dash-button-web 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/dash-button.cjs.entry.js +14 -5
- package/dist/cjs/dash-button.cjs.entry.js.map +1 -1
- package/dist/collection/components/my-component/dash-button.js +14 -5
- package/dist/collection/components/my-component/dash-button.js.map +1 -1
- package/dist/components/dash-button.js +14 -5
- package/dist/components/dash-button.js.map +1 -1
- package/dist/esm/dash-button.entry.js +14 -5
- package/dist/esm/dash-button.entry.js.map +1 -1
- package/dist/web-compnont/{p-89ceb862.entry.js → p-392f1e3f.entry.js} +2 -2
- package/dist/web-compnont/{p-89ceb862.entry.js.map → p-392f1e3f.entry.js.map} +1 -1
- package/dist/web-compnont/web-compnont.esm.js +1 -1
- package/package.json +1 -1
|
@@ -2519,6 +2519,8 @@ const DashButtonComponent = class {
|
|
|
2519
2519
|
const tempAppList = this.appList.map(obj => obj['shortname']);
|
|
2520
2520
|
// Check if the user has permission to access the selected application
|
|
2521
2521
|
if (appIdList.filter(id => tempAppList.includes(id)).length == 0) {
|
|
2522
|
+
// Update local storage app permission
|
|
2523
|
+
localStorage.setItem("ZDZW_app_permission", JSON.stringify(false));
|
|
2522
2524
|
// Show modal
|
|
2523
2525
|
const appErrorModal = this.el.shadowRoot.querySelector('#appPermissionErrorModal');
|
|
2524
2526
|
appErrorModal.style.display = "block";
|
|
@@ -2538,6 +2540,11 @@ const DashButtonComponent = class {
|
|
|
2538
2540
|
}, 1000);
|
|
2539
2541
|
}
|
|
2540
2542
|
}
|
|
2543
|
+
else {
|
|
2544
|
+
// The user is authenticated and has the necessary permissions
|
|
2545
|
+
// Update local storage app permission
|
|
2546
|
+
localStorage.setItem("ZDZW_app_permission", JSON.stringify(true));
|
|
2547
|
+
}
|
|
2541
2548
|
}
|
|
2542
2549
|
});
|
|
2543
2550
|
}
|
|
@@ -2581,6 +2588,8 @@ const DashButtonComponent = class {
|
|
|
2581
2588
|
// }
|
|
2582
2589
|
}
|
|
2583
2590
|
async initKeycloak() {
|
|
2591
|
+
// Remove the initiation time permission localstorage object
|
|
2592
|
+
localStorage.removeItem("ZDZW_app_permission");
|
|
2584
2593
|
await this.keycloak.init({
|
|
2585
2594
|
onLoad: this.authMethod,
|
|
2586
2595
|
checkLoginIframe: false,
|
|
@@ -2622,19 +2631,19 @@ const DashButtonComponent = class {
|
|
|
2622
2631
|
appModal.style.display = "none";
|
|
2623
2632
|
}
|
|
2624
2633
|
render() {
|
|
2625
|
-
return index.h("div", { key: '
|
|
2634
|
+
return index.h("div", { key: '45d3cee1eb5857f688bf82eccfa5fcf31ec0e649' }, index.h("div", { key: '2e0fbfe2fd3e969f03d31eba64732407abc9319f' }, (() => {
|
|
2626
2635
|
if (this.isAuth && this.showPostLoginText) {
|
|
2627
2636
|
return (index.h("a", { href: this.redirectUri, id: "login-btn", class: "button button-link" }, index.h("span", { class: "button-text button-text-full-width" }, "Go to Dashboard")));
|
|
2628
2637
|
}
|
|
2629
2638
|
else if (this.isAuth) {
|
|
2630
|
-
return (index.h("div", { id: "profile-btn", class: "dropdown" }, index.h("button", { type: "button", class: "button" }, index.h("span", { class: "button-profile" }, index.h("img", { src: "https://i.pravatar.cc/100?img=32", alt: "" })), index.h("span", { id: "given-name", class: "button-text" }, this.givenName), index.h("div", { class: "button-icon" }, index.h("span", { class: "gg-menu-grid-r" }))), index.h("div", { class: "dropdown-content" }, index.h("a", { onClick: this.showModal.bind(this), id: "applications-btn" }, "Applications"), index.h("a", { onClick: this.logout.bind(this), id: "logout-btn" }, "Logout"))));
|
|
2639
|
+
return (index.h("div", { id: "profile-btn", class: "dropdown" }, index.h("button", { type: "button", class: "button" }, index.h("span", { class: "button-profile" }, index.h("img", { src: "https://i.pravatar.cc/100?img=32", alt: "" })), index.h("span", { id: "given-name", class: "button-text" }, this.givenName), index.h("div", { class: "button-icon" }, index.h("span", { class: "gg-menu-grid-r" }))), index.h("div", { class: "dropdown-content" }, index.h("a", { onClick: this.showModal.bind(this), id: "applications-btn" }, "Applications"), index.h("a", { href: this.portalUrl, target: '_blank', id: "applications-btn" }, "Portal"), index.h("a", { href: this.marketplaceUrl, target: '_blank', id: "applications-btn" }, "Marketplace"), index.h("a", { onClick: this.logout.bind(this), id: "logout-btn" }, "Logout"))));
|
|
2631
2640
|
}
|
|
2632
2641
|
else {
|
|
2633
2642
|
return (index.h("button", { onClick: this.login.bind(this), id: "login-btn", type: "button", class: "button" }, index.h("span", { class: "button-text" }, "Login")));
|
|
2634
2643
|
}
|
|
2635
|
-
})()), index.h("div", { key: '
|
|
2636
|
-
return (index.h("a", { class: "external-app-link", target: '_blank', href: "https://" + app.shortname + "-zdzw
|
|
2637
|
-
}) : index.h("div", null, index.h("h3", { class: "gray-text" }, "Not installed application found."), " ", index.h("p", { class: "gray-text" }, "Please contact administration."))))), index.h("div", { key: '
|
|
2644
|
+
})()), index.h("div", { key: 'fc06bdd5f74a4b79a21f1ddab5629f6a898a261a', id: "appListModal", class: "modal" }, index.h("div", { key: '667fa5a708f790818d2694bb5a7c811a64fbbff3', class: "modal-content" }, index.h("span", { key: 'ec1df58c4d4ed0a3231e9fc9457cd596ca8e048b', onClick: this.closeModal.bind(this), class: "close" }, "\u00D7"), index.h("h3", { key: '2f9bae87a635e8904f5f0fe4ad8076a347370404' }, "Applications"), index.h("div", { key: '930a0de8699c574a7d9438ab0ac973830734327a', class: "modal-body" }, this.appList.length > 0 ? this.appList.map(app => {
|
|
2645
|
+
return (index.h("a", { class: "external-app-link", target: '_blank', href: "https://" + app.shortname + "-zdzw" + this.portalUrl.replace(/(^\w+:|^)\/\//, '').replace('.portal-frontend-zdzw', '') }, index.h("div", { class: "modal-app" }, index.h("div", null, app.name))));
|
|
2646
|
+
}) : index.h("div", null, index.h("h3", { class: "gray-text" }, "Not installed application found."), " ", index.h("p", { class: "gray-text" }, "Please contact administration."))))), index.h("div", { key: 'c01ee35c13b76484278a3a6bc38917784aa1f4d0', id: "appPermissionErrorModal", class: "modal" }, index.h("div", { key: 'cb330533d75233c44a520851adfee2aad581f192', class: "modal-content" }, index.h("img", { key: 'b8ef10fdc78a54a35ae91b6798f3eeaa13b05cf6', src: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAACXBIWXMAAAsTAAALEwEAmpwYAAAGD0lEQVR4nO2cbU8TWRTH/W5WEAmF4nNiieFFoeBjYhQUWzUWYkpbDfGFCR9CoolvQF9aWgG3kMCG8LACC1ikuCuUh7bH/M/MmW131S2ZqTDjPcmkdub2tvPj3HP/55yJR44oU6ZMmTJlyg7YOsL9pI7+shkogGFzDqMAhhVAOsiQozwwrACS8sCwfXd+tYTDCiApDwwf/FJUSzisAJKjNhFlPzYF0KQpgCZNATRpCqBJUwBNmgJo0hRAk6YAmjQF0KkAs4uLtPz8OU2HQpRqaaFkQwPFq6v5SHo8fA7XVgYGKLu0dGC/81ABLORylB4cpInLl+nt0aP7OiauXKH00BAV8vlfE2AmkaCxpiYDSKK6mqaammjx+nX6FAzS348e0VYkwgf+jXO4Nun18lj53PuLF2kjmfx1AOa3t2mmt9cAkDxxghauXaPN3l7KxmJlHRgLmKNutzHPTCTCczsa4G4mQ6nWVr7h4WPHaL6trQTc+r17NOf30/iZMzTmdtNwVRWPA2Scm/H56FMgQNlolMfDO/9ob+cxmDPl99PuxoYzAe5mMrzcxOvWAALgolFauXmTxurry45/gPvnjRsG+LW7d3lOWdKVhHggAPPb24bnvW9ooL96evjGP4dC9NvJkwaY0fPnaa6vjzLJJG19+ED5bJY/u5NOUyYep/lnz2jk3Ll/4p/Hw/B4ru5unls8Mb+z4xyAM3rMg5cIvHRXFyVqavg8oKy+elXWjooxqy9f0luXy5gTm4xAFE+cjcWcATCTSGgxr6rKWLaAF9fj1u+BAOW2tsqeL7+7S5OdnRq8mhpaf/CA5xSI8EiJiRsjI/YGWMjlDKmCDUOWrXje3NOnRIWCaXh45biqL+f59nYjHlqtE38qwPTgoLHMeLeNRo2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QMGkDoYaCeaDzi29jIuziuYYyVua1jANrFFECTpgCaNAXQpCmAJk0BNGkKoElTACsNUB39ZTFQAMMW/78xypQpU6ZMmbIjP9e+AkAlsBlIjsPOAAAAAElFTkSuQmCC" }), index.h("h2", { key: '64db3526910c2eff61f8f59d445ba8fd2fe0cae1', class: "green-text margin-b" }, "You don't have permission to access this application."), index.h("h3", { key: '845136246b4bdaa80c71cb44d9e483ed11b8727f', class: "green-text" }, "Please contact the administration."), (this.portalUrl && this.showUnauthorizedModal) ?
|
|
2638
2647
|
index.h("div", null, index.h("h4", { class: "gray-text" }, "You will be automatically redirected to the portal."), index.h("div", { id: "countdown" }, index.h("div", { id: "countdown-number" }), index.h("svg", null, index.h("circle", { r: "18", cx: "20", cy: "20" }))))
|
|
2639
2648
|
: index.h("div", null))));
|
|
2640
2649
|
}
|