diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/module/waiting_download/App.vue b/src/Bundle/ChillDocStoreBundle/Resources/public/module/waiting_download/App.vue new file mode 100644 index 000000000..873fdd2d4 --- /dev/null +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/module/waiting_download/App.vue @@ -0,0 +1,106 @@ + + + diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/module/waiting_download/index.ts b/src/Bundle/ChillDocStoreBundle/Resources/public/module/waiting_download/index.ts new file mode 100644 index 000000000..c2196a98e --- /dev/null +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/module/waiting_download/index.ts @@ -0,0 +1,22 @@ +import { createApp } from "vue"; +import App from "./App.vue"; + +const elements = document.querySelectorAll( + "[data-wait-download-stored-object]" +); + +elements.forEach((el) => { + const storedObjectUuid = el.dataset.storedObjectUuid as string; + const waitingText = el.dataset.waitingText as string; + const stoppedText = el.dataset.stoppedText as string; + const failureText = el.dataset.failureText as string; + const readyText = el.dataset.readyText as string; + + createApp(App, { + storedObjectUuid, + waitingText, + stoppedText, + failureText, + readyText, + }).mount(el); +}); diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/types/index.ts b/src/Bundle/ChillDocStoreBundle/Resources/public/types/index.ts index 4213d971a..eb9a74768 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/public/types/index.ts +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/types/index.ts @@ -3,6 +3,13 @@ import { SignedUrlGet } from "ChillDocStoreAssets/vuejs/StoredObjectButton/helpe export type StoredObjectStatus = "empty" | "ready" | "failure" | "pending"; +export interface StoredObjectReady { + id: number; + title: string; + status: StoredObjectStatus; + type: string; +} + export interface StoredObject { id: number; title: string | null; diff --git a/src/Bundle/ChillDocStoreBundle/chill.webpack.config.js b/src/Bundle/ChillDocStoreBundle/chill.webpack.config.js index a44812a0e..9aac9f44e 100644 --- a/src/Bundle/ChillDocStoreBundle/chill.webpack.config.js +++ b/src/Bundle/ChillDocStoreBundle/chill.webpack.config.js @@ -18,4 +18,8 @@ module.exports = function (encore) { "vue_document_signature", __dirname + "/Resources/public/vuejs/DocumentSignature/index", ); + encore.addEntry( + "page_wait_download_stored_object", + __dirname + "/Resources/public/module/waiting_download/index.ts", + ); };