dash-button-web 0.0.13 → 0.0.15

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.
@@ -6,7 +6,7 @@ const index = require('./index-ad267eeb.js');
6
6
 
7
7
  const defineCustomElements = (win, options) => {
8
8
  if (typeof window === 'undefined') return undefined;
9
- return index.bootstrapLazy([["dash-button.cjs",[[1,"dash-button",{"showPostLoginText":[4,"show-post-login-text"],"silentCheckSso":[4,"silent-check-sso"],"redirectUri":[1,"redirect-uri"],"authMethod":[1,"auth-method"],"keycloakUri":[1,"keycloak-uri"],"realm":[1],"clientId":[1,"client-id"],"appId":[1,"app-id"],"portalUrl":[1,"portal-url"],"marketplaceUrl":[1,"marketplace-url"],"plmUrl":[1,"plm-url"],"usageTrackingUrl":[1,"usage-tracking-url"],"showUnauthorizedModal":[4,"show-unauthorized-modal"],"postTextDelayDuration":[2,"post-text-delay-duration"],"primaryColor":[1,"primary-color"],"accentColor":[1,"accent-color"],"keycloak":[32],"isAuth":[32],"givenUserName":[32],"silentCheckSsoRedirectUri":[32],"appList":[32],"showPostLoginLoadingSpinner":[32],"avatarSvg":[32]}]]]], options);
9
+ return index.bootstrapLazy([["dash-button.cjs",[[1,"dash-button",{"showPostLoginText":[4,"show-post-login-text"],"silentCheckSso":[4,"silent-check-sso"],"redirectUri":[1,"redirect-uri"],"authMethod":[1,"auth-method"],"keycloakUri":[1,"keycloak-uri"],"realm":[1],"clientId":[1,"client-id"],"appId":[1,"app-id"],"portalUrl":[1,"portal-url"],"marketplaceUrl":[1,"marketplace-url"],"plmUrl":[1,"plm-url"],"usageTrackingUrl":[1,"usage-tracking-url"],"showUnauthorizedModal":[4,"show-unauthorized-modal"],"postTextDelayDuration":[2,"post-text-delay-duration"],"primaryColor":[1,"primary-color"],"accentColor":[1,"accent-color"],"otherLinkType":[1,"other-link-type"],"applicationDisplayName":[1,"application-display-name"],"disableApplicationTab":[4,"disable-application-tab"],"keycloak":[32],"isAuth":[32],"givenUserName":[32],"silentCheckSsoRedirectUri":[32],"appList":[32],"menuLinkList":[32],"showPostLoginLoadingSpinner":[32],"avatarSvg":[32]}]]]], options);
10
10
  };
11
11
 
12
12
  exports.setNonce = index.setNonce;
@@ -17,7 +17,7 @@ const patchBrowser = () => {
17
17
  };
18
18
 
19
19
  patchBrowser().then(options => {
20
- return index.bootstrapLazy([["dash-button.cjs",[[1,"dash-button",{"showPostLoginText":[4,"show-post-login-text"],"silentCheckSso":[4,"silent-check-sso"],"redirectUri":[1,"redirect-uri"],"authMethod":[1,"auth-method"],"keycloakUri":[1,"keycloak-uri"],"realm":[1],"clientId":[1,"client-id"],"appId":[1,"app-id"],"portalUrl":[1,"portal-url"],"marketplaceUrl":[1,"marketplace-url"],"plmUrl":[1,"plm-url"],"usageTrackingUrl":[1,"usage-tracking-url"],"showUnauthorizedModal":[4,"show-unauthorized-modal"],"postTextDelayDuration":[2,"post-text-delay-duration"],"primaryColor":[1,"primary-color"],"accentColor":[1,"accent-color"],"keycloak":[32],"isAuth":[32],"givenUserName":[32],"silentCheckSsoRedirectUri":[32],"appList":[32],"showPostLoginLoadingSpinner":[32],"avatarSvg":[32]}]]]], options);
20
+ return index.bootstrapLazy([["dash-button.cjs",[[1,"dash-button",{"showPostLoginText":[4,"show-post-login-text"],"silentCheckSso":[4,"silent-check-sso"],"redirectUri":[1,"redirect-uri"],"authMethod":[1,"auth-method"],"keycloakUri":[1,"keycloak-uri"],"realm":[1],"clientId":[1,"client-id"],"appId":[1,"app-id"],"portalUrl":[1,"portal-url"],"marketplaceUrl":[1,"marketplace-url"],"plmUrl":[1,"plm-url"],"usageTrackingUrl":[1,"usage-tracking-url"],"showUnauthorizedModal":[4,"show-unauthorized-modal"],"postTextDelayDuration":[2,"post-text-delay-duration"],"primaryColor":[1,"primary-color"],"accentColor":[1,"accent-color"],"otherLinkType":[1,"other-link-type"],"applicationDisplayName":[1,"application-display-name"],"disableApplicationTab":[4,"disable-application-tab"],"keycloak":[32],"isAuth":[32],"givenUserName":[32],"silentCheckSsoRedirectUri":[32],"appList":[32],"menuLinkList":[32],"showPostLoginLoadingSpinner":[32],"avatarSvg":[32]}]]]], options);
21
21
  });
22
22
 
23
23
  exports.setNonce = index.setNonce;
@@ -50,6 +50,15 @@
50
50
  border-radius: 4px;
51
51
  }
52
52
 
53
+ .profile-image {
54
+ display: flex;
55
+ margin-left: 4px;
56
+ width: 40px;
57
+ height: 40px;
58
+ border-radius: 4px;
59
+ background-color: #fff;
60
+ }
61
+
53
62
  .button-text-full-width {
54
63
  width: auto!important;
55
64
  }
@@ -443,4 +452,122 @@
443
452
  background: currentColor;
444
453
  left: 5px;
445
454
  bottom: 5px
