identity-admin 1.26.17 → 1.26.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.
- package/README.md +294 -294
- package/lib/Dashboard.d.ts +14 -14
- package/lib/Dashboard.js +95 -95
- package/lib/container/helpers/HelperInversify.d.ts +6 -6
- package/lib/container/helpers/HelperInversify.js +10 -10
- package/lib/container/helpers/HelperTypes.d.ts +5 -5
- package/lib/container/helpers/HelperTypes.js +7 -7
- package/lib/container/index.d.ts +1 -1
- package/lib/container/index.js +14 -14
- package/lib/container/repositories/RepositoryInversify.d.ts +4 -4
- package/lib/container/repositories/RepositoryInversify.js +13 -13
- package/lib/container/repositories/RepositoryTypes.d.ts +4 -4
- package/lib/container/repositories/RepositoryTypes.js +6 -6
- package/lib/container/types.d.ts +8 -8
- package/lib/container/types.js +9 -9
- package/lib/controllers/ActionController.d.ts +8 -8
- package/lib/controllers/ActionController.js +96 -96
- package/lib/controllers/AdminNotificationController.d.ts +8 -8
- package/lib/controllers/AdminNotificationController.js +69 -69
- package/lib/controllers/DashboardController.d.ts +43 -43
- package/lib/controllers/DashboardController.js +741 -741
- package/lib/controllers/ResourceController.d.ts +15 -15
- package/lib/controllers/ResourceController.js +135 -135
- package/lib/helpers/ActionsGenerator.d.ts +11 -11
- package/lib/helpers/ActionsGenerator.js +179 -179
- package/lib/helpers/AdminNotifications/AdminNotificationCreation.d.ts +48 -48
- package/lib/helpers/AdminNotifications/AdminNotificationCreation.js +66 -66
- package/lib/helpers/AdminNotifications/AdminNotificationFetcher.d.ts +51 -51
- package/lib/helpers/AdminNotifications/AdminNotificationFetcher.js +39 -39
- package/lib/helpers/FiltersHelper.d.ts +9 -9
- package/lib/helpers/FiltersHelper.js +113 -113
- package/lib/helpers/LocalesHelper.d.ts +4 -4
- package/lib/helpers/LocalesHelper.js +73 -73
- package/lib/helpers/LocalizedStringHelper.d.ts +9 -9
- package/lib/helpers/LocalizedStringHelper.js +57 -57
- package/lib/helpers/Permissions/PermissionFetcher.d.ts +8 -8
- package/lib/helpers/Permissions/PermissionFetcher.js +95 -95
- package/lib/helpers/Permissions/PermissionLabel.d.ts +2 -2
- package/lib/helpers/Permissions/PermissionLabel.js +42 -42
- package/lib/helpers/Permissions/PermissionMapper.d.ts +13 -13
- package/lib/helpers/Permissions/PermissionMapper.js +35 -35
- package/lib/helpers/Permissions/PermissionResource.d.ts +6 -6
- package/lib/helpers/Permissions/PermissionResource.js +62 -62
- package/lib/helpers/Permissions/PermissionSavingService.d.ts +13 -13
- package/lib/helpers/Permissions/PermissionSavingService.js +32 -32
- package/lib/helpers/Permissions/SavePermissionGroup.d.ts +6 -6
- package/lib/helpers/Permissions/SavePermissionGroup.js +32 -32
- package/lib/helpers/Permissions/UpdatePermissionGroup.d.ts +6 -6
- package/lib/helpers/Permissions/UpdatePermissionGroup.js +50 -50
- package/lib/helpers/Permissions/types.d.ts +17 -17
- package/lib/helpers/Permissions/types.js +2 -2
- package/lib/helpers/PopulationHelper.d.ts +12 -12
- package/lib/helpers/PopulationHelper.js +50 -50
- package/lib/helpers/ReportsGenerator.d.ts +11 -11
- package/lib/helpers/ReportsGenerator.js +57 -57
- package/lib/helpers/ResourceGenerator.d.ts +9 -9
- package/lib/helpers/ResourceGenerator.js +172 -172
- package/lib/helpers/ResourceHelper.d.ts +28 -28
- package/lib/helpers/ResourceHelper.js +395 -395
- package/lib/helpers/RportsGenerator.d.ts +10 -10
- package/lib/helpers/RportsGenerator.js +21 -21
- package/lib/helpers/SchemaGenerator.d.ts +7 -5
- package/lib/helpers/SchemaGenerator.js +130 -101
- package/lib/helpers/SchemaHelper.d.ts +5 -5
- package/lib/helpers/SchemaHelper.js +21 -21
- package/lib/helpers/UserActionsLog/UserActionsLogHelper.d.ts +2 -2
- package/lib/helpers/UserActionsLog/UserActionsLogHelper.js +49 -49
- package/lib/locales/en.json +53 -53
- package/lib/middlewares/cache/decorator.d.ts +3 -3
- package/lib/middlewares/cache/decorator.js +60 -60
- package/lib/middlewares/cache/deletionMethods.d.ts +3 -3
- package/lib/middlewares/cache/deletionMethods.js +23 -23
- package/lib/middlewares/isAuth.d.ts +13 -13
- package/lib/middlewares/isAuth.js +43 -43
- package/lib/models/ModelNames.d.ts +9 -9
- package/lib/models/ModelNames.js +12 -12
- package/lib/models/adminNotification/AdminNotification.d.ts +5 -5
- package/lib/models/adminNotification/AdminNotification.js +50 -50
- package/lib/models/adminNotification/IAdminNotification.d.ts +29 -29
- package/lib/models/adminNotification/IAdminNotification.js +15 -15
- package/lib/models/adminpermission/AdminPermission.d.ts +11 -11
- package/lib/models/adminpermission/AdminPermission.js +23 -23
- package/lib/models/adminpermission/IAdminPermission.d.ts +13 -13
- package/lib/models/adminpermission/IAdminPermission.js +2 -2
- package/lib/models/customPage/CustomPage.d.ts +2 -2
- package/lib/models/customPage/CustomPage.js +38 -38
- package/lib/models/customPage/ICustomPage.d.ts +17 -17
- package/lib/models/customPage/ICustomPage.js +2 -2
- package/lib/models/file/File.d.ts +2 -2
- package/lib/models/file/File.js +23 -23
- package/lib/models/file/IFile.d.ts +15 -15
- package/lib/models/file/IFile.js +2 -2
- package/lib/models/location/ILocation.d.ts +14 -14
- package/lib/models/location/ILocation.js +2 -2
- package/lib/models/location/Location.d.ts +2 -2
- package/lib/models/location/Location.js +21 -21
- package/lib/models/modelConfiguration/IModelConfigurations.d.ts +29 -29
- package/lib/models/modelConfiguration/IModelConfigurations.js +2 -2
- package/lib/models/modelConfiguration/ModelConfiguration.d.ts +13 -13
- package/lib/models/modelConfiguration/ModelConfiguration.js +95 -95
- package/lib/models/permission/IPermission.d.ts +14 -14
- package/lib/models/permission/IPermission.js +2 -2
- package/lib/models/permission/Permission.d.ts +2 -2
- package/lib/models/permission/Permission.js +21 -21
- package/lib/models/request-log/IRequestLog.d.ts +22 -22
- package/lib/models/request-log/IRequestLog.js +2 -2
- package/lib/models/request-log/RequestLog.d.ts +3 -3
- package/lib/models/request-log/RequestLog.js +51 -51
- package/lib/models/userActionsLog/IUserActionsLog.d.ts +26 -26
- package/lib/models/userActionsLog/IUserActionsLog.js +11 -11
- package/lib/models/userActionsLog/UserActionsLog.d.ts +3 -3
- package/lib/models/userActionsLog/UserActionsLog.js +41 -41
- package/lib/pdf/ReportTemplate.d.ts +71 -71
- package/lib/pdf/ReportTemplate.js +94 -94
- package/lib/repositories/AdminNotificationRepository.d.ts +7 -7
- package/lib/repositories/AdminNotificationRepository.js +23 -23
- package/lib/repositories/DashboardRepository.d.ts +5 -5
- package/lib/repositories/DashboardRepository.js +12 -12
- package/lib/repositories/Repository.d.ts +68 -68
- package/lib/repositories/Repository.js +212 -212
- package/lib/repositories/RequestLogRepository.d.ts +10 -10
- package/lib/repositories/RequestLogRepository.js +54 -54
- package/lib/repositories/SaveResult.d.ts +14 -14
- package/lib/repositories/SaveResult.js +18 -18
- package/lib/resources/AdminNotificationsResource.d.ts +3 -3
- package/lib/resources/AdminNotificationsResource.js +23 -23
- package/lib/resources/parents.d.ts +4 -4
- package/lib/resources/parents.js +7 -7
- package/lib/router/index.d.ts +8 -8
- package/lib/router/index.js +104 -104
- package/lib/types/DashbordConfig.d.ts +21 -21
- package/lib/types/DashbordConfig.js +2 -2
- package/lib/types/IConfigurationFile.d.ts +11 -10
- package/lib/types/IConfigurationFile.js +2 -2
- package/lib/types/IResourceFile.d.ts +675 -675
- package/lib/types/IResourceFile.js +2 -2
- package/lib/types/IResourceResponse.d.ts +95 -95
- package/lib/types/IResourceResponse.js +2 -2
- package/lib/types/helpers.d.ts +66 -66
- package/lib/types/helpers.js +77 -77
- package/lib/utils/ResourceUtils.d.ts +2 -2
- package/lib/utils/ResourceUtils.js +7 -7
- package/lib/utils/ResponseUtils.d.ts +11 -11
- package/lib/utils/ResponseUtils.js +41 -41
- package/lib/utils/StringUtils.d.ts +9 -9
- package/lib/utils/StringUtils.js +46 -46
- package/lib/view/asset-manifest.json +18 -18
- package/lib/view/assets/icons/delete_icon.svg +3 -3
- package/lib/view/assets/icons/flags/ic_flag_cn.svg +9 -9
- package/lib/view/assets/icons/flags/ic_flag_sa.svg +9 -9
- package/lib/view/assets/icons/flags/ic_flag_vn.svg +9 -9
- package/lib/view/assets/icons/info_icon.svg +3 -3
- package/lib/view/assets/icons/navbar/ic_banking.svg +5 -5
- package/lib/view/assets/icons/navbar/ic_invoice.svg +4 -4
- package/lib/view/assets/icons/navbar/ic_kanban.svg +7 -7
- package/lib/view/assets/icons/navbar/ic_menu_item.svg +8 -8
- package/lib/view/assets/icons/small_info_icon.svg +3 -3
- package/lib/view/assets/illustrations/Group 16.svg +4 -4
- package/lib/view/assets/illustrations/logo.svg +5 -5
- package/lib/view/favicon/browserconfig.xml +9 -9
- package/lib/view/favicon/safari-pinned-tab.svg +182 -182
- package/lib/view/favicon/site.webmanifest +19 -19
- package/lib/view/fonts/index.css +18 -18
- package/lib/view/index.html +52 -52
- package/lib/view/manifest.json +20 -20
- package/lib/view/robots.txt +3 -3
- package/lib/view/static/css/main.54de06ef.css +1 -1
- package/lib/view/static/js/574.778b5963.chunk.js +1 -1
- package/lib/view/static/js/678.521704a3.chunk.js +1 -1
- package/lib/view/static/js/798.54856416.chunk.js +1 -1
- package/lib/view/static/js/main.4687f255.js +2 -2
- package/lib/view/static/js/main.4687f255.js.LICENSE.txt +214 -214
- package/package.json +62 -62
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
/// <reference types="mongoose" />
|
|
2
|
-
/// <reference types="mongoose" />
|
|
3
|
-
/// <reference types="mongoose" />
|
|
4
|
-
/// <reference types="mongoose" />
|
|
5
|
-
/// <reference types="mongoose" />
|
|
6
|
-
/// <reference types="mongoose" />
|
|
7
|
-
/// <reference types="mongoose" />
|
|
8
|
-
/// <reference types="mongoose" />
|
|
9
|
-
/// <reference types="mongoose" />
|
|
10
|
-
/// <reference types="mongoose" />
|
|
11
|
-
/// <reference types="mongoose" />
|
|
12
|
-
/// <reference types="mongoose" />
|
|
13
|
-
/// <reference types="mongoose" />
|
|
14
|
-
/// <reference types="mongoose" />
|
|
15
|
-
/// <reference types="mongoose" />
|
|
16
|
-
/// <reference types="mongoose" />
|
|
17
|
-
/// <reference types="mongoose" />
|
|
18
|
-
/// <reference types="mongoose" />
|
|
19
|
-
/// <reference types="mongoose" />
|
|
20
|
-
/// <reference types="mongoose" />
|
|
21
|
-
/// <reference types="mongoose" />
|
|
22
|
-
/// <reference types="mongoose" />
|
|
23
|
-
/// <reference types="mongoose" />
|
|
24
|
-
/// <reference types="mongoose" />
|
|
25
|
-
/// <reference types="passport-local-mongoose" />
|
|
26
|
-
/// <reference types="mongoose" />
|
|
27
|
-
import { AdminNotificationNavigationType, AdminNotificationTypePriority } from '../../models/adminNotification/IAdminNotification';
|
|
28
|
-
export interface IMappedAdminNotification {
|
|
29
|
-
id: string;
|
|
30
|
-
text: string;
|
|
31
|
-
createdAt: Date;
|
|
32
|
-
clickable: boolean;
|
|
33
|
-
redirectUrl?: string;
|
|
34
|
-
redirectUrlType: AdminNotificationNavigationType;
|
|
35
|
-
isRead: boolean;
|
|
36
|
-
priority: AdminNotificationTypePriority;
|
|
37
|
-
type?: string;
|
|
38
|
-
}
|
|
39
|
-
export declare class AdminNotificationFetcher {
|
|
40
|
-
static fetchNotifications(): Promise<{
|
|
41
|
-
id: import("mongoose").Types.ObjectId;
|
|
42
|
-
text: string;
|
|
43
|
-
createdAt: Date;
|
|
44
|
-
clickable: boolean;
|
|
45
|
-
redirectUrl: String | undefined;
|
|
46
|
-
redirectUrlType: AdminNotificationNavigationType | undefined;
|
|
47
|
-
isRead: boolean | undefined;
|
|
48
|
-
priority: AdminNotificationTypePriority | undefined;
|
|
49
|
-
type: string | undefined;
|
|
50
|
-
}[]>;
|
|
51
|
-
}
|
|
1
|
+
/// <reference types="mongoose" />
|
|
2
|
+
/// <reference types="mongoose" />
|
|
3
|
+
/// <reference types="mongoose" />
|
|
4
|
+
/// <reference types="mongoose" />
|
|
5
|
+
/// <reference types="mongoose" />
|
|
6
|
+
/// <reference types="mongoose" />
|
|
7
|
+
/// <reference types="mongoose" />
|
|
8
|
+
/// <reference types="mongoose" />
|
|
9
|
+
/// <reference types="mongoose" />
|
|
10
|
+
/// <reference types="mongoose" />
|
|
11
|
+
/// <reference types="mongoose" />
|
|
12
|
+
/// <reference types="mongoose" />
|
|
13
|
+
/// <reference types="mongoose" />
|
|
14
|
+
/// <reference types="mongoose" />
|
|
15
|
+
/// <reference types="mongoose" />
|
|
16
|
+
/// <reference types="mongoose" />
|
|
17
|
+
/// <reference types="mongoose" />
|
|
18
|
+
/// <reference types="mongoose" />
|
|
19
|
+
/// <reference types="mongoose" />
|
|
20
|
+
/// <reference types="mongoose" />
|
|
21
|
+
/// <reference types="mongoose" />
|
|
22
|
+
/// <reference types="mongoose" />
|
|
23
|
+
/// <reference types="mongoose" />
|
|
24
|
+
/// <reference types="mongoose" />
|
|
25
|
+
/// <reference types="passport-local-mongoose" />
|
|
26
|
+
/// <reference types="mongoose" />
|
|
27
|
+
import { AdminNotificationNavigationType, AdminNotificationTypePriority } from '../../models/adminNotification/IAdminNotification';
|
|
28
|
+
export interface IMappedAdminNotification {
|
|
29
|
+
id: string;
|
|
30
|
+
text: string;
|
|
31
|
+
createdAt: Date;
|
|
32
|
+
clickable: boolean;
|
|
33
|
+
redirectUrl?: string;
|
|
34
|
+
redirectUrlType: AdminNotificationNavigationType;
|
|
35
|
+
isRead: boolean;
|
|
36
|
+
priority: AdminNotificationTypePriority;
|
|
37
|
+
type?: string;
|
|
38
|
+
}
|
|
39
|
+
export declare class AdminNotificationFetcher {
|
|
40
|
+
static fetchNotifications(): Promise<{
|
|
41
|
+
id: import("mongoose").Types.ObjectId;
|
|
42
|
+
text: string;
|
|
43
|
+
createdAt: Date;
|
|
44
|
+
clickable: boolean;
|
|
45
|
+
redirectUrl: String | undefined;
|
|
46
|
+
redirectUrlType: AdminNotificationNavigationType | undefined;
|
|
47
|
+
isRead: boolean | undefined;
|
|
48
|
+
priority: AdminNotificationTypePriority | undefined;
|
|
49
|
+
type: string | undefined;
|
|
50
|
+
}[]>;
|
|
51
|
+
}
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.AdminNotificationFetcher = void 0;
|
|
16
|
-
const AdminNotification_1 = __importDefault(require("../../models/adminNotification/AdminNotification"));
|
|
17
|
-
const IAdminNotification_1 = require("../../models/adminNotification/IAdminNotification");
|
|
18
|
-
class AdminNotificationFetcher {
|
|
19
|
-
static fetchNotifications() {
|
|
20
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
-
const notifications = yield AdminNotification_1.default.find({ isRead: false }).sort({ createdAt: -1 });
|
|
22
|
-
const mappedNotifications = notifications.map((notification) => {
|
|
23
|
-
return {
|
|
24
|
-
id: notification._id,
|
|
25
|
-
text: notification.title,
|
|
26
|
-
createdAt: notification.createdAt,
|
|
27
|
-
clickable: notification.redirectUrlType === IAdminNotification_1.AdminNotificationNavigationType.NONE ? false : true,
|
|
28
|
-
redirectUrl: notification.redirectUrl,
|
|
29
|
-
redirectUrlType: notification.redirectUrlType,
|
|
30
|
-
isRead: notification.isRead,
|
|
31
|
-
priority: notification.priority,
|
|
32
|
-
type: notification.type,
|
|
33
|
-
};
|
|
34
|
-
});
|
|
35
|
-
return mappedNotifications;
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
exports.AdminNotificationFetcher = AdminNotificationFetcher;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.AdminNotificationFetcher = void 0;
|
|
16
|
+
const AdminNotification_1 = __importDefault(require("../../models/adminNotification/AdminNotification"));
|
|
17
|
+
const IAdminNotification_1 = require("../../models/adminNotification/IAdminNotification");
|
|
18
|
+
class AdminNotificationFetcher {
|
|
19
|
+
static fetchNotifications() {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
const notifications = yield AdminNotification_1.default.find({ isRead: false }).sort({ createdAt: -1 });
|
|
22
|
+
const mappedNotifications = notifications.map((notification) => {
|
|
23
|
+
return {
|
|
24
|
+
id: notification._id,
|
|
25
|
+
text: notification.title,
|
|
26
|
+
createdAt: notification.createdAt,
|
|
27
|
+
clickable: notification.redirectUrlType === IAdminNotification_1.AdminNotificationNavigationType.NONE ? false : true,
|
|
28
|
+
redirectUrl: notification.redirectUrl,
|
|
29
|
+
redirectUrlType: notification.redirectUrlType,
|
|
30
|
+
isRead: notification.isRead,
|
|
31
|
+
priority: notification.priority,
|
|
32
|
+
type: notification.type,
|
|
33
|
+
};
|
|
34
|
+
});
|
|
35
|
+
return mappedNotifications;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.AdminNotificationFetcher = AdminNotificationFetcher;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { IResourceFile } from "../types/IResourceFile";
|
|
2
|
-
export default class FilterHelper {
|
|
3
|
-
static appendFilters(filterQuery: {
|
|
4
|
-
[key: string]: any;
|
|
5
|
-
}, filters: string[] | undefined, resource?: IResourceFile): Promise<{
|
|
6
|
-
[key: string]: any;
|
|
7
|
-
}>;
|
|
8
|
-
private static getVirtualFilter;
|
|
9
|
-
}
|
|
1
|
+
import { IResourceFile } from "../types/IResourceFile";
|
|
2
|
+
export default class FilterHelper {
|
|
3
|
+
static appendFilters(filterQuery: {
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
}, filters: string[] | undefined, resource?: IResourceFile): Promise<{
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
}>;
|
|
8
|
+
private static getVirtualFilter;
|
|
9
|
+
}
|
|
@@ -1,113 +1,113 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const mongoose_1 = __importDefault(require("mongoose"));
|
|
16
|
-
const helpers_1 = require("../types/helpers");
|
|
17
|
-
const LocalizedStringHelper_1 = __importDefault(require("./LocalizedStringHelper"));
|
|
18
|
-
var pluralize = require('pluralize');
|
|
19
|
-
class FilterHelper {
|
|
20
|
-
static appendFilters(filterQuery, filters, resource) {
|
|
21
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
-
if (!filters) {
|
|
23
|
-
return filterQuery;
|
|
24
|
-
}
|
|
25
|
-
for (var i = 0; i < filters.length; i++) {
|
|
26
|
-
const filter = filters[i];
|
|
27
|
-
if (!filter || filter === '' || !filter.includes(';;')) {
|
|
28
|
-
continue;
|
|
29
|
-
}
|
|
30
|
-
const filterQueryString = filter.split(';;');
|
|
31
|
-
const fieldType = filterQueryString[1];
|
|
32
|
-
if (fieldType === helpers_1.FieldTypes.NUMBER || fieldType === helpers_1.FieldTypes.DATE) {
|
|
33
|
-
const rangeObject = filterQueryString[0].split(':');
|
|
34
|
-
const fieldName = rangeObject[0];
|
|
35
|
-
const fromToObject = rangeObject[1].split(',');
|
|
36
|
-
const from = fromToObject[0].split('=')[1];
|
|
37
|
-
const to = fromToObject[1].split('=')[1];
|
|
38
|
-
var filterRange = {};
|
|
39
|
-
if (from && from !== '' && from !== 'null') {
|
|
40
|
-
filterRange.$gte = from;
|
|
41
|
-
}
|
|
42
|
-
if (to && to !== '' && to !== 'null') {
|
|
43
|
-
filterRange.$lte = to;
|
|
44
|
-
}
|
|
45
|
-
if (filterRange.$lte || filterRange.$gte) {
|
|
46
|
-
filterQuery[fieldName] = filterRange;
|
|
47
|
-
}
|
|
48
|
-
continue;
|
|
49
|
-
}
|
|
50
|
-
if (!filterQueryString[0] || !fieldType || !filterQueryString[0].includes('=')) {
|
|
51
|
-
continue;
|
|
52
|
-
}
|
|
53
|
-
const splittedQueryString = filterQueryString[0].split('=');
|
|
54
|
-
const key = splittedQueryString[0];
|
|
55
|
-
const value = splittedQueryString[1].includes('%20') ? splittedQueryString[1].replace(/%20/g, ' ') : splittedQueryString[1];
|
|
56
|
-
switch (fieldType) {
|
|
57
|
-
case helpers_1.FieldTypes.OBJECTID:
|
|
58
|
-
if (!mongoose_1.default.isValidObjectId(value)) {
|
|
59
|
-
break;
|
|
60
|
-
}
|
|
61
|
-
filterQuery[key] = value;
|
|
62
|
-
break;
|
|
63
|
-
case helpers_1.FieldTypes.STRING:
|
|
64
|
-
filterQuery[key] = new RegExp(value, 'i');
|
|
65
|
-
break;
|
|
66
|
-
case helpers_1.FieldTypes.LOCALIZEDSTRING:
|
|
67
|
-
filterQuery.$or = [
|
|
68
|
-
LocalizedStringHelper_1.default.getFilterObject(key, "0", new RegExp(value, 'i')),
|
|
69
|
-
LocalizedStringHelper_1.default.getFilterObject(key, "1", new RegExp(value, 'i')),
|
|
70
|
-
];
|
|
71
|
-
break;
|
|
72
|
-
case helpers_1.FieldTypes.REFERENCE:
|
|
73
|
-
if (value !== 'null' && value !== 'undefined') {
|
|
74
|
-
filterQuery = yield this.getVirtualFilter(filterQuery, key, value, resource);
|
|
75
|
-
}
|
|
76
|
-
break;
|
|
77
|
-
default:
|
|
78
|
-
if (value !== 'null' && value !== 'undefined') {
|
|
79
|
-
filterQuery[key] = value;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
return filterQuery;
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
static getVirtualFilter(filterQuery, key, value, resource) {
|
|
87
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
88
|
-
if (resource && resource.properties.model) {
|
|
89
|
-
const virtuals = resource.properties.model.virtuals;
|
|
90
|
-
if (virtuals && virtuals[key] && virtuals[key].showIn === helpers_1.Virtuals.FILTER && virtuals[key].handler) {
|
|
91
|
-
const virtual = virtuals[key];
|
|
92
|
-
filterQuery = yield virtual.handler(filterQuery, value);
|
|
93
|
-
}
|
|
94
|
-
else {
|
|
95
|
-
const fieldProps = resource.properties.model[key];
|
|
96
|
-
if (fieldProps && fieldProps.multipleInFilter) {
|
|
97
|
-
filterQuery[key] = {
|
|
98
|
-
$in: value.split(',')
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
else {
|
|
102
|
-
filterQuery[key] = value;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
107
|
-
filterQuery[key] = value;
|
|
108
|
-
}
|
|
109
|
-
return filterQuery;
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
exports.default = FilterHelper;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const mongoose_1 = __importDefault(require("mongoose"));
|
|
16
|
+
const helpers_1 = require("../types/helpers");
|
|
17
|
+
const LocalizedStringHelper_1 = __importDefault(require("./LocalizedStringHelper"));
|
|
18
|
+
var pluralize = require('pluralize');
|
|
19
|
+
class FilterHelper {
|
|
20
|
+
static appendFilters(filterQuery, filters, resource) {
|
|
21
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
if (!filters) {
|
|
23
|
+
return filterQuery;
|
|
24
|
+
}
|
|
25
|
+
for (var i = 0; i < filters.length; i++) {
|
|
26
|
+
const filter = filters[i];
|
|
27
|
+
if (!filter || filter === '' || !filter.includes(';;')) {
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
const filterQueryString = filter.split(';;');
|
|
31
|
+
const fieldType = filterQueryString[1];
|
|
32
|
+
if (fieldType === helpers_1.FieldTypes.NUMBER || fieldType === helpers_1.FieldTypes.DATE) {
|
|
33
|
+
const rangeObject = filterQueryString[0].split(':');
|
|
34
|
+
const fieldName = rangeObject[0];
|
|
35
|
+
const fromToObject = rangeObject[1].split(',');
|
|
36
|
+
const from = fromToObject[0].split('=')[1];
|
|
37
|
+
const to = fromToObject[1].split('=')[1];
|
|
38
|
+
var filterRange = {};
|
|
39
|
+
if (from && from !== '' && from !== 'null') {
|
|
40
|
+
filterRange.$gte = from;
|
|
41
|
+
}
|
|
42
|
+
if (to && to !== '' && to !== 'null') {
|
|
43
|
+
filterRange.$lte = to;
|
|
44
|
+
}
|
|
45
|
+
if (filterRange.$lte || filterRange.$gte) {
|
|
46
|
+
filterQuery[fieldName] = filterRange;
|
|
47
|
+
}
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
if (!filterQueryString[0] || !fieldType || !filterQueryString[0].includes('=')) {
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
const splittedQueryString = filterQueryString[0].split('=');
|
|
54
|
+
const key = splittedQueryString[0];
|
|
55
|
+
const value = splittedQueryString[1].includes('%20') ? splittedQueryString[1].replace(/%20/g, ' ') : splittedQueryString[1];
|
|
56
|
+
switch (fieldType) {
|
|
57
|
+
case helpers_1.FieldTypes.OBJECTID:
|
|
58
|
+
if (!mongoose_1.default.isValidObjectId(value)) {
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
filterQuery[key] = value;
|
|
62
|
+
break;
|
|
63
|
+
case helpers_1.FieldTypes.STRING:
|
|
64
|
+
filterQuery[key] = new RegExp(value, 'i');
|
|
65
|
+
break;
|
|
66
|
+
case helpers_1.FieldTypes.LOCALIZEDSTRING:
|
|
67
|
+
filterQuery.$or = [
|
|
68
|
+
LocalizedStringHelper_1.default.getFilterObject(key, "0", new RegExp(value, 'i')),
|
|
69
|
+
LocalizedStringHelper_1.default.getFilterObject(key, "1", new RegExp(value, 'i')),
|
|
70
|
+
];
|
|
71
|
+
break;
|
|
72
|
+
case helpers_1.FieldTypes.REFERENCE:
|
|
73
|
+
if (value !== 'null' && value !== 'undefined') {
|
|
74
|
+
filterQuery = yield this.getVirtualFilter(filterQuery, key, value, resource);
|
|
75
|
+
}
|
|
76
|
+
break;
|
|
77
|
+
default:
|
|
78
|
+
if (value !== 'null' && value !== 'undefined') {
|
|
79
|
+
filterQuery[key] = value;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return filterQuery;
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
static getVirtualFilter(filterQuery, key, value, resource) {
|
|
87
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
88
|
+
if (resource && resource.properties.model) {
|
|
89
|
+
const virtuals = resource.properties.model.virtuals;
|
|
90
|
+
if (virtuals && virtuals[key] && virtuals[key].showIn === helpers_1.Virtuals.FILTER && virtuals[key].handler) {
|
|
91
|
+
const virtual = virtuals[key];
|
|
92
|
+
filterQuery = yield virtual.handler(filterQuery, value);
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
const fieldProps = resource.properties.model[key];
|
|
96
|
+
if (fieldProps && fieldProps.multipleInFilter) {
|
|
97
|
+
filterQuery[key] = {
|
|
98
|
+
$in: value.split(',')
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
filterQuery[key] = value;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
filterQuery[key] = value;
|
|
108
|
+
}
|
|
109
|
+
return filterQuery;
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
exports.default = FilterHelper;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IResourceFile } from "../types/IResourceFile";
|
|
2
|
-
export default class LocalesHelper {
|
|
3
|
-
static localizeResource(resource: IResourceFile): any;
|
|
4
|
-
}
|
|
1
|
+
import { IResourceFile } from "../types/IResourceFile";
|
|
2
|
+
export default class LocalesHelper {
|
|
3
|
+
static localizeResource(resource: IResourceFile): any;
|
|
4
|
+
}
|
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
// import { AdminParent, SetupParent } from "@pbb/materialUi/parents";
|
|
7
|
-
const StringUtils_1 = __importDefault(require("../utils/StringUtils"));
|
|
8
|
-
const ResourceHelper_1 = __importDefault(require("./ResourceHelper"));
|
|
9
|
-
var pluralize = require('pluralize');
|
|
10
|
-
class LocalesHelper {
|
|
11
|
-
static localizeResource(resource) {
|
|
12
|
-
var _a, _b, _c, _d, _e;
|
|
13
|
-
const modelName = resource.resource.modelName;
|
|
14
|
-
const modifiedResource = JSON.parse(JSON.stringify(resource));
|
|
15
|
-
const title = ResourceHelper_1.default.getSchemaTitle(modelName, resource);
|
|
16
|
-
const schema = resource.resource.schema.paths;
|
|
17
|
-
const recordFields = ResourceHelper_1.default.manageFields(schema, title, resource.properties.hiddenProperties);
|
|
18
|
-
const modelCheck = resource.properties.model ? JSON.parse(JSON.stringify(resource.properties.model)) : undefined;
|
|
19
|
-
const actionsCheck = resource.properties.actions;
|
|
20
|
-
const modelAndPopulatedString = ResourceHelper_1.default.setModelSchema(schema, modelCheck, modelName);
|
|
21
|
-
modifiedResource.properties.model = modelAndPopulatedString[0];
|
|
22
|
-
modifiedResource.properties.populatedString = modelAndPopulatedString[1];
|
|
23
|
-
const modifiedProperties = ResourceHelper_1.default.addVirtualFields(JSON.parse(JSON.stringify(recordFields)), modelCheck);
|
|
24
|
-
modifiedResource.properties.path = ResourceHelper_1.default.getModelPath(modelName);
|
|
25
|
-
const modifiedListProperties = modifiedProperties[0];
|
|
26
|
-
const modifiedShowProperties = modifiedProperties[1];
|
|
27
|
-
const modifiedFormProperties = modifiedProperties[2];
|
|
28
|
-
if (!resource.properties.parent) {
|
|
29
|
-
//modifiedResource.properties.parent = SetupParent
|
|
30
|
-
}
|
|
31
|
-
if (!resource.properties.name) {
|
|
32
|
-
modifiedResource.properties.name = StringUtils_1.default.convertCamelCaseToWord(modelName);
|
|
33
|
-
}
|
|
34
|
-
if (!resource.showProperties) {
|
|
35
|
-
modifiedResource.showProperties = modifiedShowProperties;
|
|
36
|
-
}
|
|
37
|
-
if (!resource.listProperties) {
|
|
38
|
-
modifiedResource.listProperties = ResourceHelper_1.default.exchangeFirstFieldWithTitle(JSON.parse(JSON.stringify(modifiedListProperties)), title);
|
|
39
|
-
}
|
|
40
|
-
if (!resource.formProperties) {
|
|
41
|
-
modifiedResource.formProperties = ResourceHelper_1.default.removeUnWantedFieldsFromCreateOrUpdate(JSON.parse(JSON.stringify(modifiedFormProperties)));
|
|
42
|
-
}
|
|
43
|
-
modifiedResource.properties.title = title;
|
|
44
|
-
if (!resource.properties.defaultOrderBy) {
|
|
45
|
-
modifiedResource.properties.defaultOrderBy = title;
|
|
46
|
-
}
|
|
47
|
-
if (!resource.properties.defaultOrder) {
|
|
48
|
-
modifiedResource.properties.defaultOrder = 'asc';
|
|
49
|
-
}
|
|
50
|
-
if (!resource.properties.defaultrowsPerPage) {
|
|
51
|
-
modifiedResource.properties.defaultrowsPerPage = 10;
|
|
52
|
-
}
|
|
53
|
-
modifiedResource.listProperties = ResourceHelper_1.default.prepareProperties(resource.listProperties ? resource.listProperties : modifiedResource.listProperties, modelName, modifiedResource.properties.model);
|
|
54
|
-
modifiedResource.showProperties = ResourceHelper_1.default.prepareProperties(resource.showProperties ? resource.showProperties : modifiedResource.showProperties, modelName, modifiedResource.properties.model);
|
|
55
|
-
modifiedResource.properties.filters = ResourceHelper_1.default.getFilters(resource.properties.filters ? JSON.parse(JSON.stringify(resource.properties.filters)) : undefined);
|
|
56
|
-
if (modifiedResource.properties.filters.scopes.isAccessible) {
|
|
57
|
-
const options = (_c = (_b = (_a = resource === null || resource === void 0 ? void 0 : resource.properties) === null || _a === void 0 ? void 0 : _a.filters) === null || _b === void 0 ? void 0 : _b.scopes) === null || _c === void 0 ? void 0 : _c.options;
|
|
58
|
-
modifiedResource.properties.filters.scopes.options = ResourceHelper_1.default.setScopeFilterOptions(modelName, options);
|
|
59
|
-
}
|
|
60
|
-
const actions = ResourceHelper_1.default.getActions(actionsCheck ? JSON.parse(JSON.stringify(resource.properties.actions)) : undefined); //resource.properties.actions? ResourcesHelper.getActions(JSON.parse(JSON.stringify(resource.properties.actions))): ResourcesHelper.getActions(undefined)
|
|
61
|
-
for (const key in actions) {
|
|
62
|
-
if (key === 'extras') {
|
|
63
|
-
actions.extras = actions.extras ? ResourceHelper_1.default.addExtraActions(JSON.parse(JSON.stringify((_e = (_d = resource === null || resource === void 0 ? void 0 : resource.properties) === null || _d === void 0 ? void 0 : _d.actions) === null || _e === void 0 ? void 0 : _e.extras))) : actions.extras;
|
|
64
|
-
continue;
|
|
65
|
-
}
|
|
66
|
-
const translation = ResourceHelper_1.default.checkActionTranslation(modelName, key);
|
|
67
|
-
actions[key] = ResourceHelper_1.default.appendActionValues(key, actions[key], translation);
|
|
68
|
-
}
|
|
69
|
-
modifiedResource.properties.actions = actions;
|
|
70
|
-
return modifiedResource;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
exports.default = LocalesHelper;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
// import { AdminParent, SetupParent } from "@pbb/materialUi/parents";
|
|
7
|
+
const StringUtils_1 = __importDefault(require("../utils/StringUtils"));
|
|
8
|
+
const ResourceHelper_1 = __importDefault(require("./ResourceHelper"));
|
|
9
|
+
var pluralize = require('pluralize');
|
|
10
|
+
class LocalesHelper {
|
|
11
|
+
static localizeResource(resource) {
|
|
12
|
+
var _a, _b, _c, _d, _e;
|
|
13
|
+
const modelName = resource.resource.modelName;
|
|
14
|
+
const modifiedResource = JSON.parse(JSON.stringify(resource));
|
|
15
|
+
const title = ResourceHelper_1.default.getSchemaTitle(modelName, resource);
|
|
16
|
+
const schema = resource.resource.schema.paths;
|
|
17
|
+
const recordFields = ResourceHelper_1.default.manageFields(schema, title, resource.properties.hiddenProperties);
|
|
18
|
+
const modelCheck = resource.properties.model ? JSON.parse(JSON.stringify(resource.properties.model)) : undefined;
|
|
19
|
+
const actionsCheck = resource.properties.actions;
|
|
20
|
+
const modelAndPopulatedString = ResourceHelper_1.default.setModelSchema(schema, modelCheck, modelName);
|
|
21
|
+
modifiedResource.properties.model = modelAndPopulatedString[0];
|
|
22
|
+
modifiedResource.properties.populatedString = modelAndPopulatedString[1];
|
|
23
|
+
const modifiedProperties = ResourceHelper_1.default.addVirtualFields(JSON.parse(JSON.stringify(recordFields)), modelCheck);
|
|
24
|
+
modifiedResource.properties.path = ResourceHelper_1.default.getModelPath(modelName);
|
|
25
|
+
const modifiedListProperties = modifiedProperties[0];
|
|
26
|
+
const modifiedShowProperties = modifiedProperties[1];
|
|
27
|
+
const modifiedFormProperties = modifiedProperties[2];
|
|
28
|
+
if (!resource.properties.parent) {
|
|
29
|
+
//modifiedResource.properties.parent = SetupParent
|
|
30
|
+
}
|
|
31
|
+
if (!resource.properties.name) {
|
|
32
|
+
modifiedResource.properties.name = StringUtils_1.default.convertCamelCaseToWord(modelName);
|
|
33
|
+
}
|
|
34
|
+
if (!resource.showProperties) {
|
|
35
|
+
modifiedResource.showProperties = modifiedShowProperties;
|
|
36
|
+
}
|
|
37
|
+
if (!resource.listProperties) {
|
|
38
|
+
modifiedResource.listProperties = ResourceHelper_1.default.exchangeFirstFieldWithTitle(JSON.parse(JSON.stringify(modifiedListProperties)), title);
|
|
39
|
+
}
|
|
40
|
+
if (!resource.formProperties) {
|
|
41
|
+
modifiedResource.formProperties = ResourceHelper_1.default.removeUnWantedFieldsFromCreateOrUpdate(JSON.parse(JSON.stringify(modifiedFormProperties)));
|
|
42
|
+
}
|
|
43
|
+
modifiedResource.properties.title = title;
|
|
44
|
+
if (!resource.properties.defaultOrderBy) {
|
|
45
|
+
modifiedResource.properties.defaultOrderBy = title;
|
|
46
|
+
}
|
|
47
|
+
if (!resource.properties.defaultOrder) {
|
|
48
|
+
modifiedResource.properties.defaultOrder = 'asc';
|
|
49
|
+
}
|
|
50
|
+
if (!resource.properties.defaultrowsPerPage) {
|
|
51
|
+
modifiedResource.properties.defaultrowsPerPage = 10;
|
|
52
|
+
}
|
|
53
|
+
modifiedResource.listProperties = ResourceHelper_1.default.prepareProperties(resource.listProperties ? resource.listProperties : modifiedResource.listProperties, modelName, modifiedResource.properties.model);
|
|
54
|
+
modifiedResource.showProperties = ResourceHelper_1.default.prepareProperties(resource.showProperties ? resource.showProperties : modifiedResource.showProperties, modelName, modifiedResource.properties.model);
|
|
55
|
+
modifiedResource.properties.filters = ResourceHelper_1.default.getFilters(resource.properties.filters ? JSON.parse(JSON.stringify(resource.properties.filters)) : undefined);
|
|
56
|
+
if (modifiedResource.properties.filters.scopes.isAccessible) {
|
|
57
|
+
const options = (_c = (_b = (_a = resource === null || resource === void 0 ? void 0 : resource.properties) === null || _a === void 0 ? void 0 : _a.filters) === null || _b === void 0 ? void 0 : _b.scopes) === null || _c === void 0 ? void 0 : _c.options;
|
|
58
|
+
modifiedResource.properties.filters.scopes.options = ResourceHelper_1.default.setScopeFilterOptions(modelName, options);
|
|
59
|
+
}
|
|
60
|
+
const actions = ResourceHelper_1.default.getActions(actionsCheck ? JSON.parse(JSON.stringify(resource.properties.actions)) : undefined); //resource.properties.actions? ResourcesHelper.getActions(JSON.parse(JSON.stringify(resource.properties.actions))): ResourcesHelper.getActions(undefined)
|
|
61
|
+
for (const key in actions) {
|
|
62
|
+
if (key === 'extras') {
|
|
63
|
+
actions.extras = actions.extras ? ResourceHelper_1.default.addExtraActions(JSON.parse(JSON.stringify((_e = (_d = resource === null || resource === void 0 ? void 0 : resource.properties) === null || _d === void 0 ? void 0 : _d.actions) === null || _e === void 0 ? void 0 : _e.extras))) : actions.extras;
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
const translation = ResourceHelper_1.default.checkActionTranslation(modelName, key);
|
|
67
|
+
actions[key] = ResourceHelper_1.default.appendActionValues(key, actions[key], translation);
|
|
68
|
+
}
|
|
69
|
+
modifiedResource.properties.actions = actions;
|
|
70
|
+
return modifiedResource;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
exports.default = LocalesHelper;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { IResourceFile } from "../types/IResourceFile";
|
|
2
|
-
export default class LocalizedStringHelper {
|
|
3
|
-
static mapLocalizableString(recordParams: any, resource: IResourceFile): any;
|
|
4
|
-
private static getArrayOfLanguages;
|
|
5
|
-
static checkLocalizedStringType(resource: IResourceFile, fieldName: string): boolean;
|
|
6
|
-
static getFilterObject(searchBy: string, index: string, value: any): {
|
|
7
|
-
[key: string]: any;
|
|
8
|
-
};
|
|
9
|
-
}
|
|
1
|
+
import { IResourceFile } from "../types/IResourceFile";
|
|
2
|
+
export default class LocalizedStringHelper {
|
|
3
|
+
static mapLocalizableString(recordParams: any, resource: IResourceFile): any;
|
|
4
|
+
private static getArrayOfLanguages;
|
|
5
|
+
static checkLocalizedStringType(resource: IResourceFile, fieldName: string): boolean;
|
|
6
|
+
static getFilterObject(searchBy: string, index: string, value: any): {
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
};
|
|
9
|
+
}
|