@digital-ai/dot-components 4.21.0 → 4.23.0
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 +111 -31
- package/package.json +1 -1
package/index.esm.js
CHANGED
|
@@ -1606,6 +1606,10 @@ const StyledTextField = styled(TextField)`
|
|
|
1606
1606
|
}
|
|
1607
1607
|
}
|
|
1608
1608
|
|
|
1609
|
+
.ai-text-clear-icon {
|
|
1610
|
+
right: 36px;
|
|
1611
|
+
position: relative;
|
|
1612
|
+
}
|
|
1609
1613
|
.MuiOutlinedInput-adornedStart {
|
|
1610
1614
|
padding-left: 12px;
|
|
1611
1615
|
|
|
@@ -7293,14 +7297,23 @@ const DotAutoComplete = ({
|
|
|
7293
7297
|
const {
|
|
7294
7298
|
inputProps
|
|
7295
7299
|
} = params;
|
|
7296
|
-
return
|
|
7297
|
-
|
|
7298
|
-
|
|
7299
|
-
|
|
7300
|
-
|
|
7301
|
-
|
|
7302
|
-
|
|
7303
|
-
|
|
7300
|
+
return jsxs(Fragment, {
|
|
7301
|
+
children: [jsx(DotIconButton, {
|
|
7302
|
+
iconId: "send-airplane",
|
|
7303
|
+
tooltip: "Send",
|
|
7304
|
+
"data-testid": dataTestId && `${dataTestId}-send-airplane-icon`,
|
|
7305
|
+
shape: "square",
|
|
7306
|
+
color: "ai",
|
|
7307
|
+
disabled: !(inputProps === null || inputProps === void 0 ? void 0 : inputProps.value),
|
|
7308
|
+
onClick: () => {
|
|
7309
|
+
if (inputProps === null || inputProps === void 0 ? void 0 : inputProps.value) {
|
|
7310
|
+
handleAiAction(inputProps.value.toString());
|
|
7311
|
+
}
|
|
7312
|
+
}
|
|
7313
|
+
}), jsx("span", {
|
|
7314
|
+
className: "ai-text-clear-icon",
|
|
7315
|
+
children: params.InputProps.endAdornment
|
|
7316
|
+
})]
|
|
7304
7317
|
});
|
|
7305
7318
|
};
|
|
7306
7319
|
const renderTrimmedLongOptions = (props, option) => {
|
|
@@ -7428,6 +7441,12 @@ const DotAutoComplete = ({
|
|
|
7428
7441
|
event.preventDefault();
|
|
7429
7442
|
(_a = actionItemRef === null || actionItemRef === void 0 ? void 0 : actionItemRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
7430
7443
|
}
|
|
7444
|
+
if (event.key === 'Enter' && ai) {
|
|
7445
|
+
event.stopPropagation();
|
|
7446
|
+
event.preventDefault();
|
|
7447
|
+
const text = event.target.value;
|
|
7448
|
+
handleAiAction(text);
|
|
7449
|
+
}
|
|
7431
7450
|
},
|
|
7432
7451
|
placeholder: showPlaceholder ? placeholder : undefined,
|
|
7433
7452
|
required: required,
|
|
@@ -10575,6 +10594,31 @@ const dashboard6 = Object.assign(Object.assign({}, dashboard6InProgress), {
|
|
|
10575
10594
|
in_progress_changes: dashboard6InProgress,
|
|
10576
10595
|
parent_id: null
|
|
10577
10596
|
});
|
|
10597
|
+
({
|
|
10598
|
+
author_fullname: 'Dashboard7 Author',
|
|
10599
|
+
author_id: 'id7a',
|
|
10600
|
+
target_apps: ['AGILITY'],
|
|
10601
|
+
external_id: '7',
|
|
10602
|
+
name: 'dummy dashboard 7',
|
|
10603
|
+
description: '',
|
|
10604
|
+
dashboard_url: 'https://test.com',
|
|
10605
|
+
server_url: 'https://test.com',
|
|
10606
|
+
external_embedding_id: null,
|
|
10607
|
+
created_dt: '2023-11-21T04:42:07.872000+00:00',
|
|
10608
|
+
id: 'id7',
|
|
10609
|
+
lifecycle_state: DashboardView.lifecycle_state.PUBLISHED,
|
|
10610
|
+
application_instances: ['2'],
|
|
10611
|
+
categories: [],
|
|
10612
|
+
bi_type: DashboardView.bi_type.MICROSTRATEGY,
|
|
10613
|
+
is_ootb_dashboard: false,
|
|
10614
|
+
thumbnail: '',
|
|
10615
|
+
external_object: {},
|
|
10616
|
+
embed_config: {},
|
|
10617
|
+
help_content_id: helpContent.id,
|
|
10618
|
+
filter_configuration: [],
|
|
10619
|
+
favorite: false,
|
|
10620
|
+
updated_dt: '2023-11-21T04:42:07.951000+00:00'
|
|
10621
|
+
});
|
|
10578
10622
|
const dummyDashboards = [dashboard1, dashboard2, dashboard3, dashboard4, dashboard5, dashboard6];
|
|
10579
10623
|
const getCategoriesMock = {
|
|
10580
10624
|
categories: {
|
|
@@ -10858,13 +10902,19 @@ const DotMetadataApiProvider = ({
|
|
|
10858
10902
|
}
|
|
10859
10903
|
let response;
|
|
10860
10904
|
try {
|
|
10861
|
-
if (dashboard.lifecycle_state === DashboardView.lifecycle_state.PUBLISHED &&
|
|
10862
|
-
|
|
10863
|
-
|
|
10864
|
-
|
|
10865
|
-
|
|
10866
|
-
|
|
10905
|
+
if (dashboard.lifecycle_state === DashboardView.lifecycle_state.PUBLISHED && updatePayload.lifecycle_state !== DashboardPatchBody.lifecycle_state.DRAFT) {
|
|
10906
|
+
if (dashboard.in_progress_changes) {
|
|
10907
|
+
// If the dashboard is published and has in-progress changes, we need to update the in-progress dashboard
|
|
10908
|
+
response = yield DashboardsService.patchInProgressDashboard(dashboard.id, updatePayload, accountId, isSync);
|
|
10909
|
+
} else {
|
|
10910
|
+
// If the dashboard is published and has no in-progress changes, we need to create an in-progress dashboard
|
|
10911
|
+
response = yield DashboardsService.postInProgressDashboard(dashboard.id, accountId, updatePayload);
|
|
10912
|
+
}
|
|
10913
|
+
} else if (dashboard.parent_id) {
|
|
10914
|
+
// If the dashboard is in progress (has a parent_id), we need to update the in-progress dashboard
|
|
10915
|
+
response = yield DashboardsService.patchInProgressDashboard(dashboard.parent_id, updatePayload, accountId, isSync);
|
|
10867
10916
|
} else {
|
|
10917
|
+
// If the dashboard is in draft state, we can update it directly
|
|
10868
10918
|
response = yield DashboardsService.patchDashboard(dashboard.id, updatePayload, accountId, isSync);
|
|
10869
10919
|
}
|
|
10870
10920
|
setDashboardsError(null);
|
|
@@ -12613,6 +12663,9 @@ function DotDashboardPublishConfirm({
|
|
|
12613
12663
|
};
|
|
12614
12664
|
return jsxs(Fragment, {
|
|
12615
12665
|
children: [dashboardToPublish !== null && jsx(DotDialog, {
|
|
12666
|
+
cancelButtonProps: {
|
|
12667
|
+
'data-testid': 'publish-cancel-button'
|
|
12668
|
+
},
|
|
12616
12669
|
cancelButtonVisible: !published,
|
|
12617
12670
|
closeOnSubmit: false,
|
|
12618
12671
|
hasPrimaryAction: publishing === null || published,
|
|
@@ -12637,6 +12690,9 @@ function DotDashboardPublishConfirm({
|
|
|
12637
12690
|
editInProgress: editInProgressByUser(dashboardToPublish, currentUser.id)
|
|
12638
12691
|
})
|
|
12639
12692
|
}), dashboardToUnpublish !== null && jsx(DotDialog, {
|
|
12693
|
+
cancelButtonProps: {
|
|
12694
|
+
'data-testid': 'unpublish-cancel-button'
|
|
12695
|
+
},
|
|
12640
12696
|
cancelButtonVisible: !unpublished,
|
|
12641
12697
|
closeOnSubmit: false,
|
|
12642
12698
|
hasPrimaryAction: unpublishing === null || unpublished,
|
|
@@ -12811,19 +12867,35 @@ function DotDashboardOptionsMenu({
|
|
|
12811
12867
|
key: 'edit-props'
|
|
12812
12868
|
});
|
|
12813
12869
|
}
|
|
12814
|
-
if (onStartStatusChange && !dashboard.is_ootb_dashboard
|
|
12815
|
-
|
|
12816
|
-
|
|
12817
|
-
|
|
12818
|
-
|
|
12819
|
-
|
|
12820
|
-
|
|
12821
|
-
|
|
12822
|
-
|
|
12823
|
-
|
|
12824
|
-
|
|
12825
|
-
|
|
12826
|
-
|
|
12870
|
+
if (onStartStatusChange && !dashboard.is_ootb_dashboard) {
|
|
12871
|
+
if (isDraft) {
|
|
12872
|
+
menuItems.push({
|
|
12873
|
+
key: 'publish',
|
|
12874
|
+
children: jsx(DotButton, {
|
|
12875
|
+
ariaLabel: "Publish dashboard",
|
|
12876
|
+
type: "text",
|
|
12877
|
+
"data-testid": `publish-dashboard-button-${dashboard.id}`,
|
|
12878
|
+
startIcon: jsx(DotIcon, {
|
|
12879
|
+
iconId: "send-airplane"
|
|
12880
|
+
}),
|
|
12881
|
+
children: "Publish"
|
|
12882
|
+
})
|
|
12883
|
+
});
|
|
12884
|
+
}
|
|
12885
|
+
if (dashboard.lifecycle_state === DashboardView.lifecycle_state.PUBLISHED && !dashboard.in_progress_changes) {
|
|
12886
|
+
menuItems.push({
|
|
12887
|
+
key: 'unpublish',
|
|
12888
|
+
children: jsx(DotButton, {
|
|
12889
|
+
ariaLabel: "Unpublish dashboard",
|
|
12890
|
+
type: "text",
|
|
12891
|
+
"data-testid": `unpublish-dashboard-button-${dashboard.id}`,
|
|
12892
|
+
startIcon: jsx(DotIcon, {
|
|
12893
|
+
iconId: "undo"
|
|
12894
|
+
}),
|
|
12895
|
+
children: "Unpublish"
|
|
12896
|
+
})
|
|
12897
|
+
});
|
|
12898
|
+
}
|
|
12827
12899
|
}
|
|
12828
12900
|
if (onStartDuplicate) {
|
|
12829
12901
|
menuItems.push({
|
|
@@ -12952,6 +13024,9 @@ function DotDashboardOptionsMenu({
|
|
|
12952
13024
|
case 'publish':
|
|
12953
13025
|
onStartStatusChange(dashboard, DashboardView.lifecycle_state.PUBLISHED);
|
|
12954
13026
|
break;
|
|
13027
|
+
case 'unpublish':
|
|
13028
|
+
onStartStatusChange(dashboard, DashboardView.lifecycle_state.DRAFT);
|
|
13029
|
+
break;
|
|
12955
13030
|
}
|
|
12956
13031
|
handleMenuClose();
|
|
12957
13032
|
}, [menuItems, handleMenuClose]);
|
|
@@ -13166,9 +13241,14 @@ function DotDashboardActions({
|
|
|
13166
13241
|
setDashboardToPublish(null);
|
|
13167
13242
|
setDashboardToUnpublish(null);
|
|
13168
13243
|
}, []);
|
|
13169
|
-
const handleStartStatusChange = useCallback(() => {
|
|
13170
|
-
|
|
13171
|
-
|
|
13244
|
+
const handleStartStatusChange = useCallback((dashboardView, newStatus) => {
|
|
13245
|
+
if (newStatus === DashboardView.lifecycle_state.DRAFT) {
|
|
13246
|
+
setDashboardToUnpublish(dashboard);
|
|
13247
|
+
setDashboardToPublish(null);
|
|
13248
|
+
} else {
|
|
13249
|
+
setDashboardToPublish(dashboard);
|
|
13250
|
+
setDashboardToUnpublish(null);
|
|
13251
|
+
}
|
|
13172
13252
|
}, [dashboard]);
|
|
13173
13253
|
const handleDeleteClose = useCallback(() => {
|
|
13174
13254
|
setDashboardToDelete(null);
|
|
@@ -53926,7 +54006,7 @@ const DotToggleSwitch = ({
|
|
|
53926
54006
|
})
|
|
53927
54007
|
}), label && jsx(DotTypography, {
|
|
53928
54008
|
className: "dot-toggle-switch-label",
|
|
53929
|
-
variant: "
|
|
54009
|
+
variant: "caption",
|
|
53930
54010
|
children: label
|
|
53931
54011
|
})]
|
|
53932
54012
|
});
|