@finos/legend-application-marketplace 0.1.56 → 0.1.58
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 +3 -1
- package/lib/__lib__/LegendMarketplaceAppEvent.d.ts.map +1 -1
- package/lib/__lib__/LegendMarketplaceAppEvent.js +2 -0
- package/lib/__lib__/LegendMarketplaceAppEvent.js.map +1 -1
- package/lib/__lib__/LegendMarketplaceTelemetryHelper.d.ts +13 -7
- package/lib/__lib__/LegendMarketplaceTelemetryHelper.d.ts.map +1 -1
- package/lib/__lib__/LegendMarketplaceTelemetryHelper.js +61 -19
- package/lib/__lib__/LegendMarketplaceTelemetryHelper.js.map +1 -1
- package/lib/components/Header/LegendMarketplaceIconToolbar.d.ts.map +1 -1
- package/lib/components/Header/LegendMarketplaceIconToolbar.js +34 -5
- package/lib/components/Header/LegendMarketplaceIconToolbar.js.map +1 -1
- package/lib/components/SearchBar/LegendMarketplaceSearchBar.js +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 +10 -21
- 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/LegendMarketplaceSearchResultsStore.d.ts.map +1 -1
- package/lib/stores/lakehouse/LegendMarketplaceSearchResultsStore.js +7 -1
- package/lib/stores/lakehouse/LegendMarketplaceSearchResultsStore.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 +2 -0
- package/src/__lib__/LegendMarketplaceTelemetryHelper.ts +75 -21
- package/src/components/Header/LegendMarketplaceIconToolbar.tsx +94 -5
- package/src/components/SearchBar/LegendMarketplaceSearchBar.tsx +1 -1
- package/src/pages/Lakehouse/MarketplaceLakehouseHome.tsx +12 -58
- 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/LegendMarketplaceSearchResultsStore.ts +13 -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 +1 -0
|
@@ -23,8 +23,6 @@ import { useAuth } from 'react-oidc-context';
|
|
|
23
23
|
import {
|
|
24
24
|
CubesLoadingIndicator,
|
|
25
25
|
CubesLoadingIndicatorIcon,
|
|
26
|
-
OpenNewTabIcon,
|
|
27
|
-
SimpleCalendarIcon,
|
|
28
26
|
} from '@finos/legend-art';
|
|
29
27
|
import { generateLakehouseSearchResultsRoute } from '../../__lib__/LegendMarketplaceNavigation.js';
|
|
30
28
|
import {
|
|
@@ -40,7 +38,6 @@ import {
|
|
|
40
38
|
LEGEND_MARKETPLACE_PAGE,
|
|
41
39
|
LegendMarketplaceTelemetryHelper,
|
|
42
40
|
} from '../../__lib__/LegendMarketplaceTelemetryHelper.js';
|
|
43
|
-
import { LEGEND_MARKETPLACE_APP_EVENT } from '../../__lib__/LegendMarketplaceAppEvent.js';
|
|
44
41
|
import type { ProductCardState } from '../../stores/lakehouse/dataProducts/ProductCardState.js';
|
|
45
42
|
import { generatePathForDataProductSearchResult } from '../../utils/SearchUtils.js';
|
|
46
43
|
import { logClickingDataProductCard } from '../../utils/LogUtils.js';
|
|
@@ -50,10 +47,6 @@ export const MarketplaceLakehouseHome = observer(() => {
|
|
|
50
47
|
const legendMarketplaceBaseStore = useLegendMarketplaceBaseStore();
|
|
51
48
|
const applicationStore = legendMarketplaceBaseStore.applicationStore;
|
|
52
49
|
const auth = useAuth();
|
|
53
|
-
const configOptions = applicationStore.config.options;
|
|
54
|
-
const showDevFeatures = configOptions.showDevFeatures;
|
|
55
|
-
const adjacentUrl = applicationStore.config.adjacentEnvUrl;
|
|
56
|
-
const adjacentEnvState = legendMarketplaceBaseStore.adjacentEnvState;
|
|
57
50
|
|
|
58
51
|
const isDarkMode =
|
|
59
52
|
!applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled;
|
|
@@ -64,7 +57,7 @@ export const MarketplaceLakehouseHome = observer(() => {
|
|
|
64
57
|
const [loading, setLoading] = useState(false);
|
|
65
58
|
|
|
66
59
|
useEffect(() => {
|
|
67
|
-
LegendMarketplaceTelemetryHelper.
|
|
60
|
+
LegendMarketplaceTelemetryHelper.clearSearchSessionId();
|
|
68
61
|
}, []);
|
|
69
62
|
|
|
70
63
|
const [activeIndex, setActiveIndex] = useState(0);
|
|
@@ -97,9 +90,16 @@ export const MarketplaceLakehouseHome = observer(() => {
|
|
|
97
90
|
setHighlightedDataProducts(dataProducts);
|
|
98
91
|
} catch (error) {
|
|
99
92
|
assertErrorThrown(error);
|
|
100
|
-
applicationStore.
|
|
101
|
-
|
|
102
|
-
|
|
93
|
+
if (applicationStore.config.options.showDevFeatures) {
|
|
94
|
+
applicationStore.notificationService.notifyError(
|
|
95
|
+
error,
|
|
96
|
+
`Can't load highlighted data products: ${error.name}\n${error.message}\n${error.cause}\n${error.stack}`,
|
|
97
|
+
);
|
|
98
|
+
} else {
|
|
99
|
+
applicationStore.notificationService.notifyError(
|
|
100
|
+
`Can't load highlighted data products: ${error.message}`,
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
103
|
} finally {
|
|
104
104
|
setLoading(false);
|
|
105
105
|
}
|
|
@@ -115,6 +115,7 @@ export const MarketplaceLakehouseHome = observer(() => {
|
|
|
115
115
|
applicationStore.notificationService,
|
|
116
116
|
applicationStore.pluginManager,
|
|
117
117
|
legendMarketplaceBaseStore,
|
|
118
|
+
applicationStore.config.options.showDevFeatures,
|
|
118
119
|
]);
|
|
119
120
|
|
|
120
121
|
const handleSearch = (
|
|
@@ -146,55 +147,8 @@ export const MarketplaceLakehouseHome = observer(() => {
|
|
|
146
147
|
return '';
|
|
147
148
|
};
|
|
148
149
|
|
|
149
|
-
const newsletterNavigation = (): void => {
|
|
150
|
-
applicationStore.navigationService.navigator.visitAddress(
|
|
151
|
-
applicationStore.config.options.newsletterUrl,
|
|
152
|
-
);
|
|
153
|
-
applicationStore.telemetryService.logEvent(
|
|
154
|
-
LEGEND_MARKETPLACE_APP_EVENT.CLICK_SUBSCRIBE_TO_NEWSLETTER,
|
|
155
|
-
{},
|
|
156
|
-
);
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
const visitAdjacentEnv = (): void => {
|
|
160
|
-
if (adjacentUrl) {
|
|
161
|
-
applicationStore.navigationService.navigator.visitAddress(adjacentUrl);
|
|
162
|
-
}
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
const handleShowDemo = (): void => {
|
|
166
|
-
legendMarketplaceBaseStore.setDemoModal(true);
|
|
167
|
-
};
|
|
168
|
-
|
|
169
150
|
return (
|
|
170
151
|
<LegendMarketplacePage className="marketplace-lakehouse-home">
|
|
171
|
-
<div className="legend-marketplace-home__button-group">
|
|
172
|
-
{showDevFeatures && (
|
|
173
|
-
<button
|
|
174
|
-
onClick={handleShowDemo}
|
|
175
|
-
className="legend-marketplace-home__button"
|
|
176
|
-
>
|
|
177
|
-
<SimpleCalendarIcon className="legend-marketplace-home__button__icon" />
|
|
178
|
-
Schedule a Demo
|
|
179
|
-
</button>
|
|
180
|
-
)}
|
|
181
|
-
{adjacentUrl && adjacentEnvState && (
|
|
182
|
-
<button
|
|
183
|
-
className="legend-marketplace-home__button"
|
|
184
|
-
onClick={visitAdjacentEnv}
|
|
185
|
-
>
|
|
186
|
-
<OpenNewTabIcon className="legend-marketplace-home__button__icon" />
|
|
187
|
-
{`${adjacentEnvState.label} Env`}
|
|
188
|
-
</button>
|
|
189
|
-
)}
|
|
190
|
-
<button
|
|
191
|
-
className="legend-marketplace-home__button"
|
|
192
|
-
onClick={newsletterNavigation}
|
|
193
|
-
>
|
|
194
|
-
<OpenNewTabIcon className="legend-marketplace-home__button__icon" />
|
|
195
|
-
Subscribe to our Newsletter
|
|
196
|
-
</button>
|
|
197
|
-
</div>
|
|
198
152
|
<Container className="marketplace-lakehouse-home__search-container">
|
|
199
153
|
<Box className="marketplace-lakehouse-home__search-container__logo">
|
|
200
154
|
<img
|
|
@@ -15,149 +15,70 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import {
|
|
18
|
-
type V1_ContractUserEventRecord,
|
|
19
|
-
type V1_EnrichedUserApprovalStatus,
|
|
20
18
|
type V1_LiteDataContract,
|
|
21
19
|
GraphManagerState,
|
|
22
20
|
V1_AdhocTeam,
|
|
23
|
-
|
|
24
|
-
V1_ResourceType,
|
|
21
|
+
V1_LiteDataContractWithUserStatus,
|
|
25
22
|
} from '@finos/legend-graph';
|
|
26
23
|
import {
|
|
27
24
|
DataGrid,
|
|
28
25
|
type DataGridCellClickedEvent,
|
|
29
|
-
type DataGridCellRendererParams,
|
|
30
26
|
type DataGridColumnDefinition,
|
|
31
27
|
} from '@finos/legend-lego/data-grid';
|
|
32
28
|
import {
|
|
33
29
|
Box,
|
|
34
30
|
CircularProgress,
|
|
35
31
|
FormControlLabel,
|
|
32
|
+
FormGroup,
|
|
36
33
|
Switch,
|
|
37
|
-
Tooltip,
|
|
38
34
|
} from '@mui/material';
|
|
39
|
-
import {
|
|
40
|
-
import type {
|
|
35
|
+
import { useMemo, useState } from 'react';
|
|
36
|
+
import type {
|
|
37
|
+
ContractCreatedByUserDetails,
|
|
38
|
+
EntitlementsDashboardState,
|
|
39
|
+
} from '../../../stores/lakehouse/entitlements/EntitlementsDashboardState.js';
|
|
41
40
|
import { useLegendMarketplaceBaseStore } from '../../../application/providers/LegendMarketplaceFrameworkProvider.js';
|
|
42
41
|
import { observer } from 'mobx-react-lite';
|
|
43
|
-
import { assertErrorThrown, lodashCapitalize } from '@finos/legend-shared';
|
|
44
42
|
import { useAuth } from 'react-oidc-context';
|
|
45
|
-
import { deserialize } from 'serializr';
|
|
46
|
-
import { InfoCircleIcon } from '@finos/legend-art';
|
|
47
43
|
import {
|
|
48
44
|
EntitlementsDataContractViewer,
|
|
49
45
|
EntitlementsDataContractViewerState,
|
|
50
|
-
getOrganizationalScopeTypeDetails,
|
|
51
|
-
getOrganizationalScopeTypeName,
|
|
52
46
|
isApprovalStatusTerminal,
|
|
53
47
|
isContractInTerminalState,
|
|
54
|
-
MultiUserRenderer,
|
|
55
|
-
stringifyOrganizationalScope,
|
|
56
|
-
UserRenderer,
|
|
57
48
|
} from '@finos/legend-extension-dsl-data-product';
|
|
58
49
|
import {
|
|
59
50
|
generateContractPagePath,
|
|
60
51
|
generateLakehouseDataProductPath,
|
|
61
52
|
} from '../../../__lib__/LegendMarketplaceNavigation.js';
|
|
62
|
-
import type { LakehouseEntitlementsStore } from '../../../stores/lakehouse/entitlements/LakehouseEntitlementsStore.js';
|
|
63
53
|
import { flowResult } from 'mobx';
|
|
64
|
-
|
|
65
|
-
const UserAccessStatusCellRenderer = (props: {
|
|
66
|
-
dataContract: V1_LiteDataContract | undefined;
|
|
67
|
-
entitlementsStore: LakehouseEntitlementsStore;
|
|
68
|
-
token: string | undefined;
|
|
69
|
-
}): React.ReactNode => {
|
|
70
|
-
const { dataContract, entitlementsStore, token } = props;
|
|
71
|
-
const [status, setStatus] = useState<
|
|
72
|
-
V1_EnrichedUserApprovalStatus | undefined
|
|
73
|
-
>(
|
|
74
|
-
dataContract
|
|
75
|
-
? entitlementsStore.contractIdToUserStatusMap.get(dataContract.guid)
|
|
76
|
-
: undefined,
|
|
77
|
-
);
|
|
78
|
-
const [loading, setLoading] = useState<boolean>(false);
|
|
79
|
-
|
|
80
|
-
useEffect(() => {
|
|
81
|
-
const fetchUserStatusByContractId = async (): Promise<void> => {
|
|
82
|
-
if (dataContract) {
|
|
83
|
-
setLoading(true);
|
|
84
|
-
try {
|
|
85
|
-
const rawUserStatus =
|
|
86
|
-
await entitlementsStore.lakehouseContractServerClient.getContractUserStatus(
|
|
87
|
-
dataContract.guid,
|
|
88
|
-
entitlementsStore.applicationStore.identityService.currentUser,
|
|
89
|
-
token,
|
|
90
|
-
);
|
|
91
|
-
const userStatus = deserialize(
|
|
92
|
-
V1_ContractUserStatusResponseModelSchema,
|
|
93
|
-
rawUserStatus,
|
|
94
|
-
).status;
|
|
95
|
-
setStatus(userStatus);
|
|
96
|
-
entitlementsStore.contractIdToUserStatusMap.set(
|
|
97
|
-
dataContract.guid,
|
|
98
|
-
userStatus,
|
|
99
|
-
);
|
|
100
|
-
} catch (error) {
|
|
101
|
-
assertErrorThrown(error);
|
|
102
|
-
entitlementsStore.applicationStore.notificationService.notifyError(
|
|
103
|
-
`Error fetching contract user access status: ${error.message}`,
|
|
104
|
-
);
|
|
105
|
-
} finally {
|
|
106
|
-
setLoading(false);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
if (status === undefined) {
|
|
112
|
-
// eslint-disable-next-line no-void
|
|
113
|
-
void fetchUserStatusByContractId();
|
|
114
|
-
}
|
|
115
|
-
}, [
|
|
116
|
-
dataContract,
|
|
117
|
-
entitlementsStore.applicationStore.identityService.currentUser,
|
|
118
|
-
entitlementsStore.applicationStore.notificationService,
|
|
119
|
-
entitlementsStore.contractIdToUserStatusMap,
|
|
120
|
-
entitlementsStore.lakehouseContractServerClient,
|
|
121
|
-
status,
|
|
122
|
-
token,
|
|
123
|
-
]);
|
|
124
|
-
|
|
125
|
-
return loading ? (
|
|
126
|
-
<CircularProgress size={20} />
|
|
127
|
-
) : (
|
|
128
|
-
lodashCapitalize(status ?? dataContract?.state ?? 'Unknown')
|
|
129
|
-
);
|
|
130
|
-
};
|
|
54
|
+
import { getCommonEntitlementsColDefs } from '../../../utils/EntitlementsUtils.js';
|
|
131
55
|
|
|
132
56
|
export const EntitlementsClosedContractsDashboard = observer(
|
|
133
57
|
(props: { dashboardState: EntitlementsDashboardState }): React.ReactNode => {
|
|
134
58
|
const { dashboardState } = props;
|
|
135
|
-
const {
|
|
59
|
+
const { allContractsForUser, allContractsCreatedByUser } = dashboardState;
|
|
136
60
|
const marketplaceBaseStore = useLegendMarketplaceBaseStore();
|
|
137
61
|
const auth = useAuth();
|
|
138
62
|
|
|
139
63
|
const myClosedContracts = useMemo(
|
|
140
64
|
() =>
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
[
|
|
65
|
+
allContractsForUser?.filter((contract) =>
|
|
66
|
+
isApprovalStatusTerminal(contract.status),
|
|
67
|
+
) ?? [],
|
|
68
|
+
[allContractsForUser],
|
|
145
69
|
);
|
|
146
70
|
const myClosedContractIds = useMemo(
|
|
147
|
-
() => new Set(myClosedContracts.map((c) => c.guid)),
|
|
71
|
+
() => new Set(myClosedContracts.map((c) => c.contractResultLite.guid)),
|
|
148
72
|
[myClosedContracts],
|
|
149
73
|
);
|
|
150
74
|
const closedContractsForOthers = useMemo(
|
|
151
75
|
() =>
|
|
152
|
-
|
|
76
|
+
allContractsCreatedByUser.filter(
|
|
153
77
|
(contract) =>
|
|
154
|
-
isContractInTerminalState(contract) &&
|
|
155
|
-
contract.
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
!myClosedContractIds.has(contract.guid),
|
|
159
|
-
) ?? [],
|
|
160
|
-
[allContracts, myClosedContractIds, dashboardState],
|
|
78
|
+
isContractInTerminalState(contract.contractResultLite) &&
|
|
79
|
+
!myClosedContractIds.has(contract.contractResultLite.guid),
|
|
80
|
+
),
|
|
81
|
+
[allContractsCreatedByUser, myClosedContractIds],
|
|
161
82
|
);
|
|
162
83
|
|
|
163
84
|
const [selectedContract, setSelectedContract] = useState<
|
|
@@ -168,151 +89,48 @@ export const EntitlementsClosedContractsDashboard = observer(
|
|
|
168
89
|
);
|
|
169
90
|
|
|
170
91
|
const handleCellClicked = async (
|
|
171
|
-
event: DataGridCellClickedEvent<
|
|
92
|
+
event: DataGridCellClickedEvent<
|
|
93
|
+
V1_LiteDataContractWithUserStatus | ContractCreatedByUserDetails
|
|
94
|
+
>,
|
|
172
95
|
) => {
|
|
173
|
-
|
|
174
|
-
event.colDef.colId !== 'targetUser' &&
|
|
175
|
-
event.colDef.colId !== 'requester' &&
|
|
176
|
-
event.colDef.colId !== 'actioner'
|
|
177
|
-
) {
|
|
178
|
-
setSelectedContract(event.data);
|
|
179
|
-
}
|
|
96
|
+
setSelectedContract(event.data?.contractResultLite);
|
|
180
97
|
};
|
|
181
98
|
|
|
182
|
-
const defaultColDef: DataGridColumnDefinition<
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
99
|
+
const defaultColDef: DataGridColumnDefinition<
|
|
100
|
+
V1_LiteDataContractWithUserStatus | ContractCreatedByUserDetails
|
|
101
|
+
> = useMemo(
|
|
102
|
+
() => ({
|
|
103
|
+
minWidth: 50,
|
|
104
|
+
sortable: true,
|
|
105
|
+
resizable: true,
|
|
106
|
+
flex: 1,
|
|
107
|
+
}),
|
|
108
|
+
[],
|
|
109
|
+
);
|
|
192
110
|
|
|
193
|
-
const colDefs: DataGridColumnDefinition<
|
|
111
|
+
const colDefs: DataGridColumnDefinition<
|
|
112
|
+
V1_LiteDataContractWithUserStatus | ContractCreatedByUserDetails
|
|
113
|
+
>[] = useMemo(
|
|
194
114
|
() => [
|
|
195
|
-
|
|
196
|
-
colId: 'consumerType',
|
|
197
|
-
headerName: 'Consumer Type',
|
|
198
|
-
cellRenderer: (
|
|
199
|
-
params: DataGridCellRendererParams<V1_ContractUserEventRecord>,
|
|
200
|
-
) => {
|
|
201
|
-
const consumer = params.data?.consumer;
|
|
202
|
-
const typeName = consumer
|
|
203
|
-
? getOrganizationalScopeTypeName(
|
|
204
|
-
consumer,
|
|
205
|
-
dashboardState.lakehouseEntitlementsStore.applicationStore.pluginManager.getApplicationPlugins(),
|
|
206
|
-
)
|
|
207
|
-
: undefined;
|
|
208
|
-
const typeDetails = consumer
|
|
209
|
-
? getOrganizationalScopeTypeDetails(
|
|
210
|
-
consumer,
|
|
211
|
-
dashboardState.lakehouseEntitlementsStore.applicationStore.pluginManager.getApplicationPlugins(),
|
|
212
|
-
)
|
|
213
|
-
: undefined;
|
|
214
|
-
return (
|
|
215
|
-
<>
|
|
216
|
-
{typeName ?? 'Unknown'}
|
|
217
|
-
{typeDetails !== undefined && (
|
|
218
|
-
<Tooltip
|
|
219
|
-
className="marketplace-lakehouse-entitlements__grid__consumer-type__tooltip__icon"
|
|
220
|
-
title={typeDetails}
|
|
221
|
-
>
|
|
222
|
-
<InfoCircleIcon />
|
|
223
|
-
</Tooltip>
|
|
224
|
-
)}
|
|
225
|
-
</>
|
|
226
|
-
);
|
|
227
|
-
},
|
|
228
|
-
},
|
|
229
|
-
{
|
|
230
|
-
headerName: 'Target User',
|
|
231
|
-
colId: 'targetUser',
|
|
232
|
-
cellRenderer: (
|
|
233
|
-
params: DataGridCellRendererParams<V1_LiteDataContract>,
|
|
234
|
-
) => {
|
|
235
|
-
const consumer = params.data?.consumer;
|
|
236
|
-
|
|
237
|
-
if (consumer instanceof V1_AdhocTeam) {
|
|
238
|
-
return (
|
|
239
|
-
<MultiUserRenderer
|
|
240
|
-
userIds={consumer.users.map((user) => user.name)}
|
|
241
|
-
applicationStore={marketplaceBaseStore.applicationStore}
|
|
242
|
-
userSearchService={marketplaceBaseStore.userSearchService}
|
|
243
|
-
singleUserClassName="marketplace-lakehouse-entitlements__grid__user-display"
|
|
244
|
-
/>
|
|
245
|
-
);
|
|
246
|
-
} else if (consumer) {
|
|
247
|
-
return <>{stringifyOrganizationalScope(consumer)}</>;
|
|
248
|
-
} else {
|
|
249
|
-
return <>Unknown</>;
|
|
250
|
-
}
|
|
251
|
-
},
|
|
252
|
-
},
|
|
253
|
-
{
|
|
254
|
-
headerName: 'Requester',
|
|
255
|
-
colId: 'requester',
|
|
256
|
-
cellRenderer: (
|
|
257
|
-
params: DataGridCellRendererParams<V1_LiteDataContract>,
|
|
258
|
-
) => {
|
|
259
|
-
const requester = params.data?.createdBy;
|
|
260
|
-
return requester ? (
|
|
261
|
-
<UserRenderer
|
|
262
|
-
userId={requester}
|
|
263
|
-
applicationStore={marketplaceBaseStore.applicationStore}
|
|
264
|
-
userSearchService={marketplaceBaseStore.userSearchService}
|
|
265
|
-
className="marketplace-lakehouse-entitlements__grid__user-display"
|
|
266
|
-
/>
|
|
267
|
-
) : (
|
|
268
|
-
<>Unknown</>
|
|
269
|
-
);
|
|
270
|
-
},
|
|
271
|
-
},
|
|
272
|
-
{
|
|
273
|
-
headerName: 'Target Data Product',
|
|
274
|
-
valueGetter: (params) => {
|
|
275
|
-
return params.data?.resourceId ?? 'Unknown';
|
|
276
|
-
},
|
|
277
|
-
},
|
|
278
|
-
{
|
|
279
|
-
headerName: 'Target Access Point Group',
|
|
280
|
-
valueGetter: (params) => {
|
|
281
|
-
const accessPointGroup =
|
|
282
|
-
params.data?.resourceType === V1_ResourceType.ACCESS_POINT_GROUP
|
|
283
|
-
? params.data.accessPointGroup
|
|
284
|
-
: `${params.data?.accessPointGroup ?? 'Unknown'} (${params.data?.resourceType ?? 'Unknown Type'})`;
|
|
285
|
-
return accessPointGroup ?? 'Unknown';
|
|
286
|
-
},
|
|
287
|
-
},
|
|
115
|
+
...getCommonEntitlementsColDefs(dashboardState),
|
|
288
116
|
{
|
|
289
117
|
headerName: 'State',
|
|
290
|
-
|
|
291
|
-
params
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
dataContract={params.data}
|
|
295
|
-
entitlementsStore={dashboardState.lakehouseEntitlementsStore}
|
|
296
|
-
token={auth.user?.access_token}
|
|
297
|
-
/>
|
|
298
|
-
),
|
|
118
|
+
valueGetter: (params) =>
|
|
119
|
+
params.data instanceof V1_LiteDataContractWithUserStatus
|
|
120
|
+
? params.data.status
|
|
121
|
+
: (params.data?.contractResultLite.state ?? 'Unknown'),
|
|
299
122
|
},
|
|
300
123
|
{
|
|
301
124
|
headerName: 'Business Justification',
|
|
302
|
-
valueGetter: (p) => p.data?.description,
|
|
125
|
+
valueGetter: (p) => p.data?.contractResultLite.description,
|
|
303
126
|
},
|
|
304
127
|
{
|
|
305
128
|
hide: true,
|
|
306
129
|
headerName: 'Contract ID',
|
|
307
|
-
valueGetter: (p) => p.data?.guid,
|
|
130
|
+
valueGetter: (p) => p.data?.contractResultLite.guid,
|
|
308
131
|
},
|
|
309
132
|
],
|
|
310
|
-
[
|
|
311
|
-
auth.user?.access_token,
|
|
312
|
-
dashboardState.lakehouseEntitlementsStore,
|
|
313
|
-
marketplaceBaseStore.applicationStore,
|
|
314
|
-
marketplaceBaseStore.userSearchService,
|
|
315
|
-
],
|
|
133
|
+
[dashboardState],
|
|
316
134
|
);
|
|
317
135
|
|
|
318
136
|
const gridRowData = useMemo(
|
|
@@ -344,17 +162,30 @@ export const EntitlementsClosedContractsDashboard = observer(
|
|
|
344
162
|
|
|
345
163
|
return (
|
|
346
164
|
<Box className="marketplace-lakehouse-entitlements__completed-contracts">
|
|
347
|
-
<
|
|
165
|
+
<FormGroup className="marketplace-lakehouse-entitlements__completed-contracts__action-btns">
|
|
348
166
|
<FormControlLabel
|
|
349
167
|
control={
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
168
|
+
dashboardState.fetchingContractsByUserState.isInProgress ? (
|
|
169
|
+
<Box className="marketplace-lakehouse-entitlements__pending-contracts__action-btn--loading">
|
|
170
|
+
<CircularProgress size={20} />
|
|
171
|
+
</Box>
|
|
172
|
+
) : (
|
|
173
|
+
<Switch
|
|
174
|
+
checked={showForOthers}
|
|
175
|
+
onChange={(event) => setShowForOthers(event.target.checked)}
|
|
176
|
+
/>
|
|
177
|
+
)
|
|
354
178
|
}
|
|
355
179
|
label="Show my requests for others"
|
|
180
|
+
title={
|
|
181
|
+
dashboardState.fetchingContractsByUserState.isInProgress
|
|
182
|
+
? 'Loading requests for others'
|
|
183
|
+
: undefined
|
|
184
|
+
}
|
|
185
|
+
disabled={dashboardState.fetchingContractsByUserState.isInProgress}
|
|
186
|
+
className="marketplace-lakehouse-entitlements__completed-contracts__action-btn"
|
|
356
187
|
/>
|
|
357
|
-
</
|
|
188
|
+
</FormGroup>
|
|
358
189
|
<Box className="marketplace-lakehouse-entitlements__completed-contracts__grid ag-theme-balham">
|
|
359
190
|
<DataGrid
|
|
360
191
|
rowData={gridRowData}
|
|
@@ -365,7 +196,9 @@ export const EntitlementsClosedContractsDashboard = observer(
|
|
|
365
196
|
suppressContextMenu={false}
|
|
366
197
|
columnDefs={colDefs}
|
|
367
198
|
onCellClicked={(
|
|
368
|
-
event: DataGridCellClickedEvent<
|
|
199
|
+
event: DataGridCellClickedEvent<
|
|
200
|
+
V1_LiteDataContractWithUserStatus | ContractCreatedByUserDetails
|
|
201
|
+
>,
|
|
369
202
|
) =>
|
|
370
203
|
// eslint-disable-next-line no-void
|
|
371
204
|
void handleCellClicked(event)
|
|
@@ -373,7 +206,7 @@ export const EntitlementsClosedContractsDashboard = observer(
|
|
|
373
206
|
defaultColDef={defaultColDef}
|
|
374
207
|
rowHeight={45}
|
|
375
208
|
overlayNoRowsTemplate="You have no closed contracts"
|
|
376
|
-
loading={dashboardState.
|
|
209
|
+
loading={dashboardState.fetchingContractsForUserState.isInProgress}
|
|
377
210
|
overlayLoadingTemplate="Loading contracts"
|
|
378
211
|
/>
|
|
379
212
|
</Box>
|