@xh/hoist 76.0.0-SNAPSHOT.1757113228632 → 76.0.0-SNAPSHOT.1757274887417
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/CHANGELOG.md +7 -0
- package/build/types/cmp/viewmanager/DataAccess.d.ts +0 -2
- package/build/types/cmp/viewmanager/ViewInfo.d.ts +4 -8
- package/build/types/cmp/viewmanager/ViewManagerModel.d.ts +10 -11
- package/build/types/desktop/cmp/viewmanager/dialog/ManageDialogModel.d.ts +0 -2
- package/build/types/desktop/cmp/viewmanager/dialog/Utils.d.ts +9 -1
- package/cmp/viewmanager/DataAccess.ts +0 -11
- package/cmp/viewmanager/ViewInfo.ts +5 -11
- package/cmp/viewmanager/ViewManagerModel.ts +15 -15
- package/desktop/cmp/viewmanager/dialog/ManageDialogModel.ts +3 -40
- package/desktop/cmp/viewmanager/dialog/SaveAsDialog.ts +17 -13
- package/desktop/cmp/viewmanager/dialog/SaveAsDialogModel.ts +42 -11
- package/desktop/cmp/viewmanager/dialog/Utils.ts +35 -3
- package/desktop/cmp/viewmanager/dialog/ViewPanel.ts +20 -37
- package/desktop/cmp/viewmanager/dialog/ViewPanelModel.ts +36 -13
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
import {FormModel} from '@xh/hoist/cmp/form';
|
|
9
9
|
import {fragment, p, strong} from '@xh/hoist/cmp/layout';
|
|
10
10
|
import {HoistModel, managed, TaskObserver, XH} from '@xh/hoist/core';
|
|
11
|
-
import {capitalize
|
|
11
|
+
import {capitalize} from 'lodash';
|
|
12
|
+
import {ReactNode} from 'react';
|
|
12
13
|
import {ManageDialogModel} from './ManageDialogModel';
|
|
13
14
|
import {makeObservable} from '@xh/hoist/mobx';
|
|
14
15
|
import {ViewInfo} from '@xh/hoist/cmp/viewmanager';
|
|
15
|
-
import {ReactNode} from 'react';
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Backing model for EditForm
|
|
@@ -44,6 +44,7 @@ export class ViewPanelModel extends HoistModel {
|
|
|
44
44
|
const {formModel} = this;
|
|
45
45
|
formModel.init({
|
|
46
46
|
...view,
|
|
47
|
+
visibility: view.isShared ? 'shared' : view.isGlobal ? 'global' : 'private',
|
|
47
48
|
owner: view.owner ?? capitalize(parent.viewManagerModel.globalDisplayName)
|
|
48
49
|
});
|
|
49
50
|
formModel.readonly = !view.isEditable;
|
|
@@ -57,20 +58,42 @@ export class ViewPanelModel extends HoistModel {
|
|
|
57
58
|
const {parent, view, formModel} = this,
|
|
58
59
|
updates = formModel.getData(true),
|
|
59
60
|
isValid = await formModel.validateAsync(),
|
|
60
|
-
isDirty = formModel.isDirty
|
|
61
|
+
isDirty = formModel.isDirty,
|
|
62
|
+
visibilityField = formModel.fields.visibility;
|
|
61
63
|
|
|
62
64
|
if (!isValid || !isDirty) return;
|
|
63
65
|
|
|
64
|
-
if (
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
if (visibilityField.isDirty) {
|
|
67
|
+
const visibility = visibilityField.value;
|
|
68
|
+
updates.isShared = visibility === 'shared';
|
|
69
|
+
updates.isGlobal = visibility === 'global';
|
|
70
|
+
|
|
71
|
+
const msgs: ReactNode[] = [strong('Are you sure you want to proceed?')];
|
|
72
|
+
switch (visibility) {
|
|
73
|
+
case 'private':
|
|
74
|
+
msgs.unshift(
|
|
75
|
+
`Your ${view.typedName} will no longer be available to all other ${XH.appName} users.`
|
|
76
|
+
);
|
|
77
|
+
break;
|
|
78
|
+
case 'global':
|
|
79
|
+
msgs.unshift(
|
|
80
|
+
`Your ${view.typedName} will become globally visible to all other ${XH.appName} users.`
|
|
81
|
+
);
|
|
82
|
+
break;
|
|
83
|
+
case 'shared':
|
|
84
|
+
view.isGlobal
|
|
85
|
+
? msgs.unshift(
|
|
86
|
+
`Your ${view.typedName} will no longer be globally visible to all other ${XH.appName} users.`
|
|
87
|
+
)
|
|
88
|
+
: msgs.unshift(
|
|
89
|
+
`Your ${view.typedName} will become available to all other ${XH.appName} users.`
|
|
90
|
+
);
|
|
91
|
+
}
|
|
69
92
|
|
|
70
93
|
const confirmed = await XH.confirm({
|
|
71
94
|
message: fragment(msgs.map(m => p(m))),
|
|
72
95
|
confirmProps: {
|
|
73
|
-
text: 'Yes, update
|
|
96
|
+
text: 'Yes, update visibility',
|
|
74
97
|
outlined: true,
|
|
75
98
|
autoFocus: false,
|
|
76
99
|
intent: 'primary'
|
|
@@ -91,10 +114,11 @@ export class ViewPanelModel extends HoistModel {
|
|
|
91
114
|
{
|
|
92
115
|
name: 'name',
|
|
93
116
|
rules: [
|
|
94
|
-
async ({value}) => {
|
|
117
|
+
async ({value}, {visibility}) => {
|
|
95
118
|
return this.parent.viewManagerModel.validateViewNameAsync(
|
|
96
119
|
value,
|
|
97
|
-
this.view
|
|
120
|
+
this.view,
|
|
121
|
+
visibility === 'global'
|
|
98
122
|
);
|
|
99
123
|
}
|
|
100
124
|
]
|
|
@@ -102,8 +126,7 @@ export class ViewPanelModel extends HoistModel {
|
|
|
102
126
|
{name: 'owner'},
|
|
103
127
|
{name: 'group'},
|
|
104
128
|
{name: 'description'},
|
|
105
|
-
{name: '
|
|
106
|
-
{name: 'isDefaultPinned'}
|
|
129
|
+
{name: 'visibility'}
|
|
107
130
|
]
|
|
108
131
|
});
|
|
109
132
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xh/hoist",
|
|
3
|
-
"version": "76.0.0-SNAPSHOT.
|
|
3
|
+
"version": "76.0.0-SNAPSHOT.1757274887417",
|
|
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",
|