dash-button-web 0.0.18 → 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.
- package/dist/cjs/dash-button.cjs.entry.js +198 -101
- package/dist/cjs/dash-button.cjs.entry.js.map +1 -1
- package/dist/cjs/{index-ad267eeb.js → index-87d4993d.js} +1 -5
- package/dist/cjs/index-87d4993d.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/web-compnont.cjs.js +2 -2
- package/dist/collection/components/my-component/dash-button.css +3 -3
- package/dist/collection/components/my-component/dash-button.js +91 -299
- package/dist/collection/components/my-component/dash-button.js.map +1 -1
- package/dist/collection/services/config.js +59 -0
- package/dist/collection/services/config.js.map +1 -0
- package/dist/collection/services/menu.js +52 -0
- package/dist/collection/services/menu.js.map +1 -0
- package/dist/components/dash-button.js +201 -115
- package/dist/components/dash-button.js.map +1 -1
- package/dist/esm/dash-button.entry.js +198 -101
- package/dist/esm/dash-button.entry.js.map +1 -1
- package/dist/esm/{index-46149754.js → index-e3df5eaf.js} +1 -5
- package/dist/{cjs/index-ad267eeb.js.map → esm/index-e3df5eaf.js.map} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/web-compnont.js +3 -3
- package/dist/types/components/my-component/dash-button.d.ts +8 -18
- package/dist/types/components.d.ts +0 -22
- package/dist/types/services/config.d.ts +47 -0
- package/dist/types/services/menu.d.ts +27 -0
- package/dist/web-compnont/p-63d22b03.entry.js +10 -0
- package/dist/web-compnont/p-63d22b03.entry.js.map +1 -0
- package/dist/web-compnont/p-c1ec12fe.js +3 -0
- package/dist/web-compnont/p-c1ec12fe.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/readme.md +49 -47
- package/dist/esm/index-46149754.js.map +0 -1
- package/dist/web-compnont/p-ac1910bb.entry.js +0 -10
- package/dist/web-compnont/p-ac1910bb.entry.js.map +0 -1
- package/dist/web-compnont/p-db53c3e9.js +0 -3
- package/dist/web-compnont/p-db53c3e9.js.map +0 -1
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-87d4993d.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"],"
|
|
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"],"appId":[1,"app-id"],"portalApiUrl":[1,"portal-api-url"],"plmUrl":[1,"plm-url"],"showUnauthorizedModal":[4,"show-unauthorized-modal"],"primaryColor":[1,"primary-color"],"accentColor":[1,"accent-color"],"keycloak":[32],"isAuth":[32],"givenUserName":[32],"silentCheckSsoRedirectUri":[32],"appList":[32],"avatarSvg":[32],"isLoading":[32],"config":[32],"localMenuLinks":[32],"organizationUrl":[32]}]]]], options);
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
exports.setNonce = index.setNonce;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-87d4993d.js');
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
8
|
Stencil Client Patch Browser v4.12.0 | MIT Licensed | https://stenciljs.com
|
|
@@ -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"],"
|
|
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"],"appId":[1,"app-id"],"portalApiUrl":[1,"portal-api-url"],"plmUrl":[1,"plm-url"],"showUnauthorizedModal":[4,"show-unauthorized-modal"],"primaryColor":[1,"primary-color"],"accentColor":[1,"accent-color"],"keycloak":[32],"isAuth":[32],"givenUserName":[32],"silentCheckSsoRedirectUri":[32],"appList":[32],"avatarSvg":[32],"isLoading":[32],"config":[32],"localMenuLinks":[32],"organizationUrl":[32]}]]]], options);
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
exports.setNonce = index.setNonce;
|
|
@@ -238,10 +238,10 @@
|
|
|
238
238
|
box-sizing: border-box;
|
|
239
239
|
display: block;
|
|
240
240
|
position: absolute;
|
|
241
|
-
width:
|
|
242
|
-
height:
|
|
241
|
+
width: 25px;
|
|
242
|
+
height: 25px;
|
|
243
243
|
margin: 3px;
|
|
244
|
-
border:
|
|
244
|
+
border: 2px solid currentColor;
|
|
245
245
|
border-radius: 50%;
|
|
246
246
|
animation: lds-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
|
|
247
247
|
border-color: currentColor transparent transparent transparent;
|
|
@@ -1,57 +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
10
|
this.redirectUri = undefined;
|
|
9
11
|
this.authMethod = "check-sso";
|
|
10
|
-
this.keycloakUri = "http://localhost:8080";
|
|
11
|
-
this.realm = "";
|
|
12
|
-
this.clientId = "";
|
|
13
12
|
this.appId = "";
|
|
14
|
-
this.portalUrl = "";
|
|
15
13
|
this.portalApiUrl = "";
|
|
16
14
|
this.plmUrl = "https://productlicensemanager-zdzw.cloud.zdzw-project.com";
|
|
17
|
-
this.usageTrackingUrl = "https://usage-tracking-ui-zdzw.cloud.zdzw-project.com";
|
|
18
15
|
this.showUnauthorizedModal = false;
|
|
19
|
-
this.postTextDelayDuration = undefined;
|
|
20
16
|
this.primaryColor = "";
|
|
21
17
|
this.accentColor = "";
|
|
22
|
-
this.
|
|
23
|
-
this.otherLinkDisplayName = "More links";
|
|
24
|
-
this.applicationDisplayName = "Applications";
|
|
25
|
-
this.disableApplicationTab = false;
|
|
26
|
-
this.menuViewType = "grid";
|
|
27
|
-
this.keycloak = new Keycloak({
|
|
28
|
-
url: this.keycloakUri,
|
|
29
|
-
realm: this.realm,
|
|
30
|
-
clientId: this.clientId,
|
|
31
|
-
});
|
|
18
|
+
this.keycloak = null;
|
|
32
19
|
this.isAuth = false;
|
|
33
20
|
this.givenUserName = "";
|
|
34
21
|
this.silentCheckSsoRedirectUri = window.location.origin + '/assets/verificar-sso.html';
|
|
35
22
|
this.appList = [];
|
|
36
|
-
this.menuLinkList = [];
|
|
37
|
-
this.mainMenuLinkList = [];
|
|
38
|
-
this.showPostLoginLoadingSpinner = false;
|
|
39
23
|
this.avatarSvg = toSvg("init-avatar", 40);
|
|
40
|
-
this.
|
|
24
|
+
this.isLoading = false;
|
|
25
|
+
this.config = undefined;
|
|
26
|
+
this.localMenuLinks = undefined;
|
|
27
|
+
this.organizationUrl = undefined;
|
|
41
28
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
//
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
if (this.
|
|
48
|
-
//
|
|
49
|
-
|
|
50
|
-
|
|
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;
|
|
51
39
|
setTimeout(() => {
|
|
52
|
-
this.
|
|
53
|
-
}, this.
|
|
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);
|
|
54
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
|
+
});
|
|
55
49
|
//
|
|
56
50
|
// Init Keycloak
|
|
57
51
|
//
|
|
@@ -59,10 +53,13 @@ export class DashButtonComponent {
|
|
|
59
53
|
// Check if the user is authenticated
|
|
60
54
|
if (this.isAuth) {
|
|
61
55
|
const _token = JSON.parse(localStorage.getItem('keycloak')).token;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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;
|
|
66
63
|
// Retrieve the list of buttons that are configured to set the app ID
|
|
67
64
|
const appIdList = this.appId.replace(/'/g, '').split(',');
|
|
68
65
|
// Remote appID list parsed from object
|
|
@@ -75,7 +72,7 @@ export class DashButtonComponent {
|
|
|
75
72
|
const appErrorModal = this.el.shadowRoot.querySelector('#appPermissionErrorModal');
|
|
76
73
|
appErrorModal.style.display = "block";
|
|
77
74
|
// If a redirect URL is provided, show the loading spinner
|
|
78
|
-
if (this.
|
|
75
|
+
if (this.config.defaultLink.url && this.showUnauthorizedModal) {
|
|
79
76
|
var countdownNumberEl = this.el.shadowRoot.getElementById('countdown-number');
|
|
80
77
|
var countdown = 6;
|
|
81
78
|
countdownNumberEl.textContent = countdown.toString();
|
|
@@ -85,7 +82,7 @@ export class DashButtonComponent {
|
|
|
85
82
|
// Once the countdown finishes, redirect to the provided URL
|
|
86
83
|
if (countdown == 1) {
|
|
87
84
|
// appErrorModal.style.display = "none";
|
|
88
|
-
window.location.replace(this.
|
|
85
|
+
window.location.replace(this.config.defaultLink.url.toString());
|
|
89
86
|
}
|
|
90
87
|
}, 1000);
|
|
91
88
|
}
|
|
@@ -95,21 +92,8 @@ export class DashButtonComponent {
|
|
|
95
92
|
// Update local storage app permission
|
|
96
93
|
localStorage.setItem("ZDZW_app_permission", JSON.stringify(true));
|
|
97
94
|
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
// Set modules menu links
|
|
101
|
-
this.getOtherMenuLinks(_token).then(res => {
|
|
102
|
-
if (res.links) {
|
|
103
|
-
this.menuLinkList = res.links;
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
// Set main menu links
|
|
107
|
-
this.getMainMenuLinks(_token).then(res => {
|
|
108
|
-
if (res.menuLinks) {
|
|
109
|
-
this.mainMenuLinkList = res.menuLinks;
|
|
110
|
-
console.log(this.mainMenuLinkList);
|
|
111
|
-
}
|
|
112
|
-
});
|
|
95
|
+
});
|
|
96
|
+
}
|
|
113
97
|
}
|
|
114
98
|
});
|
|
115
99
|
}
|
|
@@ -125,7 +109,7 @@ export class DashButtonComponent {
|
|
|
125
109
|
this.isAuth = true;
|
|
126
110
|
localStorage.setItem("keycloak", JSON.stringify(this.keycloak));
|
|
127
111
|
// document.cookie = "DASH_BTN=" + JSON.parse(localStorage.getItem('keycloak')).token;
|
|
128
|
-
document.cookie = "
|
|
112
|
+
document.cookie = this.config.cookieName + "=" + JSON.parse(localStorage.getItem('keycloak')).token;
|
|
129
113
|
// Set userName
|
|
130
114
|
this.givenUserName = JSON.parse(localStorage.getItem('keycloak')).idTokenParsed.preferred_username;
|
|
131
115
|
// Set user avatar
|
|
@@ -133,13 +117,34 @@ export class DashButtonComponent {
|
|
|
133
117
|
}
|
|
134
118
|
});
|
|
135
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
|
+
}
|
|
136
147
|
async getAppList(token) {
|
|
137
|
-
// const token = await JSON.parse(localStorage.getItem('keycloak')).token;
|
|
138
|
-
// const response = await fetch(this.marketplaceUrl + '/api/v1/product/nameAndShortName', {
|
|
139
|
-
// headers: new Headers({
|
|
140
|
-
// 'Authorization': 'Bearer ' + token,
|
|
141
|
-
// }),
|
|
142
|
-
// })
|
|
143
148
|
const response = await fetch(this.plmUrl + '/api/v1/product/nameAndShortNameOrg', {
|
|
144
149
|
headers: new Headers({
|
|
145
150
|
'Authorization': 'Bearer ' + token,
|
|
@@ -148,31 +153,13 @@ export class DashButtonComponent {
|
|
|
148
153
|
const jsonObj = await response.json();
|
|
149
154
|
return jsonObj;
|
|
150
155
|
}
|
|
151
|
-
async getOtherMenuLinks(token) {
|
|
152
|
-
const response = await fetch(this.portalApiUrl + '/developer/dashbutton-link/' + this.otherLinkType, {
|
|
153
|
-
headers: new Headers({
|
|
154
|
-
'Authorization': 'Bearer ' + token,
|
|
155
|
-
}),
|
|
156
|
-
});
|
|
157
|
-
const jsonObj = await response.json();
|
|
158
|
-
return jsonObj;
|
|
159
|
-
}
|
|
160
|
-
async getMainMenuLinks(token) {
|
|
161
|
-
const response = await fetch(this.portalApiUrl + '/developer/dashbutton-menu-link', {
|
|
162
|
-
headers: new Headers({
|
|
163
|
-
'Authorization': 'Bearer ' + token,
|
|
164
|
-
}),
|
|
165
|
-
});
|
|
166
|
-
const jsonObj = await response.json();
|
|
167
|
-
return jsonObj;
|
|
168
|
-
}
|
|
169
156
|
login() {
|
|
170
157
|
this.keycloak.login();
|
|
171
158
|
}
|
|
172
159
|
logout() {
|
|
173
160
|
localStorage.removeItem("keycloak");
|
|
174
161
|
// document.cookie = "DASH_BTN=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
|
|
175
|
-
document.cookie = "
|
|
162
|
+
document.cookie = this.config.cookieName + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
|
|
176
163
|
this.keycloak.logout();
|
|
177
164
|
}
|
|
178
165
|
showModal() {
|
|
@@ -184,38 +171,39 @@ export class DashButtonComponent {
|
|
|
184
171
|
appModal.style.display = "none";
|
|
185
172
|
}
|
|
186
173
|
render() {
|
|
187
|
-
|
|
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
|
+
}
|
|
188
180
|
if (this.isAuth && this.showPostLoginText) {
|
|
189
|
-
|
|
190
|
-
if (this.showPostLoginLoadingSpinner) {
|
|
191
|
-
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))));
|
|
192
|
-
}
|
|
193
|
-
else {
|
|
194
|
-
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")));
|
|
195
|
-
}
|
|
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")));
|
|
196
182
|
}
|
|
197
183
|
else if (this.isAuth) {
|
|
198
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 ?
|
|
199
185
|
h("img", { class: "profile-image", src: "https://s-damith.github.io/test-avatar/images/e24da9c5-0b1f-46fa-82cd-7c711c77b5c7.png" })
|
|
200
186
|
:
|
|
201
|
-
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.
|
|
202
|
-
return (h("a", { href:
|
|
203
|
-
})), this.
|
|
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"))))) : (
|
|
204
190
|
// List View
|
|
205
|
-
h("div", { class: "dropdown-content-link" }, this.
|
|
206
|
-
return (h("a", { href:
|
|
207
|
-
}), 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.
|
|
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"))))));
|
|
208
194
|
}
|
|
209
195
|
else {
|
|
210
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")));
|
|
211
197
|
}
|
|
212
|
-
})()), h("div", { key: '
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
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,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" }), 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) ?
|
|
219
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" }))))
|
|
220
208
|
: h("div", null))));
|
|
221
209
|
}
|
|
@@ -304,60 +292,6 @@ export class DashButtonComponent {
|
|
|
304
292
|
"reflect": false,
|
|
305
293
|
"defaultValue": "\"check-sso\""
|
|
306
294
|
},
|
|
307
|
-
"keycloakUri": {
|
|
308
|
-
"type": "string",
|
|
309
|
-
"mutable": false,
|
|
310
|
-
"complexType": {
|
|
311
|
-
"original": "string",
|
|
312
|
-
"resolved": "string",
|
|
313
|
-
"references": {}
|
|
314
|
-
},
|
|
315
|
-
"required": false,
|
|
316
|
-
"optional": false,
|
|
317
|
-
"docs": {
|
|
318
|
-
"tags": [],
|
|
319
|
-
"text": ""
|
|
320
|
-
},
|
|
321
|
-
"attribute": "keycloak-uri",
|
|
322
|
-
"reflect": false,
|
|
323
|
-
"defaultValue": "\"http://localhost:8080\""
|
|
324
|
-
},
|
|
325
|
-
"realm": {
|
|
326
|
-
"type": "string",
|
|
327
|
-
"mutable": false,
|
|
328
|
-
"complexType": {
|
|
329
|
-
"original": "string",
|
|
330
|
-
"resolved": "string",
|
|
331
|
-
"references": {}
|
|
332
|
-
},
|
|
333
|
-
"required": false,
|
|
334
|
-
"optional": false,
|
|
335
|
-
"docs": {
|
|
336
|
-
"tags": [],
|
|
337
|
-
"text": ""
|
|
338
|
-
},
|
|
339
|
-
"attribute": "realm",
|
|
340
|
-
"reflect": false,
|
|
341
|
-
"defaultValue": "\"\""
|
|
342
|
-
},
|
|
343
|
-
"clientId": {
|
|
344
|
-
"type": "string",
|
|
345
|
-
"mutable": false,
|
|
346
|
-
"complexType": {
|
|
347
|
-
"original": "string",
|
|
348
|
-
"resolved": "string",
|
|
349
|
-
"references": {}
|
|
350
|
-
},
|
|
351
|
-
"required": false,
|
|
352
|
-
"optional": false,
|
|
353
|
-
"docs": {
|
|
354
|
-
"tags": [],
|
|
355
|
-
"text": ""
|
|
356
|
-
},
|
|
357
|
-
"attribute": "client-id",
|
|
358
|
-
"reflect": false,
|
|
359
|
-
"defaultValue": "\"\""
|
|
360
|
-
},
|
|
361
295
|
"appId": {
|
|
362
296
|
"type": "string",
|
|
363
297
|
"mutable": false,
|
|
@@ -376,24 +310,6 @@ export class DashButtonComponent {
|
|
|
376
310
|
"reflect": false,
|
|
377
311
|
"defaultValue": "\"\""
|
|
378
312
|
},
|
|
379
|
-
"portalUrl": {
|
|
380
|
-
"type": "string",
|
|
381
|
-
"mutable": false,
|
|
382
|
-
"complexType": {
|
|
383
|
-
"original": "string",
|
|
384
|
-
"resolved": "string",
|
|
385
|
-
"references": {}
|
|
386
|
-
},
|
|
387
|
-
"required": false,
|
|
388
|
-
"optional": false,
|
|
389
|
-
"docs": {
|
|
390
|
-
"tags": [],
|
|
391
|
-
"text": ""
|
|
392
|
-
},
|
|
393
|
-
"attribute": "portal-url",
|
|
394
|
-
"reflect": false,
|
|
395
|
-
"defaultValue": "\"\""
|
|
396
|
-
},
|
|
397
313
|
"portalApiUrl": {
|
|
398
314
|
"type": "string",
|
|
399
315
|
"mutable": false,
|
|
@@ -430,24 +346,6 @@ export class DashButtonComponent {
|
|
|
430
346
|
"reflect": false,
|
|
431
347
|
"defaultValue": "\"https://productlicensemanager-zdzw.cloud.zdzw-project.com\""
|
|
432
348
|
},
|
|
433
|
-
"usageTrackingUrl": {
|
|
434
|
-
"type": "string",
|
|
435
|
-
"mutable": false,
|
|
436
|
-
"complexType": {
|
|
437
|
-
"original": "string",
|
|
438
|
-
"resolved": "string",
|
|
439
|
-
"references": {}
|
|
440
|
-
},
|
|
441
|
-
"required": false,
|
|
442
|
-
"optional": false,
|
|
443
|
-
"docs": {
|
|
444
|
-
"tags": [],
|
|
445
|
-
"text": ""
|
|
446
|
-
},
|
|
447
|
-
"attribute": "usage-tracking-url",
|
|
448
|
-
"reflect": false,
|
|
449
|
-
"defaultValue": "\"https://usage-tracking-ui-zdzw.cloud.zdzw-project.com\""
|
|
450
|
-
},
|
|
451
349
|
"showUnauthorizedModal": {
|
|
452
350
|
"type": "boolean",
|
|
453
351
|
"mutable": false,
|
|
@@ -466,23 +364,6 @@ export class DashButtonComponent {
|
|
|
466
364
|
"reflect": false,
|
|
467
365
|
"defaultValue": "false"
|
|
468
366
|
},
|
|
469
|
-
"postTextDelayDuration": {
|
|
470
|
-
"type": "number",
|
|
471
|
-
"mutable": false,
|
|
472
|
-
"complexType": {
|
|
473
|
-
"original": "number",
|
|
474
|
-
"resolved": "number",
|
|
475
|
-
"references": {}
|
|
476
|
-
},
|
|
477
|
-
"required": false,
|
|
478
|
-
"optional": false,
|
|
479
|
-
"docs": {
|
|
480
|
-
"tags": [],
|
|
481
|
-
"text": ""
|
|
482
|
-
},
|
|
483
|
-
"attribute": "post-text-delay-duration",
|
|
484
|
-
"reflect": false
|
|
485
|
-
},
|
|
486
367
|
"primaryColor": {
|
|
487
368
|
"type": "string",
|
|
488
369
|
"mutable": false,
|
|
@@ -518,95 +399,6 @@ export class DashButtonComponent {
|
|
|
518
399
|
"attribute": "accent-color",
|
|
519
400
|
"reflect": false,
|
|
520
401
|
"defaultValue": "\"\""
|
|
521
|
-
},
|
|
522
|
-
"otherLinkType": {
|
|
523
|
-
"type": "string",
|
|
524
|
-
"mutable": false,
|
|
525
|
-
"complexType": {
|
|
526
|
-
"original": "string",
|
|
527
|
-
"resolved": "string",
|
|
528
|
-
"references": {}
|
|
529
|
-
},
|
|
530
|
-
"required": false,
|
|
531
|
-
"optional": false,
|
|
532
|
-
"docs": {
|
|
533
|
-
"tags": [],
|
|
534
|
-
"text": ""
|
|
535
|
-
},
|
|
536
|
-
"attribute": "other-link-type",
|
|
537
|
-
"reflect": false
|
|
538
|
-
},
|
|
539
|
-
"otherLinkDisplayName": {
|
|
540
|
-
"type": "string",
|
|
541
|
-
"mutable": false,
|
|
542
|
-
"complexType": {
|
|
543
|
-
"original": "string",
|
|
544
|
-
"resolved": "string",
|
|
545
|
-
"references": {}
|
|
546
|
-
},
|
|
547
|
-
"required": false,
|
|
548
|
-
"optional": false,
|
|
549
|
-
"docs": {
|
|
550
|
-
"tags": [],
|
|
551
|
-
"text": ""
|
|
552
|
-
},
|
|
553
|
-
"attribute": "other-link-display-name",
|
|
554
|
-
"reflect": false,
|
|
555
|
-
"defaultValue": "\"More links\""
|
|
556
|
-
},
|
|
557
|
-
"applicationDisplayName": {
|
|
558
|
-
"type": "string",
|
|
559
|
-
"mutable": false,
|
|
560
|
-
"complexType": {
|
|
561
|
-
"original": "string",
|
|
562
|
-
"resolved": "string",
|
|
563
|
-
"references": {}
|
|
564
|
-
},
|
|
565
|
-
"required": false,
|
|
566
|
-
"optional": false,
|
|
567
|
-
"docs": {
|
|
568
|
-
"tags": [],
|
|
569
|
-
"text": ""
|
|
570
|
-
},
|
|
571
|
-
"attribute": "application-display-name",
|
|
572
|
-
"reflect": false,
|
|
573
|
-
"defaultValue": "\"Applications\""
|
|
574
|
-
},
|
|
575
|
-
"disableApplicationTab": {
|
|
576
|
-
"type": "boolean",
|
|
577
|
-
"mutable": false,
|
|
578
|
-
"complexType": {
|
|
579
|
-
"original": "boolean",
|
|
580
|
-
"resolved": "boolean",
|
|
581
|
-
"references": {}
|
|
582
|
-
},
|
|
583
|
-
"required": false,
|
|
584
|
-
"optional": false,
|
|
585
|
-
"docs": {
|
|
586
|
-
"tags": [],
|
|
587
|
-
"text": ""
|
|
588
|
-
},
|
|
589
|
-
"attribute": "disable-application-tab",
|
|
590
|
-
"reflect": false,
|
|
591
|
-
"defaultValue": "false"
|
|
592
|
-
},
|
|
593
|
-
"menuViewType": {
|
|
594
|
-
"type": "string",
|
|
595
|
-
"mutable": false,
|
|
596
|
-
"complexType": {
|
|
597
|
-
"original": "string",
|
|
598
|
-
"resolved": "string",
|
|
599
|
-
"references": {}
|
|
600
|
-
},
|
|
601
|
-
"required": false,
|
|
602
|
-
"optional": false,
|
|
603
|
-
"docs": {
|
|
604
|
-
"tags": [],
|
|
605
|
-
"text": ""
|
|
606
|
-
},
|
|
607
|
-
"attribute": "menu-view-type",
|
|
608
|
-
"reflect": false,
|
|
609
|
-
"defaultValue": "\"grid\""
|
|
610
402
|
}
|
|
611
403
|
};
|
|
612
404
|
}
|
|
@@ -617,11 +409,11 @@ export class DashButtonComponent {
|
|
|
617
409
|
"givenUserName": {},
|
|
618
410
|
"silentCheckSsoRedirectUri": {},
|
|
619
411
|
"appList": {},
|
|
620
|
-
"menuLinkList": {},
|
|
621
|
-
"mainMenuLinkList": {},
|
|
622
|
-
"showPostLoginLoadingSpinner": {},
|
|
623
412
|
"avatarSvg": {},
|
|
624
|
-
"
|
|
413
|
+
"isLoading": {},
|
|
414
|
+
"config": {},
|
|
415
|
+
"localMenuLinks": {},
|
|
416
|
+
"organizationUrl": {}
|
|
625
417
|
};
|
|
626
418
|
}
|
|
627
419
|
static get elementRef() { return "el"; }
|