From c7c82118ff7181445e690a9fca9bf7f7bdc003eb Mon Sep 17 00:00:00 2001 From: Olivia Guyot Date: Mon, 10 Jun 2024 11:13:02 +0200 Subject: [PATCH] feat(ME): adapt save status labels in top-toolbar --- .../top-toolbar/top-toolbar.component.html | 12 ++++++------ .../top-toolbar/top-toolbar.component.spec.ts | 6 +++--- .../top-toolbar/top-toolbar.component.ts | 18 ++++++++---------- translations/de.json | 6 +++--- translations/en.json | 6 +++--- translations/es.json | 6 +++--- translations/fr.json | 6 +++--- translations/it.json | 6 +++--- translations/nl.json | 6 +++--- translations/pt.json | 6 +++--- translations/sk.json | 6 +++--- 11 files changed, 41 insertions(+), 43 deletions(-) diff --git a/apps/metadata-editor/src/app/edit/components/top-toolbar/top-toolbar.component.html b/apps/metadata-editor/src/app/edit/components/top-toolbar/top-toolbar.component.html index 177c9d3bf1..aab1948240 100644 --- a/apps/metadata-editor/src/app/edit/components/top-toolbar/top-toolbar.component.html +++ b/apps/metadata-editor/src/app/edit/components/top-toolbar/top-toolbar.component.html @@ -15,27 +15,27 @@ class="grow flex flex-row items-center justify-center gap-1 text-[14px]" [ngSwitch]="saveStatus$ | async" > - + check_circle - editor.record.saveStatus.notPublishedYet + editor.record.saveStatus.asDraftOnly - + check_circle - editor.record.saveStatus.publishedUpToDate + editor.record.saveStatus.recordUpToDate - + pending - editor.record.saveStatus.publishedChangesPending + editor.record.saveStatus.draftWithChangesPending diff --git a/apps/metadata-editor/src/app/edit/components/top-toolbar/top-toolbar.component.spec.ts b/apps/metadata-editor/src/app/edit/components/top-toolbar/top-toolbar.component.spec.ts index 6f7ad48d9f..5c37c3f73f 100644 --- a/apps/metadata-editor/src/app/edit/components/top-toolbar/top-toolbar.component.spec.ts +++ b/apps/metadata-editor/src/app/edit/components/top-toolbar/top-toolbar.component.spec.ts @@ -66,7 +66,7 @@ describe('TopToolbarComponent', () => { editorFacade.changedSinceSave$.next(true) }) it('sets the correct status', () => { - expect(saveStatus).toBe('saved_not_published') + expect(saveStatus).toBe('draft_only') }) }) describe('saved, published and up to date', () => { @@ -75,7 +75,7 @@ describe('TopToolbarComponent', () => { editorFacade.changedSinceSave$.next(false) }) it('sets the correct status', () => { - expect(saveStatus).toBe('saved_published_up_to_date') + expect(saveStatus).toBe('record_up_to_date') }) }) describe('saved, published, pending changes', () => { @@ -84,7 +84,7 @@ describe('TopToolbarComponent', () => { editorFacade.changedSinceSave$.next(true) }) it('sets the correct status', () => { - expect(saveStatus).toBe('saved_published_changes_pending') + expect(saveStatus).toBe('draft_changes_pending') }) }) }) diff --git a/apps/metadata-editor/src/app/edit/components/top-toolbar/top-toolbar.component.ts b/apps/metadata-editor/src/app/edit/components/top-toolbar/top-toolbar.component.ts index 685820ca1c..36e6cba0e3 100644 --- a/apps/metadata-editor/src/app/edit/components/top-toolbar/top-toolbar.component.ts +++ b/apps/metadata-editor/src/app/edit/components/top-toolbar/top-toolbar.component.ts @@ -24,13 +24,13 @@ import { TranslateModule } from '@ngx-translate/core' }) export class TopToolbarComponent { protected SaveStatus = [ - 'saved_not_published', - 'saved_published_up_to_date', - 'saved_published_changes_pending', - // these are not used since the draft is saved locally + 'draft_only', // => when creating a record + 'record_up_to_date', // => when the record was just published (ie saved on the server) + 'draft_changes_pending', // => when the record was modified and not yet published + // these are not used since the draft is saved locally in a synchronous way // TODO: use these states when the draft is saved on the server - // 'saving', - // 'saving_failed', + // 'draft_saving', + // 'draft_saving_failed', ] as const protected saveStatus$: Observable = @@ -40,11 +40,9 @@ export class TopToolbarComponent { ]).pipe( map(([alreadySavedOnce, changedSinceSave]) => { if (!alreadySavedOnce) { - return 'saved_not_published' + return 'draft_only' } - return changedSinceSave - ? 'saved_published_changes_pending' - : 'saved_published_up_to_date' + return changedSinceSave ? 'draft_changes_pending' : 'record_up_to_date' }) ) diff --git a/translations/de.json b/translations/de.json index b69fa8d75e..822d224de6 100644 --- a/translations/de.json +++ b/translations/de.json @@ -168,9 +168,9 @@ "editor.record.publishError.title": "", "editor.record.publishSuccess.body": "", "editor.record.publishSuccess.title": "", - "editor.record.saveStatus.notPublishedYet": "", - "editor.record.saveStatus.publishedChangesPending": "", - "editor.record.saveStatus.publishedUpToDate": "", + "editor.record.saveStatus.asDraftOnly": "", + "editor.record.saveStatus.draftWithChangesPending": "", + "editor.record.saveStatus.recordUpToDate": "", "editor.record.upToDate": "", "externalviewer.dataset.unnamed": "Datensatz aus dem Datahub", "facets.block.title.OrgForResource": "Organisation", diff --git a/translations/en.json b/translations/en.json index 46cf50b189..53e231e70e 100644 --- a/translations/en.json +++ b/translations/en.json @@ -168,9 +168,9 @@ "editor.record.publishError.title": "Error publishing record", "editor.record.publishSuccess.body": "The record was successfully published!", "editor.record.publishSuccess.title": "Publish success", - "editor.record.saveStatus.notPublishedYet": "Saved automatically - not published yet", - "editor.record.saveStatus.publishedChangesPending": "Saved automatically - changes are pending", - "editor.record.saveStatus.publishedUpToDate": "Saved automatically - up to date", + "editor.record.saveStatus.asDraftOnly": "Saved as draft only - not published yet", + "editor.record.saveStatus.draftWithChangesPending": "Saved as draft - changes are pending", + "editor.record.saveStatus.recordUpToDate": "Record is up to date", "editor.record.upToDate": "This record is up to date", "externalviewer.dataset.unnamed": "Datahub layer", "facets.block.title.OrgForResource": "Organisation", diff --git a/translations/es.json b/translations/es.json index b97d26f87d..384aa3cba3 100644 --- a/translations/es.json +++ b/translations/es.json @@ -168,9 +168,9 @@ "editor.record.publishError.title": "", "editor.record.publishSuccess.body": "", "editor.record.publishSuccess.title": "", - "editor.record.saveStatus.notPublishedYet": "", - "editor.record.saveStatus.publishedChangesPending": "", - "editor.record.saveStatus.publishedUpToDate": "", + "editor.record.saveStatus.asDraftOnly": "", + "editor.record.saveStatus.draftWithChangesPending": "", + "editor.record.saveStatus.recordUpToDate": "", "editor.record.upToDate": "", "externalviewer.dataset.unnamed": "", "facets.block.title.OrgForResource": "", diff --git a/translations/fr.json b/translations/fr.json index f261c88d23..8dc865f38f 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -168,9 +168,9 @@ "editor.record.publishError.title": "", "editor.record.publishSuccess.body": "", "editor.record.publishSuccess.title": "", - "editor.record.saveStatus.notPublishedYet": "Enregistrement automatique - non publiée", - "editor.record.saveStatus.publishedChangesPending": "Enregistrement automatique - publiée, modifications en cours", - "editor.record.saveStatus.publishedUpToDate": "Enregistrement automatique - publiée et à jour", + "editor.record.saveStatus.asDraftOnly": "Brouillon enregistré - fiche non publiée", + "editor.record.saveStatus.draftWithChangesPending": "Brouillon enregistré - modifications en cours", + "editor.record.saveStatus.recordUpToDate": "La fiche publiée est à jour", "editor.record.upToDate": "", "externalviewer.dataset.unnamed": "Couche du datahub", "facets.block.title.OrgForResource": "Organisation", diff --git a/translations/it.json b/translations/it.json index f888a494f3..34ec4c3674 100644 --- a/translations/it.json +++ b/translations/it.json @@ -168,9 +168,9 @@ "editor.record.publishError.title": "", "editor.record.publishSuccess.body": "", "editor.record.publishSuccess.title": "", - "editor.record.saveStatus.notPublishedYet": "", - "editor.record.saveStatus.publishedChangesPending": "", - "editor.record.saveStatus.publishedUpToDate": "", + "editor.record.saveStatus.asDraftOnly": "", + "editor.record.saveStatus.draftWithChangesPending": "", + "editor.record.saveStatus.recordUpToDate": "", "editor.record.upToDate": "", "externalviewer.dataset.unnamed": "Layer del datahub", "facets.block.title.OrgForResource": "Organizzazione", diff --git a/translations/nl.json b/translations/nl.json index 47c6813e07..98078f8718 100644 --- a/translations/nl.json +++ b/translations/nl.json @@ -168,9 +168,9 @@ "editor.record.publishError.title": "", "editor.record.publishSuccess.body": "", "editor.record.publishSuccess.title": "", - "editor.record.saveStatus.notPublishedYet": "", - "editor.record.saveStatus.publishedChangesPending": "", - "editor.record.saveStatus.publishedUpToDate": "", + "editor.record.saveStatus.asDraftOnly": "", + "editor.record.saveStatus.draftWithChangesPending": "", + "editor.record.saveStatus.recordUpToDate": "", "editor.record.upToDate": "", "externalviewer.dataset.unnamed": "", "facets.block.title.OrgForResource": "", diff --git a/translations/pt.json b/translations/pt.json index 7ad73e8e67..46a680eb6e 100644 --- a/translations/pt.json +++ b/translations/pt.json @@ -168,9 +168,9 @@ "editor.record.publishError.title": "", "editor.record.publishSuccess.body": "", "editor.record.publishSuccess.title": "", - "editor.record.saveStatus.notPublishedYet": "", - "editor.record.saveStatus.publishedChangesPending": "", - "editor.record.saveStatus.publishedUpToDate": "", + "editor.record.saveStatus.asDraftOnly": "", + "editor.record.saveStatus.draftWithChangesPending": "", + "editor.record.saveStatus.recordUpToDate": "", "editor.record.upToDate": "", "externalviewer.dataset.unnamed": "", "facets.block.title.OrgForResource": "", diff --git a/translations/sk.json b/translations/sk.json index 325e63732c..02131776ed 100644 --- a/translations/sk.json +++ b/translations/sk.json @@ -168,9 +168,9 @@ "editor.record.publishError.title": "", "editor.record.publishSuccess.body": "", "editor.record.publishSuccess.title": "", - "editor.record.saveStatus.notPublishedYet": "", - "editor.record.saveStatus.publishedChangesPending": "", - "editor.record.saveStatus.publishedUpToDate": "", + "editor.record.saveStatus.asDraftOnly": "", + "editor.record.saveStatus.draftWithChangesPending": "", + "editor.record.saveStatus.recordUpToDate": "", "editor.record.upToDate": "", "externalviewer.dataset.unnamed": "", "facets.block.title.OrgForResource": "Organizácia",