@xh/hoist 67.0.0-SNAPSHOT.1725046027559 → 67.0.0-SNAPSHOT.1725047531773
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/admin/tabs/cluster/ClusterTabModel.ts +2 -4
- package/admin/tabs/cluster/services/ServiceModel.ts +1 -1
- package/admin/tabs/general/alertBanner/AlertBannerModel.ts +2 -1
- package/admin/tabs/general/config/ConfigPanelModel.ts +1 -0
- package/admin/tabs/userData/prefs/editor/PrefEditorModel.ts +1 -0
- package/admin/tabs/userData/roles/RoleModel.ts +11 -6
- package/admin/tabs/userData/roles/recategorize/RecategorizeDialog.ts +2 -2
- package/build/types/desktop/cmp/rest/RestGridModel.d.ts +6 -6
- package/desktop/cmp/rest/RestGridModel.ts +8 -11
- package/desktop/cmp/rest/impl/RestFormModel.ts +2 -3
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -184,10 +184,8 @@ export class ClusterTabModel extends HoistModel {
|
|
|
184
184
|
confirmProps: {
|
|
185
185
|
icon: Icon.skull(),
|
|
186
186
|
text: 'Shutdown Now',
|
|
187
|
-
intent: 'danger'
|
|
188
|
-
|
|
189
|
-
cancelProps: {
|
|
190
|
-
autoFocus: true
|
|
187
|
+
intent: 'danger',
|
|
188
|
+
autoFocus: false
|
|
191
189
|
}
|
|
192
190
|
}))
|
|
193
191
|
)
|
|
@@ -125,10 +125,12 @@ export class RoleModel extends HoistModel {
|
|
|
125
125
|
if (this.readonly) return false;
|
|
126
126
|
|
|
127
127
|
const confirm = await XH.confirm({
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
128
|
+
message: `Are you sure you want to delete "${role.name}"? This may affect access to this application.`,
|
|
129
|
+
confirmProps: {
|
|
130
|
+
text: 'Yes, delete role',
|
|
131
|
+
intent: 'danger',
|
|
132
|
+
autoFocus: false
|
|
133
|
+
}
|
|
132
134
|
});
|
|
133
135
|
if (!confirm) return false;
|
|
134
136
|
|
|
@@ -197,8 +199,9 @@ export class RoleModel extends HoistModel {
|
|
|
197
199
|
private groupByAction(): RecordActionSpec {
|
|
198
200
|
return {
|
|
199
201
|
text: 'Group By Category',
|
|
202
|
+
icon: Icon.treeList(),
|
|
200
203
|
displayFn: () => ({
|
|
201
|
-
|
|
204
|
+
text: this.showInGroups ? 'Ungroup Grid' : 'Group by Category'
|
|
202
205
|
}),
|
|
203
206
|
actionFn: () => {
|
|
204
207
|
this.showInGroups = !this.showInGroups;
|
|
@@ -350,15 +353,17 @@ export class RoleModel extends HoistModel {
|
|
|
350
353
|
|
|
351
354
|
private getContextMenuItems() {
|
|
352
355
|
return this.readonly
|
|
353
|
-
? [this.groupByAction(), ...GridModel.defaultContextMenu]
|
|
356
|
+
? [this.groupByAction(), '-', ...GridModel.defaultContextMenu]
|
|
354
357
|
: [
|
|
355
358
|
this.addAction(),
|
|
356
359
|
this.editAction(),
|
|
357
360
|
this.cloneAction(),
|
|
358
361
|
this.deleteAction(),
|
|
362
|
+
'-',
|
|
359
363
|
this.recategorizeDialogModel.recategorizeAction(),
|
|
360
364
|
'-',
|
|
361
365
|
this.groupByAction(),
|
|
366
|
+
'-',
|
|
362
367
|
...GridModel.defaultContextMenu
|
|
363
368
|
];
|
|
364
369
|
}
|
|
@@ -24,7 +24,7 @@ export const recategorizeDialog = hoistCmp.factory({
|
|
|
24
24
|
return dialog({
|
|
25
25
|
title: `Change Category (${model.selectedRecords.length} roles)`,
|
|
26
26
|
icon: Icon.folder(),
|
|
27
|
-
style: {width:
|
|
27
|
+
style: {width: 400},
|
|
28
28
|
isOpen: true,
|
|
29
29
|
isCloseButtonShown: false,
|
|
30
30
|
item: panel({
|
|
@@ -35,7 +35,7 @@ export const recategorizeDialog = hoistCmp.factory({
|
|
|
35
35
|
bind: 'categoryName',
|
|
36
36
|
enableCreate: true,
|
|
37
37
|
options: model.options,
|
|
38
|
-
width:
|
|
38
|
+
width: '100%'
|
|
39
39
|
})
|
|
40
40
|
),
|
|
41
41
|
bbar: bbar()
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { RowDoubleClickedEvent } from '@ag-grid-community/core';
|
|
2
2
|
import { BaseFieldConfig } from '@xh/hoist/cmp/form';
|
|
3
3
|
import { GridConfig, GridModel } from '@xh/hoist/cmp/grid';
|
|
4
|
-
import { HoistModel, PlainObject
|
|
4
|
+
import { ElementSpec, HoistModel, PlainObject } from '@xh/hoist/core';
|
|
5
5
|
import '@xh/hoist/desktop/register';
|
|
6
6
|
import { RecordAction, RecordActionSpec, StoreRecord } from '@xh/hoist/data';
|
|
7
|
+
import { ExportOptions } from '@xh/hoist/svc';
|
|
8
|
+
import { FormFieldProps } from '../form';
|
|
7
9
|
import { RestStore, RestStoreConfig } from './data/RestStore';
|
|
8
10
|
import { RestFormModel } from './impl/RestFormModel';
|
|
9
|
-
import { FormFieldProps } from '../form';
|
|
10
|
-
import { ExportOptions } from '@xh/hoist/svc';
|
|
11
11
|
export interface RestGridConfig extends GridConfig {
|
|
12
12
|
store?: RestStore | RestStoreConfig;
|
|
13
13
|
/** Prevent users from creating, updating, or destroying a record. Defaults to false. */
|
|
14
14
|
readonly?: boolean;
|
|
15
15
|
/** Actions to display in the toolbar. Defaults to add, edit, delete. */
|
|
16
16
|
toolbarActions?: Array<RecordAction | RecordActionSpec>;
|
|
17
|
-
/**
|
|
18
|
-
menuActions?: Array<RecordAction | RecordActionSpec>;
|
|
17
|
+
/** Actions to display in the grid context menu. Defaults to add, edit, delete. */
|
|
18
|
+
menuActions?: Array<RecordAction | RecordActionSpec | '-'>;
|
|
19
19
|
/** Actions to display in the form toolbar. Defaults to delete. */
|
|
20
20
|
formActions?: Array<RecordAction | RecordActionSpec>;
|
|
21
21
|
/** Warning to display before actions on a selection of records. */
|
|
@@ -68,7 +68,7 @@ export declare class RestGridModel extends HoistModel {
|
|
|
68
68
|
readonly: boolean;
|
|
69
69
|
editors: RestGridEditor[];
|
|
70
70
|
toolbarActions: Array<RecordAction | RecordActionSpec>;
|
|
71
|
-
menuActions: Array<RecordAction | RecordActionSpec>;
|
|
71
|
+
menuActions: Array<RecordAction | RecordActionSpec | '-'>;
|
|
72
72
|
formActions: Array<RecordAction | RecordActionSpec>;
|
|
73
73
|
prepareCloneFn: (input: {
|
|
74
74
|
record: StoreRecord;
|
|
@@ -8,17 +8,16 @@
|
|
|
8
8
|
import {RowDoubleClickedEvent} from '@ag-grid-community/core';
|
|
9
9
|
import {BaseFieldConfig} from '@xh/hoist/cmp/form';
|
|
10
10
|
import {GridConfig, GridModel} from '@xh/hoist/cmp/grid';
|
|
11
|
-
import {HoistModel, managed, PlainObject,
|
|
11
|
+
import {ElementSpec, HoistModel, managed, PlainObject, XH} from '@xh/hoist/core';
|
|
12
12
|
import '@xh/hoist/desktop/register';
|
|
13
13
|
import {RecordAction, RecordActionSpec, StoreRecord} from '@xh/hoist/data';
|
|
14
|
-
import {
|
|
14
|
+
import {ExportOptions} from '@xh/hoist/svc';
|
|
15
15
|
import {pluralize, throwIf, withDefault} from '@xh/hoist/utils/js';
|
|
16
16
|
import {isFunction} from 'lodash';
|
|
17
|
-
import {RestStore, RestStoreConfig} from './data/RestStore';
|
|
18
|
-
import {RestFormModel} from './impl/RestFormModel';
|
|
19
17
|
import {FormFieldProps} from '../form';
|
|
20
18
|
import {addAction, deleteAction, editAction, viewAction} from './Actions';
|
|
21
|
-
import {
|
|
19
|
+
import {RestStore, RestStoreConfig} from './data/RestStore';
|
|
20
|
+
import {RestFormModel} from './impl/RestFormModel';
|
|
22
21
|
|
|
23
22
|
export interface RestGridConfig extends GridConfig {
|
|
24
23
|
store?: RestStore | RestStoreConfig;
|
|
@@ -29,8 +28,8 @@ export interface RestGridConfig extends GridConfig {
|
|
|
29
28
|
/** Actions to display in the toolbar. Defaults to add, edit, delete. */
|
|
30
29
|
toolbarActions?: Array<RecordAction | RecordActionSpec>;
|
|
31
30
|
|
|
32
|
-
/**
|
|
33
|
-
menuActions?: Array<RecordAction | RecordActionSpec>;
|
|
31
|
+
/** Actions to display in the grid context menu. Defaults to add, edit, delete. */
|
|
32
|
+
menuActions?: Array<RecordAction | RecordActionSpec | '-'>;
|
|
34
33
|
|
|
35
34
|
/** Actions to display in the form toolbar. Defaults to delete. */
|
|
36
35
|
formActions?: Array<RecordAction | RecordActionSpec>;
|
|
@@ -96,7 +95,7 @@ export class RestGridModel extends HoistModel {
|
|
|
96
95
|
readonly: boolean;
|
|
97
96
|
editors: RestGridEditor[];
|
|
98
97
|
toolbarActions: Array<RecordAction | RecordActionSpec>;
|
|
99
|
-
menuActions: Array<RecordAction | RecordActionSpec>;
|
|
98
|
+
menuActions: Array<RecordAction | RecordActionSpec | '-'>;
|
|
100
99
|
formActions: Array<RecordAction | RecordActionSpec>;
|
|
101
100
|
prepareCloneFn: (input: {record: StoreRecord; clone: PlainObject}) => void;
|
|
102
101
|
unit: string;
|
|
@@ -243,9 +242,7 @@ export class RestGridModel extends HoistModel {
|
|
|
243
242
|
warning = this.actionWarning.del,
|
|
244
243
|
message = isFunction(warning) ? warning(records) : warning;
|
|
245
244
|
|
|
246
|
-
message
|
|
247
|
-
? XH.confirm({message, title: 'Warning', icon: Icon.warning(), onConfirm: delFn})
|
|
248
|
-
: delFn();
|
|
245
|
+
message ? XH.confirm({message, title: 'Warning', onConfirm: delFn}) : delFn();
|
|
249
246
|
}
|
|
250
247
|
|
|
251
248
|
async exportAsync(options?: ExportOptions) {
|
|
@@ -8,9 +8,8 @@ import {FormModel} from '@xh/hoist/cmp/form';
|
|
|
8
8
|
import {HoistModel, managed, PlainObject, XH} from '@xh/hoist/core';
|
|
9
9
|
import {required} from '@xh/hoist/data';
|
|
10
10
|
import {RestGridEditor, RestGridModel} from '@xh/hoist/desktop/cmp/rest';
|
|
11
|
-
import {Icon} from '@xh/hoist/icon';
|
|
12
11
|
import {action, makeObservable, observable} from '@xh/hoist/mobx';
|
|
13
|
-
import {
|
|
12
|
+
import {mergeDeep, throwIf} from '@xh/hoist/utils/js';
|
|
14
13
|
import {isFunction, isNil} from 'lodash';
|
|
15
14
|
import {createRef} from 'react';
|
|
16
15
|
import {RestField} from '../data/RestField';
|
|
@@ -119,7 +118,7 @@ export class RestFormModel extends HoistModel {
|
|
|
119
118
|
const warning = this.actionWarning[this.isAdd ? 'add' : 'edit'],
|
|
120
119
|
message = isFunction(warning) ? warning([this.currentRecord]) : warning;
|
|
121
120
|
if (message) {
|
|
122
|
-
if (!(await XH.confirm({message, title: 'Warning'
|
|
121
|
+
if (!(await XH.confirm({message, title: 'Warning'}))) {
|
|
123
122
|
return;
|
|
124
123
|
}
|
|
125
124
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xh/hoist",
|
|
3
|
-
"version": "67.0.0-SNAPSHOT.
|
|
3
|
+
"version": "67.0.0-SNAPSHOT.1725047531773",
|
|
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",
|