@finos/legend-application-marketplace 0.2.13 → 0.2.15
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 +2 -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/application/LegendMarketplaceApplicationConfig.d.ts +9 -0
- package/lib/application/LegendMarketplaceApplicationConfig.d.ts.map +1 -1
- package/lib/application/LegendMarketplaceApplicationConfig.js +40 -22
- package/lib/application/LegendMarketplaceApplicationConfig.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/application/__test-utils__/LegendMarketplaceApplicationTestUtils.d.ts.map +1 -1
- package/lib/application/__test-utils__/LegendMarketplaceApplicationTestUtils.js +7 -0
- package/lib/application/__test-utils__/LegendMarketplaceApplicationTestUtils.js.map +1 -1
- package/lib/application/providers/LegendMarketplaceAIChatStoreProvider.d.ts +21 -0
- package/lib/application/providers/LegendMarketplaceAIChatStoreProvider.d.ts.map +1 -0
- package/lib/application/providers/LegendMarketplaceAIChatStoreProvider.js +29 -0
- package/lib/application/providers/LegendMarketplaceAIChatStoreProvider.js.map +1 -0
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +1 -1
- package/lib/pages/Agents/LegendMarketplaceAgents.d.ts.map +1 -1
- package/lib/pages/Agents/LegendMarketplaceAgents.js +49 -17
- package/lib/pages/Agents/LegendMarketplaceAgents.js.map +1 -1
- package/lib/pages/Agents/MarketplaceAIChatView.d.ts +21 -0
- package/lib/pages/Agents/MarketplaceAIChatView.d.ts.map +1 -0
- package/lib/pages/Agents/MarketplaceAIChatView.js +141 -0
- package/lib/pages/Agents/MarketplaceAIChatView.js.map +1 -0
- package/lib/pages/Agents/MarketplaceAIInputBar.d.ts +22 -0
- package/lib/pages/Agents/MarketplaceAIInputBar.d.ts.map +1 -0
- package/lib/pages/Agents/MarketplaceAIInputBar.js +40 -0
- package/lib/pages/Agents/MarketplaceAIInputBar.js.map +1 -0
- package/lib/pages/Agents/MarketplaceAIProductAutosuggest.d.ts +25 -0
- package/lib/pages/Agents/MarketplaceAIProductAutosuggest.d.ts.map +1 -0
- package/lib/pages/Agents/MarketplaceAIProductAutosuggest.js +86 -0
- package/lib/pages/Agents/MarketplaceAIProductAutosuggest.js.map +1 -0
- package/lib/pages/Agents/MarketplaceAIProductCards.d.ts +23 -0
- package/lib/pages/Agents/MarketplaceAIProductCards.d.ts.map +1 -0
- package/lib/pages/Agents/MarketplaceAIProductCards.js +20 -0
- package/lib/pages/Agents/MarketplaceAIProductCards.js.map +1 -0
- package/lib/pages/Agents/MarketplaceAIScopeSelector.d.ts +19 -0
- package/lib/pages/Agents/MarketplaceAIScopeSelector.d.ts.map +1 -0
- package/lib/pages/Agents/MarketplaceAIScopeSelector.js +46 -0
- package/lib/pages/Agents/MarketplaceAIScopeSelector.js.map +1 -0
- package/lib/pages/Lakehouse/entitlements/EntitlementsClosedContractsDashboard.d.ts.map +1 -1
- package/lib/pages/Lakehouse/entitlements/EntitlementsClosedContractsDashboard.js +74 -63
- 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 +85 -69
- 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 +7 -11
- package/lib/pages/Lakehouse/entitlements/EntitlementsPendingTasksDashboard.js.map +1 -1
- package/lib/pages/Lakehouse/entitlements/PermitDataAccessRequest.d.ts +17 -0
- package/lib/pages/Lakehouse/entitlements/PermitDataAccessRequest.d.ts.map +1 -0
- package/lib/pages/Lakehouse/entitlements/PermitDataAccessRequest.js +126 -0
- package/lib/pages/Lakehouse/entitlements/PermitDataAccessRequest.js.map +1 -0
- package/lib/pages/Lakehouse/entitlements/WorkflowDataAccessRequest.d.ts.map +1 -1
- package/lib/pages/Lakehouse/entitlements/WorkflowDataAccessRequest.js +23 -65
- package/lib/pages/Lakehouse/entitlements/WorkflowDataAccessRequest.js.map +1 -1
- package/lib/pages/Lakehouse/entitlements/showTaskActionAlert.d.ts +29 -0
- package/lib/pages/Lakehouse/entitlements/showTaskActionAlert.d.ts.map +1 -0
- package/lib/pages/Lakehouse/entitlements/showTaskActionAlert.js +60 -0
- package/lib/pages/Lakehouse/entitlements/showTaskActionAlert.js.map +1 -0
- package/lib/pages/Lakehouse/searchResults/LegendMarketplaceSearchResults.d.ts.map +1 -1
- package/lib/pages/Lakehouse/searchResults/LegendMarketplaceSearchResults.js +3 -8
- package/lib/pages/Lakehouse/searchResults/LegendMarketplaceSearchResults.js.map +1 -1
- package/lib/stores/LegendMarketplaceBaseStore.d.ts +2 -1
- package/lib/stores/LegendMarketplaceBaseStore.d.ts.map +1 -1
- package/lib/stores/LegendMarketplaceBaseStore.js +8 -1
- package/lib/stores/LegendMarketplaceBaseStore.js.map +1 -1
- package/lib/stores/ai/LegendMarketplaceAIChatStore.d.ts +109 -0
- package/lib/stores/ai/LegendMarketplaceAIChatStore.d.ts.map +1 -0
- package/lib/stores/ai/LegendMarketplaceAIChatStore.js +1106 -0
- package/lib/stores/ai/LegendMarketplaceAIChatStore.js.map +1 -0
- package/lib/stores/lakehouse/LegendMarketplaceProductViewerStore.d.ts.map +1 -1
- package/lib/stores/lakehouse/LegendMarketplaceProductViewerStore.js +3 -2
- package/lib/stores/lakehouse/LegendMarketplaceProductViewerStore.js.map +1 -1
- package/lib/stores/lakehouse/dataProducts/ProductCardState.d.ts +1 -1
- package/lib/stores/lakehouse/dataProducts/ProductCardState.d.ts.map +1 -1
- package/lib/stores/lakehouse/dataProducts/ProductCardState.js +1 -2
- package/lib/stores/lakehouse/dataProducts/ProductCardState.js.map +1 -1
- package/lib/stores/lakehouse/entitlements/EntitlementsDashboardState.d.ts +30 -3
- package/lib/stores/lakehouse/entitlements/EntitlementsDashboardState.d.ts.map +1 -1
- package/lib/stores/lakehouse/entitlements/EntitlementsDashboardState.js +94 -16
- package/lib/stores/lakehouse/entitlements/EntitlementsDashboardState.js.map +1 -1
- package/lib/utils/EntitlementsUtils.d.ts +36 -2
- package/lib/utils/EntitlementsUtils.d.ts.map +1 -1
- package/lib/utils/EntitlementsUtils.js +225 -46
- package/lib/utils/EntitlementsUtils.js.map +1 -1
- package/lib/utils/SearchUtils.d.ts.map +1 -1
- package/lib/utils/SearchUtils.js +7 -4
- package/lib/utils/SearchUtils.js.map +1 -1
- package/package.json +10 -10
- package/src/__lib__/LegendMarketplaceNavigation.ts +11 -0
- package/src/application/LegendMarketplaceApplicationConfig.ts +62 -24
- package/src/application/LegendMarketplaceWebApplication.tsx +15 -0
- package/src/application/__test-utils__/LegendMarketplaceApplicationTestUtils.ts +7 -0
- package/src/application/providers/LegendMarketplaceAIChatStoreProvider.tsx +47 -0
- package/src/pages/Agents/LegendMarketplaceAgents.tsx +145 -23
- package/src/pages/Agents/MarketplaceAIChatView.tsx +555 -0
- package/src/pages/Agents/MarketplaceAIInputBar.tsx +91 -0
- package/src/pages/Agents/MarketplaceAIProductAutosuggest.tsx +181 -0
- package/src/pages/Agents/MarketplaceAIProductCards.tsx +111 -0
- package/src/pages/Agents/MarketplaceAIScopeSelector.tsx +84 -0
- package/src/pages/Lakehouse/entitlements/EntitlementsClosedContractsDashboard.tsx +131 -136
- package/src/pages/Lakehouse/entitlements/EntitlementsPendingContractsDashboard.tsx +158 -165
- package/src/pages/Lakehouse/entitlements/EntitlementsPendingTasksDashboard.tsx +12 -17
- package/src/pages/Lakehouse/entitlements/PermitDataAccessRequest.tsx +245 -0
- package/src/pages/Lakehouse/entitlements/WorkflowDataAccessRequest.tsx +25 -94
- package/src/pages/Lakehouse/entitlements/showTaskActionAlert.tsx +101 -0
- package/src/pages/Lakehouse/searchResults/LegendMarketplaceSearchResults.tsx +27 -31
- package/src/stores/LegendMarketplaceBaseStore.ts +12 -0
- package/src/stores/ai/LegendMarketplaceAIChatStore.ts +1720 -0
- package/src/stores/lakehouse/LegendMarketplaceProductViewerStore.ts +6 -0
- package/src/stores/lakehouse/dataProducts/ProductCardState.ts +3 -4
- package/src/stores/lakehouse/entitlements/EntitlementsDashboardState.ts +181 -48
- package/src/utils/EntitlementsUtils.tsx +341 -86
- package/src/utils/SearchUtils.tsx +7 -4
- package/tsconfig.json +9 -0
|
@@ -14,15 +14,9 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
18
|
-
GraphManagerState,
|
|
19
|
-
V1_ContractState,
|
|
20
|
-
type V1_LiteDataContract,
|
|
21
|
-
V1_LiteDataContractWithUserStatus,
|
|
22
|
-
} from '@finos/legend-graph';
|
|
17
|
+
import { V1_LiteDataContractWithUserStatus } from '@finos/legend-graph';
|
|
23
18
|
import {
|
|
24
19
|
DataGrid,
|
|
25
|
-
type DataGridCellClickedEvent,
|
|
26
20
|
type DataGridCellRendererParams,
|
|
27
21
|
type DataGridColumnDefinition,
|
|
28
22
|
} from '@finos/legend-lego/data-grid';
|
|
@@ -33,63 +27,84 @@ import {
|
|
|
33
27
|
FormGroup,
|
|
34
28
|
Switch,
|
|
35
29
|
} from '@mui/material';
|
|
36
|
-
import { useMemo, useState } from 'react';
|
|
37
|
-
import type {
|
|
38
|
-
ContractCreatedByUserDetails,
|
|
39
|
-
EntitlementsDashboardState,
|
|
40
|
-
} from '../../../stores/lakehouse/entitlements/EntitlementsDashboardState.js';
|
|
30
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
31
|
+
import type { EntitlementsDashboardState } from '../../../stores/lakehouse/entitlements/EntitlementsDashboardState.js';
|
|
41
32
|
import { useLegendMarketplaceBaseStore } from '../../../application/providers/LegendMarketplaceFrameworkProvider.js';
|
|
42
33
|
import { observer } from 'mobx-react-lite';
|
|
43
34
|
import { startCase } from '@finos/legend-shared';
|
|
44
35
|
import { useAuth } from 'react-oidc-context';
|
|
45
36
|
import {
|
|
37
|
+
type ContractErrorLayer,
|
|
46
38
|
MultiUserRenderer,
|
|
47
39
|
isContractInTerminalState,
|
|
48
40
|
DataAccessRequestViewer,
|
|
49
41
|
isApprovalStatusTerminal,
|
|
50
|
-
DataContractViewerState,
|
|
51
42
|
} from '@finos/legend-extension-dsl-data-product';
|
|
52
|
-
import {
|
|
53
|
-
generateContractPagePath,
|
|
54
|
-
generateLakehouseDataProductPath,
|
|
55
|
-
} from '../../../__lib__/LegendMarketplaceNavigation.js';
|
|
56
43
|
import type { LakehouseEntitlementsStore } from '../../../stores/lakehouse/entitlements/LakehouseEntitlementsStore.js';
|
|
57
44
|
import { flowResult } from 'mobx';
|
|
58
|
-
import {
|
|
45
|
+
import {
|
|
46
|
+
getCommonEntitlementsColDefs,
|
|
47
|
+
type EntitlementsRow,
|
|
48
|
+
getContractData,
|
|
49
|
+
getSelectedRowId,
|
|
50
|
+
getSelectedContractGuid,
|
|
51
|
+
getOpenTaskAssignees,
|
|
52
|
+
EntitlementsColumnHeader,
|
|
53
|
+
CONTRACT_STATE_DISPLAY_LABELS,
|
|
54
|
+
ENTITLEMENTS_DEFAULT_COL_DEF,
|
|
55
|
+
ROW_KIND_CONTRACT,
|
|
56
|
+
ROW_KIND_REQUEST,
|
|
57
|
+
TERMINAL_DATA_REQUEST_STATES,
|
|
58
|
+
UNKNOWN,
|
|
59
|
+
useSelectedViewerState,
|
|
60
|
+
useGetDataProductUrl,
|
|
61
|
+
} from '../../../utils/EntitlementsUtils.js';
|
|
59
62
|
|
|
60
|
-
const AssigneesCellRenderer = (
|
|
61
|
-
|
|
62
|
-
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
63
|
+
const AssigneesCellRenderer = observer(
|
|
64
|
+
(props: {
|
|
65
|
+
row: EntitlementsRow | undefined;
|
|
66
|
+
entitlementsStore: LakehouseEntitlementsStore;
|
|
67
|
+
}): React.ReactNode => {
|
|
68
|
+
const { row, entitlementsStore } = props;
|
|
69
|
+
if (!row) {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
68
72
|
|
|
69
|
-
|
|
70
|
-
(
|
|
71
|
-
|
|
72
|
-
|
|
73
|
+
let assignees: string[];
|
|
74
|
+
if (row.kind === ROW_KIND_CONTRACT) {
|
|
75
|
+
assignees =
|
|
76
|
+
(row.data instanceof V1_LiteDataContractWithUserStatus
|
|
77
|
+
? row.data.pendingTaskWithAssignees?.assignees.toSorted()
|
|
78
|
+
: row.data.sortedAssigneeIds) ?? [];
|
|
79
|
+
} else {
|
|
80
|
+
assignees = getOpenTaskAssignees(row.data);
|
|
81
|
+
}
|
|
73
82
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
83
|
+
return (
|
|
84
|
+
<MultiUserRenderer
|
|
85
|
+
userIds={assignees}
|
|
86
|
+
applicationStore={entitlementsStore.applicationStore}
|
|
87
|
+
userSearchService={
|
|
88
|
+
entitlementsStore.marketplaceBaseStore.userSearchService
|
|
89
|
+
}
|
|
90
|
+
disableOnClick={true}
|
|
91
|
+
singleUserClassName="marketplace-lakehouse-entitlements__grid__user-display"
|
|
92
|
+
/>
|
|
93
|
+
);
|
|
94
|
+
},
|
|
95
|
+
);
|
|
86
96
|
|
|
87
97
|
export const EntitlementsPendingContractsDashboard = observer(
|
|
88
98
|
(props: { dashboardState: EntitlementsDashboardState }): React.ReactNode => {
|
|
89
99
|
const { dashboardState } = props;
|
|
90
|
-
const {
|
|
100
|
+
const {
|
|
101
|
+
allContractsForUser,
|
|
102
|
+
allContractsCreatedByUser,
|
|
103
|
+
dataRequestsCreatedByUser,
|
|
104
|
+
} = dashboardState;
|
|
91
105
|
const marketplaceBaseStore = useLegendMarketplaceBaseStore();
|
|
92
106
|
const auth = useAuth();
|
|
107
|
+
const getDataProductUrl = useGetDataProductUrl();
|
|
93
108
|
|
|
94
109
|
const myPendingContracts = useMemo(
|
|
95
110
|
() =>
|
|
@@ -112,110 +127,110 @@ export const EntitlementsPendingContractsDashboard = observer(
|
|
|
112
127
|
[allContractsCreatedByUser, myPendingContractIds],
|
|
113
128
|
);
|
|
114
129
|
|
|
115
|
-
const
|
|
116
|
-
|
|
130
|
+
const pendingDataRequests = useMemo(
|
|
131
|
+
() =>
|
|
132
|
+
(dataRequestsCreatedByUser ?? []).filter(
|
|
133
|
+
(dr) => !TERMINAL_DATA_REQUEST_STATES.has(dr.dataRequest.state),
|
|
134
|
+
),
|
|
135
|
+
[dataRequestsCreatedByUser],
|
|
136
|
+
);
|
|
137
|
+
|
|
138
|
+
const [selectedRow, setSelectedRow] = useState<
|
|
139
|
+
EntitlementsRow | undefined
|
|
117
140
|
>();
|
|
118
|
-
const [
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
141
|
+
const [contractErrors, setContractErrors] = useState<
|
|
142
|
+
ContractErrorLayer | undefined
|
|
143
|
+
>(undefined);
|
|
144
|
+
|
|
145
|
+
const selectedRowId = getSelectedRowId(selectedRow);
|
|
146
|
+
const selectedViewerState = useSelectedViewerState(
|
|
147
|
+
selectedRow,
|
|
148
|
+
selectedRowId,
|
|
149
|
+
);
|
|
150
|
+
|
|
122
151
|
const [showForOthers, setShowForOthers] = useState<boolean>(
|
|
123
152
|
myPendingContracts.length === 0 && pendingContractsForOthers.length > 0,
|
|
124
153
|
);
|
|
125
154
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
if (contract !== undefined) {
|
|
135
|
-
setIngestVerificationInProgress(true);
|
|
136
|
-
const result = await flowResult(
|
|
137
|
-
dashboardState.getUnverifiedIngestDefinitions(
|
|
138
|
-
contract.guid,
|
|
139
|
-
auth.user?.access_token,
|
|
140
|
-
),
|
|
141
|
-
);
|
|
142
|
-
setUnverifiedIngestDefinitions(result);
|
|
143
|
-
setIngestVerificationInProgress(false);
|
|
155
|
+
useEffect(() => {
|
|
156
|
+
setContractErrors(undefined);
|
|
157
|
+
if (selectedRow?.kind === ROW_KIND_CONTRACT) {
|
|
158
|
+
const contract = selectedRow.data.contractResultLite;
|
|
159
|
+
dashboardState
|
|
160
|
+
.getContractErrors(contract.guid, auth.user?.access_token)
|
|
161
|
+
.then((result) => setContractErrors(result))
|
|
162
|
+
.catch(() => setContractErrors(undefined));
|
|
144
163
|
}
|
|
145
|
-
};
|
|
164
|
+
}, [selectedRow, auth.user?.access_token, dashboardState]);
|
|
146
165
|
|
|
147
|
-
const
|
|
148
|
-
V1_LiteDataContractWithUserStatus | ContractCreatedByUserDetails
|
|
149
|
-
> = useMemo(
|
|
150
|
-
() => ({
|
|
151
|
-
minWidth: 50,
|
|
152
|
-
sortable: true,
|
|
153
|
-
resizable: true,
|
|
154
|
-
flex: 1,
|
|
155
|
-
}),
|
|
156
|
-
[],
|
|
157
|
-
);
|
|
166
|
+
const selectedContractGuid = getSelectedContractGuid(selectedRow);
|
|
158
167
|
|
|
159
|
-
const colDefs: DataGridColumnDefinition<
|
|
160
|
-
V1_LiteDataContractWithUserStatus | ContractCreatedByUserDetails
|
|
161
|
-
>[] = useMemo(
|
|
168
|
+
const colDefs: DataGridColumnDefinition<EntitlementsRow>[] = useMemo(
|
|
162
169
|
() => [
|
|
163
170
|
...getCommonEntitlementsColDefs(dashboardState),
|
|
164
171
|
{
|
|
165
|
-
headerName:
|
|
172
|
+
headerName: EntitlementsColumnHeader.STATE,
|
|
166
173
|
valueGetter: (params) => {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
174
|
+
if (!params.data) {
|
|
175
|
+
return UNKNOWN;
|
|
176
|
+
}
|
|
177
|
+
if (params.data.kind === ROW_KIND_CONTRACT) {
|
|
178
|
+
const state = getContractData(params.data)?.state;
|
|
179
|
+
return state
|
|
180
|
+
? (CONTRACT_STATE_DISPLAY_LABELS[state] ?? startCase(state))
|
|
181
|
+
: UNKNOWN;
|
|
175
182
|
}
|
|
183
|
+
return startCase(params.data.data.dataRequest.state);
|
|
176
184
|
},
|
|
177
185
|
},
|
|
178
186
|
{
|
|
179
|
-
headerName:
|
|
180
|
-
valueGetter: (p) => p.data?.contractResultLite.description,
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
headerName: 'Assignees',
|
|
187
|
+
headerName: EntitlementsColumnHeader.ASSIGNEES,
|
|
184
188
|
colId: 'assignees',
|
|
185
189
|
valueGetter: (params) => {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
190
|
+
if (!params.data) {
|
|
191
|
+
return UNKNOWN;
|
|
192
|
+
}
|
|
193
|
+
if (params.data.kind === ROW_KIND_CONTRACT) {
|
|
194
|
+
const assignees =
|
|
195
|
+
(params.data.data instanceof V1_LiteDataContractWithUserStatus
|
|
196
|
+
? params.data.data.pendingTaskWithAssignees?.assignees.toSorted()
|
|
197
|
+
: params.data.data.sortedAssigneeIds) ?? [];
|
|
198
|
+
return assignees.length > 0 ? assignees.join(', ') : UNKNOWN;
|
|
199
|
+
}
|
|
200
|
+
const openAssignees = getOpenTaskAssignees(params.data.data);
|
|
201
|
+
return openAssignees.length > 0 ? openAssignees.join(', ') : 'None';
|
|
191
202
|
},
|
|
192
203
|
cellRenderer: (
|
|
193
|
-
params: DataGridCellRendererParams<
|
|
194
|
-
V1_LiteDataContractWithUserStatus | ContractCreatedByUserDetails
|
|
195
|
-
>,
|
|
204
|
+
params: DataGridCellRendererParams<EntitlementsRow>,
|
|
196
205
|
) => (
|
|
197
206
|
<AssigneesCellRenderer
|
|
198
|
-
|
|
207
|
+
row={params.data}
|
|
199
208
|
entitlementsStore={dashboardState.lakehouseEntitlementsStore}
|
|
200
209
|
/>
|
|
201
210
|
),
|
|
202
211
|
},
|
|
203
|
-
{
|
|
204
|
-
hide: true,
|
|
205
|
-
headerName: 'Contract ID',
|
|
206
|
-
valueGetter: (p) => p.data?.contractResultLite.guid,
|
|
207
|
-
},
|
|
208
212
|
],
|
|
209
213
|
[dashboardState],
|
|
210
214
|
);
|
|
211
215
|
|
|
212
|
-
const gridRowData = useMemo(
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
216
|
+
const gridRowData: EntitlementsRow[] = useMemo(() => {
|
|
217
|
+
const contracts = showForOthers
|
|
218
|
+
? [...myPendingContracts, ...pendingContractsForOthers]
|
|
219
|
+
: myPendingContracts;
|
|
220
|
+
return [
|
|
221
|
+
...contracts.map(
|
|
222
|
+
(c): EntitlementsRow => ({ kind: ROW_KIND_CONTRACT, data: c }),
|
|
223
|
+
),
|
|
224
|
+
...pendingDataRequests.map(
|
|
225
|
+
(r): EntitlementsRow => ({ kind: ROW_KIND_REQUEST, data: r }),
|
|
226
|
+
),
|
|
227
|
+
];
|
|
228
|
+
}, [
|
|
229
|
+
showForOthers,
|
|
230
|
+
myPendingContracts,
|
|
231
|
+
pendingContractsForOthers,
|
|
232
|
+
pendingDataRequests,
|
|
233
|
+
]);
|
|
219
234
|
|
|
220
235
|
return (
|
|
221
236
|
<Box className="marketplace-lakehouse-entitlements__pending-contracts">
|
|
@@ -252,61 +267,39 @@ export const EntitlementsPendingContractsDashboard = observer(
|
|
|
252
267
|
suppressFieldDotNotation={true}
|
|
253
268
|
suppressContextMenu={false}
|
|
254
269
|
columnDefs={colDefs}
|
|
255
|
-
onCellClicked={(
|
|
256
|
-
|
|
257
|
-
V1_LiteDataContractWithUserStatus | ContractCreatedByUserDetails
|
|
258
|
-
>,
|
|
259
|
-
) =>
|
|
260
|
-
// eslint-disable-next-line no-void
|
|
261
|
-
void handleCellClicked(event)
|
|
262
|
-
}
|
|
263
|
-
defaultColDef={defaultColDef}
|
|
270
|
+
onCellClicked={(event) => event.data && setSelectedRow(event.data)}
|
|
271
|
+
defaultColDef={ENTITLEMENTS_DEFAULT_COL_DEF}
|
|
264
272
|
rowHeight={45}
|
|
265
|
-
overlayNoRowsTemplate="You have no pending contracts"
|
|
266
|
-
loading={
|
|
267
|
-
|
|
273
|
+
overlayNoRowsTemplate="You have no pending contracts or data requests"
|
|
274
|
+
loading={
|
|
275
|
+
dashboardState.fetchingContractsForUserState.isInProgress ||
|
|
276
|
+
dashboardState.fetchingDataRequestsCreatedByUserState.isInProgress
|
|
277
|
+
}
|
|
278
|
+
overlayLoadingTemplate="Loading"
|
|
268
279
|
/>
|
|
269
280
|
</Box>
|
|
270
|
-
{
|
|
281
|
+
{selectedRow !== undefined && selectedViewerState !== undefined && (
|
|
271
282
|
<DataAccessRequestViewer
|
|
272
283
|
open={true}
|
|
273
284
|
onClose={() => {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
setIngestVerificationInProgress(false);
|
|
277
|
-
}}
|
|
278
|
-
unverifiedIngestDefinitions={unverifiedIngestDefinitions}
|
|
279
|
-
viewerState={
|
|
280
|
-
new DataContractViewerState(
|
|
281
|
-
selectedContract,
|
|
282
|
-
(contractId: string, taskId: string) =>
|
|
283
|
-
marketplaceBaseStore.applicationStore.navigationService.navigator.generateAddress(
|
|
284
|
-
generateContractPagePath(contractId, taskId),
|
|
285
|
-
),
|
|
286
|
-
undefined,
|
|
287
|
-
marketplaceBaseStore.applicationStore,
|
|
288
|
-
marketplaceBaseStore.lakehouseContractServerClient,
|
|
289
|
-
new GraphManagerState(
|
|
290
|
-
marketplaceBaseStore.applicationStore.pluginManager,
|
|
291
|
-
marketplaceBaseStore.applicationStore.logService,
|
|
292
|
-
),
|
|
293
|
-
marketplaceBaseStore.userSearchService,
|
|
294
|
-
)
|
|
295
|
-
}
|
|
296
|
-
onRefresh={async () => {
|
|
297
|
-
await flowResult(
|
|
298
|
-
dashboardState.updateContract(
|
|
299
|
-
selectedContract.guid,
|
|
300
|
-
auth.user?.access_token,
|
|
301
|
-
),
|
|
302
|
-
);
|
|
285
|
+
setSelectedRow(undefined);
|
|
286
|
+
setContractErrors(undefined);
|
|
303
287
|
}}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
288
|
+
contractErrors={contractErrors}
|
|
289
|
+
viewerState={selectedViewerState}
|
|
290
|
+
{...(selectedContractGuid
|
|
291
|
+
? {
|
|
292
|
+
onRefresh: async () => {
|
|
293
|
+
await flowResult(
|
|
294
|
+
dashboardState.updateContract(
|
|
295
|
+
selectedContractGuid,
|
|
296
|
+
auth.user?.access_token,
|
|
297
|
+
),
|
|
298
|
+
);
|
|
299
|
+
},
|
|
300
|
+
}
|
|
301
|
+
: {})}
|
|
302
|
+
getDataProductUrl={getDataProductUrl}
|
|
310
303
|
dataProductEnvironment={
|
|
311
304
|
marketplaceBaseStore.envState.lakehouseEnvironment
|
|
312
305
|
}
|
|
@@ -55,6 +55,7 @@ import { observer } from 'mobx-react-lite';
|
|
|
55
55
|
import type { LegendMarketplaceBaseStore } from '../../../stores/LegendMarketplaceBaseStore.js';
|
|
56
56
|
import { startCase } from '@finos/legend-shared';
|
|
57
57
|
import {
|
|
58
|
+
type ContractErrorLayer,
|
|
58
59
|
UserRenderer,
|
|
59
60
|
getOrganizationalScopeTypeName,
|
|
60
61
|
getOrganizationalScopeTypeDetails,
|
|
@@ -289,10 +290,9 @@ export const EntitlementsPendingTasksDashboard = observer(
|
|
|
289
290
|
>();
|
|
290
291
|
const [selectedContractTargetUser, setSelectedContractTargetUser] =
|
|
291
292
|
useState<string | undefined>();
|
|
292
|
-
const [
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
useState(false);
|
|
293
|
+
const [contractErrors, setContractErrors] = useState<
|
|
294
|
+
ContractErrorLayer | undefined
|
|
295
|
+
>(undefined);
|
|
296
296
|
|
|
297
297
|
const auth = useAuth();
|
|
298
298
|
|
|
@@ -322,17 +322,13 @@ export const EntitlementsPendingTasksDashboard = observer(
|
|
|
322
322
|
);
|
|
323
323
|
setSelectedContract(contract);
|
|
324
324
|
setSelectedContractTargetUser(event.data?.consumer);
|
|
325
|
-
|
|
325
|
+
setContractErrors(undefined);
|
|
326
326
|
if (contract !== undefined) {
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
contract.guid,
|
|
331
|
-
auth.user?.access_token,
|
|
332
|
-
),
|
|
327
|
+
const result = await dashboardState.getContractErrors(
|
|
328
|
+
contract.guid,
|
|
329
|
+
auth.user?.access_token,
|
|
333
330
|
);
|
|
334
|
-
|
|
335
|
-
setIngestVerificationInProgress(false);
|
|
331
|
+
setContractErrors(result);
|
|
336
332
|
}
|
|
337
333
|
}
|
|
338
334
|
};
|
|
@@ -859,15 +855,14 @@ export const EntitlementsPendingTasksDashboard = observer(
|
|
|
859
855
|
pendingTaskContracts={pendingTaskContracts}
|
|
860
856
|
marketplaceBaseStore={marketplaceBaseStore}
|
|
861
857
|
/>
|
|
862
|
-
{selectedContract !== undefined &&
|
|
858
|
+
{selectedContract !== undefined && (
|
|
863
859
|
<DataAccessRequestViewer
|
|
864
860
|
open={true}
|
|
865
861
|
onClose={() => {
|
|
866
862
|
setSelectedContract(undefined);
|
|
867
|
-
|
|
868
|
-
setIngestVerificationInProgress(false);
|
|
863
|
+
setContractErrors(undefined);
|
|
869
864
|
}}
|
|
870
|
-
|
|
865
|
+
contractErrors={contractErrors}
|
|
871
866
|
viewerState={
|
|
872
867
|
new DataContractViewerState(
|
|
873
868
|
selectedContract,
|