dash-button-web 0.0.7 → 0.0.9
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 -8
- package/dist/cjs/dash-button.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/web-compnont.cjs.js +1 -1
- package/dist/collection/components/my-component/dash-button.js +33 -9
- package/dist/collection/components/my-component/dash-button.js.map +1 -1
- package/dist/components/dash-button.js +15 -8
- package/dist/components/dash-button.js.map +1 -1
- package/dist/esm/dash-button.entry.js +14 -8
- package/dist/esm/dash-button.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/web-compnont.js +1 -1
- package/dist/types/components/my-component/dash-button.d.ts +2 -1
- package/dist/types/components.d.ts +2 -0
- package/dist/web-compnont/{p-e4d4f568.entry.js → p-4097acc5.entry.js} +3 -3
- package/dist/web-compnont/p-4097acc5.entry.js.map +1 -0
- package/dist/web-compnont/web-compnont.esm.js +1 -1
- package/dist/web-compnont/web-compnont.esm.js.map +1 -1
- package/package.json +1 -1
- package/dist/web-compnont/p-e4d4f568.entry.js.map +0 -1
|
@@ -2492,7 +2492,8 @@ const DashButtonComponent = class {
|
|
|
2492
2492
|
this.clientId = "";
|
|
2493
2493
|
this.appId = "";
|
|
2494
2494
|
this.portalUrl = "";
|
|
2495
|
-
this.marketplaceUrl = "";
|
|
2495
|
+
this.marketplaceUrl = "https://marketplace-zdzw.cloud.zdzw-project.com";
|
|
2496
|
+
this.plmUrl = "https://productlicensemanager-zdzw.cloud.zdzw-project.com";
|
|
2496
2497
|
this.showUnauthorizedModal = false;
|
|
2497
2498
|
this.postTextDelayDuration = undefined;
|
|
2498
2499
|
this.keycloak = new Keycloak({
|
|
@@ -2525,7 +2526,8 @@ const DashButtonComponent = class {
|
|
|
2525
2526
|
this.initKeycloak().then(() => {
|
|
2526
2527
|
// Check if the user is authenticated
|
|
2527
2528
|
if (this.isAuth) {
|
|
2528
|
-
|
|
2529
|
+
const _token = JSON.parse(localStorage.getItem('keycloak')).token;
|
|
2530
|
+
this.getAppList(_token).then(res => {
|
|
2529
2531
|
this.appList = res;
|
|
2530
2532
|
// If the user has set an app ID, check if they have permission to access
|
|
2531
2533
|
if (this.appId) {
|
|
@@ -2582,14 +2584,18 @@ const DashButtonComponent = class {
|
|
|
2582
2584
|
}
|
|
2583
2585
|
});
|
|
2584
2586
|
}
|
|
2585
|
-
async getAppList() {
|
|
2587
|
+
async getAppList(token) {
|
|
2586
2588
|
// const token = await JSON.parse(localStorage.getItem('keycloak')).token;
|
|
2587
2589
|
// const response = await fetch(this.marketplaceUrl + '/api/v1/product/nameAndShortName', {
|
|
2588
2590
|
// headers: new Headers({
|
|
2589
2591
|
// 'Authorization': 'Bearer ' + token,
|
|
2590
2592
|
// }),
|
|
2591
2593
|
// })
|
|
2592
|
-
const response = await fetch(this.
|
|
2594
|
+
const response = await fetch(this.plmUrl + '/api/v1/product/nameAndShortNameOrg', {
|
|
2595
|
+
headers: new Headers({
|
|
2596
|
+
'Authorization': 'Bearer ' + token,
|
|
2597
|
+
}),
|
|
2598
|
+
});
|
|
2593
2599
|
const jsonObj = await response.json();
|
|
2594
2600
|
return jsonObj;
|
|
2595
2601
|
}
|
|
@@ -2610,7 +2616,7 @@ const DashButtonComponent = class {
|
|
|
2610
2616
|
appModal.style.display = "none";
|
|
2611
2617
|
}
|
|
2612
2618
|
render() {
|
|
2613
|
-
return index.h("div", { key: '
|
|
2619
|
+
return index.h("div", { key: '7843bbee4940a6a252e61442f8d77d467ee769c2' }, index.h("div", { key: 'd0940bd721a4eab5533cb7b136fabe8353cbb535' }, (() => {
|
|
2614
2620
|
if (this.isAuth && this.showPostLoginText) {
|
|
2615
2621
|
// User set post-text-delay-duration for displaying loading spinner
|
|
2616
2622
|
if (this.showPostLoginLoadingSpinner) {
|
|
@@ -2626,9 +2632,9 @@ const DashButtonComponent = class {
|
|
|
2626
2632
|
else {
|
|
2627
2633
|
return (index.h("button", { onClick: this.login.bind(this), id: "login-btn", type: "button", class: "button" }, index.h("span", { class: "button-text" }, "Login")));
|
|
2628
2634
|
}
|
|
2629
|
-
})()), index.h("div", { key: '
|
|
2630
|
-
return (index.h("a", { class: "external-app-link", target: '_blank', href: "https://" + app.shortname + "-zdzw" + this.portalUrl.replace(/(^\w+:|^)\/\//, '').replace('
|
|
2631
|
-
}) : 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: '
|
|
2635
|
+
})()), index.h("div", { key: '2c2f55d80917b2dc2b7a9279f2f76bc3a7f2e202', id: "appListModal", class: "modal" }, index.h("div", { key: '90d14c23cdbb1a129ba99f00518cff0a0a65baeb', class: "modal-content" }, index.h("span", { key: '6879c9fdc1d9a4a7075616f96ff63d95f8eaaea7', onClick: this.closeModal.bind(this), class: "close" }, "\u00D7"), index.h("h3", { key: '06a0268e396c3aeda8cf90e93e3dde405743abcd' }, "Applications"), index.h("div", { key: '2f77c0e5d35acdb101cfe9caf2b6e26be241dae9', class: "modal-body" }, this.appList.length > 0 ? this.appList.map(app => {
|
|
2636
|
+
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))));
|
|
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: 'bd4688753740aa007b07c2eae3addb53735d8f0a', id: "appPermissionErrorModal", class: "modal" }, index.h("div", { key: 'e4456ad3eca347536e671acd7194e7b9edde14c9', class: "modal-content" }, index.h("img", { key: '2332a30194ff8629bfee4e80c87b6a537962b97c', src: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAA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c1f5a910eff8c2f', class: "green-text margin-b" }, "You don't have permission to access this application."), index.h("h3", { key: '8de093a380855028b879686a9ab1b345dea4e356', class: "green-text" }, "Please contact the administration."), (this.portalUrl && this.showUnauthorizedModal) ?
|
|
2632
2638
|
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" }))))
|
|
2633
2639
|
: index.h("div", null))));
|
|
2634
2640
|
}
|