@finos/legend-application-marketplace 0.2.26 → 0.2.28
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__/LegendMarketplaceNavigation.d.ts +4 -0
- package/lib/__lib__/LegendMarketplaceNavigation.d.ts.map +1 -1
- package/lib/__lib__/LegendMarketplaceNavigation.js +4 -0
- package/lib/__lib__/LegendMarketplaceNavigation.js.map +1 -1
- package/lib/__lib__/LegendMarketplaceTelemetryHelper.d.ts +2 -2
- 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/application/LegendMarketplaceApplicationConfig.d.ts +2 -0
- package/lib/application/LegendMarketplaceApplicationConfig.d.ts.map +1 -1
- package/lib/application/LegendMarketplaceApplicationConfig.js +4 -0
- package/lib/application/LegendMarketplaceApplicationConfig.js.map +1 -1
- package/lib/components/__test-utils__/LegendMarketplaceStoreTestUtils.d.ts.map +1 -1
- package/lib/components/__test-utils__/LegendMarketplaceStoreTestUtils.js +11 -6
- package/lib/components/__test-utils__/LegendMarketplaceStoreTestUtils.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/entitlements/EntitlementsClosedContractsDashboard.d.ts.map +1 -1
- package/lib/pages/Lakehouse/entitlements/EntitlementsClosedContractsDashboard.js +10 -7
- 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 +3 -2
- package/lib/pages/Lakehouse/entitlements/EntitlementsPendingContractsDashboard.js.map +1 -1
- package/lib/pages/Lakehouse/entitlements/EntitlementsPendingTasksDashboard.d.ts +1 -1
- package/lib/pages/Lakehouse/entitlements/EntitlementsPendingTasksDashboard.d.ts.map +1 -1
- package/lib/pages/Lakehouse/entitlements/EntitlementsPendingTasksDashboard.js +67 -38
- package/lib/pages/Lakehouse/entitlements/EntitlementsPendingTasksDashboard.js.map +1 -1
- package/lib/stores/LegendMarketplaceBaseStore.d.ts.map +1 -1
- package/lib/stores/LegendMarketplaceBaseStore.js +1 -0
- package/lib/stores/LegendMarketplaceBaseStore.js.map +1 -1
- package/lib/stores/ai/LegendMarketplaceAIChatStore.d.ts +1 -2
- package/lib/stores/ai/LegendMarketplaceAIChatStore.d.ts.map +1 -1
- package/lib/stores/ai/LegendMarketplaceAIChatStore.js +12 -8
- package/lib/stores/ai/LegendMarketplaceAIChatStore.js.map +1 -1
- package/lib/stores/lakehouse/LegendMarketplaceProductViewerStore.d.ts.map +1 -1
- package/lib/stores/lakehouse/LegendMarketplaceProductViewerStore.js +11 -1
- package/lib/stores/lakehouse/LegendMarketplaceProductViewerStore.js.map +1 -1
- package/lib/stores/lakehouse/entitlements/EntitlementsDashboardState.d.ts +39 -15
- package/lib/stores/lakehouse/entitlements/EntitlementsDashboardState.d.ts.map +1 -1
- package/lib/stores/lakehouse/entitlements/EntitlementsDashboardState.js +324 -39
- package/lib/stores/lakehouse/entitlements/EntitlementsDashboardState.js.map +1 -1
- package/lib/utils/EntitlementsUtils.d.ts +2 -2
- package/lib/utils/EntitlementsUtils.d.ts.map +1 -1
- package/lib/utils/EntitlementsUtils.js +11 -2
- package/lib/utils/EntitlementsUtils.js.map +1 -1
- package/lib/utils/LakehouseUtils.d.ts +2 -1
- package/lib/utils/LakehouseUtils.d.ts.map +1 -1
- package/lib/utils/LakehouseUtils.js +31 -2
- package/lib/utils/LakehouseUtils.js.map +1 -1
- package/package.json +12 -12
- package/src/__lib__/LegendMarketplaceNavigation.ts +17 -0
- package/src/__lib__/LegendMarketplaceTelemetryHelper.ts +6 -6
- package/src/application/LegendMarketplaceApplicationConfig.ts +7 -0
- package/src/components/__test-utils__/LegendMarketplaceStoreTestUtils.tsx +20 -8
- package/src/pages/Lakehouse/entitlements/EntitlementsClosedContractsDashboard.tsx +13 -5
- package/src/pages/Lakehouse/entitlements/EntitlementsPendingContractsDashboard.tsx +5 -1
- package/src/pages/Lakehouse/entitlements/EntitlementsPendingTasksDashboard.tsx +306 -299
- package/src/stores/LegendMarketplaceBaseStore.ts +1 -0
- package/src/stores/ai/LegendMarketplaceAIChatStore.ts +14 -9
- package/src/stores/lakehouse/LegendMarketplaceProductViewerStore.ts +38 -0
- package/src/stores/lakehouse/entitlements/EntitlementsDashboardState.ts +538 -91
- package/src/utils/EntitlementsUtils.tsx +13 -2
- package/src/utils/LakehouseUtils.tsx +80 -1
|
@@ -15,9 +15,8 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import {
|
|
18
|
-
type
|
|
19
|
-
type
|
|
20
|
-
GraphManagerState,
|
|
18
|
+
type V1_PendingTaskRecord,
|
|
19
|
+
type V1_LiteAccessRequest,
|
|
21
20
|
V1_ApprovalType,
|
|
22
21
|
V1_ResourceType,
|
|
23
22
|
} from '@finos/legend-graph';
|
|
@@ -42,7 +41,6 @@ import {
|
|
|
42
41
|
Tooltip,
|
|
43
42
|
} from '@mui/material';
|
|
44
43
|
import { useCallback, useMemo, useState, type ChangeEvent } from 'react';
|
|
45
|
-
import type { EntitlementsDashboardState } from '../../../stores/lakehouse/entitlements/EntitlementsDashboardState.js';
|
|
46
44
|
import { useLegendMarketplaceBaseStore } from '../../../application/providers/LegendMarketplaceFrameworkProvider.js';
|
|
47
45
|
import {
|
|
48
46
|
CubesLoadingIndicator,
|
|
@@ -59,26 +57,35 @@ import {
|
|
|
59
57
|
UserRenderer,
|
|
60
58
|
getOrganizationalScopeTypeName,
|
|
61
59
|
getOrganizationalScopeTypeDetails,
|
|
60
|
+
stringifyOrganizationalScope,
|
|
62
61
|
DataAccessRequestViewer,
|
|
63
|
-
DataContractViewerState,
|
|
64
62
|
} from '@finos/legend-extension-dsl-data-product';
|
|
65
|
-
import {
|
|
66
|
-
generateContractPagePath,
|
|
67
|
-
generateLakehouseDataProductPath,
|
|
68
|
-
} from '../../../__lib__/LegendMarketplaceNavigation.js';
|
|
69
63
|
import {
|
|
70
64
|
CONTRACT_ACTION,
|
|
71
65
|
LegendMarketplaceTelemetryHelper,
|
|
72
66
|
} from '../../../__lib__/LegendMarketplaceTelemetryHelper.js';
|
|
73
67
|
import { formatOrderDate } from '../../../stores/orders/OrderHelpers.js';
|
|
68
|
+
import {
|
|
69
|
+
ContractCreatedByUserDetails,
|
|
70
|
+
type EntitlementsDashboardState,
|
|
71
|
+
} from '../../../stores/lakehouse/entitlements/EntitlementsDashboardState.js';
|
|
72
|
+
import {
|
|
73
|
+
type EntitlementsRow,
|
|
74
|
+
ROW_KIND_CONTRACT,
|
|
75
|
+
ROW_KIND_REQUEST,
|
|
76
|
+
getSelectedRowId,
|
|
77
|
+
getSelectedContractGuid,
|
|
78
|
+
useSelectedViewerState,
|
|
79
|
+
useGetDataProductUrl,
|
|
80
|
+
} from '../../../utils/EntitlementsUtils.js';
|
|
74
81
|
|
|
75
82
|
const EntitlementsDashboardActionModal = (props: {
|
|
76
83
|
open: boolean;
|
|
77
|
-
selectedTasks:
|
|
84
|
+
selectedTasks: V1_PendingTaskRecord[];
|
|
78
85
|
dashboardState: EntitlementsDashboardState;
|
|
79
86
|
onClose: () => void;
|
|
80
87
|
action: 'approve' | 'deny' | undefined;
|
|
81
|
-
pendingTaskContracts:
|
|
88
|
+
pendingTaskContracts: V1_LiteAccessRequest[];
|
|
82
89
|
marketplaceBaseStore: LegendMarketplaceBaseStore;
|
|
83
90
|
}) => {
|
|
84
91
|
const {
|
|
@@ -94,7 +101,7 @@ const EntitlementsDashboardActionModal = (props: {
|
|
|
94
101
|
const auth = useAuth();
|
|
95
102
|
const [isLoading, setIsLoading] = useState(false);
|
|
96
103
|
const [errorMessages, setErrorMessages] = useState<
|
|
97
|
-
[
|
|
104
|
+
[V1_PendingTaskRecord, string][]
|
|
98
105
|
>([]);
|
|
99
106
|
const [successCount, setSuccessCount] = useState(0);
|
|
100
107
|
|
|
@@ -188,7 +195,7 @@ const EntitlementsDashboardActionModal = (props: {
|
|
|
188
195
|
</Box>
|
|
189
196
|
)}
|
|
190
197
|
{errorMessages.map(([task, errorMessage]) => {
|
|
191
|
-
const contractId = task.
|
|
198
|
+
const contractId = task.accessRequestId;
|
|
192
199
|
const contract = pendingTaskContracts.find(
|
|
193
200
|
(c) => c.guid === contractId,
|
|
194
201
|
);
|
|
@@ -285,8 +292,8 @@ export const EntitlementsPendingTasksDashboard = observer(
|
|
|
285
292
|
'approve' | 'deny' | undefined
|
|
286
293
|
>();
|
|
287
294
|
const selectedTaskIdsSet = dashboardState.selectedTaskIds;
|
|
288
|
-
const [
|
|
289
|
-
|
|
295
|
+
const [selectedRow, setSelectedRow] = useState<
|
|
296
|
+
EntitlementsRow | undefined
|
|
290
297
|
>();
|
|
291
298
|
const [selectedContractTargetUser, setSelectedContractTargetUser] =
|
|
292
299
|
useState<string | undefined>();
|
|
@@ -295,16 +302,21 @@ export const EntitlementsPendingTasksDashboard = observer(
|
|
|
295
302
|
>(undefined);
|
|
296
303
|
|
|
297
304
|
const auth = useAuth();
|
|
305
|
+
const getDataProductUrl = useGetDataProductUrl();
|
|
306
|
+
|
|
307
|
+
const selectedRowId = getSelectedRowId(selectedRow);
|
|
308
|
+
const selectedViewerState = useSelectedViewerState(
|
|
309
|
+
selectedRow,
|
|
310
|
+
selectedRowId,
|
|
311
|
+
);
|
|
312
|
+
const selectedContractGuid = getSelectedContractGuid(selectedRow);
|
|
298
313
|
|
|
299
314
|
// Callbacks
|
|
300
315
|
|
|
301
316
|
const handleFirstDataRendered = (
|
|
302
|
-
event: DataGridFirstDataRenderedEvent<
|
|
303
|
-
V1_ContractUserEventRecord,
|
|
304
|
-
unknown
|
|
305
|
-
>,
|
|
317
|
+
event: DataGridFirstDataRenderedEvent<V1_PendingTaskRecord, unknown>,
|
|
306
318
|
) => {
|
|
307
|
-
const nodesToSelect: DataGridIRowNode<
|
|
319
|
+
const nodesToSelect: DataGridIRowNode<V1_PendingTaskRecord>[] = [];
|
|
308
320
|
event.api.forEachNode((node) => {
|
|
309
321
|
if (node.data && selectedTaskIdsSet.has(node.data.taskId)) {
|
|
310
322
|
nodesToSelect.push(node);
|
|
@@ -313,22 +325,39 @@ export const EntitlementsPendingTasksDashboard = observer(
|
|
|
313
325
|
event.api.setNodesSelected({ nodes: nodesToSelect, newValue: true });
|
|
314
326
|
};
|
|
315
327
|
|
|
316
|
-
const handleCellClicked =
|
|
317
|
-
event: DataGridCellClickedEvent<
|
|
328
|
+
const handleCellClicked = (
|
|
329
|
+
event: DataGridCellClickedEvent<V1_PendingTaskRecord, unknown>,
|
|
318
330
|
) => {
|
|
319
331
|
if (event.colDef.colId !== 'selection') {
|
|
320
|
-
const contract = pendingTaskContracts.find(
|
|
321
|
-
(c) => c.guid === event.data?.dataContractId,
|
|
322
|
-
);
|
|
323
|
-
setSelectedContract(contract);
|
|
324
332
|
setSelectedContractTargetUser(event.data?.consumer);
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
333
|
+
|
|
334
|
+
const dataRequestId = event.data?.accessRequestId;
|
|
335
|
+
const isDataRequest =
|
|
336
|
+
dataRequestId !== undefined &&
|
|
337
|
+
dashboardState.pendingDataRequestIds.has(dataRequestId);
|
|
338
|
+
|
|
339
|
+
if (isDataRequest && dataRequestId) {
|
|
340
|
+
const detail =
|
|
341
|
+
dashboardState.pendingDataRequestDetailsMap.get(dataRequestId);
|
|
342
|
+
if (detail) {
|
|
343
|
+
setContractErrors(undefined);
|
|
344
|
+
setSelectedRow({ kind: ROW_KIND_REQUEST, data: detail });
|
|
345
|
+
}
|
|
346
|
+
} else {
|
|
347
|
+
const contract = pendingTaskContracts.find(
|
|
348
|
+
(c) => c.guid === event.data?.accessRequestId,
|
|
330
349
|
);
|
|
331
|
-
|
|
350
|
+
if (contract) {
|
|
351
|
+
setContractErrors(undefined);
|
|
352
|
+
setSelectedRow({
|
|
353
|
+
kind: ROW_KIND_CONTRACT,
|
|
354
|
+
data: new ContractCreatedByUserDetails(contract),
|
|
355
|
+
});
|
|
356
|
+
dashboardState
|
|
357
|
+
.getContractErrors(contract.guid, auth.user?.access_token)
|
|
358
|
+
.then((result) => setContractErrors(result))
|
|
359
|
+
.catch(() => setContractErrors(undefined));
|
|
360
|
+
}
|
|
332
361
|
}
|
|
333
362
|
}
|
|
334
363
|
};
|
|
@@ -345,7 +374,7 @@ export const EntitlementsPendingTasksDashboard = observer(
|
|
|
345
374
|
);
|
|
346
375
|
|
|
347
376
|
const CustomSelectionRenderer = useCallback(
|
|
348
|
-
(params: DataGridCellRendererParams<
|
|
377
|
+
(params: DataGridCellRendererParams<V1_PendingTaskRecord>) => {
|
|
349
378
|
const handleChange = (_: ChangeEvent<HTMLInputElement>) => {
|
|
350
379
|
if (params.data) {
|
|
351
380
|
const newSet = new Set<string>(selectedTaskIdsSet);
|
|
@@ -372,8 +401,8 @@ export const EntitlementsPendingTasksDashboard = observer(
|
|
|
372
401
|
|
|
373
402
|
const CustomSelectionHeaderRenderer = useCallback(
|
|
374
403
|
(_props: {
|
|
375
|
-
params: DataGridCustomHeaderProps<
|
|
376
|
-
taskSet:
|
|
404
|
+
params: DataGridCustomHeaderProps<V1_PendingTaskRecord>;
|
|
405
|
+
taskSet: V1_PendingTaskRecord[];
|
|
377
406
|
}) => {
|
|
378
407
|
const { taskSet } = _props;
|
|
379
408
|
const checked =
|
|
@@ -410,213 +439,231 @@ export const EntitlementsPendingTasksDashboard = observer(
|
|
|
410
439
|
[selectedTaskIdsSet, dashboardState],
|
|
411
440
|
);
|
|
412
441
|
|
|
413
|
-
const colDefs: DataGridColumnDefinition<
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
return formatOrderDate(createdAt) ?? 'Unknown';
|
|
425
|
-
},
|
|
426
|
-
sortable: true,
|
|
427
|
-
sort: 'desc',
|
|
428
|
-
comparator: (_, __, val1, val2) => {
|
|
429
|
-
const contractId1 = val1.data?.dataContractId;
|
|
430
|
-
const contractId2 = val2.data?.dataContractId;
|
|
431
|
-
const createdAt1 = pendingTaskContracts.find(
|
|
432
|
-
(c) => c.guid === contractId1,
|
|
433
|
-
)?.createdAt;
|
|
434
|
-
const createdAt2 = pendingTaskContracts.find(
|
|
435
|
-
(c) => c.guid === contractId2,
|
|
436
|
-
)?.createdAt;
|
|
437
|
-
const dateA = createdAt1 ? new Date(createdAt1).getTime() : 0;
|
|
438
|
-
const dateB = createdAt2 ? new Date(createdAt2).getTime() : 0;
|
|
439
|
-
return dateA - dateB;
|
|
440
|
-
},
|
|
442
|
+
const colDefs: DataGridColumnDefinition<V1_PendingTaskRecord>[] = useMemo(
|
|
443
|
+
() => [
|
|
444
|
+
{
|
|
445
|
+
headerName: 'Date Created',
|
|
446
|
+
colId: 'dateCreated',
|
|
447
|
+
valueGetter: (params) => {
|
|
448
|
+
const contractId = params.data?.accessRequestId;
|
|
449
|
+
const createdAt = pendingTaskContracts.find(
|
|
450
|
+
(c) => c.guid === contractId,
|
|
451
|
+
)?.createdAt;
|
|
452
|
+
return formatOrderDate(createdAt) ?? 'Unknown';
|
|
441
453
|
},
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
consumer,
|
|
457
|
-
dashboardState.lakehouseEntitlementsStore.applicationStore.pluginManager.getApplicationPlugins(),
|
|
458
|
-
)
|
|
459
|
-
: undefined;
|
|
460
|
-
return typeName ?? 'Unknown';
|
|
461
|
-
},
|
|
462
|
-
cellRenderer: (
|
|
463
|
-
params: DataGridCellRendererParams<V1_ContractUserEventRecord>,
|
|
464
|
-
) => {
|
|
465
|
-
const contractId = params.data?.dataContractId;
|
|
466
|
-
const consumer = pendingTaskContracts.find(
|
|
467
|
-
(c) => c.guid === contractId,
|
|
468
|
-
)?.consumer;
|
|
469
|
-
const typeName = consumer
|
|
470
|
-
? getOrganizationalScopeTypeName(
|
|
471
|
-
consumer,
|
|
472
|
-
dashboardState.lakehouseEntitlementsStore.applicationStore.pluginManager.getApplicationPlugins(),
|
|
473
|
-
)
|
|
474
|
-
: undefined;
|
|
475
|
-
const typeDetails = consumer
|
|
476
|
-
? getOrganizationalScopeTypeDetails(
|
|
477
|
-
consumer,
|
|
478
|
-
dashboardState.lakehouseEntitlementsStore.applicationStore.pluginManager.getApplicationPlugins(),
|
|
479
|
-
)
|
|
480
|
-
: undefined;
|
|
481
|
-
return (
|
|
482
|
-
<>
|
|
483
|
-
{typeName ?? 'Unknown'}
|
|
484
|
-
{typeDetails !== undefined && (
|
|
485
|
-
<Tooltip
|
|
486
|
-
className="marketplace-lakehouse-entitlements__grid__consumer-type__tooltip__icon"
|
|
487
|
-
title={typeDetails}
|
|
488
|
-
>
|
|
489
|
-
<InfoCircleIcon />
|
|
490
|
-
</Tooltip>
|
|
491
|
-
)}
|
|
492
|
-
</>
|
|
493
|
-
);
|
|
494
|
-
},
|
|
454
|
+
sortable: true,
|
|
455
|
+
sort: 'desc',
|
|
456
|
+
comparator: (_, __, val1, val2) => {
|
|
457
|
+
const contractId1 = val1.data?.accessRequestId;
|
|
458
|
+
const contractId2 = val2.data?.accessRequestId;
|
|
459
|
+
const createdAt1 = pendingTaskContracts.find(
|
|
460
|
+
(c) => c.guid === contractId1,
|
|
461
|
+
)?.createdAt;
|
|
462
|
+
const createdAt2 = pendingTaskContracts.find(
|
|
463
|
+
(c) => c.guid === contractId2,
|
|
464
|
+
)?.createdAt;
|
|
465
|
+
const dateA = createdAt1 ? new Date(createdAt1).getTime() : 0;
|
|
466
|
+
const dateB = createdAt2 ? new Date(createdAt2).getTime() : 0;
|
|
467
|
+
return dateA - dateB;
|
|
495
468
|
},
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
)
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
applicationStore
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
/>
|
|
517
|
-
);
|
|
518
|
-
},
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
minWidth: 25,
|
|
472
|
+
sortable: true,
|
|
473
|
+
resizable: true,
|
|
474
|
+
colId: 'consumerType',
|
|
475
|
+
headerName: 'Consumer Type',
|
|
476
|
+
flex: 1,
|
|
477
|
+
valueGetter: (params) => {
|
|
478
|
+
const contractId = params.data?.accessRequestId;
|
|
479
|
+
const consumer = pendingTaskContracts.find(
|
|
480
|
+
(c) => c.guid === contractId,
|
|
481
|
+
)?.consumer;
|
|
482
|
+
const typeName = consumer
|
|
483
|
+
? getOrganizationalScopeTypeName(
|
|
484
|
+
consumer,
|
|
485
|
+
dashboardState.lakehouseEntitlementsStore.applicationStore.pluginManager.getApplicationPlugins(),
|
|
486
|
+
)
|
|
487
|
+
: undefined;
|
|
488
|
+
return typeName ?? 'Unknown';
|
|
519
489
|
},
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
},
|
|
490
|
+
cellRenderer: (
|
|
491
|
+
params: DataGridCellRendererParams<V1_PendingTaskRecord>,
|
|
492
|
+
) => {
|
|
493
|
+
const contractId = params.data?.accessRequestId;
|
|
494
|
+
const consumer = pendingTaskContracts.find(
|
|
495
|
+
(c) => c.guid === contractId,
|
|
496
|
+
)?.consumer;
|
|
497
|
+
const typeName = consumer
|
|
498
|
+
? getOrganizationalScopeTypeName(
|
|
499
|
+
consumer,
|
|
500
|
+
dashboardState.lakehouseEntitlementsStore.applicationStore.pluginManager.getApplicationPlugins(),
|
|
501
|
+
)
|
|
502
|
+
: undefined;
|
|
503
|
+
const typeDetails = consumer
|
|
504
|
+
? getOrganizationalScopeTypeDetails(
|
|
505
|
+
consumer,
|
|
506
|
+
dashboardState.lakehouseEntitlementsStore.applicationStore.pluginManager.getApplicationPlugins(),
|
|
507
|
+
)
|
|
508
|
+
: undefined;
|
|
509
|
+
return (
|
|
510
|
+
<>
|
|
511
|
+
{typeName ?? 'Unknown'}
|
|
512
|
+
{typeDetails !== undefined && (
|
|
513
|
+
<Tooltip
|
|
514
|
+
className="marketplace-lakehouse-entitlements__grid__consumer-type__tooltip__icon"
|
|
515
|
+
title={typeDetails}
|
|
516
|
+
>
|
|
517
|
+
<InfoCircleIcon />
|
|
518
|
+
</Tooltip>
|
|
519
|
+
)}
|
|
520
|
+
</>
|
|
521
|
+
);
|
|
553
522
|
},
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
523
|
+
},
|
|
524
|
+
{
|
|
525
|
+
minWidth: 50,
|
|
526
|
+
sortable: true,
|
|
527
|
+
resizable: true,
|
|
528
|
+
colId: 'targetUser',
|
|
529
|
+
headerName: 'Target User',
|
|
530
|
+
flex: 1,
|
|
531
|
+
valueGetter: (params) => {
|
|
532
|
+
const contractId = params.data?.accessRequestId;
|
|
533
|
+
const consumer = pendingTaskContracts.find(
|
|
534
|
+
(c) => c.guid === contractId,
|
|
535
|
+
)?.consumer;
|
|
536
|
+
return consumer
|
|
537
|
+
? stringifyOrganizationalScope(
|
|
538
|
+
consumer,
|
|
539
|
+
dashboardState.lakehouseEntitlementsStore.applicationStore.pluginManager.getApplicationPlugins(),
|
|
540
|
+
)
|
|
541
|
+
: 'Unknown';
|
|
567
542
|
},
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
543
|
+
cellRenderer: (
|
|
544
|
+
params: DataGridCellRendererParams<V1_PendingTaskRecord>,
|
|
545
|
+
) => {
|
|
546
|
+
const contractId = params.data?.accessRequestId;
|
|
547
|
+
const consumer = pendingTaskContracts.find(
|
|
548
|
+
(c) => c.guid === contractId,
|
|
549
|
+
)?.consumer;
|
|
550
|
+
const userId = consumer
|
|
551
|
+
? stringifyOrganizationalScope(
|
|
552
|
+
consumer,
|
|
553
|
+
dashboardState.lakehouseEntitlementsStore.applicationStore.pluginManager.getApplicationPlugins(),
|
|
554
|
+
)
|
|
555
|
+
: undefined;
|
|
556
|
+
return (
|
|
557
|
+
<UserRenderer
|
|
558
|
+
userId={userId}
|
|
559
|
+
applicationStore={marketplaceBaseStore.applicationStore}
|
|
560
|
+
userSearchService={marketplaceBaseStore.userSearchService}
|
|
561
|
+
disableOnClick={true}
|
|
562
|
+
className="marketplace-lakehouse-entitlements__grid__user-display"
|
|
563
|
+
/>
|
|
564
|
+
);
|
|
585
565
|
},
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
minWidth: 50,
|
|
569
|
+
sortable: true,
|
|
570
|
+
resizable: true,
|
|
571
|
+
colId: 'requester',
|
|
572
|
+
headerName: 'Requester',
|
|
573
|
+
flex: 1,
|
|
574
|
+
valueGetter: (params) => {
|
|
575
|
+
const contractId = params.data?.accessRequestId;
|
|
576
|
+
const requester = pendingTaskContracts.find(
|
|
577
|
+
(c) => c.guid === contractId,
|
|
578
|
+
)?.createdBy;
|
|
579
|
+
return requester ?? 'Unknown';
|
|
599
580
|
},
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
581
|
+
cellRenderer: (
|
|
582
|
+
params: DataGridCellRendererParams<V1_PendingTaskRecord>,
|
|
583
|
+
) => {
|
|
584
|
+
const contractId = params.data?.accessRequestId;
|
|
585
|
+
const requester = pendingTaskContracts.find(
|
|
586
|
+
(c) => c.guid === contractId,
|
|
587
|
+
)?.createdBy;
|
|
588
|
+
return requester ? (
|
|
589
|
+
<UserRenderer
|
|
590
|
+
userId={requester}
|
|
591
|
+
applicationStore={marketplaceBaseStore.applicationStore}
|
|
592
|
+
userSearchService={marketplaceBaseStore.userSearchService}
|
|
593
|
+
disableOnClick={true}
|
|
594
|
+
className="marketplace-lakehouse-entitlements__grid__user-display"
|
|
595
|
+
/>
|
|
596
|
+
) : (
|
|
597
|
+
<>Unknown</>
|
|
598
|
+
);
|
|
608
599
|
},
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
600
|
+
},
|
|
601
|
+
{
|
|
602
|
+
minWidth: 50,
|
|
603
|
+
sortable: true,
|
|
604
|
+
resizable: true,
|
|
605
|
+
headerName: 'Target Data Product',
|
|
606
|
+
flex: 1,
|
|
607
|
+
valueGetter: (params) => {
|
|
608
|
+
const contractId = params.data?.accessRequestId;
|
|
609
|
+
const contract = pendingTaskContracts.find(
|
|
610
|
+
(c) => c.guid === contractId,
|
|
611
|
+
);
|
|
612
|
+
return contract?.resourceId ?? 'Unknown';
|
|
613
|
+
},
|
|
614
|
+
},
|
|
615
|
+
{
|
|
616
|
+
minWidth: 50,
|
|
617
|
+
sortable: true,
|
|
618
|
+
resizable: true,
|
|
619
|
+
headerName: 'Target Access Point Group',
|
|
620
|
+
flex: 1,
|
|
621
|
+
valueGetter: (params) => {
|
|
622
|
+
const contractId = params.data?.accessRequestId;
|
|
623
|
+
const contract = pendingTaskContracts.find(
|
|
624
|
+
(c) => c.guid === contractId,
|
|
625
|
+
);
|
|
626
|
+
const accessPointGroup =
|
|
627
|
+
contract?.resourceType === V1_ResourceType.ACCESS_POINT_GROUP
|
|
628
|
+
? contract.accessPointGroup
|
|
629
|
+
: `${contract?.accessPointGroup ?? 'Unknown'} (${contract?.resourceType ?? 'Unknown Type'})`;
|
|
630
|
+
return accessPointGroup ?? 'Unknown';
|
|
631
|
+
},
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
minWidth: 50,
|
|
635
|
+
sortable: true,
|
|
636
|
+
resizable: true,
|
|
637
|
+
headerName: 'Business Justification',
|
|
638
|
+
flex: 2,
|
|
639
|
+
valueGetter: (params) => {
|
|
640
|
+
const contractId = params.data?.accessRequestId;
|
|
641
|
+
const businessJustification = pendingTaskContracts.find(
|
|
642
|
+
(c) => c.guid === contractId,
|
|
643
|
+
)?.description;
|
|
644
|
+
return businessJustification ?? 'Unknown';
|
|
645
|
+
},
|
|
646
|
+
},
|
|
647
|
+
{
|
|
648
|
+
minWidth: 50,
|
|
649
|
+
sortable: true,
|
|
650
|
+
resizable: true,
|
|
651
|
+
hide: true,
|
|
652
|
+
headerName: 'Contract ID',
|
|
653
|
+
flex: 2,
|
|
654
|
+
valueGetter: (params) => params.data?.accessRequestId ?? 'Unknown',
|
|
655
|
+
},
|
|
656
|
+
],
|
|
657
|
+
[
|
|
658
|
+
dashboardState.lakehouseEntitlementsStore.applicationStore
|
|
659
|
+
.pluginManager,
|
|
660
|
+
marketplaceBaseStore.applicationStore,
|
|
661
|
+
marketplaceBaseStore.userSearchService,
|
|
662
|
+
pendingTaskContracts,
|
|
663
|
+
],
|
|
664
|
+
);
|
|
618
665
|
|
|
619
|
-
const privilegeManagerColDefs: DataGridColumnDefinition<
|
|
666
|
+
const privilegeManagerColDefs: DataGridColumnDefinition<V1_PendingTaskRecord>[] =
|
|
620
667
|
useMemo(
|
|
621
668
|
() => [
|
|
622
669
|
{
|
|
@@ -625,7 +672,7 @@ export const EntitlementsPendingTasksDashboard = observer(
|
|
|
625
672
|
width: 50,
|
|
626
673
|
cellRenderer: CustomSelectionRenderer,
|
|
627
674
|
headerComponent: (
|
|
628
|
-
params: DataGridCustomHeaderProps<
|
|
675
|
+
params: DataGridCustomHeaderProps<V1_PendingTaskRecord>,
|
|
629
676
|
) => (
|
|
630
677
|
<CustomSelectionHeaderRenderer
|
|
631
678
|
params={params}
|
|
@@ -644,7 +691,7 @@ export const EntitlementsPendingTasksDashboard = observer(
|
|
|
644
691
|
],
|
|
645
692
|
);
|
|
646
693
|
|
|
647
|
-
const dataOwnerColDefs: DataGridColumnDefinition<
|
|
694
|
+
const dataOwnerColDefs: DataGridColumnDefinition<V1_PendingTaskRecord>[] =
|
|
648
695
|
useMemo(
|
|
649
696
|
() => [
|
|
650
697
|
{
|
|
@@ -653,7 +700,7 @@ export const EntitlementsPendingTasksDashboard = observer(
|
|
|
653
700
|
width: 50,
|
|
654
701
|
cellRenderer: CustomSelectionRenderer,
|
|
655
702
|
headerComponent: (
|
|
656
|
-
params: DataGridCustomHeaderProps<
|
|
703
|
+
params: DataGridCustomHeaderProps<V1_PendingTaskRecord>,
|
|
657
704
|
) => (
|
|
658
705
|
<CustomSelectionHeaderRenderer
|
|
659
706
|
params={params}
|
|
@@ -672,7 +719,7 @@ export const EntitlementsPendingTasksDashboard = observer(
|
|
|
672
719
|
],
|
|
673
720
|
);
|
|
674
721
|
|
|
675
|
-
const otherTasksColDefs: DataGridColumnDefinition<
|
|
722
|
+
const otherTasksColDefs: DataGridColumnDefinition<V1_PendingTaskRecord>[] =
|
|
676
723
|
useMemo(
|
|
677
724
|
() => [
|
|
678
725
|
{
|
|
@@ -681,7 +728,7 @@ export const EntitlementsPendingTasksDashboard = observer(
|
|
|
681
728
|
width: 50,
|
|
682
729
|
cellRenderer: CustomSelectionRenderer,
|
|
683
730
|
headerComponent: (
|
|
684
|
-
params: DataGridCustomHeaderProps<
|
|
731
|
+
params: DataGridCustomHeaderProps<V1_PendingTaskRecord>,
|
|
685
732
|
) => (
|
|
686
733
|
<CustomSelectionHeaderRenderer
|
|
687
734
|
params={params}
|
|
@@ -749,17 +796,9 @@ export const EntitlementsPendingTasksDashboard = observer(
|
|
|
749
796
|
rowHeight={45}
|
|
750
797
|
rowSelection={rowSelection}
|
|
751
798
|
onFirstDataRendered={handleFirstDataRendered}
|
|
752
|
-
onCellClicked={
|
|
753
|
-
event: DataGridCellClickedEvent<
|
|
754
|
-
V1_ContractUserEventRecord,
|
|
755
|
-
unknown
|
|
756
|
-
>,
|
|
757
|
-
) =>
|
|
758
|
-
// eslint-disable-next-line no-void
|
|
759
|
-
void handleCellClicked(event)
|
|
760
|
-
}
|
|
799
|
+
onCellClicked={handleCellClicked}
|
|
761
800
|
columnDefs={privilegeManagerColDefs}
|
|
762
|
-
overlayNoRowsTemplate="You have no contracts to approve as a Privilege Manager"
|
|
801
|
+
overlayNoRowsTemplate="You have no contracts or data requests to approve as a Privilege Manager"
|
|
763
802
|
loading={loading}
|
|
764
803
|
overlayLoadingTemplate="Loading contracts"
|
|
765
804
|
/>
|
|
@@ -792,17 +831,9 @@ export const EntitlementsPendingTasksDashboard = observer(
|
|
|
792
831
|
rowHeight={45}
|
|
793
832
|
rowSelection={rowSelection}
|
|
794
833
|
onFirstDataRendered={handleFirstDataRendered}
|
|
795
|
-
onCellClicked={
|
|
796
|
-
event: DataGridCellClickedEvent<
|
|
797
|
-
V1_ContractUserEventRecord,
|
|
798
|
-
unknown
|
|
799
|
-
>,
|
|
800
|
-
) =>
|
|
801
|
-
// eslint-disable-next-line no-void
|
|
802
|
-
void handleCellClicked(event)
|
|
803
|
-
}
|
|
834
|
+
onCellClicked={handleCellClicked}
|
|
804
835
|
columnDefs={dataOwnerColDefs}
|
|
805
|
-
overlayNoRowsTemplate="You have no contracts to approve as a Data Owner"
|
|
836
|
+
overlayNoRowsTemplate="You have no contracts or data requests to approve as a Data Owner"
|
|
806
837
|
loading={loading}
|
|
807
838
|
overlayLoadingTemplate="Loading contracts"
|
|
808
839
|
/>
|
|
@@ -824,15 +855,7 @@ export const EntitlementsPendingTasksDashboard = observer(
|
|
|
824
855
|
rowHeight={45}
|
|
825
856
|
rowSelection={rowSelection}
|
|
826
857
|
onFirstDataRendered={handleFirstDataRendered}
|
|
827
|
-
onCellClicked={
|
|
828
|
-
event: DataGridCellClickedEvent<
|
|
829
|
-
V1_ContractUserEventRecord,
|
|
830
|
-
unknown
|
|
831
|
-
>,
|
|
832
|
-
) =>
|
|
833
|
-
// eslint-disable-next-line no-void
|
|
834
|
-
void handleCellClicked(event)
|
|
835
|
-
}
|
|
858
|
+
onCellClicked={handleCellClicked}
|
|
836
859
|
columnDefs={otherTasksColDefs}
|
|
837
860
|
loading={loading}
|
|
838
861
|
overlayLoadingTemplate="Loading contracts"
|
|
@@ -855,44 +878,28 @@ export const EntitlementsPendingTasksDashboard = observer(
|
|
|
855
878
|
pendingTaskContracts={pendingTaskContracts}
|
|
856
879
|
marketplaceBaseStore={marketplaceBaseStore}
|
|
857
880
|
/>
|
|
858
|
-
{
|
|
881
|
+
{selectedRow !== undefined && selectedViewerState !== undefined && (
|
|
859
882
|
<DataAccessRequestViewer
|
|
860
883
|
open={true}
|
|
861
884
|
onClose={() => {
|
|
862
|
-
|
|
885
|
+
setSelectedRow(undefined);
|
|
863
886
|
setContractErrors(undefined);
|
|
864
887
|
}}
|
|
865
888
|
contractErrors={contractErrors}
|
|
866
|
-
viewerState={
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
marketplaceBaseStore.userSearchService,
|
|
881
|
-
)
|
|
882
|
-
}
|
|
883
|
-
onRefresh={async () => {
|
|
884
|
-
await flowResult(
|
|
885
|
-
dashboardState.updateContract(
|
|
886
|
-
selectedContract.guid,
|
|
887
|
-
auth.user?.access_token,
|
|
888
|
-
),
|
|
889
|
-
);
|
|
890
|
-
}}
|
|
891
|
-
getDataProductUrl={(dataProductId: string, deploymentId: number) =>
|
|
892
|
-
marketplaceBaseStore.applicationStore.navigationService.navigator.generateAddress(
|
|
893
|
-
generateLakehouseDataProductPath(dataProductId, deploymentId),
|
|
894
|
-
)
|
|
895
|
-
}
|
|
889
|
+
viewerState={selectedViewerState}
|
|
890
|
+
{...(selectedContractGuid
|
|
891
|
+
? {
|
|
892
|
+
onRefresh: async () => {
|
|
893
|
+
await flowResult(
|
|
894
|
+
dashboardState.updateContract(
|
|
895
|
+
selectedContractGuid,
|
|
896
|
+
auth.user?.access_token,
|
|
897
|
+
),
|
|
898
|
+
);
|
|
899
|
+
},
|
|
900
|
+
}
|
|
901
|
+
: {})}
|
|
902
|
+
getDataProductUrl={getDataProductUrl}
|
|
896
903
|
initialSelectedUser={selectedContractTargetUser}
|
|
897
904
|
//Derives environment from the fact that other environments are filtered out
|
|
898
905
|
dataProductEnvironment={
|