@finos/legend-application-marketplace 0.1.54 → 0.1.56
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 +10 -0
- package/lib/__lib__/LegendMarketplaceTelemetryHelper.d.ts.map +1 -1
- package/lib/__lib__/LegendMarketplaceTelemetryHelper.js +55 -1
- package/lib/__lib__/LegendMarketplaceTelemetryHelper.js.map +1 -1
- package/lib/application/LegendMarketplaceWebApplication.d.ts.map +1 -1
- package/lib/application/LegendMarketplaceWebApplication.js +56 -17
- package/lib/application/LegendMarketplaceWebApplication.js.map +1 -1
- package/lib/application/providers/LegendMarketplaceFrameworkProvider.d.ts.map +1 -1
- package/lib/application/providers/LegendMarketplaceFrameworkProvider.js +4 -4
- package/lib/application/providers/LegendMarketplaceFrameworkProvider.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 +3 -0
- 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 +16 -6
- package/lib/pages/Lakehouse/entitlements/EntitlementsClosedContractsDashboard.js.map +1 -1
- package/lib/pages/Lakehouse/entitlements/EntitlementsPendingContractsDashboard.js +2 -2
- package/lib/pages/Lakehouse/entitlements/EntitlementsPendingContractsDashboard.js.map +1 -1
- package/lib/pages/Lakehouse/entitlements/EntitlementsPendingTasksDashboard.js +2 -2
- 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/package.json +10 -10
- package/src/__lib__/LegendMarketplaceAppEvent.ts +1 -0
- package/src/__lib__/LegendMarketplaceNavigation.ts +19 -3
- package/src/__lib__/LegendMarketplaceTelemetryHelper.ts +77 -1
- package/src/application/LegendMarketplaceWebApplication.tsx +128 -20
- package/src/application/providers/LegendMarketplaceFrameworkProvider.tsx +1 -5
- package/src/components/SearchBar/LegendMarketplaceSearchBar.tsx +7 -0
- package/src/pages/Lakehouse/MarketplaceLakehouseHome.tsx +4 -0
- package/src/pages/Lakehouse/admin/LakehouseAdminContractsDashboard.tsx +3 -3
- package/src/pages/Lakehouse/entitlements/EntitlementsClosedContractsDashboard.tsx +23 -9
- package/src/pages/Lakehouse/entitlements/EntitlementsPendingContractsDashboard.tsx +3 -3
- package/src/pages/Lakehouse/entitlements/EntitlementsPendingTasksDashboard.tsx +3 -3
- package/src/pages/Lakehouse/entitlements/LakehouseDataContract.tsx +284 -0
- package/src/stores/lakehouse/LegendMarketplaceProductViewerStore.ts +3 -3
- package/tsconfig.json +1 -0
|
@@ -19,9 +19,7 @@ import { guaranteeNonNullable } from '@finos/legend-shared';
|
|
|
19
19
|
import { useLocalObservable } from 'mobx-react-lite';
|
|
20
20
|
import {
|
|
21
21
|
ApplicationFrameworkProvider,
|
|
22
|
-
BlockingAlert,
|
|
23
22
|
useApplicationStore,
|
|
24
|
-
NotificationManager,
|
|
25
23
|
} from '@finos/legend-application';
|
|
26
24
|
import {
|
|
27
25
|
type LegendMarketplaceApplicationStore,
|
|
@@ -65,8 +63,8 @@ export const LegendMarketplaceFrameworkProvider: React.FC<{
|
|
|
65
63
|
children: React.ReactNode;
|
|
66
64
|
}> = ({ children }) => (
|
|
67
65
|
<ApplicationFrameworkProvider
|
|
68
|
-
simple={true}
|
|
69
66
|
enableTransitions={true}
|
|
67
|
+
disableVirtualAssistant={true}
|
|
70
68
|
customFonts={[
|
|
71
69
|
'"GS Sans"',
|
|
72
70
|
'Roboto',
|
|
@@ -76,8 +74,6 @@ export const LegendMarketplaceFrameworkProvider: React.FC<{
|
|
|
76
74
|
'sans-serif',
|
|
77
75
|
].join(',')}
|
|
78
76
|
>
|
|
79
|
-
<BlockingAlert />
|
|
80
|
-
<NotificationManager />
|
|
81
77
|
<LegendMarketplaceBaseStoreProvider>
|
|
82
78
|
{children}
|
|
83
79
|
</LegendMarketplaceBaseStoreProvider>
|
|
@@ -27,6 +27,8 @@ import {
|
|
|
27
27
|
import { clsx, SearchIcon, TuneIcon } from '@finos/legend-art';
|
|
28
28
|
import { observer } from 'mobx-react-lite';
|
|
29
29
|
import { LegendMarketplaceInfoTooltip } from '../InfoTooltip/LegendMarketplaceInfoTooltip.js';
|
|
30
|
+
import { LegendMarketplaceTelemetryHelper } from '../../__lib__/LegendMarketplaceTelemetryHelper.js';
|
|
31
|
+
import { useLegendMarketplaceBaseStore } from '../../application/providers/LegendMarketplaceFrameworkProvider.js';
|
|
30
32
|
|
|
31
33
|
export interface Vendor {
|
|
32
34
|
provider: string;
|
|
@@ -54,6 +56,7 @@ export const LegendMarketplaceSearchBar = observer(
|
|
|
54
56
|
initialUseProducerSearch,
|
|
55
57
|
} = props;
|
|
56
58
|
|
|
59
|
+
const applicationStore = useLegendMarketplaceBaseStore().applicationStore;
|
|
57
60
|
const [searchQuery, setSearchQuery] = useState<string>(initialValue ?? '');
|
|
58
61
|
const [useProducerSearch, setUseProducerSearch] = useState(
|
|
59
62
|
initialUseProducerSearch ?? false,
|
|
@@ -117,6 +120,10 @@ export const LegendMarketplaceSearchBar = observer(
|
|
|
117
120
|
checked={useProducerSearch}
|
|
118
121
|
onChange={(event) => {
|
|
119
122
|
setUseProducerSearch(event.target.checked);
|
|
123
|
+
LegendMarketplaceTelemetryHelper.logEvent_toggleProducerSearch(
|
|
124
|
+
applicationStore.telemetryService,
|
|
125
|
+
event.target.checked,
|
|
126
|
+
);
|
|
120
127
|
}}
|
|
121
128
|
/>
|
|
122
129
|
}
|
|
@@ -63,6 +63,10 @@ export const MarketplaceLakehouseHome = observer(() => {
|
|
|
63
63
|
>([]);
|
|
64
64
|
const [loading, setLoading] = useState(false);
|
|
65
65
|
|
|
66
|
+
useEffect(() => {
|
|
67
|
+
LegendMarketplaceTelemetryHelper.clearSearchSession();
|
|
68
|
+
}, []);
|
|
69
|
+
|
|
66
70
|
const [activeIndex, setActiveIndex] = useState(0);
|
|
67
71
|
useEffect(() => {
|
|
68
72
|
const loadDataProducts = async (): Promise<void> => {
|
|
@@ -35,8 +35,8 @@ import {
|
|
|
35
35
|
EntitlementsDataContractViewerState,
|
|
36
36
|
} from '@finos/legend-extension-dsl-data-product';
|
|
37
37
|
import {
|
|
38
|
+
generateContractPagePath,
|
|
38
39
|
generateLakehouseDataProductPath,
|
|
39
|
-
generateLakehouseTaskPath,
|
|
40
40
|
} from '../../../__lib__/LegendMarketplaceNavigation.js';
|
|
41
41
|
|
|
42
42
|
export const LakehouseAdminContractsDashboard = observer(
|
|
@@ -143,9 +143,9 @@ export const LakehouseAdminContractsDashboard = observer(
|
|
|
143
143
|
)
|
|
144
144
|
}
|
|
145
145
|
onRefresh={() => adminStore.refresh()}
|
|
146
|
-
getContractTaskUrl={(taskId: string) =>
|
|
146
|
+
getContractTaskUrl={(contractId: string, taskId: string) =>
|
|
147
147
|
adminStore.legendMarketplaceBaseStore.applicationStore.navigationService.navigator.generateAddress(
|
|
148
|
-
|
|
148
|
+
generateContractPagePath(contractId, taskId),
|
|
149
149
|
)
|
|
150
150
|
}
|
|
151
151
|
getDataProductUrl={(dataProductId: string, deploymentId: number) =>
|
|
@@ -56,8 +56,8 @@ import {
|
|
|
56
56
|
UserRenderer,
|
|
57
57
|
} from '@finos/legend-extension-dsl-data-product';
|
|
58
58
|
import {
|
|
59
|
+
generateContractPagePath,
|
|
59
60
|
generateLakehouseDataProductPath,
|
|
60
|
-
generateLakehouseTaskPath,
|
|
61
61
|
} from '../../../__lib__/LegendMarketplaceNavigation.js';
|
|
62
62
|
import type { LakehouseEntitlementsStore } from '../../../stores/lakehouse/entitlements/LakehouseEntitlementsStore.js';
|
|
63
63
|
import { flowResult } from 'mobx';
|
|
@@ -323,6 +323,25 @@ export const EntitlementsClosedContractsDashboard = observer(
|
|
|
323
323
|
[myClosedContracts, closedContractsForOthers, showForOthers],
|
|
324
324
|
);
|
|
325
325
|
|
|
326
|
+
const getInitialUserForViewer = (): string | undefined => {
|
|
327
|
+
const currentUser =
|
|
328
|
+
dashboardState.lakehouseEntitlementsStore.applicationStore
|
|
329
|
+
.identityService.currentUser;
|
|
330
|
+
if (selectedContract && myClosedContractIds.has(selectedContract.guid)) {
|
|
331
|
+
return currentUser;
|
|
332
|
+
}
|
|
333
|
+
if (
|
|
334
|
+
selectedContract &&
|
|
335
|
+
selectedContract.consumer instanceof V1_AdhocTeam &&
|
|
336
|
+
selectedContract.consumer.users.some(
|
|
337
|
+
(user) => user.name === currentUser,
|
|
338
|
+
)
|
|
339
|
+
) {
|
|
340
|
+
return currentUser;
|
|
341
|
+
}
|
|
342
|
+
return undefined;
|
|
343
|
+
};
|
|
344
|
+
|
|
326
345
|
return (
|
|
327
346
|
<Box className="marketplace-lakehouse-entitlements__completed-contracts">
|
|
328
347
|
<Box className="marketplace-lakehouse-entitlements__completed-contracts__action-btns">
|
|
@@ -375,12 +394,7 @@ export const EntitlementsClosedContractsDashboard = observer(
|
|
|
375
394
|
marketplaceBaseStore.userSearchService,
|
|
376
395
|
)
|
|
377
396
|
}
|
|
378
|
-
initialSelectedUser={
|
|
379
|
-
myClosedContractIds.has(selectedContract.guid)
|
|
380
|
-
? dashboardState.lakehouseEntitlementsStore.applicationStore
|
|
381
|
-
.identityService.currentUser
|
|
382
|
-
: undefined
|
|
383
|
-
}
|
|
397
|
+
initialSelectedUser={getInitialUserForViewer()}
|
|
384
398
|
onRefresh={async () => {
|
|
385
399
|
await flowResult(
|
|
386
400
|
dashboardState.updateContract(
|
|
@@ -389,9 +403,9 @@ export const EntitlementsClosedContractsDashboard = observer(
|
|
|
389
403
|
),
|
|
390
404
|
);
|
|
391
405
|
}}
|
|
392
|
-
getContractTaskUrl={(taskId: string) =>
|
|
406
|
+
getContractTaskUrl={(contractId: string, taskId: string) =>
|
|
393
407
|
marketplaceBaseStore.applicationStore.navigationService.navigator.generateAddress(
|
|
394
|
-
|
|
408
|
+
generateContractPagePath(contractId, taskId),
|
|
395
409
|
)
|
|
396
410
|
}
|
|
397
411
|
getDataProductUrl={(dataProductId: string, deploymentId: number) =>
|
|
@@ -55,7 +55,7 @@ import {
|
|
|
55
55
|
EntitlementsDataContractViewerState,
|
|
56
56
|
} from '@finos/legend-extension-dsl-data-product';
|
|
57
57
|
import {
|
|
58
|
-
|
|
58
|
+
generateContractPagePath,
|
|
59
59
|
generateLakehouseDataProductPath,
|
|
60
60
|
} from '../../../__lib__/LegendMarketplaceNavigation.js';
|
|
61
61
|
import type { LakehouseEntitlementsStore } from '../../../stores/lakehouse/entitlements/LakehouseEntitlementsStore.js';
|
|
@@ -475,9 +475,9 @@ export const EntitlementsPendingContractsDashboard = observer(
|
|
|
475
475
|
),
|
|
476
476
|
);
|
|
477
477
|
}}
|
|
478
|
-
getContractTaskUrl={(taskId: string) =>
|
|
478
|
+
getContractTaskUrl={(contractId: string, taskId: string) =>
|
|
479
479
|
marketplaceBaseStore.applicationStore.navigationService.navigator.generateAddress(
|
|
480
|
-
|
|
480
|
+
generateContractPagePath(contractId, taskId),
|
|
481
481
|
)
|
|
482
482
|
}
|
|
483
483
|
getDataProductUrl={(dataProductId: string, deploymentId: number) =>
|
|
@@ -69,7 +69,7 @@ import {
|
|
|
69
69
|
EntitlementsDataContractViewerState,
|
|
70
70
|
} from '@finos/legend-extension-dsl-data-product';
|
|
71
71
|
import {
|
|
72
|
-
|
|
72
|
+
generateContractPagePath,
|
|
73
73
|
generateLakehouseDataProductPath,
|
|
74
74
|
} from '../../../__lib__/LegendMarketplaceNavigation.js';
|
|
75
75
|
import {
|
|
@@ -855,9 +855,9 @@ export const EntitlementsPendingTasksDashboard = observer(
|
|
|
855
855
|
),
|
|
856
856
|
);
|
|
857
857
|
}}
|
|
858
|
-
getContractTaskUrl={(taskId: string) =>
|
|
858
|
+
getContractTaskUrl={(contractId: string, taskId: string) =>
|
|
859
859
|
marketplaceBaseStore.applicationStore.navigationService.navigator.generateAddress(
|
|
860
|
-
|
|
860
|
+
generateContractPagePath(contractId, taskId),
|
|
861
861
|
)
|
|
862
862
|
}
|
|
863
863
|
getDataProductUrl={(dataProductId: string, deploymentId: number) =>
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { observer } from 'mobx-react-lite';
|
|
18
|
+
import { withLegendMarketplaceProductViewerStore } from '../../../application/providers/LegendMarketplaceProductViewerStoreProvider.js';
|
|
19
|
+
import { useParams } from '@finos/legend-application/browser';
|
|
20
|
+
import {
|
|
21
|
+
generateContractPagePath,
|
|
22
|
+
generateLakehouseDataProductPath,
|
|
23
|
+
type LakehouseDataContractTaskPathParams,
|
|
24
|
+
LEGEND_MARKETPLACE_ROUTE_PATTERN_TOKEN,
|
|
25
|
+
} from '../../../__lib__/LegendMarketplaceNavigation.js';
|
|
26
|
+
import { assertErrorThrown, guaranteeNonNullable } from '@finos/legend-shared';
|
|
27
|
+
import { useAuth } from 'react-oidc-context';
|
|
28
|
+
import { LegendMarketplacePage } from '../../LegendMarketplacePage.js';
|
|
29
|
+
import {
|
|
30
|
+
EntitlementsDataContractContent,
|
|
31
|
+
EntitlementsDataContractViewerState,
|
|
32
|
+
} from '@finos/legend-extension-dsl-data-product';
|
|
33
|
+
import { useEffect, useState } from 'react';
|
|
34
|
+
import { useLegendMarketplaceBaseStore } from '../../../application/providers/LegendMarketplaceFrameworkProvider.js';
|
|
35
|
+
import {
|
|
36
|
+
GraphManagerState,
|
|
37
|
+
V1_dataContractsResponseModelSchema,
|
|
38
|
+
V1_TaskStatusChangeResponseModelSchema,
|
|
39
|
+
V1_transformDataContractToLiteDatacontract,
|
|
40
|
+
V1_UserApprovalStatus,
|
|
41
|
+
} from '@finos/legend-graph';
|
|
42
|
+
import { deserialize } from 'serializr';
|
|
43
|
+
import { Box, Button, Tooltip } from '@mui/material';
|
|
44
|
+
import {
|
|
45
|
+
CubesLoadingIndicator,
|
|
46
|
+
CubesLoadingIndicatorIcon,
|
|
47
|
+
} from '@finos/legend-art';
|
|
48
|
+
|
|
49
|
+
export const LakehouseDataContractTask =
|
|
50
|
+
withLegendMarketplaceProductViewerStore(
|
|
51
|
+
observer(() => {
|
|
52
|
+
const marketplaceBaseStore = useLegendMarketplaceBaseStore();
|
|
53
|
+
const params = useParams<LakehouseDataContractTaskPathParams>();
|
|
54
|
+
const auth = useAuth();
|
|
55
|
+
const currentUser =
|
|
56
|
+
marketplaceBaseStore.applicationStore.identityService.currentUser;
|
|
57
|
+
const [contractViewerState, setContractViewerState] = useState<
|
|
58
|
+
EntitlementsDataContractViewerState | undefined
|
|
59
|
+
>(undefined);
|
|
60
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
61
|
+
|
|
62
|
+
const contractId = guaranteeNonNullable(
|
|
63
|
+
params[LEGEND_MARKETPLACE_ROUTE_PATTERN_TOKEN.DATA_CONTRACT_ID],
|
|
64
|
+
);
|
|
65
|
+
const taskId = guaranteeNonNullable(
|
|
66
|
+
params[LEGEND_MARKETPLACE_ROUTE_PATTERN_TOKEN.DATA_CONTRACT_TASK_ID],
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
const associatedTask = contractViewerState?.associatedTasks?.find(
|
|
70
|
+
(task) => task.rec.taskId === taskId,
|
|
71
|
+
);
|
|
72
|
+
const isTaskPending =
|
|
73
|
+
associatedTask?.rec.status === V1_UserApprovalStatus.PENDING;
|
|
74
|
+
const userCanApprove =
|
|
75
|
+
isTaskPending && associatedTask.assignees.includes(currentUser);
|
|
76
|
+
const initialUser = associatedTask?.rec.consumer;
|
|
77
|
+
|
|
78
|
+
useEffect(() => {
|
|
79
|
+
const fetchAndInitializeContract = async () => {
|
|
80
|
+
try {
|
|
81
|
+
const rawContract =
|
|
82
|
+
await marketplaceBaseStore.lakehouseContractServerClient.getDataContract(
|
|
83
|
+
contractId,
|
|
84
|
+
false,
|
|
85
|
+
auth.user?.access_token,
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
const contractResponse = deserialize(
|
|
89
|
+
V1_dataContractsResponseModelSchema(
|
|
90
|
+
marketplaceBaseStore.applicationStore.pluginManager.getPureProtocolProcessorPlugins(),
|
|
91
|
+
),
|
|
92
|
+
rawContract,
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
const dataContracts = contractResponse.dataContracts;
|
|
96
|
+
if (dataContracts?.[0]?.dataContract) {
|
|
97
|
+
const dataContract = dataContracts[0]?.dataContract;
|
|
98
|
+
const liteDataContract =
|
|
99
|
+
V1_transformDataContractToLiteDatacontract(dataContract);
|
|
100
|
+
|
|
101
|
+
const viewerState = new EntitlementsDataContractViewerState(
|
|
102
|
+
liteDataContract,
|
|
103
|
+
undefined,
|
|
104
|
+
marketplaceBaseStore.applicationStore,
|
|
105
|
+
marketplaceBaseStore.lakehouseContractServerClient,
|
|
106
|
+
new GraphManagerState(
|
|
107
|
+
marketplaceBaseStore.applicationStore.pluginManager,
|
|
108
|
+
marketplaceBaseStore.applicationStore.logService,
|
|
109
|
+
),
|
|
110
|
+
marketplaceBaseStore.userSearchService,
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
setContractViewerState(viewerState);
|
|
114
|
+
}
|
|
115
|
+
} catch (error) {
|
|
116
|
+
assertErrorThrown(error);
|
|
117
|
+
marketplaceBaseStore.applicationStore.notificationService.notifyError(
|
|
118
|
+
`Error fetching contract: ${error.message}`,
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
// eslint-disable-next-line no-void
|
|
123
|
+
void fetchAndInitializeContract();
|
|
124
|
+
}, [contractId, auth.user?.access_token, marketplaceBaseStore]);
|
|
125
|
+
|
|
126
|
+
const handleRefresh = async (): Promise<void> => {
|
|
127
|
+
if (contractViewerState) {
|
|
128
|
+
contractViewerState.init(auth.user?.access_token);
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
const handleApprove = async () => {
|
|
133
|
+
const response =
|
|
134
|
+
await marketplaceBaseStore.lakehouseContractServerClient.approveTask(
|
|
135
|
+
taskId,
|
|
136
|
+
auth.user?.access_token,
|
|
137
|
+
);
|
|
138
|
+
const change = deserialize(
|
|
139
|
+
V1_TaskStatusChangeResponseModelSchema,
|
|
140
|
+
response,
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
if (change.errorMessage) {
|
|
144
|
+
throw new Error(`Unable to approve task: ${change.errorMessage}`);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
marketplaceBaseStore.applicationStore.notificationService.notifySuccess(
|
|
148
|
+
'Task has been approved',
|
|
149
|
+
);
|
|
150
|
+
|
|
151
|
+
await handleRefresh();
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
const handleDeny = async () => {
|
|
155
|
+
const response =
|
|
156
|
+
await marketplaceBaseStore.lakehouseContractServerClient.denyTask(
|
|
157
|
+
taskId,
|
|
158
|
+
auth.user?.access_token,
|
|
159
|
+
);
|
|
160
|
+
const change = deserialize(
|
|
161
|
+
V1_TaskStatusChangeResponseModelSchema,
|
|
162
|
+
response,
|
|
163
|
+
);
|
|
164
|
+
|
|
165
|
+
if (change.errorMessage) {
|
|
166
|
+
throw new Error(`Unable to deny task: ${change.errorMessage}`);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
marketplaceBaseStore.applicationStore.notificationService.notifySuccess(
|
|
170
|
+
'Task has been denied',
|
|
171
|
+
);
|
|
172
|
+
|
|
173
|
+
await handleRefresh();
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
const handleApproveClick = () => {
|
|
177
|
+
if (!isLoading) {
|
|
178
|
+
setIsLoading(true);
|
|
179
|
+
handleApprove()
|
|
180
|
+
.catch((error) => {
|
|
181
|
+
assertErrorThrown(error);
|
|
182
|
+
marketplaceBaseStore.applicationStore.notificationService.notifyError(
|
|
183
|
+
`Error approving task: ${error.message}`,
|
|
184
|
+
);
|
|
185
|
+
})
|
|
186
|
+
.finally(() => {
|
|
187
|
+
setIsLoading(false);
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
const handleDenyClick = () => {
|
|
193
|
+
if (!isLoading) {
|
|
194
|
+
setIsLoading(true);
|
|
195
|
+
handleDeny()
|
|
196
|
+
.catch((error) => {
|
|
197
|
+
assertErrorThrown(error);
|
|
198
|
+
marketplaceBaseStore.applicationStore.notificationService.notifyError(
|
|
199
|
+
`Error denying task: ${error.message}`,
|
|
200
|
+
);
|
|
201
|
+
})
|
|
202
|
+
.finally(() => {
|
|
203
|
+
setIsLoading(false);
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
return (
|
|
209
|
+
<LegendMarketplacePage className="marketplace-lakehouse-single-contract-viewer">
|
|
210
|
+
<CubesLoadingIndicator isLoading={isLoading}>
|
|
211
|
+
<CubesLoadingIndicatorIcon />
|
|
212
|
+
</CubesLoadingIndicator>
|
|
213
|
+
{contractViewerState && (
|
|
214
|
+
<div className="marketplace-lakehouse-single-contract-viewer__container">
|
|
215
|
+
{associatedTask !== undefined && (
|
|
216
|
+
<Box className="marketplace-lakehouse-single-contract-viewer__action-btns">
|
|
217
|
+
<Tooltip
|
|
218
|
+
className="marketplace-lakehouse-single-contract-viewer__tooltip__icon"
|
|
219
|
+
title={
|
|
220
|
+
!isTaskPending
|
|
221
|
+
? 'Task does not require review'
|
|
222
|
+
: userCanApprove
|
|
223
|
+
? ''
|
|
224
|
+
: 'You are not assigned to review this task'
|
|
225
|
+
}
|
|
226
|
+
>
|
|
227
|
+
<Button
|
|
228
|
+
variant="contained"
|
|
229
|
+
color="success"
|
|
230
|
+
onClick={handleApproveClick}
|
|
231
|
+
disabled={!userCanApprove || isLoading}
|
|
232
|
+
>
|
|
233
|
+
Approve Task
|
|
234
|
+
</Button>
|
|
235
|
+
</Tooltip>
|
|
236
|
+
<Tooltip
|
|
237
|
+
className="marketplace-lakehouse-single-contract-viewer__tooltip__icon"
|
|
238
|
+
title={
|
|
239
|
+
!isTaskPending
|
|
240
|
+
? 'Task does not require review'
|
|
241
|
+
: userCanApprove
|
|
242
|
+
? ''
|
|
243
|
+
: 'You are not assigned to review this task'
|
|
244
|
+
}
|
|
245
|
+
>
|
|
246
|
+
<Button
|
|
247
|
+
variant="contained"
|
|
248
|
+
color="error"
|
|
249
|
+
onClick={handleDenyClick}
|
|
250
|
+
disabled={!userCanApprove || isLoading}
|
|
251
|
+
>
|
|
252
|
+
Deny Task
|
|
253
|
+
</Button>
|
|
254
|
+
</Tooltip>
|
|
255
|
+
</Box>
|
|
256
|
+
)}
|
|
257
|
+
<EntitlementsDataContractContent
|
|
258
|
+
currentViewer={contractViewerState}
|
|
259
|
+
getContractTaskUrl={() =>
|
|
260
|
+
marketplaceBaseStore.applicationStore.navigationService.navigator.generateAddress(
|
|
261
|
+
generateContractPagePath(contractId, taskId),
|
|
262
|
+
)
|
|
263
|
+
}
|
|
264
|
+
getDataProductUrl={(
|
|
265
|
+
dataProductId: string,
|
|
266
|
+
deploymentId: number,
|
|
267
|
+
) =>
|
|
268
|
+
marketplaceBaseStore.applicationStore.navigationService.navigator.generateAddress(
|
|
269
|
+
generateLakehouseDataProductPath(
|
|
270
|
+
dataProductId,
|
|
271
|
+
deploymentId,
|
|
272
|
+
),
|
|
273
|
+
)
|
|
274
|
+
}
|
|
275
|
+
initialSelectedUser={initialUser}
|
|
276
|
+
onRefresh={handleRefresh}
|
|
277
|
+
isReadOnly={true}
|
|
278
|
+
/>
|
|
279
|
+
</div>
|
|
280
|
+
)}
|
|
281
|
+
</LegendMarketplacePage>
|
|
282
|
+
);
|
|
283
|
+
}),
|
|
284
|
+
);
|
|
@@ -73,7 +73,7 @@ import {
|
|
|
73
73
|
EXTERNAL_APPLICATION_NAVIGATION__generateDataSpaceQueryEditorUrl,
|
|
74
74
|
EXTERNAL_APPLICATION_NAVIGATION__generateStudioSDLCProjectViewUrl,
|
|
75
75
|
generateLakehouseDataProductPath,
|
|
76
|
-
|
|
76
|
+
generateContractPagePath,
|
|
77
77
|
} from '../../__lib__/LegendMarketplaceNavigation.js';
|
|
78
78
|
import {
|
|
79
79
|
DataSpaceViewerState,
|
|
@@ -418,9 +418,9 @@ export class LegendMarketplaceProductViewerStore {
|
|
|
418
418
|
this.marketplaceBaseStore.lakehouseIngestServerClient,
|
|
419
419
|
this.marketplaceBaseStore.applicationStore.pluginManager.getApplicationPlugins(),
|
|
420
420
|
{
|
|
421
|
-
getContractTaskUrl: (taskId: string) =>
|
|
421
|
+
getContractTaskUrl: (contractId: string, taskId: string) =>
|
|
422
422
|
this.marketplaceBaseStore.applicationStore.navigationService.navigator.generateAddress(
|
|
423
|
-
|
|
423
|
+
generateContractPagePath(contractId, taskId),
|
|
424
424
|
),
|
|
425
425
|
getDataProductUrl: (_dataProductId: string, _deploymentId: number) =>
|
|
426
426
|
this.marketplaceBaseStore.applicationStore.navigationService.navigator.generateAddress(
|
package/tsconfig.json
CHANGED
|
@@ -122,6 +122,7 @@
|
|
|
122
122
|
"./src/pages/Lakehouse/entitlements/EntitlementsClosedContractsDashboard.tsx",
|
|
123
123
|
"./src/pages/Lakehouse/entitlements/EntitlementsPendingContractsDashboard.tsx",
|
|
124
124
|
"./src/pages/Lakehouse/entitlements/EntitlementsPendingTasksDashboard.tsx",
|
|
125
|
+
"./src/pages/Lakehouse/entitlements/LakehouseDataContract.tsx",
|
|
125
126
|
"./src/pages/Lakehouse/entitlements/LakehouseEntitlements.tsx",
|
|
126
127
|
"./src/pages/Lakehouse/searchResults/LegendMarketplaceSearchResults.tsx",
|
|
127
128
|
"./src/pages/Profile/LegendMarketplaceSubscriptions.tsx",
|