@digital-ai/dot-components 2.3.0 → 2.3.2
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/CHANGE_LOG.md +21 -4
- package/index.esm.js +51 -25
- package/index.umd.js +70 -40
- package/lib/components/app-switcher/AppSwitcher.d.ts +2 -1
- package/package.json +1 -1
package/CHANGE_LOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.3.2](https://www.npmjs.com/package/@digital-ai/dot-components) (02/23/2023)
|
|
4
|
+
|
|
5
|
+
[Full Changelog](https://digital-ai.github.io/dot-components/?path=/story/introduction--page/digital-ai/dot-components/compare/2.3.1...2.3.2)
|
|
6
|
+
|
|
7
|
+
**Fixed bugs:**
|
|
8
|
+
|
|
9
|
+
- S-89896: Still trying to get SQ off its \(non-\)duplicate obsession [\#1388](https://github.com/digital-ai/dot-components/pull/1388) ([jmcnally](https://github.com/jmcnally))
|
|
10
|
+
- S-89896: Sort app types alphabetically [\#1384](https://github.com/digital-ai/dot-components/pull/1384) ([jmcnally](https://github.com/jmcnally))
|
|
11
|
+
- S-89896: Handle non-product apps in their own group [\#1381](https://github.com/digital-ai/dot-components/pull/1381) ([jmcnally](https://github.com/jmcnally))
|
|
12
|
+
|
|
13
|
+
## [2.3.1](https://www.npmjs.com/package/@digital-ai/dot-components) (02/15/2023)
|
|
14
|
+
|
|
15
|
+
[Full Changelog](https://digital-ai.github.io/dot-components/?path=/story/introduction--page/digital-ai/dot-components/compare/2.3.0...2.3.1)
|
|
16
|
+
|
|
17
|
+
**Fixed bugs:**
|
|
18
|
+
|
|
19
|
+
- S-89896: Remove 'identity.' from host when constructing platform url [\#1379](https://github.com/digital-ai/dot-components/pull/1379) ([jmcnally](https://github.com/jmcnally))
|
|
20
|
+
|
|
3
21
|
## [2.3.0](https://www.npmjs.com/package/@digital-ai/dot-components) (02/09/2023)
|
|
4
22
|
|
|
5
23
|
[Full Changelog](https://digital-ai.github.io/dot-components/?path=/story/introduction--page/digital-ai/dot-components/compare/2.2.1...2.3.0)
|
|
@@ -36,7 +54,6 @@
|
|
|
36
54
|
- Upload drip echo icon [\#1366](https://github.com/digital-ai/dot-components/pull/1366) ([pauldigitalai](https://github.com/pauldigitalai))
|
|
37
55
|
- S-90007 Add missing test [\#1362](https://github.com/digital-ai/dot-components/pull/1362) ([angel-git](https://github.com/angel-git))
|
|
38
56
|
- icons-pin-update-Jan-27th [\#1354](https://github.com/digital-ai/dot-components/pull/1354) ([pauldigitalai](https://github.com/pauldigitalai))
|
|
39
|
-
- S-80702: adjust letter spacing of overline, add additional e2e tests [\#1345](https://github.com/digital-ai/dot-components/pull/1345) ([CWSites](https://github.com/CWSites))
|
|
40
57
|
|
|
41
58
|
## [1.21.8](https://www.npmjs.com/package/@digital-ai/dot-components) (02/04/2023)
|
|
42
59
|
|
|
@@ -61,6 +78,7 @@
|
|
|
61
78
|
|
|
62
79
|
**Misc:**
|
|
63
80
|
|
|
81
|
+
- S-80702: adjust letter spacing of overline, add additional e2e tests [\#1345](https://github.com/digital-ai/dot-components/pull/1345) ([CWSites](https://github.com/CWSites))
|
|
64
82
|
- S-88495: update warning 900 color [\#1344](https://github.com/digital-ai/dot-components/pull/1344) ([CWSites](https://github.com/CWSites))
|
|
65
83
|
|
|
66
84
|
## [2.1.1](https://www.npmjs.com/package/@digital-ai/dot-components) (12/15/2022)
|
|
@@ -270,7 +288,6 @@
|
|
|
270
288
|
|
|
271
289
|
**Fixed bugs:**
|
|
272
290
|
|
|
273
|
-
- D-20378: update input margin to account for helper text [\#1212](https://github.com/digital-ai/dot-components/pull/1212) ([CWSites](https://github.com/CWSites))
|
|
274
291
|
- D-21918: Update `DotAlertBanner` to match Figma [\#1208](https://github.com/digital-ai/dot-components/pull/1208) ([CWSites](https://github.com/CWSites))
|
|
275
292
|
|
|
276
293
|
## [1.19.1](https://www.npmjs.com/package/@digital-ai/dot-components) (07/18/2022)
|
|
@@ -282,6 +299,7 @@
|
|
|
282
299
|
- D-22029: `DotAutocomplete`: fix id attribute on input [\#1217](https://github.com/digital-ai/dot-components/pull/1217) ([angel-git](https://github.com/angel-git))
|
|
283
300
|
- D-20693: `DotSidebar` updates to match Figma [\#1214](https://github.com/digital-ai/dot-components/pull/1214) ([CWSites](https://github.com/CWSites))
|
|
284
301
|
- D-20329: add href to application logo [\#1213](https://github.com/digital-ai/dot-components/pull/1213) ([CWSites](https://github.com/CWSites))
|
|
302
|
+
- D-20378: update input margin to account for helper text [\#1212](https://github.com/digital-ai/dot-components/pull/1212) ([CWSites](https://github.com/CWSites))
|
|
285
303
|
- D-20404: update table border color [\#1211](https://github.com/digital-ai/dot-components/pull/1211) ([CWSites](https://github.com/CWSites))
|
|
286
304
|
- D-21972: Adds props for custom tooltip position in ListItemProps [\#1207](https://github.com/digital-ai/dot-components/pull/1207) ([s-zimm](https://github.com/s-zimm))
|
|
287
305
|
|
|
@@ -296,7 +314,6 @@
|
|
|
296
314
|
**Fixed bugs:**
|
|
297
315
|
|
|
298
316
|
- D-21935 `DotAutocomplete` with action item, on enter key if no option is selected should trigger the action AND close it [\#1204](https://github.com/digital-ai/dot-components/pull/1204) ([angel-git](https://github.com/angel-git))
|
|
299
|
-
- S-84140: `AvatarGroup` updates [\#1192](https://github.com/digital-ai/dot-components/pull/1192) ([CWSites](https://github.com/CWSites))
|
|
300
317
|
- D-19158: safari font weight [\#1175](https://github.com/digital-ai/dot-components/pull/1175) ([CWSites](https://github.com/CWSites))
|
|
301
318
|
|
|
302
319
|
## [1.18.0](https://www.npmjs.com/package/@digital-ai/dot-components) (06/21/2022)
|
|
@@ -639,6 +656,7 @@
|
|
|
639
656
|
|
|
640
657
|
**Fixed bugs:**
|
|
641
658
|
|
|
659
|
+
- D-19415: `1.6.0` - Sidebar links broken, import was moved [\#926](https://github.com/digital-ai/dot-components/pull/926) ([dmiletic85](https://github.com/dmiletic85))
|
|
642
660
|
- D-19390: `Autocomplete` doesn't have `dot-input` class [\#924](https://github.com/digital-ai/dot-components/pull/924) ([dmiletic85](https://github.com/dmiletic85))
|
|
643
661
|
|
|
644
662
|
## [1.6.0](https://www.npmjs.com/package/@digital-ai/dot-components) (01/03/2022)
|
|
@@ -651,7 +669,6 @@
|
|
|
651
669
|
|
|
652
670
|
**Fixed bugs:**
|
|
653
671
|
|
|
654
|
-
- D-19415: `1.6.0` - Sidebar links broken, import was moved [\#926](https://github.com/digital-ai/dot-components/pull/926) ([dmiletic85](https://github.com/dmiletic85))
|
|
655
672
|
- D-19382: `DynamicForm`: `isRequired` with value of `false` is not respected [\#919](https://github.com/digital-ai/dot-components/pull/919) ([dmiletic85](https://github.com/dmiletic85))
|
|
656
673
|
- D-19381: `Storybook`: issue while clicking on `Docs` page of `Menu` component [\#917](https://github.com/digital-ai/dot-components/pull/917) ([dmiletic85](https://github.com/dmiletic85))
|
|
657
674
|
- D-19379: `DynamicForm` doesn't export all types [\#915](https://github.com/digital-ai/dot-components/pull/915) ([dmiletic85](https://github.com/dmiletic85))
|
package/index.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { useState, useEffect, useRef, useMemo, useContext, createContext, forwardRef, Fragment as Fragment$1, createElement
|
|
3
|
+
import { useState, useEffect, useRef, useMemo, useContext, createContext, useCallback, forwardRef, Fragment as Fragment$1, createElement } from 'react';
|
|
4
4
|
import { Tooltip, Icon, Typography, Accordion, AccordionSummary, AccordionDetails, AccordionActions, InputAdornment, InputLabel, TextField, Toolbar, Alert, Fade, Avatar, IconButton, Link, Drawer, Button, darken, List, ListItem, CircularProgress, Popper, MenuList, MenuItem, Paper, ClickAwayListener, ListItemIcon, Collapse, ListSubheader, Divider, ListItemText, Badge, useMediaQuery, Autocomplete, Chip, AvatarGroup, Breadcrumbs, ToggleButtonGroup, ToggleButton, Card, CardContent, CardHeader, FormControlLabel, Checkbox, FormControl, FormGroup, FormLabel, FormHelperText, Dialog, DialogContent, DialogActions, useTheme as useTheme$1, RadioGroup, Radio, Switch, Skeleton, Snackbar, ButtonGroup, TablePagination, TableContainer, TableCell, TableRow, TableBody, TableSortLabel, TableHead, Table, Tabs, Tab, LinearProgress } from '@mui/material';
|
|
5
5
|
import styled, { css, createGlobalStyle, ThemeProvider as ThemeProvider$1, keyframes } from 'styled-components';
|
|
6
6
|
import { createTheme, ThemeProvider, alpha, useTheme } from '@mui/material/styles';
|
|
@@ -1372,8 +1372,9 @@ function useCancelablePromise() {
|
|
|
1372
1372
|
}
|
|
1373
1373
|
|
|
1374
1374
|
const nullStr = null;
|
|
1375
|
-
|
|
1376
|
-
|
|
1375
|
+
let idCount = 100;
|
|
1376
|
+
const createAppInstance = (name, instance_state, appType = 'Deploy') => ({
|
|
1377
|
+
id: '757e74ed-389b-4ec4-be29-bfed6738b' + idCount++,
|
|
1377
1378
|
product_instance_id: nullStr,
|
|
1378
1379
|
account_id: 'c390d325-1628-4c4e-a1ee-d269e025c34e',
|
|
1379
1380
|
enabled: true,
|
|
@@ -1385,13 +1386,14 @@ const deployAppInstance = (id, name, instance_state) => ({
|
|
|
1385
1386
|
alternate_label: nullStr,
|
|
1386
1387
|
logo: nullStr,
|
|
1387
1388
|
needs_authentication: false,
|
|
1388
|
-
logo_product_name:
|
|
1389
|
-
instance_state
|
|
1389
|
+
logo_product_name: appType,
|
|
1390
|
+
instance_state: instance_state % 2
|
|
1390
1391
|
});
|
|
1391
|
-
const testData = [['
|
|
1392
|
+
const testData = [['QA Deploy', 0], ['Deploy 1', 1], ['Deploy 2er', 5], ['Deploy 3rf', 3], ['Deploy 4', 7], ['Deploy 5', 9], ['Deploy 5a', 101], ['Deploy 5b', 91], ['Deploy 6', 2], ['Deploy 7', 3], ['Deploy 8c', 21], ['Deploy 9', 20], ['Deploy 10m', 10], ['Deploy 11', 11], ['Deploy 12qa', 30], ['Deploy 13', 31], ['Deploy 14d', 41], ['Deploy 15', 45], ['Deploy 16', 40], ['Deploy 17', 51], ['Deploy 18', 70], ['Deploy 19a', 61], ['Deploy 20', 63], ['Deploy 21', 67], ['Deploy 22p', 65], ['Deploy 23', 73], ['Deploy 24o', 93], ['Deploy 25', 11], ['Deploy 26', 80], ['Deploy 27io', 81], ['Deploy 28ty', 87], ['Deploy 29', 76], ['Deploy 30rt', 97], ['Deploy 31sd', 37], ['Deploy 32as', 39], ['Deploy 33', 12], ['No type 1c', 13], ['Deploy 34pl', 19], ['No type 2t', 14], ['Deploy 35', 17], ['No type 3h', 44], ['Deploy 36d', 55]];
|
|
1392
1393
|
const deployInstances = [];
|
|
1393
|
-
for (const [
|
|
1394
|
-
|
|
1394
|
+
for (const [name, instanceState] of testData) {
|
|
1395
|
+
const appType = name.startsWith('No type') ? null : 'Deploy';
|
|
1396
|
+
deployInstances.push(createAppInstance(name, instanceState, appType));
|
|
1395
1397
|
}
|
|
1396
1398
|
let applications = [{
|
|
1397
1399
|
id: 'be6e1e4f-7009-4412-b3ba-e5633cbe6be0',
|
|
@@ -1540,7 +1542,11 @@ const DotCoreApiProvider = ({
|
|
|
1540
1542
|
const issUrl = new URL(iss);
|
|
1541
1543
|
const pathArray = issUrl.pathname.split('/');
|
|
1542
1544
|
const vanityDomain = pathArray[pathArray.length - 1];
|
|
1543
|
-
|
|
1545
|
+
let host = issUrl.hostname === 'localhost' ? 'local.digital.ai:4200' : issUrl.host;
|
|
1546
|
+
const identity = 'identity.';
|
|
1547
|
+
if (host.startsWith(identity)) {
|
|
1548
|
+
host = host.substring(identity.length);
|
|
1549
|
+
}
|
|
1544
1550
|
const consoleUrl = issUrl.protocol + '//' + vanityDomain + '.' + host + '/';
|
|
1545
1551
|
setPlatformConsoleUrl(consoleUrl);
|
|
1546
1552
|
} catch (e) {
|
|
@@ -1975,15 +1981,19 @@ const createTopLevelMenuItem = (url, logo, title, openNewTab = true) => {
|
|
|
1975
1981
|
}), `top-menu-item-${title}`);
|
|
1976
1982
|
};
|
|
1977
1983
|
const createAppTypeLabel = (appTypeName, logo, appProps) => {
|
|
1984
|
+
const logoProps = logo ? {
|
|
1985
|
+
imageSrc: logo
|
|
1986
|
+
} : {
|
|
1987
|
+
iconId: 'collection'
|
|
1988
|
+
};
|
|
1978
1989
|
return jsxs("div", Object.assign({
|
|
1979
1990
|
className: "logo-title"
|
|
1980
1991
|
}, {
|
|
1981
|
-
children: [jsx(DotAvatar, {
|
|
1992
|
+
children: [jsx(DotAvatar, Object.assign({}, logoProps, {
|
|
1982
1993
|
alt: "app image",
|
|
1983
|
-
imageSrc: logo,
|
|
1984
1994
|
type: "image",
|
|
1985
1995
|
variant: "circular"
|
|
1986
|
-
}, void 0), jsxs("div", Object.assign({
|
|
1996
|
+
}), void 0), jsxs("div", Object.assign({
|
|
1987
1997
|
className: "dot-app-switcher-app-title"
|
|
1988
1998
|
}, {
|
|
1989
1999
|
children: [jsx(DotTypography, Object.assign({
|
|
@@ -2184,6 +2194,7 @@ const DotAppSwitcherView = ({
|
|
|
2184
2194
|
activeApp,
|
|
2185
2195
|
apps,
|
|
2186
2196
|
className,
|
|
2197
|
+
noAppTypeLabel: _noAppTypeLabel = 'Other',
|
|
2187
2198
|
platformConsoleUrl,
|
|
2188
2199
|
onClose,
|
|
2189
2200
|
open,
|
|
@@ -2205,19 +2216,26 @@ const DotAppSwitcherView = ({
|
|
|
2205
2216
|
selectedAppType = selectedAppTypeAlt;
|
|
2206
2217
|
setSelectedAppType = setSelectedAppTypeAlt;
|
|
2207
2218
|
}
|
|
2208
|
-
const showApps = appType => {
|
|
2219
|
+
const showApps = useCallback(appType => {
|
|
2209
2220
|
setSelectedAppType(appType);
|
|
2210
|
-
};
|
|
2211
|
-
const showAppTypes = () => setSelectedAppType(null);
|
|
2212
|
-
const populateAppTypeMap = () => {
|
|
2221
|
+
}, []);
|
|
2222
|
+
const showAppTypes = useCallback(() => setSelectedAppType(null), []);
|
|
2223
|
+
const populateAppTypeMap = useCallback(() => {
|
|
2213
2224
|
const newAppTypeMap = new Map();
|
|
2225
|
+
// we'll put Other at the end
|
|
2226
|
+
const otherApps = [];
|
|
2214
2227
|
apps === null || apps === void 0 ? void 0 : apps.forEach(app => {
|
|
2215
|
-
const appTypeName = app.logo_product_name;
|
|
2216
2228
|
const children = createMenuItem(app.url, app.name, getInstanceStateText(app));
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
newAppTypeMap.
|
|
2229
|
+
const appTypeName = app.logo_product_name;
|
|
2230
|
+
let appTypeApps;
|
|
2231
|
+
if (appTypeName) {
|
|
2232
|
+
appTypeApps = newAppTypeMap.get(appTypeName);
|
|
2233
|
+
if (!appTypeApps) {
|
|
2234
|
+
appTypeApps = [];
|
|
2235
|
+
newAppTypeMap.set(appTypeName, appTypeApps);
|
|
2236
|
+
}
|
|
2237
|
+
} else {
|
|
2238
|
+
appTypeApps = otherApps;
|
|
2221
2239
|
}
|
|
2222
2240
|
appTypeApps.push({
|
|
2223
2241
|
children,
|
|
@@ -2225,7 +2243,15 @@ const DotAppSwitcherView = ({
|
|
|
2225
2243
|
height: 64
|
|
2226
2244
|
});
|
|
2227
2245
|
});
|
|
2228
|
-
|
|
2246
|
+
const keys = Array.from(newAppTypeMap.keys()).sort();
|
|
2247
|
+
const sortedAppTypeMap = new Map();
|
|
2248
|
+
for (const appType of keys) {
|
|
2249
|
+
sortedAppTypeMap.set(appType, newAppTypeMap.get(appType));
|
|
2250
|
+
}
|
|
2251
|
+
if (otherApps.length > 0) {
|
|
2252
|
+
sortedAppTypeMap.set(_noAppTypeLabel, otherApps);
|
|
2253
|
+
}
|
|
2254
|
+
setAppTypeMap(sortedAppTypeMap);
|
|
2229
2255
|
const menuItems = [daiAppsHeaderMenuItem];
|
|
2230
2256
|
if (platformConsoleUrl) {
|
|
2231
2257
|
const children = createTopLevelMenuItem(platformConsoleUrl, getLogoForAppType('Platform'), 'Digital.ai Platform', !window.location.href.startsWith(platformConsoleUrl));
|
|
@@ -2236,9 +2262,9 @@ const DotAppSwitcherView = ({
|
|
|
2236
2262
|
});
|
|
2237
2263
|
}
|
|
2238
2264
|
const newAppTypeLabels = new Map();
|
|
2239
|
-
|
|
2265
|
+
sortedAppTypeMap.forEach((singleTypeApps, appTypeName) => {
|
|
2240
2266
|
if ((singleTypeApps === null || singleTypeApps === void 0 ? void 0 : singleTypeApps.length) > 0) {
|
|
2241
|
-
const logo = getLogoForAppType(appTypeName);
|
|
2267
|
+
const logo = appTypeName === _noAppTypeLabel ? null : getLogoForAppType(appTypeName);
|
|
2242
2268
|
newAppTypeLabels.set(appTypeName, {
|
|
2243
2269
|
logo,
|
|
2244
2270
|
singleTypeApps
|
|
@@ -2259,7 +2285,7 @@ const DotAppSwitcherView = ({
|
|
|
2259
2285
|
});
|
|
2260
2286
|
setAppTypeMenuItems(menuItems);
|
|
2261
2287
|
setAppTypeLabels(newAppTypeLabels);
|
|
2262
|
-
};
|
|
2288
|
+
}, [apps]);
|
|
2263
2289
|
const emptyState = () => {
|
|
2264
2290
|
const currentAppMenuItem = createTopLevelMenuItem(window.location.href, getLogoForAppType(activeApp.product), activeApp.name, false);
|
|
2265
2291
|
setAppTypeMenuItems([daiAppsHeaderMenuItem, {
|
package/index.umd.js
CHANGED
|
@@ -1548,9 +1548,13 @@
|
|
|
1548
1548
|
}
|
|
1549
1549
|
|
|
1550
1550
|
var nullStr = null;
|
|
1551
|
-
var
|
|
1551
|
+
var idCount = 100;
|
|
1552
|
+
var createAppInstance = function createAppInstance(name, instance_state, appType) {
|
|
1553
|
+
if (appType === void 0) {
|
|
1554
|
+
appType = 'Deploy';
|
|
1555
|
+
}
|
|
1552
1556
|
return {
|
|
1553
|
-
id:
|
|
1557
|
+
id: '757e74ed-389b-4ec4-be29-bfed6738b' + idCount++,
|
|
1554
1558
|
product_instance_id: nullStr,
|
|
1555
1559
|
account_id: 'c390d325-1628-4c4e-a1ee-d269e025c34e',
|
|
1556
1560
|
enabled: true,
|
|
@@ -1562,18 +1566,18 @@
|
|
|
1562
1566
|
alternate_label: nullStr,
|
|
1563
1567
|
logo: nullStr,
|
|
1564
1568
|
needs_authentication: false,
|
|
1565
|
-
logo_product_name:
|
|
1566
|
-
instance_state: instance_state
|
|
1569
|
+
logo_product_name: appType,
|
|
1570
|
+
instance_state: instance_state % 2
|
|
1567
1571
|
};
|
|
1568
1572
|
};
|
|
1569
|
-
var testData = [['
|
|
1573
|
+
var testData = [['QA Deploy', 0], ['Deploy 1', 1], ['Deploy 2er', 5], ['Deploy 3rf', 3], ['Deploy 4', 7], ['Deploy 5', 9], ['Deploy 5a', 101], ['Deploy 5b', 91], ['Deploy 6', 2], ['Deploy 7', 3], ['Deploy 8c', 21], ['Deploy 9', 20], ['Deploy 10m', 10], ['Deploy 11', 11], ['Deploy 12qa', 30], ['Deploy 13', 31], ['Deploy 14d', 41], ['Deploy 15', 45], ['Deploy 16', 40], ['Deploy 17', 51], ['Deploy 18', 70], ['Deploy 19a', 61], ['Deploy 20', 63], ['Deploy 21', 67], ['Deploy 22p', 65], ['Deploy 23', 73], ['Deploy 24o', 93], ['Deploy 25', 11], ['Deploy 26', 80], ['Deploy 27io', 81], ['Deploy 28ty', 87], ['Deploy 29', 76], ['Deploy 30rt', 97], ['Deploy 31sd', 37], ['Deploy 32as', 39], ['Deploy 33', 12], ['No type 1c', 13], ['Deploy 34pl', 19], ['No type 2t', 14], ['Deploy 35', 17], ['No type 3h', 44], ['Deploy 36d', 55]];
|
|
1570
1574
|
var deployInstances = [];
|
|
1571
1575
|
for (var _i = 0, testData_1 = testData; _i < testData_1.length; _i++) {
|
|
1572
1576
|
var _a = testData_1[_i],
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
deployInstances.push(
|
|
1577
|
+
name_1 = _a[0],
|
|
1578
|
+
instanceState = _a[1];
|
|
1579
|
+
var appType = name_1.startsWith('No type') ? null : 'Deploy';
|
|
1580
|
+
deployInstances.push(createAppInstance(name_1, instanceState, appType));
|
|
1577
1581
|
}
|
|
1578
1582
|
var applications = [{
|
|
1579
1583
|
id: 'be6e1e4f-7009-4412-b3ba-e5633cbe6be0',
|
|
@@ -1734,6 +1738,10 @@
|
|
|
1734
1738
|
var pathArray = issUrl.pathname.split('/');
|
|
1735
1739
|
var vanityDomain = pathArray[pathArray.length - 1];
|
|
1736
1740
|
var host = issUrl.hostname === 'localhost' ? 'local.digital.ai:4200' : issUrl.host;
|
|
1741
|
+
var identity = 'identity.';
|
|
1742
|
+
if (host.startsWith(identity)) {
|
|
1743
|
+
host = host.substring(identity.length);
|
|
1744
|
+
}
|
|
1737
1745
|
var consoleUrl = issUrl.protocol + '//' + vanityDomain + '.' + host + '/';
|
|
1738
1746
|
setPlatformConsoleUrl(consoleUrl);
|
|
1739
1747
|
} catch (e) {
|
|
@@ -2209,15 +2217,19 @@
|
|
|
2209
2217
|
}), "top-menu-item-" + title);
|
|
2210
2218
|
};
|
|
2211
2219
|
var createAppTypeLabel = function createAppTypeLabel(appTypeName, logo, appProps) {
|
|
2220
|
+
var logoProps = logo ? {
|
|
2221
|
+
imageSrc: logo
|
|
2222
|
+
} : {
|
|
2223
|
+
iconId: 'collection'
|
|
2224
|
+
};
|
|
2212
2225
|
return jsxRuntime.jsxs("div", __assign({
|
|
2213
2226
|
className: "logo-title"
|
|
2214
2227
|
}, {
|
|
2215
|
-
children: [jsxRuntime.jsx(DotAvatar, {
|
|
2228
|
+
children: [jsxRuntime.jsx(DotAvatar, __assign({}, logoProps, {
|
|
2216
2229
|
alt: "app image",
|
|
2217
|
-
imageSrc: logo,
|
|
2218
2230
|
type: "image",
|
|
2219
2231
|
variant: "circular"
|
|
2220
|
-
}, void 0), jsxRuntime.jsxs("div", __assign({
|
|
2232
|
+
}), void 0), jsxRuntime.jsxs("div", __assign({
|
|
2221
2233
|
className: "dot-app-switcher-app-title"
|
|
2222
2234
|
}, {
|
|
2223
2235
|
children: [jsxRuntime.jsx(DotTypography, __assign({
|
|
@@ -2430,51 +2442,60 @@
|
|
|
2430
2442
|
var activeApp = _a.activeApp,
|
|
2431
2443
|
apps = _a.apps,
|
|
2432
2444
|
className = _a.className,
|
|
2445
|
+
_b = _a.noAppTypeLabel,
|
|
2446
|
+
noAppTypeLabel = _b === void 0 ? 'Other' : _b,
|
|
2433
2447
|
platformConsoleUrl = _a.platformConsoleUrl,
|
|
2434
2448
|
onClose = _a.onClose,
|
|
2435
2449
|
open = _a.open,
|
|
2436
2450
|
selectedAppType = _a.selectedAppType,
|
|
2437
|
-
|
|
2438
|
-
yOffset =
|
|
2439
|
-
|
|
2440
|
-
zIndex =
|
|
2451
|
+
_c = _a.yOffset,
|
|
2452
|
+
yOffset = _c === void 0 ? 48 : _c,
|
|
2453
|
+
_d = _a.zIndex,
|
|
2454
|
+
zIndex = _d === void 0 ? 990 : _d;
|
|
2441
2455
|
var dotCoreApiContext = useDotCoreApiContext();
|
|
2442
2456
|
var setSelectedAppType = null;
|
|
2443
2457
|
if (dotCoreApiContext !== null) {
|
|
2444
2458
|
setSelectedAppType = dotCoreApiContext.setSelectedAppSwitcherAppType;
|
|
2445
2459
|
}
|
|
2446
2460
|
var rootClasses = useStylesWithRootClass(rootClassName$Q, className);
|
|
2447
|
-
var _d = React.useState(),
|
|
2448
|
-
appTypeMap = _d[0],
|
|
2449
|
-
setAppTypeMap = _d[1];
|
|
2450
2461
|
var _e = React.useState(),
|
|
2451
|
-
|
|
2452
|
-
|
|
2462
|
+
appTypeMap = _e[0],
|
|
2463
|
+
setAppTypeMap = _e[1];
|
|
2453
2464
|
var _f = React.useState(),
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
var _g = React.useState(
|
|
2457
|
-
|
|
2458
|
-
|
|
2465
|
+
appTypeLabels = _f[0],
|
|
2466
|
+
setAppTypeLabels = _f[1];
|
|
2467
|
+
var _g = React.useState(),
|
|
2468
|
+
appTypeMenuItems = _g[0],
|
|
2469
|
+
setAppTypeMenuItems = _g[1];
|
|
2470
|
+
var _h = React.useState(null),
|
|
2471
|
+
selectedAppTypeAlt = _h[0],
|
|
2472
|
+
setSelectedAppTypeAlt = _h[1];
|
|
2459
2473
|
if (!setSelectedAppType) {
|
|
2460
2474
|
selectedAppType = selectedAppTypeAlt;
|
|
2461
2475
|
setSelectedAppType = setSelectedAppTypeAlt;
|
|
2462
2476
|
}
|
|
2463
|
-
var showApps = function
|
|
2477
|
+
var showApps = React.useCallback(function (appType) {
|
|
2464
2478
|
setSelectedAppType(appType);
|
|
2465
|
-
};
|
|
2466
|
-
var showAppTypes = function
|
|
2479
|
+
}, []);
|
|
2480
|
+
var showAppTypes = React.useCallback(function () {
|
|
2467
2481
|
return setSelectedAppType(null);
|
|
2468
|
-
};
|
|
2469
|
-
var populateAppTypeMap = function
|
|
2482
|
+
}, []);
|
|
2483
|
+
var populateAppTypeMap = React.useCallback(function () {
|
|
2470
2484
|
var newAppTypeMap = new Map();
|
|
2485
|
+
// we'll put Other at the end
|
|
2486
|
+
var otherApps = [];
|
|
2471
2487
|
apps === null || apps === void 0 ? void 0 : apps.forEach(function (app) {
|
|
2472
|
-
var appTypeName = app.logo_product_name;
|
|
2473
2488
|
var children = createMenuItem(app.url, app.name, getInstanceStateText(app));
|
|
2474
|
-
var
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
newAppTypeMap.
|
|
2489
|
+
var appTypeName = app.logo_product_name;
|
|
2490
|
+
var appTypeApps;
|
|
2491
|
+
if (appTypeName) {
|
|
2492
|
+
appTypeApps = newAppTypeMap.get(appTypeName);
|
|
2493
|
+
if (!appTypeApps) {
|
|
2494
|
+
appTypeApps = [];
|
|
2495
|
+
newAppTypeMap.set(appTypeName, appTypeApps);
|
|
2496
|
+
}
|
|
2497
|
+
} else {
|
|
2498
|
+
appTypeApps = otherApps;
|
|
2478
2499
|
}
|
|
2479
2500
|
appTypeApps.push({
|
|
2480
2501
|
children: children,
|
|
@@ -2482,7 +2503,16 @@
|
|
|
2482
2503
|
height: 64
|
|
2483
2504
|
});
|
|
2484
2505
|
});
|
|
2485
|
-
|
|
2506
|
+
var keys = Array.from(newAppTypeMap.keys()).sort();
|
|
2507
|
+
var sortedAppTypeMap = new Map();
|
|
2508
|
+
for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {
|
|
2509
|
+
var appType = keys_1[_i];
|
|
2510
|
+
sortedAppTypeMap.set(appType, newAppTypeMap.get(appType));
|
|
2511
|
+
}
|
|
2512
|
+
if (otherApps.length > 0) {
|
|
2513
|
+
sortedAppTypeMap.set(noAppTypeLabel, otherApps);
|
|
2514
|
+
}
|
|
2515
|
+
setAppTypeMap(sortedAppTypeMap);
|
|
2486
2516
|
var menuItems = [daiAppsHeaderMenuItem];
|
|
2487
2517
|
if (platformConsoleUrl) {
|
|
2488
2518
|
var children = createTopLevelMenuItem(platformConsoleUrl, getLogoForAppType('Platform'), 'Digital.ai Platform', !window.location.href.startsWith(platformConsoleUrl));
|
|
@@ -2493,9 +2523,9 @@
|
|
|
2493
2523
|
});
|
|
2494
2524
|
}
|
|
2495
2525
|
var newAppTypeLabels = new Map();
|
|
2496
|
-
|
|
2526
|
+
sortedAppTypeMap.forEach(function (singleTypeApps, appTypeName) {
|
|
2497
2527
|
if ((singleTypeApps === null || singleTypeApps === void 0 ? void 0 : singleTypeApps.length) > 0) {
|
|
2498
|
-
var logo = getLogoForAppType(appTypeName);
|
|
2528
|
+
var logo = appTypeName === noAppTypeLabel ? null : getLogoForAppType(appTypeName);
|
|
2499
2529
|
newAppTypeLabels.set(appTypeName, {
|
|
2500
2530
|
logo: logo,
|
|
2501
2531
|
singleTypeApps: singleTypeApps
|
|
@@ -2518,7 +2548,7 @@
|
|
|
2518
2548
|
});
|
|
2519
2549
|
setAppTypeMenuItems(menuItems);
|
|
2520
2550
|
setAppTypeLabels(newAppTypeLabels);
|
|
2521
|
-
};
|
|
2551
|
+
}, [apps]);
|
|
2522
2552
|
var emptyState = function emptyState() {
|
|
2523
2553
|
var currentAppMenuItem = createTopLevelMenuItem(window.location.href, getLogoForAppType(activeApp.product), activeApp.name, false);
|
|
2524
2554
|
setAppTypeMenuItems([daiAppsHeaderMenuItem, {
|
|
@@ -7,6 +7,7 @@ interface ActiveAppInfo {
|
|
|
7
7
|
}
|
|
8
8
|
interface CommonAppSwitcherProps extends CommonProps {
|
|
9
9
|
activeApp: ActiveAppInfo;
|
|
10
|
+
noAppTypeLabel?: string;
|
|
10
11
|
onClose?: (event: MouseEvent | KeyboardEvent) => void;
|
|
11
12
|
yOffset?: number;
|
|
12
13
|
zIndex?: number;
|
|
@@ -17,7 +18,7 @@ interface AppSwitcherViewProps extends CommonAppSwitcherProps {
|
|
|
17
18
|
platformConsoleUrl?: string;
|
|
18
19
|
selectedAppType: string;
|
|
19
20
|
}
|
|
20
|
-
export declare const DotAppSwitcherView: ({ activeApp, apps, className, platformConsoleUrl, onClose, open, selectedAppType, yOffset, zIndex, }: AppSwitcherViewProps) => JSX.Element;
|
|
21
|
+
export declare const DotAppSwitcherView: ({ activeApp, apps, className, noAppTypeLabel, platformConsoleUrl, onClose, open, selectedAppType, yOffset, zIndex, }: AppSwitcherViewProps) => JSX.Element;
|
|
21
22
|
interface AppSwitcherProps extends CommonAppSwitcherProps {
|
|
22
23
|
accountId?: string;
|
|
23
24
|
includePlatformConsole?: boolean;
|