455
+ }
456
+
457
+ .gg-link {
458
+ box-sizing: border-box;
459
+ position: relative;
460
+ transform: rotate(-45deg) scale(var(--ggs, 1));
461
+ width: 8px;
462
+ height: 2px;
463
+ border-bottom: 2px solid;
464
+ margin-bottom: 5px;
465
+ margin-right: 14px;
466
+ margin-left: 6px;
467
+ }
468
+ .gg-link::after,
469
+ .gg-link::before {
470
+ content: "";
471
+ display: block;
472
+ box-sizing: border-box;
473
+ position: absolute;
474
+ border-radius: 3px;
475
+ width: 8px;
476
+ height: 10px;
477
+ border: 2px solid;
478
+ top: -4px;
479
+ }
480
+ .gg-link::before {
481
+ border-right: 0;
482
+ border-top-left-radius: 40px;
483
+ border-bottom-left-radius: 40px;
484
+ left: -6px;
485
+ }
486
+ .gg-link::after {
487
+ border-left: 0;
488
+ border-top-right-radius: 40px;
489
+ border-bottom-right-radius: 40px;
490
+ right: -6px;
491
+ }
492
+
493
+ .other-links-list {
494
+ /* display: flex;
495
+ justify-content: space-between; */
496
+ padding: 14px;
497
+ background-color: #f1f1f1;
498
+ margin-bottom: 8px;
499
+ text-align: start;
500
+ border-radius: 5px;
501
+ }
502
+
503
+ /* .box {
504
+ box-shadow: 0 3px 12px rgba(0,0,0,0.15);
505
+ background-color: #fff;
506
+ border-radius: 3px;
507
+ overflow: hidden;
508
+ } */
509
+
510
+ .tab-list {
511
+ margin: 0px 40px;
512
+ padding: 0;
513
+ list-style: none;
514
+ display: flex;
515
+ position: relative;
516
+ width: 85%;
517
+ border-bottom: 1px solid #aaa;
518
+ }
519
+
520
+ /* .tab-list::before {
521
+ content: '';
522
+ display: block;
523
+ height: 2px;
524
+ width: 50%;
525
+ position: absolute;
526
+ bottom: 0;
527
+ background-color: #aaa;
528
+ transition: .3s;
529
+ } */
530
+
531
+ .tab-item {
532
+ flex: 1;
533
+ text-align: center;
534
+ transition: .3s;
535
+ opacity: 0.5;
536
+ }
537
+
538
+ .tab-toggle {
539
+ display: none;
540
+ }
541
+
542
+ .tab-content {
543
+ display: none;
544
+ }
545
+
546
+ .tab-toggle:nth-child(1):checked ~ .tab-list .tab-item:nth-child(1),
547
+ .tab-toggle:nth-child(2):checked ~ .tab-list .tab-item:nth-child(2) {
548
+ opacity: 1;
549
+ color: #008168;
550
+ border-bottom: 2px solid #008168;
551
+ }
552
+
553
+ .tab-toggle:nth-child(2):checked ~ .tab-list::before {
554
+ transform: translateX(100%);
555
+ }
556
+
557
+ .tab-toggle:nth-child(3):checked ~ .tab-list::before {
558
+ transform: translateX(200%);
559
+ }
560
+
561
+ .tab-toggle:nth-child(1):checked ~ .tab-container .tab-content:nth-child(1),
562
+ .tab-toggle:nth-child(2):checked ~ .tab-container .tab-content:nth-child(2) {
563
+ display: block;
564
+ }
565
+
566
+ .tab-trigger {
567
+ display: block;
568
+ padding: 10px 0;
569
+ }
570
+
571
+ .tab-container {
572
+ padding: 15px 30px;
446
573
  }
@@ -19,6 +19,9 @@ export class DashButtonComponent {
19
19
  this.postTextDelayDuration = undefined;
20
20
  this.primaryColor = "";
21
21
  this.accentColor = "";
22
+ this.otherLinkType = undefined;
23
+ this.applicationDisplayName = "Applications";
24
+ this.disableApplicationTab = false;
22
25
  this.keycloak = new Keycloak({
23
26
  url: this.keycloakUri,
24
27
  realm: this.realm,
@@ -28,6 +31,7 @@ export class DashButtonComponent {
28
31
  this.givenUserName = "";
29
32
  this.silentCheckSsoRedirectUri = window.location.origin + '/assets/verificar-sso.html';
30
33
  this.appList = [];
34
+ this.menuLinkList = [];
31
35
  this.showPostLoginLoadingSpinner = false;
32
36
  this.avatarSvg = toSvg("init-avatar", 40);
33
37
  }
@@ -89,6 +93,12 @@ export class DashButtonComponent {
89
93
  }
90
94
  }
91
95
  });
96
+ // Set other menu links
97
+ this.getOtherMenuLinks(_token).then(res => {
98
+ if (res.links) {
99
+ this.menuLinkList = res.links;
100
+ }
101
+ });
92
102
  }
93
103
  });
94
104
  }
