@finos/legend-application-marketplace 0.1.56 → 0.1.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/__lib__/LegendMarketplaceTelemetryHelper.d.ts +1 -1
- package/lib/__lib__/LegendMarketplaceTelemetryHelper.d.ts.map +1 -1
- package/lib/__lib__/LegendMarketplaceTelemetryHelper.js +2 -2
- package/lib/__lib__/LegendMarketplaceTelemetryHelper.js.map +1 -1
- package/lib/components/Header/LegendMarketplaceIconToolbar.d.ts.map +1 -1
- package/lib/components/Header/LegendMarketplaceIconToolbar.js +11 -2
- package/lib/components/Header/LegendMarketplaceIconToolbar.js.map +1 -1
- package/lib/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 +2 -19
- 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/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__/LegendMarketplaceTelemetryHelper.ts +3 -3
- package/src/components/Header/LegendMarketplaceIconToolbar.tsx +29 -0
- package/src/pages/Lakehouse/MarketplaceLakehouseHome.tsx +0 -54
- 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/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
|
@@ -0,0 +1,207 @@
|
|
|
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
|
+
getOrganizationalScopeTypeName,
|
|
19
|
+
getOrganizationalScopeTypeDetails,
|
|
20
|
+
UserRenderer,
|
|
21
|
+
MultiUserRenderer,
|
|
22
|
+
} from '@finos/legend-extension-dsl-data-product';
|
|
23
|
+
import {
|
|
24
|
+
V1_LiteDataContractWithUserStatus,
|
|
25
|
+
V1_ResourceType,
|
|
26
|
+
} from '@finos/legend-graph';
|
|
27
|
+
import type {
|
|
28
|
+
DataGridCellRendererParams,
|
|
29
|
+
DataGridColumnDefinition,
|
|
30
|
+
} from '@finos/legend-lego/data-grid';
|
|
31
|
+
import type {
|
|
32
|
+
ContractCreatedByUserDetails,
|
|
33
|
+
EntitlementsDashboardState,
|
|
34
|
+
} from '../stores/lakehouse/entitlements/EntitlementsDashboardState.js';
|
|
35
|
+
import { formatOrderDate } from '../stores/orders/OrderHelpers.js';
|
|
36
|
+
import { InfoCircleIcon } from '@finos/legend-art';
|
|
37
|
+
import { Tooltip } from '@mui/material';
|
|
38
|
+
import { observer } from 'mobx-react-lite';
|
|
39
|
+
import type { LakehouseEntitlementsStore } from '../stores/lakehouse/entitlements/LakehouseEntitlementsStore.js';
|
|
40
|
+
|
|
41
|
+
const TargetUserCellRenderer = observer(
|
|
42
|
+
(props: {
|
|
43
|
+
dataContract:
|
|
44
|
+
| V1_LiteDataContractWithUserStatus
|
|
45
|
+
| ContractCreatedByUserDetails
|
|
46
|
+
| undefined;
|
|
47
|
+
entitlementsStore: LakehouseEntitlementsStore;
|
|
48
|
+
}): React.ReactNode => {
|
|
49
|
+
const { dataContract, entitlementsStore } = props;
|
|
50
|
+
|
|
51
|
+
const userIds =
|
|
52
|
+
dataContract instanceof V1_LiteDataContractWithUserStatus
|
|
53
|
+
? [dataContract.user]
|
|
54
|
+
: (dataContract?.sortedMemberIds ?? []);
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<MultiUserRenderer
|
|
58
|
+
userIds={userIds}
|
|
59
|
+
applicationStore={entitlementsStore.applicationStore}
|
|
60
|
+
userSearchService={
|
|
61
|
+
entitlementsStore.marketplaceBaseStore.userSearchService
|
|
62
|
+
}
|
|
63
|
+
disableOnClick={true}
|
|
64
|
+
singleUserClassName="marketplace-lakehouse-entitlements__grid__user-display"
|
|
65
|
+
/>
|
|
66
|
+
);
|
|
67
|
+
},
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
export const getCommonEntitlementsColDefs = (
|
|
71
|
+
dashboardState: EntitlementsDashboardState,
|
|
72
|
+
): DataGridColumnDefinition<
|
|
73
|
+
V1_LiteDataContractWithUserStatus | ContractCreatedByUserDetails
|
|
74
|
+
>[] => [
|
|
75
|
+
{
|
|
76
|
+
headerName: 'Date Created',
|
|
77
|
+
colId: 'dateCreated',
|
|
78
|
+
valueGetter: (params) => {
|
|
79
|
+
return (
|
|
80
|
+
formatOrderDate(params.data?.contractResultLite.createdAt) ?? 'Unknown'
|
|
81
|
+
);
|
|
82
|
+
},
|
|
83
|
+
sort: 'desc',
|
|
84
|
+
comparator: (_, __, val1, val2) => {
|
|
85
|
+
const dateA = val1.data?.contractResultLite.createdAt
|
|
86
|
+
? new Date(val1.data.contractResultLite.createdAt).getTime()
|
|
87
|
+
: 0;
|
|
88
|
+
const dateB = val2.data?.contractResultLite.createdAt
|
|
89
|
+
? new Date(val2.data.contractResultLite.createdAt).getTime()
|
|
90
|
+
: 0;
|
|
91
|
+
return dateA - dateB;
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
colId: 'consumerType',
|
|
96
|
+
headerName: 'Consumer Type',
|
|
97
|
+
valueGetter: (params) => {
|
|
98
|
+
const consumer = params.data?.contractResultLite.consumer;
|
|
99
|
+
const typeName = consumer
|
|
100
|
+
? getOrganizationalScopeTypeName(
|
|
101
|
+
consumer,
|
|
102
|
+
dashboardState.lakehouseEntitlementsStore.applicationStore.pluginManager.getApplicationPlugins(),
|
|
103
|
+
)
|
|
104
|
+
: undefined;
|
|
105
|
+
return typeName ?? 'Unknown';
|
|
106
|
+
},
|
|
107
|
+
cellRenderer: (
|
|
108
|
+
params: DataGridCellRendererParams<
|
|
109
|
+
V1_LiteDataContractWithUserStatus | ContractCreatedByUserDetails
|
|
110
|
+
>,
|
|
111
|
+
) => {
|
|
112
|
+
const consumer = params.data?.contractResultLite.consumer;
|
|
113
|
+
const typeName = consumer
|
|
114
|
+
? getOrganizationalScopeTypeName(
|
|
115
|
+
consumer,
|
|
116
|
+
dashboardState.lakehouseEntitlementsStore.applicationStore.pluginManager.getApplicationPlugins(),
|
|
117
|
+
)
|
|
118
|
+
: undefined;
|
|
119
|
+
const typeDetails = consumer
|
|
120
|
+
? getOrganizationalScopeTypeDetails(
|
|
121
|
+
consumer,
|
|
122
|
+
dashboardState.lakehouseEntitlementsStore.applicationStore.pluginManager.getApplicationPlugins(),
|
|
123
|
+
)
|
|
124
|
+
: undefined;
|
|
125
|
+
return (
|
|
126
|
+
<>
|
|
127
|
+
{typeName ?? 'Unknown'}
|
|
128
|
+
{typeDetails !== undefined && (
|
|
129
|
+
<Tooltip
|
|
130
|
+
className="marketplace-lakehouse-entitlements__grid__consumer-type__tooltip__icon"
|
|
131
|
+
title={typeDetails}
|
|
132
|
+
>
|
|
133
|
+
<InfoCircleIcon />
|
|
134
|
+
</Tooltip>
|
|
135
|
+
)}
|
|
136
|
+
</>
|
|
137
|
+
);
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
headerName: 'Target User(s)',
|
|
142
|
+
colId: 'targetUser',
|
|
143
|
+
valueGetter: (params) => {
|
|
144
|
+
const userIds =
|
|
145
|
+
params.data instanceof V1_LiteDataContractWithUserStatus
|
|
146
|
+
? [params.data.user]
|
|
147
|
+
: (params.data?.sortedMemberIds ?? []);
|
|
148
|
+
return userIds.length > 0 ? userIds.join(', ') : 'Unknown';
|
|
149
|
+
},
|
|
150
|
+
cellRenderer: (
|
|
151
|
+
params: DataGridCellRendererParams<
|
|
152
|
+
V1_LiteDataContractWithUserStatus | ContractCreatedByUserDetails
|
|
153
|
+
>,
|
|
154
|
+
) => (
|
|
155
|
+
<TargetUserCellRenderer
|
|
156
|
+
dataContract={params.data}
|
|
157
|
+
entitlementsStore={dashboardState.lakehouseEntitlementsStore}
|
|
158
|
+
/>
|
|
159
|
+
),
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
headerName: 'Requester',
|
|
163
|
+
colId: 'requester',
|
|
164
|
+
valueGetter: (params) =>
|
|
165
|
+
params.data?.contractResultLite.createdBy ?? 'Unknown',
|
|
166
|
+
cellRenderer: (
|
|
167
|
+
params: DataGridCellRendererParams<
|
|
168
|
+
V1_LiteDataContractWithUserStatus | ContractCreatedByUserDetails
|
|
169
|
+
>,
|
|
170
|
+
) => {
|
|
171
|
+
const requester = params.data?.contractResultLite.createdBy;
|
|
172
|
+
return requester ? (
|
|
173
|
+
<UserRenderer
|
|
174
|
+
userId={requester}
|
|
175
|
+
applicationStore={
|
|
176
|
+
dashboardState.lakehouseEntitlementsStore.applicationStore
|
|
177
|
+
}
|
|
178
|
+
userSearchService={
|
|
179
|
+
dashboardState.lakehouseEntitlementsStore.marketplaceBaseStore
|
|
180
|
+
.userSearchService
|
|
181
|
+
}
|
|
182
|
+
disableOnClick={true}
|
|
183
|
+
className="marketplace-lakehouse-entitlements__grid__user-display"
|
|
184
|
+
/>
|
|
185
|
+
) : (
|
|
186
|
+
<>Unknown</>
|
|
187
|
+
);
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
headerName: 'Target Data Product',
|
|
192
|
+
valueGetter: (params) => {
|
|
193
|
+
return params.data?.contractResultLite.resourceId ?? 'Unknown';
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
headerName: 'Target Access Point Group',
|
|
198
|
+
valueGetter: (params) => {
|
|
199
|
+
const accessPointGroup =
|
|
200
|
+
params.data?.contractResultLite.resourceType ===
|
|
201
|
+
V1_ResourceType.ACCESS_POINT_GROUP
|
|
202
|
+
? params.data.contractResultLite.accessPointGroup
|
|
203
|
+
: `${params.data?.contractResultLite.accessPointGroup ?? 'Unknown'} (${params.data?.contractResultLite.resourceType ?? 'Unknown Type'})`;
|
|
204
|
+
return accessPointGroup ?? 'Unknown';
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
];
|
package/tsconfig.json
CHANGED
|
@@ -129,6 +129,7 @@
|
|
|
129
129
|
"./src/pages/Profile/LegendMarketplaceYourOrders.tsx",
|
|
130
130
|
"./src/pages/TerminalsAddons/LegendMarketplaceTerminalsAddons.tsx",
|
|
131
131
|
"./src/stores/LegendMarketPlaceVendorDataStore.tsx",
|
|
132
|
+
"./src/utils/EntitlementsUtils.tsx",
|
|
132
133
|
"./src/utils/LakehouseUtils.tsx",
|
|
133
134
|
"./src/utils/LogUtils.tsx",
|
|
134
135
|
"./src/utils/SearchUtils.tsx",
|