From d9cd3a0b1d902c70ba1692e7723eae4f62fafe87 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Wed, 20 Dec 2023 14:30:11 +0100 Subject: [PATCH] add files for manipulating tabs from feature-30660 --- application/config/Events.php | 14 ++++++ application/core/CI3_Events.php | 51 ++++++++++++++++++++ public/js/components/Tabs.js | 85 +++++++++++++++++++++++++++++++++ 3 files changed, 150 insertions(+) create mode 100644 application/config/Events.php create mode 100644 application/core/CI3_Events.php create mode 100644 public/js/components/Tabs.js diff --git a/application/config/Events.php b/application/config/Events.php new file mode 100644 index 000000000..191a1eb98 --- /dev/null +++ b/application/config/Events.php @@ -0,0 +1,14 @@ + 'TEST', + 'component' => './Stv/Studentenverwaltung/Details/Notizen.js' + ]; + }); + */ diff --git a/application/core/CI3_Events.php b/application/core/CI3_Events.php new file mode 100644 index 000000000..33a96b89e --- /dev/null +++ b/application/core/CI3_Events.php @@ -0,0 +1,51 @@ + CoreRESTClient.getData(result.data)) + .then(result => { + const tabs = {}; + // TODO(chris): check if result is array + Object.entries(result).forEach(([key, config]) => { + if (!config.component) + return console.error('Component missing for ' + key); + + tabs[key] = { + component: Vue.defineAsyncComponent(() => import(config.component)), + title: config.title || key, + config: config.config, + key + } + }); + if (tabs[this.default]) + this.current = this.default; + else + this.current = Object.keys(tabs)[0]; + this.tabs = tabs; + }) + .catch(this.$fhcAlert.handleSystemError); + }, + template: ` +
+ +
+ + + +
+
` +}; \ No newline at end of file