identity-admin 1.20.0 → 1.21.0
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.
|
@@ -67,7 +67,7 @@ let ResourceController = class ResourceController {
|
|
|
67
67
|
const isAllowed = resource.properties.isAllowed ? yield resource.properties.isAllowed(currentUser) : true;
|
|
68
68
|
const isVisibile = resource.properties.isVisible ? yield resource.properties.isVisible(currentUser) : true;
|
|
69
69
|
if (isAllowed) {
|
|
70
|
-
const adaptedResource = ResourceGenerator_1.default.generate(resource, currentUser);
|
|
70
|
+
const adaptedResource = ResourceGenerator_1.default.generate(resource, currentUser, this.configurations);
|
|
71
71
|
const modelName = StringUtils_1.default.lowerCaseFirstLetter(adaptedResource.properties.modelName);
|
|
72
72
|
modifiedResource[modelName] = adaptedResource;
|
|
73
73
|
if (isVisibile) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Document } from "mongoose";
|
|
2
2
|
import { IResourceFile } from "../types/IResourceFile";
|
|
3
|
+
import { IConfiguartionFile } from "../types/IConfigurationFile";
|
|
3
4
|
export default class ResourceGenerator {
|
|
4
|
-
static generate(resource: IResourceFile, currentUser: Document): any;
|
|
5
|
+
static generate(resource: IResourceFile, currentUser: Document, configurations?: IConfiguartionFile): any;
|
|
5
6
|
}
|
|
@@ -37,7 +37,7 @@ const SetupParent = {
|
|
|
37
37
|
//value: __({phrase: "Setup", locale: i18n.getLocale()})
|
|
38
38
|
};
|
|
39
39
|
class ResourceGenerator {
|
|
40
|
-
static generate(resource, currentUser) {
|
|
40
|
+
static generate(resource, currentUser, configurations) {
|
|
41
41
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
42
42
|
const SetupParent = {
|
|
43
43
|
name: 'Setup',
|
|
@@ -96,7 +96,7 @@ class ResourceGenerator {
|
|
|
96
96
|
modifiedResource.properties.defaultOrder = 'asc';
|
|
97
97
|
}
|
|
98
98
|
if (!resource.properties.defaultrowsPerPage) {
|
|
99
|
-
modifiedResource.properties.defaultrowsPerPage = 10;
|
|
99
|
+
modifiedResource.properties.defaultrowsPerPage = configurations && configurations.defaultRowsPerPage ? configurations.defaultRowsPerPage : 10;
|
|
100
100
|
}
|
|
101
101
|
modifiedResource.listProperties = ResourceHelper_1.default.prepareProperties(resource.listProperties ? resource.listProperties : modifiedResource.listProperties, modelName, modifiedResource.properties.model, resource);
|
|
102
102
|
modifiedResource.showProperties = ResourceHelper_1.default.prepareProperties(resource.showProperties ? resource.showProperties : modifiedResource.showProperties, modelName, modifiedResource.properties.model, resource);
|