@xh/hoist 71.0.0-SNAPSHOT.1736120910674 → 71.0.0-SNAPSHOT.1736123831690

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.
@@ -220,13 +220,21 @@ export class ManageDialogModel extends HoistModel {
220
220
  }
221
221
 
222
222
  private async doMakeGlobalAsync(view: ViewInfo) {
223
- const {globalDisplayName, typeDisplayName} = this.viewManagerModel,
224
- {typedName} = view,
225
- msgs = [
226
- `The ${typedName} will become a ${globalDisplayName} ${typeDisplayName} visible to all other ${XH.appName} users.`,
227
- strong('Are you sure you want to proceed?')
228
- ];
223
+ const {globalDisplayName, typeDisplayName, globalViews} = this.viewManagerModel,
224
+ {typedName} = view;
225
+
226
+ if (some(globalViews, {name: view.name})) {
227
+ XH.alert({
228
+ title: 'Alert',
229
+ message: `There is already a ${globalDisplayName} ${typedName}. Please rename or edit it instead.`
230
+ });
231
+ return;
232
+ }
229
233
 
234
+ const msgs = [
235
+ `The ${typedName} will become a ${globalDisplayName} ${typeDisplayName} visible to all other ${XH.appName} users.`,
236
+ strong('Are you sure you want to proceed?')
237
+ ];
230
238
  const confirmed = await XH.confirm({
231
239
  message: fragment(msgs.map(m => p(m))),
232
240
  confirmProps: {
@@ -16,7 +16,7 @@ import {ViewPanelModel} from '@xh/hoist/desktop/cmp/viewmanager/dialog/ViewPanel
16
16
  import {getGroupOptions} from '@xh/hoist/desktop/cmp/viewmanager/dialog/Utils';
17
17
  import {fmtDateTime} from '@xh/hoist/format';
18
18
  import {Icon} from '@xh/hoist/icon';
19
- import {capitalize} from 'lodash';
19
+ import {capitalize, some} from 'lodash';
20
20
 
21
21
  /**
22
22
  * Form to edit or view details on a single saved view within the ViewManager manage dialog.
@@ -128,7 +128,7 @@ const formButtons = hoistCmp.factory<ViewPanelModel>({
128
128
  });
129
129
  }
130
130
 
131
- const {enableGlobal, globalDisplayName, manageGlobal, typeDisplayName} =
131
+ const {enableGlobal, globalDisplayName, manageGlobal, typeDisplayName, globalViews} =
132
132
  parent.viewManagerModel;
133
133
  return vbox({
134
134
  style: {gap: 10, alignItems: 'center'},
@@ -148,6 +148,7 @@ const formButtons = hoistCmp.factory<ViewPanelModel>({
148
148
  icon: Icon.globe(),
149
149
  width: 200,
150
150
  outlined: true,
151
+ disabled: some(globalViews, {name: view.name}),
151
152
  omit: readonly || view.isGlobal || !enableGlobal || !manageGlobal,
152
153
  onClick: () => parent.makeGlobalAsync(view)
153
154
  }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xh/hoist",
3
- "version": "71.0.0-SNAPSHOT.1736120910674",
3
+ "version": "71.0.0-SNAPSHOT.1736123831690",
4
4
  "description": "Hoist add-on for building and deploying React Applications.",
5
5
  "repository": "github:xh/hoist-react",
6
6
  "homepage": "https://xh.io",