From 1d708a481d4685d1eaccde942b4ff7eea4739f2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 21 Oct 2024 16:55:11 +0200 Subject: [PATCH] Fix the display of old documents in the storedobject's history list modal OP#737 https://champs-libres.openproject.com/work_packages/737 --- .../vuejs/StoredObjectButton/DownloadButton.vue | 4 ++-- .../HistoryButton/HistoryButtonList.vue | 1 - .../HistoryButton/HistoryButtonListItem.vue | 12 +++++++----- .../HistoryButton/HistoryButtonModal.vue | 1 - 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/DownloadButton.vue b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/DownloadButton.vue index ecf9055af..0e6da5ef4 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/DownloadButton.vue +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/DownloadButton.vue @@ -24,11 +24,11 @@ interface DownloadButtonConfig { * if true, display the action string into the button. If false, displays only * the icon */ - displayActionStringInButton: boolean, + displayActionStringInButton?: boolean, /** * if true, will download directly the file on load */ - directDownload: boolean, + directDownload?: boolean, } interface DownloadButtonState { diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/HistoryButton/HistoryButtonList.vue b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/HistoryButton/HistoryButtonList.vue index c7be09a44..893d85a77 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/HistoryButton/HistoryButtonList.vue +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/HistoryButton/HistoryButtonList.vue @@ -50,7 +50,6 @@ const onRestored = ({newVersion}: {newVersion: StoredObjectVersionWithPointInTim :version="v" :can-edit="canEdit" :is-current="higher_version === v.version" - :is-restored="v.version === state.restored" :stored-object="storedObject" @restore-version="onRestored" > diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/HistoryButton/HistoryButtonListItem.vue b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/HistoryButton/HistoryButtonListItem.vue index ec077540e..81436ee35 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/HistoryButton/HistoryButtonListItem.vue +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/StoredObjectButton/HistoryButton/HistoryButtonListItem.vue @@ -12,7 +12,6 @@ interface HistoryButtonListItemConfig { storedObject: StoredObject; canEdit: boolean; isCurrent: boolean; - isRestored: boolean; } const emit = defineEmits<{ @@ -31,7 +30,9 @@ const isKeptBeforeConversion = computed(() => props.version["point-in-t ), ); -const isRestored = computed(() => null !== props.version["from-restored"]); +const isRestored = computed(() => props.version.version > 0 && null !== props.version["from-restored"]); + +const isDuplicated = computed(() => props.version.version === 0 && null !== props.version["from-restored"]); const classes = computed<{row: true, 'row-hover': true, 'blinking-1': boolean, 'blinking-2': boolean}>(() => ({row: true, 'row-hover': true, 'blinking-1': props.isRestored && 0 === props.version.version % 2, 'blinking-2': props.isRestored && 1 === props.version.version % 2})); @@ -39,13 +40,14 @@ const classes = computed<{row: true, 'row-hover': true, 'blinking-1': boolean, '