dash-button-web 0.0.23 → 0.0.25
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/app-globals-V2Kpy_OQ.js +5 -0
- package/dist/cjs/dash-button_4.cjs.entry.js +11790 -0
- package/dist/cjs/index-CyJNVLIY.js +1623 -0
- package/dist/cjs/index.cjs.js +0 -2
- package/dist/cjs/loader.cjs.js +5 -7
- package/dist/cjs/web-compnont.cjs.js +15 -15
- package/dist/collection/collection-manifest.json +13 -3
- package/dist/collection/components/my-component/dash-button.css +282 -0
- package/dist/collection/components/my-component/dash-button.js +247 -78
- package/dist/collection/index.js +0 -1
- package/dist/collection/services/config.js +3 -5
- package/dist/collection/services/menu.js +4 -5
- package/dist/components/dash-button.js +1 -4266
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +1 -3
- package/dist/components/loading-component.js +1 -0
- package/dist/components/loading-component2.js +1 -0
- package/dist/components/notification-component.js +1 -0
- package/dist/components/notification-component2.js +1 -0
- package/dist/components/notification-table.js +1 -0
- package/dist/components/notification-table2.js +2 -0
- package/dist/esm/app-globals-DQuL1Twl.js +3 -0
- package/dist/esm/dash-button_4.entry.js +11785 -0
- package/dist/esm/index-NLvZO6-E.js +1615 -0
- package/dist/esm/index.js +0 -2
- package/dist/esm/loader.js +6 -6
- package/dist/esm/web-compnont.js +15 -14
- package/dist/types/components/my-component/dash-button.d.ts +27 -2
- package/dist/types/components.d.ts +84 -3
- package/dist/types/services/menu.d.ts +2 -0
- package/dist/types/stencil-public-runtime.d.ts +268 -70
- package/dist/web-compnont/index.esm.js +0 -2
- package/dist/web-compnont/p-DQuL1Twl.js +1 -0
- package/dist/web-compnont/p-NLvZO6-E.js +3 -0
- package/dist/web-compnont/p-ce35027b.entry.js +2 -0
- package/dist/web-compnont/web-compnont.esm.js +1 -2
- package/loader/cdn.js +1 -3
- package/loader/index.cjs.js +1 -3
- package/loader/index.d.ts +4 -1
- package/loader/index.es2017.js +1 -3
- package/loader/index.js +1 -3
- package/package.json +3 -2
- package/readme.md +18 -0
- package/dist/cjs/dash-button.cjs.entry.js +0 -4231
- package/dist/cjs/dash-button.cjs.entry.js.map +0 -1
- package/dist/cjs/index-87d4993d.js +0 -1793
- package/dist/cjs/index-87d4993d.js.map +0 -1
- package/dist/cjs/index.cjs.js.map +0 -1
- package/dist/cjs/loader.cjs.js.map +0 -1
- package/dist/cjs/web-compnont.cjs.js.map +0 -1
- package/dist/collection/components/my-component/dash-button.e2e.js +0 -26
- package/dist/collection/components/my-component/dash-button.e2e.js.map +0 -1
- package/dist/collection/components/my-component/dash-button.js.map +0 -1
- package/dist/collection/components/my-component/dash-button.spec.js +0 -35
- package/dist/collection/components/my-component/dash-button.spec.js.map +0 -1
- package/dist/collection/index.js.map +0 -1
- package/dist/collection/services/config.js.map +0 -1
- package/dist/collection/services/menu.js.map +0 -1
- package/dist/components/dash-button.js.map +0 -1
- package/dist/components/index.js.map +0 -1
- package/dist/esm/dash-button.entry.js +0 -4227
- package/dist/esm/dash-button.entry.js.map +0 -1
- package/dist/esm/index-e3df5eaf.js +0 -1766
- package/dist/esm/index-e3df5eaf.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/loader.js.map +0 -1
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/esm/web-compnont.js.map +0 -1
- package/dist/web-compnont/index.esm.js.map +0 -1
- package/dist/web-compnont/p-2e8505f3.entry.js +0 -10
- package/dist/web-compnont/p-2e8505f3.entry.js.map +0 -1
- package/dist/web-compnont/p-c1ec12fe.js +0 -3
- package/dist/web-compnont/p-c1ec12fe.js.map +0 -1
- package/dist/web-compnont/web-compnont.esm.js.map +0 -1
- package/loader/package.json +0 -11
|
@@ -3,42 +3,103 @@ import Keycloak from "keycloak-js";
|
|
|
3
3
|
import { toSvg } from "jdenticon";
|
|
4
4
|
import { configService } from "../../services/config";
|
|
5
5
|
import { menuService } from "../../services/menu";
|
|
6
|
+
import "ice-notification-component";
|
|
6
7
|
export class DashButtonComponent {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
8
|
+
el;
|
|
9
|
+
showPostLoginText = false;
|
|
10
|
+
silentCheckSso = false;
|
|
11
|
+
redirectUri;
|
|
12
|
+
authMethod = "check-sso";
|
|
13
|
+
portalApiUrl = "";
|
|
14
|
+
plmUrl = "https://productlicensemanager-zdzw.cloud.zdzw-project.com";
|
|
15
|
+
showUnauthorizedModal = false;
|
|
16
|
+
primaryColor = "";
|
|
17
|
+
accentColor = "";
|
|
18
|
+
keycloak = null;
|
|
19
|
+
isAuth = false;
|
|
20
|
+
givenUserName = "";
|
|
21
|
+
silentCheckSsoRedirectUri = window.location.origin + '/assets/verificar-sso.html';
|
|
22
|
+
appList = [];
|
|
23
|
+
avatarSvg = toSvg("init-avatar", 40);
|
|
24
|
+
isLoading = false;
|
|
25
|
+
config;
|
|
26
|
+
localMenuLinks;
|
|
27
|
+
organizationUrl;
|
|
28
|
+
isRestricted = false;
|
|
29
|
+
showNotification = true;
|
|
30
|
+
notificationPosition = 'left';
|
|
31
|
+
// Accordion: at most one of the two sections is collapsed at a time.
|
|
32
|
+
// Collapsing one always leaves the other expanded.
|
|
33
|
+
collapsedModuleSection = null;
|
|
34
|
+
gridLocalListEl;
|
|
35
|
+
listLocalScrollEl;
|
|
36
|
+
toggleGlobalModules = () => {
|
|
37
|
+
this.collapsedModuleSection = this.collapsedModuleSection === 'global' ? null : 'global';
|
|
38
|
+
};
|
|
39
|
+
toggleLocalModules = () => {
|
|
40
|
+
this.collapsedModuleSection = this.collapsedModuleSection === 'local' ? null : 'local';
|
|
41
|
+
};
|
|
42
|
+
// The dropdown only becomes visible via CSS :hover (no JS "opened" event),
|
|
43
|
+
// and componentDidRender's measurement can run while it's still
|
|
44
|
+
// display:none — offsetHeight is always 0 for a hidden subtree, so that
|
|
45
|
+
// first measurement can permanently stick maxHeight at 0px. Re-measuring
|
|
46
|
+
// on mouseenter (when the dropdown is guaranteed visible) fixes it.
|
|
47
|
+
handleDropdownMouseEnter = () => {
|
|
48
|
+
this.capToRowPeek(this.gridLocalListEl, 2.5);
|
|
49
|
+
this.capToRowPeek(this.listLocalScrollEl, 2.5);
|
|
50
|
+
};
|
|
51
|
+
componentDidRender() {
|
|
52
|
+
this.capToRowPeek(this.gridLocalListEl, 2.5);
|
|
53
|
+
this.capToRowPeek(this.listLocalScrollEl, 2.5);
|
|
28
54
|
}
|
|
55
|
+
componentDidLoad() {
|
|
56
|
+
document.addEventListener('click', this.handleNotificationLinkClick, true);
|
|
57
|
+
}
|
|
58
|
+
// Caps a container to `rows` times its first item's rendered height, so
|
|
59
|
+
// Local Modules always shows a partial next row as a "scroll for more"
|
|
60
|
+
// cue instead of a clean cut. Measured off the real item (icon size,
|
|
61
|
+
// padding, etc. all vary) rather than a guessed pixel value; harmless
|
|
62
|
+
// to always set since max-height only constrains when content is
|
|
63
|
+
// actually taller than that.
|
|
64
|
+
capToRowPeek(container, rows) {
|
|
65
|
+
if (!container)
|
|
66
|
+
return;
|
|
67
|
+
const firstItem = container.firstElementChild;
|
|
68
|
+
if (!firstItem) {
|
|
69
|
+
container.style.maxHeight = '';
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
container.style.maxHeight = `${firstItem.offsetHeight * rows}px`;
|
|
73
|
+
}
|
|
74
|
+
disconnectedCallback() {
|
|
75
|
+
document.removeEventListener('click', this.handleNotificationLinkClick, true);
|
|
76
|
+
}
|
|
77
|
+
// Fix notification home icon click not opening a new tab
|
|
78
|
+
// (workaround for ice-notification-component shadow DOM click bug)
|
|
79
|
+
handleNotificationLinkClick = (event) => {
|
|
80
|
+
const path = event.composedPath();
|
|
81
|
+
const insideNotification = path.some((node) => node.tagName === 'NOTIFICATION-COMPONENT');
|
|
82
|
+
if (!insideNotification)
|
|
83
|
+
return;
|
|
84
|
+
const anchor = path.find((node) => node.tagName === 'A' && node.target === '_blank');
|
|
85
|
+
if (!anchor || !anchor.href)
|
|
86
|
+
return;
|
|
87
|
+
event.preventDefault();
|
|
88
|
+
event.stopPropagation();
|
|
89
|
+
window.open(anchor.href, '_blank', 'noopener');
|
|
90
|
+
};
|
|
29
91
|
async componentWillLoad() {
|
|
30
|
-
var _a, _b, _c, _d;
|
|
31
92
|
// Fetch config from API
|
|
32
93
|
this.config = await configService.fetchConfig(this.portalApiUrl);
|
|
33
94
|
console.log(this.config);
|
|
34
95
|
if (!this.config)
|
|
35
96
|
return; // prevent Keycloak init if fetch failed
|
|
36
97
|
// render will show spinner
|
|
37
|
-
if (
|
|
98
|
+
if (this.config?.loading?.isLoading) {
|
|
38
99
|
this.isLoading = true;
|
|
39
100
|
setTimeout(() => {
|
|
40
101
|
this.isLoading = false;
|
|
41
|
-
},
|
|
102
|
+
}, this.config?.loading?.duration);
|
|
42
103
|
}
|
|
43
104
|
// Initialize Keycloak
|
|
44
105
|
this.keycloak = new Keycloak({
|
|
@@ -68,39 +129,40 @@ export class DashButtonComponent {
|
|
|
68
129
|
onLoad: this.authMethod,
|
|
69
130
|
checkLoginIframe: false,
|
|
70
131
|
silentCheckSsoRedirectUri: this.silentCheckSso ? this.silentCheckSsoRedirectUri : '',
|
|
71
|
-
}).then(res => {
|
|
132
|
+
}).then((res) => {
|
|
72
133
|
if (res) {
|
|
73
134
|
this.isAuth = true;
|
|
74
135
|
localStorage.setItem("keycloak", JSON.stringify(this.keycloak));
|
|
75
136
|
// document.cookie = "DASH_BTN=" + JSON.parse(localStorage.getItem('keycloak')).token;
|
|
76
|
-
document.cookie = this.config.cookieName + "=" + JSON.parse(localStorage.getItem('keycloak')).token;
|
|
137
|
+
document.cookie = this.config.cookieName + "=" + JSON.parse(localStorage.getItem('keycloak') ?? '{}').token;
|
|
77
138
|
// Set userName
|
|
78
|
-
this.givenUserName = JSON.parse(localStorage.getItem('keycloak')).idTokenParsed.preferred_username;
|
|
139
|
+
this.givenUserName = JSON.parse(localStorage.getItem('keycloak') ?? '{}').idTokenParsed.preferred_username;
|
|
79
140
|
// Set user avatar
|
|
80
|
-
this.avatarSvg = toSvg(JSON.parse(localStorage.getItem('keycloak')).idTokenParsed.sub, 40);
|
|
141
|
+
this.avatarSvg = toSvg(JSON.parse(localStorage.getItem('keycloak') ?? '{}').idTokenParsed.sub, 40);
|
|
81
142
|
}
|
|
82
143
|
});
|
|
83
144
|
}
|
|
84
145
|
async loadOrganizationUrlAndLinks() {
|
|
85
|
-
var _a, _b, _c;
|
|
86
146
|
// Read org URL safely
|
|
87
147
|
try {
|
|
88
148
|
const kc = JSON.parse(localStorage.getItem("keycloak") || "{}");
|
|
89
|
-
this.organizationUrl =
|
|
149
|
+
this.organizationUrl = kc?.idTokenParsed?.organizationUrl || null;
|
|
90
150
|
}
|
|
91
|
-
catch
|
|
151
|
+
catch {
|
|
92
152
|
this.organizationUrl = null;
|
|
93
153
|
}
|
|
94
154
|
// If no organization, do nothing
|
|
95
155
|
if (!this.organizationUrl)
|
|
96
156
|
return;
|
|
97
157
|
// If config or menu not ready, skip
|
|
98
|
-
if (!
|
|
158
|
+
if (!this.config?.menu?.local)
|
|
99
159
|
return;
|
|
100
160
|
// Only load when custom menu is NOT enabled
|
|
101
161
|
if (!this.config.menu.local.enableCustomLocalMenu) {
|
|
102
162
|
try {
|
|
103
163
|
this.localMenuLinks = await menuService.getMenuLinks(this.organizationUrl);
|
|
164
|
+
console.log("======");
|
|
165
|
+
console.log(this.localMenuLinks);
|
|
104
166
|
}
|
|
105
167
|
catch (e) {
|
|
106
168
|
console.error("Failed to load local menu", e);
|
|
@@ -112,26 +174,25 @@ export class DashButtonComponent {
|
|
|
112
174
|
// Then, check the token's organization URL
|
|
113
175
|
// Finally, check against dashbutton configuration: allowedGlobalDomain and whitelistedUrls
|
|
114
176
|
validateAppAccessByUrl() {
|
|
115
|
-
var _a, _b, _c, _d, _e, _f;
|
|
116
177
|
const normalizeUrl = (url) => url.replace(/\/+$/, '');
|
|
117
178
|
const currentUrl = normalizeUrl(window.location.href);
|
|
118
179
|
const currentOrigin = normalizeUrl(window.location.origin);
|
|
119
|
-
const globalLinks =
|
|
120
|
-
const allowedGlobalDomain =
|
|
121
|
-
const whitelistedUrls =
|
|
180
|
+
const globalLinks = this.config?.menu?.global?.links || [];
|
|
181
|
+
const allowedGlobalDomain = this.config?.allowedGlobalDomain || '';
|
|
182
|
+
const whitelistedUrls = this.config?.whitelistedUrls || '';
|
|
122
183
|
// First, check global links
|
|
123
184
|
const matchGlobal = globalLinks.some(link => {
|
|
124
185
|
try {
|
|
125
186
|
const linkOrigin = normalizeUrl(new URL(link.url).origin);
|
|
126
187
|
return currentOrigin === linkOrigin;
|
|
127
188
|
}
|
|
128
|
-
catch
|
|
189
|
+
catch {
|
|
129
190
|
return false;
|
|
130
191
|
}
|
|
131
192
|
});
|
|
132
193
|
// Then check the token organization URL
|
|
133
|
-
const tokenParsed =
|
|
134
|
-
const allowedOrg = tokenParsed
|
|
194
|
+
const tokenParsed = this.keycloak?.tokenParsed;
|
|
195
|
+
const allowedOrg = tokenParsed?.organizationUrl;
|
|
135
196
|
const matchOrganization = allowedOrg && currentUrl.includes(normalizeUrl(allowedOrg));
|
|
136
197
|
// Check allowedGlobalDomain (single domain)
|
|
137
198
|
const matchAllowedDomain = allowedGlobalDomain &&
|
|
@@ -157,52 +218,102 @@ export class DashButtonComponent {
|
|
|
157
218
|
document.cookie = this.config.cookieName + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
|
|
158
219
|
this.keycloak.logout();
|
|
159
220
|
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
221
|
+
// Normalizes the "Modules" list so grid view and list view can render it
|
|
222
|
+
// with the exact same markup/classes used for the global "Applications" links.
|
|
223
|
+
get moduleLinks() {
|
|
224
|
+
const useCustom = this.config?.menu?.local?.enableCustomLocalMenu;
|
|
225
|
+
const links = useCustom
|
|
226
|
+
? (this.config?.menu?.local?.links || []).map(item => ({
|
|
227
|
+
name: item.name,
|
|
228
|
+
url: item.url,
|
|
229
|
+
icon: item.icon,
|
|
230
|
+
disabled: !item.url,
|
|
231
|
+
}))
|
|
232
|
+
: (this.localMenuLinks || []).map(item => ({
|
|
233
|
+
name: item.name,
|
|
234
|
+
url: item.url,
|
|
235
|
+
icon: item.icon,
|
|
236
|
+
disabled: !item.url,
|
|
237
|
+
}));
|
|
238
|
+
return links.sort((a, b) => a.name.localeCompare(b.name, undefined, { sensitivity: 'base' }));
|
|
163
239
|
}
|
|
164
|
-
|
|
165
|
-
const
|
|
166
|
-
|
|
240
|
+
isContainerizationModule(item) {
|
|
241
|
+
const name = (item.name || '')
|
|
242
|
+
.trim()
|
|
243
|
+
.toLowerCase()
|
|
244
|
+
.replace(/[\s_-]+/g, '');
|
|
245
|
+
return /^(containerization|containerisation)(module)?$/.test(name);
|
|
246
|
+
}
|
|
247
|
+
get containerizationModule() {
|
|
248
|
+
return this.moduleLinks.find(item => this.isContainerizationModule(item));
|
|
249
|
+
}
|
|
250
|
+
get visibleModuleLinks() {
|
|
251
|
+
return this.moduleLinks.filter(item => !this.isContainerizationModule(item));
|
|
252
|
+
}
|
|
253
|
+
renderSectionLabel(icon, label, count, collapsed, onToggle, shortcut) {
|
|
254
|
+
return (h("div", { class: "menu-section-header", onClick: onToggle }, h("div", { class: "menu-section-header-left" }, h("span", { class: "menu-section-icon" }, h("i", { class: icon })), h("span", { class: "menu-section-title" }, label), h("span", { class: "menu-section-count" }, count)), h("div", { class: "menu-section-header-actions" }, shortcut && (h("a", { class: "footer-icon-btn footer-icon-btn-portal local-module-shortcut", href: shortcut.disabled ? undefined : shortcut.url, target: shortcut.disabled ? undefined : "_blank", rel: shortcut.disabled ? undefined : "noopener noreferrer", "aria-label": shortcut.name, "aria-disabled": shortcut.disabled ? "true" : undefined, tabIndex: shortcut.disabled ? -1 : undefined, "data-tooltip": shortcut.name, onClick: (event) => {
|
|
255
|
+
event.stopPropagation();
|
|
256
|
+
if (shortcut.disabled)
|
|
257
|
+
event.preventDefault();
|
|
258
|
+
} }, h("i", { class: "fa-solid fa-server" }))), h("span", { class: "menu-section-chevron-btn" +
|
|
259
|
+
(collapsed ? " menu-section-chevron-btn-collapsed" : "") }, h("i", { class: "fa-solid fa-chevron-down" })))));
|
|
260
|
+
}
|
|
261
|
+
renderNotificationComponent() {
|
|
262
|
+
const token = this.keycloak?.idTokenParsed;
|
|
263
|
+
const owner = token?.preferred_username || token?.sub || '';
|
|
264
|
+
const organizationUrl = String(token?.organizationUrl || '').trim();
|
|
265
|
+
if (!owner || !organizationUrl)
|
|
266
|
+
return null;
|
|
267
|
+
let orgHost;
|
|
268
|
+
try {
|
|
269
|
+
const url = /^https?:\/\//i.test(organizationUrl)
|
|
270
|
+
? organizationUrl
|
|
271
|
+
: `https://${organizationUrl}`;
|
|
272
|
+
orgHost = new URL(url).hostname;
|
|
273
|
+
}
|
|
274
|
+
catch {
|
|
275
|
+
return null;
|
|
276
|
+
}
|
|
277
|
+
return (h("notification-component", { owner: owner, "max-records": 10, "display-type": "icon", "notification-url": `https://notifications.${orgHost}/notifications-api`, "socket-connect": true, "socket-url": `wss://repository.${orgHost}/socket`, "list-url": `https://notifications.${orgHost}/notifications` }));
|
|
167
278
|
}
|
|
168
279
|
render() {
|
|
169
|
-
|
|
170
|
-
return h("div", { key: '370786aa472fafd2bf9509a18bd62c87ac2893c7' }, h("div", { key: 'c0b091b19e7981ecc48e95c03c8d91e77e7a88df' }, (() => {
|
|
171
|
-
var _a, _b, _c, _d, _e, _f;
|
|
280
|
+
return h("div", { key: 'f4302fb8824c5bc6df03aaff56eacbc9cf764767' }, h("div", { key: 'cd8204369b6489a41e85fdbc18b7fb859f11446b' }, (() => {
|
|
172
281
|
// GLOBAL LOADING SPINNER
|
|
173
282
|
if (this.isLoading) {
|
|
174
283
|
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))));
|
|
175
284
|
}
|
|
176
285
|
if (this.isRestricted) {
|
|
177
|
-
return (h("div", { class: "restricted-overlay" }, h("div", { class: "restricted-card" }, h("div", { class: "restricted-icon" }, h("i", { class: "fa-solid fa-shield-halved" })), h("h2", null, "Access Restricted"), h("p", { class: "restricted-message" }, "You do not have permission to access this application. Please contact your administrator if you believe this is an error."),
|
|
286
|
+
return (h("div", { class: "restricted-overlay" }, h("div", { class: "restricted-card" }, h("div", { class: "restricted-icon" }, h("i", { class: "fa-solid fa-shield-halved" })), h("h2", null, "Access Restricted"), h("p", { class: "restricted-message" }, "You do not have permission to access this application. Please contact your administrator if you believe this is an error."), this.config?.menu?.global?.links?.length > 0 && (h("div", { class: "restricted-links" }, h("h4", null, "Publicly Available Modules"), h("div", { class: "link-grid" }, this.config.menu.global.links.map(item => (h("a", { href: item.url, target: "_blank", class: "restricted-link" }, h("i", { class: item.icon }), h("span", null, item.name))))))), h("div", { class: "restricted-actions" }, this.config?.defaultLink?.url && (h("a", { href: this.config.defaultLink.url, target: "_blank", class: "btn-primary" }, "Go to Portal")), h("button", { class: "btn-danger", onClick: this.logout.bind(this) }, "Logout")))));
|
|
178
287
|
}
|
|
179
288
|
if (this.isAuth && this.showPostLoginText) {
|
|
180
289
|
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")));
|
|
181
290
|
}
|
|
182
291
|
else if (this.isAuth) {
|
|
183
|
-
return (h("div", {
|
|
292
|
+
return (h("div", { class: "profile-actions", style: { display: "inline-flex", alignItems: "center", gap: "15px" } }, this.showNotification &&
|
|
293
|
+
this.notificationPosition === 'left' &&
|
|
294
|
+
this.renderNotificationComponent(), h("div", { id: "profile-btn", class: "dropdown", onMouseEnter: this.handleDropdownMouseEnter }, 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 ?
|
|
184
295
|
h("img", { class: "profile-image", src: "https://s-damith.github.io/test-avatar/images/e24da9c5-0b1f-46fa-82cd-7c711c77b5c7.png" })
|
|
185
296
|
:
|
|
186
|
-
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 => {
|
|
187
|
-
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)));
|
|
188
|
-
})), this.
|
|
297
|
+
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: "user-profile-info" }, h("div", { class: "username" }, "@", this.givenUserName), h("div", { class: "first-last-name" }, JSON.parse(localStorage.getItem('keycloak') ?? '{}').idTokenParsed.name)), h("div", { class: "user-profile-actions" }, h("a", { href: this.config.defaultLink.url, target: "_blank", rel: "noopener noreferrer", class: "footer-icon-btn footer-icon-btn-portal", "aria-label": this.config.defaultLink.name || "Portal", "data-tooltip": this.config.defaultLink.name || "Portal" }, h("i", { class: "fa-solid fa-globe" })), h("button", { type: "button", onClick: this.logout.bind(this), class: "footer-icon-btn footer-icon-btn-logout", "aria-label": "Logout", "data-tooltip": "Logout" }, h("i", { class: "fa-solid fa-right-from-bracket" })))), (this.config.menuViewType == "grid") ? (h("div", null, this.moduleLinks.length > 0 && this.renderSectionLabel("fa-solid fa-earth-americas", "Global Modules", this.config.menu.global.links.length, (this.collapsedModuleSection === 'global'), this.toggleGlobalModules), (this.moduleLinks.length === 0 || this.collapsedModuleSection !== 'global') && (h("div", { class: "grid-view-menu" }, this.config.menu.global.links.map(item => {
|
|
298
|
+
return (h("a", { href: item.url, target: '_blank', rel: "noopener noreferrer", class: "grid-view-link" }, h("i", { class: item.icon + " fa-2x" }), h("div", { class: "grid-view-link-text" }, item.name)));
|
|
299
|
+
}))), this.moduleLinks.length > 0 && (h("div", { style: { display: "contents" } }, h("hr", { class: "solid" }), this.renderSectionLabel("fa-solid fa-building", "Local Modules", this.visibleModuleLinks.length, this.collapsedModuleSection === 'local', this.toggleLocalModules, this.containerizationModule), !(this.collapsedModuleSection === 'local') && (h("div", { class: "grid-view-menu", ref: (el) => this.gridLocalListEl = el }, this.visibleModuleLinks.map(item => {
|
|
300
|
+
const isImageUrl = item.icon && /^https?:\/\//i.test(item.icon);
|
|
301
|
+
const iconClass = item.icon && !isImageUrl
|
|
302
|
+
? item.icon
|
|
303
|
+
: "fa-solid fa-cube";
|
|
304
|
+
return (h("a", { class: "grid-view-link" + (item.disabled ? " grid-view-link-disabled" : ""), href: item.disabled ? undefined : item.url, target: item.disabled ? undefined : "_blank", rel: item.disabled ? undefined : "noopener noreferrer", onClick: item.disabled ? (e) => e.preventDefault() : undefined }, isImageUrl ? (h("img", { src: item.icon, alt: item.name, class: "grid-view-link-image" })) : (h("i", { class: iconClass + " fa-2x" })), h("div", { class: "grid-view-link-text" }, item.name)));
|
|
305
|
+
}))))))) : (
|
|
189
306
|
// List View
|
|
190
|
-
h("div", { class: "dropdown-content-link" }, this.config.menu.global.links.map(item => {
|
|
191
|
-
return (h("a", { href: item.url, target: '_blank', id: "applications-btn" }, h("i", { class: item.icon + " menu-bar-icons" }), item.name));
|
|
192
|
-
}), h("
|
|
307
|
+
h("div", { class: "dropdown-content-link" }, this.moduleLinks.length > 0 && this.renderSectionLabel("fa-solid fa-earth-americas", "Global Modules", this.config.menu.global.links.length, (this.collapsedModuleSection === 'global'), this.toggleGlobalModules), (this.moduleLinks.length === 0 || this.collapsedModuleSection !== 'global') && (this.config.menu.global.links.map(item => {
|
|
308
|
+
return (h("a", { href: item.url, target: '_blank', rel: "noopener noreferrer", id: "applications-btn" }, h("i", { class: item.icon + " menu-bar-icons" }), item.name));
|
|
309
|
+
})), this.moduleLinks.length > 0 && (h("div", { style: { display: "contents" } }, this.renderSectionLabel("fa-solid fa-building", "Local Modules", this.moduleLinks.length, (this.collapsedModuleSection === 'local'), this.toggleLocalModules), !(this.collapsedModuleSection === 'local') && (h("div", { class: "local-modules-scroll", ref: (el) => this.listLocalScrollEl = el }, this.moduleLinks.map(item => (h("a", { id: "applications-btn", class: item.disabled ? "applications-btn-disabled" : undefined, href: item.disabled ? undefined : item.url, target: item.disabled ? undefined : "_blank", rel: item.disabled ? undefined : "noopener noreferrer", onClick: item.disabled ? (e) => e.preventDefault() : undefined }, h("i", { class: (item.icon || "fa-solid fa-cube") + " menu-bar-icons" }), item.name)))))))))), this.showNotification &&
|
|
310
|
+
this.notificationPosition === 'right' &&
|
|
311
|
+
this.renderNotificationComponent())));
|
|
193
312
|
}
|
|
194
313
|
else {
|
|
195
314
|
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")));
|
|
196
315
|
}
|
|
197
|
-
})()), h("div", { key: '
|
|
198
|
-
// <div>{this.localMenuLinks}</div>
|
|
199
|
-
(_d = this.localMenuLinks) === null || _d === void 0 ? void 0 : _d.map((app, index) => {
|
|
200
|
-
const isDisabled = !app.url;
|
|
201
|
-
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))));
|
|
202
|
-
})) : ((_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 Domain URL not set"), h("p", { class: "gray-text" }, "Please set your Organization Domain 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) &&
|
|
203
|
-
((_k = (_j = this.localMenuLinks) === null || _j === void 0 ? void 0 : _j.length) !== null && _k !== void 0 ? _k : 0) === 0) ||
|
|
204
|
-
(((_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) &&
|
|
205
|
-
((_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: '349c7ff69d94c988a278677f497c0a9fef85c59c', id: "appPermissionErrorModal", class: "modal" }, h("div", { key: '788004858cf2f55f4e79cce0c023895274bab9ab', class: "modal-content" }, h("img", { key: '57ea43b0a21086eeaebe0585b9501967099ec999', src: "data:image/png;base64,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" }), h("h2", { key: 'c7663fb1503a0f0713350ac2ff2e52708c5425f9', class: "green-text margin-b" }, "You don't have permission to access this application."), h("h3", { key: '925b21fffdee5437664f690254821ffa63d736cb', class: "green-text" }, "Please contact the administration."), (this.config.defaultLink.url && this.showUnauthorizedModal) ?
|
|
316
|
+
})()), h("div", { key: '34bb14b2332370430752853150d0dec2643c5b85', id: "appPermissionErrorModal", class: "modal" }, h("div", { key: '4d0d68d78c1958d60712a79b780cb18e7c3e4b81', class: "modal-content" }, h("img", { key: 'd8a50635f3c14f424763525469df6d7d88524413', src: "data:image/png;base64,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" }), h("h2", { key: '0f064131a4fe8a22968e8447efdbfb2877f45508', class: "green-text margin-b" }, "You don't have permission to access this application."), h("h3", { key: '2bc49be7296bb8f0410a689eb468a42f6e523c9c', class: "green-text" }, "Please contact the administration."), (this.config.defaultLink.url && this.showUnauthorizedModal) ?
|
|
206
317
|
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" }))))
|
|
207
318
|
: h("div", null))));
|
|
208
319
|
}
|
|
@@ -234,8 +345,10 @@ export class DashButtonComponent {
|
|
|
234
345
|
"tags": [],
|
|
235
346
|
"text": ""
|
|
236
347
|
},
|
|
237
|
-
"
|
|
348
|
+
"getter": false,
|
|
349
|
+
"setter": false,
|
|
238
350
|
"reflect": false,
|
|
351
|
+
"attribute": "show-post-login-text",
|
|
239
352
|
"defaultValue": "false"
|
|
240
353
|
},
|
|
241
354
|
"silentCheckSso": {
|
|
@@ -252,8 +365,10 @@ export class DashButtonComponent {
|
|
|
252
365
|
"tags": [],
|
|
253
366
|
"text": ""
|
|
254
367
|
},
|
|
255
|
-
"
|
|
368
|
+
"getter": false,
|
|
369
|
+
"setter": false,
|
|
256
370
|
"reflect": false,
|
|
371
|
+
"attribute": "silent-check-sso",
|
|
257
372
|
"defaultValue": "false"
|
|
258
373
|
},
|
|
259
374
|
"redirectUri": {
|
|
@@ -264,14 +379,16 @@ export class DashButtonComponent {
|
|
|
264
379
|
"resolved": "string",
|
|
265
380
|
"references": {}
|
|
266
381
|
},
|
|
267
|
-
"required":
|
|
382
|
+
"required": true,
|
|
268
383
|
"optional": false,
|
|
269
384
|
"docs": {
|
|
270
385
|
"tags": [],
|
|
271
386
|
"text": ""
|
|
272
387
|
},
|
|
273
|
-
"
|
|
274
|
-
"
|
|
388
|
+
"getter": false,
|
|
389
|
+
"setter": false,
|
|
390
|
+
"reflect": false,
|
|
391
|
+
"attribute": "redirect-uri"
|
|
275
392
|
},
|
|
276
393
|
"authMethod": {
|
|
277
394
|
"type": "string",
|
|
@@ -287,8 +404,10 @@ export class DashButtonComponent {
|
|
|
287
404
|
"tags": [],
|
|
288
405
|
"text": ""
|
|
289
406
|
},
|
|
290
|
-
"
|
|
407
|
+
"getter": false,
|
|
408
|
+
"setter": false,
|
|
291
409
|
"reflect": false,
|
|
410
|
+
"attribute": "auth-method",
|
|
292
411
|
"defaultValue": "\"check-sso\""
|
|
293
412
|
},
|
|
294
413
|
"portalApiUrl": {
|
|
@@ -305,8 +424,10 @@ export class DashButtonComponent {
|
|
|
305
424
|
"tags": [],
|
|
306
425
|
"text": ""
|
|
307
426
|
},
|
|
308
|
-
"
|
|
427
|
+
"getter": false,
|
|
428
|
+
"setter": false,
|
|
309
429
|
"reflect": false,
|
|
430
|
+
"attribute": "portal-api-url",
|
|
310
431
|
"defaultValue": "\"\""
|
|
311
432
|
},
|
|
312
433
|
"plmUrl": {
|
|
@@ -323,8 +444,10 @@ export class DashButtonComponent {
|
|
|
323
444
|
"tags": [],
|
|
324
445
|
"text": ""
|
|
325
446
|
},
|
|
326
|
-
"
|
|
447
|
+
"getter": false,
|
|
448
|
+
"setter": false,
|
|
327
449
|
"reflect": false,
|
|
450
|
+
"attribute": "plm-url",
|
|
328
451
|
"defaultValue": "\"https://productlicensemanager-zdzw.cloud.zdzw-project.com\""
|
|
329
452
|
},
|
|
330
453
|
"showUnauthorizedModal": {
|
|
@@ -341,8 +464,10 @@ export class DashButtonComponent {
|
|
|
341
464
|
"tags": [],
|
|
342
465
|
"text": ""
|
|
343
466
|
},
|
|
344
|
-
"
|
|
467
|
+
"getter": false,
|
|
468
|
+
"setter": false,
|
|
345
469
|
"reflect": false,
|
|
470
|
+
"attribute": "show-unauthorized-modal",
|
|
346
471
|
"defaultValue": "false"
|
|
347
472
|
},
|
|
348
473
|
"primaryColor": {
|
|
@@ -359,8 +484,10 @@ export class DashButtonComponent {
|
|
|
359
484
|
"tags": [],
|
|
360
485
|
"text": ""
|
|
361
486
|
},
|
|
362
|
-
"
|
|
487
|
+
"getter": false,
|
|
488
|
+
"setter": false,
|
|
363
489
|
"reflect": false,
|
|
490
|
+
"attribute": "primary-color",
|
|
364
491
|
"defaultValue": "\"\""
|
|
365
492
|
},
|
|
366
493
|
"accentColor": {
|
|
@@ -377,9 +504,51 @@ export class DashButtonComponent {
|
|
|
377
504
|
"tags": [],
|
|
378
505
|
"text": ""
|
|
379
506
|
},
|
|
380
|
-
"
|
|
507
|
+
"getter": false,
|
|
508
|
+
"setter": false,
|
|
381
509
|
"reflect": false,
|
|
510
|
+
"attribute": "accent-color",
|
|
382
511
|
"defaultValue": "\"\""
|
|
512
|
+
},
|
|
513
|
+
"showNotification": {
|
|
514
|
+
"type": "boolean",
|
|
515
|
+
"mutable": false,
|
|
516
|
+
"complexType": {
|
|
517
|
+
"original": "boolean",
|
|
518
|
+
"resolved": "boolean",
|
|
519
|
+
"references": {}
|
|
520
|
+
},
|
|
521
|
+
"required": false,
|
|
522
|
+
"optional": false,
|
|
523
|
+
"docs": {
|
|
524
|
+
"tags": [],
|
|
525
|
+
"text": ""
|
|
526
|
+
},
|
|
527
|
+
"getter": false,
|
|
528
|
+
"setter": false,
|
|
529
|
+
"reflect": false,
|
|
530
|
+
"attribute": "show-notification",
|
|
531
|
+
"defaultValue": "true"
|
|
532
|
+
},
|
|
533
|
+
"notificationPosition": {
|
|
534
|
+
"type": "string",
|
|
535
|
+
"mutable": false,
|
|
536
|
+
"complexType": {
|
|
537
|
+
"original": "'left' | 'right'",
|
|
538
|
+
"resolved": "\"left\" | \"right\"",
|
|
539
|
+
"references": {}
|
|
540
|
+
},
|
|
541
|
+
"required": false,
|
|
542
|
+
"optional": false,
|
|
543
|
+
"docs": {
|
|
544
|
+
"tags": [],
|
|
545
|
+
"text": ""
|
|
546
|
+
},
|
|
547
|
+
"getter": false,
|
|
548
|
+
"setter": false,
|
|
549
|
+
"reflect": false,
|
|
550
|
+
"attribute": "notification-position",
|
|
551
|
+
"defaultValue": "'left'"
|
|
383
552
|
}
|
|
384
553
|
};
|
|
385
554
|
}
|
|
@@ -395,9 +564,9 @@ export class DashButtonComponent {
|
|
|
395
564
|
"config": {},
|
|
396
565
|
"localMenuLinks": {},
|
|
397
566
|
"organizationUrl": {},
|
|
398
|
-
"isRestricted": {}
|
|
567
|
+
"isRestricted": {},
|
|
568
|
+
"collapsedModuleSection": {}
|
|
399
569
|
};
|
|
400
570
|
}
|
|
401
571
|
static get elementRef() { return "el"; }
|
|
402
572
|
}
|
|
403
|
-
//# sourceMappingURL=dash-button.js.map
|
package/dist/collection/index.js
CHANGED
|
@@ -27,9 +27,8 @@ const DEFAULT_CONFIG = {
|
|
|
27
27
|
};
|
|
28
28
|
// Fetch config from API
|
|
29
29
|
class ConfigService {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
30
|
+
static instance;
|
|
31
|
+
_config = DEFAULT_CONFIG;
|
|
33
32
|
static getInstance() {
|
|
34
33
|
if (!ConfigService.instance) {
|
|
35
34
|
ConfigService.instance = new ConfigService();
|
|
@@ -42,7 +41,7 @@ class ConfigService {
|
|
|
42
41
|
if (!res.ok)
|
|
43
42
|
throw new Error('Failed to fetch config');
|
|
44
43
|
const data = await res.json();
|
|
45
|
-
this._config =
|
|
44
|
+
this._config = { ...DEFAULT_CONFIG, ...data }; // Merge API data with defaults
|
|
46
45
|
}
|
|
47
46
|
catch (e) {
|
|
48
47
|
console.warn('Using default config due to API failure', e);
|
|
@@ -58,4 +57,3 @@ class ConfigService {
|
|
|
58
57
|
}
|
|
59
58
|
}
|
|
60
59
|
export const configService = ConfigService.getInstance();
|
|
61
|
-
//# sourceMappingURL=config.js.map
|
|
@@ -43,7 +43,7 @@ class MenuService {
|
|
|
43
43
|
throw new Error('API error');
|
|
44
44
|
return await res.json();
|
|
45
45
|
}
|
|
46
|
-
catch
|
|
46
|
+
catch {
|
|
47
47
|
return { data: [], total: 0, page: 1, perPage: 0, totalPages: 0 };
|
|
48
48
|
}
|
|
49
49
|
}
|
|
@@ -63,17 +63,16 @@ class MenuService {
|
|
|
63
63
|
urlObj.hostname = `containerisationbackend.${urlObj.hostname}`;
|
|
64
64
|
const { data } = await this.getMenuConfig(`${urlObj.origin}/developer/charts/installed`);
|
|
65
65
|
return data.map(d => {
|
|
66
|
-
|
|
67
|
-
const frontendUrlPrefix = (_a = d.metadata) === null || _a === void 0 ? void 0 : _a.frontendUrlPrefix;
|
|
66
|
+
const frontendUrlPrefix = d.metadata?.frontendUrlPrefix;
|
|
68
67
|
const rootDomain = getRootDomain(BASE_URL);
|
|
69
68
|
const generatedUrl = `${getUrlProtocol(BASE_URL)}${frontendUrlPrefix}.${rootDomain}`;
|
|
70
69
|
return {
|
|
71
70
|
name: d.installChartName,
|
|
72
71
|
url: frontendUrlPrefix ? generatedUrl : "",
|
|
73
|
-
category:
|
|
72
|
+
category: d.metadata?.category ?? "",
|
|
73
|
+
icon: d.metadata?.icon ?? "",
|
|
74
74
|
};
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
export const menuService = new MenuService();
|
|
79
|
-
//# sourceMappingURL=menu.js.map
|