@finos/legend-application-marketplace 0.1.51 → 0.1.53
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 +2 -1
- 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/components/AddToCart/RecommendedAddOnsModal.d.ts.map +1 -1
- package/lib/components/AddToCart/RecommendedAddOnsModal.js +32 -6
- package/lib/components/AddToCart/RecommendedAddOnsModal.js.map +1 -1
- package/lib/components/AddToCart/RecommendedItemsCard.d.ts +0 -1
- package/lib/components/AddToCart/RecommendedItemsCard.d.ts.map +1 -1
- package/lib/components/AddToCart/RecommendedItemsCard.js +12 -17
- package/lib/components/AddToCart/RecommendedItemsCard.js.map +1 -1
- package/lib/components/Header/LegendMarketplaceAppInfo.d.ts.map +1 -1
- package/lib/components/Header/LegendMarketplaceAppInfo.js +55 -12
- package/lib/components/Header/LegendMarketplaceAppInfo.js.map +1 -1
- package/lib/components/ProviderCard/LegendMarketplaceTerminalCard.d.ts.map +1 -1
- package/lib/components/ProviderCard/LegendMarketplaceTerminalCard.js +2 -2
- package/lib/components/ProviderCard/LegendMarketplaceTerminalCard.js.map +1 -1
- package/lib/components/orders/CancelOrderDialog.d.ts +27 -0
- package/lib/components/orders/CancelOrderDialog.d.ts.map +1 -0
- package/lib/components/orders/CancelOrderDialog.js +52 -0
- package/lib/components/orders/CancelOrderDialog.js.map +1 -0
- package/lib/components/orders/ProgressTracker.d.ts +23 -0
- package/lib/components/orders/ProgressTracker.d.ts.map +1 -0
- package/lib/components/orders/ProgressTracker.js +116 -0
- package/lib/components/orders/ProgressTracker.js.map +1 -0
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +1 -1
- package/lib/pages/Profile/LegendMarketplaceYourOrders.d.ts.map +1 -1
- package/lib/pages/Profile/LegendMarketplaceYourOrders.js +43 -36
- package/lib/pages/Profile/LegendMarketplaceYourOrders.js.map +1 -1
- package/lib/pages/TerminalsAddons/LegendMarketplaceTerminalsAddons.d.ts.map +1 -1
- package/lib/pages/TerminalsAddons/LegendMarketplaceTerminalsAddons.js +42 -18
- package/lib/pages/TerminalsAddons/LegendMarketplaceTerminalsAddons.js.map +1 -1
- package/lib/stores/LegendMarketPlaceVendorDataStore.d.ts +10 -4
- package/lib/stores/LegendMarketPlaceVendorDataStore.d.ts.map +1 -1
- package/lib/stores/LegendMarketPlaceVendorDataStore.js +82 -49
- package/lib/stores/LegendMarketPlaceVendorDataStore.js.map +1 -1
- package/lib/stores/cart/CartStore.d.ts.map +1 -1
- package/lib/stores/cart/CartStore.js +2 -1
- package/lib/stores/cart/CartStore.js.map +1 -1
- package/lib/stores/orders/OrderHelpers.d.ts +49 -0
- package/lib/stores/orders/OrderHelpers.d.ts.map +1 -0
- package/lib/stores/orders/OrderHelpers.js +134 -0
- package/lib/stores/orders/OrderHelpers.js.map +1 -0
- package/lib/stores/orders/OrderStore.d.ts +2 -0
- package/lib/stores/orders/OrderStore.d.ts.map +1 -1
- package/lib/stores/orders/OrderStore.js +31 -0
- package/lib/stores/orders/OrderStore.js.map +1 -1
- package/package.json +13 -13
- package/src/__lib__/LegendMarketplaceAppEvent.ts +1 -0
- package/src/components/AddToCart/RecommendedAddOnsModal.tsx +145 -17
- package/src/components/AddToCart/RecommendedItemsCard.tsx +32 -62
- package/src/components/Header/LegendMarketplaceAppInfo.tsx +104 -53
- package/src/components/ProviderCard/LegendMarketplaceTerminalCard.tsx +18 -2
- package/src/components/orders/CancelOrderDialog.tsx +157 -0
- package/src/components/orders/ProgressTracker.tsx +266 -0
- package/src/pages/Profile/LegendMarketplaceYourOrders.tsx +227 -230
- package/src/pages/TerminalsAddons/LegendMarketplaceTerminalsAddons.tsx +140 -17
- package/src/stores/LegendMarketPlaceVendorDataStore.tsx +114 -84
- package/src/stores/cart/CartStore.ts +2 -1
- package/src/stores/orders/OrderHelpers.ts +167 -0
- package/src/stores/orders/OrderStore.ts +51 -0
- package/tsconfig.json +3 -0
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { observer } from 'mobx-react-lite';
|
|
18
|
+
import { useMemo, useState } from 'react';
|
|
18
19
|
import {
|
|
19
20
|
Dialog,
|
|
20
21
|
DialogTitle,
|
|
@@ -22,15 +23,24 @@ import {
|
|
|
22
23
|
DialogActions,
|
|
23
24
|
Button,
|
|
24
25
|
Typography,
|
|
25
|
-
Grid,
|
|
26
26
|
Box,
|
|
27
27
|
IconButton,
|
|
28
|
+
TextField,
|
|
29
|
+
InputAdornment,
|
|
30
|
+
Select,
|
|
31
|
+
MenuItem,
|
|
32
|
+
FormControl,
|
|
33
|
+
InputLabel,
|
|
34
|
+
type SelectChangeEvent,
|
|
28
35
|
} from '@mui/material';
|
|
29
36
|
import {
|
|
30
37
|
CloseIcon,
|
|
31
38
|
CheckCircleIcon,
|
|
32
39
|
ArrowRightIcon,
|
|
33
40
|
WarningIcon,
|
|
41
|
+
SearchIcon,
|
|
42
|
+
ArrowUpIcon,
|
|
43
|
+
ArrowDownIcon,
|
|
34
44
|
} from '@finos/legend-art';
|
|
35
45
|
import {
|
|
36
46
|
TerminalItemType,
|
|
@@ -58,8 +68,34 @@ export const RecommendedAddOnsModal = observer(
|
|
|
58
68
|
onViewCart,
|
|
59
69
|
} = props;
|
|
60
70
|
|
|
71
|
+
const [searchTerm, setSearchTerm] = useState('');
|
|
72
|
+
const [sortOrder, setSortOrder] = useState<'asc' | 'desc' | ''>('');
|
|
73
|
+
|
|
74
|
+
const filteredAndSortedItems = useMemo(() => {
|
|
75
|
+
let items = [...recommendedItems];
|
|
76
|
+
|
|
77
|
+
if (searchTerm) {
|
|
78
|
+
const search = searchTerm.toLowerCase();
|
|
79
|
+
items = items.filter(
|
|
80
|
+
(item) =>
|
|
81
|
+
item.productName.toLowerCase().includes(search) ||
|
|
82
|
+
item.providerName.toLowerCase().includes(search),
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (sortOrder) {
|
|
87
|
+
items.sort((a, b) =>
|
|
88
|
+
sortOrder === 'asc' ? a.price - b.price : b.price - a.price,
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return items;
|
|
93
|
+
}, [recommendedItems, searchTerm, sortOrder]);
|
|
94
|
+
|
|
61
95
|
const closeModal = () => {
|
|
62
96
|
setShowModal(false);
|
|
97
|
+
setSearchTerm('');
|
|
98
|
+
setSortOrder('');
|
|
63
99
|
};
|
|
64
100
|
|
|
65
101
|
const handleViewCart = () => {
|
|
@@ -67,6 +103,12 @@ export const RecommendedAddOnsModal = observer(
|
|
|
67
103
|
closeModal();
|
|
68
104
|
};
|
|
69
105
|
|
|
106
|
+
const handleSortChange = (
|
|
107
|
+
event: SelectChangeEvent<'asc' | 'desc' | ''>,
|
|
108
|
+
) => {
|
|
109
|
+
setSortOrder(event.target.value);
|
|
110
|
+
};
|
|
111
|
+
|
|
70
112
|
if (!showModal) {
|
|
71
113
|
return null;
|
|
72
114
|
}
|
|
@@ -119,8 +161,10 @@ export const RecommendedAddOnsModal = observer(
|
|
|
119
161
|
className="recommended-addons-modal__section-title"
|
|
120
162
|
>
|
|
121
163
|
{terminal?.terminalItemType === TerminalItemType.TERMINAL
|
|
122
|
-
?
|
|
123
|
-
:
|
|
164
|
+
? `Recommended Add-Ons for ${terminal.providerName}`
|
|
165
|
+
: terminal
|
|
166
|
+
? `Recommended Terminals for ${terminal.providerName}`
|
|
167
|
+
: ''}
|
|
124
168
|
</Typography>
|
|
125
169
|
<Typography
|
|
126
170
|
variant="body2"
|
|
@@ -141,24 +185,108 @@ export const RecommendedAddOnsModal = observer(
|
|
|
141
185
|
</Typography>
|
|
142
186
|
</Box>
|
|
143
187
|
) : (
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
<
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
188
|
+
<>
|
|
189
|
+
<Box className="recommended-addons-modal__filter-controls">
|
|
190
|
+
<TextField
|
|
191
|
+
size="medium"
|
|
192
|
+
placeholder="Search any service..."
|
|
193
|
+
value={searchTerm}
|
|
194
|
+
onChange={(e) => setSearchTerm(e.target.value)}
|
|
195
|
+
className="recommended-addons-modal__search-field"
|
|
196
|
+
slotProps={{
|
|
197
|
+
input: {
|
|
198
|
+
endAdornment: (
|
|
199
|
+
<InputAdornment position="end">
|
|
200
|
+
<SearchIcon />
|
|
201
|
+
</InputAdornment>
|
|
202
|
+
),
|
|
203
|
+
},
|
|
204
|
+
}}
|
|
205
|
+
/>
|
|
206
|
+
<FormControl
|
|
207
|
+
size="medium"
|
|
208
|
+
className="recommended-addons-modal__sort-select"
|
|
209
|
+
sx={{ minWidth: 180 }}
|
|
210
|
+
>
|
|
211
|
+
<InputLabel
|
|
212
|
+
id="recommended-addons-sort-label"
|
|
213
|
+
sx={{ fontSize: '1rem' }}
|
|
214
|
+
>
|
|
215
|
+
Sort by Price
|
|
216
|
+
</InputLabel>
|
|
217
|
+
<Select
|
|
218
|
+
labelId="recommended-addons-sort-label"
|
|
219
|
+
value={sortOrder}
|
|
220
|
+
label="Sort by Price"
|
|
221
|
+
onChange={handleSortChange}
|
|
222
|
+
sx={{ fontSize: '1rem' }}
|
|
223
|
+
>
|
|
224
|
+
<MenuItem value="" sx={{ fontSize: '1rem' }}>
|
|
225
|
+
<em>None</em>
|
|
226
|
+
</MenuItem>
|
|
227
|
+
<MenuItem value="asc" sx={{ fontSize: '1rem' }}>
|
|
228
|
+
<Box display="flex" alignItems="center">
|
|
229
|
+
<ArrowUpIcon fontSize="small" />
|
|
230
|
+
<Typography sx={{ ml: 0.5, fontSize: '1rem' }}>
|
|
231
|
+
Low to High
|
|
232
|
+
</Typography>
|
|
233
|
+
</Box>
|
|
234
|
+
</MenuItem>
|
|
235
|
+
<MenuItem value="desc" sx={{ fontSize: '1rem' }}>
|
|
236
|
+
<Box display="flex" alignItems="center">
|
|
237
|
+
<ArrowDownIcon fontSize="small" />
|
|
238
|
+
<Typography sx={{ ml: 0.5, fontSize: '1rem' }}>
|
|
239
|
+
High to Low
|
|
240
|
+
</Typography>
|
|
241
|
+
</Box>
|
|
242
|
+
</MenuItem>
|
|
243
|
+
</Select>
|
|
244
|
+
</FormControl>
|
|
245
|
+
</Box>
|
|
246
|
+
|
|
247
|
+
{filteredAndSortedItems.length === 0 ? (
|
|
248
|
+
<Box className="recommended-addons-modal__empty-state">
|
|
249
|
+
<Typography variant="body1">
|
|
250
|
+
No items match your search criteria.
|
|
251
|
+
</Typography>
|
|
252
|
+
</Box>
|
|
253
|
+
) : (
|
|
254
|
+
<Box className="recommended-addons-modal__list">
|
|
255
|
+
<Box className="recommended-addons-modal__list-header">
|
|
256
|
+
<Typography
|
|
257
|
+
variant="subtitle2"
|
|
258
|
+
className="recommended-addons-modal__header-name"
|
|
259
|
+
>
|
|
260
|
+
Product Name
|
|
261
|
+
</Typography>
|
|
262
|
+
<Typography
|
|
263
|
+
variant="subtitle2"
|
|
264
|
+
className="recommended-addons-modal__header-provider"
|
|
265
|
+
>
|
|
266
|
+
Provider
|
|
267
|
+
</Typography>
|
|
268
|
+
<Typography
|
|
269
|
+
variant="subtitle2"
|
|
270
|
+
className="recommended-addons-modal__header-price"
|
|
271
|
+
>
|
|
272
|
+
Price
|
|
273
|
+
</Typography>
|
|
274
|
+
<Typography
|
|
275
|
+
variant="subtitle2"
|
|
276
|
+
className="recommended-addons-modal__header-action"
|
|
277
|
+
>
|
|
278
|
+
Action
|
|
279
|
+
</Typography>
|
|
280
|
+
</Box>
|
|
281
|
+
{filteredAndSortedItems.map((item) => (
|
|
154
282
|
<RecommendedItemsCard
|
|
155
283
|
key={item.id}
|
|
156
284
|
recommendedItem={item}
|
|
157
285
|
/>
|
|
158
|
-
)}
|
|
159
|
-
</
|
|
160
|
-
)
|
|
161
|
-
|
|
286
|
+
))}
|
|
287
|
+
</Box>
|
|
288
|
+
)}
|
|
289
|
+
</>
|
|
162
290
|
)}
|
|
163
291
|
</DialogContent>
|
|
164
292
|
|
|
@@ -16,16 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
import { clsx, PlusIcon } from '@finos/legend-art';
|
|
18
18
|
import type { TerminalResult } from '@finos/legend-server-marketplace';
|
|
19
|
-
import {
|
|
20
|
-
Box,
|
|
21
|
-
Button,
|
|
22
|
-
Card,
|
|
23
|
-
CardActions,
|
|
24
|
-
CardContent,
|
|
25
|
-
Chip,
|
|
26
|
-
CircularProgress,
|
|
27
|
-
Typography,
|
|
28
|
-
} from '@mui/material';
|
|
19
|
+
import { Box, Button, CircularProgress, Typography } from '@mui/material';
|
|
29
20
|
import { flowResult } from 'mobx';
|
|
30
21
|
import { useState } from 'react';
|
|
31
22
|
import { assertErrorThrown } from '@finos/legend-shared';
|
|
@@ -33,12 +24,11 @@ import { toastManager } from '../Toast/CartToast.js';
|
|
|
33
24
|
import { useLegendMarketplaceBaseStore } from '../../application/providers/LegendMarketplaceFrameworkProvider.js';
|
|
34
25
|
|
|
35
26
|
interface RecommendedItemsCardProps {
|
|
36
|
-
vendorProfileId?: number;
|
|
37
27
|
recommendedItem: TerminalResult;
|
|
38
28
|
}
|
|
39
29
|
|
|
40
30
|
export const RecommendedItemsCard = (props: RecommendedItemsCardProps) => {
|
|
41
|
-
const {
|
|
31
|
+
const { recommendedItem } = props;
|
|
42
32
|
const legendMarketplaceBaseStore = useLegendMarketplaceBaseStore();
|
|
43
33
|
const [isAddingToCart, setIsAddingToCart] = useState(false);
|
|
44
34
|
const [inCart, setInCart] = useState(false);
|
|
@@ -47,9 +37,6 @@ export const RecommendedItemsCard = (props: RecommendedItemsCardProps) => {
|
|
|
47
37
|
setIsAddingToCart(true);
|
|
48
38
|
const cartItemRequest =
|
|
49
39
|
legendMarketplaceBaseStore.cartStore.providerToCartRequest(addon);
|
|
50
|
-
if (vendorProfileId) {
|
|
51
|
-
cartItemRequest.vendorProfileId = vendorProfileId;
|
|
52
|
-
}
|
|
53
40
|
|
|
54
41
|
flowResult(
|
|
55
42
|
legendMarketplaceBaseStore.cartStore.addToCartWithAPI(cartItemRequest),
|
|
@@ -70,62 +57,45 @@ export const RecommendedItemsCard = (props: RecommendedItemsCardProps) => {
|
|
|
70
57
|
};
|
|
71
58
|
|
|
72
59
|
return (
|
|
73
|
-
<
|
|
74
|
-
<
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
<Box className="recommended-addons-modal__card-footer">
|
|
97
|
-
<Typography
|
|
98
|
-
variant="body2"
|
|
99
|
-
className={clsx('recommended-addons-modal__price', {
|
|
100
|
-
'recommended-addons-modal__price__free':
|
|
101
|
-
recommendedItem.price === 0,
|
|
60
|
+
<Box className="recommended-addons-modal__list-item">
|
|
61
|
+
<Typography
|
|
62
|
+
variant="body1"
|
|
63
|
+
className="recommended-addons-modal__item-name"
|
|
64
|
+
>
|
|
65
|
+
{recommendedItem.productName}
|
|
66
|
+
</Typography>
|
|
67
|
+
<Typography
|
|
68
|
+
variant="body2"
|
|
69
|
+
className="recommended-addons-modal__item-provider"
|
|
70
|
+
>
|
|
71
|
+
{recommendedItem.providerName}
|
|
72
|
+
</Typography>
|
|
73
|
+
<Typography
|
|
74
|
+
variant="body2"
|
|
75
|
+
className="recommended-addons-modal__item-price"
|
|
76
|
+
>
|
|
77
|
+
{recommendedItem.price === 0
|
|
78
|
+
? 'Free'
|
|
79
|
+
: recommendedItem.price.toLocaleString('en-US', {
|
|
80
|
+
style: 'currency',
|
|
81
|
+
currency: 'USD',
|
|
82
|
+
maximumFractionDigits: 2,
|
|
102
83
|
})}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
? 'Free'
|
|
106
|
-
: recommendedItem.price.toLocaleString('en-US', {
|
|
107
|
-
style: 'currency',
|
|
108
|
-
currency: 'USD',
|
|
109
|
-
maximumFractionDigits: 2,
|
|
110
|
-
})}
|
|
111
|
-
</Typography>
|
|
112
|
-
</Box>
|
|
113
|
-
</CardContent>
|
|
114
|
-
|
|
115
|
-
<CardActions className="recommended-addons-modal__card-actions">
|
|
84
|
+
</Typography>
|
|
85
|
+
<Box className="recommended-addons-modal__item-action">
|
|
116
86
|
<Button
|
|
117
87
|
variant={inCart ? 'outlined' : 'contained'}
|
|
118
88
|
onClick={() => handleAddAddonToCart(recommendedItem)}
|
|
119
89
|
disabled={inCart || isAddingToCart}
|
|
120
|
-
|
|
90
|
+
size="small"
|
|
121
91
|
className={clsx('recommended-addons-modal__add-btn', {
|
|
122
|
-
'recommended-addons-modal__add-
|
|
92
|
+
'recommended-addons-modal__add-btn--added': inCart,
|
|
123
93
|
})}
|
|
124
94
|
>
|
|
125
95
|
{isAddingToCart ? (
|
|
126
96
|
<>
|
|
127
97
|
Adding...
|
|
128
|
-
<CircularProgress size={
|
|
98
|
+
<CircularProgress size={14} />
|
|
129
99
|
</>
|
|
130
100
|
) : inCart ? (
|
|
131
101
|
'Added to Cart'
|
|
@@ -136,7 +106,7 @@ export const RecommendedItemsCard = (props: RecommendedItemsCardProps) => {
|
|
|
136
106
|
</>
|
|
137
107
|
)}
|
|
138
108
|
</Button>
|
|
139
|
-
</
|
|
140
|
-
</
|
|
109
|
+
</Box>
|
|
110
|
+
</Box>
|
|
141
111
|
);
|
|
142
112
|
};
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import type React from 'react';
|
|
18
|
-
import {
|
|
19
|
-
import { isNonNullable } from '@finos/legend-shared';
|
|
18
|
+
import { useLegendMarketplaceBaseStore } from '../../application/providers/LegendMarketplaceFrameworkProvider.js';
|
|
19
|
+
import { isNonNullable, isValidUrl } from '@finos/legend-shared';
|
|
20
20
|
import {
|
|
21
21
|
CopyIcon,
|
|
22
22
|
Dialog,
|
|
@@ -28,24 +28,68 @@ import {
|
|
|
28
28
|
ModalTitle,
|
|
29
29
|
TimesIcon,
|
|
30
30
|
} from '@finos/legend-art';
|
|
31
|
+
import { observer } from 'mobx-react-lite';
|
|
32
|
+
import { TextField } from '@mui/material';
|
|
31
33
|
|
|
32
34
|
export const LegendMarketplaceAppInfo: React.FC<{
|
|
33
35
|
open: boolean;
|
|
34
36
|
closeModal: () => void;
|
|
35
|
-
}> = (props) => {
|
|
37
|
+
}> = observer((props) => {
|
|
36
38
|
const { open, closeModal } = props;
|
|
37
|
-
const
|
|
39
|
+
const legendMarketplaceBaseStore = useLegendMarketplaceBaseStore();
|
|
40
|
+
const applicationStore = legendMarketplaceBaseStore.applicationStore;
|
|
38
41
|
const config = applicationStore.config;
|
|
42
|
+
|
|
43
|
+
const configData: {
|
|
44
|
+
label: string;
|
|
45
|
+
value: string | undefined;
|
|
46
|
+
}[] = [
|
|
47
|
+
{
|
|
48
|
+
label: 'Environment',
|
|
49
|
+
value: config.env,
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
label: 'Version',
|
|
53
|
+
value: config.appVersion,
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
label: 'Revision',
|
|
57
|
+
value: config.appVersionCommitId,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
label: 'Build Time',
|
|
61
|
+
value: config.appVersionBuildTime,
|
|
62
|
+
},
|
|
63
|
+
];
|
|
64
|
+
|
|
65
|
+
const serverData: {
|
|
66
|
+
label: string;
|
|
67
|
+
value: string | undefined;
|
|
68
|
+
setter?: (val: string | undefined) => void;
|
|
69
|
+
}[] = [
|
|
70
|
+
{
|
|
71
|
+
label: 'Engine Server',
|
|
72
|
+
value: config.engineServerUrl,
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
label: 'Depot Server',
|
|
76
|
+
value: config.depotServerUrl,
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
label: 'Marketplace Server',
|
|
80
|
+
value: legendMarketplaceBaseStore.marketplaceServerClient.baseUrl,
|
|
81
|
+
setter: (val: string | undefined): void =>
|
|
82
|
+
legendMarketplaceBaseStore.marketplaceServerClient.setBaseUrl(val),
|
|
83
|
+
},
|
|
84
|
+
];
|
|
85
|
+
|
|
39
86
|
const copyInfo = (): void => {
|
|
40
87
|
applicationStore.clipboardService
|
|
41
88
|
.copyTextToClipboard(
|
|
42
89
|
[
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
`Build Time: ${config.appVersionBuildTime}`,
|
|
47
|
-
`Engine Server: ${config.engineServerUrl}`,
|
|
48
|
-
`Depot Server: ${config.depotServerUrl}`,
|
|
90
|
+
[...configData, ...serverData].map(
|
|
91
|
+
(data) => `${data.label}: ${data.value}`,
|
|
92
|
+
),
|
|
49
93
|
]
|
|
50
94
|
.filter(isNonNullable)
|
|
51
95
|
.join('\n'),
|
|
@@ -92,26 +136,12 @@ export const LegendMarketplaceAppInfo: React.FC<{
|
|
|
92
136
|
</ModalHeaderActions>
|
|
93
137
|
</ModalHeader>
|
|
94
138
|
<ModalBody>
|
|
95
|
-
|
|
96
|
-
<div className="
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
<div className="app__info__entry">
|
|
100
|
-
<div className="app__info__entry__title">Version:</div>
|
|
101
|
-
<div className="app__info__entry__value">{config.appVersion}</div>
|
|
102
|
-
</div>
|
|
103
|
-
<div className="app__info__entry">
|
|
104
|
-
<div className="app__info__entry__title">Revision:</div>
|
|
105
|
-
<div className="app__info__entry__value">
|
|
106
|
-
{config.appVersionCommitId}
|
|
139
|
+
{configData.map((data) => (
|
|
140
|
+
<div key={data.label} className="app__info__entry">
|
|
141
|
+
<div className="app__info__entry__title">{data.label}:</div>
|
|
142
|
+
<div className="app__info__entry__value">{data.value}</div>
|
|
107
143
|
</div>
|
|
108
|
-
|
|
109
|
-
<div className="app__info__entry">
|
|
110
|
-
<div className="app__info__entry__title">Build Time:</div>
|
|
111
|
-
<div className="app__info__entry__value">
|
|
112
|
-
{config.appVersionBuildTime}
|
|
113
|
-
</div>
|
|
114
|
-
</div>
|
|
144
|
+
))}
|
|
115
145
|
<div className="app__info__entry">
|
|
116
146
|
<div
|
|
117
147
|
onClick={goToReleaseLog}
|
|
@@ -121,33 +151,54 @@ export const LegendMarketplaceAppInfo: React.FC<{
|
|
|
121
151
|
</div>
|
|
122
152
|
</div>
|
|
123
153
|
<div className="app__info__group">
|
|
124
|
-
|
|
125
|
-
<div className="
|
|
126
|
-
|
|
127
|
-
<
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
154
|
+
{serverData.map((data) => (
|
|
155
|
+
<div key={data.label} className="app__info__entry">
|
|
156
|
+
<div className="app__info__entry__title">{data.label}:</div>
|
|
157
|
+
<div className="app__info__entry__value">
|
|
158
|
+
{data.setter === undefined ? (
|
|
159
|
+
<a
|
|
160
|
+
href={data.value}
|
|
161
|
+
target="_blank"
|
|
162
|
+
rel="noopener noreferrer"
|
|
163
|
+
>
|
|
164
|
+
{data.value}
|
|
165
|
+
</a>
|
|
166
|
+
) : (
|
|
167
|
+
<TextField
|
|
168
|
+
value={data.value}
|
|
169
|
+
spellCheck={false}
|
|
170
|
+
onChange={(event) => {
|
|
171
|
+
const stringValue = event.target.value;
|
|
172
|
+
data.setter?.(stringValue ? stringValue : undefined);
|
|
173
|
+
}}
|
|
174
|
+
placeholder={`${data.label} client base URL`}
|
|
175
|
+
error={!isValidUrl(data.value ?? '')}
|
|
176
|
+
helperText={
|
|
177
|
+
!isValidUrl(data.value ?? '')
|
|
178
|
+
? 'Invalid URL'
|
|
179
|
+
: undefined
|
|
180
|
+
}
|
|
181
|
+
variant="outlined"
|
|
182
|
+
size="small"
|
|
183
|
+
fullWidth={true}
|
|
184
|
+
className="app__info__entry__value--editable"
|
|
185
|
+
slotProps={{
|
|
186
|
+
htmlInput: {
|
|
187
|
+
className: 'app__info__entry__value--editable__input',
|
|
188
|
+
},
|
|
189
|
+
formHelperText: {
|
|
190
|
+
className:
|
|
191
|
+
'app__info__entry__value--editable__helper-text',
|
|
192
|
+
},
|
|
193
|
+
}}
|
|
194
|
+
/>
|
|
195
|
+
)}
|
|
196
|
+
</div>
|
|
134
197
|
</div>
|
|
135
|
-
|
|
136
|
-
<div className="app__info__entry">
|
|
137
|
-
<div className="app__info__entry__title">Depot Server:</div>
|
|
138
|
-
<div className="app__info__entry__value">
|
|
139
|
-
<a
|
|
140
|
-
href={config.depotServerUrl}
|
|
141
|
-
target="_blank"
|
|
142
|
-
rel="noopener noreferrer"
|
|
143
|
-
>
|
|
144
|
-
{config.depotServerUrl}
|
|
145
|
-
</a>
|
|
146
|
-
</div>
|
|
147
|
-
</div>
|
|
198
|
+
))}
|
|
148
199
|
</div>
|
|
149
200
|
</ModalBody>
|
|
150
201
|
</Modal>
|
|
151
202
|
</Dialog>
|
|
152
203
|
);
|
|
153
|
-
};
|
|
204
|
+
});
|
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
CardMedia,
|
|
26
26
|
Chip,
|
|
27
27
|
CircularProgress,
|
|
28
|
+
Typography,
|
|
28
29
|
} from '@mui/material';
|
|
29
30
|
import type { TerminalResult } from '@finos/legend-server-marketplace';
|
|
30
31
|
import { CheckCircleIcon, ShoppingCartIcon } from '@finos/legend-art';
|
|
@@ -104,10 +105,25 @@ export const LegendMarketplaceTerminalCard = observer(
|
|
|
104
105
|
image={getImageUrl()}
|
|
105
106
|
alt="data asset"
|
|
106
107
|
/>
|
|
108
|
+
{terminalResult.category && (
|
|
109
|
+
<Chip
|
|
110
|
+
label={terminalResult.category}
|
|
111
|
+
className="legend-marketplace-terminal-card__category-chip"
|
|
112
|
+
/>
|
|
113
|
+
)}
|
|
107
114
|
<CardContent className="legend-marketplace-terminal-card__content">
|
|
108
|
-
<
|
|
115
|
+
<Typography
|
|
116
|
+
variant="subtitle2"
|
|
117
|
+
className="legend-marketplace-terminal-card__provider"
|
|
118
|
+
>
|
|
119
|
+
{terminalResult.providerName}
|
|
120
|
+
</Typography>
|
|
121
|
+
<Typography
|
|
122
|
+
variant="h6"
|
|
123
|
+
className="legend-marketplace-terminal-card__title"
|
|
124
|
+
>
|
|
109
125
|
{terminalResult.productName}
|
|
110
|
-
</
|
|
126
|
+
</Typography>
|
|
111
127
|
</CardContent>
|
|
112
128
|
</CardActionArea>
|
|
113
129
|
<CardActions className="legend-marketplace-terminal-card__action-buttons">
|