identity-admin 1.25.0 → 1.25.1
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.
|
@@ -53,9 +53,15 @@ class ActionsGenerator {
|
|
|
53
53
|
extraActions.forEach((action) => {
|
|
54
54
|
action.keys = action.isVisible ? Object.keys(action.isVisible) : [];
|
|
55
55
|
action.name = (0, i18n_1.__)({ phrase: action.name, locale: i18n_1.default.getLocale() });
|
|
56
|
-
action.guardTitle = action.guardTitle
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
action.guardTitle = action.guardTitle
|
|
57
|
+
? (0, i18n_1.__)({ phrase: action.guardTitle, locale: i18n_1.default.getLocale() })
|
|
58
|
+
: undefined;
|
|
59
|
+
action.guard = action.guard
|
|
60
|
+
? (0, i18n_1.__)({ phrase: action.guard, locale: i18n_1.default.getLocale() })
|
|
61
|
+
: undefined;
|
|
62
|
+
action.message = action.message
|
|
63
|
+
? (0, i18n_1.__)({ phrase: action.message, locale: i18n_1.default.getLocale() })
|
|
64
|
+
: undefined;
|
|
59
65
|
action.handlerStrategy = action.handlerStrategy
|
|
60
66
|
? action.handlerStrategy
|
|
61
67
|
: helpers_1.HandlerStrategy.NORMAL;
|
|
@@ -68,11 +74,21 @@ class ActionsGenerator {
|
|
|
68
74
|
static getActions(actions, currentUser, configuration) {
|
|
69
75
|
var _a, _b, _c, _d, _e, _f;
|
|
70
76
|
var actionObject = {
|
|
71
|
-
show: {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
77
|
+
show: {
|
|
78
|
+
isAccessible: ((_a = configuration === null || configuration === void 0 ? void 0 : configuration.actions) === null || _a === void 0 ? void 0 : _a.show) === false ? false : true,
|
|
79
|
+
},
|
|
80
|
+
new: {
|
|
81
|
+
isAccessible: ((_b = configuration === null || configuration === void 0 ? void 0 : configuration.actions) === null || _b === void 0 ? void 0 : _b.new) === false ? false : true,
|
|
82
|
+
},
|
|
83
|
+
edit: {
|
|
84
|
+
isAccessible: ((_c = configuration === null || configuration === void 0 ? void 0 : configuration.actions) === null || _c === void 0 ? void 0 : _c.edit) === false ? false : true,
|
|
85
|
+
},
|
|
86
|
+
delete: {
|
|
87
|
+
isAccessible: ((_d = configuration === null || configuration === void 0 ? void 0 : configuration.actions) === null || _d === void 0 ? void 0 : _d.delete) === false ? false : true,
|
|
88
|
+
},
|
|
89
|
+
bulkDelete: {
|
|
90
|
+
isAccessible: ((_e = configuration === null || configuration === void 0 ? void 0 : configuration.actions) === null || _e === void 0 ? void 0 : _e.bulkDelete) === true ? true : false,
|
|
91
|
+
},
|
|
76
92
|
};
|
|
77
93
|
if (!actions || Object.keys(actions).length === 0) {
|
|
78
94
|
return actionObject;
|
|
@@ -105,6 +121,11 @@ class ActionsGenerator {
|
|
|
105
121
|
? translation
|
|
106
122
|
: (0, i18n_1.__)({ phrase: "actions_edit", locale: i18n_1.default.getLocale() });
|
|
107
123
|
break;
|
|
124
|
+
case "show":
|
|
125
|
+
actionObject.value = translation
|
|
126
|
+
? translation
|
|
127
|
+
: (0, i18n_1.__)({ phrase: "actions_show", locale: i18n_1.default.getLocale() });
|
|
128
|
+
break;
|
|
108
129
|
case "delete":
|
|
109
130
|
actionObject.value = translation
|
|
110
131
|
? translation
|