@xh/hoist 71.0.0-SNAPSHOT.1735844948971 → 71.0.0-SNAPSHOT.1735861709598

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.
@@ -11,9 +11,9 @@ export interface ViewCreateSpec {
11
11
  value: PlainObject;
12
12
  }
13
13
  export interface ViewUpdateSpec {
14
- name: string;
15
- group: string;
16
- description: string;
14
+ name?: string;
15
+ group?: string;
16
+ description?: string;
17
17
  isShared?: boolean;
18
18
  isDefaultPinned?: boolean;
19
19
  }
@@ -37,9 +37,9 @@ export interface ViewCreateSpec {
37
37
  }
38
38
 
39
39
  export interface ViewUpdateSpec {
40
- name: string;
41
- group: string;
42
- description: string;
40
+ name?: string;
41
+ group?: string;
42
+ description?: string;
43
43
  isShared?: boolean;
44
44
  isDefaultPinned?: boolean;
45
45
  }
@@ -8,7 +8,7 @@
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} from 'lodash';
11
+ import {capitalize, isUndefined} from 'lodash';
12
12
  import {ManageDialogModel} from './ManageDialogModel';
13
13
  import {makeObservable} from '@xh/hoist/mobx';
14
14
  import {ViewInfo} from '@xh/hoist/cmp/viewmanager';
@@ -55,14 +55,14 @@ export class ViewPanelModel extends HoistModel {
55
55
 
56
56
  async saveAsync() {
57
57
  const {parent, view, formModel} = this,
58
- {name, group, description, isDefaultPinned, isShared} = formModel.getData(),
58
+ updates = formModel.getData(true),
59
59
  isValid = await formModel.validateAsync(),
60
60
  isDirty = formModel.isDirty;
61
61
 
62
62
  if (!isValid || !isDirty) return;
63
63
 
64
- if (view.isOwned && view.isShared != isShared) {
65
- const msg: ReactNode = !isShared
64
+ if (view.isOwned && !isUndefined(updates.isShared)) {
65
+ const msg: ReactNode = !updates.isShared
66
66
  ? `Your ${view.typedName} will no longer be visible to all other ${XH.appName} users.`
67
67
  : `Your ${view.typedName} will become visible to all other ${XH.appName} users.`;
68
68
  const msgs = [msg, strong('Are you sure you want to proceed?')];
@@ -79,13 +79,7 @@ export class ViewPanelModel extends HoistModel {
79
79
  if (!confirmed) return;
80
80
  }
81
81
 
82
- await parent.updateAsync(view, {
83
- name,
84
- group,
85
- description,
86
- isShared,
87
- isDefaultPinned
88
- });
82
+ await parent.updateAsync(view, updates);
89
83
  }
90
84
 
91
85
  //------------------------
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xh/hoist",
3
- "version": "71.0.0-SNAPSHOT.1735844948971",
3
+ "version": "71.0.0-SNAPSHOT.1735861709598",
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",