identity-admin 1.28.22 → 1.28.23

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.
@@ -60,7 +60,7 @@ class ActionsGenerator {
60
60
  return extraActionsObject;
61
61
  }
62
62
  static getActions(actions, currentUser, configuration) {
63
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
63
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
64
64
  var actionObject = {
65
65
  show: {
66
66
  isAccessible: ((_a = configuration === null || configuration === void 0 ? void 0 : configuration.actions) === null || _a === void 0 ? void 0 : _a.show) === false ? false : true,
@@ -70,20 +70,20 @@ class ActionsGenerator {
70
70
  isAccessible: ((_b = configuration === null || configuration === void 0 ? void 0 : configuration.actions) === null || _b === void 0 ? void 0 : _b.new) === false ? false : true,
71
71
  },
72
72
  duplicate: {
73
- isAccessible: ((_c = configuration === null || configuration === void 0 ? void 0 : configuration.actions) === null || _c === void 0 ? void 0 : _c.new) === false ? false : true,
73
+ isAccessible: ((_c = configuration === null || configuration === void 0 ? void 0 : configuration.actions) === null || _c === void 0 ? void 0 : _c.new) === false ? false : ((_d = configuration === null || configuration === void 0 ? void 0 : configuration.actions) === null || _d === void 0 ? void 0 : _d.duplicate) === false ? false : true,
74
74
  },
75
75
  edit: {
76
- isAccessible: ((_d = configuration === null || configuration === void 0 ? void 0 : configuration.actions) === null || _d === void 0 ? void 0 : _d.edit) === false ? false : true,
76
+ isAccessible: ((_e = configuration === null || configuration === void 0 ? void 0 : configuration.actions) === null || _e === void 0 ? void 0 : _e.edit) === false ? false : true,
77
77
  isMainAction: true,
78
78
  },
79
79
  delete: {
80
- isAccessible: ((_e = configuration === null || configuration === void 0 ? void 0 : configuration.actions) === null || _e === void 0 ? void 0 : _e.delete) === false ? false : true,
80
+ isAccessible: ((_f = configuration === null || configuration === void 0 ? void 0 : configuration.actions) === null || _f === void 0 ? void 0 : _f.delete) === false ? false : true,
81
81
  },
82
82
  import: {
83
- isAccessible: ((_f = configuration === null || configuration === void 0 ? void 0 : configuration.actions) === null || _f === void 0 ? void 0 : _f.import) === true ? true : false,
83
+ isAccessible: ((_g = configuration === null || configuration === void 0 ? void 0 : configuration.actions) === null || _g === void 0 ? void 0 : _g.import) === true ? true : false,
84
84
  },
85
85
  bulkDelete: {
86
- isAccessible: ((_g = configuration === null || configuration === void 0 ? void 0 : configuration.actions) === null || _g === void 0 ? void 0 : _g.bulkDelete) === true ? true : false,
86
+ isAccessible: ((_h = configuration === null || configuration === void 0 ? void 0 : configuration.actions) === null || _h === void 0 ? void 0 : _h.bulkDelete) === true ? true : false,
87
87
  },
88
88
  };
89
89
  if (!actions || Object.keys(actions).length === 0) {
@@ -101,8 +101,8 @@ class ActionsGenerator {
101
101
  else if (key === 'extras') {
102
102
  actionObject[key] = actions[key];
103
103
  }
104
- actionObject[key].reloadAfterAction = (_h = actions[key]) === null || _h === void 0 ? void 0 : _h.reloadAfterAction;
105
- actionObject[key].isMainAction = (_j = actions[key].isMainAction) !== null && _j !== void 0 ? _j : (key === 'edit' || key === 'show');
104
+ actionObject[key].reloadAfterAction = (_j = actions[key]) === null || _j === void 0 ? void 0 : _j.reloadAfterAction;
105
+ actionObject[key].isMainAction = (_k = actions[key].isMainAction) !== null && _k !== void 0 ? _k : (key === 'edit' || key === 'show');
106
106
  }
107
107
  return actionObject;
108
108
  }
@@ -7,6 +7,7 @@ export interface IModelConfigurationActions {
7
7
  delete?: boolean;
8
8
  bulkDelete?: boolean;
9
9
  import?: boolean;
10
+ duplicate?: boolean;
10
11
  }
11
12
  export interface IModelConfigurationProps {
12
13
  _id?: Types.ObjectId;
@@ -1,4 +1,4 @@
1
- import { Schema, SchemaOptions } from "mongoose";
1
+ import { Schema, SchemaOptions } from 'mongoose';
2
2
  export declare enum RowArrangeType {
3
3
  ASCENDING = "asc",
4
4
  DESCENDING = "desc"
@@ -40,6 +40,10 @@ const ActionSchema = new mongoose_1.Schema({
40
40
  type: Boolean,
41
41
  required: false,
42
42
  },
43
+ duplicate: {
44
+ type: Boolean,
45
+ required: false,
46
+ },
43
47
  }, { _id: false });
44
48
  function getModelConfiguartionSchema(schemaOptions) {
45
49
  return new mongoose_1.Schema({
@@ -68,7 +72,7 @@ function getModelConfiguartionSchema(schemaOptions) {
68
72
  },
69
73
  actions: {
70
74
  type: ActionSchema,
71
- required: false
75
+ required: false,
72
76
  },
73
77
  listProperties: [
74
78
  {
@@ -8,5 +8,6 @@ export interface IConfiguartionFile {
8
8
  adminNotifications?: boolean;
9
9
  baseApiUrl?: string;
10
10
  enableLocalization?: boolean;
11
+ disableDuplicateAction?: boolean;
11
12
  }
12
13
  export {};
@@ -451,6 +451,7 @@ interface ActionOptions {
451
451
  delete?: Action;
452
452
  import?: Action;
453
453
  bulkDelete?: Action;
454
+ duplicate?: Action;
454
455
  /**
455
456
  * Any extra action to be added.
456
457
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "identity-admin",
3
- "version": "1.28.22",
3
+ "version": "1.28.23",
4
4
  "description": "",
5
5
  "main": "lib/Dashboard.js",
6
6
  "types": "lib/Dashbord.d.ts",