@finos/legend-application-marketplace 0.1.55 → 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__/LegendMarketplaceAppEvent.d.ts +1 -0
- package/lib/__lib__/LegendMarketplaceAppEvent.d.ts.map +1 -1
- package/lib/__lib__/LegendMarketplaceAppEvent.js +1 -0
- package/lib/__lib__/LegendMarketplaceAppEvent.js.map +1 -1
- package/lib/__lib__/LegendMarketplaceNavigation.d.ts +9 -2
- package/lib/__lib__/LegendMarketplaceNavigation.d.ts.map +1 -1
- package/lib/__lib__/LegendMarketplaceNavigation.js +7 -1
- package/lib/__lib__/LegendMarketplaceNavigation.js.map +1 -1
- package/lib/__lib__/LegendMarketplaceTelemetryHelper.d.ts +11 -1
- package/lib/__lib__/LegendMarketplaceTelemetryHelper.d.ts.map +1 -1
- package/lib/__lib__/LegendMarketplaceTelemetryHelper.js +57 -3
- package/lib/__lib__/LegendMarketplaceTelemetryHelper.js.map +1 -1
- package/lib/application/LegendMarketplaceWebApplication.d.ts.map +1 -1
- package/lib/application/LegendMarketplaceWebApplication.js +4 -1
- package/lib/application/LegendMarketplaceWebApplication.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/components/SearchBar/LegendMarketplaceSearchBar.d.ts.map +1 -1
- package/lib/components/SearchBar/LegendMarketplaceSearchBar.js +4 -0
- package/lib/components/SearchBar/LegendMarketplaceSearchBar.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 +5 -19
- package/lib/pages/Lakehouse/MarketplaceLakehouseHome.js.map +1 -1
- package/lib/pages/Lakehouse/admin/LakehouseAdminContractsDashboard.js +2 -2
- package/lib/pages/Lakehouse/admin/LakehouseAdminContractsDashboard.js.map +1 -1
- package/lib/pages/Lakehouse/entitlements/EntitlementsClosedContractsDashboard.d.ts.map +1 -1
- package/lib/pages/Lakehouse/entitlements/EntitlementsClosedContractsDashboard.js +38 -132
- 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 +36 -160
- 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 +60 -40
- package/lib/pages/Lakehouse/entitlements/EntitlementsPendingTasksDashboard.js.map +1 -1
- package/lib/pages/Lakehouse/entitlements/LakehouseDataContract.d.ts +17 -0
- package/lib/pages/Lakehouse/entitlements/LakehouseDataContract.d.ts.map +1 -0
- package/lib/pages/Lakehouse/entitlements/LakehouseDataContract.js +124 -0
- package/lib/pages/Lakehouse/entitlements/LakehouseDataContract.js.map +1 -0
- package/lib/stores/lakehouse/LegendMarketplaceProductViewerStore.js +2 -2
- package/lib/stores/lakehouse/LegendMarketplaceProductViewerStore.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__/LegendMarketplaceAppEvent.ts +1 -0
- package/src/__lib__/LegendMarketplaceNavigation.ts +19 -3
- package/src/__lib__/LegendMarketplaceTelemetryHelper.ts +80 -4
- package/src/application/LegendMarketplaceWebApplication.tsx +15 -0
- package/src/components/Header/LegendMarketplaceIconToolbar.tsx +29 -0
- package/src/components/SearchBar/LegendMarketplaceSearchBar.tsx +7 -0
- package/src/pages/Lakehouse/MarketplaceLakehouseHome.tsx +4 -54
- package/src/pages/Lakehouse/admin/LakehouseAdminContractsDashboard.tsx +3 -3
- package/src/pages/Lakehouse/entitlements/EntitlementsClosedContractsDashboard.tsx +91 -244
- package/src/pages/Lakehouse/entitlements/EntitlementsPendingContractsDashboard.tsx +91 -298
- package/src/pages/Lakehouse/entitlements/EntitlementsPendingTasksDashboard.tsx +87 -52
- package/src/pages/Lakehouse/entitlements/LakehouseDataContract.tsx +284 -0
- package/src/stores/lakehouse/LegendMarketplaceProductViewerStore.ts +3 -3
- 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 +2 -0
|
@@ -15,15 +15,10 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import {
|
|
18
|
-
type V1_ContractUserEventRecord,
|
|
19
|
-
type V1_LiteDataContract,
|
|
20
|
-
type V1_UserPendingContractsRecord,
|
|
21
18
|
GraphManagerState,
|
|
22
|
-
V1_AdhocTeam,
|
|
23
19
|
V1_ContractState,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
V1_UserApprovalStatus,
|
|
20
|
+
type V1_LiteDataContract,
|
|
21
|
+
V1_LiteDataContractWithUserStatus,
|
|
27
22
|
} from '@finos/legend-graph';
|
|
28
23
|
import {
|
|
29
24
|
DataGrid,
|
|
@@ -35,220 +30,86 @@ import {
|
|
|
35
30
|
Box,
|
|
36
31
|
CircularProgress,
|
|
37
32
|
FormControlLabel,
|
|
33
|
+
FormGroup,
|
|
38
34
|
Switch,
|
|
39
|
-
Tooltip,
|
|
40
35
|
} from '@mui/material';
|
|
41
|
-
import {
|
|
42
|
-
import type {
|
|
36
|
+
import { useMemo, useState } from 'react';
|
|
37
|
+
import type {
|
|
38
|
+
ContractCreatedByUserDetails,
|
|
39
|
+
EntitlementsDashboardState,
|
|
40
|
+
} from '../../../stores/lakehouse/entitlements/EntitlementsDashboardState.js';
|
|
43
41
|
import { useLegendMarketplaceBaseStore } from '../../../application/providers/LegendMarketplaceFrameworkProvider.js';
|
|
44
42
|
import { observer } from 'mobx-react-lite';
|
|
45
|
-
import {
|
|
43
|
+
import { startCase } from '@finos/legend-shared';
|
|
46
44
|
import { useAuth } from 'react-oidc-context';
|
|
47
|
-
import { InfoCircleIcon } from '@finos/legend-art';
|
|
48
45
|
import {
|
|
49
46
|
MultiUserRenderer,
|
|
50
47
|
isContractInTerminalState,
|
|
51
|
-
getOrganizationalScopeTypeName,
|
|
52
|
-
getOrganizationalScopeTypeDetails,
|
|
53
|
-
UserRenderer,
|
|
54
48
|
EntitlementsDataContractViewer,
|
|
55
49
|
EntitlementsDataContractViewerState,
|
|
50
|
+
isApprovalStatusTerminal,
|
|
56
51
|
} from '@finos/legend-extension-dsl-data-product';
|
|
57
52
|
import {
|
|
58
|
-
|
|
53
|
+
generateContractPagePath,
|
|
59
54
|
generateLakehouseDataProductPath,
|
|
60
55
|
} from '../../../__lib__/LegendMarketplaceNavigation.js';
|
|
61
56
|
import type { LakehouseEntitlementsStore } from '../../../stores/lakehouse/entitlements/LakehouseEntitlementsStore.js';
|
|
62
57
|
import { flowResult } from 'mobx';
|
|
58
|
+
import { getCommonEntitlementsColDefs } from '../../../utils/EntitlementsUtils.js';
|
|
63
59
|
|
|
64
60
|
const AssigneesCellRenderer = (props: {
|
|
65
|
-
dataContract:
|
|
66
|
-
|
|
61
|
+
dataContract:
|
|
62
|
+
| V1_LiteDataContractWithUserStatus
|
|
63
|
+
| ContractCreatedByUserDetails
|
|
64
|
+
| undefined;
|
|
67
65
|
entitlementsStore: LakehouseEntitlementsStore;
|
|
68
|
-
token: string | undefined;
|
|
69
66
|
}): React.ReactNode => {
|
|
70
|
-
const { dataContract,
|
|
71
|
-
props;
|
|
72
|
-
const pendingContractRecord = pendingContractRecords?.find(
|
|
73
|
-
(record) => record.contractId === dataContract?.guid,
|
|
74
|
-
);
|
|
75
|
-
const [assignees, setAssignees] = useState<string[]>(
|
|
76
|
-
pendingContractRecord?.pendingTaskWithAssignees.assignees ??
|
|
77
|
-
entitlementsStore.contractIdToAssigneesMap.get(
|
|
78
|
-
dataContract?.guid ?? '',
|
|
79
|
-
) ??
|
|
80
|
-
[],
|
|
81
|
-
);
|
|
82
|
-
const [loading, setLoading] = useState<boolean>(false);
|
|
83
|
-
|
|
84
|
-
useEffect(() => {
|
|
85
|
-
const fetchAssignees = async () => {
|
|
86
|
-
if (dataContract) {
|
|
87
|
-
setLoading(true);
|
|
88
|
-
try {
|
|
89
|
-
const rawTasks =
|
|
90
|
-
await entitlementsStore.lakehouseContractServerClient.getContractTasks(
|
|
91
|
-
dataContract.guid,
|
|
92
|
-
token,
|
|
93
|
-
);
|
|
94
|
-
const tasks = V1_deserializeTaskResponse(rawTasks);
|
|
95
|
-
const pendingTasks = tasks.filter(
|
|
96
|
-
(task) => task.rec.status === V1_UserApprovalStatus.PENDING,
|
|
97
|
-
);
|
|
98
|
-
const pendingAssignees = Array.from(
|
|
99
|
-
new Set<string>(pendingTasks.map((task) => task.assignees).flat()),
|
|
100
|
-
);
|
|
101
|
-
setAssignees(pendingAssignees);
|
|
102
|
-
entitlementsStore.contractIdToAssigneesMap.set(
|
|
103
|
-
dataContract.guid,
|
|
104
|
-
pendingAssignees,
|
|
105
|
-
);
|
|
106
|
-
} catch (error) {
|
|
107
|
-
assertErrorThrown(error);
|
|
108
|
-
entitlementsStore.applicationStore.notificationService.notifyError(
|
|
109
|
-
`Error fetching contract assignees: ${error.message}`,
|
|
110
|
-
);
|
|
111
|
-
} finally {
|
|
112
|
-
setLoading(false);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
};
|
|
67
|
+
const { dataContract, entitlementsStore } = props;
|
|
116
68
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}, [
|
|
122
|
-
assignees.length,
|
|
123
|
-
dataContract,
|
|
124
|
-
entitlementsStore.applicationStore.notificationService,
|
|
125
|
-
entitlementsStore.contractIdToAssigneesMap,
|
|
126
|
-
entitlementsStore.lakehouseContractServerClient,
|
|
127
|
-
token,
|
|
128
|
-
]);
|
|
69
|
+
const assignees =
|
|
70
|
+
(dataContract instanceof V1_LiteDataContractWithUserStatus
|
|
71
|
+
? dataContract.pendingTaskWithAssignees?.assignees.toSorted()
|
|
72
|
+
: dataContract?.sortedAssigneeIds) ?? [];
|
|
129
73
|
|
|
130
|
-
return
|
|
131
|
-
<CircularProgress size={20} />
|
|
132
|
-
) : assignees.length > 0 ? (
|
|
74
|
+
return (
|
|
133
75
|
<MultiUserRenderer
|
|
134
76
|
userIds={assignees}
|
|
135
77
|
applicationStore={entitlementsStore.applicationStore}
|
|
136
78
|
userSearchService={
|
|
137
79
|
entitlementsStore.marketplaceBaseStore.userSearchService
|
|
138
80
|
}
|
|
81
|
+
disableOnClick={true}
|
|
139
82
|
singleUserClassName="marketplace-lakehouse-entitlements__grid__user-display"
|
|
140
83
|
/>
|
|
141
|
-
) : (
|
|
142
|
-
<>Unknown</>
|
|
143
84
|
);
|
|
144
85
|
};
|
|
145
86
|
|
|
146
|
-
const TargetUserCellRenderer = observer(
|
|
147
|
-
(props: {
|
|
148
|
-
dataContract: V1_LiteDataContract | undefined;
|
|
149
|
-
entitlementsStore: LakehouseEntitlementsStore;
|
|
150
|
-
token: string | undefined;
|
|
151
|
-
}): React.ReactNode => {
|
|
152
|
-
const { dataContract, entitlementsStore, token } = props;
|
|
153
|
-
const [targetUsers, setTargetUsers] = useState<string[]>(
|
|
154
|
-
entitlementsStore.contractIdToTargetUsersMap.get(
|
|
155
|
-
dataContract?.guid ?? '',
|
|
156
|
-
) ?? [],
|
|
157
|
-
);
|
|
158
|
-
const [loading, setLoading] = useState<boolean>(false);
|
|
159
|
-
|
|
160
|
-
useEffect(() => {
|
|
161
|
-
const fetchTargetUsers = async () => {
|
|
162
|
-
if (dataContract) {
|
|
163
|
-
setLoading(true);
|
|
164
|
-
try {
|
|
165
|
-
// We try to get the target users from the associated tasks first, since the
|
|
166
|
-
// tasks are what drive the timeline view. If there are no associated tasks,
|
|
167
|
-
// then we use the contract consumer.
|
|
168
|
-
const rawTasks =
|
|
169
|
-
await entitlementsStore.lakehouseContractServerClient.getContractTasks(
|
|
170
|
-
dataContract.guid,
|
|
171
|
-
token,
|
|
172
|
-
);
|
|
173
|
-
const tasks = V1_deserializeTaskResponse(rawTasks);
|
|
174
|
-
const taskTargetUsers = Array.from(
|
|
175
|
-
new Set<string>(tasks.map((task) => task.rec.consumer)),
|
|
176
|
-
);
|
|
177
|
-
const _targetUsers = taskTargetUsers.length
|
|
178
|
-
? taskTargetUsers
|
|
179
|
-
: dataContract.consumer instanceof V1_AdhocTeam
|
|
180
|
-
? dataContract.consumer.users.map((user) => user.name)
|
|
181
|
-
: [];
|
|
182
|
-
setTargetUsers(_targetUsers);
|
|
183
|
-
entitlementsStore.contractIdToTargetUsersMap.set(
|
|
184
|
-
dataContract.guid,
|
|
185
|
-
_targetUsers,
|
|
186
|
-
);
|
|
187
|
-
} catch (error) {
|
|
188
|
-
assertErrorThrown(error);
|
|
189
|
-
entitlementsStore.applicationStore.notificationService.notifyError(
|
|
190
|
-
`Error fetching contract target users: ${error.message}`,
|
|
191
|
-
);
|
|
192
|
-
} finally {
|
|
193
|
-
setLoading(false);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
};
|
|
197
|
-
if (targetUsers.length === 0) {
|
|
198
|
-
// eslint-disable-next-line no-void
|
|
199
|
-
void fetchTargetUsers();
|
|
200
|
-
}
|
|
201
|
-
}, [dataContract, entitlementsStore, targetUsers.length, token]);
|
|
202
|
-
|
|
203
|
-
return loading ? (
|
|
204
|
-
<CircularProgress size={20} />
|
|
205
|
-
) : targetUsers.length > 0 ? (
|
|
206
|
-
<MultiUserRenderer
|
|
207
|
-
userIds={targetUsers}
|
|
208
|
-
applicationStore={entitlementsStore.applicationStore}
|
|
209
|
-
userSearchService={
|
|
210
|
-
entitlementsStore.marketplaceBaseStore.userSearchService
|
|
211
|
-
}
|
|
212
|
-
singleUserClassName="marketplace-lakehouse-entitlements__grid__user-display"
|
|
213
|
-
/>
|
|
214
|
-
) : (
|
|
215
|
-
<>Unknown</>
|
|
216
|
-
);
|
|
217
|
-
},
|
|
218
|
-
);
|
|
219
|
-
|
|
220
87
|
export const EntitlementsPendingContractsDashboard = observer(
|
|
221
88
|
(props: { dashboardState: EntitlementsDashboardState }): React.ReactNode => {
|
|
222
89
|
const { dashboardState } = props;
|
|
223
|
-
const {
|
|
90
|
+
const { allContractsForUser, allContractsCreatedByUser } = dashboardState;
|
|
224
91
|
const marketplaceBaseStore = useLegendMarketplaceBaseStore();
|
|
225
92
|
const auth = useAuth();
|
|
226
93
|
|
|
227
94
|
const myPendingContracts = useMemo(
|
|
228
95
|
() =>
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
(pendingContract) => pendingContract.contractId === contract.guid,
|
|
232
|
-
),
|
|
96
|
+
allContractsForUser?.filter(
|
|
97
|
+
(contract) => !isApprovalStatusTerminal(contract.status),
|
|
233
98
|
) ?? [],
|
|
234
|
-
[
|
|
99
|
+
[allContractsForUser],
|
|
100
|
+
);
|
|
101
|
+
const myPendingContractIds = useMemo(
|
|
102
|
+
() => new Set(myPendingContracts.map((c) => c.contractResultLite.guid)),
|
|
103
|
+
[myPendingContracts],
|
|
235
104
|
);
|
|
236
105
|
const pendingContractsForOthers = useMemo(
|
|
237
106
|
() =>
|
|
238
|
-
|
|
107
|
+
allContractsCreatedByUser.filter(
|
|
239
108
|
(contract) =>
|
|
240
|
-
contract.
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
!myPendingContracts.includes(contract),
|
|
245
|
-
) ?? [],
|
|
246
|
-
[
|
|
247
|
-
allContracts,
|
|
248
|
-
dashboardState.lakehouseEntitlementsStore.applicationStore
|
|
249
|
-
.identityService.currentUser,
|
|
250
|
-
myPendingContracts,
|
|
251
|
-
],
|
|
109
|
+
!isContractInTerminalState(contract.contractResultLite) &&
|
|
110
|
+
!myPendingContractIds.has(contract.contractResultLite.guid),
|
|
111
|
+
),
|
|
112
|
+
[allContractsCreatedByUser, myPendingContractIds],
|
|
252
113
|
);
|
|
253
114
|
|
|
254
115
|
const [selectedContract, setSelectedContract] = useState<
|
|
@@ -259,116 +120,34 @@ export const EntitlementsPendingContractsDashboard = observer(
|
|
|
259
120
|
);
|
|
260
121
|
|
|
261
122
|
const handleCellClicked = (
|
|
262
|
-
event: DataGridCellClickedEvent<
|
|
123
|
+
event: DataGridCellClickedEvent<
|
|
124
|
+
V1_LiteDataContractWithUserStatus | ContractCreatedByUserDetails
|
|
125
|
+
>,
|
|
263
126
|
) => {
|
|
264
|
-
|
|
265
|
-
event.colDef.colId !== 'targetUser' &&
|
|
266
|
-
event.colDef.colId !== 'requester' &&
|
|
267
|
-
event.colDef.colId !== 'assignees'
|
|
268
|
-
) {
|
|
269
|
-
setSelectedContract(event.data);
|
|
270
|
-
}
|
|
127
|
+
setSelectedContract(event.data?.contractResultLite);
|
|
271
128
|
};
|
|
272
129
|
|
|
273
|
-
const defaultColDef: DataGridColumnDefinition<
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
130
|
+
const defaultColDef: DataGridColumnDefinition<
|
|
131
|
+
V1_LiteDataContractWithUserStatus | ContractCreatedByUserDetails
|
|
132
|
+
> = useMemo(
|
|
133
|
+
() => ({
|
|
134
|
+
minWidth: 50,
|
|
135
|
+
sortable: true,
|
|
136
|
+
resizable: true,
|
|
137
|
+
flex: 1,
|
|
138
|
+
}),
|
|
139
|
+
[],
|
|
140
|
+
);
|
|
283
141
|
|
|
284
|
-
const colDefs: DataGridColumnDefinition<
|
|
142
|
+
const colDefs: DataGridColumnDefinition<
|
|
143
|
+
V1_LiteDataContractWithUserStatus | ContractCreatedByUserDetails
|
|
144
|
+
>[] = useMemo(
|
|
285
145
|
() => [
|
|
286
|
-
|
|
287
|
-
colId: 'consumerType',
|
|
288
|
-
headerName: 'Consumer Type',
|
|
289
|
-
cellRenderer: (
|
|
290
|
-
params: DataGridCellRendererParams<V1_ContractUserEventRecord>,
|
|
291
|
-
) => {
|
|
292
|
-
const consumer = params.data?.consumer;
|
|
293
|
-
const typeName = consumer
|
|
294
|
-
? getOrganizationalScopeTypeName(
|
|
295
|
-
consumer,
|
|
296
|
-
dashboardState.lakehouseEntitlementsStore.applicationStore.pluginManager.getApplicationPlugins(),
|
|
297
|
-
)
|
|
298
|
-
: undefined;
|
|
299
|
-
const typeDetails = consumer
|
|
300
|
-
? getOrganizationalScopeTypeDetails(
|
|
301
|
-
consumer,
|
|
302
|
-
dashboardState.lakehouseEntitlementsStore.applicationStore.pluginManager.getApplicationPlugins(),
|
|
303
|
-
)
|
|
304
|
-
: undefined;
|
|
305
|
-
return (
|
|
306
|
-
<>
|
|
307
|
-
{typeName ?? 'Unknown'}
|
|
308
|
-
{typeDetails !== undefined && (
|
|
309
|
-
<Tooltip
|
|
310
|
-
className="marketplace-lakehouse-entitlements__grid__consumer-type__tooltip__icon"
|
|
311
|
-
title={typeDetails}
|
|
312
|
-
>
|
|
313
|
-
<InfoCircleIcon />
|
|
314
|
-
</Tooltip>
|
|
315
|
-
)}
|
|
316
|
-
</>
|
|
317
|
-
);
|
|
318
|
-
},
|
|
319
|
-
},
|
|
320
|
-
{
|
|
321
|
-
headerName: 'Target User(s)',
|
|
322
|
-
colId: 'targetUser',
|
|
323
|
-
cellRenderer: (
|
|
324
|
-
params: DataGridCellRendererParams<V1_LiteDataContract>,
|
|
325
|
-
) => (
|
|
326
|
-
<TargetUserCellRenderer
|
|
327
|
-
dataContract={params.data}
|
|
328
|
-
entitlementsStore={dashboardState.lakehouseEntitlementsStore}
|
|
329
|
-
token={auth.user?.access_token}
|
|
330
|
-
/>
|
|
331
|
-
),
|
|
332
|
-
},
|
|
333
|
-
{
|
|
334
|
-
headerName: 'Requester',
|
|
335
|
-
colId: 'requester',
|
|
336
|
-
cellRenderer: (
|
|
337
|
-
params: DataGridCellRendererParams<V1_LiteDataContract>,
|
|
338
|
-
) => {
|
|
339
|
-
const requester = params.data?.createdBy;
|
|
340
|
-
return requester ? (
|
|
341
|
-
<UserRenderer
|
|
342
|
-
userId={requester}
|
|
343
|
-
applicationStore={marketplaceBaseStore.applicationStore}
|
|
344
|
-
userSearchService={marketplaceBaseStore.userSearchService}
|
|
345
|
-
className="marketplace-lakehouse-entitlements__grid__user-display"
|
|
346
|
-
/>
|
|
347
|
-
) : (
|
|
348
|
-
<>Unknown</>
|
|
349
|
-
);
|
|
350
|
-
},
|
|
351
|
-
},
|
|
352
|
-
{
|
|
353
|
-
headerName: 'Target Data Product',
|
|
354
|
-
valueGetter: (params) => {
|
|
355
|
-
return params.data?.resourceId ?? 'Unknown';
|
|
356
|
-
},
|
|
357
|
-
},
|
|
358
|
-
{
|
|
359
|
-
headerName: 'Target Access Point Group',
|
|
360
|
-
valueGetter: (params) => {
|
|
361
|
-
const accessPointGroup =
|
|
362
|
-
params.data?.resourceType === V1_ResourceType.ACCESS_POINT_GROUP
|
|
363
|
-
? params.data.accessPointGroup
|
|
364
|
-
: `${params.data?.accessPointGroup ?? 'Unknown'} (${params.data?.resourceType ?? 'Unknown Type'})`;
|
|
365
|
-
return accessPointGroup ?? 'Unknown';
|
|
366
|
-
},
|
|
367
|
-
},
|
|
146
|
+
...getCommonEntitlementsColDefs(dashboardState),
|
|
368
147
|
{
|
|
369
148
|
headerName: 'State',
|
|
370
149
|
valueGetter: (params) => {
|
|
371
|
-
const state = params.data?.state;
|
|
150
|
+
const state = params.data?.contractResultLite.state;
|
|
372
151
|
switch (state) {
|
|
373
152
|
case V1_ContractState.PENDING_DATA_OWNER_APPROVAL:
|
|
374
153
|
return 'Data Owner Approval';
|
|
@@ -381,35 +160,36 @@ export const EntitlementsPendingContractsDashboard = observer(
|
|
|
381
160
|
},
|
|
382
161
|
{
|
|
383
162
|
headerName: 'Business Justification',
|
|
384
|
-
valueGetter: (p) => p.data?.description,
|
|
163
|
+
valueGetter: (p) => p.data?.contractResultLite.description,
|
|
385
164
|
},
|
|
386
165
|
{
|
|
387
166
|
headerName: 'Assignees',
|
|
388
167
|
colId: 'assignees',
|
|
168
|
+
valueGetter: (params) => {
|
|
169
|
+
const assignees =
|
|
170
|
+
(params.data instanceof V1_LiteDataContractWithUserStatus
|
|
171
|
+
? params.data.pendingTaskWithAssignees?.assignees.toSorted()
|
|
172
|
+
: params.data?.sortedAssigneeIds) ?? [];
|
|
173
|
+
return assignees.length > 0 ? assignees.join(', ') : 'Unknown';
|
|
174
|
+
},
|
|
389
175
|
cellRenderer: (
|
|
390
|
-
params: DataGridCellRendererParams<
|
|
176
|
+
params: DataGridCellRendererParams<
|
|
177
|
+
V1_LiteDataContractWithUserStatus | ContractCreatedByUserDetails
|
|
178
|
+
>,
|
|
391
179
|
) => (
|
|
392
180
|
<AssigneesCellRenderer
|
|
393
181
|
dataContract={params.data}
|
|
394
|
-
pendingContractRecords={pendingContracts}
|
|
395
182
|
entitlementsStore={dashboardState.lakehouseEntitlementsStore}
|
|
396
|
-
token={auth.user?.access_token}
|
|
397
183
|
/>
|
|
398
184
|
),
|
|
399
185
|
},
|
|
400
186
|
{
|
|
401
187
|
hide: true,
|
|
402
188
|
headerName: 'Contract ID',
|
|
403
|
-
valueGetter: (p) => p.data?.guid,
|
|
189
|
+
valueGetter: (p) => p.data?.contractResultLite.guid,
|
|
404
190
|
},
|
|
405
191
|
],
|
|
406
|
-
[
|
|
407
|
-
auth.user?.access_token,
|
|
408
|
-
dashboardState.lakehouseEntitlementsStore,
|
|
409
|
-
marketplaceBaseStore.applicationStore,
|
|
410
|
-
marketplaceBaseStore.userSearchService,
|
|
411
|
-
pendingContracts,
|
|
412
|
-
],
|
|
192
|
+
[dashboardState],
|
|
413
193
|
);
|
|
414
194
|
|
|
415
195
|
const gridRowData = useMemo(
|
|
@@ -422,17 +202,30 @@ export const EntitlementsPendingContractsDashboard = observer(
|
|
|
422
202
|
|
|
423
203
|
return (
|
|
424
204
|
<Box className="marketplace-lakehouse-entitlements__pending-contracts">
|
|
425
|
-
<
|
|
205
|
+
<FormGroup className="marketplace-lakehouse-entitlements__pending-contracts__action-btns">
|
|
426
206
|
<FormControlLabel
|
|
427
207
|
control={
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
208
|
+
dashboardState.fetchingContractsByUserState.isInProgress ? (
|
|
209
|
+
<Box className="marketplace-lakehouse-entitlements__pending-contracts__action-btn--loading">
|
|
210
|
+
<CircularProgress size={20} />
|
|
211
|
+
</Box>
|
|
212
|
+
) : (
|
|
213
|
+
<Switch
|
|
214
|
+
checked={showForOthers}
|
|
215
|
+
onChange={(event) => setShowForOthers(event.target.checked)}
|
|
216
|
+
/>
|
|
217
|
+
)
|
|
432
218
|
}
|
|
433
219
|
label="Show my requests for others"
|
|
220
|
+
title={
|
|
221
|
+
dashboardState.fetchingContractsByUserState.isInProgress
|
|
222
|
+
? 'Loading requests for others'
|
|
223
|
+
: undefined
|
|
224
|
+
}
|
|
225
|
+
disabled={dashboardState.fetchingContractsByUserState.isInProgress}
|
|
226
|
+
className="marketplace-lakehouse-entitlements__pending-contracts__action-btn"
|
|
434
227
|
/>
|
|
435
|
-
</
|
|
228
|
+
</FormGroup>
|
|
436
229
|
<Box className="marketplace-lakehouse-entitlements__pending-contracts__grid ag-theme-balham">
|
|
437
230
|
<DataGrid
|
|
438
231
|
rowData={gridRowData}
|
|
@@ -446,7 +239,7 @@ export const EntitlementsPendingContractsDashboard = observer(
|
|
|
446
239
|
defaultColDef={defaultColDef}
|
|
447
240
|
rowHeight={45}
|
|
448
241
|
overlayNoRowsTemplate="You have no pending contracts"
|
|
449
|
-
loading={dashboardState.
|
|
242
|
+
loading={dashboardState.fetchingContractsForUserState.isInProgress}
|
|
450
243
|
overlayLoadingTemplate="Loading contracts"
|
|
451
244
|
/>
|
|
452
245
|
</Box>
|
|
@@ -475,9 +268,9 @@ export const EntitlementsPendingContractsDashboard = observer(
|
|
|
475
268
|
),
|
|
476
269
|
);
|
|
477
270
|
}}
|
|
478
|
-
getContractTaskUrl={(taskId: string) =>
|
|
271
|
+
getContractTaskUrl={(contractId: string, taskId: string) =>
|
|
479
272
|
marketplaceBaseStore.applicationStore.navigationService.navigator.generateAddress(
|
|
480
|
-
|
|
273
|
+
generateContractPagePath(contractId, taskId),
|
|
481
274
|
)
|
|
482
275
|
}
|
|
483
276
|
getDataProductUrl={(dataProductId: string, deploymentId: number) =>
|