Allow to set values per line in the enum field

This commit is contained in:
soupette 2019-03-25 12:36:04 +01:00
parent 2b4396151c
commit cde09a20e8
18 changed files with 36 additions and 36 deletions

View File

@ -138,7 +138,7 @@ export function getDataSucceeded({ allModels, models }, connections) {
} }
export function onChangeExistingContentTypeMainInfos({ target }) { export function onChangeExistingContentTypeMainInfos({ target }) {
const value = target.name === 'name' ? camelCase(target.value.trim()).toLowerCase() : target.value.trim(); const value = target.name === 'name' ? camelCase(target.value.trim()).toLowerCase() : target.value;
return { return {
type: ON_CHANGE_EXISTING_CONTENT_TYPE_MAIN_INFOS, type: ON_CHANGE_EXISTING_CONTENT_TYPE_MAIN_INFOS,
@ -148,7 +148,7 @@ export function onChangeExistingContentTypeMainInfos({ target }) {
} }
export function onChangeNewContentTypeMainInfos({ target }) { export function onChangeNewContentTypeMainInfos({ target }) {
const value = target.name === 'name' ? camelCase(target.value.trim()).toLowerCase() : target.value.trim(); const value = target.name === 'name' ? camelCase(target.value.trim()).toLowerCase() : target.value;
return { return {
type: ON_CHANGE_NEW_CONTENT_TYPE_MAIN_INFOS, type: ON_CHANGE_NEW_CONTENT_TYPE_MAIN_INFOS,
@ -307,7 +307,7 @@ export function updateTempContentType() {
export const buildModelAttributes = attributes => { export const buildModelAttributes = attributes => {
const formattedAttributes = attributes.reduce((acc, current) => { const formattedAttributes = attributes.reduce((acc, current) => {
if (current.params.type === 'enumeration') { if (current.params.type === 'enumeration') {
acc[current.name] = Object.assign(current.params, { enum: current.params.enum.join(',') }); acc[current.name] = Object.assign(current.params, { enum: current.params.enum.join('\n') });
} else if (current.params.nature === 'oneWay') { } else if (current.params.nature === 'oneWay') {
acc[current.name] = Object.assign(current.params, { key: '-' }); acc[current.name] = Object.assign(current.params, { key: '-' });
} else { } else {
@ -338,7 +338,7 @@ export const formatModelAttributes = attributes =>
acc2.params.pluginValue = value; acc2.params.pluginValue = value;
acc2.params.plugin = true; acc2.params.plugin = true;
} else if (curr === 'enum') { } else if (curr === 'enum') {
acc2.params.enum = value.split(','); acc2.params.enum = value.split('\n');
} else { } else {
acc2.params[curr] = value; acc2.params[curr] = value;
} }

View File

@ -110,7 +110,7 @@ describe('Content Type Builder Action utils', () => {
}, },
test: { test: {
type: 'enumeration', type: 'enumeration',
enum: 'test,test1', enum: 'test\ntest1',
}, },
otherTest: { otherTest: {
columnName: '', columnName: '',
@ -220,7 +220,7 @@ describe('Content Type Builder Action utils', () => {
}, },
otherTest: { otherTest: {
type: 'enumeration', type: 'enumeration',
enum: 'test,test1', enum: 'test\ntest1',
}, },
}; };
@ -448,7 +448,7 @@ describe('App actions', () => {
const e = { const e = {
target: { target: {
name: 'test', name: 'test',
value: 'testWith spaces and stuff ', value: 'testWith spaces and stuff',
}, },
}; };
const expected = { const expected = {
@ -482,7 +482,7 @@ describe('App actions', () => {
const e = { const e = {
target: { target: {
name: 'test', name: 'test',
value: 'testWith spaces and stuff ', value: 'testWith spaces and stuff',
}, },
}; };
const expected = { const expected = {

View File

@ -41,7 +41,7 @@
"form.attribute.item.enumeration.graphql.description": "يسمح لك بتجاوز الاسم الذي تم إنشاؤه افتراضيًا لـ GraphQL", "form.attribute.item.enumeration.graphql.description": "يسمح لك بتجاوز الاسم الذي تم إنشاؤه افتراضيًا لـ GraphQL",
"form.attribute.item.enumeration.name": "أسم", "form.attribute.item.enumeration.name": "أسم",
"form.attribute.item.enumeration.placeholder": "مثال: صباح,قمر,احداث", "form.attribute.item.enumeration.placeholder": "مثال: صباح,قمر,احداث",
"form.attribute.item.enumeration.rules": "قيم ( مقسمة بإستخدام الفاصلة )", "form.attribute.item.enumeration.rules": "Values (one line per value)",
"form.attribute.item.json.name": "الأسم", "form.attribute.item.json.name": "الأسم",
"form.attribute.item.maximum": "اقصى قيمة", "form.attribute.item.maximum": "اقصى قيمة",
"form.attribute.item.maximumLength": "أقصى طول", "form.attribute.item.maximumLength": "أقصى طول",
@ -155,4 +155,4 @@
"table.contentType.head.name": "اسم", "table.contentType.head.name": "اسم",
"table.contentType.title.plural": "أنواع المحتوى متاحة", "table.contentType.title.plural": "أنواع المحتوى متاحة",
"table.contentType.title.singular": "نوع المحتوى متاح" "table.contentType.title.singular": "نوع المحتوى متاح"
} }

View File

@ -41,7 +41,7 @@
"form.attribute.item.enumeration.graphql.description": "Ermöglicht dir, den standardmäßig generierten Namen für GraphQL zu überschreiben", "form.attribute.item.enumeration.graphql.description": "Ermöglicht dir, den standardmäßig generierten Namen für GraphQL zu überschreiben",
"form.attribute.item.enumeration.name": "Name", "form.attribute.item.enumeration.name": "Name",
"form.attribute.item.enumeration.placeholder": "Ex: Morgen, Mittag, Abend", "form.attribute.item.enumeration.placeholder": "Ex: Morgen, Mittag, Abend",
"form.attribute.item.enumeration.rules": "Werte (trenne sie mit einem Komma)", "form.attribute.item.enumeration.rules": "Values (one line per value)",
"form.attribute.item.json.name": "Name", "form.attribute.item.json.name": "Name",
"form.attribute.item.maximum": "Maximalwert", "form.attribute.item.maximum": "Maximalwert",
"form.attribute.item.maximumLength": "Maximallänge", "form.attribute.item.maximumLength": "Maximallänge",
@ -154,4 +154,4 @@
"table.contentType.head.name": "Name", "table.contentType.head.name": "Name",
"table.contentType.title.plural": "Inhaltstypen sind verfügbar", "table.contentType.title.plural": "Inhaltstypen sind verfügbar",
"table.contentType.title.singular": "Inhaltstyp ist verfügbar" "table.contentType.title.singular": "Inhaltstyp ist verfügbar"
} }

View File

@ -42,7 +42,7 @@
"form.attribute.item.enumeration.graphql.description": "Allows you to override the default generated name for GraphQL", "form.attribute.item.enumeration.graphql.description": "Allows you to override the default generated name for GraphQL",
"form.attribute.item.enumeration.name": "Name", "form.attribute.item.enumeration.name": "Name",
"form.attribute.item.enumeration.placeholder": "Ex: morning,noon,evening", "form.attribute.item.enumeration.placeholder": "Ex: morning,noon,evening",
"form.attribute.item.enumeration.rules": "Values (separate them with a comma)", "form.attribute.item.enumeration.rules": "Values (one line per value)",
"form.attribute.item.json.name": "Name", "form.attribute.item.json.name": "Name",
"form.attribute.item.maximum": "Maximum value", "form.attribute.item.maximum": "Maximum value",
"form.attribute.item.maximumLength": "Maximum length", "form.attribute.item.maximumLength": "Maximum length",

View File

@ -41,7 +41,7 @@
"form.attribute.item.enumeration.graphql.description": "Le permite redefinir el nombre generado por defecto para GraphQL", "form.attribute.item.enumeration.graphql.description": "Le permite redefinir el nombre generado por defecto para GraphQL",
"form.attribute.item.enumeration.name": "Nombre", "form.attribute.item.enumeration.name": "Nombre",
"form.attribute.item.enumeration.placeholder": "Ej: mañana, mediodía, noche", "form.attribute.item.enumeration.placeholder": "Ej: mañana, mediodía, noche",
"form.attribute.item.enumeration.rules": "Valores (separados con una coma)", "form.attribute.item.enumeration.rules": "Values (one line per value)",
"form.attribute.item.json.name": "Nombre", "form.attribute.item.json.name": "Nombre",
"form.attribute.item.maximum": "Valor máximo", "form.attribute.item.maximum": "Valor máximo",
"form.attribute.item.maximumLength": "Longitud máxima", "form.attribute.item.maximumLength": "Longitud máxima",
@ -154,4 +154,4 @@
"table.contentType.head.name": "Nombre", "table.contentType.head.name": "Nombre",
"table.contentType.title.plural": "Tipos de Contenido disponibles", "table.contentType.title.plural": "Tipos de Contenido disponibles",
"table.contentType.title.singular": "Tipo de contenido está disponible" "table.contentType.title.singular": "Tipo de contenido está disponible"
} }

View File

@ -41,7 +41,7 @@
"form.attribute.item.enumeration.graphql.description": "Vous permet de remplacer le nom généré par défaut pour GraphQL", "form.attribute.item.enumeration.graphql.description": "Vous permet de remplacer le nom généré par défaut pour GraphQL",
"form.attribute.item.enumeration.name": "Nom", "form.attribute.item.enumeration.name": "Nom",
"form.attribute.item.enumeration.placeholder": "Ex : matin,midi,soir", "form.attribute.item.enumeration.placeholder": "Ex : matin,midi,soir",
"form.attribute.item.enumeration.rules": "Valeurs (les séparer par une virgule)", "form.attribute.item.enumeration.rules": "Valeurs (les séparer par une nouvelle ligne)",
"form.attribute.item.json.name": "Nom", "form.attribute.item.json.name": "Nom",
"form.attribute.item.maximum": "Valeur maximum", "form.attribute.item.maximum": "Valeur maximum",
"form.attribute.item.maximumLength": "Taille maximum", "form.attribute.item.maximumLength": "Taille maximum",

View File

@ -41,7 +41,7 @@
"form.attribute.item.enumeration.graphql.description": "Consente di ignorare l'impostazione predefinita generata nome per GraphQL", "form.attribute.item.enumeration.graphql.description": "Consente di ignorare l'impostazione predefinita generata nome per GraphQL",
"form.attribute.item.enumeration.name": "Nome", "form.attribute.item.enumeration.name": "Nome",
"form.attribute.item.enumeration.placeholder": "Ex: mattina,mezzogiorno,sera", "form.attribute.item.enumeration.placeholder": "Ex: mattina,mezzogiorno,sera",
"form.attribute.item.enumeration.rules": "Valori (separati da una virgola)", "form.attribute.item.enumeration.rules": "Values (one line per value)",
"form.attribute.item.json.name": "Nome", "form.attribute.item.json.name": "Nome",
"form.attribute.item.maximum": "Valore massimo", "form.attribute.item.maximum": "Valore massimo",
"form.attribute.item.maximumLength": "Lunghezza massima", "form.attribute.item.maximumLength": "Lunghezza massima",
@ -154,4 +154,4 @@
"table.contentType.head.name": "Nome", "table.contentType.head.name": "Nome",
"table.contentType.title.plural": "I Tipi di contenuto sono disponibili", "table.contentType.title.plural": "I Tipi di contenuto sono disponibili",
"table.contentType.title.singular": "Il Tipo di contenuto è disponibile" "table.contentType.title.singular": "Il Tipo di contenuto è disponibile"
} }

View File

@ -41,7 +41,7 @@
"form.attribute.item.enumeration.graphql.description": "GraphQLの既定の生成名をオーバーライドできます", "form.attribute.item.enumeration.graphql.description": "GraphQLの既定の生成名をオーバーライドできます",
"form.attribute.item.enumeration.name": "名前", "form.attribute.item.enumeration.name": "名前",
"form.attribute.item.enumeration.placeholder": "例:朝、正午、夕方", "form.attribute.item.enumeration.placeholder": "例:朝、正午、夕方",
"form.attribute.item.enumeration.rules": "値 (カンマ区切り)", "form.attribute.item.enumeration.rules": "Values (one line per value)",
"form.attribute.item.json.name": "名前", "form.attribute.item.json.name": "名前",
"form.attribute.item.maximum": "最大値", "form.attribute.item.maximum": "最大値",
"form.attribute.item.maximumLength": "最大長", "form.attribute.item.maximumLength": "最大長",
@ -154,4 +154,4 @@
"table.contentType.head.name": "名前", "table.contentType.head.name": "名前",
"table.contentType.title.plural": "個のコンテンツタイプが利用できます。", "table.contentType.title.plural": "個のコンテンツタイプが利用できます。",
"table.contentType.title.singular": "コンテンツタイプは利用可能です" "table.contentType.title.singular": "コンテンツタイプは利用可能です"
} }

View File

@ -41,7 +41,7 @@
"form.attribute.item.enumeration.graphql.description": "기본 생성된 이름을 GraphQL에서 사용합니다.", "form.attribute.item.enumeration.graphql.description": "기본 생성된 이름을 GraphQL에서 사용합니다.",
"form.attribute.item.enumeration.name": "이름", "form.attribute.item.enumeration.name": "이름",
"form.attribute.item.enumeration.placeholder": "Ex: morning,noon,evening", "form.attribute.item.enumeration.placeholder": "Ex: morning,noon,evening",
"form.attribute.item.enumeration.rules": "값 (쉼표로 구분)", "form.attribute.item.enumeration.rules": "Values (one line per value)",
"form.attribute.item.json.name": "이름", "form.attribute.item.json.name": "이름",
"form.attribute.item.maximum": "최대 값", "form.attribute.item.maximum": "최대 값",
"form.attribute.item.maximumLength": "최대 길이", "form.attribute.item.maximumLength": "최대 길이",
@ -154,4 +154,4 @@
"table.contentType.head.name": "이름", "table.contentType.head.name": "이름",
"table.contentType.title.plural": "개의 콘텐츠 타입이 있습니다.", "table.contentType.title.plural": "개의 콘텐츠 타입이 있습니다.",
"table.contentType.title.singular": "개의 콘텐츠 타입이 있습니다." "table.contentType.title.singular": "개의 콘텐츠 타입이 있습니다."
} }

View File

@ -41,7 +41,7 @@
"form.attribute.item.enumeration.graphql.description": "Zorgt ervoor dat je de standaard gegenereerde naam voor GraphQL kan overschrijven", "form.attribute.item.enumeration.graphql.description": "Zorgt ervoor dat je de standaard gegenereerde naam voor GraphQL kan overschrijven",
"form.attribute.item.enumeration.name": "Naam", "form.attribute.item.enumeration.name": "Naam",
"form.attribute.item.enumeration.placeholder": "Bijv.: ochtend,middag,avond", "form.attribute.item.enumeration.placeholder": "Bijv.: ochtend,middag,avond",
"form.attribute.item.enumeration.rules": "Waardes (onderscheid ze met een komma)", "form.attribute.item.enumeration.rules": "Values (one line per value)",
"form.attribute.item.json.name": "Naam", "form.attribute.item.json.name": "Naam",
"form.attribute.item.maximum": "Maximale waarde", "form.attribute.item.maximum": "Maximale waarde",
"form.attribute.item.maximumLength": "Maximale lengte", "form.attribute.item.maximumLength": "Maximale lengte",
@ -154,4 +154,4 @@
"table.contentType.head.name": "Naam", "table.contentType.head.name": "Naam",
"table.contentType.title.plural": "Content Types zijn beschikbaar", "table.contentType.title.plural": "Content Types zijn beschikbaar",
"table.contentType.title.singular": "Content Type is beschikbaar" "table.contentType.title.singular": "Content Type is beschikbaar"
} }

View File

@ -41,7 +41,7 @@
"form.attribute.item.enumeration.graphql.description": "Pozwalaj na nadpisanie domyślnie wygenerowanej nazwy dla GraphQL.", "form.attribute.item.enumeration.graphql.description": "Pozwalaj na nadpisanie domyślnie wygenerowanej nazwy dla GraphQL.",
"form.attribute.item.enumeration.name": "Nazwa", "form.attribute.item.enumeration.name": "Nazwa",
"form.attribute.item.enumeration.placeholder": "Przykład: rano,południe,wieczór", "form.attribute.item.enumeration.placeholder": "Przykład: rano,południe,wieczór",
"form.attribute.item.enumeration.rules": "Wartości (oddzielone przecinkiem)", "form.attribute.item.enumeration.rules": "Values (one line per value)",
"form.attribute.item.json.name": "Nazwa", "form.attribute.item.json.name": "Nazwa",
"form.attribute.item.maximum": "Maksymalna wartość", "form.attribute.item.maximum": "Maksymalna wartość",
"form.attribute.item.maximumLength": "Maksymalna długość", "form.attribute.item.maximumLength": "Maksymalna długość",

View File

@ -41,7 +41,7 @@
"form.attribute.item.enumeration.graphql.description": "Permite à si a substituição do nome predefinido para o GraphQL", "form.attribute.item.enumeration.graphql.description": "Permite à si a substituição do nome predefinido para o GraphQL",
"form.attribute.item.enumeration.name": "Nome", "form.attribute.item.enumeration.name": "Nome",
"form.attribute.item.enumeration.placeholder": "Ex: manhã,tarde,noite", "form.attribute.item.enumeration.placeholder": "Ex: manhã,tarde,noite",
"form.attribute.item.enumeration.rules": "Valores (separe-os com uma vírgula)", "form.attribute.item.enumeration.rules": "Values (one line per value)",
"form.attribute.item.json.name": "Nome", "form.attribute.item.json.name": "Nome",
"form.attribute.item.maximum": "Valor máximo", "form.attribute.item.maximum": "Valor máximo",
"form.attribute.item.maximumLength": "Tamanho máximo", "form.attribute.item.maximumLength": "Tamanho máximo",
@ -154,4 +154,4 @@
"table.contentType.head.name": "Nome", "table.contentType.head.name": "Nome",
"table.contentType.title.plural": "Tipos de Conteúdos estão disponíveis", "table.contentType.title.plural": "Tipos de Conteúdos estão disponíveis",
"table.contentType.title.singular": "Tipo de Conteúdo está disponível" "table.contentType.title.singular": "Tipo de Conteúdo está disponível"
} }

View File

@ -41,7 +41,7 @@
"form.attribute.item.enumeration.graphql.description": "Permite à si a substituição do nome predefinido para o GraphQL", "form.attribute.item.enumeration.graphql.description": "Permite à si a substituição do nome predefinido para o GraphQL",
"form.attribute.item.enumeration.name": "Nome", "form.attribute.item.enumeration.name": "Nome",
"form.attribute.item.enumeration.placeholder": "Ex: manhã,tarde,noite", "form.attribute.item.enumeration.placeholder": "Ex: manhã,tarde,noite",
"form.attribute.item.enumeration.rules": "Valores (separe-os com uma vírgula)", "form.attribute.item.enumeration.rules": "Values (one line per value)",
"form.attribute.item.json.name": "Nome", "form.attribute.item.json.name": "Nome",
"form.attribute.item.maximum": "Valor máximo", "form.attribute.item.maximum": "Valor máximo",
"form.attribute.item.maximumLength": "Comprimento máximo", "form.attribute.item.maximumLength": "Comprimento máximo",
@ -154,4 +154,4 @@
"table.contentType.head.name": "Nome", "table.contentType.head.name": "Nome",
"table.contentType.title.plural": "Tipos de Conteúdos estão disponíveis", "table.contentType.title.plural": "Tipos de Conteúdos estão disponíveis",
"table.contentType.title.singular": "Tipo de Conteúdo está disponível" "table.contentType.title.singular": "Tipo de Conteúdo está disponível"
} }

View File

@ -41,7 +41,7 @@
"form.attribute.item.enumeration.graphql.description": "Позволяет переопределить название поля в GraphQL, сгенерированное по умолчанию", "form.attribute.item.enumeration.graphql.description": "Позволяет переопределить название поля в GraphQL, сгенерированное по умолчанию",
"form.attribute.item.enumeration.name": "Название", "form.attribute.item.enumeration.name": "Название",
"form.attribute.item.enumeration.placeholder": "Например: morning,noon,evening", "form.attribute.item.enumeration.placeholder": "Например: morning,noon,evening",
"form.attribute.item.enumeration.rules": "Значения (через запятую)", "form.attribute.item.enumeration.rules": "Values (one line per value)",
"form.attribute.item.json.name": "Название", "form.attribute.item.json.name": "Название",
"form.attribute.item.maximum": "Максимальное значение", "form.attribute.item.maximum": "Максимальное значение",
"form.attribute.item.maximumLength": "Максимальная длина", "form.attribute.item.maximumLength": "Максимальная длина",

View File

@ -41,7 +41,7 @@
"form.attribute.item.enumeration.graphql.description": "GraphQL için varsayılan oluşturulan adı geçersiz kılmanıza izin verir.", "form.attribute.item.enumeration.graphql.description": "GraphQL için varsayılan oluşturulan adı geçersiz kılmanıza izin verir.",
"form.attribute.item.enumeration.name": "İsim", "form.attribute.item.enumeration.name": "İsim",
"form.attribute.item.enumeration.placeholder": "Örn: sabah, öğlen, akşam", "form.attribute.item.enumeration.placeholder": "Örn: sabah, öğlen, akşam",
"form.attribute.item.enumeration.rules": "Değerler (virgülle ayırın)", "form.attribute.item.enumeration.rules": "Values (one line per value)",
"form.attribute.item.json.name": "İsim", "form.attribute.item.json.name": "İsim",
"form.attribute.item.maximum": "En yüksek değer", "form.attribute.item.maximum": "En yüksek değer",
"form.attribute.item.maximumLength": "En yüksek uzunluk", "form.attribute.item.maximumLength": "En yüksek uzunluk",
@ -154,4 +154,4 @@
"table.contentType.head.name": "İsim", "table.contentType.head.name": "İsim",
"table.contentType.title.plural": "İçerik Türleri kullanılabilir", "table.contentType.title.plural": "İçerik Türleri kullanılabilir",
"table.contentType.title.singular": "İçerik Türü kullanılabilir" "table.contentType.title.singular": "İçerik Türü kullanılabilir"
} }

View File

@ -40,7 +40,7 @@
"form.attribute.item.enumeration.graphql.description": "Allows you to override the default generated name for GraphQL", "form.attribute.item.enumeration.graphql.description": "Allows you to override the default generated name for GraphQL",
"form.attribute.item.enumeration.name": "Name", "form.attribute.item.enumeration.name": "Name",
"form.attribute.item.enumeration.placeholder": "Ex: morning,noon,evening", "form.attribute.item.enumeration.placeholder": "Ex: morning,noon,evening",
"form.attribute.item.enumeration.rules": "Values (separate them with a comma)", "form.attribute.item.enumeration.rules": "Values (one line per value)",
"form.attribute.item.json.name": "Name", "form.attribute.item.json.name": "Name",
"form.attribute.item.maximum": "最大值", "form.attribute.item.maximum": "最大值",
"form.attribute.item.maximumLength": "最大长度", "form.attribute.item.maximumLength": "最大长度",
@ -152,4 +152,4 @@
"table.contentType.head.name": "名称", "table.contentType.head.name": "名称",
"table.contentType.title.plural": "Content Types 是可用的", "table.contentType.title.plural": "Content Types 是可用的",
"table.contentType.title.singular": "Content Type 是可用的" "table.contentType.title.singular": "Content Type 是可用的"
} }

