dash-button-web 0.0.23-beta.1 → 0.0.23-beta.3
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 +10842 -0
- package/dist/cjs/{index-BfwSK14n.js → index-DcvBej9f.js} +122 -4
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/web-compnont.cjs.js +3 -3
- package/dist/collection/collection-manifest.json +11 -3
- package/dist/collection/components/my-component/dash-button.js +50 -86
- package/dist/collection/services/config.js +3 -4
- package/dist/collection/services/menu.js +3 -4
- package/dist/components/dash-button.js +1 -1
- package/dist/components/index.js +1 -1
- 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 +10837 -0
- package/dist/esm/{index-6_Ga3Eox.js → index-p0GxQx6x.js} +122 -4
- package/dist/esm/loader.js +4 -4
- package/dist/esm/web-compnont.js +4 -4
- package/dist/types/components/my-component/dash-button.d.ts +1 -1
- package/dist/web-compnont/p-DQuL1Twl.js +1 -0
- package/dist/web-compnont/p-a0a0ebc6.entry.js +3 -0
- package/dist/web-compnont/p-p0GxQx6x.js +3 -0
- package/dist/web-compnont/web-compnont.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/app-globals-cd54EKuF.js +0 -15
- package/dist/cjs/dash-button.cjs.entry.js +0 -4314
- package/dist/collection/global/app.js +0 -7
- package/dist/esm/app-globals-B2hgy9FG.js +0 -13
- package/dist/esm/dash-button.entry.js +0 -4312
- package/dist/types/global/app.d.ts +0 -2
- package/dist/web-compnont/p-6_Ga3Eox.js +0 -3
- package/dist/web-compnont/p-7de50cbc.entry.js +0 -1
- package/dist/web-compnont/p-DiU1T8CW.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const NAMESPACE = 'web-compnont';
|
|
4
|
-
const BUILD = /* web-compnont */ { hotModuleReplacement: false, hydratedSelectorName: "hydrated", lazyLoad: true, propChangeCallback:
|
|
4
|
+
const BUILD = /* web-compnont */ { hotModuleReplacement: false, hydratedSelectorName: "hydrated", lazyLoad: true, propChangeCallback: true, state: true, updatable: true};
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
Stencil Client Platform v4.45.0 | MIT Licensed | https://stenciljs.com
|
|
@@ -200,7 +200,6 @@ var flush = () => {
|
|
|
200
200
|
};
|
|
201
201
|
var nextTick = (cb) => promiseResolve().then(cb);
|
|
202
202
|
var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
|
|
203
|
-
var setAssetPath = (path) => plt.$resourcesUrl$ = path;
|
|
204
203
|
|
|
205
204
|
// src/utils/style.ts
|
|
206
205
|
function createStyleSheetIfNeededAndSupported(styles2) {
|
|
@@ -444,6 +443,31 @@ var newVNode = (tag, text) => {
|
|
|
444
443
|
var Host = {};
|
|
445
444
|
var isHost = (node) => node && node.$tag$ === Host;
|
|
446
445
|
|
|
446
|
+
// src/runtime/normalize-watchers.ts
|
|
447
|
+
var normalizeWatchers = (raw) => {
|
|
448
|
+
if (!raw) return void 0;
|
|
449
|
+
const keys = Object.keys(raw);
|
|
450
|
+
if (keys.length === 0) return void 0;
|
|
451
|
+
let hasLegacy = false;
|
|
452
|
+
for (const propName of keys) {
|
|
453
|
+
if (hasLegacy) break;
|
|
454
|
+
for (const h2 of raw[propName]) {
|
|
455
|
+
if (typeof h2 === "string") {
|
|
456
|
+
hasLegacy = true;
|
|
457
|
+
break;
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
if (!hasLegacy) return raw;
|
|
462
|
+
const out = {};
|
|
463
|
+
for (const propName of keys) {
|
|
464
|
+
out[propName] = raw[propName].map(
|
|
465
|
+
(h2) => typeof h2 === "string" ? { [h2]: 0 } : h2
|
|
466
|
+
);
|
|
467
|
+
}
|
|
468
|
+
return out;
|
|
469
|
+
};
|
|
470
|
+
|
|
447
471
|
// src/runtime/parse-property-value.ts
|
|
448
472
|
var parsePropertyValue = (propValue, propType, isFormAssociated) => {
|
|
449
473
|
if (propValue != null && !isComplexType(propValue)) {
|
|
@@ -452,6 +476,9 @@ var parsePropertyValue = (propValue, propType, isFormAssociated) => {
|
|
|
452
476
|
return propValue === "false" ? false : propValue === "" || !!propValue;
|
|
453
477
|
}
|
|
454
478
|
}
|
|
479
|
+
if (propType & 2 /* Number */) {
|
|
480
|
+
return typeof propValue === "string" ? parseFloat(propValue) : typeof propValue === "number" ? propValue : NaN;
|
|
481
|
+
}
|
|
455
482
|
if (propType & 1 /* String */) {
|
|
456
483
|
return String(propValue);
|
|
457
484
|
}
|
|
@@ -463,6 +490,21 @@ var getElement = (ref) => {
|
|
|
463
490
|
var _a;
|
|
464
491
|
return (_a = getHostRef(ref)) == null ? void 0 : _a.$hostElement$ ;
|
|
465
492
|
};
|
|
493
|
+
|
|
494
|
+
// src/runtime/event-emitter.ts
|
|
495
|
+
var createEvent = (ref, name, flags) => {
|
|
496
|
+
const elm = getElement(ref);
|
|
497
|
+
return {
|
|
498
|
+
emit: (detail) => {
|
|
499
|
+
return emitEvent(elm, name, {
|
|
500
|
+
bubbles: true,
|
|
501
|
+
composed: true,
|
|
502
|
+
cancelable: true,
|
|
503
|
+
detail
|
|
504
|
+
});
|
|
505
|
+
}
|
|
506
|
+
};
|
|
507
|
+
};
|
|
466
508
|
var emitEvent = (elm, name, opts) => {
|
|
467
509
|
const ev = plt.ce(name, opts);
|
|
468
510
|
elm.dispatchEvent(ev);
|
|
@@ -503,7 +545,11 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
|
|
|
503
545
|
}
|
|
504
546
|
}
|
|
505
547
|
}
|
|
506
|
-
} else if (memberName === "key") ; else if (
|
|
548
|
+
} else if (memberName === "key") ; else if (memberName === "ref") {
|
|
549
|
+
if (newValue) {
|
|
550
|
+
queueRefAttachment(newValue, elm);
|
|
551
|
+
}
|
|
552
|
+
} else if ((!isProp ) && memberName[0] === "o" && memberName[1] === "n") {
|
|
507
553
|
if (memberName[2] === "-") {
|
|
508
554
|
memberName = memberName.slice(3);
|
|
509
555
|
} else if (isMemberInElement(win, ln)) {
|
|
@@ -640,6 +686,8 @@ function sortedAttrNames(attrNames) {
|
|
|
640
686
|
}
|
|
641
687
|
var hostTagName;
|
|
642
688
|
var isSvgMode = false;
|
|
689
|
+
var refCallbacksToRemove = [];
|
|
690
|
+
var refCallbacksToAttach = [];
|
|
643
691
|
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
644
692
|
const newVNode2 = newParentVNode.$children$[childIndex];
|
|
645
693
|
let i2 = 0;
|
|
@@ -708,6 +756,7 @@ var removeVnodes = (vnodes, startIdx, endIdx) => {
|
|
|
708
756
|
const vnode = vnodes[index];
|
|
709
757
|
if (vnode) {
|
|
710
758
|
const elm = vnode.$elm$;
|
|
759
|
+
nullifyVNodeRefs(vnode);
|
|
711
760
|
if (elm) {
|
|
712
761
|
elm.remove();
|
|
713
762
|
}
|
|
@@ -844,6 +893,27 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
844
893
|
elm.data = text;
|
|
845
894
|
}
|
|
846
895
|
};
|
|
896
|
+
var nullifyVNodeRefs = (vNode) => {
|
|
897
|
+
{
|
|
898
|
+
if (vNode.$attrs$ && vNode.$attrs$.ref) {
|
|
899
|
+
refCallbacksToRemove.push(() => vNode.$attrs$.ref(null));
|
|
900
|
+
}
|
|
901
|
+
vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
|
|
902
|
+
}
|
|
903
|
+
};
|
|
904
|
+
var queueRefAttachment = (refCallback, elm) => {
|
|
905
|
+
{
|
|
906
|
+
refCallbacksToAttach.push(() => refCallback(elm));
|
|
907
|
+
}
|
|
908
|
+
};
|
|
909
|
+
var flushQueuedRefCallbacks = () => {
|
|
910
|
+
{
|
|
911
|
+
refCallbacksToRemove.forEach((cb) => cb());
|
|
912
|
+
refCallbacksToRemove.length = 0;
|
|
913
|
+
refCallbacksToAttach.forEach((cb) => cb());
|
|
914
|
+
refCallbacksToAttach.length = 0;
|
|
915
|
+
}
|
|
916
|
+
};
|
|
847
917
|
var insertBefore = (parent, newNode, reference, isInitialLoad) => {
|
|
848
918
|
{
|
|
849
919
|
return parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
|
@@ -867,6 +937,7 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
867
937
|
hostRef.$vnode$ = rootVnode;
|
|
868
938
|
rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
|
|
869
939
|
patch(oldVNode, rootVnode, isInitialLoad);
|
|
940
|
+
flushQueuedRefCallbacks();
|
|
870
941
|
};
|
|
871
942
|
|
|
872
943
|
// src/runtime/update-component.ts
|
|
@@ -1045,6 +1116,7 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1045
1116
|
`Couldn't find host element for "${cmpMeta.$tagName$}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/stenciljs/core/issues/5457).`
|
|
1046
1117
|
);
|
|
1047
1118
|
}
|
|
1119
|
+
const elm = hostRef.$hostElement$ ;
|
|
1048
1120
|
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
1049
1121
|
const flags = hostRef.$flags$;
|
|
1050
1122
|
const instance = hostRef.$lazyInstance$ ;
|
|
@@ -1055,6 +1127,27 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1055
1127
|
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
1056
1128
|
if ((!(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
|
|
1057
1129
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
1130
|
+
if (cmpMeta.$watchers$) {
|
|
1131
|
+
const watchMethods = cmpMeta.$watchers$[propName];
|
|
1132
|
+
if (watchMethods) {
|
|
1133
|
+
watchMethods.map((watcher) => {
|
|
1134
|
+
try {
|
|
1135
|
+
const [[watchMethodName, watcherFlags]] = Object.entries(watcher);
|
|
1136
|
+
if (flags & 128 /* isWatchReady */ || watcherFlags & 1 /* Immediate */) {
|
|
1137
|
+
if (!instance) {
|
|
1138
|
+
hostRef.$fetchedCbList$.push(() => {
|
|
1139
|
+
hostRef.$lazyInstance$[watchMethodName](newVal, oldVal, propName);
|
|
1140
|
+
});
|
|
1141
|
+
} else {
|
|
1142
|
+
instance[watchMethodName](newVal, oldVal, propName);
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
1145
|
+
} catch (e) {
|
|
1146
|
+
consoleError(e, elm);
|
|
1147
|
+
}
|
|
1148
|
+
});
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1058
1151
|
if (flags & 2 /* hasRendered */) {
|
|
1059
1152
|
if (instance.componentShouldUpdate) {
|
|
1060
1153
|
const shouldUpdate = instance.componentShouldUpdate(newVal, oldVal, propName);
|
|
@@ -1072,6 +1165,17 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1072
1165
|
var _a, _b;
|
|
1073
1166
|
const prototype = Cstr.prototype;
|
|
1074
1167
|
if (cmpMeta.$members$ || BUILD.propChangeCallback) {
|
|
1168
|
+
{
|
|
1169
|
+
if (Cstr.watchers && !cmpMeta.$watchers$) {
|
|
1170
|
+
cmpMeta.$watchers$ = normalizeWatchers(Cstr.watchers);
|
|
1171
|
+
}
|
|
1172
|
+
if (Cstr.deserializers && !cmpMeta.$deserializers$) {
|
|
1173
|
+
cmpMeta.$deserializers$ = Cstr.deserializers;
|
|
1174
|
+
}
|
|
1175
|
+
if (Cstr.serializers && !cmpMeta.$serializers$) {
|
|
1176
|
+
cmpMeta.$serializers$ = Cstr.serializers;
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
1075
1179
|
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
1076
1180
|
members.map(([memberName, [memberFlags]]) => {
|
|
1077
1181
|
if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
|
|
@@ -1237,6 +1341,11 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1237
1341
|
throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
|
|
1238
1342
|
}
|
|
1239
1343
|
if (!Cstr.isProxied) {
|
|
1344
|
+
{
|
|
1345
|
+
cmpMeta.$watchers$ = normalizeWatchers(Cstr.watchers);
|
|
1346
|
+
cmpMeta.$serializers$ = Cstr.serializers;
|
|
1347
|
+
cmpMeta.$deserializers$ = Cstr.deserializers;
|
|
1348
|
+
}
|
|
1240
1349
|
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
|
|
1241
1350
|
Cstr.isProxied = true;
|
|
1242
1351
|
}
|
|
@@ -1252,6 +1361,9 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1252
1361
|
{
|
|
1253
1362
|
hostRef.$flags$ &= -9 /* isConstructingInstance */;
|
|
1254
1363
|
}
|
|
1364
|
+
{
|
|
1365
|
+
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
1366
|
+
}
|
|
1255
1367
|
endNewInstance();
|
|
1256
1368
|
{
|
|
1257
1369
|
fireConnectedCallback(hostRef.$lazyInstance$, elm);
|
|
@@ -1385,6 +1497,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1385
1497
|
plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", win.document.baseURI).href;
|
|
1386
1498
|
lazyBundles.map((lazyBundle) => {
|
|
1387
1499
|
lazyBundle[1].map((compactMeta) => {
|
|
1500
|
+
var _a2, _b;
|
|
1388
1501
|
const cmpMeta = {
|
|
1389
1502
|
$flags$: compactMeta[0],
|
|
1390
1503
|
$tagName$: compactMeta[1],
|
|
@@ -1394,6 +1507,11 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1394
1507
|
{
|
|
1395
1508
|
cmpMeta.$members$ = compactMeta[2];
|
|
1396
1509
|
}
|
|
1510
|
+
{
|
|
1511
|
+
cmpMeta.$watchers$ = normalizeWatchers(compactMeta[4]);
|
|
1512
|
+
cmpMeta.$serializers$ = (_a2 = compactMeta[5]) != null ? _a2 : {};
|
|
1513
|
+
cmpMeta.$deserializers$ = (_b = compactMeta[6]) != null ? _b : {};
|
|
1514
|
+
}
|
|
1397
1515
|
const tagName = transformTag(cmpMeta.$tagName$);
|
|
1398
1516
|
const HostElement = class extends HTMLElement {
|
|
1399
1517
|
["s-p"];
|
|
@@ -1499,9 +1617,9 @@ function transformTag(tag) {
|
|
|
1499
1617
|
}
|
|
1500
1618
|
|
|
1501
1619
|
exports.bootstrapLazy = bootstrapLazy;
|
|
1620
|
+
exports.createEvent = createEvent;
|
|
1502
1621
|
exports.getElement = getElement;
|
|
1503
1622
|
exports.h = h;
|
|
1504
1623
|
exports.promiseResolve = promiseResolve;
|
|
1505
1624
|
exports.registerInstance = registerInstance;
|
|
1506
|
-
exports.setAssetPath = setAssetPath;
|
|
1507
1625
|
exports.setNonce = setNonce;
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
4
|
-
var appGlobals = require('./app-globals-
|
|
3
|
+
var index = require('./index-DcvBej9f.js');
|
|
4
|
+
var appGlobals = require('./app-globals-V2Kpy_OQ.js');
|
|
5
5
|
|
|
6
6
|
const defineCustomElements = async (win, options) => {
|
|
7
7
|
if (typeof window === 'undefined') return undefined;
|
|
8
8
|
await appGlobals.globalScripts();
|
|
9
|
-
return index.bootstrapLazy([["dash-
|
|
9
|
+
return index.bootstrapLazy([["dash-button_4.cjs",[[513,"dash-button",{"showPostLoginText":[4,"show-post-login-text"],"silentCheckSso":[4,"silent-check-sso"],"redirectUri":[1,"redirect-uri"],"authMethod":[1,"auth-method"],"portalApiUrl":[1,"portal-api-url"],"plmUrl":[1,"plm-url"],"showUnauthorizedModal":[4,"show-unauthorized-modal"],"primaryColor":[1,"primary-color"],"accentColor":[1,"accent-color"],"notificationPosition":[1,"notification-position"],"keycloak":[32],"isAuth":[32],"givenUserName":[32],"silentCheckSsoRedirectUri":[32],"appList":[32],"avatarSvg":[32],"isLoading":[32],"config":[32],"localMenuLinks":[32],"organizationUrl":[32],"isRestricted":[32]}],[513,"notification-component",{"owner":[1],"applicationId":[1,"application-id"],"maxRecords":[2,"max-records"],"listUrl":[1,"list-url"],"displayType":[1,"display-type"],"notificationUrl":[1,"notification-url"],"socketConnect":[4,"socket-connect"],"socketUrl":[1,"socket-url"],"showModal":[32]},null,{"showModal":[{"ownerChanged":0}]}],[513,"notification-table",{"owner":[1],"applicationId":[1,"application-id"],"maxRecords":[2,"max-records"],"listUrl":[1,"list-url"],"displayType":[1,"display-type"],"notificationUrl":[1,"notification-url"],"socketConnect":[4,"socket-connect"],"socketUrl":[1,"socket-url"],"showTable":[32],"loading":[32],"newCount":[32],"notificationList":[32],"markingRead":[32],"pageNumber":[32],"totalRecords":[32],"search":[32],"searching":[32],"showSearchBar":[32],"categoryList":[32],"statusList":[32]},null,{"owner":[{"ownerChanged":0}]}],[513,"loading-component",{"show":[4],"size":[1]}]]]], options);
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
exports.setNonce = index.setNonce;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
4
|
-
var appGlobals = require('./app-globals-
|
|
3
|
+
var index = require('./index-DcvBej9f.js');
|
|
4
|
+
var appGlobals = require('./app-globals-V2Kpy_OQ.js');
|
|
5
5
|
|
|
6
6
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
7
7
|
/*
|
|
@@ -19,7 +19,7 @@ var patchBrowser = () => {
|
|
|
19
19
|
|
|
20
20
|
patchBrowser().then(async (options) => {
|
|
21
21
|
await appGlobals.globalScripts();
|
|
22
|
-
return index.bootstrapLazy([["dash-
|
|
22
|
+
return index.bootstrapLazy([["dash-button_4.cjs",[[513,"dash-button",{"showPostLoginText":[4,"show-post-login-text"],"silentCheckSso":[4,"silent-check-sso"],"redirectUri":[1,"redirect-uri"],"authMethod":[1,"auth-method"],"portalApiUrl":[1,"portal-api-url"],"plmUrl":[1,"plm-url"],"showUnauthorizedModal":[4,"show-unauthorized-modal"],"primaryColor":[1,"primary-color"],"accentColor":[1,"accent-color"],"notificationPosition":[1,"notification-position"],"keycloak":[32],"isAuth":[32],"givenUserName":[32],"silentCheckSsoRedirectUri":[32],"appList":[32],"avatarSvg":[32],"isLoading":[32],"config":[32],"localMenuLinks":[32],"organizationUrl":[32],"isRestricted":[32]}],[513,"notification-component",{"owner":[1],"applicationId":[1,"application-id"],"maxRecords":[2,"max-records"],"listUrl":[1,"list-url"],"displayType":[1,"display-type"],"notificationUrl":[1,"notification-url"],"socketConnect":[4,"socket-connect"],"socketUrl":[1,"socket-url"],"showModal":[32]},null,{"showModal":[{"ownerChanged":0}]}],[513,"notification-table",{"owner":[1],"applicationId":[1,"application-id"],"maxRecords":[2,"max-records"],"listUrl":[1,"list-url"],"displayType":[1,"display-type"],"notificationUrl":[1,"notification-url"],"socketConnect":[4,"socket-connect"],"socketUrl":[1,"socket-url"],"showTable":[32],"loading":[32],"newCount":[32],"notificationList":[32],"markingRead":[32],"pageNumber":[32],"totalRecords":[32],"search":[32],"searching":[32],"showSearchBar":[32],"categoryList":[32],"statusList":[32]},null,{"owner":[{"ownerChanged":0}]}],[513,"loading-component",{"show":[4],"size":[1]}]]]], options);
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
exports.setNonce = index.setNonce;
|
|
@@ -8,7 +8,15 @@
|
|
|
8
8
|
"version": "4.45.0",
|
|
9
9
|
"typescriptVersion": "5.8.3"
|
|
10
10
|
},
|
|
11
|
-
"collections": [
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
"collections": [
|
|
12
|
+
{
|
|
13
|
+
"name": "ice-notification-component",
|
|
14
|
+
"tags": [
|
|
15
|
+
"loading-component",
|
|
16
|
+
"notification-component",
|
|
17
|
+
"notification-table"
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"bundles": []
|
|
14
22
|
}
|
|
@@ -3,72 +3,42 @@ 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
|
-
|
|
28
|
-
|
|
29
|
-
this.el.addEventListener('click', (event) => {
|
|
30
|
-
const path = event.composedPath();
|
|
31
|
-
// Ensure this click originated from inside the notification module
|
|
32
|
-
const isInsideNotification = path.some((target) => target && target.tagName === 'NOTIFICATION-COMPONENT');
|
|
33
|
-
// If the click is outside the notification module (e.g., somewhere else in dash-button), exit early
|
|
34
|
-
if (!isInsideNotification) {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
// 2. Identify the specific link element inside the path array
|
|
38
|
-
const clickedLink = path.find((target) => target && (target.tagName === 'A' || (typeof target.hasAttribute === 'function' && target.hasAttribute('href'))));
|
|
39
|
-
if (clickedLink) {
|
|
40
|
-
const destinationUrl = clickedLink.getAttribute('href');
|
|
41
|
-
if (destinationUrl) {
|
|
42
|
-
// Prevent the default behavior ONLY for the notification component links
|
|
43
|
-
event.preventDefault();
|
|
44
|
-
event.stopPropagation();
|
|
45
|
-
// Check if the link contains the unique class name
|
|
46
|
-
const isHomeIconLink = clickedLink.classList.contains('button-link');
|
|
47
|
-
if (isHomeIconLink) {
|
|
48
|
-
console.log('Notification module home link intercepted. Opening in new tab:', destinationUrl);
|
|
49
|
-
window.open(destinationUrl, '_blank', 'noopener,noreferrer');
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
console.log('Notification module standard link intercepted. Navigating in current view:', destinationUrl);
|
|
53
|
-
window.location.href = destinationUrl;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
}
|
|
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
|
+
notificationPosition = "left";
|
|
19
|
+
keycloak = null;
|
|
20
|
+
isAuth = false;
|
|
21
|
+
givenUserName = "";
|
|
22
|
+
silentCheckSsoRedirectUri = window.location.origin + '/assets/verificar-sso.html';
|
|
23
|
+
appList = [];
|
|
24
|
+
avatarSvg = toSvg("init-avatar", 40);
|
|
25
|
+
isLoading = false;
|
|
26
|
+
config;
|
|
27
|
+
localMenuLinks;
|
|
28
|
+
organizationUrl;
|
|
29
|
+
isRestricted = false;
|
|
59
30
|
async componentWillLoad() {
|
|
60
|
-
var _a, _b, _c, _d;
|
|
61
31
|
// Fetch config from API
|
|
62
32
|
this.config = await configService.fetchConfig(this.portalApiUrl);
|
|
63
33
|
console.log(this.config);
|
|
64
34
|
if (!this.config)
|
|
65
35
|
return; // prevent Keycloak init if fetch failed
|
|
66
36
|
// render will show spinner
|
|
67
|
-
if (
|
|
37
|
+
if (this.config?.loading?.isLoading) {
|
|
68
38
|
this.isLoading = true;
|
|
69
39
|
setTimeout(() => {
|
|
70
40
|
this.isLoading = false;
|
|
71
|
-
},
|
|
41
|
+
}, this.config?.loading?.duration);
|
|
72
42
|
}
|
|
73
43
|
// Initialize Keycloak
|
|
74
44
|
this.keycloak = new Keycloak({
|
|
@@ -99,34 +69,32 @@ export class DashButtonComponent {
|
|
|
99
69
|
checkLoginIframe: false,
|
|
100
70
|
silentCheckSsoRedirectUri: this.silentCheckSso ? this.silentCheckSsoRedirectUri : '',
|
|
101
71
|
}).then((res) => {
|
|
102
|
-
var _a, _b, _c;
|
|
103
72
|
if (res) {
|
|
104
73
|
this.isAuth = true;
|
|
105
74
|
localStorage.setItem("keycloak", JSON.stringify(this.keycloak));
|
|
106
75
|
// document.cookie = "DASH_BTN=" + JSON.parse(localStorage.getItem('keycloak')).token;
|
|
107
|
-
document.cookie = this.config.cookieName + "=" + JSON.parse(
|
|
76
|
+
document.cookie = this.config.cookieName + "=" + JSON.parse(localStorage.getItem('keycloak') ?? '{}').token;
|
|
108
77
|
// Set userName
|
|
109
|
-
this.givenUserName = JSON.parse(
|
|
78
|
+
this.givenUserName = JSON.parse(localStorage.getItem('keycloak') ?? '{}').idTokenParsed.preferred_username;
|
|
110
79
|
// Set user avatar
|
|
111
|
-
this.avatarSvg = toSvg(JSON.parse(
|
|
80
|
+
this.avatarSvg = toSvg(JSON.parse(localStorage.getItem('keycloak') ?? '{}').idTokenParsed.sub, 40);
|
|
112
81
|
}
|
|
113
82
|
});
|
|
114
83
|
}
|
|
115
84
|
async loadOrganizationUrlAndLinks() {
|
|
116
|
-
var _a, _b, _c;
|
|
117
85
|
// Read org URL safely
|
|
118
86
|
try {
|
|
119
87
|
const kc = JSON.parse(localStorage.getItem("keycloak") || "{}");
|
|
120
|
-
this.organizationUrl =
|
|
88
|
+
this.organizationUrl = kc?.idTokenParsed?.organizationUrl || null;
|
|
121
89
|
}
|
|
122
|
-
catch
|
|
90
|
+
catch {
|
|
123
91
|
this.organizationUrl = null;
|
|
124
92
|
}
|
|
125
93
|
// If no organization, do nothing
|
|
126
94
|
if (!this.organizationUrl)
|
|
127
95
|
return;
|
|
128
96
|
// If config or menu not ready, skip
|
|
129
|
-
if (!
|
|
97
|
+
if (!this.config?.menu?.local)
|
|
130
98
|
return;
|
|
131
99
|
// Only load when custom menu is NOT enabled
|
|
132
100
|
if (!this.config.menu.local.enableCustomLocalMenu) {
|
|
@@ -143,26 +111,25 @@ export class DashButtonComponent {
|
|
|
143
111
|
// Then, check the token's organization URL
|
|
144
112
|
// Finally, check against dashbutton configuration: allowedGlobalDomain and whitelistedUrls
|
|
145
113
|
validateAppAccessByUrl() {
|
|
146
|
-
var _a, _b, _c, _d, _e, _f;
|
|
147
114
|
const normalizeUrl = (url) => url.replace(/\/+$/, '');
|
|
148
115
|
const currentUrl = normalizeUrl(window.location.href);
|
|
149
116
|
const currentOrigin = normalizeUrl(window.location.origin);
|
|
150
|
-
const globalLinks =
|
|
151
|
-
const allowedGlobalDomain =
|
|
152
|
-
const whitelistedUrls =
|
|
117
|
+
const globalLinks = this.config?.menu?.global?.links || [];
|
|
118
|
+
const allowedGlobalDomain = this.config?.allowedGlobalDomain || '';
|
|
119
|
+
const whitelistedUrls = this.config?.whitelistedUrls || '';
|
|
153
120
|
// First, check global links
|
|
154
121
|
const matchGlobal = globalLinks.some(link => {
|
|
155
122
|
try {
|
|
156
123
|
const linkOrigin = normalizeUrl(new URL(link.url).origin);
|
|
157
124
|
return currentOrigin === linkOrigin;
|
|
158
125
|
}
|
|
159
|
-
catch
|
|
126
|
+
catch {
|
|
160
127
|
return false;
|
|
161
128
|
}
|
|
162
129
|
});
|
|
163
130
|
// Then check the token organization URL
|
|
164
|
-
const tokenParsed =
|
|
165
|
-
const allowedOrg = tokenParsed
|
|
131
|
+
const tokenParsed = this.keycloak?.tokenParsed;
|
|
132
|
+
const allowedOrg = tokenParsed?.organizationUrl;
|
|
166
133
|
const matchOrganization = allowedOrg && currentUrl.includes(normalizeUrl(allowedOrg));
|
|
167
134
|
// Check allowedGlobalDomain (single domain)
|
|
168
135
|
const matchAllowedDomain = allowedGlobalDomain &&
|
|
@@ -197,34 +164,31 @@ export class DashButtonComponent {
|
|
|
197
164
|
appModal.style.display = "none";
|
|
198
165
|
}
|
|
199
166
|
renderNotificationComponent() {
|
|
200
|
-
|
|
201
|
-
const
|
|
202
|
-
const
|
|
203
|
-
const orgUrlRaw = (token === null || token === void 0 ? void 0 : token.organizationUrl) || '';
|
|
167
|
+
const token = this.keycloak?.idTokenParsed;
|
|
168
|
+
const owner = token?.preferred_username || token?.sub || '';
|
|
169
|
+
const orgUrlRaw = token?.organizationUrl || '';
|
|
204
170
|
const orgHost = orgUrlRaw
|
|
205
171
|
? new URL(orgUrlRaw.startsWith('http') ? orgUrlRaw : `https://${orgUrlRaw}`).hostname
|
|
206
172
|
: '';
|
|
207
173
|
return orgHost && owner ? (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` })) : null;
|
|
208
174
|
}
|
|
209
175
|
render() {
|
|
210
|
-
|
|
211
|
-
return h("div", { key: 'a2d1650d96fcbbfa5128da4315e70dc0c2682dfd' }, h("div", { key: '975ab012c618442f627f00a9ee29773c08d55824' }, (() => {
|
|
212
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
176
|
+
return h("div", { key: '19d648150555501634f0ddd5d1ff1bbd8a6e8f7b' }, h("div", { key: '503bbe31b40f8927a8727de73b820626bfe62522' }, (() => {
|
|
213
177
|
// GLOBAL LOADING SPINNER
|
|
214
178
|
if (this.isLoading) {
|
|
215
179
|
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))));
|
|
216
180
|
}
|
|
217
181
|
if (this.isRestricted) {
|
|
218
|
-
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."),
|
|
182
|
+
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")))));
|
|
219
183
|
}
|
|
220
184
|
if (this.isAuth && this.showPostLoginText) {
|
|
221
185
|
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")));
|
|
222
186
|
}
|
|
223
187
|
else if (this.isAuth) {
|
|
224
|
-
return (h("div", { class: "profile-actions", style: { display: "inline-flex", alignItems: "center", gap: "15px" } }, this.notificationPosition !== "right" && this.renderNotificationComponent(), 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(
|
|
188
|
+
return (h("div", { class: "profile-actions", style: { display: "inline-flex", alignItems: "center", gap: "15px" } }, this.notificationPosition !== "right" && this.renderNotificationComponent(), 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 ?
|
|
225
189
|
h("img", { class: "profile-image", src: "https://s-damith.github.io/test-avatar/images/e24da9c5-0b1f-46fa-82cd-7c711c77b5c7.png" })
|
|
226
190
|
:
|
|
227
|
-
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(
|
|
191
|
+
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 => {
|
|
228
192
|
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)));
|
|
229
193
|
})), 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
|
|
230
194
|
? { marginBottom: '12px' }
|
|
@@ -237,15 +201,15 @@ export class DashButtonComponent {
|
|
|
237
201
|
else {
|
|
238
202
|
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")));
|
|
239
203
|
}
|
|
240
|
-
})()), h("div", { key: '
|
|
204
|
+
})()), h("div", { key: 'c18a187a01d2196210d1c20d3bc682f8479e3700', id: "appListModal", class: "modal" }, h("div", { key: '0b12b0b6928895900a74e878e47a345a5e6371fd', class: "modal-content" }, h("span", { key: 'b259933b44d186bdd756bb6108cc85748194f5ca', onClick: this.closeModal.bind(this), class: "close" }, "\u00D7"), h("div", { key: '56eb24767120a0732335efb6eb316504b63e95d2', class: "box" }, h("input", { key: '27567441136d750dbcf7958aecaada63102fc8ea', type: "radio", class: "tab-toggle", name: "tab-toggle", id: "tab1", checked: true }), h("ul", { key: '5d65e1c4b3f37f408c115d108c91f3f6c4dcfb0d', class: "tab-list" }, h("li", { key: '76b9322c5d01cdccf2c0ccdf47982163185b4538', class: "tab-item" }, h("label", { key: '1e3945d0370cfda6c30e4adf2f94937176317666', class: "tab-trigger", htmlFor: "tab1" }, h("i", { key: '22622e208b826be62d6fdef561aab0684945405a', class: "fa-solid fa-table-list menu-bar-icons" }), " ", this.config.menu.local.name))), h("div", { key: 'ab62210a80547521d860fe63e103e45001055080', class: "tab-container" }, h("div", { key: 'dc76a572864c07f5abf67d0625b8c21eeaacba74', class: "tab-content" }, h("div", { key: '10b8a6cdb0db43950a524becdb6372b82dab3129', class: "modal-body" }, !this.config?.menu?.local?.enableCustomLocalMenu ? (
|
|
241
205
|
// <div>{this.localMenuLinks}</div>
|
|
242
|
-
|
|
206
|
+
this.localMenuLinks?.map((app, index) => {
|
|
243
207
|
const isDisabled = !app.url;
|
|
244
208
|
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))));
|
|
245
|
-
})) : (
|
|
246
|
-
(
|
|
247
|
-
(
|
|
248
|
-
(
|
|
209
|
+
})) : (this.config.menu.local.links?.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."))) : (((!this.config?.menu?.local?.enableCustomLocalMenu &&
|
|
210
|
+
(this.localMenuLinks?.length ?? 0) === 0) ||
|
|
211
|
+
(this.config?.menu?.local?.enableCustomLocalMenu &&
|
|
212
|
+
(this.config?.menu?.local?.links?.length ?? 0) === 0)) && (h("div", null, h("h3", { class: "gray-text" }, "No installed ", this.config?.menu?.local?.name || "menu", " found."), h("p", { class: "gray-text" }, "Please contact administration.")))))))))), h("div", { key: '56e11d4950282c74727e5ddc6bd7b97908e7f31d', id: "appPermissionErrorModal", class: "modal" }, h("div", { key: '64766ad4104269fe9a866aa4816ad66142b8fdd2', class: "modal-content" }, h("img", { key: '41079a1a2dca0505a553b6f1890bd67f892a0c43', src: "data:image/png;base64,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" }), h("h2", { key: 'fc0b1ca5d770164bed603441ffe34d3701bb84c7', class: "green-text margin-b" }, "You don't have permission to access this application."), h("h3", { key: '17ae8656a89ccbdbaf88030110895e8e92e37c9a', class: "green-text" }, "Please contact the administration."), (this.config.defaultLink.url && this.showUnauthorizedModal) ?
|
|
249
213
|
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" }))))
|
|
250
214
|
: h("div", null))));
|
|
251
215
|
}
|
|
@@ -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);
|
|
@@ -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,14 +63,13 @@ 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 ?? "",
|
|
74
73
|
};
|
|
75
74
|
});
|
|
76
75
|
}
|