From fbb04eb7835643689ea9ba455872876d7712bd49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 15 Apr 2026 18:10:07 +0200 Subject: [PATCH] Add automatic refresh of stored objects with interval support - Introduced `refreshStoredObject` logic to periodically update stored objects using `get_stored_object` API. - Updated `DocumentActionButtonsGroup.vue` and `IsCurrentlyEdited.vue` to emit refresh events and handle object updates. - Added new props to configure auto-refresh behavior, including interval and maximum execution limits. - Extended `helpers.ts` with new `get_stored_object` function for retrieving objects by UUID. --- .../document_action_buttons_group/index.ts | 5 +- .../vuejs/DocumentActionButtonsGroup.vue | 56 ++++++++++++++++++- .../StoredObjectButton/IsCurrentlyEdited.vue | 12 +++- .../vuejs/StoredObjectButton/helpers.ts | 14 +++++ 4 files changed, 81 insertions(+), 6 deletions(-) diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/module/document_action_buttons_group/index.ts b/src/Bundle/ChillDocStoreBundle/Resources/public/module/document_action_buttons_group/index.ts index 012693fac..9a713dfde 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/public/module/document_action_buttons_group/index.ts +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/module/document_action_buttons_group/index.ts @@ -46,7 +46,7 @@ window.addEventListener("DOMContentLoaded", function () { }; }, template: - '', + '', methods: { onStoredObjectStatusChange: function ( newStatus: StoredObjectStatusChange, @@ -64,6 +64,9 @@ window.addEventListener("DOMContentLoaded", function () { el.remove(); }); }, + onStoredObjectRefresh: function (newStoredObject: StoredObject) { + this.$data.storedObject = newStoredObject; + } }, }); diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentActionButtonsGroup.vue b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentActionButtonsGroup.vue index 226d748a0..e1b617af1 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentActionButtonsGroup.vue +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentActionButtonsGroup.vue @@ -18,7 +18,7 @@