From d9b24ce937e5d8c87ef7d4ea415e13bf6495968a Mon Sep 17 00:00:00 2001 From: Sebastian Date: Tue, 15 Jun 2021 12:52:57 +0200 Subject: [PATCH] Resolve references. --- backend/i18n/frontend_en.json | 1 + backend/i18n/frontend_it.json | 1 + backend/i18n/frontend_nl.json | 1 + backend/i18n/frontend_zh.json | 1 + backend/i18n/source/frontend_en.json | 1 + .../schema/fields/types/references-ui.component.html | 6 +++--- frontend/app/shared/state/schemas.forms.ts | 10 ++++------ 7 files changed, 12 insertions(+), 9 deletions(-) diff --git a/backend/i18n/frontend_en.json b/backend/i18n/frontend_en.json index e3f423bc4..d3afa743e 100644 --- a/backend/i18n/frontend_en.json +++ b/backend/i18n/frontend_en.json @@ -777,6 +777,7 @@ "schemas.fieldTypes.references.countMin": "Min Items", "schemas.fieldTypes.references.description": "Links to other content items.", "schemas.fieldTypes.references.mustBePublished": "References must be published", + "schemas.fieldTypes.references.resolve": "Resolve references", "schemas.fieldTypes.references.resolveHint": "Show the name of the referenced item in content list when MaxItems is set to 1.", "schemas.fieldTypes.string.characters": "Characters", "schemas.fieldTypes.string.charactersMax": "Max Characters", diff --git a/backend/i18n/frontend_it.json b/backend/i18n/frontend_it.json index ed5883010..b831f70ea 100644 --- a/backend/i18n/frontend_it.json +++ b/backend/i18n/frontend_it.json @@ -777,6 +777,7 @@ "schemas.fieldTypes.references.countMin": "Numero Min Elementi", "schemas.fieldTypes.references.description": "Link ad altri elementi del contenuto.", "schemas.fieldTypes.references.mustBePublished": "I contenuti collegati devono essere pubblicati", + "schemas.fieldTypes.references.resolve": "Resolve references", "schemas.fieldTypes.references.resolveHint": "Mostra il nome dell'elemento collegato (riferimento) nella lista dei contenuti quando il numero massimo di elementi è impostato a 1.", "schemas.fieldTypes.string.characters": "Caratteri", "schemas.fieldTypes.string.charactersMax": "Max numero di Caratteri", diff --git a/backend/i18n/frontend_nl.json b/backend/i18n/frontend_nl.json index 86a95187a..0ec83baca 100644 --- a/backend/i18n/frontend_nl.json +++ b/backend/i18n/frontend_nl.json @@ -777,6 +777,7 @@ "schemas.fieldTypes.references.countMin": "Min. items", "schemas.fieldTypes.references.description": "Links naar andere inhoudsitems.", "schemas.fieldTypes.references.mustBePublished": "References must be published", + "schemas.fieldTypes.references.resolve": "Resolve references", "schemas.fieldTypes.references.resolveHint": "Toon de naam van het item waarnaar wordt verwezen in de inhoudslijst wanneer MaxItems is ingesteld op 1.", "schemas.fieldTypes.string.characters": "Karakters", "schemas.fieldTypes.string.charactersMax": "Max. karakters", diff --git a/backend/i18n/frontend_zh.json b/backend/i18n/frontend_zh.json index dc7c2f285..b5afad968 100644 --- a/backend/i18n/frontend_zh.json +++ b/backend/i18n/frontend_zh.json @@ -777,6 +777,7 @@ "schemas.fieldTypes.references.countMin": "最小项目", "schemas.fieldTypes.references.description": "链接到其他内容项。", "schemas.fieldTypes.references.mustBePublished": "必须发布参考文献", + "schemas.fieldTypes.references.resolve": "Resolve references", "schemas.fieldTypes.references.resolveHint": "当 MaxItems 设置为 1 时,在内容列表中显示引用项的名称。", "schemas.fieldTypes.string.characters": "字符", "schemas.fieldTypes.string.charactersMax": "最大字符数", diff --git a/backend/i18n/source/frontend_en.json b/backend/i18n/source/frontend_en.json index e3f423bc4..d3afa743e 100644 --- a/backend/i18n/source/frontend_en.json +++ b/backend/i18n/source/frontend_en.json @@ -777,6 +777,7 @@ "schemas.fieldTypes.references.countMin": "Min Items", "schemas.fieldTypes.references.description": "Links to other content items.", "schemas.fieldTypes.references.mustBePublished": "References must be published", + "schemas.fieldTypes.references.resolve": "Resolve references", "schemas.fieldTypes.references.resolveHint": "Show the name of the referenced item in content list when MaxItems is set to 1.", "schemas.fieldTypes.string.characters": "Characters", "schemas.fieldTypes.string.charactersMax": "Max Characters", diff --git a/frontend/app/features/schemas/pages/schema/fields/types/references-ui.component.html b/frontend/app/features/schemas/pages/schema/fields/types/references-ui.component.html index df28d904a..4fc469e57 100644 --- a/frontend/app/features/schemas/pages/schema/fields/types/references-ui.component.html +++ b/frontend/app/features/schemas/pages/schema/fields/types/references-ui.component.html @@ -16,9 +16,9 @@
- -
diff --git a/frontend/app/shared/state/schemas.forms.ts b/frontend/app/shared/state/schemas.forms.ts index 3b2ea701c..62bfc3f4b 100644 --- a/frontend/app/shared/state/schemas.forms.ts +++ b/frontend/app/shared/state/schemas.forms.ts @@ -316,15 +316,13 @@ export class EditFieldFormVisitor implements FieldPropertiesVisitor { public visitReferences() { this.config['allowDuplicates'] = undefined; + this.config['defaultValue'] = undefined; + this.config['defaultValues'] = undefined; this.config['maxItems'] = undefined; this.config['minItems'] = undefined; + this.config['mustBePublished'] = false; + this.config['resolveReference'] = false; this.config['schemaIds'] = undefined; - this.config['defaultValue'] = undefined; - this.config['defaultValues'] = undefined; - this.config['mustBePublished'] = undefined; - this.config['defaultValues'] = undefined; - this.config['defaultValues'] = undefined; - this.config['defaultValues'] = undefined; } public visitString() {