@digital-ai/dot-components 4.3.0 → 4.3.1

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.
Files changed (2) hide show
  1. package/index.esm.js +34 -20
  2. package/package.json +1 -1
package/index.esm.js CHANGED
@@ -9726,7 +9726,7 @@ const dashboard3 = {
9726
9726
  author_id: 'id3a',
9727
9727
  target_apps: ['AGILITY'],
9728
9728
  external_id: '3',
9729
- name: 'dashboard3',
9729
+ name: 'dummy dashboard 3',
9730
9730
  description: '',
9731
9731
  dashboard_url: 'https://test.com',
9732
9732
  server_url: 'https://test.com',
@@ -9751,7 +9751,7 @@ const dashboard4 = {
9751
9751
  author_id: 'id4a',
9752
9752
  target_apps: ['DEPLOY'],
9753
9753
  external_id: '4',
9754
- name: 'dashboard4',
9754
+ name: 'dummy dashboard',
9755
9755
  description: '',
9756
9756
  dashboard_url: 'https://test.com',
9757
9757
  server_url: 'https://test.com',
@@ -9771,7 +9771,7 @@ const dashboard4 = {
9771
9771
  favorite: false,
9772
9772
  updated_dt: '2023-11-21T04:42:07.951000+00:00'
9773
9773
  };
9774
- ({
9774
+ const dashboard5 = {
9775
9775
  author_fullname: 'Dashboard5 Author',
9776
9776
  author_id: 'id5a',
9777
9777
  target_apps: ['CHANGERISKPREDICTION'],
@@ -9795,9 +9795,9 @@ const dashboard4 = {
9795
9795
  filter_configuration: [],
9796
9796
  favorite: false,
9797
9797
  updated_dt: '2023-11-21T04:42:07.951000+00:00'
9798
- });
9798
+ };
9799
9799
  // Dashboard with in-progress edits
9800
- ({
9800
+ const dashboard6 = {
9801
9801
  author_fullname: 'Dashboard6 Author',
9802
9802
  author_id: 'id6a',
9803
9803
  target_apps: ['AGILITY'],
@@ -9825,7 +9825,8 @@ const dashboard4 = {
9825
9825
  updated_dt: '2023-11-22T06:42:07.952000+00:00',
9826
9826
  is_being_modified: true,
9827
9827
  modified_author_id: 'id123'
9828
- });
9828
+ };
9829
+ const dummyDashboards = [dashboard1, dashboard2, dashboard3, dashboard4, dashboard5, dashboard6];
9829
9830
  const getCategoriesMock = {
9830
9831
  categories: {
9831
9832
  AGILITY: ['Scrum Master', 'DevOps Manager', 'Release Train Engineer', 'Agility Analytics'],
@@ -10008,7 +10009,8 @@ const DotMetadataApiProvider = ({
10008
10009
  }) => {
10009
10010
  if (OpenAPI.BASE === MOCK_API_URL) {
10010
10011
  setDashboardsError(null);
10011
- return Promise.resolve([]);
10012
+ const results = dummyDashboards.filter(dashboard => (name === null || name === void 0 ? void 0 : name.toLowerCase()) === dashboard.name.toLowerCase());
10013
+ return Promise.resolve(results);
10012
10014
  }
10013
10015
  setAccountIdHeader(accountId);
10014
10016
  setDashboardSearchLoading(true);
@@ -11848,6 +11850,9 @@ const StyledDotMenu = styled(DotMenu)`
11848
11850
  .dot-ul .dot-li {
11849
11851
  padding: 0;
11850
11852
 
11853
+ .disabled-menu-item {
11854
+ color: ${theme.palette.layer['n200']};
11855
+ }
11851
11856
  .dot-link {
11852
11857
  padding: ${theme.spacing(0.5, 2)};
11853
11858
 
@@ -11866,7 +11871,7 @@ const StyledDotMenu = styled(DotMenu)`
11866
11871
  `}
11867
11872
  `;
11868
11873
 
11869
- const disabledFieldsMessage = 'Dashboard name and description cannot be modified while the dashboard editor is active. Please save your changes and close the editor, if you need to make a name or description change.';
11874
+ const disabledPropsMessage = 'Dashboard properties cannot be modified while the dashboard editor is active. If you need to make property changes, please close the editor.';
11870
11875
  const inProgressEditMessage = 'This is a published dashboard; changes will not be visible to other users until you publish the updated dashboard.';
11871
11876
  function DotDashboardOptionsMenu({
11872
11877
  dashboard,
@@ -11904,6 +11909,7 @@ function DotDashboardOptionsMenu({
11904
11909
  }, [dashboard, onViewMode]);
11905
11910
  const handleEditPropertiesClick = useCallback(() => {
11906
11911
  var _a;
11912
+ if (isEdit) return;
11907
11913
  handleMenuClose();
11908
11914
  setIsEditPropertiesDialogOpen(true);
11909
11915
  if (((_a = dashboard === null || dashboard === void 0 ? void 0 : dashboard.target_apps) === null || _a === void 0 ? void 0 : _a.length) > 0) {
@@ -11916,7 +11922,7 @@ function DotDashboardOptionsMenu({
11916
11922
  } else {
11917
11923
  setCategoryOptions([]);
11918
11924
  }
11919
- }, [dashboard]);
11925
+ }, [dashboard, isEdit]);
11920
11926
  const handleSubmitEditProperties = useCallback((data, isDone) => __awaiter(this, void 0, void 0, function* () {
11921
11927
  return updateDashboard(dashboard.id, {
11922
11928
  name: data.name,
@@ -11948,15 +11954,26 @@ function DotDashboardOptionsMenu({
11948
11954
  });
11949
11955
  }
11950
11956
  if (onUpdatedProperties && !dashboard.is_ootb_dashboard) {
11951
- menuItems.push({
11952
- children: jsx(DotButton, {
11953
- ariaLabel: "Edit dashboard properties",
11954
- type: "text",
11955
- startIcon: jsx(DotIcon, {
11956
- iconId: "edit"
11957
- }),
11958
- children: "Edit properties"
11957
+ let menuItem = jsx(DotButton, {
11958
+ ariaLabel: "Edit dashboard properties",
11959
+ className: isEdit ? 'disabled-menu-item' : '',
11960
+ disabled: isEdit,
11961
+ type: "text",
11962
+ startIcon: jsx(DotIcon, {
11963
+ className: isEdit ? 'disabled-menu-item' : '',
11964
+ iconId: "edit"
11959
11965
  }),
11966
+ children: "Edit properties"
11967
+ });
11968
+ if (isEdit) {
11969
+ menuItem = jsx(DotTooltip, {
11970
+ title: disabledPropsMessage,
11971
+ placement: "left-start",
11972
+ children: menuItem
11973
+ });
11974
+ }
11975
+ menuItems.push({
11976
+ children: menuItem,
11960
11977
  key: 'edit-props'
11961
11978
  });
11962
11979
  }
@@ -12107,9 +12124,6 @@ function DotDashboardOptionsMenu({
12107
12124
  if (dashboard.is_being_modified || dashboard.lifecycle_state === DashboardView.lifecycle_state.PUBLISHED) {
12108
12125
  messages.push(inProgressEditMessage);
12109
12126
  }
12110
- if (isEdit) {
12111
- messages.push(disabledFieldsMessage);
12112
- }
12113
12127
  return menuItems.length > 0 ? jsxs(Fragment, {
12114
12128
  children: [jsx(DotDashboardDialog, {
12115
12129
  title: "Edit dashboard properties",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digital-ai/dot-components",
3
- "version": "4.3.0",
3
+ "version": "4.3.1",
4
4
  "private": false,
5
5
  "license": "SEE LICENSE IN <LICENSE.md>",
6
6
  "contributors": [