@xh/hoist 67.0.0-SNAPSHOT.1724362478970 → 67.0.0-SNAPSHOT.1724719449021

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.
@@ -9,6 +9,7 @@ import {filler} from '@xh/hoist/cmp/layout';
9
9
  import {hoistCmp, uses} from '@xh/hoist/core';
10
10
  import {button} from '@xh/hoist/desktop/cmp/button';
11
11
  import {select} from '@xh/hoist/desktop/cmp/input';
12
+ import {panel} from '@xh/hoist/desktop/cmp/panel';
12
13
  import {toolbar} from '@xh/hoist/desktop/cmp/toolbar';
13
14
  import {Icon} from '@xh/hoist/icon';
14
15
  import {dialog, dialogBody} from '@xh/hoist/kit/blueprint';
@@ -17,7 +18,7 @@ export const recategorizeDialog = hoistCmp.factory({
17
18
  model: uses(RecategorizeDialogModel),
18
19
 
19
20
  render({model}) {
20
- const {isOpen} = model;
21
+ const {isOpen, savingTask} = model;
21
22
  if (!isOpen) return null;
22
23
 
23
24
  return dialog({
@@ -26,22 +27,24 @@ export const recategorizeDialog = hoistCmp.factory({
26
27
  style: {width: 300},
27
28
  isOpen: true,
28
29
  isCloseButtonShown: false,
29
- items: [
30
- dialogBody(
30
+ item: panel({
31
+ mask: savingTask,
32
+ item: dialogBody(
31
33
  select({
34
+ autoFocus: true,
32
35
  bind: 'categoryName',
33
36
  enableCreate: true,
34
37
  options: model.options,
35
38
  width: 260
36
39
  })
37
40
  ),
38
- tbar()
39
- ]
41
+ bbar: bbar()
42
+ })
40
43
  });
41
44
  }
42
45
  });
43
46
 
44
- const tbar = hoistCmp.factory<RecategorizeDialogModel>(({model}) => {
47
+ const bbar = hoistCmp.factory<RecategorizeDialogModel>(({model}) => {
45
48
  return toolbar(
46
49
  filler(),
47
50
  button({
@@ -5,7 +5,7 @@
5
5
  * Copyright © 2024 Extremely Heavy Industries Inc.
6
6
  */
7
7
  import {RoleModel} from '@xh/hoist/admin/tabs/userData/roles/RoleModel';
8
- import {HoistModel, XH} from '@xh/hoist/core';
8
+ import {HoistModel, TaskObserver, XH} from '@xh/hoist/core';
9
9
  import {StoreRecord} from '@xh/hoist/data';
10
10
  import {Icon} from '@xh/hoist/icon/Icon';
11
11
  import {action, bindable, makeObservable, observable} from '@xh/hoist/mobx';
@@ -15,6 +15,8 @@ export class RecategorizeDialogModel extends HoistModel {
15
15
  private parent: RoleModel;
16
16
  selectedRecords: StoreRecord[];
17
17
 
18
+ readonly savingTask = TaskObserver.trackLast();
19
+
18
20
  @bindable categoryName = null;
19
21
  @observable isOpen = false;
20
22
 
@@ -53,17 +55,21 @@ export class RecategorizeDialogModel extends HoistModel {
53
55
  it => !it.isGroupRow
54
56
  );
55
57
  const roles: string[] = map(roleSpec, it => it.name);
56
- await XH.fetchService
57
- .postJson({
58
- url: 'roleAdmin/bulkCategoryUpdate',
59
- body: {
60
- roles,
61
- category: this.categoryName === '_CLEAR_ROLES_' ? null : this.categoryName
62
- }
63
- })
64
- .catchDefault();
65
- await this.parent.refreshAsync();
66
- this.close();
58
+ try {
59
+ await XH.fetchService
60
+ .postJson({
61
+ url: 'roleAdmin/bulkCategoryUpdate',
62
+ body: {
63
+ roles,
64
+ category: this.categoryName === '_CLEAR_ROLES_' ? null : this.categoryName
65
+ }
66
+ })
67
+ .linkTo(this.savingTask);
68
+ await this.parent.refreshAsync();
69
+ this.close();
70
+ } catch (e) {
71
+ XH.handleException(e);
72
+ }
67
73
  }
68
74
 
69
75
  //-----------------
@@ -1,8 +1,9 @@
1
- import { HoistModel } from '@xh/hoist/core';
1
+ import { HoistModel, TaskObserver } from '@xh/hoist/core';
2
2
  import { StoreRecord } from '@xh/hoist/data';
3
3
  export declare class RecategorizeDialogModel extends HoistModel {
4
4
  private parent;
5
5
  selectedRecords: StoreRecord[];
6
+ readonly savingTask: TaskObserver;
6
7
  categoryName: any;
7
8
  isOpen: boolean;
8
9
  recategorizeAction(): {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xh/hoist",
3
- "version": "67.0.0-SNAPSHOT.1724362478970",
3
+ "version": "67.0.0-SNAPSHOT.1724719449021",
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",