diff --git a/frontend/src/app/features/content/shared/preview-button.component.ts b/frontend/src/app/features/content/shared/preview-button.component.ts index 23ce3db0b..a54c32b22 100644 --- a/frontend/src/app/features/content/shared/preview-button.component.ts +++ b/frontend/src/app/features/content/shared/preview-button.component.ts @@ -96,7 +96,6 @@ export class PreviewButtonComponent extends StatefulComponent implements const state = { ...s }; const keys = Object.keys(this.schema.previewUrls); - state.previewNameSelected = selectedName; state.previewNamesMore = keys.removed(selectedName).sorted(); diff --git a/frontend/src/app/features/content/shared/references/references-editor.component.html b/frontend/src/app/features/content/shared/references/references-editor.component.html index fc72df346..88af66e23 100644 --- a/frontend/src/app/features/content/shared/references/references-editor.component.html +++ b/frontend/src/app/features/content/shared/references/references-editor.component.html @@ -5,7 +5,7 @@
-
diff --git a/frontend/src/app/shared/state/contents.forms.spec.ts b/frontend/src/app/shared/state/contents.forms.spec.ts index 3cd202001..c5492b01f 100644 --- a/frontend/src/app/shared/state/contents.forms.spec.ts +++ b/frontend/src/app/shared/state/contents.forms.spec.ts @@ -397,6 +397,23 @@ describe('GetContentValue', () => { }); }); + it('should resolve value from invariant field as zero', () => { + const content: any = { + data: { + field1: { + iv: 0, + }, + }, + }; + + const result = getContentValue(content, language, fieldInvariant); + + expect(result).toEqual({ + value: 0, + formatted: '0', + }); + }); + it('should resolve value from localized field', () => { const content: any = { data: { diff --git a/frontend/src/app/shared/state/contents.forms.visitors.ts b/frontend/src/app/shared/state/contents.forms.visitors.ts index 90652964e..2cdd83c68 100644 --- a/frontend/src/app/shared/state/contents.forms.visitors.ts +++ b/frontend/src/app/shared/state/contents.forms.visitors.ts @@ -48,12 +48,11 @@ export function getContentValue(content: ContentDto, language: LanguageDto, fiel const actualReference = getValue(content.referenceData, language, field, true); const actualValue = getValue(content.data, language, field); - if (!actualReference && !actualValue) { + if (Types.isUndefined(actualReference) && Types.isUndefined(actualValue)) { return { value: actualValue, formatted: '' }; } const formatted = FieldFormatter.format(field, actualValue, actualReference, allowHtml); - return { value: actualValue, formatted }; }