@finos/legend-application-marketplace 0.0.20 → 0.0.21
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 +10 -1
- package/lib/__lib__/LegendMarketplaceNavigation.js.map +1 -1
- package/lib/app.css +2 -2
- package/lib/app.css.map +1 -1
- package/lib/application/LegendMarketplaceApplicationConfig.d.ts +10 -0
- package/lib/application/LegendMarketplaceApplicationConfig.d.ts.map +1 -1
- package/lib/application/LegendMarketplaceApplicationConfig.js +10 -0
- package/lib/application/LegendMarketplaceApplicationConfig.js.map +1 -1
- package/lib/application/LegendMarketplaceWebApplication.d.ts.map +1 -1
- package/lib/application/LegendMarketplaceWebApplication.js +12 -9
- package/lib/application/LegendMarketplaceWebApplication.js.map +1 -1
- package/lib/components/DataProductCard/LegendMarketplaceDataProductSearchCard.d.ts.map +1 -1
- package/lib/components/DataProductCard/LegendMarketplaceDataProductSearchCard.js +6 -3
- package/lib/components/DataProductCard/LegendMarketplaceDataProductSearchCard.js.map +1 -1
- package/lib/components/DataProductCard/LegendMarketplaceLightDataProductCard.d.ts.map +1 -1
- package/lib/components/DataProductCard/LegendMarketplaceLightDataProductCard.js +9 -6
- package/lib/components/DataProductCard/LegendMarketplaceLightDataProductCard.js.map +1 -1
- package/lib/components/{Lakehouse/LakehouseHeader.d.ts → Header/MarketplaceLakehouseHeader.d.ts} +2 -2
- package/lib/components/Header/MarketplaceLakehouseHeader.d.ts.map +1 -0
- package/lib/components/{Lakehouse/LakehouseHeader.js → Header/MarketplaceLakehouseHeader.js} +3 -3
- package/lib/components/Header/MarketplaceLakehouseHeader.js.map +1 -0
- package/lib/components/MarketplaceCard/LegendMarketplaceCard.d.ts +25 -0
- package/lib/components/MarketplaceCard/LegendMarketplaceCard.d.ts.map +1 -0
- package/lib/components/MarketplaceCard/LegendMarketplaceCard.js +32 -0
- package/lib/components/MarketplaceCard/LegendMarketplaceCard.js.map +1 -0
- package/lib/components/ProviderCard/LegendMarketplaceProviderCard.d.ts.map +1 -1
- package/lib/components/ProviderCard/LegendMarketplaceProviderCard.js +6 -3
- package/lib/components/ProviderCard/LegendMarketplaceProviderCard.js.map +1 -1
- package/lib/components/__test-utils__/LegendMarketplaceStoreTestUtils.d.ts.map +1 -1
- package/lib/components/__test-utils__/LegendMarketplaceStoreTestUtils.js +3 -6
- package/lib/components/__test-utils__/LegendMarketplaceStoreTestUtils.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +2 -1
- package/lib/pages/Home/LegendMarketplaceHome.d.ts.map +1 -1
- package/lib/pages/Home/LegendMarketplaceHome.js +4 -4
- package/lib/pages/Home/LegendMarketplaceHome.js.map +1 -1
- package/lib/pages/Lakehouse/DataProductDataAccess.d.ts.map +1 -0
- package/lib/{components → pages}/Lakehouse/DataProductDataAccess.js +39 -6
- package/lib/pages/Lakehouse/DataProductDataAccess.js.map +1 -0
- package/lib/pages/Lakehouse/DataProductHolder.d.ts.map +1 -0
- package/lib/pages/Lakehouse/DataProductHolder.js.map +1 -0
- package/lib/pages/Lakehouse/DataProductViewer.d.ts.map +1 -0
- package/lib/pages/Lakehouse/DataProductViewer.js.map +1 -0
- package/lib/pages/Lakehouse/DataProductViewerActivityBar.d.ts.map +1 -0
- package/lib/pages/Lakehouse/DataProductViewerActivityBar.js.map +1 -0
- package/lib/pages/Lakehouse/DataProductWiki.d.ts.map +1 -0
- package/lib/pages/Lakehouse/DataProductWiki.js.map +1 -0
- package/lib/pages/Lakehouse/LakehouseDataProduct.d.ts.map +1 -0
- package/lib/{components → pages}/Lakehouse/LakehouseDataProduct.js +3 -3
- package/lib/pages/Lakehouse/LakehouseDataProduct.js.map +1 -0
- package/lib/{components/Lakehouse/LakehouseMarketplace.d.ts → pages/Lakehouse/MarketplaceLakehouseHome.d.ts} +2 -2
- package/lib/pages/Lakehouse/MarketplaceLakehouseHome.d.ts.map +1 -0
- package/lib/pages/Lakehouse/MarketplaceLakehouseHome.js +54 -0
- package/lib/pages/Lakehouse/MarketplaceLakehouseHome.js.map +1 -0
- package/lib/{components/Lakehouse/MarketLakehouseStoreProvider.d.ts → pages/Lakehouse/MarketplaceLakehouseStoreProvider.d.ts} +1 -1
- package/lib/pages/Lakehouse/MarketplaceLakehouseStoreProvider.d.ts.map +1 -0
- package/lib/{components/Lakehouse/MarketLakehouseStoreProvider.js → pages/Lakehouse/MarketplaceLakehouseStoreProvider.js} +1 -1
- package/lib/pages/Lakehouse/MarketplaceLakehouseStoreProvider.js.map +1 -0
- package/lib/pages/Lakehouse/entitlements/EntitlementsDashboard.d.ts +23 -0
- package/lib/pages/Lakehouse/entitlements/EntitlementsDashboard.d.ts.map +1 -0
- package/lib/{components/Lakehouse/entitlements/LakehouseEntitlements.js → pages/Lakehouse/entitlements/EntitlementsDashboard.js} +10 -86
- package/lib/pages/Lakehouse/entitlements/EntitlementsDashboard.js.map +1 -0
- package/lib/{components/Lakehouse/entitlements/DataContractCreator.d.ts → pages/Lakehouse/entitlements/EntitlementsDataContractCreator.d.ts} +1 -1
- package/lib/pages/Lakehouse/entitlements/EntitlementsDataContractCreator.d.ts.map +1 -0
- package/lib/{components/Lakehouse/entitlements/DataContractCreator.js → pages/Lakehouse/entitlements/EntitlementsDataContractCreator.js} +1 -1
- package/lib/pages/Lakehouse/entitlements/EntitlementsDataContractCreator.js.map +1 -0
- package/lib/pages/Lakehouse/entitlements/EntitlementsDataContractViewer.d.ts +22 -0
- package/lib/pages/Lakehouse/entitlements/EntitlementsDataContractViewer.d.ts.map +1 -0
- package/lib/pages/Lakehouse/entitlements/EntitlementsDataContractViewer.js +23 -0
- package/lib/pages/Lakehouse/entitlements/EntitlementsDataContractViewer.js.map +1 -0
- package/lib/pages/Lakehouse/entitlements/EntitlementsTaskViewer.d.ts +21 -0
- package/lib/pages/Lakehouse/entitlements/EntitlementsTaskViewer.d.ts.map +1 -0
- package/lib/pages/Lakehouse/entitlements/EntitlementsTaskViewer.js +32 -0
- package/lib/pages/Lakehouse/entitlements/EntitlementsTaskViewer.js.map +1 -0
- package/lib/pages/Lakehouse/entitlements/LakehouseEntitlements.d.ts +17 -0
- package/lib/pages/Lakehouse/entitlements/LakehouseEntitlements.d.ts.map +1 -0
- package/lib/pages/Lakehouse/entitlements/LakehouseEntitlements.js +55 -0
- package/lib/pages/Lakehouse/entitlements/LakehouseEntitlements.js.map +1 -0
- package/lib/pages/Lakehouse/entitlements/LakehouseEntitlementsStoreProvider.d.ts.map +1 -0
- package/lib/pages/Lakehouse/entitlements/LakehouseEntitlementsStoreProvider.js.map +1 -0
- package/lib/pages/Lakehouse/shared/GridItemViewer.d.ts +21 -0
- package/lib/pages/Lakehouse/shared/GridItemViewer.d.ts.map +1 -0
- package/lib/pages/Lakehouse/shared/GridItemViewer.js +46 -0
- package/lib/pages/Lakehouse/shared/GridItemViewer.js.map +1 -0
- package/lib/pages/Lakehouse/subscriptions/LakehouseSubscriptions.d.ts.map +1 -0
- package/lib/{components → pages}/Lakehouse/subscriptions/LakehouseSubscriptions.js +4 -6
- package/lib/pages/Lakehouse/subscriptions/LakehouseSubscriptions.js.map +1 -0
- package/lib/pages/Lakehouse/subscriptions/LakehouseSubscriptionsStoreProvider.d.ts.map +1 -0
- package/lib/pages/Lakehouse/subscriptions/LakehouseSubscriptionsStoreProvider.js.map +1 -0
- package/lib/pages/LegendMarketplacePage.d.ts +23 -0
- package/lib/pages/LegendMarketplacePage.d.ts.map +1 -0
- package/lib/pages/LegendMarketplacePage.js +23 -0
- package/lib/pages/LegendMarketplacePage.js.map +1 -0
- package/lib/pages/SearchResults/LegendMarketplaceSearchResults.d.ts.map +1 -1
- package/lib/pages/SearchResults/LegendMarketplaceSearchResults.js +13 -13
- package/lib/pages/SearchResults/LegendMarketplaceSearchResults.js.map +1 -1
- package/lib/pages/VendorData/LegendMarketplaceVendorData.d.ts.map +1 -1
- package/lib/pages/VendorData/LegendMarketplaceVendorData.js +6 -6
- package/lib/pages/VendorData/LegendMarketplaceVendorData.js.map +1 -1
- package/lib/stores/LakehouseContractServerClient.d.ts +3 -0
- package/lib/stores/LakehouseContractServerClient.d.ts.map +1 -1
- package/lib/stores/LakehouseContractServerClient.js +11 -0
- package/lib/stores/LakehouseContractServerClient.js.map +1 -1
- package/lib/stores/LegendMarketplaceBaseStore.d.ts +3 -0
- 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/lakehouse/LakehouseUtils.d.ts +29 -1
- package/lib/stores/lakehouse/LakehouseUtils.d.ts.map +1 -1
- package/lib/stores/lakehouse/LakehouseUtils.js +203 -1
- package/lib/stores/lakehouse/LakehouseUtils.js.map +1 -1
- package/lib/stores/lakehouse/entitlements/{LakehouseEntitlementsMainViewState.d.ts → EntitlementsDashboardState.d.ts} +2 -2
- package/lib/stores/lakehouse/entitlements/EntitlementsDashboardState.d.ts.map +1 -0
- package/lib/stores/lakehouse/entitlements/{LakehouseEntitlementsMainViewState.js → EntitlementsDashboardState.js} +12 -3
- package/lib/stores/lakehouse/entitlements/EntitlementsDashboardState.js.map +1 -0
- package/lib/stores/lakehouse/entitlements/{DataContractState.d.ts → EntitlementsDataContractViewerState.d.ts} +11 -8
- package/lib/stores/lakehouse/entitlements/EntitlementsDataContractViewerState.d.ts.map +1 -0
- package/lib/stores/lakehouse/entitlements/EntitlementsDataContractViewerState.js +65 -0
- package/lib/stores/lakehouse/entitlements/EntitlementsDataContractViewerState.js.map +1 -0
- package/lib/stores/lakehouse/entitlements/{DataContractTaskState.d.ts → EntitlementsTaskViewerState.d.ts} +12 -6
- package/lib/stores/lakehouse/entitlements/EntitlementsTaskViewerState.d.ts.map +1 -0
- package/lib/stores/lakehouse/entitlements/{DataContractTaskState.js → EntitlementsTaskViewerState.js} +39 -21
- package/lib/stores/lakehouse/entitlements/EntitlementsTaskViewerState.js.map +1 -0
- package/lib/stores/lakehouse/entitlements/LakehouseEntitlementsStore.d.ts +4 -5
- package/lib/stores/lakehouse/entitlements/LakehouseEntitlementsStore.d.ts.map +1 -1
- package/lib/stores/lakehouse/entitlements/LakehouseEntitlementsStore.js +30 -13
- package/lib/stores/lakehouse/entitlements/LakehouseEntitlementsStore.js.map +1 -1
- package/package.json +5 -4
- package/src/__lib__/LegendMarketplaceNavigation.ts +15 -1
- package/src/application/LegendMarketplaceApplicationConfig.ts +25 -0
- package/src/application/LegendMarketplaceWebApplication.tsx +32 -13
- package/src/components/DataProductCard/LegendMarketplaceDataProductSearchCard.tsx +41 -33
- package/src/components/DataProductCard/LegendMarketplaceLightDataProductCard.tsx +33 -36
- package/src/components/{Lakehouse/LakehouseHeader.tsx → Header/MarketplaceLakehouseHeader.tsx} +2 -2
- package/src/components/MarketplaceCard/LegendMarketplaceCard.tsx +98 -0
- package/src/components/ProviderCard/LegendMarketplaceProviderCard.tsx +47 -39
- package/src/components/__test-utils__/LegendMarketplaceStoreTestUtils.tsx +2 -14
- package/src/pages/Home/LegendMarketplaceHome.tsx +42 -51
- package/src/{components → pages}/Lakehouse/DataProductDataAccess.tsx +77 -7
- package/src/{components → pages}/Lakehouse/LakehouseDataProduct.tsx +14 -23
- package/src/pages/Lakehouse/MarketplaceLakehouseHome.tsx +167 -0
- package/src/{components/Lakehouse/entitlements/LakehouseEntitlements.tsx → pages/Lakehouse/entitlements/EntitlementsDashboard.tsx} +20 -247
- package/src/pages/Lakehouse/entitlements/EntitlementsDataContractViewer.tsx +33 -0
- package/src/pages/Lakehouse/entitlements/EntitlementsTaskViewer.tsx +73 -0
- package/src/pages/Lakehouse/entitlements/LakehouseEntitlements.tsx +82 -0
- package/src/pages/Lakehouse/shared/GridItemViewer.tsx +105 -0
- package/src/{components → pages}/Lakehouse/subscriptions/LakehouseSubscriptions.tsx +15 -27
- package/src/pages/LegendMarketplacePage.tsx +26 -0
- package/src/pages/SearchResults/LegendMarketplaceSearchResults.tsx +58 -65
- package/src/pages/VendorData/LegendMarketplaceVendorData.tsx +44 -42
- package/src/stores/LakehouseContractServerClient.ts +29 -0
- package/src/stores/LegendMarketplaceBaseStore.ts +16 -1
- package/src/stores/lakehouse/LakehouseUtils.ts +252 -0
- package/src/stores/lakehouse/entitlements/{LakehouseEntitlementsMainViewState.ts → EntitlementsDashboardState.ts} +19 -3
- package/src/stores/lakehouse/entitlements/EntitlementsDataContractViewerState.ts +101 -0
- package/src/stores/lakehouse/entitlements/{DataContractTaskState.ts → EntitlementsTaskViewerState.ts} +62 -24
- package/src/stores/lakehouse/entitlements/LakehouseEntitlementsStore.ts +44 -23
- package/tsconfig.json +23 -17
- package/lib/components/Lakehouse/DataProductDataAccess.d.ts.map +0 -1
- package/lib/components/Lakehouse/DataProductDataAccess.js.map +0 -1
- package/lib/components/Lakehouse/DataProductHolder.d.ts.map +0 -1
- package/lib/components/Lakehouse/DataProductHolder.js.map +0 -1
- package/lib/components/Lakehouse/DataProductViewer.d.ts.map +0 -1
- package/lib/components/Lakehouse/DataProductViewer.js.map +0 -1
- package/lib/components/Lakehouse/DataProductViewerActivityBar.d.ts.map +0 -1
- package/lib/components/Lakehouse/DataProductViewerActivityBar.js.map +0 -1
- package/lib/components/Lakehouse/DataProductWiki.d.ts.map +0 -1
- package/lib/components/Lakehouse/DataProductWiki.js.map +0 -1
- package/lib/components/Lakehouse/LakehouseDataProduct.d.ts.map +0 -1
- package/lib/components/Lakehouse/LakehouseDataProduct.js.map +0 -1
- package/lib/components/Lakehouse/LakehouseHeader.d.ts.map +0 -1
- package/lib/components/Lakehouse/LakehouseHeader.js.map +0 -1
- package/lib/components/Lakehouse/LakehouseMarketplace.d.ts.map +0 -1
- package/lib/components/Lakehouse/LakehouseMarketplace.js +0 -51
- package/lib/components/Lakehouse/LakehouseMarketplace.js.map +0 -1
- package/lib/components/Lakehouse/MarketLakehouseStoreProvider.d.ts.map +0 -1
- package/lib/components/Lakehouse/MarketLakehouseStoreProvider.js.map +0 -1
- package/lib/components/Lakehouse/entitlements/DataContractCreator.d.ts.map +0 -1
- package/lib/components/Lakehouse/entitlements/DataContractCreator.js.map +0 -1
- package/lib/components/Lakehouse/entitlements/LakehouseEntitlements.d.ts +0 -28
- package/lib/components/Lakehouse/entitlements/LakehouseEntitlements.d.ts.map +0 -1
- package/lib/components/Lakehouse/entitlements/LakehouseEntitlements.js.map +0 -1
- package/lib/components/Lakehouse/entitlements/LakehouseEntitlementsStoreProvider.d.ts.map +0 -1
- package/lib/components/Lakehouse/entitlements/LakehouseEntitlementsStoreProvider.js.map +0 -1
- package/lib/components/Lakehouse/subscriptions/LakehouseSubscriptions.d.ts.map +0 -1
- package/lib/components/Lakehouse/subscriptions/LakehouseSubscriptions.js.map +0 -1
- package/lib/components/Lakehouse/subscriptions/LakehouseSubscriptionsStoreProvider.d.ts.map +0 -1
- package/lib/components/Lakehouse/subscriptions/LakehouseSubscriptionsStoreProvider.js.map +0 -1
- package/lib/stores/lakehouse/entitlements/DataContractState.d.ts.map +0 -1
- package/lib/stores/lakehouse/entitlements/DataContractState.js +0 -127
- package/lib/stores/lakehouse/entitlements/DataContractState.js.map +0 -1
- package/lib/stores/lakehouse/entitlements/DataContractTaskState.d.ts.map +0 -1
- package/lib/stores/lakehouse/entitlements/DataContractTaskState.js.map +0 -1
- package/lib/stores/lakehouse/entitlements/LakehouseEntitlementsMainViewState.d.ts.map +0 -1
- package/lib/stores/lakehouse/entitlements/LakehouseEntitlementsMainViewState.js.map +0 -1
- package/src/components/Lakehouse/LakehouseMarketplace.tsx +0 -184
- package/src/stores/lakehouse/entitlements/DataContractState.ts +0 -142
- /package/lib/{components → pages}/Lakehouse/DataProductDataAccess.d.ts +0 -0
- /package/lib/{components → pages}/Lakehouse/DataProductHolder.d.ts +0 -0
- /package/lib/{components → pages}/Lakehouse/DataProductHolder.js +0 -0
- /package/lib/{components → pages}/Lakehouse/DataProductViewer.d.ts +0 -0
- /package/lib/{components → pages}/Lakehouse/DataProductViewer.js +0 -0
- /package/lib/{components → pages}/Lakehouse/DataProductViewerActivityBar.d.ts +0 -0
- /package/lib/{components → pages}/Lakehouse/DataProductViewerActivityBar.js +0 -0
- /package/lib/{components → pages}/Lakehouse/DataProductWiki.d.ts +0 -0
- /package/lib/{components → pages}/Lakehouse/DataProductWiki.js +0 -0
- /package/lib/{components → pages}/Lakehouse/LakehouseDataProduct.d.ts +0 -0
- /package/lib/{components → pages}/Lakehouse/entitlements/LakehouseEntitlementsStoreProvider.d.ts +0 -0
- /package/lib/{components → pages}/Lakehouse/entitlements/LakehouseEntitlementsStoreProvider.js +0 -0
- /package/lib/{components → pages}/Lakehouse/subscriptions/LakehouseSubscriptions.d.ts +0 -0
- /package/lib/{components → pages}/Lakehouse/subscriptions/LakehouseSubscriptionsStoreProvider.d.ts +0 -0
- /package/lib/{components → pages}/Lakehouse/subscriptions/LakehouseSubscriptionsStoreProvider.js +0 -0
- /package/src/{components → pages}/Lakehouse/DataProductHolder.tsx +0 -0
- /package/src/{components → pages}/Lakehouse/DataProductViewer.tsx +0 -0
- /package/src/{components → pages}/Lakehouse/DataProductViewerActivityBar.tsx +0 -0
- /package/src/{components → pages}/Lakehouse/DataProductWiki.tsx +0 -0
- /package/src/{components/Lakehouse/MarketLakehouseStoreProvider.tsx → pages/Lakehouse/MarketplaceLakehouseStoreProvider.tsx} +0 -0
- /package/src/{components/Lakehouse/entitlements/DataContractCreator.tsx → pages/Lakehouse/entitlements/EntitlementsDataContractCreator.tsx} +0 -0
- /package/src/{components → pages}/Lakehouse/entitlements/LakehouseEntitlementsStoreProvider.tsx +0 -0
- /package/src/{components → pages}/Lakehouse/subscriptions/LakehouseSubscriptionsStoreProvider.tsx +0 -0
|
@@ -18,11 +18,27 @@ import {
|
|
|
18
18
|
type V1_AccessPointGroup,
|
|
19
19
|
V1_AccessPointGroupReference,
|
|
20
20
|
V1_AdhocTeam,
|
|
21
|
+
V1_AppDirOrganizationalScope,
|
|
21
22
|
V1_ContractState,
|
|
23
|
+
type V1_ContractUserEventRecord,
|
|
22
24
|
type V1_DataContract,
|
|
23
25
|
type V1_DataProduct,
|
|
26
|
+
V1_UserApprovalStatus,
|
|
24
27
|
} from '@finos/legend-graph';
|
|
28
|
+
import { prettyCONSTName } from '@finos/legend-shared';
|
|
25
29
|
|
|
30
|
+
export enum GridTiemStatus {
|
|
31
|
+
SUCCESS = 'success',
|
|
32
|
+
ERROR = 'error',
|
|
33
|
+
INFO = 'info',
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export type GridItemDetail = {
|
|
37
|
+
name: string;
|
|
38
|
+
value: string | number;
|
|
39
|
+
onClick?: (() => void) | undefined;
|
|
40
|
+
status?: GridTiemStatus | undefined;
|
|
41
|
+
};
|
|
26
42
|
const inValidContractState = [
|
|
27
43
|
V1_ContractState.DRAFT,
|
|
28
44
|
V1_ContractState.REJECTED,
|
|
@@ -34,6 +50,23 @@ const inProgressContractState = [
|
|
|
34
50
|
V1_ContractState.OPEN_FOR_PRIVILEGE_MANAGER_APPROVAL,
|
|
35
51
|
];
|
|
36
52
|
|
|
53
|
+
const idxLabel = (idx: number): string => {
|
|
54
|
+
return ` (${idx + 1})`;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export const convertMutilGridItemDetail = (
|
|
58
|
+
details: GridItemDetail[][],
|
|
59
|
+
): GridItemDetail[] => {
|
|
60
|
+
if (details.length > 1) {
|
|
61
|
+
details.forEach((gridItems, idx) => {
|
|
62
|
+
gridItems.forEach((item) => {
|
|
63
|
+
item.name = `${item.name}${idxLabel(idx)}`;
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
return details.flat();
|
|
68
|
+
};
|
|
69
|
+
|
|
37
70
|
export const dataContractContainsDataProduct = (
|
|
38
71
|
dataProduct: V1_DataProduct,
|
|
39
72
|
dataProdcutDeploymentID: string | undefined,
|
|
@@ -91,3 +124,222 @@ export const isContractCompleted = (contract: V1_DataContract): boolean => {
|
|
|
91
124
|
export const isContractPending = (contract: V1_DataContract): boolean => {
|
|
92
125
|
return inProgressContractState.includes(contract.state);
|
|
93
126
|
};
|
|
127
|
+
|
|
128
|
+
type ContractDetailOptions = {
|
|
129
|
+
openApplicationIdHandler?: ((user: string) => void) | undefined;
|
|
130
|
+
openDirectoryHandler?: ((id: string) => void) | undefined;
|
|
131
|
+
externalReference?:
|
|
132
|
+
| {
|
|
133
|
+
openContractHandler: ((id: string) => void) | undefined;
|
|
134
|
+
}
|
|
135
|
+
| undefined;
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
const CONTRACT_GRID_NAME = Object.freeze({
|
|
139
|
+
CONTRACT_ID: 'Contract ID',
|
|
140
|
+
CONTRACT_DESCRIPTION: 'Contract Description',
|
|
141
|
+
CONTRACT_VERSION: 'Contract Version',
|
|
142
|
+
CONTRACT_STATE: 'Contract State',
|
|
143
|
+
CONTRACT_DATA_PRODUCT_ID: 'Contract Data Product ID',
|
|
144
|
+
CONTRACT_DATA_PRODUCT: 'Contract Data Product',
|
|
145
|
+
CONTRACT_DATA_PRODUCT_DID: 'Contract Data Product DID',
|
|
146
|
+
CONTRACT_ACCESS_GROUP: 'Contract Access Group',
|
|
147
|
+
CONTRACT_ACCESS_POINTS: 'Contract Access Points',
|
|
148
|
+
CONTRACT_CONSUMER_NAME: 'Contract Consumer Name',
|
|
149
|
+
CONTRACT_CONSUMER_LEVEL: 'Contract Consumer Level',
|
|
150
|
+
CONTRACT_MEMBER_ID: 'Contract Member ID',
|
|
151
|
+
CONTRACT_MEMBER_TYPE: 'Contract Member Type',
|
|
152
|
+
CONTRACT_MEMBER_STATUS: 'Contract Member Status',
|
|
153
|
+
CONTRACT_MEMBER_NAME: 'Contract Member Name',
|
|
154
|
+
CONTRACT_APP_DID: 'Contract App DID',
|
|
155
|
+
CONTRACT_APP_LEVEL: 'Contract App Level',
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
export const buildDataContractDetail = (
|
|
159
|
+
dataContract: V1_DataContract,
|
|
160
|
+
options?: ContractDetailOptions | undefined,
|
|
161
|
+
): GridItemDetail[] => {
|
|
162
|
+
const applicationIdUrlCallBack = options?.openApplicationIdHandler;
|
|
163
|
+
const directoryUrl = options?.openDirectoryHandler;
|
|
164
|
+
const openContractHandler = options?.externalReference?.openContractHandler;
|
|
165
|
+
const contractDetails = [
|
|
166
|
+
{
|
|
167
|
+
name: CONTRACT_GRID_NAME.CONTRACT_ID,
|
|
168
|
+
value: dataContract.guid,
|
|
169
|
+
onClick: openContractHandler
|
|
170
|
+
? () => openContractHandler(dataContract.guid)
|
|
171
|
+
: undefined,
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
name: CONTRACT_GRID_NAME.CONTRACT_DESCRIPTION,
|
|
175
|
+
value: dataContract.description,
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
name: CONTRACT_GRID_NAME.CONTRACT_VERSION,
|
|
179
|
+
value: dataContract.version,
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
name: CONTRACT_GRID_NAME.CONTRACT_STATE,
|
|
183
|
+
value: prettyCONSTName(dataContract.state),
|
|
184
|
+
},
|
|
185
|
+
];
|
|
186
|
+
const accessPointGroupRef = dataContract.resource;
|
|
187
|
+
let dataProductDetails: GridItemDetail[] = [];
|
|
188
|
+
if (accessPointGroupRef instanceof V1_AccessPointGroupReference) {
|
|
189
|
+
dataProductDetails = [
|
|
190
|
+
{
|
|
191
|
+
name: CONTRACT_GRID_NAME.CONTRACT_DATA_PRODUCT_ID,
|
|
192
|
+
value: accessPointGroupRef.dataProduct.guid,
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
name: CONTRACT_GRID_NAME.CONTRACT_DATA_PRODUCT,
|
|
196
|
+
value: accessPointGroupRef.dataProduct.name,
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
name: CONTRACT_GRID_NAME.CONTRACT_DATA_PRODUCT_DID,
|
|
200
|
+
value: accessPointGroupRef.dataProduct.owner.appDirId,
|
|
201
|
+
onClick: applicationIdUrlCallBack
|
|
202
|
+
? () =>
|
|
203
|
+
applicationIdUrlCallBack(
|
|
204
|
+
accessPointGroupRef.dataProduct.owner.appDirId.toString(),
|
|
205
|
+
)
|
|
206
|
+
: undefined,
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
name: CONTRACT_GRID_NAME.CONTRACT_ACCESS_GROUP,
|
|
210
|
+
value: accessPointGroupRef.accessPointGroup,
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
name: CONTRACT_GRID_NAME.CONTRACT_ACCESS_POINTS,
|
|
214
|
+
value: accessPointGroupRef.dataProduct.accessPoints
|
|
215
|
+
.map((ap) => ap.name)
|
|
216
|
+
.join(', '),
|
|
217
|
+
},
|
|
218
|
+
];
|
|
219
|
+
}
|
|
220
|
+
const org = dataContract.consumer;
|
|
221
|
+
let orgDetails: GridItemDetail[] = [];
|
|
222
|
+
if (org instanceof V1_AppDirOrganizationalScope) {
|
|
223
|
+
orgDetails = convertMutilGridItemDetail(
|
|
224
|
+
org.appDirNode.map((value) => [
|
|
225
|
+
{
|
|
226
|
+
name: CONTRACT_GRID_NAME.CONTRACT_APP_DID,
|
|
227
|
+
value: value.appDirId.toString(),
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
name: CONTRACT_GRID_NAME.CONTRACT_APP_LEVEL,
|
|
231
|
+
value: value.level.toString(),
|
|
232
|
+
},
|
|
233
|
+
]),
|
|
234
|
+
);
|
|
235
|
+
} else if (org instanceof V1_AdhocTeam) {
|
|
236
|
+
orgDetails = convertMutilGridItemDetail(
|
|
237
|
+
org.users.map((user) => {
|
|
238
|
+
return [
|
|
239
|
+
{
|
|
240
|
+
name: CONTRACT_GRID_NAME.CONTRACT_CONSUMER_NAME,
|
|
241
|
+
value: user.name,
|
|
242
|
+
onClick: directoryUrl ? () => directoryUrl(user.name) : undefined,
|
|
243
|
+
},
|
|
244
|
+
];
|
|
245
|
+
}),
|
|
246
|
+
);
|
|
247
|
+
}
|
|
248
|
+
const contractMembers = convertMutilGridItemDetail(
|
|
249
|
+
dataContract.members.map((member) => [
|
|
250
|
+
{
|
|
251
|
+
name: CONTRACT_GRID_NAME.CONTRACT_MEMBER_ID,
|
|
252
|
+
value: member.guid,
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
name: CONTRACT_GRID_NAME.CONTRACT_MEMBER_NAME,
|
|
256
|
+
value: member.user.name,
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
name: CONTRACT_GRID_NAME.CONTRACT_MEMBER_TYPE,
|
|
260
|
+
value: member.user.userType.toString(),
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
name: CONTRACT_GRID_NAME.CONTRACT_MEMBER_STATUS,
|
|
264
|
+
value: member.status.toString(),
|
|
265
|
+
},
|
|
266
|
+
]),
|
|
267
|
+
);
|
|
268
|
+
return [
|
|
269
|
+
...contractDetails,
|
|
270
|
+
...dataProductDetails,
|
|
271
|
+
...orgDetails,
|
|
272
|
+
...contractMembers,
|
|
273
|
+
];
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
const getGridInfoFromTaskStatus = (
|
|
277
|
+
status: V1_UserApprovalStatus,
|
|
278
|
+
): GridTiemStatus | undefined => {
|
|
279
|
+
switch (status) {
|
|
280
|
+
case V1_UserApprovalStatus.APPROVED:
|
|
281
|
+
return GridTiemStatus.SUCCESS;
|
|
282
|
+
case V1_UserApprovalStatus.DENIED:
|
|
283
|
+
return GridTiemStatus.ERROR;
|
|
284
|
+
case V1_UserApprovalStatus.PENDING:
|
|
285
|
+
return GridTiemStatus.INFO;
|
|
286
|
+
default:
|
|
287
|
+
return undefined;
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
export const TYPE_GRID_ITEM = Object.freeze({
|
|
292
|
+
TASK_ID: 'Task ID',
|
|
293
|
+
TASK_STATUS: 'Task Status',
|
|
294
|
+
TASK_CONSUMER: 'Task Consumer',
|
|
295
|
+
TASK_ASSIGNEE: 'Task Assignee',
|
|
296
|
+
});
|
|
297
|
+
|
|
298
|
+
export const buildTaskGridItemDetail = (
|
|
299
|
+
task: V1_ContractUserEventRecord,
|
|
300
|
+
assignees?: string[] | undefined,
|
|
301
|
+
contract?: V1_DataContract | undefined,
|
|
302
|
+
openContractHandler?: ((id: string) => void) | undefined,
|
|
303
|
+
openDirectoryHandler?: ((id: string) => void) | undefined,
|
|
304
|
+
openApplicationIdHandler?: ((user: string) => void) | undefined,
|
|
305
|
+
): GridItemDetail[] => {
|
|
306
|
+
const taskAssignees = convertMutilGridItemDetail(
|
|
307
|
+
assignees?.map((name) => [
|
|
308
|
+
{
|
|
309
|
+
name: TYPE_GRID_ITEM.TASK_ASSIGNEE,
|
|
310
|
+
value: name,
|
|
311
|
+
onClick: openDirectoryHandler
|
|
312
|
+
? () => openDirectoryHandler(name)
|
|
313
|
+
: undefined,
|
|
314
|
+
},
|
|
315
|
+
]) ?? [],
|
|
316
|
+
);
|
|
317
|
+
return [
|
|
318
|
+
{
|
|
319
|
+
name: TYPE_GRID_ITEM.TASK_ID,
|
|
320
|
+
value: task.taskId,
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
name: TYPE_GRID_ITEM.TASK_STATUS,
|
|
324
|
+
value: task.status.toString(),
|
|
325
|
+
status: getGridInfoFromTaskStatus(task.status),
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
name: TYPE_GRID_ITEM.TASK_CONSUMER,
|
|
329
|
+
value: task.consumer,
|
|
330
|
+
onClick: openDirectoryHandler
|
|
331
|
+
? () => openDirectoryHandler(task.consumer)
|
|
332
|
+
: undefined,
|
|
333
|
+
},
|
|
334
|
+
...taskAssignees,
|
|
335
|
+
...(contract && openContractHandler
|
|
336
|
+
? buildDataContractDetail(contract, {
|
|
337
|
+
openDirectoryHandler,
|
|
338
|
+
openApplicationIdHandler,
|
|
339
|
+
externalReference: {
|
|
340
|
+
openContractHandler,
|
|
341
|
+
},
|
|
342
|
+
})
|
|
343
|
+
: []),
|
|
344
|
+
];
|
|
345
|
+
};
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
} from './LakehouseEntitlementsStore.js';
|
|
40
40
|
import { LakehouseViewerState } from './LakehouseViewerState.js';
|
|
41
41
|
|
|
42
|
-
export class
|
|
42
|
+
export class EntitlementsDashboardState extends LakehouseViewerState {
|
|
43
43
|
pendingTasks: V1_ContractUserEventRecord[] | undefined;
|
|
44
44
|
pendingContracts: V1_UserPendingContractsRecord[] | undefined;
|
|
45
45
|
changingState = ActionState.create();
|
|
@@ -67,7 +67,6 @@ export class LakehouseEntitlementsMainViewState extends LakehouseViewerState {
|
|
|
67
67
|
TEST_USER,
|
|
68
68
|
token,
|
|
69
69
|
)) as PlainObject<V1_PendingTasksRespond>;
|
|
70
|
-
|
|
71
70
|
const pendingContracts =
|
|
72
71
|
(yield this.state.lakehouseServerClient.getPendingContracts(
|
|
73
72
|
TEST_USER2,
|
|
@@ -111,8 +110,14 @@ export class LakehouseEntitlementsMainViewState extends LakehouseViewerState {
|
|
|
111
110
|
}
|
|
112
111
|
task.status = change.status;
|
|
113
112
|
this.setPendingTasks([...(this.pendingTasks ?? [])]);
|
|
113
|
+
this.state.applicationStore.notificationService.notifySuccess(
|
|
114
|
+
`Task has been Approved`,
|
|
115
|
+
);
|
|
114
116
|
} catch (error) {
|
|
115
117
|
assertErrorThrown(error);
|
|
118
|
+
this.state.applicationStore.notificationService.notifyError(
|
|
119
|
+
`${error.message}`,
|
|
120
|
+
);
|
|
116
121
|
} finally {
|
|
117
122
|
this.changingState.complete();
|
|
118
123
|
this.changingState.setMessage(undefined);
|
|
@@ -125,7 +130,11 @@ export class LakehouseEntitlementsMainViewState extends LakehouseViewerState {
|
|
|
125
130
|
): GeneratorFn<void> {
|
|
126
131
|
try {
|
|
127
132
|
this.changingState.inProgress();
|
|
128
|
-
this.
|
|
133
|
+
this.state.applicationStore.alertService.setBlockingAlert({
|
|
134
|
+
message: 'Denying Task',
|
|
135
|
+
prompt: 'Denying task...',
|
|
136
|
+
showLoading: true,
|
|
137
|
+
});
|
|
129
138
|
const response = (yield this.state.lakehouseServerClient.denyTask(
|
|
130
139
|
task.taskId,
|
|
131
140
|
token,
|
|
@@ -141,11 +150,18 @@ export class LakehouseEntitlementsMainViewState extends LakehouseViewerState {
|
|
|
141
150
|
}
|
|
142
151
|
task.status = change.status;
|
|
143
152
|
this.setPendingTasks([...(this.pendingTasks ?? [])]);
|
|
153
|
+
this.state.applicationStore.notificationService.notifySuccess(
|
|
154
|
+
`Task has been denied`,
|
|
155
|
+
);
|
|
144
156
|
} catch (error) {
|
|
145
157
|
assertErrorThrown(error);
|
|
158
|
+
this.state.applicationStore.notificationService.notifyError(
|
|
159
|
+
`${error.message}`,
|
|
160
|
+
);
|
|
146
161
|
} finally {
|
|
147
162
|
this.changingState.complete();
|
|
148
163
|
this.changingState.setMessage(undefined);
|
|
164
|
+
this.state.applicationStore.alertService.setBlockingAlert(undefined);
|
|
149
165
|
}
|
|
150
166
|
}
|
|
151
167
|
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-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 {
|
|
18
|
+
type V1_ContractUserEventRecord,
|
|
19
|
+
type V1_PendingTasksRespond,
|
|
20
|
+
type V1_DataContract,
|
|
21
|
+
V1_deserializeTaskResponse,
|
|
22
|
+
} from '@finos/legend-graph';
|
|
23
|
+
import { type LakehouseEntitlementsStore } from './LakehouseEntitlementsStore.js';
|
|
24
|
+
import { LakehouseViewerState } from './LakehouseViewerState.js';
|
|
25
|
+
import {
|
|
26
|
+
assertErrorThrown,
|
|
27
|
+
type GeneratorFn,
|
|
28
|
+
type PlainObject,
|
|
29
|
+
} from '@finos/legend-shared';
|
|
30
|
+
import { action, computed, flow, makeObservable, observable } from 'mobx';
|
|
31
|
+
import {
|
|
32
|
+
buildDataContractDetail,
|
|
33
|
+
buildTaskGridItemDetail,
|
|
34
|
+
convertMutilGridItemDetail,
|
|
35
|
+
type GridItemDetail,
|
|
36
|
+
} from '../LakehouseUtils.js';
|
|
37
|
+
|
|
38
|
+
export class EntitlementsDataContractViewerState extends LakehouseViewerState {
|
|
39
|
+
readonly value: V1_DataContract;
|
|
40
|
+
associatedTasks: V1_ContractUserEventRecord[] | undefined;
|
|
41
|
+
|
|
42
|
+
constructor(value: V1_DataContract, state: LakehouseEntitlementsStore) {
|
|
43
|
+
super(state);
|
|
44
|
+
this.value = value;
|
|
45
|
+
makeObservable(this, {
|
|
46
|
+
associatedTasks: observable,
|
|
47
|
+
setAssociatedTasks: action,
|
|
48
|
+
init: flow,
|
|
49
|
+
tasksDetails: computed,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
get contractDetails(): GridItemDetail[] {
|
|
54
|
+
return [
|
|
55
|
+
...buildDataContractDetail(this.value, {
|
|
56
|
+
openDirectoryHandler: this.state.directoryCallBack,
|
|
57
|
+
openApplicationIdHandler: this.state.applicationCallBack,
|
|
58
|
+
}),
|
|
59
|
+
...this.tasksDetails,
|
|
60
|
+
];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
get tasksDetails(): GridItemDetail[] {
|
|
64
|
+
return convertMutilGridItemDetail(
|
|
65
|
+
this.associatedTasks?.map((task) =>
|
|
66
|
+
buildTaskGridItemDetail(
|
|
67
|
+
task,
|
|
68
|
+
[],
|
|
69
|
+
undefined,
|
|
70
|
+
undefined,
|
|
71
|
+
this.state.directoryCallBack,
|
|
72
|
+
this.state.applicationCallBack,
|
|
73
|
+
),
|
|
74
|
+
) ?? [],
|
|
75
|
+
).map((e) => {
|
|
76
|
+
e.name = `Contract ${e.name}`;
|
|
77
|
+
return e;
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
setAssociatedTasks(
|
|
82
|
+
associatedTasks: V1_ContractUserEventRecord[] | undefined,
|
|
83
|
+
): void {
|
|
84
|
+
this.associatedTasks = associatedTasks;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
*init(token: string | undefined): GeneratorFn<void> {
|
|
88
|
+
try {
|
|
89
|
+
this.setAssociatedTasks(undefined);
|
|
90
|
+
const pendingContracts =
|
|
91
|
+
(yield this.state.lakehouseServerClient.getContractTasks(
|
|
92
|
+
this.value.guid,
|
|
93
|
+
token,
|
|
94
|
+
)) as PlainObject<V1_PendingTasksRespond>;
|
|
95
|
+
const tasks = V1_deserializeTaskResponse(pendingContracts);
|
|
96
|
+
this.setAssociatedTasks(tasks.map((e) => e.rec));
|
|
97
|
+
} catch (error) {
|
|
98
|
+
assertErrorThrown(error);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import {
|
|
18
|
+
ActionState,
|
|
18
19
|
assertErrorThrown,
|
|
19
20
|
type GeneratorFn,
|
|
20
21
|
type PlainObject,
|
|
@@ -30,30 +31,37 @@ import {
|
|
|
30
31
|
type V1_DataContractsRecord,
|
|
31
32
|
type V1_PendingTasksRespond,
|
|
32
33
|
V1_pendingTasksRespondModelSchema,
|
|
34
|
+
type V1_UserPendingContractsRecord,
|
|
35
|
+
type V1_TaskMetadata,
|
|
33
36
|
} from '@finos/legend-graph';
|
|
34
37
|
import { makeObservable, flow, observable, flowResult, action } from 'mobx';
|
|
35
38
|
import {
|
|
36
|
-
type GridItemDetail,
|
|
37
39
|
type LakehouseEntitlementsStore,
|
|
38
40
|
TEST_USER,
|
|
39
41
|
} from './LakehouseEntitlementsStore.js';
|
|
40
|
-
import { buildDataContractDetail } from './DataContractState.js';
|
|
41
42
|
import { LakehouseViewerState } from './LakehouseViewerState.js';
|
|
43
|
+
import {
|
|
44
|
+
buildTaskGridItemDetail,
|
|
45
|
+
type GridItemDetail,
|
|
46
|
+
} from '../LakehouseUtils.js';
|
|
47
|
+
import { generateLakehouseContractPath } from '../../../__lib__/LegendMarketplaceNavigation.js';
|
|
42
48
|
|
|
43
|
-
export class
|
|
49
|
+
export class EntitlementsTaskViewerState extends LakehouseViewerState {
|
|
44
50
|
readonly value: V1_ContractUserEventRecord;
|
|
51
|
+
readonly approvalStatus = ActionState.create();
|
|
45
52
|
canApprove: boolean | undefined;
|
|
46
53
|
dataContract: V1_DataContract | undefined;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
) {
|
|
54
|
+
pendingAssociatedContractEvent: V1_UserPendingContractsRecord[] | undefined;
|
|
55
|
+
changingTaskState = ActionState.create();
|
|
56
|
+
taskAssignees: string[] | undefined;
|
|
57
|
+
constructor(value: V1_TaskMetadata, state: LakehouseEntitlementsStore) {
|
|
52
58
|
super(state);
|
|
53
|
-
this.value = value;
|
|
59
|
+
this.value = value.rec;
|
|
60
|
+
this.taskAssignees = value.assignees;
|
|
54
61
|
makeObservable(this, {
|
|
55
|
-
value: observable,
|
|
56
62
|
canApprove: observable,
|
|
63
|
+
pendingAssociatedContractEvent: observable,
|
|
64
|
+
setPendingAssociatedContractEvent: action,
|
|
57
65
|
setCanApprove: action,
|
|
58
66
|
approve: flow,
|
|
59
67
|
deny: flow,
|
|
@@ -61,6 +69,7 @@ export class DataContractTaskState extends LakehouseViewerState {
|
|
|
61
69
|
calculateApprovalRights: flow,
|
|
62
70
|
fetchContract: flow,
|
|
63
71
|
dataContract: observable,
|
|
72
|
+
taskAssignees: observable,
|
|
64
73
|
});
|
|
65
74
|
this.observeContract();
|
|
66
75
|
}
|
|
@@ -69,6 +78,12 @@ export class DataContractTaskState extends LakehouseViewerState {
|
|
|
69
78
|
return this.value.taskId;
|
|
70
79
|
}
|
|
71
80
|
|
|
81
|
+
setPendingAssociatedContractEvent(
|
|
82
|
+
pendingAssociatedContractEvent: V1_UserPendingContractsRecord[] | undefined,
|
|
83
|
+
): void {
|
|
84
|
+
this.pendingAssociatedContractEvent = pendingAssociatedContractEvent;
|
|
85
|
+
}
|
|
86
|
+
|
|
72
87
|
*init(token: string | undefined): GeneratorFn<void> {
|
|
73
88
|
flowResult(this.calculateApprovalRights(token)).catch(
|
|
74
89
|
this.state.applicationStore.alertUnhandledError,
|
|
@@ -90,6 +105,7 @@ export class DataContractTaskState extends LakehouseViewerState {
|
|
|
90
105
|
|
|
91
106
|
*approve(token: string | undefined): GeneratorFn<void> {
|
|
92
107
|
try {
|
|
108
|
+
this.approvalStatus.inProgress();
|
|
93
109
|
const response = (yield this.state.lakehouseServerClient.approveTask(
|
|
94
110
|
this.value.taskId,
|
|
95
111
|
token,
|
|
@@ -99,19 +115,34 @@ export class DataContractTaskState extends LakehouseViewerState {
|
|
|
99
115
|
response,
|
|
100
116
|
);
|
|
101
117
|
if (change.errorMessage) {
|
|
118
|
+
this.approvalStatus.fail();
|
|
102
119
|
throw new Error(
|
|
103
120
|
`Unable to approve task: ${this.value.taskId}: ${change.errorMessage}`,
|
|
104
121
|
);
|
|
105
122
|
}
|
|
106
123
|
this.value.status = change.status;
|
|
107
124
|
this.setCanApprove(false);
|
|
125
|
+
this.approvalStatus.pass();
|
|
126
|
+
this.state.applicationStore.notificationService.notifySuccess(
|
|
127
|
+
'Approval succeeded',
|
|
128
|
+
);
|
|
108
129
|
} catch (error) {
|
|
130
|
+
this.approvalStatus.fail();
|
|
109
131
|
assertErrorThrown(error);
|
|
132
|
+
this.state.applicationStore.notificationService.notifyError(
|
|
133
|
+
`${error.message}`,
|
|
134
|
+
);
|
|
110
135
|
}
|
|
111
136
|
}
|
|
112
137
|
|
|
113
138
|
*deny(token: string | undefined): GeneratorFn<void> {
|
|
114
139
|
try {
|
|
140
|
+
this.changingTaskState.inProgress();
|
|
141
|
+
this.state.applicationStore.alertService.setBlockingAlert({
|
|
142
|
+
message: 'Denying Task',
|
|
143
|
+
prompt: 'Denying task...',
|
|
144
|
+
showLoading: true,
|
|
145
|
+
});
|
|
115
146
|
const response = (yield this.state.lakehouseServerClient.denyTask(
|
|
116
147
|
this.value.taskId,
|
|
117
148
|
token,
|
|
@@ -127,8 +158,18 @@ export class DataContractTaskState extends LakehouseViewerState {
|
|
|
127
158
|
}
|
|
128
159
|
this.value.status = change.status;
|
|
129
160
|
this.setCanApprove(false);
|
|
161
|
+
this.state.applicationStore.notificationService.notifySuccess(
|
|
162
|
+
`Task has been denied`,
|
|
163
|
+
);
|
|
130
164
|
} catch (error) {
|
|
131
165
|
assertErrorThrown(error);
|
|
166
|
+
this.state.applicationStore.notificationService.notifyError(
|
|
167
|
+
`${error.message}`,
|
|
168
|
+
);
|
|
169
|
+
} finally {
|
|
170
|
+
this.changingTaskState.complete();
|
|
171
|
+
this.changingTaskState.setMessage(undefined);
|
|
172
|
+
this.state.applicationStore.alertService.setBlockingAlert(undefined);
|
|
132
173
|
}
|
|
133
174
|
}
|
|
134
175
|
|
|
@@ -170,20 +211,17 @@ export class DataContractTaskState extends LakehouseViewerState {
|
|
|
170
211
|
}
|
|
171
212
|
|
|
172
213
|
get taskDetails(): GridItemDetail[] {
|
|
173
|
-
return
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
name: 'Task Consumer',
|
|
184
|
-
value: this.value.consumer,
|
|
214
|
+
return buildTaskGridItemDetail(
|
|
215
|
+
this.value,
|
|
216
|
+
this.taskAssignees,
|
|
217
|
+
this.dataContract,
|
|
218
|
+
(id: string): void => {
|
|
219
|
+
this.state.applicationStore.navigationService.navigator.updateCurrentLocation(
|
|
220
|
+
generateLakehouseContractPath(id),
|
|
221
|
+
);
|
|
185
222
|
},
|
|
186
|
-
|
|
187
|
-
|
|
223
|
+
this.state.directoryCallBack,
|
|
224
|
+
this.state.applicationCallBack,
|
|
225
|
+
);
|
|
188
226
|
}
|
|
189
227
|
}
|