@@ -103,6 +113,7 @@ export class DashButtonComponent {
103
113
  if (res) {
104
114
  this.isAuth = true;
105
115
  localStorage.setItem("keycloak", JSON.stringify(this.keycloak));
116
+ // document.cookie = "DASH_BTN=" + JSON.parse(localStorage.getItem('keycloak')).token;
106
117
  document.cookie = "ZDZW_cookie=" + JSON.parse(localStorage.getItem('keycloak')).token;
107
118
  // Set userName
108
119
  this.givenUserName = JSON.parse(localStorage.getItem('keycloak')).idTokenParsed.preferred_username;
@@ -126,11 +137,21 @@ export class DashButtonComponent {
126
137
  const jsonObj = await response.json();
127
138
  return jsonObj;
128
139
  }
140
+ async getOtherMenuLinks(token) {
141
+ const response = await fetch(this.portalUrl + '/developer/dashbutton-link/' + this.otherLinkType, {
142
+ headers: new Headers({
143
+ 'Authorization': 'Bearer ' + token,
144
+ }),
145
+ });
146
+ const jsonObj = await response.json();
147
+ return jsonObj;
148
+ }
129
149
  login() {
130
150
  this.keycloak.login();
131
151
  }
132
152
  logout() {
133
153
  localStorage.removeItem("keycloak");
154
+ // document.cookie = "DASH_BTN=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
134
155
  document.cookie = "ZDZW_cookie=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
135
156
  this.keycloak.logout();
136
157
  }
@@ -143,7 +164,7 @@ export class DashButtonComponent {
143
164
  appModal.style.display = "none";
144
165
  }
145
166
  render() {
146
- return h("div", { key: '8451f0ebb8dc515f8ad6c5ca6dedbf4799c251ae' }, h("div", { key: 'a692626bea0cc06ce19d306573bd99f176edcb6b' }, (() => {
167
+ return h("div", { key: '645060a56354d6be3af1573e6bae0620176e4ea5' }, h("div", { key: '4809ca705f0b27e9c6b28523719d66e436c5e614' }, (() => {
147
168
  if (this.isAuth && this.showPostLoginText) {
148
169
  // User set post-text-delay-duration for displaying loading spinner
149
170
  if (this.showPostLoginLoadingSpinner) {
@@ -154,14 +175,19 @@ export class DashButtonComponent {
154
175
  }
155
176
  }
156
177
  else if (this.isAuth) {
157
- 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" }, 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" }, h("span", { class: "gg-menu-grid-r" }))), 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)), h("a", { onClick: this.showModal.bind(this), id: "applications-btn" }, h("i", { style: { color: this.primaryColor != undefined ? this.primaryColor : "" }, class: "menu-bar-icons gg-microsoft" }), "Applications"), h("a", { href: this.portalUrl, target: '_blank', id: "applications-btn" }, h("i", { style: { color: this.primaryColor != undefined ? this.primaryColor : "" }, class: "menu-bar-icons gg-ereader" }), "Portal"), h("a", { href: this.marketplaceUrl, target: '_blank', id: "applications-btn" }, h("i", { style: { color: this.primaryColor != undefined ? this.primaryColor : "" }, class: "menu-bar-icons gg-display-flex" }), "Marketplace"), h("a", { href: this.usageTrackingUrl, target: '_blank', id: "applications-btn" }, h("i", { style: { color: this.primaryColor != undefined ? this.primaryColor : "" }, class: "menu-bar-icons gg-align-bottom" }), "Usage Tracking"), h("a", { onClick: this.logout.bind(this), id: "logout-btn" }, h("i", { style: { color: this.primaryColor != undefined ? this.primaryColor : "" }, class: "menu-bar-icons gg-log-out" }), "Logout"))));
178
+ 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 ?
179
+ h("img", { class: "profile-image", src: "https://s-damith.github.io/test-avatar/images/e24da9c5-0b1f-46fa-82cd-7c711c77b5c7.png" })
180
+ :
181
+ 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" }, h("span", { class: "gg-menu-grid-r" }))), 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)), h("a", { onClick: this.showModal.bind(this), id: "applications-btn" }, h("i", { style: { color: this.primaryColor != undefined ? this.primaryColor : "" }, class: "menu-bar-icons gg-microsoft" }), this.applicationDisplayName), h("a", { href: this.portalUrl, target: '_blank', id: "applications-btn" }, h("i", { style: { color: this.primaryColor != undefined ? this.primaryColor : "" }, class: "menu-bar-icons gg-ereader" }), "Portal"), h("a", { href: this.marketplaceUrl, target: '_blank', id: "applications-btn" }, h("i", { style: { color: this.primaryColor != undefined ? this.primaryColor : "" }, class: "menu-bar-icons gg-display-flex" }), "Marketplace"), h("a", { onClick: this.logout.bind(this), id: "logout-btn" }, h("i", { style: { color: this.primaryColor != undefined ? this.primaryColor : "" }, class: "menu-bar-icons gg-log-out" }), "Logout"))));
158
182
  }
159
183
  else {
160
184
  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")));
161
185
  }
162
- })()), h("div", { key: 'e1dda02d64589c23ad34f960d06f513d58561d89', id: "appListModal", class: "modal" }, h("div", { key: 'a87345411f0eae5d56c7d52d4e6ac08009d627be', class: "modal-content" }, h("span", { key: '8523744cf95ec9a2144be6b1bb03002989d1801a', onClick: this.closeModal.bind(this), class: "close" }, "\u00D7"), h("h3", { key: 'ff6cd4a2f5f461fd049f026c2653044f4e7935c4' }, "Applications"), h("div", { key: 'f5fd583072b547677a197e8471b09103a8fba631', class: "modal-body" }, this.appList.length > 0 ? this.appList.map(app => {
186
+ })()), h("div", { key: '8e9383c347949feb8ee6e74bd2bc8fe2a6695861', id: "appListModal", class: "modal" }, h("div", { key: '823a614f1910f9ecd4f99e5517302e06c11fe12f', class: "modal-content" }, h("span", { key: '84ae8783a22d649631b6e0da9becc087ed0824dd', onClick: this.closeModal.bind(this), class: "close" }, "\u00D7"), h("div", { key: 'bbe7b4cc099600759736a99047560b52faf3c7fa', 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: '7aca201ec0c436e8902215ebe9405189a4c9f21a', class: "tab-list" }, (!this.disableApplicationTab) && h("li", { class: "tab-item" }, h("label", { class: "tab-trigger", htmlFor: "tab1" }, h("i", { style: { color: this.primaryColor != undefined ? this.primaryColor : "" }, class: "menu-bar-icons gg-ereader" }), " ", this.applicationDisplayName)), (this.menuLinkList.length != 0) && h("li", { class: "tab-item" }, h("label", { class: "tab-trigger", htmlFor: "tab2" }, h("i", { style: { color: this.primaryColor != undefined ? this.primaryColor : "" }, class: "menu-bar-icons gg-link" }), " More links"))), h("div", { key: 'd79fd171d56b9da0cee3b664f472bc0884a9c110', class: "tab-container" }, h("div", { key: '9e55949eef5865acc805b3264a25af18d7d35f5c', class: "tab-content" }, h("div", { key: 'a0e957f721c39173a4bb21ce06a2c5a57f1ad546', class: "modal-body" }, this.appList.length > 0 ? this.appList.map(app => {
163
187
  return (h("a", { class: "external-app-link", target: '_blank', href: "https://" + app.shortname + "-zdzw" + this.portalUrl.replace(/(^\w+:|^)\/\//, '').replace('portal-frontend-zdzw', '') }, h("div", { class: "modal-app" }, h("div", null, app.name))));
164
- }) : h("div", null, h("h3", { class: "gray-text" }, "Not installed application found."), " ", h("p", { class: "gray-text" }, "Please contact administration."))))), h("div", { key: '8dde166aebc15a7e33d4c1073e0c4d1c97774284', id: "appPermissionErrorModal", class: "modal" }, h("div", { key: '34f20d3951e5b1cbfc5e457f1eb5782cc490e432', class: "modal-content" }, h("img", { key: '6fe23bcf521cd8ab5288d0c82c63669562acace3', src: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAACXBIWXMAAAsTAAALEwEAmpwYAAAGD0lEQVR4nO2cbU8TWRTH/W5WEAmF4nNiieFFoeBjYhQUWzUWYkpbDfGFCR9CoolvQF9aWgG3kMCG8LACC1ikuCuUh7bH/M/MmW131S2ZqTDjPcmkdub2tvPj3HP/55yJR44oU6ZMmTJlyg7YOsL9pI7+shkogGFzDqMAhhVAOsiQozwwrACS8sCwfXd+tYTDCiApDwwf/FJUSzisAJKjNhFlPzYF0KQpgCZNATRpCqBJUwBNmgJo0hRAk6YAmjQF0KkAs4uLtPz8OU2HQpRqaaFkQwPFq6v5SHo8fA7XVgYGKLu0dGC/81ABLORylB4cpInLl+nt0aP7OiauXKH00BAV8vlfE2AmkaCxpiYDSKK6mqaammjx+nX6FAzS348e0VYkwgf+jXO4Nun18lj53PuLF2kjmfx1AOa3t2mmt9cAkDxxghauXaPN3l7KxmJlHRgLmKNutzHPTCTCczsa4G4mQ6nWVr7h4WPHaL6trQTc+r17NOf30/iZMzTmdtNwVRWPA2Scm/H56FMgQNlolMfDO/9ob+cxmDPl99PuxoYzAe5mMrzcxOvWAALgolFauXmTxurry45/gPvn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BZh8/dlhb06+Vs9B6FIi4cYmJInGgEyGIkbHgc8idkWHgHHRecVsTMU/mwuuY3tYcv3TJWW1NGJrdJY113WtkdxaJU84BqSK7rRFXdc/Dd+w5rbFeDHG8rc2IiQj2UmwQsY1iKFIxlKSg46AjARfnkGGISOZHO6JRnkNiHjzPsY92iGFZoultLNu6OtZs+3m4CCIZnxGpIjGvUsv2UAEUQ9NblrSUoNDDQP4KT+TH2/QWJT/eFgjwNaRnnGHI4x3NzRXZbQ89QBg0GsQ2Wo+SnZR1uFycYbBI3kdv2XEAiw35KqQMGkDoYaCeaDzi29jIuziuYYyVua1jANrFFECTpgCaNAXQpCmAJk0BNGkKoElTACsNUB39ZTFQAMMW/78xypQpU6ZMmbIjP9e+AkAlsBlIjsPOAAAAAElFTkSuQmCC" }), h("h2", { key: '307e89e5e88655aaa9788c13f738c9361cab0903', class: "green-text margin-b" }, "You don't have permission to access this application."), h("h3", { key: '1be6f7dd8e590d99b8933ba770c16b386779d77b', class: "green-text" }, "Please contact the administration."), (this.portalUrl && this.showUnauthorizedModal) ?
188
+ }) : h("div", null, h("h3", { class: "gray-text" }, "Not installed ", this.applicationDisplayName, " found."), " ", h("p", { class: "gray-text" }, "Please contact administration.")))), h("div", { key: 'ebffa0a5fe4ba4409ce365634e2c420d9ac75558', class: "tab-content" }, h("div", { key: '43048ac28c32d4395c8aa11ce624689fe494fdfd', class: "modal-body" }, this.menuLinkList.map(link => {
189
+ return (h("a", { class: "external-app-link", target: '_blank', href: link.url }, h("div", { class: "modal-app" }, h("div", null, link.name))));
190
+ }))))))), h("div", { key: '1b72a38ac2f73fb79063f0697624495ef15e31ee', id: "appPermissionErrorModal", class: "modal" }, h("div", { key: 'bc361ed356640750a94d1959278a63b48b73c7a7', class: "modal-content" }, h("img", { key: 'bd1c05b0cfe517146904956f8579b9ab2725082e', src: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAACXBIWXMAAAsTAAALEwEAmpwY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xx9fZbDE4NO5LTO5+OxCB14P93dbT+AKZ9P84ZgkG8GqRjeQ9ZUAh4MYhvXxs+e5fHwRBbWra32A5j0ePjHf9H1mST+2YWFisCDba+u8vV3tbWGNuT3jY32AxjXS06QFLgZKUH9aPct7O3RVFfXf+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: '6baced0f593f104cd8de647d6f2fd29d30e5e21a', class: "green-text margin-b" }, "You don't have permission to access this application."), h("h3", { key: '97274ef241e9f7bc05384f87ff5ba822791886ee', class: "green-text" }, "Please contact the administration."), (this.portalUrl && this.showUnauthorizedModal) ?
165
191
  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" }))))
166
192
  : h("div", null))));
167
193
  }
@@ -464,6 +490,59 @@ export class DashButtonComponent {
464
490
  "attribute": "accent-color",
465
491
  "reflect": false,
466
492
  "defaultValue": "\"\""
493
+ },
494
+ "otherLinkType": {
495
+ "type": "string",
496
+ "mutable": false,
497
+ "complexType": {
498
+ "original": "string",
499
+ "resolved": "string",
500
+ "references": {}
501
+ },
502
+ "required": false,
503
+ "optional": false,
504
+ "docs": {
505
+ "tags": [],
506
+ "text": ""
507
+ },
508
+ "attribute": "other-link-type",
509
+ "reflect": false
510
+ },
511
+ "applicationDisplayName": {
512
+ "type": "string",
513
+ "mutable": false,
514
+ "complexType": {
515
+ "original": "string",
516
+ "resolved": "string",
517
+ "references": {}
518
+ },
519
+ "required": false,
520
+ "optional": false,
521
+ "docs": {
522
+ "tags": [],
523
+ "text": ""
524
+ },
525
+ "attribute": "application-display-name",
526
+ "reflect": false,
527
+ "defaultValue": "\"Applications\""
528
+ },
529
+ "disableApplicationTab": {
530
+ "type": "boolean",
531
+ "mutable": false,
532
+ "complexType": {
533
+ "original": "boolean",
534
+ "resolved": "boolean",
535
+ "references": {}
536
+ },
537
+ "required": false,
538
+ "optional": false,
539
+ "docs": {
540
+ "tags": [],
541
+ "text": ""
542
+ },
543
+ "attribute": "disable-application-tab",
544
+ "reflect": false,
545
+ "defaultValue": "false"
467
546
  }
468
547
  };
469
548
  }
@@ -474,6 +553,7 @@ export class DashButtonComponent {
474
553
  "givenUserName": {},
475
554
  "silentCheckSsoRedirectUri": {},
476
555
  "appList": {},
556
+ "menuLinkList": {},
477
557
  "showPostLoginLoadingSpinner": {},
478
558
  "avatarSvg": {}
479
559
  };
@@ -1 +1 @@
1
- {"version":3,"file":"dash-button.js","sourceRoot":"","sources":["../../../src/components/my-component/dash-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAOlC,MAAM,OAAO,mBAAmB;;iCAIO,KAAK;8BACR,KAAK;;0BAEV,WAAW;2BAEV,uBAAuB;qBAC7B,EAAE;wBACC,EAAE;qBAEL,EAAE;yBACE,EAAE;8BACG,iDAAiD;sBACzD,2DAA2D;gCACjD,uDAAuD;qCACjD,KAAK;;4BAGf,EAAE;2BACH,EAAE;wBAEP,IAAI,QAAQ,CAAC;YACpC,GAAG,EAAE,IAAI,CAAC,WAAW;YACrB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB,CAAC;sBAEgB,KAAK;6BACU,EAAE;yCACW,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,4BAA4B;uBAEhF,EAAE;2CAEkB,KAAK;yBACvB,KAAK,CAAC,aAAa,EAAE,EAAE,CAAC;;IAT1C,CAAC;IAWJ,iBAAiB;QACf,EAAE;QACF,mEAAmE;QACnE,EAAE;QACF,IAAG,IAAI,CAAC,qBAAqB,GAAG,CAAC,EAAE,CAAC;YAClC,uBAAuB;YACvB,IAAI,CAAC,2BAA2B,GAAG,IAAI,CAAA;YACvC,2DAA2D;YAC3D,UAAU,CAAC,GAAG,EAAE;gBACd,IAAI,CAAC,2BAA2B,GAAG,KAAK,CAAA;YAC1C,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAC;QACjC,CAAC;QAED,EAAE;QACF,gBAAgB;QAChB,EAAE;QACF,IAAI,CAAC,YAAY,EAAE,CAAC,IAAI,CAAC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DAAK,EAAE,EAAC,yBAAyB,EAAC,KAAK,EAAC,OAAO;gBAC7C,4DAAK,KAAK,EAAC,eAAe;oBACxB,4DAAK,GAAG,EAAC,opEAAopE,GAAE;oBAC/pE,2DAAI,KAAK,EAAC,qBAAqB,4DAA2D;oBAC1F,2DAAI,KAAK,EAAC,YAAY,yCAAwC;oBAE3D,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC;wBAC7C;4BACE,UAAI,KAAK,EAAC,WAAW,0DAAyD;4BAC5E,WAAK,EAAE,EAAC,WAAW;gCACnB,WAAK,EAAE,EAAC,kBAAkB,GAAO;gCACjC;oCACE,cAAQ,CAAC,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,GAAU,CACpC,CACF,CACF;wBACR,CAAC,CAAC,cAAW,CAEb,CACF,CAEF,CAAC;IACP,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, State, h, Element } from '@stencil/core';\nimport Keycloak from \"keycloak-js\";\nimport { toSvg } from \"jdenticon\";\n\n@Component({\n tag: 'dash-button',\n styleUrl: 'dash-button.css',\n shadow: true,\n})\nexport class DashButtonComponent {\n\n @Element() el;\n \n @Prop() showPostLoginText: boolean = false;\n @Prop() silentCheckSso: boolean = false;\n @Prop() redirectUri: string;\n @Prop() authMethod: string = \"check-sso\";\n\n @Prop() keycloakUri: string = \"http://localhost:8080\";\n @Prop() realm: string = \"\";\n @Prop() clientId: string = \"\";\n\n @Prop() appId: string = \"\";\n @Prop() portalUrl: string = \"\";\n @Prop() marketplaceUrl: string = \"https://marketplace-zdzw.cloud.zdzw-project.com\";\n @Prop() plmUrl: string = \"https://productlicensemanager-zdzw.cloud.zdzw-project.com\";\n @Prop() usageTrackingUrl: string = \"https://usage-tracking-ui-zdzw.cloud.zdzw-project.com\";\n @Prop() showUnauthorizedModal: boolean = false;\n @Prop() postTextDelayDuration: number;\n\n @Prop() primaryColor: string = \"\";\n @Prop() accentColor: string = \"\";\n\n @State() keycloak: any = new Keycloak({\n url: this.keycloakUri,\n realm: this.realm,\n clientId: this.clientId,\n });;\n\n @State() isAuth = false;\n @State() givenUserName: string = \"\";\n @State() silentCheckSsoRedirectUri: string = window.location.origin + '/assets/verificar-sso.html';\n\n @State() appList = []\n\n @State() showPostLoginLoadingSpinner = false;\n @State() avatarSvg = toSvg(\"init-avatar\", 40);\n\n componentWillLoad() {\n //\n // User set post-text-delay-duration for displaying loading spinner\n //\n if(this.postTextDelayDuration > 0) {\n // Show loading spinner\n this.showPostLoginLoadingSpinner = true\n // Removing a loading spinner after the delay period ending\n setTimeout(() => {\n this.showPostLoginLoadingSpinner = false\n }, this.postTextDelayDuration);\n }\n\n //\n // Init Keycloak\n //\n this.initKeycloak().then(() => {\n // Check if the user is authenticated\n if(this.isAuth) {\n const _token = JSON.parse(localStorage.getItem('keycloak')).token\n \n this.getAppList(_token).then(res => {\n this.appList = res\n\n // If the user has set an app ID, check if they have permission to access\n if(this.appId) {\n \n // Retrieve the list of buttons that are configured to set the app ID\n const appIdList = this.appId.replace(/'/g, '').split(',');\n // Remote appID list parsed from object\n const tempAppList = this.appList.map(obj => obj['shortname'])\n\n // Check if the user has permission to access the selected application\n if(appIdList.filter(id => tempAppList.includes(id)).length == 0) {\n // Update local storage app permission\n localStorage.setItem(\"ZDZW_app_permission\", JSON.stringify(false));\n\n // Show modal\n const appErrorModal = this.el.shadowRoot.querySelector('#appPermissionErrorModal');\n appErrorModal.style.display = \"block\";\n\n // If a redirect URL is provided, show the loading spinner\n if (this.portalUrl && this.showUnauthorizedModal) {\n var countdownNumberEl = this.el.shadowRoot.getElementById('countdown-number');\n var countdown = 6;\n\n countdownNumberEl.textContent = countdown.toString();\n\n setInterval(() => {\n countdown = --countdown <= 0 ? 6 : countdown;\n countdownNumberEl.textContent = countdown.toString();\n\n // Once the countdown finishes, redirect to the provided URL\n if(countdown == 1) {\n // appErrorModal.style.display = \"none\";\n window.location.replace(this.portalUrl.toString());\n }\n }, 1000);\n }\n } else {\n // The user is authenticated and has the necessary permissions\n // Update local storage app permission\n localStorage.setItem(\"ZDZW_app_permission\", JSON.stringify(true));\n }\n }\n\n })\n }\n })\n }\n\n async initKeycloak() {\n // Remove the initiation time permission localstorage object\n localStorage.removeItem(\"ZDZW_app_permission\");\n\n await this.keycloak.init(\n {\n onLoad: this.authMethod,\n checkLoginIframe: false,\n silentCheckSsoRedirectUri: this.silentCheckSso ? this.silentCheckSsoRedirectUri : '',\n }).then(res => {\n if(res) {\n this.isAuth = true\n localStorage.setItem(\"keycloak\", JSON.stringify(this.keycloak));\n document.cookie = \"ZDZW_cookie=\" + JSON.parse(localStorage.getItem('keycloak')).token;\n\n // Set userName\n this.givenUserName = JSON.parse(localStorage.getItem('keycloak')).idTokenParsed.preferred_username\n\n // Set user avatar\n this.avatarSvg = toSvg(JSON.parse(localStorage.getItem('keycloak')).idTokenParsed.sub, 40);\n } \n });\n }\n\n async getAppList(token) {\n // const token = await JSON.parse(localStorage.getItem('keycloak')).token;\n // const response = await fetch(this.marketplaceUrl + '/api/v1/product/nameAndShortName', {\n // headers: new Headers({\n // 'Authorization': 'Bearer ' + token,\n // }),\n // })\n\n const response = await fetch(this.plmUrl + '/api/v1/product/nameAndShortNameOrg', {\n headers: new Headers({\n 'Authorization': 'Bearer ' + token,\n }),\n })\n const jsonObj = await response.json()\n return jsonObj\n }\n\n login() { \n this.keycloak.login() \n }\n\n logout() {\n localStorage.removeItem(\"keycloak\");\n document.cookie = \"ZDZW_cookie=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;\";\n this.keycloak.logout() \n } \n\n showModal() {\n const appModal = this.el.shadowRoot.querySelector('#appListModal');\n appModal.style.display = \"block\";\n }\n\n closeModal() {\n const appModal = this.el.shadowRoot.querySelector('#appListModal');\n appModal.style.display = \"none\";\n }\n\n render() {\n return <div>\n <div>\n {\n (() => {\n if(this.isAuth && this.showPostLoginText) {\n // User set post-text-delay-duration for displaying loading spinner\n if(this.showPostLoginLoadingSpinner) {\n return (\n <a id=\"login-btn\" class=\"button button-link\">\n <div class=\"lds-ring\"><div></div><div></div><div></div><div></div></div>\n </a>\n )\n } else {\n return (\n <a style={{background: this.primaryColor != undefined? this.primaryColor : \"\"}} href={this.redirectUri} id=\"login-btn\" class=\"button button-link\">\n <span style={{color: this.accentColor != undefined? this.accentColor : \"\"}} class=\"button-text button-text-full-width\">Go to Dashboard</span>\n </a>\n )\n }\n \n } else if (this.isAuth) {\n return (\n <div id=\"profile-btn\" class=\"dropdown\">\n <button style={{background: this.primaryColor != undefined? this.primaryColor : \"\"}} type=\"button\" class=\"button\">\n <span class=\"button-profile\">\n <div innerHTML={this.avatarSvg}/>\n </span>\n <span style={{color: this.accentColor != undefined? this.accentColor : \"\"}} id=\"given-name\" class=\"button-text\">{this.givenUserName}</span>\n <div class=\"button-icon\">\n <span class=\"gg-menu-grid-r\"></span>\n </div>\n </button>\n <div class=\"dropdown-content\">\n <div class=\"dropdown-user-profile\">\n <div class=\"username\">@{this.givenUserName}</div>\n <div class=\"first-last-name\">{JSON.parse(localStorage.getItem('keycloak')).idTokenParsed.name}</div>\n </div>\n <a onClick={this.showModal.bind(this)} id=\"applications-btn\"><i style={{color: this.primaryColor != undefined? this.primaryColor : \"\"}} class=\"menu-bar-icons gg-microsoft\"></i>Applications</a>\n <a href={this.portalUrl} target='_blank' id=\"applications-btn\"><i style={{color: this.primaryColor != undefined? this.primaryColor : \"\"}} class=\"menu-bar-icons gg-ereader\"></i>Portal</a>\n <a href={this.marketplaceUrl} target='_blank' id=\"applications-btn\"><i style={{color: this.primaryColor != undefined? this.primaryColor : \"\"}} class=\"menu-bar-icons gg-display-flex\"></i>Marketplace</a>\n <a href={this.usageTrackingUrl} target='_blank' id=\"applications-btn\"><i style={{color: this.primaryColor != undefined? this.primaryColor : \"\"}} class=\"menu-bar-icons gg-align-bottom\"></i>Usage Tracking</a>\n <a onClick={this.logout.bind(this)} id=\"logout-btn\"><i style={{color: this.primaryColor != undefined? this.primaryColor : \"\"}} class=\"menu-bar-icons gg-log-out\"></i>Logout</a>\n </div>\n </div>\n )\n } else {\n return (\n <button style={{background: this.primaryColor != undefined? this.primaryColor : \"\"}} onClick={this.login.bind(this)} id=\"login-btn\" type=\"button\" class=\"button\">\n <span style={{color: this.accentColor != undefined? this.accentColor : \"\"}} class=\"button-text\">Login</span>\n </button>\n )\n }\n })() \n } \n </div>\n \n <div id=\"appListModal\" class=\"modal\">\n \n <div class=\"modal-content\">\n <span onClick={this.closeModal.bind(this)} class=\"close\">&times;</span>\n <h3>Applications</h3>\n <div class=\"modal-body\">\n {this.appList.length > 0 ? this.appList.map( app => {\n return (\n <a class=\"external-app-link\" target='_blank' href={\"https://\" + app.shortname + \"-zdzw\"+ this.portalUrl.replace(/(^\\w+:|^)\\/\\//, '').replace('portal-frontend-zdzw','')}>\n <div class=\"modal-app\">\n <div>{app.name}</div>\n </div>\n </a>\n );\n }) : <div><h3 class=\"gray-text\">Not installed application found.</h3> <p class=\"gray-text\">Please contact administration.</p></div>}\n </div>\n </div>\n \n </div>\n\n <div id=\"appPermissionErrorModal\" class=\"modal\">\n <div class=\"modal-content\">\n <img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAACXBIWXMAAAsTAAALEwEAmpwYAAAGD0lEQVR4nO2cbU8TWRTH/W5WEAmF4nNiieFFo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8GqRjeQ9ZUAh4MYhvXxs+e5fHwRBbWra32A5j0ePjHf9H1mST+2YWFisCDba+u8vV3tbWGNuT3jY32AxjXS06QFLgZKUH9aPct7O3RVFfXf+BlHj6kZG2tBq+j47tpGs5LoYKrNpGI9v74cfsDHNazg+/dvFl4sNzmprHz2x5g8l9LWMTuzsePli7bYkMBgqVMfb39l3CqpeXbm0g8XhF439xEgkGjOmN7GTOjA4XU2Be8zs6y4MFmnzzRpJLfXypjenrsK6Qnvd4SSQGxCyFtNbxiIb1+/74mpL1e+wrp7NISp1ElqZwuZZB2WQkPZqRyevz7Eg5zCc22qVxxMUGWMRL94sTfKnjYfd+dPq15261bpcWEq1fJvuWsoSEt/3W7tRZlNMolJylxWQEPJTGRP6lTpwz5YpSz3ryxcUE1nzcaSeieFTeArIKH3Fq8GSX9koJqc7O9C6owNL0lO5CKsZTfzS7bqTt3+LPxornxKu2Cz6Oj5IymUkTLCOB54iWAKOIaMRE7JXbS/zOMwYYhMQ9/gOLOnPxBZh8/dlhb06+Vs9B6FIi4cYmJInGgEyGIkbHgc8idkWHgHHRecVsTMU/mwuuY3tYcv3TJWW1NGJrdJY113WtkdxaJU84BqSK7rRFXdc/Dd+w5rbFeDHG8rc2IiQj2UmwQsY1iKFIxlKSg46AjARfnkGGISOZHO6JRnkNiHjzPsY92iGFZoultLNu6OtZs+3m4CCIZnxGpIjGvUsv2UAEUQ9NblrSUoNDDQP4KT+TH2/QWJT/eFgjwNaRnnGHI4x3NzRXZbQ89QBg0GsQ2Wo+SnZR1uFycYbBI3kdv2XEAiw35KqQMGkDoYaCeaDzi29jIuziuYYyVua1jANrFFECTpgCaNAXQpCmAJk0BNGkKoElTACsNUB39ZTFQAMMW/78xypQpU6ZMmbIjP9e+AkAlsBlIjsPOAAAAAElFTkSuQmCC\"/>\n <h2 class=\"green-text margin-b\">You don't have permission to access this application.</h2>\n <h3 class=\"green-text\">Please contact the administration.</h3>\n \n {(this.portalUrl && this.showUnauthorizedModal) ? \n <div>\n <h4 class=\"gray-text\">You will be automatically redirected to the portal.</h4>\n <div id=\"countdown\">\n <div id=\"countdown-number\"></div>\n <svg>\n <circle r=\"18\" cx=\"20\" cy=\"20\"></circle>\n </svg>\n </div>\n </div>\n : <div></div>\n }\n </div>\n </div>\n\n </div>;\n }\n}\n"]}
1
+ {"version":3,"file":"dash-button.js","sourceRoot":"","sources":["../../../src/components/my-component/dash-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAOlC,MAAM,OAAO,mBAAmB;;iCAIO,KAAK;8BACR,KAAK;;0BAEV,WAAW;2BAEV,uBAAuB;qBAC7B,EAAE;wBACC,EAAE;qBAEL,EAAE;yBACE,EAAE;8BACG,iDAAiD;sBACzD,2DAA2D;gCACjD,uDAAuD;qCACjD,KAAK;;4BAGf,EAAE;2BACH,EAAE;;sCAGS,cAAc;qCACd,KAAK;wBAGrB,IAAI,QAAQ,CAAC;YACpC,GAAG,EAAE,IAAI,CAAC,WAAW;YACrB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB,CAAC;sBAEgB,KAAK;6BACU,EAAE;yCACW,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,4BAA4B;uBAEhF,EAAE;4BACG,EAAE;2CAEa,KAAK;yBACvB,KAAK,CAAC,aAAa,EAAE,EAAE,CAAC;;IAV1C,CAAC;IAYJ,iBAAiB;QACf,EAAE;QACF,mEAAmE;QACnE,EAAE;QACF,IAAG,IAAI,CAAC,qBAAqB,GAAG,CAAC,EAAE,CAAC;YAClC,uBAAuB;YACvB,IAAI,CAAC,2BAA2B,GAAG,IAAI,CAAA;YACvC,2DAA2D;YAC3D,UAAU,CAAC,GAAG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qBAAqB,4DAA2D;oBAC1F,2DAAI,KAAK,EAAC,YAAY,yCAAwC;oBAE3D,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC;wBAC7C;4BACE,UAAI,KAAK,EAAC,WAAW,0DAAyD;4BAC5E,WAAK,EAAE,EAAC,WAAW;gCACnB,WAAK,EAAE,EAAC,kBAAkB,GAAO;gCACjC;oCACE,cAAQ,CAAC,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,GAAU,CACpC,CACF,CACF;wBACR,CAAC,CAAC,cAAW,CAEb,CACF,CAEF,CAAC;IACP,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, State, h, Element } from '@stencil/core';\nimport Keycloak from \"keycloak-js\";\nimport { toSvg } from \"jdenticon\";\n\n@Component({\n tag: 'dash-button',\n styleUrl: 'dash-button.css',\n shadow: true,\n})\nexport class DashButtonComponent {\n\n @Element() el;\n \n @Prop() showPostLoginText: boolean = false;\n @Prop() silentCheckSso: boolean = false;\n @Prop() redirectUri: string;\n @Prop() authMethod: string = \"check-sso\";\n\n @Prop() keycloakUri: string = \"http://localhost:8080\";\n @Prop() realm: string = \"\";\n @Prop() clientId: string = \"\";\n\n @Prop() appId: string = \"\";\n @Prop() portalUrl: string = \"\";\n @Prop() marketplaceUrl: string = \"https://marketplace-zdzw.cloud.zdzw-project.com\";\n @Prop() plmUrl: string = \"https://productlicensemanager-zdzw.cloud.zdzw-project.com\";\n @Prop() usageTrackingUrl: string = \"https://usage-tracking-ui-zdzw.cloud.zdzw-project.com\";\n @Prop() showUnauthorizedModal: boolean = false;\n @Prop() postTextDelayDuration: number;\n\n @Prop() primaryColor: string = \"\";\n @Prop() accentColor: string = \"\";\n\n @Prop() otherLinkType: string;\n @Prop() applicationDisplayName: string = \"Applications\"\n @Prop() disableApplicationTab: boolean = false\n \n\n @State() keycloak: any = new Keycloak({\n url: this.keycloakUri,\n realm: this.realm,\n clientId: this.clientId,\n });;\n\n @State() isAuth = false;\n @State() givenUserName: string = \"\";\n @State() silentCheckSsoRedirectUri: string = window.location.origin + '/assets/verificar-sso.html';\n\n @State() appList = []\n @State() menuLinkList = []\n \n @State() showPostLoginLoadingSpinner = false;\n @State() avatarSvg = toSvg(\"init-avatar\", 40);\n\n componentWillLoad() {\n //\n // User set post-text-delay-duration for displaying loading spinner\n //\n if(this.postTextDelayDuration > 0) {\n // Show loading spinner\n this.showPostLoginLoadingSpinner = true\n // Removing a loading spinner after the delay period ending\n setTimeout(() => {\n this.showPostLoginLoadingSpinner = false\n }, this.postTextDelayDuration);\n }\n\n //\n // Init Keycloak\n //\n this.initKeycloak().then(() => {\n // Check if the user is authenticated\n if(this.isAuth) {\n const _token = JSON.parse(localStorage.getItem('keycloak')).token\n \n this.getAppList(_token).then(res => {\n this.appList = res\n\n // If the user has set an app ID, check if they have permission to access\n if(this.appId) {\n \n // Retrieve the list of buttons that are configured to set the app ID\n const appIdList = this.appId.replace(/'/g, '').split(',');\n // Remote appID list parsed from object\n const tempAppList = this.appList.map(obj => obj['shortname'])\n\n // Check if the user has permission to access the selected application\n if(appIdList.filter(id => tempAppList.includes(id)).length == 0) {\n // Update local storage app permission\n localStorage.setItem(\"ZDZW_app_permission\", JSON.stringify(false));\n\n // Show modal\n const appErrorModal = this.el.shadowRoot.querySelector('#appPermissionErrorModal');\n appErrorModal.style.display = \"block\";\n\n // If a redirect URL is provided, show the loading spinner\n if (this.portalUrl && this.showUnauthorizedModal) {\n var countdownNumberEl = this.el.shadowRoot.getElementById('countdown-number');\n var countdown = 6;\n\n countdownNumberEl.textContent = countdown.toString();\n\n setInterval(() => {\n countdown = --countdown <= 0 ? 6 : countdown;\n countdownNumberEl.textContent = countdown.toString();\n\n // Once the countdown finishes, redirect to the provided URL\n if(countdown == 1) {\n // appErrorModal.style.display = \"none\";\n window.location.replace(this.portalUrl.toString());\n }\n }, 1000);\n }\n } else {\n // The user is authenticated and has the necessary permissions\n // Update local storage app permission\n localStorage.setItem(\"ZDZW_app_permission\", JSON.stringify(true));\n }\n }\n\n })\n\n // Set other menu links \n this.getOtherMenuLinks(_token).then(res => {\n if(res.links) {\n this.menuLinkList = res.links\n\n }\n })\n }\n })\n\n }\n\n async initKeycloak() {\n // Remove the initiation time permission localstorage object\n localStorage.removeItem(\"ZDZW_app_permission\");\n\n await this.keycloak.init(\n {\n onLoad: this.authMethod,\n checkLoginIframe: false,\n silentCheckSsoRedirectUri: this.silentCheckSso ? this.silentCheckSsoRedirectUri : '',\n }).then(res => {\n if(res) {\n this.isAuth = true\n localStorage.setItem(\"keycloak\", JSON.stringify(this.keycloak));\n // document.cookie = \"DASH_BTN=\" + JSON.parse(localStorage.getItem('keycloak')).token;\n document.cookie = \"ZDZW_cookie=\" + JSON.parse(localStorage.getItem('keycloak')).token;\n\n // Set userName\n this.givenUserName = JSON.parse(localStorage.getItem('keycloak')).idTokenParsed.preferred_username\n\n // Set user avatar\n this.avatarSvg = toSvg(JSON.parse(localStorage.getItem('keycloak')).idTokenParsed.sub, 40);\n } \n });\n }\n\n async getAppList(token) {\n // const token = await JSON.parse(localStorage.getItem('keycloak')).token;\n // const response = await fetch(this.marketplaceUrl + '/api/v1/product/nameAndShortName', {\n // headers: new Headers({\n // 'Authorization': 'Bearer ' + token,\n // }),\n // })\n\n const response = await fetch(this.plmUrl + '/api/v1/product/nameAndShortNameOrg', {\n headers: new Headers({\n 'Authorization': 'Bearer ' + token,\n }),\n })\n const jsonObj = await response.json()\n return jsonObj\n }\n\n async getOtherMenuLinks(token) {\n const response = await fetch(this.portalUrl + '/developer/dashbutton-link/'+ this.otherLinkType, {\n headers: new Headers({\n 'Authorization': 'Bearer ' + token,\n }),\n })\n const jsonObj = await response.json()\n return jsonObj\n }\n\n login() { \n this.keycloak.login() \n }\n\n logout() {\n localStorage.removeItem(\"keycloak\");\n // document.cookie = \"DASH_BTN=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;\";\n document.cookie = \"ZDZW_cookie=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;\";\n this.keycloak.logout() \n } \n\n showModal() {\n const appModal = this.el.shadowRoot.querySelector('#appListModal');\n appModal.style.display = \"block\";\n }\n\n closeModal() {\n const appModal = this.el.shadowRoot.querySelector('#appListModal');\n appModal.style.display = \"none\";\n }\n\n render() {\n return <div>\n <div>\n {\n (() => {\n if(this.isAuth && this.showPostLoginText) {\n // User set post-text-delay-duration for displaying loading spinner\n if(this.showPostLoginLoadingSpinner) {\n return (\n <a id=\"login-btn\" class=\"button button-link\">\n <div class=\"lds-ring\"><div></div><div></div><div></div><div></div></div>\n </a>\n )\n } else {\n return (\n <a style={{background: this.primaryColor != undefined? this.primaryColor : \"\"}} href={this.redirectUri} id=\"login-btn\" class=\"button button-link\">\n <span style={{color: this.accentColor != undefined? this.accentColor : \"\"}} class=\"button-text button-text-full-width\">Go to Dashboard</span>\n </a>\n )\n }\n \n } else if (this.isAuth) {\n return (\n <div id=\"profile-btn\" class=\"dropdown\">\n <button style={{background: this.primaryColor != undefined? this.primaryColor : \"\"}} type=\"button\" class=\"button\">\n <span class=\"button-profile\">\n {JSON.parse(localStorage.getItem('keycloak')).idTokenParsed.imageUrl ?\n <img class=\"profile-image\" src=\"https://s-damith.github.io/test-avatar/images/e24da9c5-0b1f-46fa-82cd-7c711c77b5c7.png\"/>\n :\n <div innerHTML={this.avatarSvg}/>\n }\n </span>\n <span style={{color: this.accentColor != undefined? this.accentColor : \"\"}} id=\"given-name\" class=\"button-text\">{this.givenUserName}</span>\n <div class=\"button-icon\">\n <span class=\"gg-menu-grid-r\"></span>\n </div>\n </button>\n <div class=\"dropdown-content\">\n <div class=\"dropdown-user-profile\">\n <div class=\"username\">@{this.givenUserName}</div>\n <div class=\"first-last-name\">{JSON.parse(localStorage.getItem('keycloak')).idTokenParsed.name}</div>\n </div>\n <a onClick={this.showModal.bind(this)} id=\"applications-btn\"><i style={{color: this.primaryColor != undefined? this.primaryColor : \"\"}} class=\"menu-bar-icons gg-microsoft\"></i>{this.applicationDisplayName}</a>\n <a href={this.portalUrl} target='_blank' id=\"applications-btn\"><i style={{color: this.primaryColor != undefined? this.primaryColor : \"\"}} class=\"menu-bar-icons gg-ereader\"></i>Portal</a>\n <a href={this.marketplaceUrl} target='_blank' id=\"applications-btn\"><i style={{color: this.primaryColor != undefined? this.primaryColor : \"\"}} class=\"menu-bar-icons gg-display-flex\"></i>Marketplace</a>\n <a onClick={this.logout.bind(this)} id=\"logout-btn\"><i style={{color: this.primaryColor != undefined? this.primaryColor : \"\"}} class=\"menu-bar-icons gg-log-out\"></i>Logout</a>\n </div>\n </div>\n )\n } else {\n return (\n <button style={{background: this.primaryColor != undefined? this.primaryColor : \"\"}} onClick={this.login.bind(this)} id=\"login-btn\" type=\"button\" class=\"button\">\n <span style={{color: this.accentColor != undefined? this.accentColor : \"\"}} class=\"button-text\">Login</span>\n </button>\n )\n }\n })() \n } \n </div>\n \n <div id=\"appListModal\" class=\"modal\">\n \n <div class=\"modal-content\">\n <span onClick={this.closeModal.bind(this)} class=\"close\">&times;</span>\n\n <div class=\"box\">\n {(!this.disableApplicationTab) && <input type=\"radio\" class=\"tab-toggle\" name=\"tab-toggle\" id=\"tab1\" checked/>}\n {(this.menuLinkList.length != 0) && <input type=\"radio\" class=\"tab-toggle\" name=\"tab-toggle\" id=\"tab2\" checked={this.disableApplicationTab}/>}\n\n <ul class=\"tab-list\">\n {(!this.disableApplicationTab) &&<li class=\"tab-item\">\n <label class=\"tab-trigger\" htmlFor=\"tab1\"><i style={{color: this.primaryColor != undefined? this.primaryColor : \"\"}} class=\"menu-bar-icons gg-ereader\"></i> {this.applicationDisplayName}</label>\n </li>}\n {(this.menuLinkList.length != 0) && <li class=\"tab-item\">\n <label class=\"tab-trigger\" htmlFor=\"tab2\"><i style={{color: this.primaryColor != undefined? this.primaryColor : \"\"}} class=\"menu-bar-icons gg-link\"></i> More links</label>\n </li>}\n </ul>\n \n <div class=\"tab-container\">\n <div class=\"tab-content\">\n <div class=\"modal-body\">\n {this.appList.length > 0 ? this.appList.map( app => {\n return (\n <a class=\"external-app-link\" target='_blank' href={\"https://\" + app.shortname + \"-zdzw\"+ this.portalUrl.replace(/(^\\w+:|^)\\/\\//, '').replace('portal-frontend-zdzw','')}>\n <div class=\"modal-app\">\n <div>{app.name}</div>\n </div>\n </a>\n );\n }) : <div><h3 class=\"gray-text\">Not installed {this.applicationDisplayName} found.</h3> <p class=\"gray-text\">Please contact administration.</p></div>}\n </div>\n </div>\n <div class=\"tab-content\">\n <div class=\"modal-body\">\n {\n this.menuLinkList.map(link => {\n return (\n <a class=\"external-app-link\" target='_blank' href={link.url}>\n <div class=\"modal-app\">\n <div>{link.name}</div>\n </div>\n </a>\n )\n })\n }\n </div>\n </div>\n </div>\n </div>\n\n {/* <h3>{this.applicationDisplayName}</h3>\n <div class=\"modal-body\">\n {this.appList.length > 0 ? this.appList.map( app => {\n return (\n <a class=\"external-app-link\" target='_blank' href={\"https://\" + app.shortname + \"-zdzw\"+ this.portalUrl.replace(/(^\\w+:|^)\\/\\//, '').replace('portal-frontend-zdzw','')}>\n <div class=\"modal-app\">\n <div>{app.name}</div>\n </div>\n </a>\n );\n }) : <div><h3 class=\"gray-text\">Not installed {this.applicationDisplayName} found.</h3> <p class=\"gray-text\">Please contact administration.</p></div>}\n </div> */}\n </div>\n \n </div>\n\n <div id=\"appPermissionErrorModal\" class=\"modal\">\n <div class=\"modal-content\">\n <img 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+f59nYjHlqtE38qwPTgoLHMeLeNRo2YB8+zEp7ExK1olI+Rujo+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YYyVua1jANrFFECTpgCaNAXQpCmAJk0BNGkKoElTACsNUB39ZTFQAMMW/78xypQpU6ZMmbIjP9e+AkAlsBlIjsPOAAAAAElFTkSuQmCC\"/>\n <h2 class=\"green-text margin-b\">You don't have permission to access this application.</h2>\n <h3 class=\"green-text\">Please contact the administration.</h3>\n \n {(this.portalUrl && this.showUnauthorizedModal) ? \n <div>\n <h4 class=\"gray-text\">You will be automatically redirected to the portal.</h4>\n <div id=\"countdown\">\n <div id=\"countdown-number\"></div>\n <svg>\n <circle r=\"18\" cx=\"20\" cy=\"20\"></circle>\n </svg>\n </div>\n </div>\n : <div></div>\n }\n </div>\n </div>\n\n </div>;\n }\n}\n"]}