dash-button-web 0.0.18-beta.0 → 0.0.19-beta.0

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.
Files changed (37) hide show
  1. package/dist/cjs/dash-button.cjs.entry.js +199 -103
  2. package/dist/cjs/dash-button.cjs.entry.js.map +1 -1
  3. package/dist/cjs/{index-ad267eeb.js → index-87d4993d.js} +1 -5
  4. package/dist/cjs/index-87d4993d.js.map +1 -0
  5. package/dist/cjs/loader.cjs.js +2 -2
  6. package/dist/cjs/web-compnont.cjs.js +2 -2
  7. package/dist/collection/components/my-component/dash-button.css +3 -3
  8. package/dist/collection/components/my-component/dash-button.js +92 -319
  9. package/dist/collection/components/my-component/dash-button.js.map +1 -1
  10. package/dist/collection/services/config.js +59 -0
  11. package/dist/collection/services/config.js.map +1 -0
  12. package/dist/collection/services/menu.js +52 -0
  13. package/dist/collection/services/menu.js.map +1 -0
  14. package/dist/components/dash-button.js +202 -118
  15. package/dist/components/dash-button.js.map +1 -1
  16. package/dist/esm/dash-button.entry.js +199 -103
  17. package/dist/esm/dash-button.entry.js.map +1 -1
  18. package/dist/esm/{index-46149754.js → index-e3df5eaf.js} +1 -5
  19. package/dist/{cjs/index-ad267eeb.js.map → esm/index-e3df5eaf.js.map} +1 -1
  20. package/dist/esm/loader.js +3 -3
  21. package/dist/esm/web-compnont.js +3 -3
  22. package/dist/types/components/my-component/dash-button.d.ts +8 -19
  23. package/dist/types/components.d.ts +0 -24
  24. package/dist/types/services/config.d.ts +47 -0
  25. package/dist/types/services/menu.d.ts +27 -0
  26. package/dist/web-compnont/p-63d22b03.entry.js +10 -0
  27. package/dist/web-compnont/p-63d22b03.entry.js.map +1 -0
  28. package/dist/web-compnont/p-c1ec12fe.js +3 -0
  29. package/dist/web-compnont/p-c1ec12fe.js.map +1 -0
  30. package/dist/web-compnont/web-compnont.esm.js +1 -1
  31. package/dist/web-compnont/web-compnont.esm.js.map +1 -1
  32. package/package.json +1 -1
  33. package/dist/esm/index-46149754.js.map +0 -1
  34. package/dist/web-compnont/p-92bc7cf5.entry.js +0 -10
  35. package/dist/web-compnont/p-92bc7cf5.entry.js.map +0 -1
  36. package/dist/web-compnont/p-db53c3e9.js +0 -3
  37. package/dist/web-compnont/p-db53c3e9.js.map +0 -1
@@ -1,58 +1,51 @@
1
1
  import { h } from "@stencil/core";
2
2
  import Keycloak from "keycloak-js";
3
3
  import { toSvg } from "jdenticon";
