@digital-ai/dot-components 3.13.1 → 3.13.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/index.esm.js +33 -18
- package/package.json +1 -1
package/index.esm.js
CHANGED
|
@@ -7966,7 +7966,7 @@ const formatListForTooltip = words => {
|
|
|
7966
7966
|
words.forEach(word => {
|
|
7967
7967
|
elements.push(jsx("div", {
|
|
7968
7968
|
children: word
|
|
7969
|
-
}));
|
|
7969
|
+
}, word));
|
|
7970
7970
|
});
|
|
7971
7971
|
return jsx("div", {
|
|
7972
7972
|
children: elements
|
|
@@ -8017,7 +8017,7 @@ function DotChipList({
|
|
|
8017
8017
|
children: jsxs(DotTypography, {
|
|
8018
8018
|
children: ["+", extraItems.length]
|
|
8019
8019
|
})
|
|
8020
|
-
}));
|
|
8020
|
+
}, "extra-items-tooltip"));
|
|
8021
8021
|
}
|
|
8022
8022
|
} else {
|
|
8023
8023
|
itemElements = items === null || items === void 0 ? void 0 : items.map(item => jsx(DotChip, {
|
|
@@ -9538,6 +9538,7 @@ const DotMetadataApiProvider = ({
|
|
|
9538
9538
|
const MOCK_API_URL = 'https://demo-mock-api';
|
|
9539
9539
|
const retrieveMetadata = useCallback((appType, isPublishedOnly) => {
|
|
9540
9540
|
setMetadataLoading(true);
|
|
9541
|
+
setAccountIdHeader(accountId);
|
|
9541
9542
|
return cancelablePromise(DashboardsService.getDashboardsMetadata(undefined, appType, undefined, undefined, isPublishedOnly ? 'PUBLISHED' : undefined)).then(response => {
|
|
9542
9543
|
setMetadataLoading(false);
|
|
9543
9544
|
setDashboardsError(null);
|
|
@@ -9555,7 +9556,7 @@ const DotMetadataApiProvider = ({
|
|
|
9555
9556
|
setDashboardsError(error);
|
|
9556
9557
|
return null;
|
|
9557
9558
|
});
|
|
9558
|
-
}, []);
|
|
9559
|
+
}, [accountId]);
|
|
9559
9560
|
const memoizedValues = useMemo(() => ({
|
|
9560
9561
|
metadataLoading,
|
|
9561
9562
|
dashboardsError,
|
|
@@ -9611,6 +9612,7 @@ const DotMetadataApiProvider = ({
|
|
|
9611
9612
|
setAccountIdHeader(accountId);
|
|
9612
9613
|
return cancelablePromise(DashboardsService.postDashboardsService1(dashboardId, dashboard)).then(response => {
|
|
9613
9614
|
setDashboardsError(null);
|
|
9615
|
+
setMetadata(null);
|
|
9614
9616
|
if (dashboards) {
|
|
9615
9617
|
dashboards.push(response);
|
|
9616
9618
|
setDashboards(dashboards.slice());
|
|
@@ -9649,6 +9651,7 @@ const DotMetadataApiProvider = ({
|
|
|
9649
9651
|
setAccountIdHeader(accountId);
|
|
9650
9652
|
return cancelablePromise(DashboardsService.patchDashboardsService(dashboardId, dashboard, isSync)).then(response => {
|
|
9651
9653
|
setDashboardsError(null);
|
|
9654
|
+
setMetadata(null);
|
|
9652
9655
|
setDashboards(orig => handleUpdateDashboard(orig, response));
|
|
9653
9656
|
return response;
|
|
9654
9657
|
}).catch(error => setDashboardsError(error));
|
|
@@ -9664,7 +9667,7 @@ const DotMetadataApiProvider = ({
|
|
|
9664
9667
|
} else if (OpenAPI.BASE === MOCK_API_URL) {
|
|
9665
9668
|
setDashboardsError(null);
|
|
9666
9669
|
setMetadataLoading(false);
|
|
9667
|
-
return Promise.resolve(appType
|
|
9670
|
+
return Promise.resolve(appType === 'AGILITY' ? getAuthorsMock : []);
|
|
9668
9671
|
}
|
|
9669
9672
|
return cancelablePromise(retrieveMetadata(appType, isPublishedOnly)).then(response => {
|
|
9670
9673
|
response.authors.sort(authorSort);
|
|
@@ -9729,7 +9732,7 @@ const DotMetadataApiProvider = ({
|
|
|
9729
9732
|
});
|
|
9730
9733
|
}
|
|
9731
9734
|
})
|
|
9732
|
-
}), [metadata, metadataLoading, dashboardsError, dashboardsLoading, openedDashboardDetails, platformConsoleUrl]);
|
|
9735
|
+
}), [accountId, metadata, metadataLoading, dashboardsError, dashboardsLoading, openedDashboardDetails, platformConsoleUrl, retrieveMetadata]);
|
|
9733
9736
|
if (apiUrl && OpenAPI.BASE !== apiUrl) {
|
|
9734
9737
|
OpenAPI.BASE = apiUrl;
|
|
9735
9738
|
}
|
|
@@ -10310,6 +10313,14 @@ const DotDashboardDetails = _a => {
|
|
|
10310
10313
|
return null;
|
|
10311
10314
|
};
|
|
10312
10315
|
|
|
10316
|
+
const getActionItemNode = value => {
|
|
10317
|
+
return value ? jsxs("span", {
|
|
10318
|
+
children: ["Create new ", jsx("strong", {
|
|
10319
|
+
children: value
|
|
10320
|
+
}), " category"]
|
|
10321
|
+
}) : 'Enter a label to create new category';
|
|
10322
|
+
};
|
|
10323
|
+
const MINIMUM_LABEL_LENGTH = 3;
|
|
10313
10324
|
function DashboardCategoriesAutoComplete(_a) {
|
|
10314
10325
|
var {
|
|
10315
10326
|
freesolo: _freesolo,
|
|
@@ -10318,30 +10329,34 @@ function DashboardCategoriesAutoComplete(_a) {
|
|
|
10318
10329
|
onNewCategory
|
|
10319
10330
|
} = _a,
|
|
10320
10331
|
args = __rest(_a, ["freesolo", "actionItem", "onInputChange", "onNewCategory"]);
|
|
10321
|
-
const getActionItemNode = value => {
|
|
10322
|
-
return value ? jsxs("span", {
|
|
10323
|
-
children: ["Create new ", jsx("strong", {
|
|
10324
|
-
children: value
|
|
10325
|
-
}), " category"]
|
|
10326
|
-
}) : 'Enter a label to create new category';
|
|
10327
|
-
};
|
|
10328
10332
|
const [actionItemText, setActionItemText] = useState(getActionItemNode(''));
|
|
10333
|
+
const [errorMessage, setErrorMessage] = useState(null);
|
|
10329
10334
|
const handleActionItemClick = newItem => {
|
|
10330
|
-
if (newItem
|
|
10331
|
-
onNewCategory
|
|
10335
|
+
if ((newItem === null || newItem === void 0 ? void 0 : newItem.length) >= MINIMUM_LABEL_LENGTH) {
|
|
10336
|
+
if (onNewCategory) {
|
|
10337
|
+
onNewCategory(newItem);
|
|
10338
|
+
}
|
|
10339
|
+
} else if (newItem) {
|
|
10340
|
+
setErrorMessage('Length of a category label must be 3 or more characters.');
|
|
10332
10341
|
}
|
|
10333
10342
|
};
|
|
10334
10343
|
const customActionItem = {
|
|
10335
10344
|
text: actionItemText,
|
|
10336
10345
|
onClick: handleActionItemClick
|
|
10337
10346
|
};
|
|
10347
|
+
const handleInputChange = useCallback((event, value, reason) => {
|
|
10348
|
+
setActionItemText(getActionItemNode(value));
|
|
10349
|
+
if ((value === null || value === void 0 ? void 0 : value.length) >= MINIMUM_LABEL_LENGTH && errorMessage) {
|
|
10350
|
+
setErrorMessage(null);
|
|
10351
|
+
}
|
|
10352
|
+
onInputChange && onInputChange(event, value, reason);
|
|
10353
|
+
}, [errorMessage]);
|
|
10338
10354
|
return jsx(DotAutoComplete, Object.assign({}, args, {
|
|
10339
10355
|
freesolo: false,
|
|
10340
10356
|
actionItem: customActionItem,
|
|
10341
|
-
onInputChange:
|
|
10342
|
-
|
|
10343
|
-
|
|
10344
|
-
}
|
|
10357
|
+
onInputChange: handleInputChange,
|
|
10358
|
+
error: !!errorMessage,
|
|
10359
|
+
helperText: errorMessage
|
|
10345
10360
|
}));
|
|
10346
10361
|
}
|
|
10347
10362
|
|