@finos/legend-application-marketplace 0.1.56 → 0.1.57
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/lib/__lib__/LegendMarketplaceTelemetryHelper.d.ts +1 -1
- package/lib/__lib__/LegendMarketplaceTelemetryHelper.d.ts.map +1 -1
- package/lib/__lib__/LegendMarketplaceTelemetryHelper.js +2 -2
- package/lib/__lib__/LegendMarketplaceTelemetryHelper.js.map +1 -1
- package/lib/components/Header/LegendMarketplaceIconToolbar.d.ts.map +1 -1
- package/lib/components/Header/LegendMarketplaceIconToolbar.js +11 -2
- package/lib/components/Header/LegendMarketplaceIconToolbar.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +1 -1
- package/lib/pages/Lakehouse/MarketplaceLakehouseHome.d.ts.map +1 -1
- package/lib/pages/Lakehouse/MarketplaceLakehouseHome.js +2 -19
- package/lib/pages/Lakehouse/MarketplaceLakehouseHome.js.map +1 -1
- package/lib/pages/Lakehouse/entitlements/EntitlementsClosedContractsDashboard.d.ts.map +1 -1
- package/lib/pages/Lakehouse/entitlements/EntitlementsClosedContractsDashboard.js +23 -127
- package/lib/pages/Lakehouse/entitlements/EntitlementsClosedContractsDashboard.js.map +1 -1
- package/lib/pages/Lakehouse/entitlements/EntitlementsPendingContractsDashboard.d.ts.map +1 -1
- package/lib/pages/Lakehouse/entitlements/EntitlementsPendingContractsDashboard.js +34 -158
- package/lib/pages/Lakehouse/entitlements/EntitlementsPendingContractsDashboard.js.map +1 -1
- package/lib/pages/Lakehouse/entitlements/EntitlementsPendingTasksDashboard.d.ts.map +1 -1
- package/lib/pages/Lakehouse/entitlements/EntitlementsPendingTasksDashboard.js +58 -38
- package/lib/pages/Lakehouse/entitlements/EntitlementsPendingTasksDashboard.js.map +1 -1
- package/lib/stores/lakehouse/entitlements/EntitlementsDashboardState.d.ts +22 -11
- package/lib/stores/lakehouse/entitlements/EntitlementsDashboardState.d.ts.map +1 -1
- package/lib/stores/lakehouse/entitlements/EntitlementsDashboardState.js +145 -74
- package/lib/stores/lakehouse/entitlements/EntitlementsDashboardState.js.map +1 -1
- package/lib/stores/orders/OrderHelpers.d.ts +1 -1
- package/lib/stores/orders/OrderHelpers.d.ts.map +1 -1
- package/lib/stores/orders/OrderHelpers.js +7 -6
- package/lib/stores/orders/OrderHelpers.js.map +1 -1
- package/lib/utils/EntitlementsUtils.d.ts +20 -0
- package/lib/utils/EntitlementsUtils.d.ts.map +1 -0
- package/lib/utils/EntitlementsUtils.js +107 -0
- package/lib/utils/EntitlementsUtils.js.map +1 -0
- package/package.json +10 -10
- package/src/__lib__/LegendMarketplaceTelemetryHelper.ts +3 -3
- package/src/components/Header/LegendMarketplaceIconToolbar.tsx +29 -0
- package/src/pages/Lakehouse/MarketplaceLakehouseHome.tsx +0 -54
- package/src/pages/Lakehouse/entitlements/EntitlementsClosedContractsDashboard.tsx +68 -235
- package/src/pages/Lakehouse/entitlements/EntitlementsPendingContractsDashboard.tsx +88 -295
- package/src/pages/Lakehouse/entitlements/EntitlementsPendingTasksDashboard.tsx +84 -49
- package/src/stores/lakehouse/entitlements/EntitlementsDashboardState.ts +234 -109
- package/src/stores/orders/OrderHelpers.ts +8 -7
- package/src/utils/EntitlementsUtils.tsx +207 -0
- package/tsconfig.json +1 -0
|
@@ -76,6 +76,7 @@ import {
|
|
|
76
76
|
CONTRACT_ACTION,
|
|
77
77
|
LegendMarketplaceTelemetryHelper,
|
|
78
78
|
} from '../../../__lib__/LegendMarketplaceTelemetryHelper.js';
|
|
79
|
+
import { formatOrderDate } from '../../../stores/orders/OrderHelpers.js';
|
|
79
80
|
|
|
80
81
|
const EntitlementsDashboardActionModal = (props: {
|
|
81
82
|
open: boolean;
|
|
@@ -83,7 +84,7 @@ const EntitlementsDashboardActionModal = (props: {
|
|
|
83
84
|
dashboardState: EntitlementsDashboardState;
|
|
84
85
|
onClose: () => void;
|
|
85
86
|
action: 'approve' | 'deny' | undefined;
|
|
86
|
-
|
|
87
|
+
pendingTaskContracts: V1_LiteDataContract[];
|
|
87
88
|
marketplaceBaseStore: LegendMarketplaceBaseStore;
|
|
88
89
|
}) => {
|
|
89
90
|
const {
|
|
@@ -92,7 +93,7 @@ const EntitlementsDashboardActionModal = (props: {
|
|
|
92
93
|
dashboardState,
|
|
93
94
|
onClose,
|
|
94
95
|
action,
|
|
95
|
-
|
|
96
|
+
pendingTaskContracts,
|
|
96
97
|
marketplaceBaseStore,
|
|
97
98
|
} = props;
|
|
98
99
|
|
|
@@ -136,7 +137,7 @@ const EntitlementsDashboardActionModal = (props: {
|
|
|
136
137
|
dashboardState.lakehouseEntitlementsStore.applicationStore
|
|
137
138
|
.telemetryService,
|
|
138
139
|
selectedTasks,
|
|
139
|
-
|
|
140
|
+
pendingTaskContracts,
|
|
140
141
|
action === 'approve'
|
|
141
142
|
? CONTRACT_ACTION.APPROVED
|
|
142
143
|
: CONTRACT_ACTION.DENIED,
|
|
@@ -151,7 +152,7 @@ const EntitlementsDashboardActionModal = (props: {
|
|
|
151
152
|
dashboardState.lakehouseEntitlementsStore.applicationStore
|
|
152
153
|
.telemetryService,
|
|
153
154
|
selectedTasks,
|
|
154
|
-
|
|
155
|
+
pendingTaskContracts,
|
|
155
156
|
action === 'approve'
|
|
156
157
|
? CONTRACT_ACTION.APPROVED
|
|
157
158
|
: CONTRACT_ACTION.DENIED,
|
|
@@ -194,8 +195,8 @@ const EntitlementsDashboardActionModal = (props: {
|
|
|
194
195
|
)}
|
|
195
196
|
{errorMessages.map(([task, errorMessage]) => {
|
|
196
197
|
const contractId = task.dataContractId;
|
|
197
|
-
const contract =
|
|
198
|
-
(
|
|
198
|
+
const contract = pendingTaskContracts.find(
|
|
199
|
+
(c) => c.guid === contractId,
|
|
199
200
|
);
|
|
200
201
|
return (
|
|
201
202
|
<Box
|
|
@@ -257,33 +258,33 @@ export const EntitlementsPendingTasksDashboard = observer(
|
|
|
257
258
|
(props: { dashboardState: EntitlementsDashboardState }): React.ReactNode => {
|
|
258
259
|
// State and props
|
|
259
260
|
const { dashboardState } = props;
|
|
260
|
-
const
|
|
261
|
-
const
|
|
261
|
+
const pendingTasks = dashboardState.pendingTasks;
|
|
262
|
+
const pendingTaskContracts = dashboardState.pendingTaskContracts;
|
|
262
263
|
const privilegeManagerTasks = useMemo(
|
|
263
264
|
() =>
|
|
264
|
-
|
|
265
|
+
pendingTasks?.filter(
|
|
265
266
|
(task) =>
|
|
266
267
|
task.type === V1_ApprovalType.CONSUMER_PRIVILEGE_MANAGER_APPROVAL,
|
|
267
268
|
) ?? [],
|
|
268
|
-
[
|
|
269
|
+
[pendingTasks],
|
|
269
270
|
);
|
|
270
271
|
const dataOwnerTasks = useMemo(
|
|
271
272
|
() =>
|
|
272
|
-
|
|
273
|
+
pendingTasks?.filter(
|
|
273
274
|
(task) => task.type === V1_ApprovalType.DATA_OWNER_APPROVAL,
|
|
274
275
|
) ?? [],
|
|
275
|
-
[
|
|
276
|
+
[pendingTasks],
|
|
276
277
|
);
|
|
277
278
|
const otherTasks = useMemo(
|
|
278
279
|
() =>
|
|
279
|
-
|
|
280
|
+
pendingTasks?.filter(
|
|
280
281
|
(task) =>
|
|
281
282
|
!privilegeManagerTasks.includes(task) &&
|
|
282
283
|
!dataOwnerTasks.includes(task),
|
|
283
284
|
) ?? [],
|
|
284
|
-
[dataOwnerTasks, privilegeManagerTasks,
|
|
285
|
+
[dataOwnerTasks, privilegeManagerTasks, pendingTasks],
|
|
285
286
|
);
|
|
286
|
-
const loading = dashboardState.
|
|
287
|
+
const loading = dashboardState.fetchingPendingTasksState.isInProgress;
|
|
287
288
|
|
|
288
289
|
const marketplaceBaseStore = useLegendMarketplaceBaseStore();
|
|
289
290
|
const [searchParams, setSearchParams] = useSearchParams();
|
|
@@ -304,17 +305,17 @@ export const EntitlementsPendingTasksDashboard = observer(
|
|
|
304
305
|
// Effects
|
|
305
306
|
|
|
306
307
|
useEffect(() => {
|
|
307
|
-
if (dashboardState.
|
|
308
|
+
if (dashboardState.fetchingPendingTasksState.hasCompleted) {
|
|
308
309
|
setSelectedTaskIdsSet((prev) => {
|
|
309
310
|
const selectedArray = Array.from(prev.values());
|
|
310
311
|
return new Set<string>(
|
|
311
312
|
selectedArray.filter((taskId) =>
|
|
312
|
-
|
|
313
|
+
pendingTasks?.map((task) => task.taskId).includes(taskId),
|
|
313
314
|
),
|
|
314
315
|
);
|
|
315
316
|
});
|
|
316
317
|
}
|
|
317
|
-
}, [dashboardState.
|
|
318
|
+
}, [dashboardState.fetchingPendingTasksState.hasCompleted, pendingTasks]);
|
|
318
319
|
|
|
319
320
|
useEffect(() => {
|
|
320
321
|
setSearchParams((params) => {
|
|
@@ -350,13 +351,9 @@ export const EntitlementsPendingTasksDashboard = observer(
|
|
|
350
351
|
const handleCellClicked = (
|
|
351
352
|
event: DataGridCellClickedEvent<V1_ContractUserEventRecord, unknown>,
|
|
352
353
|
) => {
|
|
353
|
-
if (
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
event.colDef.colId !== 'requester'
|
|
357
|
-
) {
|
|
358
|
-
const contract = allContracts?.find(
|
|
359
|
-
(_contract) => _contract.guid === event.data?.dataContractId,
|
|
354
|
+
if (event.colDef.colId !== 'selection') {
|
|
355
|
+
const contract = pendingTaskContracts.find(
|
|
356
|
+
(c) => c.guid === event.data?.dataContractId,
|
|
360
357
|
);
|
|
361
358
|
setSelectedContract(contract);
|
|
362
359
|
setSelectedContractTargetUser(event.data?.consumer);
|
|
@@ -451,18 +448,29 @@ export const EntitlementsPendingTasksDashboard = observer(
|
|
|
451
448
|
useMemo(
|
|
452
449
|
() => [
|
|
453
450
|
{
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
resizable: true,
|
|
457
|
-
headerName: 'Action Date',
|
|
458
|
-
flex: 1,
|
|
451
|
+
headerName: 'Date Created',
|
|
452
|
+
colId: 'dateCreated',
|
|
459
453
|
valueGetter: (params) => {
|
|
460
|
-
const
|
|
461
|
-
const
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
454
|
+
const contractId = params.data?.dataContractId;
|
|
455
|
+
const createdAt = pendingTaskContracts.find(
|
|
456
|
+
(c) => c.guid === contractId,
|
|
457
|
+
)?.createdAt;
|
|
458
|
+
return formatOrderDate(createdAt) ?? 'Unknown';
|
|
459
|
+
},
|
|
460
|
+
sortable: true,
|
|
461
|
+
sort: 'desc',
|
|
462
|
+
comparator: (_, __, val1, val2) => {
|
|
463
|
+
const contractId1 = val1.data?.dataContractId;
|
|
464
|
+
const contractId2 = val2.data?.dataContractId;
|
|
465
|
+
const createdAt1 = pendingTaskContracts.find(
|
|
466
|
+
(c) => c.guid === contractId1,
|
|
467
|
+
)?.createdAt;
|
|
468
|
+
const createdAt2 = pendingTaskContracts.find(
|
|
469
|
+
(c) => c.guid === contractId2,
|
|
470
|
+
)?.createdAt;
|
|
471
|
+
const dateA = createdAt1 ? new Date(createdAt1).getTime() : 0;
|
|
472
|
+
const dateB = createdAt2 ? new Date(createdAt2).getTime() : 0;
|
|
473
|
+
return dateA - dateB;
|
|
466
474
|
},
|
|
467
475
|
},
|
|
468
476
|
{
|
|
@@ -472,12 +480,25 @@ export const EntitlementsPendingTasksDashboard = observer(
|
|
|
472
480
|
colId: 'consumerType',
|
|
473
481
|
headerName: 'Consumer Type',
|
|
474
482
|
flex: 1,
|
|
483
|
+
valueGetter: (params) => {
|
|
484
|
+
const contractId = params.data?.dataContractId;
|
|
485
|
+
const consumer = pendingTaskContracts.find(
|
|
486
|
+
(c) => c.guid === contractId,
|
|
487
|
+
)?.consumer;
|
|
488
|
+
const typeName = consumer
|
|
489
|
+
? getOrganizationalScopeTypeName(
|
|
490
|
+
consumer,
|
|
491
|
+
dashboardState.lakehouseEntitlementsStore.applicationStore.pluginManager.getApplicationPlugins(),
|
|
492
|
+
)
|
|
493
|
+
: undefined;
|
|
494
|
+
return typeName ?? 'Unknown';
|
|
495
|
+
},
|
|
475
496
|
cellRenderer: (
|
|
476
497
|
params: DataGridCellRendererParams<V1_ContractUserEventRecord>,
|
|
477
498
|
) => {
|
|
478
499
|
const contractId = params.data?.dataContractId;
|
|
479
|
-
const consumer =
|
|
480
|
-
(
|
|
500
|
+
const consumer = pendingTaskContracts.find(
|
|
501
|
+
(c) => c.guid === contractId,
|
|
481
502
|
)?.consumer;
|
|
482
503
|
const typeName = consumer
|
|
483
504
|
? getOrganizationalScopeTypeName(
|
|
@@ -513,6 +534,9 @@ export const EntitlementsPendingTasksDashboard = observer(
|
|
|
513
534
|
colId: 'targetUser',
|
|
514
535
|
headerName: 'Target User',
|
|
515
536
|
flex: 1,
|
|
537
|
+
valueGetter: (params) => {
|
|
538
|
+
return params.data?.consumer ?? 'Unknown';
|
|
539
|
+
},
|
|
516
540
|
cellRenderer: (
|
|
517
541
|
params: DataGridCellRendererParams<V1_ContractUserEventRecord>,
|
|
518
542
|
) => {
|
|
@@ -521,6 +545,7 @@ export const EntitlementsPendingTasksDashboard = observer(
|
|
|
521
545
|
userId={params.data?.consumer}
|
|
522
546
|
applicationStore={marketplaceBaseStore.applicationStore}
|
|
523
547
|
userSearchService={marketplaceBaseStore.userSearchService}
|
|
548
|
+
disableOnClick={true}
|
|
524
549
|
className="marketplace-lakehouse-entitlements__grid__user-display"
|
|
525
550
|
/>
|
|
526
551
|
);
|
|
@@ -533,18 +558,26 @@ export const EntitlementsPendingTasksDashboard = observer(
|
|
|
533
558
|
colId: 'requester',
|
|
534
559
|
headerName: 'Requester',
|
|
535
560
|
flex: 1,
|
|
561
|
+
valueGetter: (params) => {
|
|
562
|
+
const contractId = params.data?.dataContractId;
|
|
563
|
+
const requester = pendingTaskContracts.find(
|
|
564
|
+
(c) => c.guid === contractId,
|
|
565
|
+
)?.createdBy;
|
|
566
|
+
return requester ?? 'Unknown';
|
|
567
|
+
},
|
|
536
568
|
cellRenderer: (
|
|
537
569
|
params: DataGridCellRendererParams<V1_ContractUserEventRecord>,
|
|
538
570
|
) => {
|
|
539
571
|
const contractId = params.data?.dataContractId;
|
|
540
|
-
const requester =
|
|
541
|
-
(
|
|
572
|
+
const requester = pendingTaskContracts.find(
|
|
573
|
+
(c) => c.guid === contractId,
|
|
542
574
|
)?.createdBy;
|
|
543
575
|
return requester ? (
|
|
544
576
|
<UserRenderer
|
|
545
577
|
userId={requester}
|
|
546
578
|
applicationStore={marketplaceBaseStore.applicationStore}
|
|
547
579
|
userSearchService={marketplaceBaseStore.userSearchService}
|
|
580
|
+
disableOnClick={true}
|
|
548
581
|
className="marketplace-lakehouse-entitlements__grid__user-display"
|
|
549
582
|
/>
|
|
550
583
|
) : (
|
|
@@ -560,8 +593,8 @@ export const EntitlementsPendingTasksDashboard = observer(
|
|
|
560
593
|
flex: 1,
|
|
561
594
|
valueGetter: (params) => {
|
|
562
595
|
const contractId = params.data?.dataContractId;
|
|
563
|
-
const contract =
|
|
564
|
-
(
|
|
596
|
+
const contract = pendingTaskContracts.find(
|
|
597
|
+
(c) => c.guid === contractId,
|
|
565
598
|
);
|
|
566
599
|
return contract?.resourceId ?? 'Unknown';
|
|
567
600
|
},
|
|
@@ -574,8 +607,8 @@ export const EntitlementsPendingTasksDashboard = observer(
|
|
|
574
607
|
flex: 1,
|
|
575
608
|
valueGetter: (params) => {
|
|
576
609
|
const contractId = params.data?.dataContractId;
|
|
577
|
-
const contract =
|
|
578
|
-
(
|
|
610
|
+
const contract = pendingTaskContracts.find(
|
|
611
|
+
(c) => c.guid === contractId,
|
|
579
612
|
);
|
|
580
613
|
const accessPointGroup =
|
|
581
614
|
contract?.resourceType === V1_ResourceType.ACCESS_POINT_GROUP
|
|
@@ -592,8 +625,8 @@ export const EntitlementsPendingTasksDashboard = observer(
|
|
|
592
625
|
flex: 2,
|
|
593
626
|
valueGetter: (params) => {
|
|
594
627
|
const contractId = params.data?.dataContractId;
|
|
595
|
-
const businessJustification =
|
|
596
|
-
(
|
|
628
|
+
const businessJustification = pendingTaskContracts.find(
|
|
629
|
+
(c) => c.guid === contractId,
|
|
597
630
|
)?.description;
|
|
598
631
|
return businessJustification ?? 'Unknown';
|
|
599
632
|
},
|
|
@@ -609,11 +642,11 @@ export const EntitlementsPendingTasksDashboard = observer(
|
|
|
609
642
|
},
|
|
610
643
|
],
|
|
611
644
|
[
|
|
612
|
-
allContracts,
|
|
613
645
|
dashboardState.lakehouseEntitlementsStore.applicationStore
|
|
614
646
|
.pluginManager,
|
|
615
647
|
marketplaceBaseStore.applicationStore,
|
|
616
648
|
marketplaceBaseStore.userSearchService,
|
|
649
|
+
pendingTaskContracts,
|
|
617
650
|
],
|
|
618
651
|
);
|
|
619
652
|
|
|
@@ -822,12 +855,14 @@ export const EntitlementsPendingTasksDashboard = observer(
|
|
|
822
855
|
<EntitlementsDashboardActionModal
|
|
823
856
|
open={selectedAction !== undefined}
|
|
824
857
|
selectedTasks={
|
|
825
|
-
|
|
858
|
+
pendingTasks?.filter((task) =>
|
|
859
|
+
selectedTaskIdsSet.has(task.taskId),
|
|
860
|
+
) ?? []
|
|
826
861
|
}
|
|
827
862
|
dashboardState={dashboardState}
|
|
828
863
|
onClose={() => setSelectedAction(undefined)}
|
|
829
864
|
action={selectedAction}
|
|
830
|
-
|
|
865
|
+
pendingTaskContracts={pendingTaskContracts}
|
|
831
866
|
marketplaceBaseStore={marketplaceBaseStore}
|
|
832
867
|
/>
|
|
833
868
|
{selectedContract !== undefined && (
|