4
+ import { configService } from "../../services/config";
5
+ import { menuService } from "../../services/menu";
4
6
  export class DashButtonComponent {
5
7
  constructor() {
6
8
  this.showPostLoginText = false;
7
9
  this.silentCheckSso = false;
8
- this.silentCheckSsoHtmlPath = "/assets/verificar-sso.html";
9
10
  this.redirectUri = undefined;
10
11
  this.authMethod = "check-sso";
11
- this.keycloakUri = "http://localhost:8080";
12
- this.realm = "";
13
- this.clientId = "";
14
12
  this.appId = "";
15
- this.portalUrl = "";
16
13
  this.portalApiUrl = "";
17
14
  this.plmUrl = "https://productlicensemanager-zdzw.cloud.zdzw-project.com";
18
- this.usageTrackingUrl = "https://usage-tracking-ui-zdzw.cloud.zdzw-project.com";
19
15
  this.showUnauthorizedModal = false;
20
- this.postTextDelayDuration = undefined;
21
16
  this.primaryColor = "";
22
17
  this.accentColor = "";
23
- this.otherLinkType = undefined;
24
- this.otherLinkDisplayName = "More links";
25
- this.applicationDisplayName = "Applications";
26
- this.disableApplicationTab = false;
27
- this.menuViewType = "grid";
28
- this.keycloak = new Keycloak({
29
- url: this.keycloakUri,
30
- realm: this.realm,
31
- clientId: this.clientId,
32
- });
18
+ this.keycloak = null;
33
19
  this.isAuth = false;
34
20
  this.givenUserName = "";
35
- this.silentCheckSsoRedirectUri = window.location.origin + this.silentCheckSsoHtmlPath;
21
+ this.silentCheckSsoRedirectUri = window.location.origin + '/assets/verificar-sso.html';
36
22
  this.appList = [];
37
- this.menuLinkList = [];
38
- this.mainMenuLinkList = [];
39
- this.showPostLoginLoadingSpinner = false;
40
23
  this.avatarSvg = toSvg("init-avatar", 40);
41
- this.dummyAppList = ["Ds2moduleapp", "Data Share Controller", "Data inspection", "DRM", "Data marketplace", "Modal development toolkit", "Multi cloud"];
24
+ this.isLoading = false;
25
+ this.config = undefined;
26
+ this.localMenuLinks = undefined;
27
+ this.organizationUrl = undefined;
42
28
  }
43
- ;
44
- componentWillLoad() {
45
- //
46
- // User set post-text-delay-duration for displaying loading spinner
47
- //
48
- if (this.postTextDelayDuration > 0) {
49
- // Show loading spinner
50
- this.showPostLoginLoadingSpinner = true;
51
- // Removing a loading spinner after the delay period ending
29
+ async componentWillLoad() {
30
+ var _a, _b, _c, _d;
31
+ // Fetch config from API
32
+ this.config = await configService.fetchConfig(this.portalApiUrl);
33
+ console.log(this.config);
34
+ if (!this.config)
35
+ return; // prevent Keycloak init if fetch failed
36
+ // render will show spinner
37
+ if ((_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.loading) === null || _b === void 0 ? void 0 : _b.isLoading) {
38
+ this.isLoading = true;
52
39
  setTimeout(() => {
53
- this.showPostLoginLoadingSpinner = false;
54
- }, this.postTextDelayDuration);
40
+ this.isLoading = false;
41
+ }, (_d = (_c = this.config) === null || _c === void 0 ? void 0 : _c.loading) === null || _d === void 0 ? void 0 : _d.duration);
55
42
  }
43
+ // Initialize Keycloak
44
+ this.keycloak = new Keycloak({
45
+ url: this.config.keycloak.url,
46
+ realm: this.config.keycloak.realm,
47
+ clientId: this.config.keycloak.clientId
48
+ });
56
49
  //
57
50
  // Init Keycloak
58
51
  //
@@ -60,10 +53,13 @@ export class DashButtonComponent {
60
53
  // Check if the user is authenticated
61
54
  if (this.isAuth) {
62
55
  const _token = JSON.parse(localStorage.getItem('keycloak')).token;
63
- this.getAppList(_token).then(res => {
64
- this.appList = res;
65
- // If the user has set an app ID, check if they have permission to access
66
- if (this.appId) {
56
+ // Get organization URL and load local menu items
57
+ // If the user has not set an organization URL, they can configure it in the Portal profile page
58
+ this.loadOrganizationUrlAndLinks();
59
+ // // If the user has set an app ID, check if they have permission to access
60
+ if (this.appId) {
61
+ this.getAppList(_token).then(res => {
62
+ this.appList = res;
67
63
  // Retrieve the list of buttons that are configured to set the app ID
68
64
  const appIdList = this.appId.replace(/'/g, '').split(',');
69
65
  // Remote appID list parsed from object
@@ -76,7 +72,7 @@ export class DashButtonComponent {
76
72
  const appErrorModal = this.el.shadowRoot.querySelector('#appPermissionErrorModal');
77
73
  appErrorModal.style.display = "block";
78
74
  // If a redirect URL is provided, show the loading spinner
79
- if (this.portalUrl && this.showUnauthorizedModal) {
75
+ if (this.config.defaultLink.url && this.showUnauthorizedModal) {
80
76
  var countdownNumberEl = this.el.shadowRoot.getElementById('countdown-number');
81
77
  var countdown = 6;
82
78
  countdownNumberEl.textContent = countdown.toString();
@@ -86,7 +82,7 @@ export class DashButtonComponent {
86
82
  // Once the countdown finishes, redirect to the provided URL
87
83
  if (countdown == 1) {
88
84
  // appErrorModal.style.display = "none";
89
- window.location.replace(this.portalUrl.toString());
85
+ window.location.replace(this.config.defaultLink.url.toString());
90
86
  }
91
87
  }, 1000);
92
88
  }
@@ -96,21 +92,8 @@ export class DashButtonComponent {
96
92
  // Update local storage app permission
97
93
  localStorage.setItem("ZDZW_app_permission", JSON.stringify(true));
98
94
  }
99
- }
100
- });
101
- // Set modules menu links
102
- this.getOtherMenuLinks(_token).then(res => {
103
- if (res.links) {
104
- this.menuLinkList = res.links;
105
- }
106
- });
107
- // Set main menu links
108
- this.getMainMenuLinks(_token).then(res => {
109
- if (res.menuLinks) {
110
- this.mainMenuLinkList = res.menuLinks;
111
- console.log(this.mainMenuLinkList);
112
- }
113
- });
95
+ });
96
+ }
114
97
  }
115
98
  });
116
99
  }
@@ -126,7 +109,7 @@ export class DashButtonComponent {
126
109
  this.isAuth = true;
127
110
  localStorage.setItem("keycloak", JSON.stringify(this.keycloak));
128
111
  // document.cookie = "DASH_BTN=" + JSON.parse(localStorage.getItem('keycloak')).token;
129
- document.cookie = "ZDZW_cookie=" + JSON.parse(localStorage.getItem('keycloak')).token;
112
+ document.cookie = this.config.cookieName + "=" + JSON.parse(localStorage.getItem('keycloak')).token;
130
113
  // Set userName
131
114
  this.givenUserName = JSON.parse(localStorage.getItem('keycloak')).idTokenParsed.preferred_username;
132
115
  // Set user avatar
@@ -134,13 +117,34 @@ export class DashButtonComponent {
134
117
  }
135
118
  });
136
119
  }
