identity-admin 1.25.17 → 1.25.18

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.
@@ -58,12 +58,14 @@ let ResourceController = class ResourceController {
58
58
  this.PermissionModel = PermissionModel;
59
59
  }
60
60
  index(req, res) {
61
+ var _a;
61
62
  return __awaiter(this, void 0, void 0, function* () {
62
63
  var modifiedResource = {};
63
64
  modifiedResource.modelParents = {};
64
65
  const currentUser = req.user;
65
66
  if (this.configurations) {
66
67
  modifiedResource.appConfigurations = this.configurations;
68
+ modifiedResource.appConfigurations.showMainActions = (_a = modifiedResource.appConfigurations.showMainActions) !== null && _a !== void 0 ? _a : true;
67
69
  }
68
70
  for (var i = 0; i < this.resourceFiles.length; i++) {
69
71
  const resource = this.resourceFiles[i];
@@ -72,16 +72,18 @@ class ActionsGenerator {
72
72
  return extraActionsObject;
73
73
  }
74
74
  static getActions(actions, currentUser, configuration) {
75
- var _a, _b, _c, _d, _e, _f;
75
+ var _a, _b, _c, _d, _e, _f, _g;
76
76
  var actionObject = {
77
77
  show: {
78
78
  isAccessible: ((_a = configuration === null || configuration === void 0 ? void 0 : configuration.actions) === null || _a === void 0 ? void 0 : _a.show) === false ? false : true,
79
+ isMainAction: true
79
80
  },
80
81
  new: {
81
82
  isAccessible: ((_b = configuration === null || configuration === void 0 ? void 0 : configuration.actions) === null || _b === void 0 ? void 0 : _b.new) === false ? false : true,
82
83
  },
83
84
  edit: {
84
85
  isAccessible: ((_c = configuration === null || configuration === void 0 ? void 0 : configuration.actions) === null || _c === void 0 ? void 0 : _c.edit) === false ? false : true,
86
+ isMainAction: true
85
87
  },
86
88
  delete: {
87
89
  isAccessible: ((_d = configuration === null || configuration === void 0 ? void 0 : configuration.actions) === null || _d === void 0 ? void 0 : _d.delete) === false ? false : true,
@@ -106,6 +108,8 @@ class ActionsGenerator {
106
108
  actionObject[key] = actions[key];
107
109
  }
108
110
  actionObject[key].reloadAfterAction = (_f = actions[key]) === null || _f === void 0 ? void 0 : _f.reloadAfterAction;
111
+ actionObject[key].isMainAction =
112
+ (_g = actions[key].isMainAction) !== null && _g !== void 0 ? _g : (key === "edit" || key === "show");
109
113
  }
110
114
  return actionObject;
111
115
  }
@@ -2,5 +2,8 @@ declare type sizeTypes = 'small' | 'medium';
2
2
  export interface IConfiguartionFile {
3
3
  textFieldSize?: sizeTypes;
4
4
  defaultRowsPerPage?: number;
5
+ themeLayout?: 'mini' | 'vertical' | 'horizontal';
6
+ themeStretch?: boolean;
7
+ showMainActions?: boolean;
5
8
  }
6
9
  export {};
@@ -55,6 +55,11 @@ interface Action {
55
55
  * @default 'Same as isAccessible'
56
56
  */
57
57
  isAllowed?: (currentUser: Document) => boolean;
58
+ /**
59
+ * The property that manages which action will be extracted from action menu in list.
60
+ * @default true for edit and show false for others
61
+ */
62
+ isMainAction?: boolean;
58
63
  }
59
64
  interface ICrudOperations {
60
65
  index?: {
@@ -421,6 +426,11 @@ export interface ExtraAction {
421
426
  * {@link https://mui.com/material-ui/material-icons/}
422
427
  */
423
428
  handlerStrategy?: HandlerStrategy;
429
+ /**
430
+ * The property that manages which action will be extracted from action menu in list.
431
+ * @default true for edit and show false for others
432
+ */
433
+ isMainAction?: boolean;
424
434
  }
425
435
  export interface IActionHandlerResponse {
426
436
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "identity-admin",
3
- "version": "1.25.17",
3
+ "version": "1.25.18",
4
4
  "description": "",
5
5
  "main": "lib/Dashboard.js",
6
6
  "types": "lib/Dashbord.d.ts",