@e-llm-studio/instant-learning 1.3.34 → 1.3.37
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/ILMarketplaceWrapper.js +39 -1
- package/dist/ILMarketplaceWrapper.js.map +1 -1
- package/dist/cjs/ILMarketplaceWrapper.js +38 -0
- package/dist/cjs/ILMarketplaceWrapper.js.map +1 -1
- package/dist/cjs/features/IL-marketplace/components/GuidelineConfirmDialog.module.css.js +2 -2
- package/dist/cjs/features/IL-marketplace/components/GuidelineLibraryCard.js +134 -15
- package/dist/cjs/features/IL-marketplace/components/GuidelineLibraryCard.js.map +1 -1
- package/dist/cjs/features/IL-marketplace/components/GuidelineLibraryCard.module.css.js +2 -2
- package/dist/cjs/features/IL-marketplace/components/GuidelineLibraryContent.js +8 -0
- package/dist/cjs/features/IL-marketplace/components/GuidelineLibraryContent.js.map +1 -1
- package/dist/cjs/features/IL-marketplace/components/RequestAccessDialog.js +157 -0
- package/dist/cjs/features/IL-marketplace/components/RequestAccessDialog.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/components/RequestAccessDialog.module.css.js +12 -0
- package/dist/cjs/features/IL-marketplace/components/RequestAccessDialog.module.css.js.map +1 -0
- package/dist/cjs/features/IL-marketplace/services/IL-marketplace.api.js.map +1 -1
- package/dist/cjs/features/IL-marketplace/services/instant-learning.api.js +27 -0
- package/dist/cjs/features/IL-marketplace/services/instant-learning.api.js.map +1 -1
- package/dist/cjs/features/IL-marketplace/utils/shareModalPrefill.js +67 -0
- package/dist/cjs/features/IL-marketplace/utils/shareModalPrefill.js.map +1 -0
- package/dist/features/IL-marketplace/components/GuidelineConfirmDialog.js +9 -9
- package/dist/features/IL-marketplace/components/GuidelineConfirmDialog.js.map +1 -1
- package/dist/features/IL-marketplace/components/GuidelineConfirmDialog.module.css.js +2 -2
- package/dist/features/IL-marketplace/components/GuidelineLibraryCard.js +134 -15
- package/dist/features/IL-marketplace/components/GuidelineLibraryCard.js.map +1 -1
- package/dist/features/IL-marketplace/components/GuidelineLibraryCard.module.css.js +2 -2
- package/dist/features/IL-marketplace/components/GuidelineLibraryContent.js +8 -0
- package/dist/features/IL-marketplace/components/GuidelineLibraryContent.js.map +1 -1
- package/dist/features/IL-marketplace/components/RequestAccessDialog.js +153 -0
- package/dist/features/IL-marketplace/components/RequestAccessDialog.js.map +1 -0
- package/dist/features/IL-marketplace/components/RequestAccessDialog.module.css.js +8 -0
- package/dist/features/IL-marketplace/components/RequestAccessDialog.module.css.js.map +1 -0
- package/dist/features/IL-marketplace/services/IL-marketplace.api.js.map +1 -1
- package/dist/features/IL-marketplace/services/instant-learning.api.js +27 -1
- package/dist/features/IL-marketplace/services/instant-learning.api.js.map +1 -1
- package/dist/features/IL-marketplace/utils/shareModalPrefill.js +63 -0
- package/dist/features/IL-marketplace/utils/shareModalPrefill.js.map +1 -0
- package/dist/types/src/ILMarketplaceWrapper.d.ts +7 -1
- package/dist/types/src/ILMarketplaceWrapper.d.ts.map +1 -1
- package/dist/types/src/features/IL-marketplace/components/GuidelineLibraryCard.d.ts +8 -1
- package/dist/types/src/features/IL-marketplace/components/GuidelineLibraryCard.d.ts.map +1 -1
- package/dist/types/src/features/IL-marketplace/components/GuidelineLibraryContent.d.ts +8 -2
- package/dist/types/src/features/IL-marketplace/components/GuidelineLibraryContent.d.ts.map +1 -1
- package/dist/types/src/features/IL-marketplace/components/RequestAccessDialog.d.ts +35 -0
- package/dist/types/src/features/IL-marketplace/components/RequestAccessDialog.d.ts.map +1 -0
- package/dist/types/src/features/IL-marketplace/index.d.ts +2 -1
- package/dist/types/src/features/IL-marketplace/index.d.ts.map +1 -1
- package/dist/types/src/features/IL-marketplace/services/IL-marketplace.api.d.ts +2 -0
- package/dist/types/src/features/IL-marketplace/services/IL-marketplace.api.d.ts.map +1 -1
- package/dist/types/src/features/IL-marketplace/services/instant-learning.api.d.ts +12 -0
- package/dist/types/src/features/IL-marketplace/services/instant-learning.api.d.ts.map +1 -1
- package/dist/types/src/features/IL-marketplace/utils/shareModalPrefill.d.ts +13 -0
- package/dist/types/src/features/IL-marketplace/utils/shareModalPrefill.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +2 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var styleInject_es = require('../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js');
|
|
6
6
|
|
|
7
7
|
var css_248z = ".GuidelineConfirmDialog-module_overlay__RFfxB{align-items:center;background-color:rgba(0,0,0,.4);bottom:0;display:flex;justify-content:center;left:0;position:fixed;right:0;top:0;z-index:9999}.GuidelineConfirmDialog-module_dialog__-Lm15{background-color:var(--il-color-white,#fff);border-radius:12px;box-shadow:0 8px 30px rgba(0,0,0,.12);max-width:420px;padding:1.5rem;width:100%}.GuidelineConfirmDialog-module_title__X9Ros{color:var(--il-color-1f2937,#1f2937);font-size:var(--il-font-size-md,16px);font-weight:var(--il-font-weight-semibold,600);line-height:1.5rem}.GuidelineConfirmDialog-module_description__yJBd5{color:var(--il-color-667085,#667085);font-size:var(--il-font-size-sm,14px);line-height:1.25rem;margin-top:.5rem}.GuidelineConfirmDialog-module_actions__BK-si{align-items:center;display:flex;gap:.75rem;justify-content:flex-end;margin-top:1.5rem}.GuidelineConfirmDialog-module_cancelButton__PJQwG{background-color:var(--il-color-white,#fff);border:1px solid var(--il-color-d0d5dd,#d0d5dd);border-radius:6px;color:var(--il-color-344054,#344054);cursor:pointer;font-size:var(--il-font-size-sm,14px);font-weight:var(--il-font-weight-semibold,600);height:2.5rem;padding:0 1rem;transition:background-color .2s ease}.GuidelineConfirmDialog-module_cancelButton__PJQwG:hover{background-color:var(--il-color-f9fafb,#f9fafb)}.GuidelineConfirmDialog-module_cancelButton__PJQwG:disabled{cursor:not-allowed;opacity:.5}.GuidelineConfirmDialog-module_confirmButton__54zRt{border:none;border-radius:6px;color:var(--il-on-primary,var(--il-color-white,#fff));cursor:pointer;font-size:var(--il-font-size-sm,14px);font-weight:var(--il-font-weight-semibold,600);height:2.5rem;padding:0 1rem;transition:background-color .2s ease}.GuidelineConfirmDialog-module_confirmButton__54zRt:disabled{cursor:not-allowed;opacity:.5}.GuidelineConfirmDialog-module_confirmButtonDefault__uzghk{background-color:var(--il-color-5b2cf4,#5b2cf4)}.GuidelineConfirmDialog-module_confirmButtonDefault__uzghk:hover{background-color:var(--il-color-4c1fe8,#4c1fe8)}.GuidelineConfirmDialog-module_confirmButtonDanger__qF9rX{background-color:var(--il-color-ef4444,#ef4444)}.GuidelineConfirmDialog-module_confirmButtonDanger__qF9rX:hover{background-color:var(--il-color-dc2626,#dc2626)}";
|
|
8
|
-
var
|
|
8
|
+
var dialogStyles = {"overlay":"GuidelineConfirmDialog-module_overlay__RFfxB","dialog":"GuidelineConfirmDialog-module_dialog__-Lm15","title":"GuidelineConfirmDialog-module_title__X9Ros","description":"GuidelineConfirmDialog-module_description__yJBd5","actions":"GuidelineConfirmDialog-module_actions__BK-si","cancelButton":"GuidelineConfirmDialog-module_cancelButton__PJQwG","confirmButton":"GuidelineConfirmDialog-module_confirmButton__54zRt","confirmButtonDefault":"GuidelineConfirmDialog-module_confirmButtonDefault__uzghk","confirmButtonDanger":"GuidelineConfirmDialog-module_confirmButtonDanger__qF9rX"};
|
|
9
9
|
styleInject_es["default"](css_248z);
|
|
10
10
|
|
|
11
|
-
exports["default"] =
|
|
11
|
+
exports["default"] = dialogStyles;
|
|
12
12
|
//# sourceMappingURL=GuidelineConfirmDialog.module.css.js.map
|
|
@@ -14,6 +14,7 @@ var GuidelineIconButton = require('./GuidelineIconButton.js');
|
|
|
14
14
|
var GuidelineTooltip = require('./GuidelineTooltip.js');
|
|
15
15
|
var GuidelineCardMenu = require('./GuidelineCardMenu.js');
|
|
16
16
|
var GuidelineConfirmDialog = require('./GuidelineConfirmDialog.js');
|
|
17
|
+
var RequestAccessDialog = require('./RequestAccessDialog.js');
|
|
17
18
|
var GuidelineStatusChip = require('./GuidelineStatusChip.js');
|
|
18
19
|
var VersionSelectDropdown = require('./VersionSelectDropdown.js');
|
|
19
20
|
var useAuthStore = require('../../LearningManagement/store/useAuthStore.js');
|
|
@@ -24,6 +25,7 @@ var toast = require('primereact/toast');
|
|
|
24
25
|
var appsecUi = require('appsec-ui');
|
|
25
26
|
var instantLearning_api = require('../services/instant-learning.api.js');
|
|
26
27
|
var appsecRoles = require('../utils/appsecRoles.js');
|
|
28
|
+
var shareModalPrefill = require('../utils/shareModalPrefill.js');
|
|
27
29
|
var ErrorToastContent = require('../../LearningManagement/shared/ErrorToastContent.js');
|
|
28
30
|
var SuccessToastContent = require('../../LearningManagement/shared/SuccessToastContent.js');
|
|
29
31
|
|
|
@@ -100,6 +102,10 @@ function GuidelineLibraryCard({
|
|
|
100
102
|
onApproveGuideline,
|
|
101
103
|
onRejectGuideline,
|
|
102
104
|
onRequestAccess,
|
|
105
|
+
requestAccessDialog,
|
|
106
|
+
autoOpenShare = false,
|
|
107
|
+
autoOpenShareEmail,
|
|
108
|
+
onAutoOpenShareHandled,
|
|
103
109
|
waitingReviewLabel = "Waiting on your review",
|
|
104
110
|
approveLabel = "Approve",
|
|
105
111
|
rejectLabel = "Reject",
|
|
@@ -107,7 +113,7 @@ function GuidelineLibraryCard({
|
|
|
107
113
|
exploreHighlightConfig,
|
|
108
114
|
guidelinePinnedMessages
|
|
109
115
|
}) {
|
|
110
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H;
|
|
116
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I;
|
|
111
117
|
const guidelineId = utils.getGuidelineId(guideline);
|
|
112
118
|
const title = utils.getGuidelineTitle(guideline);
|
|
113
119
|
const description = utils.getGuidelineDisplayDescription(guideline);
|
|
@@ -171,6 +177,7 @@ function GuidelineLibraryCard({
|
|
|
171
177
|
enabled: Boolean(accessControl)
|
|
172
178
|
});
|
|
173
179
|
const isAccessDenied = isILMarketplace && guideline.has_access === false && !appAccess.permissions.has(viewPermission);
|
|
180
|
+
const showRequestAccessDialogButton = isAccessDenied && Boolean((requestAccessDialog == null ? void 0 : requestAccessDialog.approverGroupId) && onRequestAccess);
|
|
174
181
|
const { data: approvalCompletionStatus } = useMarketplaceApprovalStatus.useMarketplaceApprovalStatus(
|
|
175
182
|
guideline == null ? void 0 : guideline.instant_learning_id,
|
|
176
183
|
guideline == null ? void 0 : guideline.scope_id,
|
|
@@ -235,6 +242,7 @@ function GuidelineLibraryCard({
|
|
|
235
242
|
const [wishlistLoading, setWishlistLoading] = React.useState(false);
|
|
236
243
|
const [decisionLoading, setDecisionLoading] = React.useState(null);
|
|
237
244
|
const [requestAccessState, setRequestAccessState] = React.useState("idle");
|
|
245
|
+
const [requestAccessDialogOpen, setRequestAccessDialogOpen] = React.useState(false);
|
|
238
246
|
const [whenToApplyOpen, setWhenToApplyOpen] = React.useState(false);
|
|
239
247
|
const [whenNotToApplyOpen, setWhenNotToApplyOpen] = React.useState(false);
|
|
240
248
|
const resolvedDuplicateDescription = duplicateConfirmDescription != null ? duplicateConfirmDescription : `Are you sure you want to duplicate "${title}"? A copy will be created with "(1)" appended to the title.`;
|
|
@@ -387,27 +395,26 @@ function GuidelineLibraryCard({
|
|
|
387
395
|
}
|
|
388
396
|
onPreview(guideline);
|
|
389
397
|
};
|
|
390
|
-
const
|
|
398
|
+
const openShare = async () => {
|
|
391
399
|
var _a2, _b2, _c2, _d2;
|
|
392
|
-
event.stopPropagation();
|
|
393
400
|
if (!canShareGuideline || isShareBusy) {
|
|
394
|
-
return;
|
|
401
|
+
return false;
|
|
395
402
|
}
|
|
396
403
|
if (sharePermissionState === "error") {
|
|
397
404
|
retryFailedPermissionChecks();
|
|
398
|
-
return;
|
|
405
|
+
return false;
|
|
399
406
|
}
|
|
400
407
|
if (sharePermissionState !== "allowed") {
|
|
401
|
-
return;
|
|
408
|
+
return false;
|
|
402
409
|
}
|
|
403
410
|
if (ilkbShareTarget) {
|
|
404
411
|
appsecRoles.clearAppsecRoleLists();
|
|
405
412
|
setShareDialogOpen(true);
|
|
406
|
-
return;
|
|
413
|
+
return true;
|
|
407
414
|
}
|
|
408
415
|
if (shareRbacConfig) {
|
|
409
416
|
setShareDialogOpen(true);
|
|
410
|
-
return;
|
|
417
|
+
return true;
|
|
411
418
|
}
|
|
412
419
|
setShareConfigLoading(true);
|
|
413
420
|
try {
|
|
@@ -426,19 +433,89 @@ function GuidelineLibraryCard({
|
|
|
426
433
|
setShareErrorMessage(
|
|
427
434
|
"This template's access configuration is incomplete, so sharing is unavailable."
|
|
428
435
|
);
|
|
429
|
-
return;
|
|
436
|
+
return false;
|
|
430
437
|
}
|
|
431
438
|
setShareRbacConfig(rbacConfig);
|
|
432
439
|
setShareDialogOpen(true);
|
|
440
|
+
return true;
|
|
433
441
|
} catch (error) {
|
|
434
442
|
console.error("Failed to fetch share RBAC config:", error);
|
|
435
443
|
setShareErrorMessage(
|
|
436
444
|
((_d2 = (_c2 = error == null ? void 0 : error.response) == null ? void 0 : _c2.data) == null ? void 0 : _d2.message) || (error == null ? void 0 : error.message) || "Couldn't load share access for this template. Please try again."
|
|
437
445
|
);
|
|
446
|
+
return false;
|
|
438
447
|
} finally {
|
|
439
448
|
setShareConfigLoading(false);
|
|
440
449
|
}
|
|
441
450
|
};
|
|
451
|
+
const handleShareClick = async (event) => {
|
|
452
|
+
event.stopPropagation();
|
|
453
|
+
await openShare();
|
|
454
|
+
};
|
|
455
|
+
const onAutoOpenShareHandledRef = React.useRef(onAutoOpenShareHandled);
|
|
456
|
+
onAutoOpenShareHandledRef.current = onAutoOpenShareHandled;
|
|
457
|
+
const autoOpenShareDoneRef = React.useRef(false);
|
|
458
|
+
const articleRef = React.useRef(null);
|
|
459
|
+
const shareModalHostRef = React.useRef(null);
|
|
460
|
+
const [shareEmailToPrefill, setShareEmailToPrefill] = React.useState(null);
|
|
461
|
+
React.useEffect(() => {
|
|
462
|
+
var _a2;
|
|
463
|
+
if (!autoOpenShare) {
|
|
464
|
+
autoOpenShareDoneRef.current = false;
|
|
465
|
+
return;
|
|
466
|
+
}
|
|
467
|
+
if (autoOpenShareDoneRef.current) return;
|
|
468
|
+
const finish = (outcome) => {
|
|
469
|
+
var _a3;
|
|
470
|
+
autoOpenShareDoneRef.current = true;
|
|
471
|
+
(_a3 = onAutoOpenShareHandledRef.current) == null ? void 0 : _a3.call(onAutoOpenShareHandledRef, outcome);
|
|
472
|
+
};
|
|
473
|
+
if (appAccess.isPending) return;
|
|
474
|
+
if (isAccessDenied) {
|
|
475
|
+
finish(appAccess.isError ? "failed" : "not-allowed");
|
|
476
|
+
return;
|
|
477
|
+
}
|
|
478
|
+
if (!canShareGuideline) {
|
|
479
|
+
finish("not-allowed");
|
|
480
|
+
return;
|
|
481
|
+
}
|
|
482
|
+
if (isShareBusy) return;
|
|
483
|
+
if (sharePermissionState === "denied") {
|
|
484
|
+
finish("not-allowed");
|
|
485
|
+
return;
|
|
486
|
+
}
|
|
487
|
+
if (sharePermissionState === "error") {
|
|
488
|
+
finish("failed");
|
|
489
|
+
return;
|
|
490
|
+
}
|
|
491
|
+
autoOpenShareDoneRef.current = true;
|
|
492
|
+
(_a2 = articleRef.current) == null ? void 0 : _a2.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
493
|
+
const emailToAdd = autoOpenShareEmail == null ? void 0 : autoOpenShareEmail.trim();
|
|
494
|
+
void openShare().then((opened) => {
|
|
495
|
+
var _a3;
|
|
496
|
+
if (opened && emailToAdd) setShareEmailToPrefill(emailToAdd);
|
|
497
|
+
(_a3 = onAutoOpenShareHandledRef.current) == null ? void 0 : _a3.call(onAutoOpenShareHandledRef, opened ? "opened" : "failed");
|
|
498
|
+
});
|
|
499
|
+
}, [
|
|
500
|
+
autoOpenShare,
|
|
501
|
+
appAccess.isPending,
|
|
502
|
+
appAccess.isError,
|
|
503
|
+
isAccessDenied,
|
|
504
|
+
canShareGuideline,
|
|
505
|
+
isShareBusy,
|
|
506
|
+
sharePermissionState
|
|
507
|
+
]);
|
|
508
|
+
React.useEffect(() => {
|
|
509
|
+
if (!shareDialogOpen || !shareEmailToPrefill) return;
|
|
510
|
+
return shareModalPrefill.prefillShareModalEmail(
|
|
511
|
+
() => shareModalHostRef.current,
|
|
512
|
+
shareEmailToPrefill,
|
|
513
|
+
() => setShareEmailToPrefill(null)
|
|
514
|
+
);
|
|
515
|
+
}, [shareDialogOpen, shareEmailToPrefill]);
|
|
516
|
+
React.useEffect(() => {
|
|
517
|
+
if (!shareDialogOpen) setShareEmailToPrefill(null);
|
|
518
|
+
}, [shareDialogOpen]);
|
|
442
519
|
const handleCardClick = (event) => {
|
|
443
520
|
if (!handleCardClickCallback || isAccessDenied) return;
|
|
444
521
|
if (event.target.closest('button, a, input, select, [role="menuitem"]')) {
|
|
@@ -492,10 +569,9 @@ function GuidelineLibraryCard({
|
|
|
492
569
|
setDecisionLoading(null);
|
|
493
570
|
}
|
|
494
571
|
};
|
|
495
|
-
const
|
|
572
|
+
const sendAccessRequest = async () => {
|
|
496
573
|
var _a2, _b2;
|
|
497
|
-
|
|
498
|
-
if (!onRequestAccess || requestAccessState !== "idle") return;
|
|
574
|
+
if (!onRequestAccess || requestAccessState !== "idle") return false;
|
|
499
575
|
setRequestAccessState("sending");
|
|
500
576
|
try {
|
|
501
577
|
await Promise.resolve(onRequestAccess(guideline));
|
|
@@ -512,6 +588,7 @@ function GuidelineLibraryCard({
|
|
|
512
588
|
}
|
|
513
589
|
)
|
|
514
590
|
});
|
|
591
|
+
return true;
|
|
515
592
|
} catch (error) {
|
|
516
593
|
setRequestAccessState("idle");
|
|
517
594
|
(_b2 = shareToastRef.current) == null ? void 0 : _b2.show({
|
|
@@ -526,8 +603,21 @@ function GuidelineLibraryCard({
|
|
|
526
603
|
}
|
|
527
604
|
)
|
|
528
605
|
});
|
|
606
|
+
return false;
|
|
529
607
|
}
|
|
530
608
|
};
|
|
609
|
+
const handleRequestAccessClick = async (event) => {
|
|
610
|
+
event.stopPropagation();
|
|
611
|
+
await sendAccessRequest();
|
|
612
|
+
};
|
|
613
|
+
const handleRequestAccessDialogOpen = (event) => {
|
|
614
|
+
event.stopPropagation();
|
|
615
|
+
if (requestAccessState !== "idle") return;
|
|
616
|
+
setRequestAccessDialogOpen(true);
|
|
617
|
+
};
|
|
618
|
+
const handleRequestAccessDialogSend = async () => {
|
|
619
|
+
if (await sendAccessRequest()) setRequestAccessDialogOpen(false);
|
|
620
|
+
};
|
|
531
621
|
const handleRejectClick = async (event) => {
|
|
532
622
|
event.stopPropagation();
|
|
533
623
|
if (!onRejectGuideline) return;
|
|
@@ -701,6 +791,7 @@ function GuidelineLibraryCard({
|
|
|
701
791
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
702
792
|
"article",
|
|
703
793
|
{
|
|
794
|
+
ref: articleRef,
|
|
704
795
|
"data-guideline-id": guidelineId,
|
|
705
796
|
onClick: handleCardClickCallback ? handleCardClick : void 0,
|
|
706
797
|
className: utils.cx(
|
|
@@ -770,7 +861,7 @@ function GuidelineLibraryCard({
|
|
|
770
861
|
className: utils.cx(GuidelineLibraryCard_module["default"].libraryCardActions, classNames == null ? void 0 : classNames.libraryCardActions),
|
|
771
862
|
style: styles == null ? void 0 : styles.libraryCardActions,
|
|
772
863
|
children: [
|
|
773
|
-
isAccessDenied && /* @__PURE__ */ jsxRuntime.jsx(GuidelineTooltip.GuidelineTooltip, { content: REQUEST_ACCESS_TOOLTIPS[requestAccessState], children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
864
|
+
isAccessDenied && !showRequestAccessDialogButton && /* @__PURE__ */ jsxRuntime.jsx(GuidelineTooltip.GuidelineTooltip, { content: REQUEST_ACCESS_TOOLTIPS[requestAccessState], children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
774
865
|
"button",
|
|
775
866
|
{
|
|
776
867
|
type: "button",
|
|
@@ -1029,7 +1120,22 @@ function GuidelineLibraryCard({
|
|
|
1029
1120
|
}
|
|
1030
1121
|
)
|
|
1031
1122
|
] }),
|
|
1032
|
-
/* @__PURE__ */ jsxRuntime.
|
|
1123
|
+
showRequestAccessDialogButton && /* @__PURE__ */ jsxRuntime.jsx("div", { className: utils.cx(GuidelineLibraryCard_module["default"].primaryActionGroup, GuidelineLibraryCard_module["default"].requestAccessFooterGroup), children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1124
|
+
"button",
|
|
1125
|
+
{
|
|
1126
|
+
type: "button",
|
|
1127
|
+
onClick: handleRequestAccessDialogOpen,
|
|
1128
|
+
"aria-disabled": requestAccessState !== "idle",
|
|
1129
|
+
"aria-haspopup": "dialog",
|
|
1130
|
+
className: GuidelineLibraryCard_module["default"].requestAccessFooterButton,
|
|
1131
|
+
"aria-label": requestAccessState === "sent" ? `Access requested for ${title}` : `Request access to ${title}`,
|
|
1132
|
+
children: [
|
|
1133
|
+
requestAccessState === "sent" && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: GuidelineLibraryCard_module["default"].requestAccessIcon, strokeWidth: 2.4 }),
|
|
1134
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: requestAccessState === "sent" ? "Access requested" : (_I = requestAccessDialog == null ? void 0 : requestAccessDialog.buttonLabel) != null ? _I : "Request access" })
|
|
1135
|
+
]
|
|
1136
|
+
}
|
|
1137
|
+
) }),
|
|
1138
|
+
!showRequestAccessDialogButton && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: GuidelineLibraryCard_module["default"].primaryActionGroup, children: [
|
|
1033
1139
|
viewActionButton,
|
|
1034
1140
|
promoteActionButton,
|
|
1035
1141
|
shouldShowPrimaryAction && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1148,6 +1254,19 @@ function GuidelineLibraryCard({
|
|
|
1148
1254
|
styles
|
|
1149
1255
|
}
|
|
1150
1256
|
),
|
|
1257
|
+
showRequestAccessDialogButton && requestAccessDialog && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1258
|
+
RequestAccessDialog.RequestAccessDialog,
|
|
1259
|
+
{
|
|
1260
|
+
open: requestAccessDialogOpen,
|
|
1261
|
+
onClose: () => setRequestAccessDialogOpen(false),
|
|
1262
|
+
onSend: handleRequestAccessDialogSend,
|
|
1263
|
+
sending: requestAccessState === "sending",
|
|
1264
|
+
resourceName: title,
|
|
1265
|
+
config: requestAccessDialog,
|
|
1266
|
+
appsecRbacUrl,
|
|
1267
|
+
token: instantLearning == null ? void 0 : instantLearning.token
|
|
1268
|
+
}
|
|
1269
|
+
),
|
|
1151
1270
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1152
1271
|
toast.Toast,
|
|
1153
1272
|
{
|
|
@@ -1158,7 +1277,7 @@ function GuidelineLibraryCard({
|
|
|
1158
1277
|
}
|
|
1159
1278
|
),
|
|
1160
1279
|
shareDialogOpen && shareDialogTarget && (instantLearning == null ? void 0 : instantLearning.token) && reactDom.createPortal(
|
|
1161
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: utils.cx(AccessPanel_module["default"].accessPanel, GuidelineLibraryCard_module["default"].shareModalHost), children: /* @__PURE__ */ jsxRuntime.jsx(appsecUi.RbacQueryProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1280
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { ref: shareModalHostRef, className: utils.cx(AccessPanel_module["default"].accessPanel, GuidelineLibraryCard_module["default"].shareModalHost), children: /* @__PURE__ */ jsxRuntime.jsx(appsecUi.RbacQueryProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1162
1281
|
appsecUi.AppsecProvider,
|
|
1163
1282
|
{
|
|
1164
1283
|
appId: shareDialogTarget.appName,
|