View File

@ -41,7 +41,7 @@
"form.attribute.item.enumeration.graphql.description": "可以讓您覆寫 GraphQL 的預設名稱", "form.attribute.item.enumeration.graphql.description": "可以讓您覆寫 GraphQL 的預設名稱",
"form.attribute.item.enumeration.name": "名稱", "form.attribute.item.enumeration.name": "名稱",
"form.attribute.item.enumeration.placeholder": "例: morning,noon,evening", "form.attribute.item.enumeration.placeholder": "例: morning,noon,evening",
"form.attribute.item.enumeration.rules": "選項(以半形逗號分隔)", "form.attribute.item.enumeration.rules": "Values (one line per value)",
"form.attribute.item.json.name": "名稱", "form.attribute.item.json.name": "名稱",
"form.attribute.item.maximum": "最大數值", "form.attribute.item.maximum": "最大數值",
"form.attribute.item.maximumLength": "最大長度", "form.attribute.item.maximumLength": "最大長度",
@ -154,4 +154,4 @@
"table.contentType.head.name": "名稱", "table.contentType.head.name": "名稱",
"table.contentType.title.plural": "筆資料結構", "table.contentType.title.plural": "筆資料結構",
"table.contentType.title.singular": "筆資料結構" "table.contentType.title.singular": "筆資料結構"
} }