nuxeo-development-framework 3.3.7 → 3.3.8
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/bundles/nuxeo-development-framework.umd.js +735 -733
- package/bundles/nuxeo-development-framework.umd.js.map +1 -1
- package/esm2015/lib/Core/services/roles/roles.service.js +13 -17
- package/esm2015/lib/components/dynamic-form/components/dynamic-form-textitem/dynamic-form-textitem.component.js +2 -2
- package/esm2015/lib/components/dynamic-form/components/dynamic-form-treeview-select/dropdown-treeview-select.component.js +18 -11
- package/esm2015/lib/nuxeo-development-framework.module.js +2 -2
- package/fesm2015/nuxeo-development-framework.js +201 -199
- package/fesm2015/nuxeo-development-framework.js.map +1 -1
- package/lib/Core/services/roles/roles.service.d.ts +2 -8
- package/lib/components/dynamic-form/components/dynamic-form-treeview-select/dropdown-treeview-select.component.d.ts +3 -1
- package/package.json +1 -1
|
@@ -1015,558 +1015,270 @@
|
|
|
1015
1015
|
return NuxeoOverride;
|
|
1016
1016
|
}(Nuxeo$1));
|
|
1017
1017
|
|
|
1018
|
-
var
|
|
1019
|
-
function
|
|
1018
|
+
var RolesService$1 = /** @class */ (function () {
|
|
1019
|
+
function RolesService(environment
|
|
1020
|
+
// , private globalAdmin : GlobalAdminService , private nuxeoService : NuxeoService
|
|
1021
|
+
) {
|
|
1022
|
+
this.environment = environment;
|
|
1023
|
+
}
|
|
1024
|
+
RolesService.prototype.getRoleName = function (role, code) {
|
|
1025
|
+
if (code === void 0) { code = null; }
|
|
1026
|
+
if (this.environment.RolesConstants[role]) {
|
|
1027
|
+
return code
|
|
1028
|
+
? this.environment.RolesConstants[role].replace("{departmentTitle}", code)
|
|
1029
|
+
: "^" + this.environment.RolesConstants[role].replace("{departmentTitle}", ".*.") + "$";
|
|
1030
|
+
}
|
|
1031
|
+
else {
|
|
1032
|
+
console.warn("role: " + role + " does not exist in roles config");
|
|
1033
|
+
return role;
|
|
1034
|
+
}
|
|
1035
|
+
};
|
|
1036
|
+
RolesService.prototype.isUserInRole = function (user, role, code) {
|
|
1020
1037
|
var _this = this;
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
_k.trys.push([0, 5, 6, 7]);
|
|
1031
|
-
arr_1 = __values(arr), arr_1_1 = arr_1.next();
|
|
1032
|
-
_k.label = 1;
|
|
1033
|
-
case 1:
|
|
1034
|
-
if (!!arr_1_1.done) return [3 /*break*/, 4];
|
|
1035
|
-
e = arr_1_1.value;
|
|
1036
|
-
return [4 /*yield*/, predicate(e)];
|
|
1037
|
-
case 2:
|
|
1038
|
-
if (!(_k.sent())) {
|
|
1039
|
-
return [2 /*return*/, false];
|
|
1038
|
+
if (code === void 0) { code = null; }
|
|
1039
|
+
var hasRole = false;
|
|
1040
|
+
var groups = user ? user.extendedGroups || user.groups : [];
|
|
1041
|
+
if (groups && groups.length > 0) {
|
|
1042
|
+
if (Array.isArray(role)) {
|
|
1043
|
+
role.forEach(function (r) {
|
|
1044
|
+
if (groups.filter(function (item) {
|
|
1045
|
+
if (code) {
|
|
1046
|
+
return (item.name || item) === _this.getRoleName(r, code);
|
|
1040
1047
|
}
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
return [3 /*break*/, 1];
|
|
1045
|
-
case 4: return [3 /*break*/, 7];
|
|
1046
|
-
case 5:
|
|
1047
|
-
e_1_1 = _k.sent();
|
|
1048
|
-
e_1 = { error: e_1_1 };
|
|
1049
|
-
return [3 /*break*/, 7];
|
|
1050
|
-
case 6:
|
|
1051
|
-
try {
|
|
1052
|
-
if (arr_1_1 && !arr_1_1.done && (_j = arr_1.return)) _j.call(arr_1);
|
|
1048
|
+
else {
|
|
1049
|
+
var regex = new RegExp(_this.getRoleName(r));
|
|
1050
|
+
return regex.test(item.name || item);
|
|
1053
1051
|
}
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
case 0:
|
|
1066
|
-
_k.trys.push([0, 5, 6, 7]);
|
|
1067
|
-
arr_2 = __values(arr), arr_2_1 = arr_2.next();
|
|
1068
|
-
_k.label = 1;
|
|
1069
|
-
case 1:
|
|
1070
|
-
if (!!arr_2_1.done) return [3 /*break*/, 4];
|
|
1071
|
-
e = arr_2_1.value;
|
|
1072
|
-
return [4 /*yield*/, predicate(e)];
|
|
1073
|
-
case 2:
|
|
1074
|
-
if (_k.sent()) {
|
|
1075
|
-
return [2 /*return*/, true];
|
|
1052
|
+
}).length > 0) {
|
|
1053
|
+
hasRole = true;
|
|
1054
|
+
return;
|
|
1055
|
+
}
|
|
1056
|
+
});
|
|
1057
|
+
}
|
|
1058
|
+
else {
|
|
1059
|
+
hasRole =
|
|
1060
|
+
groups.filter(function (item) {
|
|
1061
|
+
if (code) {
|
|
1062
|
+
return (item.name || item) === _this.getRoleName(role, code);
|
|
1076
1063
|
}
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
return [3 /*break*/, 1];
|
|
1081
|
-
case 4: return [3 /*break*/, 7];
|
|
1082
|
-
case 5:
|
|
1083
|
-
e_2_1 = _k.sent();
|
|
1084
|
-
e_2 = { error: e_2_1 };
|
|
1085
|
-
return [3 /*break*/, 7];
|
|
1086
|
-
case 6:
|
|
1087
|
-
try {
|
|
1088
|
-
if (arr_2_1 && !arr_2_1.done && (_j = arr_2.return)) _j.call(arr_2);
|
|
1064
|
+
else {
|
|
1065
|
+
var regex = new RegExp(_this.getRoleName(role));
|
|
1066
|
+
return regex.test(item.name || item);
|
|
1089
1067
|
}
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1068
|
+
}).length > 0;
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
return hasRole;
|
|
1072
|
+
};
|
|
1073
|
+
RolesService.prototype.getUserRoleName = function (user, code) {
|
|
1074
|
+
var _this = this;
|
|
1075
|
+
var found = null;
|
|
1076
|
+
var groups = user ? user.extendedGroups || user.groups : [];
|
|
1077
|
+
if (groups && groups.length) {
|
|
1078
|
+
Object.keys(this.environment.RolesConstants).forEach(function (key) {
|
|
1079
|
+
var roleWCode = _this.environment.RolesConstants[key].replace("{departmentTitle}", code);
|
|
1080
|
+
if ((code && roleWCode.includes('dms_user_')) || !code)
|
|
1081
|
+
groups.forEach(function (group) {
|
|
1082
|
+
if (group.name || group === roleWCode) {
|
|
1083
|
+
found = key;
|
|
1084
|
+
}
|
|
1085
|
+
});
|
|
1086
|
+
});
|
|
1087
|
+
}
|
|
1088
|
+
return found;
|
|
1089
|
+
};
|
|
1090
|
+
RolesService.prototype.isUserManagerInDepartment = function (user, code) {
|
|
1091
|
+
var filteredRoles = Object.values(this.environment.RolesConstants).filter(function (role) { return role.includes("{departmentTitle}"); });
|
|
1092
|
+
var departmentRoles = [];
|
|
1093
|
+
var isUserInDepartment = false;
|
|
1094
|
+
var groups = user ? user.extendedGroups || user.groups : [];
|
|
1095
|
+
if (groups && groups.length) {
|
|
1096
|
+
filteredRoles.forEach(function (key) {
|
|
1097
|
+
var roleWCode = key.replace("{departmentTitle}", code);
|
|
1098
|
+
departmentRoles.push(roleWCode);
|
|
1099
|
+
});
|
|
1100
|
+
}
|
|
1101
|
+
departmentRoles = departmentRoles.filter(function (role) {
|
|
1102
|
+
return role.includes("Manager");
|
|
1103
|
+
});
|
|
1104
|
+
groups.forEach(function (group) {
|
|
1105
|
+
var groupName = group.name || group;
|
|
1106
|
+
var departmentIsIncluded = departmentRoles.includes(groupName);
|
|
1107
|
+
if (departmentIsIncluded) {
|
|
1108
|
+
isUserInDepartment = true;
|
|
1109
|
+
}
|
|
1110
|
+
});
|
|
1111
|
+
return isUserInDepartment;
|
|
1112
|
+
};
|
|
1113
|
+
RolesService.prototype.getUserDepartment = function (currentUser, prefix, option) {
|
|
1114
|
+
if (prefix === void 0) { prefix = "cts_role_"; }
|
|
1115
|
+
var groupToExclude = "cts_role_sys";
|
|
1116
|
+
if (option && option.isGlobalAdmin) {
|
|
1117
|
+
prefix = "tenant_" + option.activeTenant + "_cts_role_";
|
|
1118
|
+
groupToExclude = "tenant_" + option.activeTenant + "_cts_role_sys";
|
|
1119
|
+
}
|
|
1120
|
+
else if (option && !option.isGlobalAdmin && option.tenantId) {
|
|
1121
|
+
prefix = "tenant_" + option.tenantId + "_cts_role_";
|
|
1122
|
+
groupToExclude = "tenant_" + option.tenantId + "_cts_role_sys";
|
|
1123
|
+
}
|
|
1124
|
+
var allGroups = currentUser.properties.groups;
|
|
1125
|
+
var departmentCode = "";
|
|
1126
|
+
allGroups.some(function (group) {
|
|
1127
|
+
if (!group.includes(groupToExclude) && group.includes(prefix)) {
|
|
1128
|
+
departmentCode = group;
|
|
1129
|
+
return true;
|
|
1130
|
+
}
|
|
1131
|
+
});
|
|
1132
|
+
var prefixLength = prefix.length;
|
|
1133
|
+
departmentCode = departmentCode.substring(prefixLength);
|
|
1134
|
+
var lastIndex = departmentCode.lastIndexOf("_");
|
|
1135
|
+
departmentCode = departmentCode.substring(0, lastIndex);
|
|
1136
|
+
return departmentCode;
|
|
1137
|
+
};
|
|
1138
|
+
return RolesService;
|
|
1139
|
+
}());
|
|
1140
|
+
RolesService$1.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: RolesService$1, deps: [{ token: "environment" }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1141
|
+
RolesService$1.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: RolesService$1, providedIn: "root" });
|
|
1142
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: RolesService$1, decorators: [{
|
|
1143
|
+
type: i0.Injectable,
|
|
1144
|
+
args: [{
|
|
1145
|
+
providedIn: "root",
|
|
1146
|
+
}]
|
|
1147
|
+
}], ctorParameters: function () {
|
|
1148
|
+
return [{ type: undefined, decorators: [{
|
|
1149
|
+
type: i0.Inject,
|
|
1150
|
+
args: ["environment"]
|
|
1151
|
+
}] }];
|
|
1152
|
+
} });
|
|
1153
|
+
|
|
1154
|
+
var NuxeoService$1 = /** @class */ (function () {
|
|
1155
|
+
function NuxeoService(http, keycloak, baseHref, environment, rolesService) {
|
|
1156
|
+
this.http = http;
|
|
1157
|
+
this.keycloak = keycloak;
|
|
1158
|
+
this.baseHref = baseHref;
|
|
1159
|
+
this.environment = environment;
|
|
1160
|
+
this.rolesService = rolesService;
|
|
1161
|
+
this.excludedUrls = [];
|
|
1162
|
+
this.enableBearerInterceptor = true;
|
|
1163
|
+
this.authenticated = false;
|
|
1164
|
+
this.ctsUser = false;
|
|
1165
|
+
this.ctsManger = false;
|
|
1166
|
+
}
|
|
1167
|
+
NuxeoService.prototype.init = function () {
|
|
1168
|
+
var _this = this;
|
|
1169
|
+
return new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
|
|
1170
|
+
var _this = this;
|
|
1171
|
+
return __generator(this, function (_a) {
|
|
1172
|
+
try {
|
|
1173
|
+
this.keycloak.getToken().then(function (token) {
|
|
1174
|
+
_this.createTokenClient(token);
|
|
1175
|
+
_this.nuxeoClient.connect()
|
|
1176
|
+
.then(function (client) {
|
|
1177
|
+
_this.authenticated = true;
|
|
1178
|
+
resolve(client);
|
|
1179
|
+
_this.checkForRoles();
|
|
1180
|
+
})
|
|
1181
|
+
.catch(function (error) {
|
|
1182
|
+
reject(error);
|
|
1183
|
+
});
|
|
1184
|
+
});
|
|
1185
|
+
}
|
|
1186
|
+
catch (error) {
|
|
1187
|
+
reject(error);
|
|
1093
1188
|
}
|
|
1189
|
+
return [2 /*return*/];
|
|
1094
1190
|
});
|
|
1095
|
-
}); };
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
if (!args || args.length === 0) {
|
|
1104
|
-
return [2 /*return*/, false];
|
|
1105
|
-
}
|
|
1106
|
-
return [4 /*yield*/, this.asyncEvery(args, function (arg) { return __awaiter(_this, void 0, void 0, function () {
|
|
1107
|
-
var evaluator;
|
|
1108
|
-
return __generator(this, function (_j) {
|
|
1109
|
-
switch (_j.label) {
|
|
1110
|
-
case 0: return [4 /*yield*/, context.getEvaluator(arg.value)];
|
|
1111
|
-
case 1:
|
|
1112
|
-
evaluator = _j.sent();
|
|
1113
|
-
if (!evaluator) {
|
|
1114
|
-
console.warn("evaluator not found: " + arg.value);
|
|
1115
|
-
return [2 /*return*/, false];
|
|
1116
|
-
}
|
|
1117
|
-
return [4 /*yield*/, evaluator(context, arg.parameters || [])];
|
|
1118
|
-
case 2: return [2 /*return*/, _j.sent()];
|
|
1119
|
-
}
|
|
1120
|
-
});
|
|
1121
|
-
}); })];
|
|
1122
|
-
case 1: return [2 /*return*/, _j.sent()];
|
|
1123
|
-
}
|
|
1124
|
-
});
|
|
1125
|
-
}); },
|
|
1126
|
-
OR: function (context, args) { return __awaiter(_this, void 0, void 0, function () {
|
|
1127
|
-
var _this = this;
|
|
1128
|
-
return __generator(this, function (_j) {
|
|
1129
|
-
switch (_j.label) {
|
|
1130
|
-
case 0:
|
|
1131
|
-
if (!args || args.length === 0) {
|
|
1132
|
-
return [2 /*return*/, false];
|
|
1133
|
-
}
|
|
1134
|
-
return [4 /*yield*/, this.asyncSome(args, function (arg) { return __awaiter(_this, void 0, void 0, function () {
|
|
1135
|
-
var evaluator, res;
|
|
1136
|
-
return __generator(this, function (_j) {
|
|
1137
|
-
switch (_j.label) {
|
|
1138
|
-
case 0: return [4 /*yield*/, context.getEvaluator(arg.value)];
|
|
1139
|
-
case 1:
|
|
1140
|
-
evaluator = _j.sent();
|
|
1141
|
-
if (!evaluator) {
|
|
1142
|
-
console.warn("evaluator not found: " + arg.value);
|
|
1143
|
-
return [2 /*return*/, false];
|
|
1144
|
-
}
|
|
1145
|
-
return [4 /*yield*/, evaluator(context, arg.parameters || [])];
|
|
1146
|
-
case 2:
|
|
1147
|
-
res = _j.sent();
|
|
1148
|
-
return [2 /*return*/, res];
|
|
1149
|
-
}
|
|
1150
|
-
});
|
|
1151
|
-
}); })];
|
|
1152
|
-
case 1: return [2 /*return*/, _j.sent()];
|
|
1153
|
-
}
|
|
1154
|
-
});
|
|
1155
|
-
}); },
|
|
1156
|
-
isStatus: function (context, args) { return __awaiter(_this, void 0, void 0, function () {
|
|
1157
|
-
return __generator(this, function (_j) {
|
|
1158
|
-
if (args.indexOf(context.entity.state) > -1) {
|
|
1159
|
-
return [2 /*return*/, true];
|
|
1160
|
-
}
|
|
1161
|
-
else {
|
|
1162
|
-
return [2 /*return*/, false];
|
|
1163
|
-
}
|
|
1164
|
-
return [2 /*return*/];
|
|
1165
|
-
});
|
|
1166
|
-
}); },
|
|
1167
|
-
isCreator: function (context, args) { return __awaiter(_this, void 0, void 0, function () {
|
|
1168
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, owner;
|
|
1169
|
-
return __generator(this, function (_j) {
|
|
1170
|
-
if ((_b = (_a = context.entity.properties.owner) === null || _a === void 0 ? void 0 : _a.properties) === null || _b === void 0 ? void 0 : _b.username) {
|
|
1171
|
-
owner = (_d = (_c = context.entity.properties.owner) === null || _c === void 0 ? void 0 : _c.properties) === null || _d === void 0 ? void 0 : _d.username;
|
|
1172
|
-
}
|
|
1173
|
-
else if ((_f = (_e = context.entity.properties["corr:owner"]) === null || _e === void 0 ? void 0 : _e.properties) === null || _f === void 0 ? void 0 : _f.username) {
|
|
1174
|
-
owner = (_h = (_g = context.entity.properties["corr:owner"]) === null || _g === void 0 ? void 0 : _g.properties) === null || _h === void 0 ? void 0 : _h.username;
|
|
1175
|
-
}
|
|
1176
|
-
else if (context.entity.properties.owner) {
|
|
1177
|
-
owner = context.entity.properties.owner;
|
|
1178
|
-
}
|
|
1179
|
-
else if (context.entity.properties["corr:owner"]) {
|
|
1180
|
-
owner = context.entity.properties["corr:owner"];
|
|
1181
|
-
}
|
|
1182
|
-
if (owner === context.user.properties.username) {
|
|
1183
|
-
return [2 /*return*/, true];
|
|
1184
|
-
}
|
|
1185
|
-
else {
|
|
1186
|
-
return [2 /*return*/, false];
|
|
1187
|
-
}
|
|
1188
|
-
return [2 /*return*/];
|
|
1189
|
-
});
|
|
1190
|
-
}); },
|
|
1191
|
-
isUserInrole: function (context, args) { return __awaiter(_this, void 0, void 0, function () {
|
|
1192
|
-
var result;
|
|
1193
|
-
return __generator(this, function (_j) {
|
|
1194
|
-
switch (_j.label) {
|
|
1195
|
-
case 0: return [4 /*yield*/, this.nuxeoService
|
|
1196
|
-
.isUserInRole(args, "")
|
|
1197
|
-
.pipe(operators.first())
|
|
1198
|
-
.toPromise()];
|
|
1199
|
-
case 1:
|
|
1200
|
-
result = _j.sent();
|
|
1201
|
-
return [2 /*return*/, result];
|
|
1202
|
-
}
|
|
1203
|
-
});
|
|
1204
|
-
}); },
|
|
1205
|
-
};
|
|
1206
|
-
this.getEvaluator = function (key) { return __awaiter(_this, void 0, void 0, function () {
|
|
1207
|
-
var eva, fn_1;
|
|
1208
|
-
var _this = this;
|
|
1209
|
-
return __generator(this, function (_j) {
|
|
1210
|
-
eva = this.evaluators;
|
|
1211
|
-
if (key && key.startsWith("!")) {
|
|
1212
|
-
fn_1 = eva[key.substring(1)];
|
|
1213
|
-
return [2 /*return*/, function (context, args) { return __awaiter(_this, void 0, void 0, function () {
|
|
1214
|
-
var result;
|
|
1215
|
-
return __generator(this, function (_j) {
|
|
1216
|
-
switch (_j.label) {
|
|
1217
|
-
case 0: return [4 /*yield*/, fn_1.apply(void 0, __spreadArray([context], __read(args)))];
|
|
1218
|
-
case 1:
|
|
1219
|
-
result = _j.sent();
|
|
1220
|
-
return [2 /*return*/, !result];
|
|
1221
|
-
}
|
|
1222
|
-
});
|
|
1223
|
-
}); }];
|
|
1224
|
-
}
|
|
1225
|
-
return [2 /*return*/, eva[key]];
|
|
1226
|
-
});
|
|
1227
|
-
}); };
|
|
1228
|
-
this.appConfigService.configLoaded.subscribe(function (ready) {
|
|
1229
|
-
if (ready) {
|
|
1230
|
-
_this.conditions = _this.getAllRules();
|
|
1191
|
+
}); });
|
|
1192
|
+
};
|
|
1193
|
+
NuxeoService.prototype.createTokenClient = function (token) {
|
|
1194
|
+
this.nuxeoClient = new NuxeoOverride$1({
|
|
1195
|
+
baseURL: this.environment.nuxeo,
|
|
1196
|
+
auth: {
|
|
1197
|
+
method: 'bearerToken',
|
|
1198
|
+
token: token
|
|
1231
1199
|
}
|
|
1232
|
-
});
|
|
1233
|
-
}
|
|
1234
|
-
EvaluatorsService.prototype.setEvaluators = function (evaluators) {
|
|
1235
|
-
this.evaluators = Object.assign(Object.assign({}, this.evaluators), evaluators);
|
|
1200
|
+
}, this.keycloak);
|
|
1236
1201
|
};
|
|
1237
|
-
|
|
1238
|
-
return this.
|
|
1202
|
+
NuxeoService.prototype.getToken = function () {
|
|
1203
|
+
return this.keycloak.getToken();
|
|
1239
1204
|
};
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
if (!evaluator) return [3 /*break*/, 3];
|
|
1255
|
-
return [4 /*yield*/, evaluator(context, ruleRef.parameters)];
|
|
1256
|
-
case 2: return [2 /*return*/, _j.sent()];
|
|
1257
|
-
case 3: return [3 /*break*/, 7];
|
|
1258
|
-
case 4: return [4 /*yield*/, this.getEvaluator(ruleId)];
|
|
1259
|
-
case 5:
|
|
1260
|
-
evaluator = _j.sent();
|
|
1261
|
-
if (!evaluator) return [3 /*break*/, 7];
|
|
1262
|
-
return [4 /*yield*/, evaluator(context)];
|
|
1263
|
-
case 6: return [2 /*return*/, _j.sent()];
|
|
1264
|
-
case 7: return [2 /*return*/];
|
|
1205
|
+
NuxeoService.prototype.doLogout = function () {
|
|
1206
|
+
this.keycloak.logout(window.location.origin + this.baseHref);
|
|
1207
|
+
};
|
|
1208
|
+
NuxeoService.prototype.isUserInRole = function (role, committeeCode) {
|
|
1209
|
+
var _this = this;
|
|
1210
|
+
if (committeeCode === void 0) { committeeCode = null; }
|
|
1211
|
+
var simpleObservable = new rxjs.Observable(function (observer) {
|
|
1212
|
+
_this.keycloak.isLoggedIn().then(function (logged) {
|
|
1213
|
+
if (!logged) {
|
|
1214
|
+
observer.next(false);
|
|
1215
|
+
}
|
|
1216
|
+
else {
|
|
1217
|
+
var hasRole = _this.rolesService.isUserInRole(_this.nuxeoClient.user, role, committeeCode);
|
|
1218
|
+
observer.next(hasRole);
|
|
1265
1219
|
}
|
|
1266
1220
|
});
|
|
1267
1221
|
});
|
|
1222
|
+
return simpleObservable;
|
|
1268
1223
|
};
|
|
1269
|
-
|
|
1270
|
-
return
|
|
1224
|
+
NuxeoService.prototype.createBlob = function (file) {
|
|
1225
|
+
return new NuxeoOverride$1.Blob({
|
|
1226
|
+
content: file
|
|
1227
|
+
});
|
|
1271
1228
|
};
|
|
1272
|
-
|
|
1273
|
-
|
|
1229
|
+
NuxeoService.prototype.getDuplicates = function (params, body) {
|
|
1230
|
+
if (params === void 0) { params = {}; }
|
|
1231
|
+
if (body === void 0) { body = {}; }
|
|
1232
|
+
return rxjs.from(this.nuxeoClient
|
|
1233
|
+
.operation('AC_Get_Duplicates', {
|
|
1234
|
+
url: "" + this.environment.nuxeo + this.environment.customAutomation,
|
|
1235
|
+
})
|
|
1236
|
+
.params(params)
|
|
1237
|
+
.context(body)
|
|
1238
|
+
.execute()).pipe(operators.catchError(function (err) {
|
|
1239
|
+
console.log(err);
|
|
1240
|
+
throw err;
|
|
1241
|
+
}));
|
|
1274
1242
|
};
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
EvaluatorsService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: EvaluatorsService, providedIn: "root" });
|
|
1279
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: EvaluatorsService, decorators: [{
|
|
1280
|
-
type: i0.Injectable,
|
|
1281
|
-
args: [{ providedIn: "root" }]
|
|
1282
|
-
}], ctorParameters: function () { return [{ type: NuxeoService$1 }, { type: AppConfigService }]; } });
|
|
1283
|
-
|
|
1284
|
-
var GlobalAdminService = /** @class */ (function () {
|
|
1285
|
-
function GlobalAdminService(evaluatorService) {
|
|
1286
|
-
this.evaluatorService = evaluatorService;
|
|
1287
|
-
this.isGlobalAdmin = false;
|
|
1288
|
-
this.activeTenant = null;
|
|
1289
|
-
}
|
|
1290
|
-
GlobalAdminService.prototype.checkIfGlobalAdmin = function () {
|
|
1291
|
-
return this.evaluatorService.evaluateRule('isGlobalAdmin');
|
|
1243
|
+
NuxeoService.prototype.checkForRoles = function () {
|
|
1244
|
+
this.isCtsUser();
|
|
1245
|
+
this.isCtsManger();
|
|
1292
1246
|
};
|
|
1293
|
-
|
|
1247
|
+
NuxeoService.prototype.isCtsUser = function () {
|
|
1248
|
+
var _this = this;
|
|
1249
|
+
this.isUserInRole('ctsSecretary', '').subscribe(function (data) {
|
|
1250
|
+
_this.ctsUser = data;
|
|
1251
|
+
});
|
|
1252
|
+
};
|
|
1253
|
+
NuxeoService.prototype.isCtsManger = function () {
|
|
1254
|
+
var _this = this;
|
|
1255
|
+
this.isUserInRole('ctsManger', '').subscribe(function (data) {
|
|
1256
|
+
_this.ctsManger = data;
|
|
1257
|
+
});
|
|
1258
|
+
};
|
|
1259
|
+
return NuxeoService;
|
|
1294
1260
|
}());
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type:
|
|
1261
|
+
NuxeoService$1.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: NuxeoService$1, deps: [{ token: i1__namespace.HttpClient }, { token: i2__namespace.KeycloakService }, { token: i3.APP_BASE_HREF }, { token: 'environment' }, { token: RolesService$1 }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1262
|
+
NuxeoService$1.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: NuxeoService$1, providedIn: 'root' });
|
|
1263
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: NuxeoService$1, decorators: [{
|
|
1298
1264
|
type: i0.Injectable,
|
|
1299
1265
|
args: [{
|
|
1300
1266
|
providedIn: 'root'
|
|
1301
1267
|
}]
|
|
1302
|
-
}], ctorParameters: function () {
|
|
1268
|
+
}], ctorParameters: function () {
|
|
1269
|
+
return [{ type: i1__namespace.HttpClient }, { type: i2__namespace.KeycloakService }, { type: undefined, decorators: [{
|
|
1270
|
+
type: i0.Inject,
|
|
1271
|
+
args: [i3.APP_BASE_HREF]
|
|
1272
|
+
}] }, { type: undefined, decorators: [{
|
|
1273
|
+
type: i0.Inject,
|
|
1274
|
+
args: ['environment']
|
|
1275
|
+
}] }, { type: RolesService$1 }];
|
|
1276
|
+
} });
|
|
1303
1277
|
|
|
1304
|
-
var
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
this.nuxeoService = nuxeoService;
|
|
1309
|
-
}
|
|
1310
|
-
RolesService.prototype.getRoleName = function (role, code) {
|
|
1311
|
-
if (code === void 0) { code = null; }
|
|
1312
|
-
if (this.environment.RolesConstants[role]) {
|
|
1313
|
-
return code
|
|
1314
|
-
? this.environment.RolesConstants[role].replace("{departmentTitle}", code)
|
|
1315
|
-
: "^" + this.environment.RolesConstants[role].replace("{departmentTitle}", ".*.") + "$";
|
|
1316
|
-
}
|
|
1317
|
-
else {
|
|
1318
|
-
console.warn("role: " + role + " does not exist in roles config");
|
|
1319
|
-
return role;
|
|
1320
|
-
}
|
|
1321
|
-
};
|
|
1322
|
-
RolesService.prototype.isUserInRole = function (user, role, code) {
|
|
1323
|
-
var _this = this;
|
|
1324
|
-
if (code === void 0) { code = null; }
|
|
1325
|
-
var hasRole = false;
|
|
1326
|
-
var groups = user ? user.extendedGroups || user.groups : [];
|
|
1327
|
-
if (groups && groups.length > 0) {
|
|
1328
|
-
if (Array.isArray(role)) {
|
|
1329
|
-
role.forEach(function (r) {
|
|
1330
|
-
if (groups.filter(function (item) {
|
|
1331
|
-
if (code) {
|
|
1332
|
-
return (item.name || item) === _this.getRoleName(r, code);
|
|
1333
|
-
}
|
|
1334
|
-
else {
|
|
1335
|
-
var regex = new RegExp(_this.getRoleName(r));
|
|
1336
|
-
return regex.test(item.name || item);
|
|
1337
|
-
}
|
|
1338
|
-
}).length > 0) {
|
|
1339
|
-
hasRole = true;
|
|
1340
|
-
return;
|
|
1341
|
-
}
|
|
1342
|
-
});
|
|
1343
|
-
}
|
|
1344
|
-
else {
|
|
1345
|
-
hasRole =
|
|
1346
|
-
groups.filter(function (item) {
|
|
1347
|
-
if (code) {
|
|
1348
|
-
return (item.name || item) === _this.getRoleName(role, code);
|
|
1349
|
-
}
|
|
1350
|
-
else {
|
|
1351
|
-
var regex = new RegExp(_this.getRoleName(role));
|
|
1352
|
-
return regex.test(item.name || item);
|
|
1353
|
-
}
|
|
1354
|
-
}).length > 0;
|
|
1355
|
-
}
|
|
1356
|
-
}
|
|
1357
|
-
return hasRole;
|
|
1358
|
-
};
|
|
1359
|
-
RolesService.prototype.getUserRoleName = function (user, code) {
|
|
1360
|
-
var _this = this;
|
|
1361
|
-
var found = null;
|
|
1362
|
-
var groups = user ? user.extendedGroups || user.groups : [];
|
|
1363
|
-
if (groups && groups.length) {
|
|
1364
|
-
Object.keys(this.environment.RolesConstants).forEach(function (key) {
|
|
1365
|
-
var roleWCode = _this.environment.RolesConstants[key].replace("{departmentTitle}", code);
|
|
1366
|
-
if ((code && roleWCode.includes('dms_user_')) || !code)
|
|
1367
|
-
groups.forEach(function (group) {
|
|
1368
|
-
if (group.name || group === roleWCode) {
|
|
1369
|
-
found = key;
|
|
1370
|
-
}
|
|
1371
|
-
});
|
|
1372
|
-
});
|
|
1373
|
-
}
|
|
1374
|
-
return found;
|
|
1375
|
-
};
|
|
1376
|
-
RolesService.prototype.isUserManagerInDepartment = function (user, code) {
|
|
1377
|
-
var filteredRoles = Object.values(this.environment.RolesConstants).filter(function (role) { return role.includes("{departmentTitle}"); });
|
|
1378
|
-
var departmentRoles = [];
|
|
1379
|
-
var isUserInDepartment = false;
|
|
1380
|
-
var groups = user ? user.extendedGroups || user.groups : [];
|
|
1381
|
-
if (groups && groups.length) {
|
|
1382
|
-
filteredRoles.forEach(function (key) {
|
|
1383
|
-
var roleWCode = key.replace("{departmentTitle}", code);
|
|
1384
|
-
departmentRoles.push(roleWCode);
|
|
1385
|
-
});
|
|
1386
|
-
}
|
|
1387
|
-
departmentRoles = departmentRoles.filter(function (role) {
|
|
1388
|
-
return role.includes("Manager");
|
|
1389
|
-
});
|
|
1390
|
-
groups.forEach(function (group) {
|
|
1391
|
-
var groupName = group.name || group;
|
|
1392
|
-
var departmentIsIncluded = departmentRoles.includes(groupName);
|
|
1393
|
-
if (departmentIsIncluded) {
|
|
1394
|
-
isUserInDepartment = true;
|
|
1395
|
-
}
|
|
1396
|
-
});
|
|
1397
|
-
return isUserInDepartment;
|
|
1398
|
-
};
|
|
1399
|
-
RolesService.prototype.getUserDepartment = function (currentUser, prefix) {
|
|
1400
|
-
if (prefix === void 0) { prefix = "cts_role_"; }
|
|
1401
|
-
var groupToExclude = "cts_role_sys";
|
|
1402
|
-
if (this.globalAdmin.isGlobalAdmin) {
|
|
1403
|
-
prefix = "tenant_" + this.globalAdmin.activeTenant + "_cts_role_";
|
|
1404
|
-
groupToExclude = "tenant_" + this.globalAdmin.activeTenant + "_cts_role_sys";
|
|
1405
|
-
}
|
|
1406
|
-
else if (!this.globalAdmin.activeTenant && this.nuxeoService.nuxeoClient.user.properties.tenantId) {
|
|
1407
|
-
prefix = "tenant_" + this.nuxeoService.nuxeoClient.user.properties.tenantId + "_cts_role_";
|
|
1408
|
-
groupToExclude = "tenant_" + this.nuxeoService.nuxeoClient.user.properties.tenantId + "_cts_role_sys";
|
|
1409
|
-
}
|
|
1410
|
-
var allGroups = currentUser.properties.groups;
|
|
1411
|
-
var departmentCode = "";
|
|
1412
|
-
allGroups.some(function (group) {
|
|
1413
|
-
if (!group.includes(groupToExclude) && group.includes(prefix)) {
|
|
1414
|
-
departmentCode = group;
|
|
1415
|
-
return true;
|
|
1416
|
-
}
|
|
1417
|
-
});
|
|
1418
|
-
var prefixLength = prefix.length;
|
|
1419
|
-
departmentCode = departmentCode.substring(prefixLength);
|
|
1420
|
-
var lastIndex = departmentCode.lastIndexOf("_");
|
|
1421
|
-
departmentCode = departmentCode.substring(0, lastIndex);
|
|
1422
|
-
return departmentCode;
|
|
1423
|
-
};
|
|
1424
|
-
return RolesService;
|
|
1425
|
-
}());
|
|
1426
|
-
RolesService$1.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: RolesService$1, deps: [{ token: "environment" }, { token: GlobalAdminService }, { token: NuxeoService$1 }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1427
|
-
RolesService$1.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: RolesService$1, providedIn: "root" });
|
|
1428
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: RolesService$1, decorators: [{
|
|
1429
|
-
type: i0.Injectable,
|
|
1430
|
-
args: [{
|
|
1431
|
-
providedIn: "root",
|
|
1432
|
-
}]
|
|
1433
|
-
}], ctorParameters: function () {
|
|
1434
|
-
return [{ type: undefined, decorators: [{
|
|
1435
|
-
type: i0.Inject,
|
|
1436
|
-
args: ["environment"]
|
|
1437
|
-
}] }, { type: GlobalAdminService }, { type: NuxeoService$1 }];
|
|
1438
|
-
} });
|
|
1439
|
-
'tenant_fintech_cts_role_sys';
|
|
1440
|
-
'tenant_fintech_cts_role_';
|
|
1441
|
-
|
|
1442
|
-
var NuxeoService$1 = /** @class */ (function () {
|
|
1443
|
-
function NuxeoService(http, keycloak, baseHref, environment, rolesService) {
|
|
1444
|
-
this.http = http;
|
|
1445
|
-
this.keycloak = keycloak;
|
|
1446
|
-
this.baseHref = baseHref;
|
|
1447
|
-
this.environment = environment;
|
|
1448
|
-
this.rolesService = rolesService;
|
|
1449
|
-
this.excludedUrls = [];
|
|
1450
|
-
this.enableBearerInterceptor = true;
|
|
1451
|
-
this.authenticated = false;
|
|
1452
|
-
this.ctsUser = false;
|
|
1453
|
-
this.ctsManger = false;
|
|
1454
|
-
}
|
|
1455
|
-
NuxeoService.prototype.init = function () {
|
|
1456
|
-
var _this = this;
|
|
1457
|
-
return new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
|
|
1458
|
-
var _this = this;
|
|
1459
|
-
return __generator(this, function (_a) {
|
|
1460
|
-
try {
|
|
1461
|
-
this.keycloak.getToken().then(function (token) {
|
|
1462
|
-
_this.createTokenClient(token);
|
|
1463
|
-
_this.nuxeoClient.connect()
|
|
1464
|
-
.then(function (client) {
|
|
1465
|
-
_this.authenticated = true;
|
|
1466
|
-
resolve(client);
|
|
1467
|
-
_this.checkForRoles();
|
|
1468
|
-
})
|
|
1469
|
-
.catch(function (error) {
|
|
1470
|
-
reject(error);
|
|
1471
|
-
});
|
|
1472
|
-
});
|
|
1473
|
-
}
|
|
1474
|
-
catch (error) {
|
|
1475
|
-
reject(error);
|
|
1476
|
-
}
|
|
1477
|
-
return [2 /*return*/];
|
|
1478
|
-
});
|
|
1479
|
-
}); });
|
|
1480
|
-
};
|
|
1481
|
-
NuxeoService.prototype.createTokenClient = function (token) {
|
|
1482
|
-
this.nuxeoClient = new NuxeoOverride$1({
|
|
1483
|
-
baseURL: this.environment.nuxeo,
|
|
1484
|
-
auth: {
|
|
1485
|
-
method: 'bearerToken',
|
|
1486
|
-
token: token
|
|
1487
|
-
}
|
|
1488
|
-
}, this.keycloak);
|
|
1489
|
-
};
|
|
1490
|
-
NuxeoService.prototype.getToken = function () {
|
|
1491
|
-
return this.keycloak.getToken();
|
|
1492
|
-
};
|
|
1493
|
-
NuxeoService.prototype.doLogout = function () {
|
|
1494
|
-
this.keycloak.logout(window.location.origin + this.baseHref);
|
|
1495
|
-
};
|
|
1496
|
-
NuxeoService.prototype.isUserInRole = function (role, committeeCode) {
|
|
1497
|
-
var _this = this;
|
|
1498
|
-
if (committeeCode === void 0) { committeeCode = null; }
|
|
1499
|
-
var simpleObservable = new rxjs.Observable(function (observer) {
|
|
1500
|
-
_this.keycloak.isLoggedIn().then(function (logged) {
|
|
1501
|
-
if (!logged) {
|
|
1502
|
-
observer.next(false);
|
|
1503
|
-
}
|
|
1504
|
-
else {
|
|
1505
|
-
var hasRole = _this.rolesService.isUserInRole(_this.nuxeoClient.user, role, committeeCode);
|
|
1506
|
-
observer.next(hasRole);
|
|
1507
|
-
}
|
|
1508
|
-
});
|
|
1509
|
-
});
|
|
1510
|
-
return simpleObservable;
|
|
1511
|
-
};
|
|
1512
|
-
NuxeoService.prototype.createBlob = function (file) {
|
|
1513
|
-
return new NuxeoOverride$1.Blob({
|
|
1514
|
-
content: file
|
|
1515
|
-
});
|
|
1516
|
-
};
|
|
1517
|
-
NuxeoService.prototype.getDuplicates = function (params, body) {
|
|
1518
|
-
if (params === void 0) { params = {}; }
|
|
1519
|
-
if (body === void 0) { body = {}; }
|
|
1520
|
-
return rxjs.from(this.nuxeoClient
|
|
1521
|
-
.operation('AC_Get_Duplicates', {
|
|
1522
|
-
url: "" + this.environment.nuxeo + this.environment.customAutomation,
|
|
1523
|
-
})
|
|
1524
|
-
.params(params)
|
|
1525
|
-
.context(body)
|
|
1526
|
-
.execute()).pipe(operators.catchError(function (err) {
|
|
1527
|
-
console.log(err);
|
|
1528
|
-
throw err;
|
|
1529
|
-
}));
|
|
1530
|
-
};
|
|
1531
|
-
NuxeoService.prototype.checkForRoles = function () {
|
|
1532
|
-
this.isCtsUser();
|
|
1533
|
-
this.isCtsManger();
|
|
1534
|
-
};
|
|
1535
|
-
NuxeoService.prototype.isCtsUser = function () {
|
|
1536
|
-
var _this = this;
|
|
1537
|
-
this.isUserInRole('ctsSecretary', '').subscribe(function (data) {
|
|
1538
|
-
_this.ctsUser = data;
|
|
1539
|
-
});
|
|
1540
|
-
};
|
|
1541
|
-
NuxeoService.prototype.isCtsManger = function () {
|
|
1542
|
-
var _this = this;
|
|
1543
|
-
this.isUserInRole('ctsManger', '').subscribe(function (data) {
|
|
1544
|
-
_this.ctsManger = data;
|
|
1545
|
-
});
|
|
1546
|
-
};
|
|
1547
|
-
return NuxeoService;
|
|
1548
|
-
}());
|
|
1549
|
-
NuxeoService$1.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: NuxeoService$1, deps: [{ token: i1__namespace.HttpClient }, { token: i2__namespace.KeycloakService }, { token: i3.APP_BASE_HREF }, { token: 'environment' }, { token: RolesService$1 }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1550
|
-
NuxeoService$1.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: NuxeoService$1, providedIn: 'root' });
|
|
1551
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: NuxeoService$1, decorators: [{
|
|
1552
|
-
type: i0.Injectable,
|
|
1553
|
-
args: [{
|
|
1554
|
-
providedIn: 'root'
|
|
1555
|
-
}]
|
|
1556
|
-
}], ctorParameters: function () {
|
|
1557
|
-
return [{ type: i1__namespace.HttpClient }, { type: i2__namespace.KeycloakService }, { type: undefined, decorators: [{
|
|
1558
|
-
type: i0.Inject,
|
|
1559
|
-
args: [i3.APP_BASE_HREF]
|
|
1560
|
-
}] }, { type: undefined, decorators: [{
|
|
1561
|
-
type: i0.Inject,
|
|
1562
|
-
args: ['environment']
|
|
1563
|
-
}] }, { type: RolesService$1 }];
|
|
1564
|
-
} });
|
|
1565
|
-
|
|
1566
|
-
var TRANSLATION_PROVIDER$1 = new i0.InjectionToken('Injection token for translation providers.');
|
|
1567
|
-
var TranslationService$1 = /** @class */ (function () {
|
|
1568
|
-
function TranslationService(translate, rendererFactory, localStorage, userPreferencesService, appConfig, nuxeoService, environment, providers) {
|
|
1569
|
-
var e_1, _a;
|
|
1278
|
+
var TRANSLATION_PROVIDER$1 = new i0.InjectionToken('Injection token for translation providers.');
|
|
1279
|
+
var TranslationService$1 = /** @class */ (function () {
|
|
1280
|
+
function TranslationService(translate, rendererFactory, localStorage, userPreferencesService, appConfig, nuxeoService, environment, providers) {
|
|
1281
|
+
var e_1, _a;
|
|
1570
1282
|
var _this = this;
|
|
1571
1283
|
this.translate = translate;
|
|
1572
1284
|
this.rendererFactory = rendererFactory;
|
|
@@ -2581,10 +2293,10 @@
|
|
|
2581
2293
|
}(Nuxeo));
|
|
2582
2294
|
|
|
2583
2295
|
var RolesService = /** @class */ (function () {
|
|
2584
|
-
function RolesService(environment
|
|
2296
|
+
function RolesService(environment
|
|
2297
|
+
// , private globalAdmin : GlobalAdminService , private nuxeoService : NuxeoService
|
|
2298
|
+
) {
|
|
2585
2299
|
this.environment = environment;
|
|
2586
|
-
this.globalAdmin = globalAdmin;
|
|
2587
|
-
this.nuxeoService = nuxeoService;
|
|
2588
2300
|
}
|
|
2589
2301
|
RolesService.prototype.getRoleName = function (role, code) {
|
|
2590
2302
|
if (code === void 0) { code = null; }
|
|
@@ -2675,16 +2387,16 @@
|
|
|
2675
2387
|
});
|
|
2676
2388
|
return isUserInDepartment;
|
|
2677
2389
|
};
|
|
2678
|
-
RolesService.prototype.getUserDepartment = function (currentUser, prefix) {
|
|
2390
|
+
RolesService.prototype.getUserDepartment = function (currentUser, prefix, option) {
|
|
2679
2391
|
if (prefix === void 0) { prefix = "cts_role_"; }
|
|
2680
2392
|
var groupToExclude = "cts_role_sys";
|
|
2681
|
-
if (
|
|
2682
|
-
prefix = "tenant_" +
|
|
2683
|
-
groupToExclude = "tenant_" +
|
|
2393
|
+
if (option && option.isGlobalAdmin) {
|
|
2394
|
+
prefix = "tenant_" + option.activeTenant + "_cts_role_";
|
|
2395
|
+
groupToExclude = "tenant_" + option.activeTenant + "_cts_role_sys";
|
|
2684
2396
|
}
|
|
2685
|
-
else if (!
|
|
2686
|
-
prefix = "tenant_" +
|
|
2687
|
-
groupToExclude = "tenant_" +
|
|
2397
|
+
else if (option && !option.isGlobalAdmin && option.tenantId) {
|
|
2398
|
+
prefix = "tenant_" + option.tenantId + "_cts_role_";
|
|
2399
|
+
groupToExclude = "tenant_" + option.tenantId + "_cts_role_sys";
|
|
2688
2400
|
}
|
|
2689
2401
|
var allGroups = currentUser.properties.groups;
|
|
2690
2402
|
var departmentCode = "";
|
|
@@ -2702,7 +2414,7 @@
|
|
|
2702
2414
|
};
|
|
2703
2415
|
return RolesService;
|
|
2704
2416
|
}());
|
|
2705
|
-
RolesService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: RolesService, deps: [{ token: "environment" }
|
|
2417
|
+
RolesService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: RolesService, deps: [{ token: "environment" }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
2706
2418
|
RolesService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: RolesService, providedIn: "root" });
|
|
2707
2419
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: RolesService, decorators: [{
|
|
2708
2420
|
type: i0.Injectable,
|
|
@@ -2713,10 +2425,8 @@
|
|
|
2713
2425
|
return [{ type: undefined, decorators: [{
|
|
2714
2426
|
type: i0.Inject,
|
|
2715
2427
|
args: ["environment"]
|
|
2716
|
-
}] }
|
|
2717
|
-
} });
|
|
2718
|
-
'tenant_fintech_cts_role_sys';
|
|
2719
|
-
'tenant_fintech_cts_role_';
|
|
2428
|
+
}] }];
|
|
2429
|
+
} });
|
|
2720
2430
|
|
|
2721
2431
|
var NuxeoService = /** @class */ (function () {
|
|
2722
2432
|
function NuxeoService(http, keycloak, baseHref, environment, rolesService) {
|
|
@@ -3660,195 +3370,461 @@
|
|
|
3660
3370
|
}
|
|
3661
3371
|
this.selectedDateChange.emit(this.selectedDate);
|
|
3662
3372
|
};
|
|
3663
|
-
HijriGregorianDatepickerComponent.prototype.hijriClick = function () {
|
|
3664
|
-
if (this.selectedDateType == DateType.Hijri) {
|
|
3665
|
-
return;
|
|
3666
|
-
}
|
|
3667
|
-
this.selectedDateType = DateType.Hijri;
|
|
3668
|
-
//to hijri
|
|
3669
|
-
if (this.range) {
|
|
3670
|
-
this.selectedDate = {
|
|
3671
|
-
from: this.dateFormatterService.ToHijri(this.selectedDate.from || null),
|
|
3672
|
-
to: this.dateFormatterService.ToHijri(this.selectedDate.to || null)
|
|
3673
|
-
};
|
|
3674
|
-
}
|
|
3675
|
-
else {
|
|
3676
|
-
this.selectedDate = this.dateFormatterService.ToHijri(this.selectedDate);
|
|
3677
|
-
}
|
|
3678
|
-
this.selectedDateChange.emit(this.selectedDate);
|
|
3373
|
+
HijriGregorianDatepickerComponent.prototype.hijriClick = function () {
|
|
3374
|
+
if (this.selectedDateType == DateType.Hijri) {
|
|
3375
|
+
return;
|
|
3376
|
+
}
|
|
3377
|
+
this.selectedDateType = DateType.Hijri;
|
|
3378
|
+
//to hijri
|
|
3379
|
+
if (this.range) {
|
|
3380
|
+
this.selectedDate = {
|
|
3381
|
+
from: this.dateFormatterService.ToHijri(this.selectedDate.from || null),
|
|
3382
|
+
to: this.dateFormatterService.ToHijri(this.selectedDate.to || null)
|
|
3383
|
+
};
|
|
3384
|
+
}
|
|
3385
|
+
else {
|
|
3386
|
+
this.selectedDate = this.dateFormatterService.ToHijri(this.selectedDate);
|
|
3387
|
+
}
|
|
3388
|
+
this.selectedDateChange.emit(this.selectedDate);
|
|
3389
|
+
};
|
|
3390
|
+
HijriGregorianDatepickerComponent.prototype.gregClick = function () {
|
|
3391
|
+
if (this.selectedDateType == DateType.Gregorian) {
|
|
3392
|
+
return;
|
|
3393
|
+
}
|
|
3394
|
+
this.selectedDateType = DateType.Gregorian;
|
|
3395
|
+
//to Gregorian
|
|
3396
|
+
if (this.range) {
|
|
3397
|
+
this.selectedDate = {
|
|
3398
|
+
from: this.dateFormatterService.ToGregorian(this.selectedDate.from || null),
|
|
3399
|
+
to: this.dateFormatterService.ToGregorian(this.selectedDate.to || null)
|
|
3400
|
+
};
|
|
3401
|
+
}
|
|
3402
|
+
else {
|
|
3403
|
+
this.selectedDate = this.dateFormatterService.ToGregorian(this.selectedDate);
|
|
3404
|
+
}
|
|
3405
|
+
this.selectedDateChange.emit(this.selectedDate);
|
|
3406
|
+
};
|
|
3407
|
+
return HijriGregorianDatepickerComponent;
|
|
3408
|
+
}());
|
|
3409
|
+
HijriGregorianDatepickerComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: HijriGregorianDatepickerComponent, deps: [{ token: DateFormatterService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
3410
|
+
HijriGregorianDatepickerComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.4", type: HijriGregorianDatepickerComponent, selector: "hijri-gregorian-datepicker", inputs: { selectedDateType: "selectedDateType", selectedDate: "selectedDate", label: "label", showLabel: "showLabel", readonly: "readonly", isRequired: "isRequired", disabled: "disabled", disabledbtn: "disabledbtn", minHijri: "minHijri", maxHijri: "maxHijri", minGreg: "minGreg", maxGreg: "maxGreg", hijriLabel: "hijriLabel", GregLabel: "GregLabel", placeHolder: "placeHolder", range: "range", vertical: "vertical" }, outputs: { selectedDateChange: "selectedDateChange" }, viewQueries: [{ propertyName: "datePicker", first: true, predicate: ["d"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div class=\"form-group\" provideParentForm>\r\n <label class=\"requiredInput\" *ngIf=\"showLabel\" for=\"input-birth-Date\">{{ label }} </label>\r\n\r\n <div class=\"input-group\">\r\n <gregorian-date-picker [vertical]=\"vertical\" *ngIf=\"selectedDateType == DateType.Gregorian\" [range]=\"range\"\r\n [(selectedDate)]=\"selectedDate\" (selectedDateChange)=\"dateSelected($event)\" [readonly]=\"readonly\" [min]=\"minGreg\"\r\n [max]=\"maxGreg\" style=\"flex: 1 1 auto;\" [name]=\"label\" [isRequired]=\"isRequired\" [placeHolder]=\"placeHolder\"\r\n [disabled]=\"disabled\">\r\n </gregorian-date-picker>\r\n <hijri-date-picker [vertical]=\"vertical\" *ngIf=\"selectedDateType == DateType.Hijri\" [range]=\"range\"\r\n [(selectedDate)]=\"selectedDate\" (selectedDateChange)=\"dateSelected($event)\" [readonly]=\"readonly\" [min]=\"minHijri\"\r\n [max]=\"maxHijri\" style=\"flex: 1 1 auto;\" [name]=\"label\" [isRequired]=\"isRequired\" [placeHolder]=\"placeHolder\"\r\n [disabled]=\"disabled\">\r\n </hijri-date-picker>\r\n\r\n <div class=\"input-group-append\">\r\n <button class=\"btn btn-sm {{selectedDateType == DateType.Hijri ? 'btn-info focus active' : 'btn-outline-info'}}\"\r\n (click)=\"hijriClick()\" [disabled]=\"disabledbtn\" type=\"button\">\r\n {{hijriLabel ? hijriLabel : 'Hijri' }}\r\n </button>\r\n <button\r\n class=\"btn btn-sm {{selectedDateType == DateType.Gregorian ? 'btn-info focus active' : 'btn-outline-info'}}\"\r\n (click)=\"gregClick()\" [disabled]=\"disabledbtn\" type=\"button\">\r\n {{GregLabel ? GregLabel : 'Gregorian' }}\r\n </button>\r\n </div>\r\n\r\n </div>\r\n</div>\r\n", components: [{ type: GregorianDatepickerComponent, selector: "gregorian-date-picker", inputs: ["selectedDate", "readonly", "isRequired", "disabled", "min", "max", "name", "range", "vertical", "placeHolder"], outputs: ["selectedDateChange"] }, { type: HijriDatepickerComponent, selector: "hijri-date-picker", inputs: ["selectedDate", "readonly", "isRequired", "disabled", "min", "max", "name", "range", "vertical", "placeHolder"], outputs: ["selectedDateChange"] }], directives: [{ type: ProvideParentFormDirective, selector: "[provideParentForm]" }, { type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
3411
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: HijriGregorianDatepickerComponent, decorators: [{
|
|
3412
|
+
type: i0.Component,
|
|
3413
|
+
args: [{
|
|
3414
|
+
selector: 'hijri-gregorian-datepicker',
|
|
3415
|
+
templateUrl: './hijri-gregorian-datepicker.component.html'
|
|
3416
|
+
}]
|
|
3417
|
+
}], ctorParameters: function () { return [{ type: DateFormatterService }]; }, propDecorators: { datePicker: [{
|
|
3418
|
+
type: i0.ViewChild,
|
|
3419
|
+
args: ['d']
|
|
3420
|
+
}], selectedDateType: [{
|
|
3421
|
+
type: i0.Input
|
|
3422
|
+
}], selectedDate: [{
|
|
3423
|
+
type: i0.Input
|
|
3424
|
+
}], selectedDateChange: [{
|
|
3425
|
+
type: i0.Output
|
|
3426
|
+
}], label: [{
|
|
3427
|
+
type: i0.Input
|
|
3428
|
+
}], showLabel: [{
|
|
3429
|
+
type: i0.Input
|
|
3430
|
+
}], readonly: [{
|
|
3431
|
+
type: i0.Input
|
|
3432
|
+
}], isRequired: [{
|
|
3433
|
+
type: i0.Input
|
|
3434
|
+
}], disabled: [{
|
|
3435
|
+
type: i0.Input
|
|
3436
|
+
}], disabledbtn: [{
|
|
3437
|
+
type: i0.Input
|
|
3438
|
+
}], minHijri: [{
|
|
3439
|
+
type: i0.Input
|
|
3440
|
+
}], maxHijri: [{
|
|
3441
|
+
type: i0.Input
|
|
3442
|
+
}], minGreg: [{
|
|
3443
|
+
type: i0.Input
|
|
3444
|
+
}], maxGreg: [{
|
|
3445
|
+
type: i0.Input
|
|
3446
|
+
}], hijriLabel: [{
|
|
3447
|
+
type: i0.Input
|
|
3448
|
+
}], GregLabel: [{
|
|
3449
|
+
type: i0.Input
|
|
3450
|
+
}], placeHolder: [{
|
|
3451
|
+
type: i0.Input
|
|
3452
|
+
}], range: [{
|
|
3453
|
+
type: i0.Input
|
|
3454
|
+
}], vertical: [{
|
|
3455
|
+
type: i0.Input
|
|
3456
|
+
}] } });
|
|
3457
|
+
|
|
3458
|
+
/** @ignore */
|
|
3459
|
+
var NgxHijriGregorianDatepickerModule = /** @class */ (function () {
|
|
3460
|
+
function NgxHijriGregorianDatepickerModule() {
|
|
3461
|
+
}
|
|
3462
|
+
return NgxHijriGregorianDatepickerModule;
|
|
3463
|
+
}());
|
|
3464
|
+
NgxHijriGregorianDatepickerModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: NgxHijriGregorianDatepickerModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
3465
|
+
NgxHijriGregorianDatepickerModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: NgxHijriGregorianDatepickerModule, declarations: [HijriGregorianDatepickerComponent,
|
|
3466
|
+
HijriDatepickerComponent,
|
|
3467
|
+
GregorianDatepickerComponent,
|
|
3468
|
+
ProvideParentFormDirective], imports: [i3.CommonModule,
|
|
3469
|
+
i6.ReactiveFormsModule,
|
|
3470
|
+
i1$1.TranslateModule,
|
|
3471
|
+
i6.FormsModule,
|
|
3472
|
+
i1$4.NgbModule], exports: [HijriGregorianDatepickerComponent] });
|
|
3473
|
+
NgxHijriGregorianDatepickerModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: NgxHijriGregorianDatepickerModule, providers: [
|
|
3474
|
+
{ provide: i1$4.NgbDateParserFormatter, useClass: CustomNgbDateParserFormatter },
|
|
3475
|
+
DateFormatterService
|
|
3476
|
+
], imports: [[
|
|
3477
|
+
i3.CommonModule,
|
|
3478
|
+
i6.ReactiveFormsModule,
|
|
3479
|
+
i1$1.TranslateModule,
|
|
3480
|
+
i6.FormsModule,
|
|
3481
|
+
i1$4.NgbModule
|
|
3482
|
+
]] });
|
|
3483
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: NgxHijriGregorianDatepickerModule, decorators: [{
|
|
3484
|
+
type: i0.NgModule,
|
|
3485
|
+
args: [{
|
|
3486
|
+
declarations: [
|
|
3487
|
+
HijriGregorianDatepickerComponent,
|
|
3488
|
+
HijriDatepickerComponent,
|
|
3489
|
+
GregorianDatepickerComponent,
|
|
3490
|
+
ProvideParentFormDirective
|
|
3491
|
+
],
|
|
3492
|
+
imports: [
|
|
3493
|
+
i3.CommonModule,
|
|
3494
|
+
i6.ReactiveFormsModule,
|
|
3495
|
+
i1$1.TranslateModule,
|
|
3496
|
+
i6.FormsModule,
|
|
3497
|
+
i1$4.NgbModule
|
|
3498
|
+
],
|
|
3499
|
+
providers: [
|
|
3500
|
+
{ provide: i1$4.NgbDateParserFormatter, useClass: CustomNgbDateParserFormatter },
|
|
3501
|
+
DateFormatterService
|
|
3502
|
+
],
|
|
3503
|
+
exports: [HijriGregorianDatepickerComponent]
|
|
3504
|
+
}]
|
|
3505
|
+
}] });
|
|
3506
|
+
|
|
3507
|
+
/** @ignore */
|
|
3508
|
+
var ClickOutsideDirective = /** @class */ (function () {
|
|
3509
|
+
function ClickOutsideDirective(elementRef) {
|
|
3510
|
+
this.elementRef = elementRef;
|
|
3511
|
+
this.clickOutside = new i0.EventEmitter();
|
|
3512
|
+
}
|
|
3513
|
+
ClickOutsideDirective.prototype.onClick = function (target) {
|
|
3514
|
+
var clickedInside = this.elementRef.nativeElement.contains(target);
|
|
3515
|
+
if (!clickedInside) {
|
|
3516
|
+
this.clickOutside.emit(target);
|
|
3517
|
+
}
|
|
3518
|
+
};
|
|
3519
|
+
return ClickOutsideDirective;
|
|
3520
|
+
}());
|
|
3521
|
+
ClickOutsideDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: ClickOutsideDirective, deps: [{ token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
|
3522
|
+
ClickOutsideDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.4", type: ClickOutsideDirective, selector: "[clickOutside]", outputs: { clickOutside: "clickOutside" }, host: { listeners: { "window:click": "onClick($event.target)" } }, ngImport: i0__namespace });
|
|
3523
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: ClickOutsideDirective, decorators: [{
|
|
3524
|
+
type: i0.Directive,
|
|
3525
|
+
args: [{
|
|
3526
|
+
selector: '[clickOutside]'
|
|
3527
|
+
}]
|
|
3528
|
+
}], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }]; }, propDecorators: { clickOutside: [{
|
|
3529
|
+
type: i0.Output
|
|
3530
|
+
}], onClick: [{
|
|
3531
|
+
type: i0.HostListener,
|
|
3532
|
+
args: ['window:click', ['$event.target']]
|
|
3533
|
+
}] } });
|
|
3534
|
+
|
|
3535
|
+
/** @ignore */
|
|
3536
|
+
var SetRtlDirective = /** @class */ (function () {
|
|
3537
|
+
function SetRtlDirective(elRef, renderer, translation) {
|
|
3538
|
+
this.elRef = elRef;
|
|
3539
|
+
this.renderer = renderer;
|
|
3540
|
+
this.translation = translation;
|
|
3541
|
+
this.switchClassBasedOnLanguage();
|
|
3542
|
+
}
|
|
3543
|
+
/*Switch rtl class based on the chosen language from Translation Service*/
|
|
3544
|
+
SetRtlDirective.prototype.switchClassBasedOnLanguage = function () {
|
|
3545
|
+
var _this = this;
|
|
3546
|
+
this.translation.isArabic.subscribe(function (arabic) {
|
|
3547
|
+
arabic
|
|
3548
|
+
? _this.renderer.addClass(_this.elRef.nativeElement, 'rtl')
|
|
3549
|
+
: _this.renderer.removeClass(_this.elRef.nativeElement, 'rtl');
|
|
3550
|
+
});
|
|
3551
|
+
};
|
|
3552
|
+
return SetRtlDirective;
|
|
3553
|
+
}());
|
|
3554
|
+
SetRtlDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: SetRtlDirective, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.Renderer2 }, { token: TranslationService$1 }], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
|
3555
|
+
SetRtlDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.4", type: SetRtlDirective, selector: "[SetRtl]", ngImport: i0__namespace });
|
|
3556
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: SetRtlDirective, decorators: [{
|
|
3557
|
+
type: i0.Directive,
|
|
3558
|
+
args: [{
|
|
3559
|
+
selector: '[SetRtl]',
|
|
3560
|
+
}]
|
|
3561
|
+
}], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.Renderer2 }, { type: TranslationService$1 }]; } });
|
|
3562
|
+
|
|
3563
|
+
var EvaluatorsService = /** @class */ (function () {
|
|
3564
|
+
function EvaluatorsService(nuxeoService, appConfigService) {
|
|
3565
|
+
var _this = this;
|
|
3566
|
+
this.nuxeoService = nuxeoService;
|
|
3567
|
+
this.appConfigService = appConfigService;
|
|
3568
|
+
this.context = { entity: null, getEvaluator: null, user: null };
|
|
3569
|
+
this.asyncEvery = function (arr, predicate) { return __awaiter(_this, void 0, void 0, function () {
|
|
3570
|
+
var arr_1, arr_1_1, e, e_1_1;
|
|
3571
|
+
var e_1, _j;
|
|
3572
|
+
return __generator(this, function (_k) {
|
|
3573
|
+
switch (_k.label) {
|
|
3574
|
+
case 0:
|
|
3575
|
+
_k.trys.push([0, 5, 6, 7]);
|
|
3576
|
+
arr_1 = __values(arr), arr_1_1 = arr_1.next();
|
|
3577
|
+
_k.label = 1;
|
|
3578
|
+
case 1:
|
|
3579
|
+
if (!!arr_1_1.done) return [3 /*break*/, 4];
|
|
3580
|
+
e = arr_1_1.value;
|
|
3581
|
+
return [4 /*yield*/, predicate(e)];
|
|
3582
|
+
case 2:
|
|
3583
|
+
if (!(_k.sent())) {
|
|
3584
|
+
return [2 /*return*/, false];
|
|
3585
|
+
}
|
|
3586
|
+
_k.label = 3;
|
|
3587
|
+
case 3:
|
|
3588
|
+
arr_1_1 = arr_1.next();
|
|
3589
|
+
return [3 /*break*/, 1];
|
|
3590
|
+
case 4: return [3 /*break*/, 7];
|
|
3591
|
+
case 5:
|
|
3592
|
+
e_1_1 = _k.sent();
|
|
3593
|
+
e_1 = { error: e_1_1 };
|
|
3594
|
+
return [3 /*break*/, 7];
|
|
3595
|
+
case 6:
|
|
3596
|
+
try {
|
|
3597
|
+
if (arr_1_1 && !arr_1_1.done && (_j = arr_1.return)) _j.call(arr_1);
|
|
3598
|
+
}
|
|
3599
|
+
finally { if (e_1) throw e_1.error; }
|
|
3600
|
+
return [7 /*endfinally*/];
|
|
3601
|
+
case 7: return [2 /*return*/, true];
|
|
3602
|
+
}
|
|
3603
|
+
});
|
|
3604
|
+
}); };
|
|
3605
|
+
this.asyncSome = function (arr, predicate) { return __awaiter(_this, void 0, void 0, function () {
|
|
3606
|
+
var arr_2, arr_2_1, e, e_2_1;
|
|
3607
|
+
var e_2, _j;
|
|
3608
|
+
return __generator(this, function (_k) {
|
|
3609
|
+
switch (_k.label) {
|
|
3610
|
+
case 0:
|
|
3611
|
+
_k.trys.push([0, 5, 6, 7]);
|
|
3612
|
+
arr_2 = __values(arr), arr_2_1 = arr_2.next();
|
|
3613
|
+
_k.label = 1;
|
|
3614
|
+
case 1:
|
|
3615
|
+
if (!!arr_2_1.done) return [3 /*break*/, 4];
|
|
3616
|
+
e = arr_2_1.value;
|
|
3617
|
+
return [4 /*yield*/, predicate(e)];
|
|
3618
|
+
case 2:
|
|
3619
|
+
if (_k.sent()) {
|
|
3620
|
+
return [2 /*return*/, true];
|
|
3621
|
+
}
|
|
3622
|
+
_k.label = 3;
|
|
3623
|
+
case 3:
|
|
3624
|
+
arr_2_1 = arr_2.next();
|
|
3625
|
+
return [3 /*break*/, 1];
|
|
3626
|
+
case 4: return [3 /*break*/, 7];
|
|
3627
|
+
case 5:
|
|
3628
|
+
e_2_1 = _k.sent();
|
|
3629
|
+
e_2 = { error: e_2_1 };
|
|
3630
|
+
return [3 /*break*/, 7];
|
|
3631
|
+
case 6:
|
|
3632
|
+
try {
|
|
3633
|
+
if (arr_2_1 && !arr_2_1.done && (_j = arr_2.return)) _j.call(arr_2);
|
|
3634
|
+
}
|
|
3635
|
+
finally { if (e_2) throw e_2.error; }
|
|
3636
|
+
return [7 /*endfinally*/];
|
|
3637
|
+
case 7: return [2 /*return*/, false];
|
|
3638
|
+
}
|
|
3639
|
+
});
|
|
3640
|
+
}); };
|
|
3641
|
+
// tslint:disable-next-line:member-ordering
|
|
3642
|
+
this.evaluators = {
|
|
3643
|
+
AND: function (context, args) { return __awaiter(_this, void 0, void 0, function () {
|
|
3644
|
+
var _this = this;
|
|
3645
|
+
return __generator(this, function (_j) {
|
|
3646
|
+
switch (_j.label) {
|
|
3647
|
+
case 0:
|
|
3648
|
+
if (!args || args.length === 0) {
|
|
3649
|
+
return [2 /*return*/, false];
|
|
3650
|
+
}
|
|
3651
|
+
return [4 /*yield*/, this.asyncEvery(args, function (arg) { return __awaiter(_this, void 0, void 0, function () {
|
|
3652
|
+
var evaluator;
|
|
3653
|
+
return __generator(this, function (_j) {
|
|
3654
|
+
switch (_j.label) {
|
|
3655
|
+
case 0: return [4 /*yield*/, context.getEvaluator(arg.value)];
|
|
3656
|
+
case 1:
|
|
3657
|
+
evaluator = _j.sent();
|
|
3658
|
+
if (!evaluator) {
|
|
3659
|
+
console.warn("evaluator not found: " + arg.value);
|
|
3660
|
+
return [2 /*return*/, false];
|
|
3661
|
+
}
|
|
3662
|
+
return [4 /*yield*/, evaluator(context, arg.parameters || [])];
|
|
3663
|
+
case 2: return [2 /*return*/, _j.sent()];
|
|
3664
|
+
}
|
|
3665
|
+
});
|
|
3666
|
+
}); })];
|
|
3667
|
+
case 1: return [2 /*return*/, _j.sent()];
|
|
3668
|
+
}
|
|
3669
|
+
});
|
|
3670
|
+
}); },
|
|
3671
|
+
OR: function (context, args) { return __awaiter(_this, void 0, void 0, function () {
|
|
3672
|
+
var _this = this;
|
|
3673
|
+
return __generator(this, function (_j) {
|
|
3674
|
+
switch (_j.label) {
|
|
3675
|
+
case 0:
|
|
3676
|
+
if (!args || args.length === 0) {
|
|
3677
|
+
return [2 /*return*/, false];
|
|
3678
|
+
}
|
|
3679
|
+
return [4 /*yield*/, this.asyncSome(args, function (arg) { return __awaiter(_this, void 0, void 0, function () {
|
|
3680
|
+
var evaluator, res;
|
|
3681
|
+
return __generator(this, function (_j) {
|
|
3682
|
+
switch (_j.label) {
|
|
3683
|
+
case 0: return [4 /*yield*/, context.getEvaluator(arg.value)];
|
|
3684
|
+
case 1:
|
|
3685
|
+
evaluator = _j.sent();
|
|
3686
|
+
if (!evaluator) {
|
|
3687
|
+
console.warn("evaluator not found: " + arg.value);
|
|
3688
|
+
return [2 /*return*/, false];
|
|
3689
|
+
}
|
|
3690
|
+
return [4 /*yield*/, evaluator(context, arg.parameters || [])];
|
|
3691
|
+
case 2:
|
|
3692
|
+
res = _j.sent();
|
|
3693
|
+
return [2 /*return*/, res];
|
|
3694
|
+
}
|
|
3695
|
+
});
|
|
3696
|
+
}); })];
|
|
3697
|
+
case 1: return [2 /*return*/, _j.sent()];
|
|
3698
|
+
}
|
|
3699
|
+
});
|
|
3700
|
+
}); },
|
|
3701
|
+
isStatus: function (context, args) { return __awaiter(_this, void 0, void 0, function () {
|
|
3702
|
+
return __generator(this, function (_j) {
|
|
3703
|
+
if (args.indexOf(context.entity.state) > -1) {
|
|
3704
|
+
return [2 /*return*/, true];
|
|
3705
|
+
}
|
|
3706
|
+
else {
|
|
3707
|
+
return [2 /*return*/, false];
|
|
3708
|
+
}
|
|
3709
|
+
return [2 /*return*/];
|
|
3710
|
+
});
|
|
3711
|
+
}); },
|
|
3712
|
+
isCreator: function (context, args) { return __awaiter(_this, void 0, void 0, function () {
|
|
3713
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, owner;
|
|
3714
|
+
return __generator(this, function (_j) {
|
|
3715
|
+
if ((_b = (_a = context.entity.properties.owner) === null || _a === void 0 ? void 0 : _a.properties) === null || _b === void 0 ? void 0 : _b.username) {
|
|
3716
|
+
owner = (_d = (_c = context.entity.properties.owner) === null || _c === void 0 ? void 0 : _c.properties) === null || _d === void 0 ? void 0 : _d.username;
|
|
3717
|
+
}
|
|
3718
|
+
else if ((_f = (_e = context.entity.properties["corr:owner"]) === null || _e === void 0 ? void 0 : _e.properties) === null || _f === void 0 ? void 0 : _f.username) {
|
|
3719
|
+
owner = (_h = (_g = context.entity.properties["corr:owner"]) === null || _g === void 0 ? void 0 : _g.properties) === null || _h === void 0 ? void 0 : _h.username;
|
|
3720
|
+
}
|
|
3721
|
+
else if (context.entity.properties.owner) {
|
|
3722
|
+
owner = context.entity.properties.owner;
|
|
3723
|
+
}
|
|
3724
|
+
else if (context.entity.properties["corr:owner"]) {
|
|
3725
|
+
owner = context.entity.properties["corr:owner"];
|
|
3726
|
+
}
|
|
3727
|
+
if (owner === context.user.properties.username) {
|
|
3728
|
+
return [2 /*return*/, true];
|
|
3729
|
+
}
|
|
3730
|
+
else {
|
|
3731
|
+
return [2 /*return*/, false];
|
|
3732
|
+
}
|
|
3733
|
+
return [2 /*return*/];
|
|
3734
|
+
});
|
|
3735
|
+
}); },
|
|
3736
|
+
isUserInrole: function (context, args) { return __awaiter(_this, void 0, void 0, function () {
|
|
3737
|
+
var result;
|
|
3738
|
+
return __generator(this, function (_j) {
|
|
3739
|
+
switch (_j.label) {
|
|
3740
|
+
case 0: return [4 /*yield*/, this.nuxeoService
|
|
3741
|
+
.isUserInRole(args, "")
|
|
3742
|
+
.pipe(operators.first())
|
|
3743
|
+
.toPromise()];
|
|
3744
|
+
case 1:
|
|
3745
|
+
result = _j.sent();
|
|
3746
|
+
return [2 /*return*/, result];
|
|
3747
|
+
}
|
|
3748
|
+
});
|
|
3749
|
+
}); },
|
|
3750
|
+
};
|
|
3751
|
+
this.getEvaluator = function (key) { return __awaiter(_this, void 0, void 0, function () {
|
|
3752
|
+
var eva, fn_1;
|
|
3753
|
+
var _this = this;
|
|
3754
|
+
return __generator(this, function (_j) {
|
|
3755
|
+
eva = this.evaluators;
|
|
3756
|
+
if (key && key.startsWith("!")) {
|
|
3757
|
+
fn_1 = eva[key.substring(1)];
|
|
3758
|
+
return [2 /*return*/, function (context, args) { return __awaiter(_this, void 0, void 0, function () {
|
|
3759
|
+
var result;
|
|
3760
|
+
return __generator(this, function (_j) {
|
|
3761
|
+
switch (_j.label) {
|
|
3762
|
+
case 0: return [4 /*yield*/, fn_1.apply(void 0, __spreadArray([context], __read(args)))];
|
|
3763
|
+
case 1:
|
|
3764
|
+
result = _j.sent();
|
|
3765
|
+
return [2 /*return*/, !result];
|
|
3766
|
+
}
|
|
3767
|
+
});
|
|
3768
|
+
}); }];
|
|
3769
|
+
}
|
|
3770
|
+
return [2 /*return*/, eva[key]];
|
|
3771
|
+
});
|
|
3772
|
+
}); };
|
|
3773
|
+
this.appConfigService.configLoaded.subscribe(function (ready) {
|
|
3774
|
+
if (ready) {
|
|
3775
|
+
_this.conditions = _this.getAllRules();
|
|
3776
|
+
}
|
|
3777
|
+
});
|
|
3778
|
+
}
|
|
3779
|
+
EvaluatorsService.prototype.setEvaluators = function (evaluators) {
|
|
3780
|
+
this.evaluators = Object.assign(Object.assign({}, this.evaluators), evaluators);
|
|
3781
|
+
};
|
|
3782
|
+
EvaluatorsService.prototype.getEvaluators = function () {
|
|
3783
|
+
return this.evaluators;
|
|
3679
3784
|
};
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3785
|
+
// ----------------------------------------------------
|
|
3786
|
+
EvaluatorsService.prototype.evaluateRule = function (ruleId, context) {
|
|
3787
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3788
|
+
var ruleRef, evaluator, evaluator;
|
|
3789
|
+
return __generator(this, function (_j) {
|
|
3790
|
+
switch (_j.label) {
|
|
3791
|
+
case 0:
|
|
3792
|
+
ruleRef = this.getRuleById(ruleId);
|
|
3793
|
+
context = context || this.context;
|
|
3794
|
+
context["getEvaluator"] = this.getEvaluator;
|
|
3795
|
+
if (!ruleRef) return [3 /*break*/, 4];
|
|
3796
|
+
return [4 /*yield*/, this.getEvaluator(ruleRef.type)];
|
|
3797
|
+
case 1:
|
|
3798
|
+
evaluator = _j.sent();
|
|
3799
|
+
if (!evaluator) return [3 /*break*/, 3];
|
|
3800
|
+
return [4 /*yield*/, evaluator(context, ruleRef.parameters)];
|
|
3801
|
+
case 2: return [2 /*return*/, _j.sent()];
|
|
3802
|
+
case 3: return [3 /*break*/, 7];
|
|
3803
|
+
case 4: return [4 /*yield*/, this.getEvaluator(ruleId)];
|
|
3804
|
+
case 5:
|
|
3805
|
+
evaluator = _j.sent();
|
|
3806
|
+
if (!evaluator) return [3 /*break*/, 7];
|
|
3807
|
+
return [4 /*yield*/, evaluator(context)];
|
|
3808
|
+
case 6: return [2 /*return*/, _j.sent()];
|
|
3809
|
+
case 7: return [2 /*return*/];
|
|
3810
|
+
}
|
|
3811
|
+
});
|
|
3812
|
+
});
|
|
3696
3813
|
};
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
HijriGregorianDatepickerComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: HijriGregorianDatepickerComponent, deps: [{ token: DateFormatterService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
3700
|
-
HijriGregorianDatepickerComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.4", type: HijriGregorianDatepickerComponent, selector: "hijri-gregorian-datepicker", inputs: { selectedDateType: "selectedDateType", selectedDate: "selectedDate", label: "label", showLabel: "showLabel", readonly: "readonly", isRequired: "isRequired", disabled: "disabled", disabledbtn: "disabledbtn", minHijri: "minHijri", maxHijri: "maxHijri", minGreg: "minGreg", maxGreg: "maxGreg", hijriLabel: "hijriLabel", GregLabel: "GregLabel", placeHolder: "placeHolder", range: "range", vertical: "vertical" }, outputs: { selectedDateChange: "selectedDateChange" }, viewQueries: [{ propertyName: "datePicker", first: true, predicate: ["d"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div class=\"form-group\" provideParentForm>\r\n <label class=\"requiredInput\" *ngIf=\"showLabel\" for=\"input-birth-Date\">{{ label }} </label>\r\n\r\n <div class=\"input-group\">\r\n <gregorian-date-picker [vertical]=\"vertical\" *ngIf=\"selectedDateType == DateType.Gregorian\" [range]=\"range\"\r\n [(selectedDate)]=\"selectedDate\" (selectedDateChange)=\"dateSelected($event)\" [readonly]=\"readonly\" [min]=\"minGreg\"\r\n [max]=\"maxGreg\" style=\"flex: 1 1 auto;\" [name]=\"label\" [isRequired]=\"isRequired\" [placeHolder]=\"placeHolder\"\r\n [disabled]=\"disabled\">\r\n </gregorian-date-picker>\r\n <hijri-date-picker [vertical]=\"vertical\" *ngIf=\"selectedDateType == DateType.Hijri\" [range]=\"range\"\r\n [(selectedDate)]=\"selectedDate\" (selectedDateChange)=\"dateSelected($event)\" [readonly]=\"readonly\" [min]=\"minHijri\"\r\n [max]=\"maxHijri\" style=\"flex: 1 1 auto;\" [name]=\"label\" [isRequired]=\"isRequired\" [placeHolder]=\"placeHolder\"\r\n [disabled]=\"disabled\">\r\n </hijri-date-picker>\r\n\r\n <div class=\"input-group-append\">\r\n <button class=\"btn btn-sm {{selectedDateType == DateType.Hijri ? 'btn-info focus active' : 'btn-outline-info'}}\"\r\n (click)=\"hijriClick()\" [disabled]=\"disabledbtn\" type=\"button\">\r\n {{hijriLabel ? hijriLabel : 'Hijri' }}\r\n </button>\r\n <button\r\n class=\"btn btn-sm {{selectedDateType == DateType.Gregorian ? 'btn-info focus active' : 'btn-outline-info'}}\"\r\n (click)=\"gregClick()\" [disabled]=\"disabledbtn\" type=\"button\">\r\n {{GregLabel ? GregLabel : 'Gregorian' }}\r\n </button>\r\n </div>\r\n\r\n </div>\r\n</div>\r\n", components: [{ type: GregorianDatepickerComponent, selector: "gregorian-date-picker", inputs: ["selectedDate", "readonly", "isRequired", "disabled", "min", "max", "name", "range", "vertical", "placeHolder"], outputs: ["selectedDateChange"] }, { type: HijriDatepickerComponent, selector: "hijri-date-picker", inputs: ["selectedDate", "readonly", "isRequired", "disabled", "min", "max", "name", "range", "vertical", "placeHolder"], outputs: ["selectedDateChange"] }], directives: [{ type: ProvideParentFormDirective, selector: "[provideParentForm]" }, { type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
3701
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: HijriGregorianDatepickerComponent, decorators: [{
|
|
3702
|
-
type: i0.Component,
|
|
3703
|
-
args: [{
|
|
3704
|
-
selector: 'hijri-gregorian-datepicker',
|
|
3705
|
-
templateUrl: './hijri-gregorian-datepicker.component.html'
|
|
3706
|
-
}]
|
|
3707
|
-
}], ctorParameters: function () { return [{ type: DateFormatterService }]; }, propDecorators: { datePicker: [{
|
|
3708
|
-
type: i0.ViewChild,
|
|
3709
|
-
args: ['d']
|
|
3710
|
-
}], selectedDateType: [{
|
|
3711
|
-
type: i0.Input
|
|
3712
|
-
}], selectedDate: [{
|
|
3713
|
-
type: i0.Input
|
|
3714
|
-
}], selectedDateChange: [{
|
|
3715
|
-
type: i0.Output
|
|
3716
|
-
}], label: [{
|
|
3717
|
-
type: i0.Input
|
|
3718
|
-
}], showLabel: [{
|
|
3719
|
-
type: i0.Input
|
|
3720
|
-
}], readonly: [{
|
|
3721
|
-
type: i0.Input
|
|
3722
|
-
}], isRequired: [{
|
|
3723
|
-
type: i0.Input
|
|
3724
|
-
}], disabled: [{
|
|
3725
|
-
type: i0.Input
|
|
3726
|
-
}], disabledbtn: [{
|
|
3727
|
-
type: i0.Input
|
|
3728
|
-
}], minHijri: [{
|
|
3729
|
-
type: i0.Input
|
|
3730
|
-
}], maxHijri: [{
|
|
3731
|
-
type: i0.Input
|
|
3732
|
-
}], minGreg: [{
|
|
3733
|
-
type: i0.Input
|
|
3734
|
-
}], maxGreg: [{
|
|
3735
|
-
type: i0.Input
|
|
3736
|
-
}], hijriLabel: [{
|
|
3737
|
-
type: i0.Input
|
|
3738
|
-
}], GregLabel: [{
|
|
3739
|
-
type: i0.Input
|
|
3740
|
-
}], placeHolder: [{
|
|
3741
|
-
type: i0.Input
|
|
3742
|
-
}], range: [{
|
|
3743
|
-
type: i0.Input
|
|
3744
|
-
}], vertical: [{
|
|
3745
|
-
type: i0.Input
|
|
3746
|
-
}] } });
|
|
3747
|
-
|
|
3748
|
-
/** @ignore */
|
|
3749
|
-
var NgxHijriGregorianDatepickerModule = /** @class */ (function () {
|
|
3750
|
-
function NgxHijriGregorianDatepickerModule() {
|
|
3751
|
-
}
|
|
3752
|
-
return NgxHijriGregorianDatepickerModule;
|
|
3753
|
-
}());
|
|
3754
|
-
NgxHijriGregorianDatepickerModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: NgxHijriGregorianDatepickerModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
3755
|
-
NgxHijriGregorianDatepickerModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: NgxHijriGregorianDatepickerModule, declarations: [HijriGregorianDatepickerComponent,
|
|
3756
|
-
HijriDatepickerComponent,
|
|
3757
|
-
GregorianDatepickerComponent,
|
|
3758
|
-
ProvideParentFormDirective], imports: [i3.CommonModule,
|
|
3759
|
-
i6.ReactiveFormsModule,
|
|
3760
|
-
i1$1.TranslateModule,
|
|
3761
|
-
i6.FormsModule,
|
|
3762
|
-
i1$4.NgbModule], exports: [HijriGregorianDatepickerComponent] });
|
|
3763
|
-
NgxHijriGregorianDatepickerModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: NgxHijriGregorianDatepickerModule, providers: [
|
|
3764
|
-
{ provide: i1$4.NgbDateParserFormatter, useClass: CustomNgbDateParserFormatter },
|
|
3765
|
-
DateFormatterService
|
|
3766
|
-
], imports: [[
|
|
3767
|
-
i3.CommonModule,
|
|
3768
|
-
i6.ReactiveFormsModule,
|
|
3769
|
-
i1$1.TranslateModule,
|
|
3770
|
-
i6.FormsModule,
|
|
3771
|
-
i1$4.NgbModule
|
|
3772
|
-
]] });
|
|
3773
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: NgxHijriGregorianDatepickerModule, decorators: [{
|
|
3774
|
-
type: i0.NgModule,
|
|
3775
|
-
args: [{
|
|
3776
|
-
declarations: [
|
|
3777
|
-
HijriGregorianDatepickerComponent,
|
|
3778
|
-
HijriDatepickerComponent,
|
|
3779
|
-
GregorianDatepickerComponent,
|
|
3780
|
-
ProvideParentFormDirective
|
|
3781
|
-
],
|
|
3782
|
-
imports: [
|
|
3783
|
-
i3.CommonModule,
|
|
3784
|
-
i6.ReactiveFormsModule,
|
|
3785
|
-
i1$1.TranslateModule,
|
|
3786
|
-
i6.FormsModule,
|
|
3787
|
-
i1$4.NgbModule
|
|
3788
|
-
],
|
|
3789
|
-
providers: [
|
|
3790
|
-
{ provide: i1$4.NgbDateParserFormatter, useClass: CustomNgbDateParserFormatter },
|
|
3791
|
-
DateFormatterService
|
|
3792
|
-
],
|
|
3793
|
-
exports: [HijriGregorianDatepickerComponent]
|
|
3794
|
-
}]
|
|
3795
|
-
}] });
|
|
3796
|
-
|
|
3797
|
-
/** @ignore */
|
|
3798
|
-
var ClickOutsideDirective = /** @class */ (function () {
|
|
3799
|
-
function ClickOutsideDirective(elementRef) {
|
|
3800
|
-
this.elementRef = elementRef;
|
|
3801
|
-
this.clickOutside = new i0.EventEmitter();
|
|
3802
|
-
}
|
|
3803
|
-
ClickOutsideDirective.prototype.onClick = function (target) {
|
|
3804
|
-
var clickedInside = this.elementRef.nativeElement.contains(target);
|
|
3805
|
-
if (!clickedInside) {
|
|
3806
|
-
this.clickOutside.emit(target);
|
|
3807
|
-
}
|
|
3814
|
+
EvaluatorsService.prototype.getRuleById = function (id) {
|
|
3815
|
+
return this.conditions[id] ? Object.assign({}, this.conditions[id]) : null;
|
|
3808
3816
|
};
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
ClickOutsideDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: ClickOutsideDirective, deps: [{ token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
|
3812
|
-
ClickOutsideDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.4", type: ClickOutsideDirective, selector: "[clickOutside]", outputs: { clickOutside: "clickOutside" }, host: { listeners: { "window:click": "onClick($event.target)" } }, ngImport: i0__namespace });
|
|
3813
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: ClickOutsideDirective, decorators: [{
|
|
3814
|
-
type: i0.Directive,
|
|
3815
|
-
args: [{
|
|
3816
|
-
selector: '[clickOutside]'
|
|
3817
|
-
}]
|
|
3818
|
-
}], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }]; }, propDecorators: { clickOutside: [{
|
|
3819
|
-
type: i0.Output
|
|
3820
|
-
}], onClick: [{
|
|
3821
|
-
type: i0.HostListener,
|
|
3822
|
-
args: ['window:click', ['$event.target']]
|
|
3823
|
-
}] } });
|
|
3824
|
-
|
|
3825
|
-
/** @ignore */
|
|
3826
|
-
var SetRtlDirective = /** @class */ (function () {
|
|
3827
|
-
function SetRtlDirective(elRef, renderer, translation) {
|
|
3828
|
-
this.elRef = elRef;
|
|
3829
|
-
this.renderer = renderer;
|
|
3830
|
-
this.translation = translation;
|
|
3831
|
-
this.switchClassBasedOnLanguage();
|
|
3832
|
-
}
|
|
3833
|
-
/*Switch rtl class based on the chosen language from Translation Service*/
|
|
3834
|
-
SetRtlDirective.prototype.switchClassBasedOnLanguage = function () {
|
|
3835
|
-
var _this = this;
|
|
3836
|
-
this.translation.isArabic.subscribe(function (arabic) {
|
|
3837
|
-
arabic
|
|
3838
|
-
? _this.renderer.addClass(_this.elRef.nativeElement, 'rtl')
|
|
3839
|
-
: _this.renderer.removeClass(_this.elRef.nativeElement, 'rtl');
|
|
3840
|
-
});
|
|
3817
|
+
EvaluatorsService.prototype.getAllRules = function () {
|
|
3818
|
+
return this.appConfigService.conditons;
|
|
3841
3819
|
};
|
|
3842
|
-
return
|
|
3820
|
+
return EvaluatorsService;
|
|
3843
3821
|
}());
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type:
|
|
3847
|
-
type: i0.
|
|
3848
|
-
args: [{
|
|
3849
|
-
|
|
3850
|
-
}]
|
|
3851
|
-
}], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.Renderer2 }, { type: TranslationService$1 }]; } });
|
|
3822
|
+
EvaluatorsService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: EvaluatorsService, deps: [{ token: NuxeoService$1 }, { token: AppConfigService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
3823
|
+
EvaluatorsService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: EvaluatorsService, providedIn: "root" });
|
|
3824
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: EvaluatorsService, decorators: [{
|
|
3825
|
+
type: i0.Injectable,
|
|
3826
|
+
args: [{ providedIn: "root" }]
|
|
3827
|
+
}], ctorParameters: function () { return [{ type: NuxeoService$1 }, { type: AppConfigService }]; } });
|
|
3852
3828
|
|
|
3853
3829
|
/**
|
|
3854
3830
|
* Permission directive shows or hides an element,
|
|
@@ -6435,6 +6411,26 @@
|
|
|
6435
6411
|
manager: 'dept:manager',
|
|
6436
6412
|
};
|
|
6437
6413
|
|
|
6414
|
+
var GlobalAdminService = /** @class */ (function () {
|
|
6415
|
+
function GlobalAdminService(evaluatorService) {
|
|
6416
|
+
this.evaluatorService = evaluatorService;
|
|
6417
|
+
this.isGlobalAdmin = false;
|
|
6418
|
+
this.activeTenant = null;
|
|
6419
|
+
}
|
|
6420
|
+
GlobalAdminService.prototype.checkIfGlobalAdmin = function () {
|
|
6421
|
+
return this.evaluatorService.evaluateRule('isGlobalAdmin');
|
|
6422
|
+
};
|
|
6423
|
+
return GlobalAdminService;
|
|
6424
|
+
}());
|
|
6425
|
+
GlobalAdminService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: GlobalAdminService, deps: [{ token: EvaluatorsService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
6426
|
+
GlobalAdminService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: GlobalAdminService, providedIn: 'root' });
|
|
6427
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: GlobalAdminService, decorators: [{
|
|
6428
|
+
type: i0.Injectable,
|
|
6429
|
+
args: [{
|
|
6430
|
+
providedIn: 'root'
|
|
6431
|
+
}]
|
|
6432
|
+
}], ctorParameters: function () { return [{ type: EvaluatorsService }]; } });
|
|
6433
|
+
|
|
6438
6434
|
var departmentCacheBuster$ = new rxjs.Subject();
|
|
6439
6435
|
var minute$1 = 60000;
|
|
6440
6436
|
/** @ignore */
|
|
@@ -7072,7 +7068,7 @@
|
|
|
7072
7068
|
}());
|
|
7073
7069
|
DynamicFormTextItemComponent.DEFAULT_SEPARATOR = ', ';
|
|
7074
7070
|
DynamicFormTextItemComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: DynamicFormTextItemComponent, deps: [{ token: DynamicFormUpdateService }, { token: i1__namespace$1.TranslateService }, { token: i6__namespace.NgControl, optional: true, self: true }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
7075
|
-
DynamicFormTextItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.4", type: DynamicFormTextItemComponent, selector: "app-dynamic-form-textitem", inputs: { autoComplete: "autoComplete", nativeAutoComplete: "nativeAutoComplete", autoComplete_pageProvider: "autoComplete_pageProvider", autoComplete_propertyName: "autoComplete_propertyName", autoComplete_propertyKey: "autoComplete_propertyKey", autoCompleteValueKey: "autoCompleteValueKey", autoCompleteType: "autoCompleteType", tenantId: "tenantId", emitFullObject: "emitFullObject", outsideParams: "outsideParams", type: "type", property: "property", label: "label", editable: "editable", placeholder: "placeholder", disabled: "disabled", displayEmpty: "displayEmpty", preventSpace: "preventSpace", id: "id", maxCharsNum: "maxCharsNum" }, viewQueries: [{ propertyName: "editorInput", first: true, predicate: ["editorInput"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div class=\"app-property-value\">\r\n <div class=\"app-input-wrapper\">\r\n <label *ngIf=\"label\" for=\"formGroupInputSmall\"\r\n >{{ label | translate\r\n }}<span *ngIf=\"isRequired()\" class=\"text-danger m-1\">*</span></label\r\n >\r\n <div class=\"\">\r\n <ng-container *ngIf=\"isEditable(); else readOnly\">\r\n <div class=\"new-one\" (clickOutside)=\"openOptions(false)\">\r\n <input\r\n \r\n [id]=\"id\"\r\n [attr.disabled]=\"isDisabled() || null\"\r\n [type]=\"type\"\r\n class=\"form-control\"\r\n [ngClass]=\"{'input-filled' : (emitFullObject ? editedValue
|
|
7071
|
+
DynamicFormTextItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.4", type: DynamicFormTextItemComponent, selector: "app-dynamic-form-textitem", inputs: { autoComplete: "autoComplete", nativeAutoComplete: "nativeAutoComplete", autoComplete_pageProvider: "autoComplete_pageProvider", autoComplete_propertyName: "autoComplete_propertyName", autoComplete_propertyKey: "autoComplete_propertyKey", autoCompleteValueKey: "autoCompleteValueKey", autoCompleteType: "autoCompleteType", tenantId: "tenantId", emitFullObject: "emitFullObject", outsideParams: "outsideParams", type: "type", property: "property", label: "label", editable: "editable", placeholder: "placeholder", disabled: "disabled", displayEmpty: "displayEmpty", preventSpace: "preventSpace", id: "id", maxCharsNum: "maxCharsNum" }, viewQueries: [{ propertyName: "editorInput", first: true, predicate: ["editorInput"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div class=\"app-property-value\">\r\n <div class=\"app-input-wrapper\">\r\n <label *ngIf=\"label\" for=\"formGroupInputSmall\"\r\n >{{ label | translate\r\n }}<span *ngIf=\"isRequired()\" class=\"text-danger m-1\">*</span></label\r\n >\r\n <div class=\"\">\r\n <ng-container *ngIf=\"isEditable(); else readOnly\">\r\n <div class=\"new-one\" (clickOutside)=\"openOptions(false)\">\r\n <input\r\n \r\n [id]=\"id\"\r\n [attr.disabled]=\"isDisabled() || null\"\r\n [type]=\"type\"\r\n class=\"form-control\"\r\n [ngClass]=\"{'input-filled' : (emitFullObject ? (editedValue?.title) : editedValue) }\"\r\n (keydown.space)=\"allowSpace($event)\"\r\n #editorInput\r\n [required]=\"isRequired()\"\r\n [(ngModel)]=\"emitFullObject ? editedValue?.title : editedValue\"\r\n [autocomplete]=\"nativeAutoComplete\"\r\n (ngModelChange)=\"update($event)\"\r\n (keyup)=\"waitUntilUserFinishTyping()\"\r\n [attr.data-automation-id]=\"'card-textitem-editinput-'\"\r\n placeholder=\"{{ placeholder | translate }}\"\r\n (focus)=\"openOptions(true)\"\r\n maxlength=\"{{maxCharsNum}}\"\r\n />\r\n <div *ngIf=\"documentList.length !== 0\" id=\"suggestedoptions\">\r\n <div\r\n class=\"suggestions-wrapper\"\r\n [ngClass]=\"{ 'd-block': showsuggestedOptions }\"\r\n >\r\n <div\r\n class=\"option\"\r\n id=\"suggestedoptions\"\r\n *ngFor=\"let option of documentList\"\r\n (click)=\"selectItem(option)\"\r\n >\r\n {{ option.title }}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <mat-error\r\n [attr.data-automation-id]=\"'card-textitem-error-'\"\r\n class=\"app-textitem-editable-error\"\r\n *ngIf=\"hasErrors()\"\r\n >\r\n <ul>\r\n <li *ngIf=\"control.errors.required\">\r\n {{ label | translate }} {{ \"VALIDATORS.REQUIRED\" | translate }}\r\n </li>\r\n <li *ngIf=\"control.errors.pattern\">\r\n {{ \"wrong pattern\" | translate }}\r\n </li>\r\n <li *ngIf=\"control.errors.min\">\r\n {{ \"VALIDATORS.MIN\" | translate }} {{ control.errors.min.min }}\r\n </li>\r\n </ul>\r\n </mat-error>\r\n </ng-container>\r\n <ng-template #readOnly>\r\n {{ emitFullObject ? editedValue?.title : editedValue }}\r\n </ng-template>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".app-property-value .input-filled{border-color:#1a96c6!important}.app-property-value .app-input-wrapper label{color:#8f98aa;font-size:12px;margin-bottom:0}.app-property-value .app-input-wrapper .form-control{border:1px solid #ccc;background-color:#8f98aa1a;border-radius:0;height:40px}.app-property-value .app-input-wrapper .form-control:disabled{background-color:#e9ecef!important}.app-property-value .app-input-wrapper .app-textitem-editable-error ul{list-style:none;padding:0;margin:0;font-size:14px}.app-property-value .app-input-wrapper .app-textitem-editable-error ul li{margin-top:5px}.app-property-value .app-input-wrapper .new-one{position:relative}.app-property-value .app-input-wrapper .suggestions-wrapper{border-radius:3px;height:auto;max-height:240px;border:1px solid #ccc;box-shadow:2px 2px 2px #0000000f;overflow:auto;display:none;position:absolute;width:100%;background-color:#fff;z-index:99}.app-property-value .app-input-wrapper .suggestions-wrapper .option{margin-bottom:5px;padding:5px 10px;cursor:pointer}.app-property-value .app-input-wrapper .suggestions-wrapper .option:hover{background-color:#f5faff}\n"], directives: [{ type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: ClickOutsideDirective, selector: "[clickOutside]", outputs: ["clickOutside"] }, { type: i6__namespace.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i3__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i6__namespace.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i6__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i6__namespace.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i6__namespace.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { type: i3__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace$2.MatError, selector: "mat-error", inputs: ["id"] }], pipes: { "translate": i1__namespace$1.TranslatePipe }, encapsulation: i0__namespace.ViewEncapsulation.None });
|
|
7076
7072
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: DynamicFormTextItemComponent, decorators: [{
|
|
7077
7073
|
type: i0.Component,
|
|
7078
7074
|
args: [{
|
|
@@ -7860,13 +7856,14 @@
|
|
|
7860
7856
|
*/
|
|
7861
7857
|
var TreeviewSelectComponent = /** @class */ (function () {
|
|
7862
7858
|
// this component is used in two places the flag is this.treeview
|
|
7863
|
-
function TreeviewSelectComponent(i18n, translation, departmentApiService, departmentManagment, rolesService, nuxeoService) {
|
|
7859
|
+
function TreeviewSelectComponent(i18n, translation, departmentApiService, departmentManagment, rolesService, nuxeoService, globalAdmin) {
|
|
7864
7860
|
this.i18n = i18n;
|
|
7865
7861
|
this.translation = translation;
|
|
7866
7862
|
this.departmentApiService = departmentApiService;
|
|
7867
7863
|
this.departmentManagment = departmentManagment;
|
|
7868
7864
|
this.rolesService = rolesService;
|
|
7869
7865
|
this.nuxeoService = nuxeoService;
|
|
7866
|
+
this.globalAdmin = globalAdmin;
|
|
7870
7867
|
this.multipleSelection = [];
|
|
7871
7868
|
this.selectedParentWithChild = [];
|
|
7872
7869
|
this.showPlus = false;
|
|
@@ -7953,7 +7950,12 @@
|
|
|
7953
7950
|
};
|
|
7954
7951
|
TreeviewSelectComponent.prototype.selectDefault = function () {
|
|
7955
7952
|
var _this = this;
|
|
7956
|
-
|
|
7953
|
+
var option = {
|
|
7954
|
+
'isGlobalAdmin': this.globalAdmin.isGlobalAdmin,
|
|
7955
|
+
'activeTenant': this.globalAdmin.activeTenant,
|
|
7956
|
+
'tenantId': this.nuxeoService.nuxeoClient.user.properties.tenantId
|
|
7957
|
+
};
|
|
7958
|
+
this.myDepartment = this.rolesService.getUserDepartment(this.nuxeoService.nuxeoClient.user, 'cts_role_', option);
|
|
7957
7959
|
this.items.map(function (item) {
|
|
7958
7960
|
_this.setPreSeletedItem(item, _this.myDepartment);
|
|
7959
7961
|
});
|
|
@@ -8102,7 +8104,7 @@
|
|
|
8102
8104
|
};
|
|
8103
8105
|
return TreeviewSelectComponent;
|
|
8104
8106
|
}());
|
|
8105
|
-
TreeviewSelectComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: TreeviewSelectComponent, deps: [{ token: i1__namespace$2.TreeviewI18n }, { token: TranslationService$1 }, { token: DepartmentApiService }, { token: DepartmentManagementService$1 }, { token: RolesService$1 }, { token: NuxeoService$1 }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
8107
|
+
TreeviewSelectComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: TreeviewSelectComponent, deps: [{ token: i1__namespace$2.TreeviewI18n }, { token: TranslationService$1 }, { token: DepartmentApiService }, { token: DepartmentManagementService$1 }, { token: RolesService$1 }, { token: NuxeoService$1 }, { token: GlobalAdminService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
8106
8108
|
TreeviewSelectComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.4", type: TreeviewSelectComponent, selector: "app-dynamic-form-treeview-select", inputs: { treeview: "treeview", treeViewAsFormControl: "treeViewAsFormControl", config: "config", items: "items", value: "value", multiple: "multiple", defaultSelect: "defaultSelect", pp_departmentNestedTree: "pp_departmentNestedTree", useCustomAddEditAction: "useCustomAddEditAction", customPrefix: "customPrefix", customParentProperty: "customParentProperty", placeholder: "placeholder" }, outputs: { valueChange: "valueChange", plusClicked: "plusClicked", actionClicked: "actionClicked" }, providers: [{ provide: i1$2.TreeviewI18n, useClass: DropdownTreeviewSelectI18n }], viewQueries: [{ propertyName: "dropdownTreeviewComponent", first: true, predicate: i1$2.DropdownTreeviewComponent, descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<ng-template\r\n #itemTemplate\r\n let-item=\"item\"\r\n let-onCollapseExpand=\"onCollapseExpand\"\r\n let-onCheckedChange=\"onCheckedChange\"\r\n>\r\n <!-- single -->\r\n <div *ngIf=\"!treeview && !multiple\">\r\n <div\r\n class=\"text-nowrap row-item\"\r\n [ngClass]=\"{ active: item.value === this.value }\"\r\n >\r\n <i\r\n *ngIf=\"item.children\"\r\n (click)=\"onCollapseExpand()\"\r\n aria-hidden=\"true\"\r\n [ngSwitch]=\"item.collapsed\"\r\n >\r\n <span\r\n *ngSwitchCase=\"true\"\r\n class=\"bi bi-caret-{{ arabic ? 'left' : 'right' }}-fill caret-icon\"\r\n ></span>\r\n <span\r\n *ngSwitchCase=\"false\"\r\n class=\"bi bi-caret-down-fill caret-icon\"\r\n ></span>\r\n </i>\r\n <!-- <label class=\"form-check-label\" (click)=\"select(item)\">{{\r\n item.text\r\n }}</label> -->\r\n <label *ngIf=\"item.disabled\" class=\"form-check-label\">{{\r\n item.text\r\n }}</label>\r\n <label *ngIf=\"!item.disabled\" class=\"form-check-label\" (click)=\"select(item)\">{{\r\n item.text\r\n }}</label>\r\n </div>\r\n </div>\r\n <!-- Multiple -->\r\n <div *ngIf=\"!treeview && multiple\">\r\n <div\r\n class=\"text-nowrap row-item\"\r\n [ngClass]=\"{ active: item.value === this.value }\"\r\n >\r\n <i\r\n *ngIf=\"item.children\"\r\n (click)=\"onCollapseExpand()\"\r\n aria-hidden=\"true\"\r\n [ngSwitch]=\"item.collapsed\"\r\n >\r\n <span\r\n *ngSwitchCase=\"true\"\r\n class=\"bi bi-caret-{{ arabic ? 'left' : 'right' }}-fill caret-icon\"\r\n ></span>\r\n <span\r\n *ngSwitchCase=\"false\"\r\n class=\"bi bi-caret-down-fill caret-icon\"\r\n ></span>\r\n </i>\r\n <!-- <input\r\n class=\"multiple-checkBox\"\r\n type=\"checkbox\"\r\n [checked]=\"multipleSelection.includes(item.value)\"\r\n (change)=\"selectMultiple($event.target.checked, item)\"\r\n />\r\n\r\n <label class=\"form-check-label\">{{ item.text }}</label> -->\r\n <div class=\"multiple-treeview\">\r\n <mat-checkbox\r\n [checked]=\"multipleSelection.includes(item.value)\"\r\n (change)=\"selectMultiple($event.checked, item)\"\r\n >\r\n <span> {{ item.text }} </span>\r\n </mat-checkbox>\r\n </div>\r\n </div>\r\n </div>\r\n <!-- treeView -->\r\n <div *ngIf=\"treeview && !treeViewAsFormControl\" class=\"tree-view-container\">\r\n <div\r\n (mouseenter)=\"hoverField.style.display = 'flex'\"\r\n (mouseleave)=\"hoverField.style.display = 'none'\"\r\n class=\"text-nowrap row-item treeview-row\"\r\n [ngClass]=\"{ selected: item.value == selectedItem }\"\r\n >\r\n <i\r\n *ngIf=\"item.children\"\r\n (click)=\"onCollapsed(item)\"\r\n aria-hidden=\"true\"\r\n [ngSwitch]=\"item.collapsed\"\r\n >\r\n <span\r\n *ngSwitchCase=\"true\"\r\n class=\"bi bi-caret-{{ arabic ? 'left' : 'right' }}-fill caret-icon\"\r\n ></span>\r\n\r\n <span\r\n *ngSwitchCase=\"false\"\r\n class=\"bi bi-caret-down-fill caret-icon\"\r\n ></span>\r\n </i>\r\n <label class=\"form-check-label-treeview\" (click)=\"select(item)\"\r\n >{{ item.text }}\r\n <span #hoverField class=\"hoverField\">\r\n <span\r\n type=\"button\"\r\n matTooltip=\"{{ 'department_management.form.edit' | translate }}\"\r\n (click)=\"onAction($event, 'update', item)\"\r\n >\r\n <li class=\"bi bi-pencil\"></li>\r\n </span>\r\n\r\n <span\r\n type=\"button\"\r\n matTooltip=\"{{\r\n 'department_management.form.toolTip_message' | translate\r\n }}\"\r\n (click)=\"onAction($event, 'add', item)\"\r\n >\r\n <li class=\"bi bi-plus\"></li>\r\n </span>\r\n </span>\r\n </label>\r\n </div>\r\n </div>\r\n <!-- treeView as form control -->\r\n <div *ngIf=\"treeview && treeViewAsFormControl\" class=\"tree-view-container\">\r\n <div\r\n class=\"text-nowrap row-item treeview-row-form-control\"\r\n [ngClass]=\"{ 'selected-form-control': item.value == selectedItem }\"\r\n >\r\n <i\r\n *ngIf=\"item.children\"\r\n (click)=\"onCollapsed(item)\"\r\n aria-hidden=\"true\"\r\n [ngSwitch]=\"item.collapsed\"\r\n >\r\n <span\r\n *ngSwitchCase=\"true\"\r\n class=\"bi bi-caret-{{ arabic ? 'left' : 'right' }}-fill caret-icon\"\r\n ></span>\r\n \r\n <span\r\n *ngSwitchCase=\"false\"\r\n class=\"bi bi-caret-down-fill caret-icon\"\r\n ></span>\r\n </i>\r\n <label class=\"form-check-label-treeview\" (click)=\"select(item)\"\r\n >{{ item.text }}\r\n </label>\r\n </div>\r\n </div>\r\n</ng-template>\r\n<ng-template\r\n #headerTemplate\r\n let-config=\"config\"\r\n let-item=\"item\"\r\n let-onCollapseExpand=\"onCollapseExpand\"\r\n let-onCheckedChange=\"onCheckedChange\"\r\n let-onFilterTextChange=\"onFilterTextChange\"\r\n>\r\n <div *ngIf=\"config.hasFilter\" class=\"row row-filter\">\r\n <div class=\"col-12\">\r\n <input\r\n class=\"form-control\"\r\n type=\"text\"\r\n [placeholder]=\"i18n.getFilterPlaceholder(placeholder)\"\r\n [(ngModel)]=\"filterText\"\r\n (ngModelChange)=\"onFilterTextChange($event)\"\r\n />\r\n </div>\r\n </div>\r\n <div *ngIf=\"config.hasAllCheckBox || config.hasCollapseExpand\" class=\"row\">\r\n <div class=\"col-12\">\r\n <label *ngIf=\"config.hasAllCheckBox\" (click)=\"select(item)\">\r\n <strong>{{ i18n.getAllCheckboxText() }}</strong>\r\n </label>\r\n <label\r\n *ngIf=\"config.hasCollapseExpand\"\r\n class=\"float-right\"\r\n (click)=\"onCollapseExpand()\"\r\n >\r\n <i\r\n [title]=\"i18n.getTooltipCollapseExpandText(item.collapsed)\"\r\n aria-hidden=\"true\"\r\n [ngSwitch]=\"item.collapsed\"\r\n >\r\n <span *ngSwitchCase=\"true\" class=\"bi bi-arrows-angle-expand\"></span>\r\n <span\r\n *ngSwitchCase=\"false\"\r\n class=\"bi bi-arrows-angle-contract\"\r\n ></span>\r\n </i>\r\n </label>\r\n </div>\r\n </div>\r\n <a *ngIf=\"defaultSelect\" class=\"select-default\" (click)=\"selectDefault()\">{{'department_management.selectDefault'| translate}}</a>\r\n <div *ngIf=\"config.hasDivider\" class=\"dropdown-divider\" [ngClass]=\"{'dropdown-divider-noMargin': defaultSelect}\"></div>\r\n</ng-template>\r\n\r\n<ng-container *ngIf=\"!treeview && !multiple\">\r\n <ngx-dropdown-treeview\r\n [config]=\"config\"\r\n [headerTemplate]=\"headerTemplate\"\r\n [items]=\"items\"\r\n [itemTemplate]=\"itemTemplate\"\r\n >\r\n </ngx-dropdown-treeview\r\n></ng-container>\r\n<ng-container *ngIf=\"!treeview && multiple\">\r\n <div class=\"multiple-tree-view\">\r\n <ngx-dropdown-treeview\r\n [config]=\"config\"\r\n [items]=\"items\"\r\n [itemTemplate]=\"itemTemplate\"\r\n >\r\n </ngx-dropdown-treeview>\r\n </div>\r\n</ng-container>\r\n<ng-container *ngIf=\"treeview && !treeViewAsFormControl\">\r\n <div class=\"tree-view\">\r\n <ngx-treeview\r\n [config]=\"config\"\r\n [headerTemplate]=\"headerTemplate\"\r\n [items]=\"items\"\r\n [itemTemplate]=\"itemTemplate\"\r\n >\r\n </ngx-treeview>\r\n </div>\r\n</ng-container>\r\n<ng-container *ngIf=\"treeview && treeViewAsFormControl\">\r\n <div class=\"tree-view-form-control\">\r\n <ngx-treeview\r\n [config]=\"config\"\r\n [headerTemplate]=\"headerTemplate\"\r\n [items]=\"items\"\r\n [itemTemplate]=\"itemTemplate\"\r\n >\r\n </ngx-treeview>\r\n </div>\r\n</ng-container>\r\n", styles: [".bi{margin:0!important}.memo-sorting-wrapper{width:265px;margin:0 10px;height:100%;display:flex}.memo-sorting-wrapper .sorting-direction{width:65px;height:40px;background-color:#465573;color:#fff;font-size:20px;display:flex;justify-content:center;align-items:center;cursor:pointer}.memo-sorting-wrapper .memo-sorting-trigger{width:calc(100% - 65px);height:100%;background-color:transparent;border:1px solid lightgrey;display:flex;justify-content:space-between;align-items:center;padding:0 15px;font-size:14px}.memo-sorting-wrapper .memo-sorting-trigger i{font-size:16px;color:gray}.memo-sorting-menu{width:200px}.my-button{border:1px solid #465573;color:#465573;border-radius:5px;background-color:transparent;font-weight:bold;min-width:80px;height:40px}.my-button.reset{border:none}.my-button:hover{color:#fff;background-color:#465573}.my-button:hover.reset{color:#465573;border:1px solid #465573;background-color:#fff}.app-property-value .app-input-wrapper label{color:#646f85;font-size:13px;margin-bottom:5px}.app-property-value .app-input-wrapper label .text-danger{font-size:16px;line-height:14px;margin:0 5px!important}.app-property-value .app-input-wrapper .form-control{border:1px solid #ccc;border-radius:5px;background-color:#8f98aa1a;height:40px}.app-property-value .app-input-wrapper .form-control:disabled{background-color:#e9ecef!important}.app-property-value .app-input-wrapper .form-control:focus{border:1px solid #1a96c6;box-shadow:0 0 4px #79c3c26b!important}.app-property-value .app-input-wrapper .app-textitem-editable-error .error-containers{list-style:none;padding:0;margin:0;font-size:14px}.app-property-value .app-input-wrapper .app-textitem-editable-error .error-containers .error{margin-top:5px}.autocomplete-container .input-container input:focus,hijri-gregorian-datepicker .form-group .input-group .form-control:focus,.ng-select.ng-select-focused .ng-select-container{border:1px solid #1a96c6!important;box-shadow:0 0 4px #79c3c26b!important}input::placeholder{font-size:12px}.form-control:focus{box-shadow:none!important}.mat-stepper-horizontal{margin-top:-25px}.mat-stepper-horizontal .mat-horizontal-stepper-header-container .mat-step-header.cdk-program-focused{background-color:transparent}.mat-stepper-horizontal .mat-horizontal-stepper-header-container .mat-step-header .mat-step-icon-selected{background-color:transparent;color:#fff;background-image:linear-gradient(to right,#0dbab5,#1a96c6)}@media only screen and (max-width: 576px){.mat-stepper-horizontal .mat-horizontal-stepper-header-container .mat-step-header .mat-step-label .mat-step-text-label{white-space:pre-wrap;overflow:visible}}.mat-stepper-horizontal .mat-horizontal-content-container{overflow:visible}@media only screen and (max-width: 768px){.mat-stepper-horizontal .mat-horizontal-content-container{padding:0 0 24px}}.mat-stepper-horizontal.rtl .mat-horizontal-stepper-header:first-child:after,.mat-stepper-horizontal.rtl .mat-horizontal-stepper-header:last-child:before{display:none}.mat-stepper-horizontal.rtl .mat-horizontal-stepper-header:first-child:before{border-top-width:1px;border-top-style:solid;content:\"\";display:inline-block;height:0;position:absolute;width:calc(50% - 20px);left:0}.mat-stepper-horizontal.rtl .mat-horizontal-stepper-header:last-child:after{border-top-width:1px;border-top-style:solid;content:\"\";display:inline-block;height:0;position:absolute;width:calc(50% - 20px);right:0}.form-wrapper{padding:30px 15px;border:1px solid #dde0e2}.form-wrapper .buttons-wrapper{display:flex;justify-content:space-between}.form-wrapper .buttons-wrapper .action-buttons-wrapper{display:flex}.form-wrapper .buttons-wrapper button{background-image:linear-gradient(to right,#0dbab5,#1a96c6);height:40px;color:#fff;border:none;width:125px;margin-top:20px;border-radius:5px}.form-wrapper .buttons-wrapper button:disabled{opacity:.4;cursor:not-allowed}.form-wrapper .buttons-wrapper button:hover{opacity:.7}.form-wrapper .upload-wrapper{display:flex;flex-direction:column;justify-content:flex-end}.form-wrapper .upload-wrapper label{color:#8f98aa;font-size:14px}.form-wrapper .upload-wrapper button{padding:10px;border:1px solid lightgray}.form-wrapper .upload-wrapper button span{margin:0 10px}.renameFileComponent .form-wrapper{padding:30px 15px;border:none!important}.renameFileComponent .form-wrapper .buttons-wrapper{display:flex;justify-content:space-between}.renameFileComponent .form-wrapper .buttons-wrapper .action-buttons-wrapper{display:flex}.renameFileComponent .form-wrapper .buttons-wrapper button{background-image:linear-gradient(to right,#0dbab5,#1a96c6);height:40px;color:#fff;border:none;width:125px;margin-top:20px;border-radius:5px}.renameFileComponent .form-wrapper .buttons-wrapper button:disabled{opacity:.4;cursor:not-allowed}.renameFileComponent .form-wrapper .buttons-wrapper button:hover{opacity:.7}.renameFileComponent .form-wrapper .upload-wrapper{display:flex;flex-direction:column;justify-content:flex-end}.renameFileComponent .form-wrapper .upload-wrapper label{color:#8f98aa;font-size:14px}.renameFileComponent .form-wrapper .upload-wrapper button{padding:10px;border:1px solid lightgray}.renameFileComponent .form-wrapper .upload-wrapper button span{margin:0 10px}.my-dynamic-viewer{display:flex;align-items:center;font-size:12px;min-height:30px}.my-dynamic-viewer .my-label{font-size:12px;font-weight:500;width:150px;word-break:break-word}@media (max-width: 992px){.my-dynamic-viewer .my-label{width:50%}}.my-dynamic-viewer .my-value{width:calc(100% - 150px);word-break:break-word}@media (max-width: 992px){.my-dynamic-viewer .my-value{width:50%}}.my-dynamic-viewer .direction-img{font-size:14px}.my-dynamic-viewer .direction-img .incoming{display:none}.my-dynamic-viewer .direction-img .outgoing{display:none}.my-dynamic-viewer .direction-img .internal{display:none}.my-dynamic-viewer.draft .my-value{color:#596973}.my-dynamic-viewer.inProgress .my-value{color:#3c3cf0}.my-dynamic-viewer.registered .my-value{color:#4f008c}.my-dynamic-viewer.archived .my-value{color:#fbb62c}.my-dynamic-viewer.closed .my-value{color:#00dca5}.my-dynamic-viewer.approved .my-value{color:#06a57e}.my-dynamic-viewer.assigned .my-value{color:#fd6670}.my-dynamic-viewer.sent .my-value{color:#3c3cf0}.my-dynamic-viewer.published .my-value{color:#00dca5}.my-dynamic-viewer.Outgoing .my-value{display:flex}.my-dynamic-viewer.Outgoing .my-value .direction-img .outgoing{color:#fbb62c;margin:1px 5px;display:flex}.my-dynamic-viewer.Outgoing .my-value .text{margin:0 5px}.my-dynamic-viewer.Internal .my-value{display:flex}.my-dynamic-viewer.Internal .my-value .direction-img .internal{color:#3c3cf0;margin:1px 5px;display:flex}.my-dynamic-viewer.Internal .my-value .text{margin:0 5px}.my-dynamic-viewer.Incoming .my-value{display:flex}.my-dynamic-viewer.Incoming .my-value .direction-img .incoming{color:#00dca5;display:flex}.my-dynamic-viewer.Incoming .my-value .text{margin:-3px 5px 0}.my-dynamic-viewer.vertical{display:block}.my-dynamic-viewer.vertical .my-label{width:auto}.my-dynamic-viewer.vertical .my-value{width:auto}.my-dynamic-viewer.with-out-label{width:100%!important}.caret-icon{color:#6c757d;font-size:14px}.multiple-treeview .mat-checkbox-ripple .mat-ripple-element,.multiple-treeview .mat-checkbox-checked.mat-accent .mat-checkbox-background{background-color:#33e3b7!important}.multiple-treeview .mat-checkbox-ripple .mat-ripple-element{position:fixed;left:inherit;top:inherit;transform:translate(-3px,-3px)!important}.multiple-treeview mat-checkbox .mat-checkbox-background{background-color:#d9dce2!important}.form-check-label-treeview{display:flex;align-items:center;justify-content:space-between;width:100%}.form-check-label-treeview .hoverField{display:none;align-items:center;text-align:center}.form-check-label-treeview .hoverField span{display:flex;align-items:center;justify-content:center;margin:0 3px;border:none;background-color:snow;background-image:linear-gradient(to right,#0dbab5,#1a96c6);height:30px;width:30px;color:#fff;border-radius:5px;list-style:none;margin-inline-end:4px}.form-check-label-treeview .hoverField span .bi-plus{font-size:28px;display:flex;justify-content:center}.form-check-label-treeview .hoverField .add-btn{width:164px;padding:1px;display:flex;justify-content:center;align-items:center;font-size:13px;background-color:#0dbab5;border-radius:5px;border:0;color:#fff;--tw-shadow: 0 1px 3px 0 rgba(0, 0, 0, .1), 0 1px 2px 0 rgba(0, 0, 0, .06);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.form-check-label-treeview .hoverField .plus-btn{display:flex;font-size:28px;align-items:center}.selected{background-color:#f5f6f8}.selected .hoverField{display:flex!important}.selected-form-control{background-color:#d9dce2}.selected-form-control .hoverField{display:flex!important}.treeview-item .row-item{display:flex;align-items:center;padding:5px 10px}.treeview-item .row-item .multiple-checkBox{margin-inline-start:4px;margin-inline-end:4px}.treeview-item .active{background-color:#f5f6f8}.treeview-row{display:flex;align-items:center}.treeview-row:hover{background-color:#f5f6f8}.treeview-row-form-control{display:flex;align-items:center}.treeview-row-form-control:hover{background-color:#d9dce2}label{margin-bottom:0;cursor:pointer}.bi{cursor:pointer;margin-right:.3rem}ngx-treeview .treeview-container{max-height:200px!important;overflow-x:hidden;scrollbar-color:#b4bac6 transparent!important;scrollbar-width:thin!important;overflow-y:auto}ngx-treeview .select-default{display:flex;justify-content:start;font-size:13px;cursor:pointer;margin-bottom:3px;margin-top:4px}ngx-treeview .dropdown-divider-noMargin{margin-top:0!important}.tree-view ngx-treeview .treeview-container{max-height:500px!important;overflow-x:hidden}.tree-view-form-control ngx-treeview .treeview-container{max-height:300px!important;overflow-x:hidden}ngx-dropdown-treeview .dropdown .dropdown-menu{margin-top:0!important;width:100%}ngx-dropdown-treeview .dropdown .btn-outline-secondary{background-color:#8f98aa1a;border:none!important}ngx-dropdown-treeview .dropdown .btn-outline-secondary:hover{color:#6c757d!important}ngx-dropdown-treeview .dropdown .btn-outline-secondary:focus{box-shadow:none!important}ngx-dropdown-treeview .dropdown .btn-outline-secondary:active{background-color:#8f98aa1a!important;border:none!important;color:#6c757d!important}ngx-dropdown-treeview .dropdown:after{position:static!important}ngx-dropdown-treeview .show .dropdown-toggle{background-color:#8f98aa1a!important;border:none!important;color:#6c757d!important}.rtl .treeview-item .treeview-item{margin-right:2rem!important;margin-left:0!important}.rtl .row-all .col-12{text-align:right}.rtl .row-all .col-12 .pull-right{float:left!important}.rtl .form-check.form-check-inline{margin-right:0!important}.rtl .btn.dropdown-toggle{margin-right:0!important}.rtl .dropdown-menu:not(ngb-datepicker){right:0px;left:unset}.rtl .dropdown :after{margin-top:.6rem;left:.6rem;right:unset!important}.rtl ngx-treeview-item{text-align:right;direction:rtl}@media (min-width: 576px){.rtl .form-inline .form-check-input{margin:3px}}.rtl .form-inline .form-check-input{margin:3px;position:inherit}.rtl .dropdown button{text-align:right!important;direction:rtl}.rtl .fa.fa-caret-right{transform:rotate(180deg)}\n"], components: [{ type: i7__namespace.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "id", "labelPosition", "name", "required", "checked", "disabled", "indeterminate", "aria-describedby", "value"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { type: i1__namespace$2.DropdownTreeviewComponent, selector: "ngx-dropdown-treeview", inputs: ["buttonClass", "config", "headerTemplate", "itemTemplate", "items"], outputs: ["selectedChange", "filterChange"] }, { type: i1__namespace$2.TreeviewComponent, selector: "ngx-treeview", inputs: ["config", "headerTemplate", "itemTemplate", "items"], outputs: ["selectedChange", "filterChange"] }], directives: [{ type: i3__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i8__namespace$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltipPosition", "matTooltipDisabled", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { type: i6__namespace.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i6__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i6__namespace.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], pipes: { "translate": i1__namespace$1.TranslatePipe }, encapsulation: i0__namespace.ViewEncapsulation.None });
|
|
8107
8109
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0__namespace, type: TreeviewSelectComponent, decorators: [{
|
|
8108
8110
|
type: i0.Component,
|
|
@@ -8113,7 +8115,7 @@
|
|
|
8113
8115
|
encapsulation: i0.ViewEncapsulation.None,
|
|
8114
8116
|
providers: [{ provide: i1$2.TreeviewI18n, useClass: DropdownTreeviewSelectI18n }],
|
|
8115
8117
|
}]
|
|
8116
|
-
}], ctorParameters: function () { return [{ type: i1__namespace$2.TreeviewI18n }, { type: TranslationService$1 }, { type: DepartmentApiService }, { type: DepartmentManagementService$1 }, { type: RolesService$1 }, { type: NuxeoService$1 }]; }, propDecorators: { treeview: [{
|
|
8118
|
+
}], ctorParameters: function () { return [{ type: i1__namespace$2.TreeviewI18n }, { type: TranslationService$1 }, { type: DepartmentApiService }, { type: DepartmentManagementService$1 }, { type: RolesService$1 }, { type: NuxeoService$1 }, { type: GlobalAdminService }]; }, propDecorators: { treeview: [{
|
|
8117
8119
|
type: i0.Input
|
|
8118
8120
|
}], treeViewAsFormControl: [{
|
|
8119
8121
|
type: i0.Input
|