@xh/hoist 71.0.0-SNAPSHOT.1736120910674 → 71.0.0-SNAPSHOT.1736185761842
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.
|
@@ -357,7 +357,7 @@ export class ViewManagerModel<T = PlainObject> extends HoistModel {
|
|
|
357
357
|
return;
|
|
358
358
|
}
|
|
359
359
|
|
|
360
|
-
|
|
360
|
+
return this.loadViewAsync(info);
|
|
361
361
|
}
|
|
362
362
|
|
|
363
363
|
async saveAsAsync(spec: ViewCreateSpec): Promise<void> {
|
|
@@ -63,7 +63,7 @@ function getNavMenuItems(model: ViewManagerModel): ReactNode[] {
|
|
|
63
63
|
className: 'xh-view-manager__menu-item',
|
|
64
64
|
icon: view.isDefault ? Icon.check() : Icon.placeholder(),
|
|
65
65
|
text: `Default ${startCase(typeDisplayName)}`,
|
|
66
|
-
onClick: () => model.selectViewAsync(null)
|
|
66
|
+
onClick: () => model.selectViewAsync(null).catchDefault()
|
|
67
67
|
})
|
|
68
68
|
);
|
|
69
69
|
}
|
|
@@ -168,6 +168,6 @@ function viewMenuItem(view: ViewInfo, model: ViewManagerModel): ReactNode {
|
|
|
168
168
|
text: view.name,
|
|
169
169
|
title: title.join(' | '),
|
|
170
170
|
icon,
|
|
171
|
-
onClick: () => model.selectViewAsync(view)
|
|
171
|
+
onClick: () => model.selectViewAsync(view).catchDefault()
|
|
172
172
|
});
|
|
173
173
|
}
|
|
@@ -86,7 +86,7 @@ export class ManageDialogModel extends HoistModel {
|
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
activateSelectedViewAndClose() {
|
|
89
|
-
this.viewManagerModel.selectViewAsync(this.selectedView);
|
|
89
|
+
this.viewManagerModel.selectViewAsync(this.selectedView).catchDefault();
|
|
90
90
|
this.close();
|
|
91
91
|
}
|
|
92
92
|
|
|
@@ -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
|
-
|
|
226
|
-
|
|
227
|
-
|
|
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.
|
|
3
|
+
"version": "71.0.0-SNAPSHOT.1736185761842",
|
|
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",
|