120
+ async loadOrganizationUrlAndLinks() {
121
+ var _a, _b, _c;
122
+ // Read org URL safely
123
+ try {
124
+ const kc = JSON.parse(localStorage.getItem("keycloak") || "{}");
125
+ this.organizationUrl = ((_a = kc === null || kc === void 0 ? void 0 : kc.idTokenParsed) === null || _a === void 0 ? void 0 : _a.organizationUrl) || null;
126
+ }
127
+ catch (_d) {
128
+ this.organizationUrl = null;
129
+ }
130
+ // If no organization, do nothing
131
+ if (!this.organizationUrl)
132
+ return;
133
+ // If config or menu not ready, skip
134
+ if (!((_c = (_b = this.config) === null || _b === void 0 ? void 0 : _b.menu) === null || _c === void 0 ? void 0 : _c.local))
135
+ return;
136
+ // Only load when custom menu is NOT enabled
137
+ if (!this.config.menu.local.enableCustomLocalMenu) {
138
+ try {
139
+ this.localMenuLinks = await menuService.getMenuLinks(this.organizationUrl);
140
+ }
141
+ catch (e) {
142
+ console.error("Failed to load local menu", e);
143
+ this.localMenuLinks = [];
144
+ }
145
+ }
146
+ }
137
147
  async getAppList(token) {
138
- // const token = await JSON.parse(localStorage.getItem('keycloak')).token;
139
- // const response = await fetch(this.marketplaceUrl + '/api/v1/product/nameAndShortName', {
140
- // headers: new Headers({
141
- // 'Authorization': 'Bearer ' + token,
142
- // }),
143
- // })
144
148
  const response = await fetch(this.plmUrl + '/api/v1/product/nameAndShortNameOrg', {
145
149
  headers: new Headers({
146
150
  'Authorization': 'Bearer ' + token,
@@ -149,31 +153,13 @@ export class DashButtonComponent {
149
153
  const jsonObj = await response.json();
150
154
  return jsonObj;
151
155
  }
152
- async getOtherMenuLinks(token) {
153
- const response = await fetch(this.portalApiUrl + '/developer/dashbutton-link/' + this.otherLinkType, {
154
- headers: new Headers({
155
- 'Authorization': 'Bearer ' + token,
156
- }),
157
- });
158
- const jsonObj = await response.json();
159
- return jsonObj;
160
- }
161
- async getMainMenuLinks(token) {
162
- const response = await fetch(this.portalApiUrl + '/developer/dashbutton-menu-link', {
163
- headers: new Headers({
164
- 'Authorization': 'Bearer ' + token,
165
- }),
166
- });
167
- const jsonObj = await response.json();
168
- return jsonObj;
169
- }
170
156
  login() {
171
157
  this.keycloak.login();
172
158
  }
173
159
  logout() {
174
160
  localStorage.removeItem("keycloak");
175
161
  // document.cookie = "DASH_BTN=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
176
- document.cookie = "ZDZW_cookie=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
162
+ document.cookie = this.config.cookieName + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
177
163
  this.keycloak.logout();
178
164
  }
179
165
  showModal() {
@@ -185,38 +171,39 @@ export class DashButtonComponent {
185
171
  appModal.style.display = "none";
186
172
  }
187
173
  render() {
188
- return h("div", { key: '14e3c6211bc1bedba56d1db79a65afb1077f51c8' }, h("div", { key: 'fe92daf674a58cb30869d8a5a73eb5ee00fd505f' }, (() => {
174
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
175
+ return h("div", { key: '47c985a3b39d98bf3b6b37f850515a9bbdff9e0c' }, h("div", { key: '5883dea8b8cf39af20811a4bd14572e7dddab18e' }, (() => {
176
+ // GLOBAL LOADING SPINNER
177
+ if (this.isLoading) {
178
+ return (h("a", { id: "login-btn", class: "button button-link" }, h("div", { class: "lds-ring" }, h("div", null), h("div", null), h("div", null), h("div", null))));
179
+ }
189
180
  if (this.isAuth && this.showPostLoginText) {
190
- // User set post-text-delay-duration for displaying loading spinner
191
- if (this.showPostLoginLoadingSpinner) {
192
- return (h("a", { id: "login-btn", class: "button button-link" }, h("div", { class: "lds-ring" }, h("div", null), h("div", null), h("div", null), h("div", null))));
193
- }
194
- else {
195
- return (h("a", { style: { background: this.primaryColor != undefined ? this.primaryColor : "" }, href: this.redirectUri, id: "login-btn", class: "button button-link" }, h("span", { style: { color: this.accentColor != undefined ? this.accentColor : "" }, class: "button-text button-text-full-width" }, "Go to Dashboard")));
196
- }
181
+ return (h("a", { style: { background: this.primaryColor != undefined ? this.primaryColor : "" }, href: this.redirectUri, id: "login-btn", class: "button button-link" }, h("span", { style: { color: this.accentColor != undefined ? this.accentColor : "" }, class: "button-text button-text-full-width" }, "Go to Dashboard")));
197
182
  }
198
183
  else if (this.isAuth) {
199
184
  return (h("div", { id: "profile-btn", class: "dropdown" }, h("button", { style: { background: this.primaryColor != undefined ? this.primaryColor : "" }, type: "button", class: "button" }, h("span", { class: "button-profile" }, JSON.parse(localStorage.getItem('keycloak')).idTokenParsed.imageUrl ?
200
185
  h("img", { class: "profile-image", src: "https://s-damith.github.io/test-avatar/images/e24da9c5-0b1f-46fa-82cd-7c711c77b5c7.png" })
201
186
  :
202
- h("div", { innerHTML: this.avatarSvg })), h("span", { style: { color: this.accentColor != undefined ? this.accentColor : "" }, id: "given-name", class: "button-text" }, this.givenUserName), h("div", { class: "button-icon" }, (this.menuViewType == "grid") ? h("i", { class: "fa-solid fa-grip-vertical" }) : h("i", { class: "fa-solid fa-bars" }))), h("div", { class: "dropdown-content" }, h("div", { class: "dropdown-user-profile" }, h("div", { class: "username" }, "@", this.givenUserName), h("div", { class: "first-last-name" }, JSON.parse(localStorage.getItem('keycloak')).idTokenParsed.name)), (this.menuViewType == "grid") ? (h("div", null, h("div", { class: "grid-view-menu" }, this.mainMenuLinkList.map(link => {
203
- return (h("a", { href: link.url, target: '_blank', class: "grid-view-link" }, h("i", { class: link.icon + " fa-2x" }), h("div", { class: "grid-view-link-text" }, link.name)));
204
- })), this.mainMenuLinkList.length != 0 && h("hr", { class: "solid" }), h("div", { class: "grid-view-menu", style: this.mainMenuLinkList.length == 0 && { "margin-bottom": "12px" } }, h("a", { onClick: this.showModal.bind(this), class: "grid-view-link" }, h("i", { class: "fa-regular fa-window-restore fa-2x" }), h("div", { class: "grid-view-link-text" }, "Modules")), h("a", { href: this.portalUrl, target: '_blank', class: "grid-view-link" }, h("i", { class: "fa-solid fa-globe fa-2x" }), h("div", { class: "grid-view-link-text" }, "Portal")), h("a", { onClick: this.logout.bind(this), class: "grid-view-link" }, h("i", { class: "fa-solid fa-right-from-bracket fa-2x" }), h("div", { class: "grid-view-link-text" }, "Logout"))))) : (
187
+ h("div", { innerHTML: this.avatarSvg })), h("span", { style: { color: this.accentColor != undefined ? this.accentColor : "" }, id: "given-name", class: "button-text" }, this.givenUserName), h("div", { class: "button-icon" }, (this.config.menuViewType == "grid") ? h("i", { class: "fa-solid fa-grip-vertical" }) : h("i", { class: "fa-solid fa-bars" }))), h("div", { class: "dropdown-content" }, h("div", { class: "dropdown-user-profile" }, h("div", { class: "username" }, "@", this.givenUserName), h("div", { class: "first-last-name" }, JSON.parse(localStorage.getItem('keycloak')).idTokenParsed.name)), (this.config.menuViewType == "grid") ? (h("div", null, h("div", { class: "grid-view-menu" }, this.config.menu.global.links.map(item => {
188
+ return (h("a", { href: item.url, target: '_blank', class: "grid-view-link" }, h("i", { class: item.icon + " fa-2x" }), h("div", { class: "grid-view-link-text" }, item.name)));
189
+ })), this.config.menu.global.links.length != 0 && h("hr", { class: "solid" }), h("div", { class: "grid-view-menu", style: this.config.menu.global.links.length == 0 && { "margin-bottom": "12px" } }, h("a", { onClick: this.showModal.bind(this), class: "grid-view-link" }, h("i", { class: "fa-regular fa-window-restore fa-2x" }), h("div", { class: "grid-view-link-text" }, "Modules")), h("a", { href: this.config.defaultLink.url, target: '_blank', class: "grid-view-link" }, h("i", { class: "fa-solid fa-globe fa-2x" }), h("div", { class: "grid-view-link-text" }, this.config.defaultLink.name)), h("a", { onClick: this.logout.bind(this), class: "grid-view-link" }, h("i", { class: "fa-solid fa-right-from-bracket fa-2x" }), h("div", { class: "grid-view-link-text" }, "Logout"))))) : (
205
190
  // List View
206
- h("div", { class: "dropdown-content-link" }, this.mainMenuLinkList.map(link => {
207
- return (h("a", { href: link.url, target: '_blank', id: "applications-btn" }, h("i", { class: link.icon + " menu-bar-icons" }), link.name));
208
- }), h("a", { onClick: this.showModal.bind(this), id: "applications-btn" }, h("i", { class: "fa-regular fa-window-restore menu-bar-icons" }), "Modules"), h("a", { href: this.portalUrl, target: '_blank', id: "applications-btn" }, h("i", { class: "fa-solid fa-globe menu-bar-icons" }), "Portal"), h("a", { onClick: this.logout.bind(this), id: "logout-btn" }, h("i", { class: "fa-solid fa-right-from-bracket menu-bar-icons" }), "Logout"))))));
191
+ h("div", { class: "dropdown-content-link" }, this.config.menu.global.links.map(item => {
192
+ return (h("a", { href: item.url, target: '_blank', id: "applications-btn" }, h("i", { class: item.icon + " menu-bar-icons" }), item.name));
193
+ }), h("a", { onClick: this.showModal.bind(this), id: "applications-btn" }, h("i", { class: "fa-regular fa-window-restore menu-bar-icons" }), "Modules"), h("a", { href: this.config.defaultLink.url, target: '_blank', id: "applications-btn" }, h("i", { class: "fa-solid fa-globe menu-bar-icons" }), this.config.defaultLink.name), h("a", { onClick: this.logout.bind(this), id: "logout-btn" }, h("i", { class: "fa-solid fa-right-from-bracket menu-bar-icons" }), "Logout"))))));
209
194
  }
210
195
  else {
211
196
  return (h("button", { style: { background: this.primaryColor != undefined ? this.primaryColor : "" }, onClick: this.login.bind(this), id: "login-btn", type: "button", class: "button" }, h("span", { style: { color: this.accentColor != undefined ? this.accentColor : "" }, class: "button-text" }, "Login")));
212
197
  }
213
- })()), h("div", { key: 'adb077b8884de0d46c65fdac09da89fb3cbf77cc', id: "appListModal", class: "modal" }, h("div", { key: '34b8bb4e23dc7b9eb52c8d1cbb06b2bf3c4c29f7', class: "modal-content" }, h("span", { key: '6ee5dc9c906613ed8dca79daf5851965f97b7e9a', onClick: this.closeModal.bind(this), class: "close" }, "\u00D7"), h("div", { key: '1e1df5d14839f1cbe340413b4f56c95b64f0720f', class: "box" }, (!this.disableApplicationTab) && h("input", { type: "radio", class: "tab-toggle", name: "tab-toggle", id: "tab1", checked: true }), (this.menuLinkList.length != 0) && h("input", { type: "radio", class: "tab-toggle", name: "tab-toggle", id: "tab2", checked: this.disableApplicationTab }), h("ul", { key: '96f055670cf7e40a0bd141246c3d0090ca666d72', class: "tab-list" }, (!this.disableApplicationTab) && h("li", { class: "tab-item" }, h("label", { class: "tab-trigger", htmlFor: "tab1" }, h("i", { class: "fa-solid fa-table-list menu-bar-icons" }), " ", this.applicationDisplayName)), (this.menuLinkList.length != 0) && h("li", { class: "tab-item" }, h("label", { class: "tab-trigger", htmlFor: "tab2" }, h("i", { class: "fa-solid fa-link menu-bar-icons" }), " ", this.otherLinkDisplayName))), h("div", { key: '01220594f802a9aec5815154467c290ca94abe81', class: "tab-container" }, (!this.disableApplicationTab) && h("div", { class: "tab-content" }, h("div", { class: "modal-body" }, this.dummyAppList.length > 0 ?
214
- this.dummyAppList.map((app) => {
215
- return (h("a", { class: "external-app-link", target: '_blank', href: "https://" + app }, h("div", { class: "modal-app" }, h("div", null, app))));
216
- })
217
- : h("div", null, h("h3", { class: "gray-text" }, "Not installed ", this.applicationDisplayName, " found."), " ", h("p", { class: "gray-text" }, "Please contact administration.")))), h("div", { key: '91d1cca16f1a3211809623ac617cddefaa1a0e94', class: "tab-content" }, h("div", { key: '4ef377d1f836f39f486220220d969a8000d3fb14', class: "modal-body" }, this.menuLinkList.map(link => {
218
- return (h("a", { class: "external-app-link", target: '_blank', href: link.url }, h("div", { class: "modal-app" }, h("div", null, link.name))));
219
- }))))))), h("div", { key: '739b7f2075d2d9112f4b70f91184b504e7ae6a4c', id: "appPermissionErrorModal", class: "modal" }, h("div", { key: '551fe0f24abc915647803a41dae875b803974aee', class: "modal-content" }, h("img", { key: '33a1322bdbac187e46d55aa091857d3df51f9afb', src: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtA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d17777ab', class: "green-text margin-b" }, "You don't have permission to access this application."), h("h3", { key: '358cc87e06772a3af8b780db449d98e5baa8a506', class: "green-text" }, "Please contact the administration."), (this.portalUrl && this.showUnauthorizedModal) ?
198
+ })()), h("div", { key: '2aeddc5c6f93134dc5058235d2e864763d3a3982', id: "appListModal", class: "modal" }, h("div", { key: 'e86b765ebd47c50ba712ea09f81e74e6c802f318', class: "modal-content" }, h("span", { key: 'ccc7f8731fb9ba49252a0fce2851772c71a44789', onClick: this.closeModal.bind(this), class: "close" }, "\u00D7"), h("div", { key: '648667998eca09d5b0464c63d1af301f35e1d9ba', class: "box" }, h("input", { type: "radio", class: "tab-toggle", name: "tab-toggle", id: "tab1", checked: true }), h("ul", { key: '907ed1361b1d6d1003ca199e9e8a3fc6c08ec500', class: "tab-list" }, h("li", { class: "tab-item" }, h("label", { class: "tab-trigger", htmlFor: "tab1" }, h("i", { class: "fa-solid fa-table-list menu-bar-icons" }), " ", this.config.menu.local.name))), h("div", { key: '3942bc1c642481d57d82a3f4f73b52033a8212d3', class: "tab-container" }, h("div", { key: '01e28aae99763cd0709cd3578ee940f82f989ac9', class: "tab-content" }, h("div", { key: '71976588232415b57b982b108c85c145ac213dd8', class: "modal-body" }, !((_c = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.menu) === null || _b === void 0 ? void 0 : _b.local) === null || _c === void 0 ? void 0 : _c.enableCustomLocalMenu) ? (
199
+ // <div>{this.localMenuLinks}</div>
200
+ (_d = this.localMenuLinks) === null || _d === void 0 ? void 0 : _d.map((app, index) => {
201
+ const isDisabled = !app.url;
202
+ return (h("a", { key: index, class: "external-app-link", href: isDisabled ? undefined : app.url, target: isDisabled ? undefined : "_blank", rel: isDisabled ? undefined : "noopener noreferrer", onClick: isDisabled ? (e) => e.preventDefault() : undefined }, h("div", { class: "modal-app" }, h("div", null, app.name))));
203
+ })) : ((_e = this.config.menu.local.links) === null || _e === void 0 ? void 0 : _e.map((app, index) => (h("a", { key: index, class: "external-app-link", target: "_blank", rel: "noopener noreferrer", href: app.url }, h("div", { class: "modal-app" }, h("div", null, app.name)))))), !this.organizationUrl ? (h("div", null, h("h3", { class: "gray-text" }, "Organization URL not set"), h("p", { class: "gray-text" }, "Please set your organization URL on the Portal profile page."))) : (((!((_h = (_g = (_f = this.config) === null || _f === void 0 ? void 0 : _f.menu) === null || _g === void 0 ? void 0 : _g.local) === null || _h === void 0 ? void 0 : _h.enableCustomLocalMenu) &&
204
+ ((_k = (_j = this.localMenuLinks) === null || _j === void 0 ? void 0 : _j.length) !== null && _k !== void 0 ? _k : 0) === 0) ||
205
+ (((_o = (_m = (_l = this.config) === null || _l === void 0 ? void 0 : _l.menu) === null || _m === void 0 ? void 0 : _m.local) === null || _o === void 0 ? void 0 : _o.enableCustomLocalMenu) &&
206
+ ((_t = (_s = (_r = (_q = (_p = this.config) === null || _p === void 0 ? void 0 : _p.menu) === null || _q === void 0 ? void 0 : _q.local) === null || _r === void 0 ? void 0 : _r.links) === null || _s === void 0 ? void 0 : _s.length) !== null && _t !== void 0 ? _t : 0) === 0)) && (h("div", null, h("h3", { class: "gray-text" }, "No installed ", ((_w = (_v = (_u = this.config) === null || _u === void 0 ? void 0 : _u.menu) === null || _v === void 0 ? void 0 : _v.local) === null || _w === void 0 ? void 0 : _w.name) || "menu", " found."), h("p", { class: "gray-text" }, "Please contact administration.")))))))))), h("div", { key: 'd92e06993fd3f248a89b0c1ef1b6f4b6cb6585e6', id: "appPermissionErrorModal", class: "modal" }, h("div", { key: '5b88b5d179bb84034927a3bb2907151d216410b6', class: "modal-content" }, h("img", { key: 'cf030ce09d59fd82acc708f606d9cc613db5fd6c', src: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAACXBIWXMAAAsTAAALEwEAmpwYAAAGD0lEQVR4nO2cbU8TWRTH/W5WEAmF4nNiieFFoeBjYhQUWzUWYkpbDfGFCR9CoolvQF9aWgG3kMCG8LACC1ikuCuUh7bH/M/MmW131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vV3tbWGNuT3jY32AxjXS06QFLgZKUH9aPct7O3RVFfXf+BlHj6kZG2tBq+j47tpGs5LoYKrNpGI9v74cfsDHNazg+/dvFl4sNzmprHz2x5g8l9LWMTuzsePli7bYkMBgqVMfb39l3CqpeXbm0g8XhF439xEgkGjOmN7GTOjA4XU2Be8zs6y4MFmnzzRpJLfXypjenrsK6Qnvd4SSQGxCyFtNbxiIb1+/74mpL1e+wrp7NISp1ElqZwuZZB2WQkPZqRyevz7Eg5zCc22qVxxMUGWMRL94sTfKnjYfd+dPq15261bpcWEq1fJvuWsoSEt/3W7tRZlNMolJylxWQEPJTGRP6lTpwz5YpSz3ryxcUE1nzcaSeieFTeArIKH3Fq8GSX9koJqc7O9C6owNL0lO5CKsZTfzS7bqTt3+LPxornxKu2Cz6Oj5IymUkTLCOB54iWAKOIaMRE7JXbS/zOMwYYhMQ9/gOLOnPxBZh8/dlhb06+Vs9B6FIi4cYmJInGgEyGIkbHgc8idkWHgHHRecVsTMU/mwuuY3tYcv3TJWW1NGJrdJY113WtkdxaJU84BqSK7rRFXdc/Dd+w5rbFeDHG8rc2IiQj2UmwQsY1iKFIxlKSg46AjARfnkGGISOZHO6JRnkNiHjzPsY92iGFZoultLNu6OtZs+3m4CCIZnxGpIjGvUsv2UAEUQ9NblrSUoNDDQP4KT+TH2/QWJT/eFgjwNaRnnGHI4x3NzRXZbQ89QBg0GsQ2Wo+SnZR1uFycYbBI3kdv2XEAiw35KqQMGkDoYaCeaDzi29jIuziuYYyVua1jANrFFECTpgCaNAXQpCmAJk0BNGkKoElTACsNUB39ZTFQAMMW/78xypQpU6ZMmbIjP9e+AkAlsBlIjsPOAAAAAElFTkSuQmCC" }), h("h2", { key: '6c0109541762219e6af691265d9b502550ee2f9a', class: "green-text margin-b" }, "You don't have permission to access this application."), h("h3", { key: 'af8800140450e7811bf741ea1280b924ff748593', class: "green-text" }, "Please contact the administration."), (this.config.defaultLink.url && this.showUnauthorizedModal) ?
220
207
  h("div", null, h("h4", { class: "gray-text" }, "You will be automatically redirected to the portal."), h("div", { id: "countdown" }, h("div", { id: "countdown-number" }), h("svg", null, h("circle", { r: "18", cx: "20", cy: "20" }))))
221
208
  : h("div", null))));
222
209
  }
@@ -270,24 +257,6 @@ export class DashButtonComponent {
270
257
  "reflect": false,
271
258
  "defaultValue": "false"
272
259
  },
273
- "silentCheckSsoHtmlPath": {
274
- "type": "string",
275
- "mutable": false,
276
- "complexType": {
277
- "original": "string",
278
- "resolved": "string",
279
- "references": {}
280
- },
281
- "required": false,
282
- "optional": false,
283
- "docs": {
284
- "tags": [],
285
- "text": ""
286
- },
287
- "attribute": "silent-check-sso-html-path",
288
- "reflect": false,
289
- "defaultValue": "\"/assets/verificar-sso.html\""
290
- },
291
260
  "redirectUri": {
292
261
  "type": "string",
293
262
  "mutable": false,
@@ -323,60 +292,6 @@ export class DashButtonComponent {
323
292
  "reflect": false,
324
293
  "defaultValue": "\"check-sso\""
325
294
  },
326
- "keycloakUri": {
327
- "type": "string",
328
- "mutable": false,
329
- "complexType": {
330
- "original": "string",
331
- "resolved": "string",
332
- "references": {}
333
- },
334
- "required": false,
335
- "optional": false,
336
- "docs": {
337
- "tags": [],
338
- "text": ""
339
- },
340
- "attribute": "keycloak-uri",
341
- "reflect": false,
342
- "defaultValue": "\"http://localhost:8080\""
343
- },
344
- "realm": {
345
- "type": "string",
346
- "mutable": false,
347
- "complexType": {
348
- "original": "string",
349
- "resolved": "string",
350
- "references": {}
351
- },
352
- "required": false,
353
- "optional": false,
354
- "docs": {
355
- "tags": [],
356
- "text": ""
357
- },
358
- "attribute": "realm",
359
- "reflect": false,
360
- "defaultValue": "\"\""
361
- },
362
- "clientId": {
363
- "type": "string",
364
- "mutable": false,
365
- "complexType": {
366
- "original": "string",
367
- "resolved": "string",
368
- "references": {}
369
- },
370
- "required": false,
371
- "optional": false,
372
- "docs": {
373
- "tags": [],
374
- "text": ""
375
- },
376
- "attribute": "client-id",
377
- "reflect": false,
378
- "defaultValue": "\"\""
379
- },
380
295
  "appId": {
381
296
  "type": "string",
382
297
  "mutable": false,
@@ -395,24 +310,6 @@ export class DashButtonComponent {
395
310
  "reflect": false,
396
311
  "defaultValue": "\"\""
397
312
  },
398
- "portalUrl": {
399
- "type": "string",
400
- "mutable": false,
401
- "complexType": {
402
- "original": "string",
403
- "resolved": "string",
404
- "references": {}
405
- },
406
- "required": false,
407
- "optional": false,
408
- "docs": {
409
- "tags": [],
410
- "text": ""
411
- },
412
- "attribute": "portal-url",
413
- "reflect": false,
414
- "defaultValue": "\"\""
415
- },
416
313
  "portalApiUrl": {
417
314
  "type": "string",
418
315
  "mutable": false,
@@ -449,24 +346,6 @@ export class DashButtonComponent {
449
346
  "reflect": false,
450
347
  "defaultValue": "\"https://productlicensemanager-zdzw.cloud.zdzw-project.com\""
451
348
  },
452
- "usageTrackingUrl": {
453
- "type": "string",
454
- "mutable": false,
455
- "complexType": {
456
- "original": "string",
457
- "resolved": "string",
458
- "references": {}
459
- },
460
- "required": false,
461
- "optional": false,
462
- "docs": {
463
- "tags": [],
464
- "text": ""
465
- },
466
- "attribute": "usage-tracking-url",
467
- "reflect": false,
468
- "defaultValue": "\"https://usage-tracking-ui-zdzw.cloud.zdzw-project.com\""
469
- },
470
349
  "showUnauthorizedModal": {
471
350
  "type": "boolean",
472
351
  "mutable": false,
@@ -485,23 +364,6 @@ export class DashButtonComponent {
485
364
  "reflect": false,
486
365
  "defaultValue": "false"
487
366
  },
488
- "postTextDelayDuration": {
489
- "type": "number",
490
- "mutable": false,
491
- "complexType": {
492
- "original": "number",
493
- "resolved": "number",
494
- "references": {}
495
- },
496
- "required": false,
497
- "optional": false,
498
- "docs": {
499
- "tags": [],
500
- "text": ""
501
- },
502
- "attribute": "post-text-delay-duration",
503
- "reflect": false
504
- },
505
367
  "primaryColor": {
506
368
  "type": "string",
507
369
  "mutable": false,
@@ -537,95 +399,6 @@ export class DashButtonComponent {
537
399
  "attribute": "accent-color",
538
400
  "reflect": false,
539
401
  "defaultValue": "\"\""
540
- },
541
- "otherLinkType": {
542
- "type": "string",
543
- "mutable": false,
544
- "complexType": {
545
- "original": "string",
546
- "resolved": "string",
547
- "references": {}
548
- },
549
- "required": false,
550
- "optional": false,
551
- "docs": {
552
- "tags": [],
553
- "text": ""
554
- },
555
- "attribute": "other-link-type",
556
- "reflect": false
557
- },
558
- "otherLinkDisplayName": {
559
- "type": "string",
560
- "mutable": false,
561
- "complexType": {
562
- "original": "string",
563
- "resolved": "string",
564
- "references": {}
565
- },
566
- "required": false,
567
- "optional": false,
568
- "docs": {
569
- "tags": [],
570
- "text": ""
571
- },
572
- "attribute": "other-link-display-name",
573
- "reflect": false,
574
- "defaultValue": "\"More links\""
575
- },
576
- "applicationDisplayName": {
577
- "type": "string",
578
- "mutable": false,
579
- "complexType": {
580
- "original": "string",
581
- "resolved": "string",
582
- "references": {}
583
- },
584
- "required": false,
585
- "optional": false,
586
- "docs": {
587
- "tags": [],
588
- "text": ""
589
- },
590
- "attribute": "application-display-name",
591
- "reflect": false,
592
- "defaultValue": "\"Applications\""
593
- },
594
- "disableApplicationTab": {
595
- "type": "boolean",
596
- "mutable": false,
597
- "complexType": {
598
- "original": "boolean",
599
- "resolved": "boolean",
600
- "references": {}
601
- },
602
- "required": false,
603
- "optional": false,
604
- "docs": {
605
- "tags": [],
606
- "text": ""
607
- },
608
- "attribute": "disable-application-tab",
609
- "reflect": false,
610
- "defaultValue": "false"
611
- },
612
- "menuViewType": {
613
- "type": "string",
614
- "mutable": false,
615
- "complexType": {
616
- "original": "string",
617
- "resolved": "string",
618
- "references": {}
619
- },
620
- "required": false,
621
- "optional": false,
622
- "docs": {
623
- "tags": [],
624
- "text": ""
625
- },
626
- "attribute": "menu-view-type",
627
- "reflect": false,
628
- "defaultValue": "\"grid\""
629
402
  }
630
403
  };
631
404
  }
@@ -636,11 +409,11 @@ export class DashButtonComponent {
636
409
  "givenUserName": {},
637
410
  "silentCheckSsoRedirectUri": {},
638
411
  "appList": {},
639
- "menuLinkList": {},
640
- "mainMenuLinkList": {},
641
- "showPostLoginLoadingSpinner": {},
642
412
  "avatarSvg": {},
643
- "dummyAppList": {}
413
+ "isLoading": {},
414
+ "config": {},
415
+ "localMenuLinks": {},
416
+ "organizationUrl": {}
644
417
  };
645
418
  }
646
419
  static get elementRef() { return "el"; }