@firestitch/app-acl 12.2.0 → 12.3.2

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.
Files changed (53) hide show
  1. package/app/components/acl-entries/acl-entries.component.d.ts +32 -32
  2. package/app/components/acl-entry/acl-entry.component.d.ts +31 -29
  3. package/app/components/acl-object-roles/acl-object-roles.component.d.ts +18 -18
  4. package/app/components/acl-permission-popover/acl-permission-popover.component.d.ts +12 -12
  5. package/app/components/acl-role/acl-role.component.d.ts +46 -46
  6. package/app/components/acl-role-popover/acl-role-popover.component.d.ts +13 -13
  7. package/app/components/acl-roles/acl-roles.component.d.ts +35 -35
  8. package/app/consts/acl-role-accesses.d.ts +5 -5
  9. package/app/enums/acl-role-access.d.ts +6 -6
  10. package/app/fs-app-acl.module.d.ts +31 -31
  11. package/app/injectors/app-acl-config.injector.d.ts +2 -2
  12. package/app/interfaces/acl-entry-data.d.ts +11 -11
  13. package/app/interfaces/acl-entry.d.ts +18 -18
  14. package/app/interfaces/acl-level.d.ts +3 -3
  15. package/app/interfaces/acl-object-entry.d.ts +11 -11
  16. package/app/interfaces/acl-object-role.d.ts +6 -6
  17. package/app/interfaces/acl-object.d.ts +4 -4
  18. package/app/interfaces/acl-permission.d.ts +7 -7
  19. package/app/interfaces/acl-role.d.ts +15 -15
  20. package/app/interfaces/app-acl-config.d.ts +7 -7
  21. package/app/interfaces/name-value.d.ts +4 -4
  22. package/app/services/app-acl.service.d.ts +16 -18
  23. package/bundles/firestitch-app-acl.umd.js +1130 -1158
  24. package/bundles/firestitch-app-acl.umd.js.map +1 -1
  25. package/esm2015/app/components/acl-entries/acl-entries.component.js +164 -166
  26. package/esm2015/app/components/acl-entry/acl-entry.component.js +90 -93
  27. package/esm2015/app/components/acl-object-roles/acl-object-roles.component.js +56 -56
  28. package/esm2015/app/components/acl-permission-popover/acl-permission-popover.component.js +32 -32
  29. package/esm2015/app/components/acl-role/acl-role.component.js +201 -202
  30. package/esm2015/app/components/acl-role-popover/acl-role-popover.component.js +37 -37
  31. package/esm2015/app/components/acl-roles/acl-roles.component.js +146 -146
  32. package/esm2015/app/consts/acl-role-accesses.js +7 -7
  33. package/esm2015/app/enums/acl-role-access.js +7 -7
  34. package/esm2015/app/fs-app-acl.module.js +123 -123
  35. package/esm2015/app/injectors/app-acl-config.injector.js +2 -2
  36. package/esm2015/app/interfaces/acl-entry-data.js +1 -1
  37. package/esm2015/app/interfaces/acl-entry.js +1 -1
  38. package/esm2015/app/interfaces/acl-level.js +1 -1
  39. package/esm2015/app/interfaces/acl-object-entry.js +1 -1
  40. package/esm2015/app/interfaces/acl-object-role.js +1 -1
  41. package/esm2015/app/interfaces/acl-object.js +1 -1
  42. package/esm2015/app/interfaces/acl-permission.js +1 -1
  43. package/esm2015/app/interfaces/acl-role.js +1 -1
  44. package/esm2015/app/interfaces/app-acl-config.js +1 -1
  45. package/esm2015/app/interfaces/name-value.js +1 -1
  46. package/esm2015/app/services/app-acl.service.js +55 -78
  47. package/esm2015/firestitch-app-acl.js +4 -4
  48. package/esm2015/public_api.js +10 -10
  49. package/fesm2015/firestitch-app-acl.js +770 -797
  50. package/fesm2015/firestitch-app-acl.js.map +1 -1
  51. package/firestitch-app-acl.d.ts +5 -5
  52. package/package.json +1 -1
  53. package/public_api.d.ts +20 -20
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/flex-layout'), require('@angular/material/input'), require('@angular/material/radio'), require('@angular/material/button'), require('@angular/material/select'), require('@angular/material/checkbox'), require('@angular/material/dialog'), require('@angular/core'), require('@angular/common'), require('@firestitch/list'), require('@firestitch/popover'), require('@firestitch/dialog'), require('@firestitch/form'), require('@firestitch/label'), require('@firestitch/radiogroup'), require('@firestitch/badge'), require('@firestitch/checkboxgroup'), require('rxjs/operators'), require('@firestitch/filter'), require('@firestitch/common'), require('rxjs'), require('lodash-es'), require('snakecase-keys'), require('camelcase-keys'), require('@firestitch/message'), require('@angular/material/form-field'), require('@angular/material/core'), require('@angular/forms'), require('@angular/flex-layout/flex'), require('@firestitch/prompt')) :
3
- typeof define === 'function' && define.amd ? define('@firestitch/app-acl', ['exports', '@angular/flex-layout', '@angular/material/input', '@angular/material/radio', '@angular/material/button', '@angular/material/select', '@angular/material/checkbox', '@angular/material/dialog', '@angular/core', '@angular/common', '@firestitch/list', '@firestitch/popover', '@firestitch/dialog', '@firestitch/form', '@firestitch/label', '@firestitch/radiogroup', '@firestitch/badge', '@firestitch/checkboxgroup', 'rxjs/operators', '@firestitch/filter', '@firestitch/common', 'rxjs', 'lodash-es', 'snakecase-keys', 'camelcase-keys', '@firestitch/message', '@angular/material/form-field', '@angular/material/core', '@angular/forms', '@angular/flex-layout/flex', '@firestitch/prompt'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.firestitch = global.firestitch || {}, global.firestitch["app-acl"] = {}), global.ng.flexLayout, global.ng.material.input, global.ng.material.radio, global.ng.material.button, global.ng.material.select, global.ng.material.checkbox, global.ng.material.dialog, global.ng.core, global.ng.common, global.i12, global.i2$1, global.i4, global.i15, global.i6, global.i7, global.i5$1, global.i1, global.rxjs.operators, global.filter, global.common, global.rxjs, global.lodashEs, global._snakecaseKeys, global._camelcaseKeys, global.i3, global.ng.material.formField, global.ng.material.core, global.ng.forms, global.ng.flexLayout.flex, global.i3$1));
5
- })(this, (function (exports, flexLayout, i18, i8, i13, i10, i9, i2, i0, i7$1, i12, i2$1, i4, i15, i6, i7, i5$1, i1, operators, filter, common, rxjs, lodashEs, _snakecaseKeys, _camelcaseKeys, i3, i5, i11, i14, i17, i3$1) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/flex-layout'), require('@angular/material/input'), require('@angular/material/radio'), require('@angular/material/button'), require('@angular/material/select'), require('@angular/material/checkbox'), require('@angular/material/dialog'), require('@angular/core'), require('@angular/common'), require('@firestitch/list'), require('@firestitch/popover'), require('@firestitch/dialog'), require('@firestitch/form'), require('@firestitch/label'), require('@firestitch/radiogroup'), require('@firestitch/badge'), require('@firestitch/checkboxgroup'), require('rxjs/operators'), require('@firestitch/filter'), require('@firestitch/common'), require('rxjs'), require('snakecase-keys'), require('camelcase-keys'), require('@firestitch/message'), require('@angular/material/form-field'), require('@angular/material/core'), require('@angular/forms'), require('@angular/flex-layout/flex'), require('lodash-es'), require('@firestitch/prompt')) :
3
+ typeof define === 'function' && define.amd ? define('@firestitch/app-acl', ['exports', '@angular/flex-layout', '@angular/material/input', '@angular/material/radio', '@angular/material/button', '@angular/material/select', '@angular/material/checkbox', '@angular/material/dialog', '@angular/core', '@angular/common', '@firestitch/list', '@firestitch/popover', '@firestitch/dialog', '@firestitch/form', '@firestitch/label', '@firestitch/radiogroup', '@firestitch/badge', '@firestitch/checkboxgroup', 'rxjs/operators', '@firestitch/filter', '@firestitch/common', 'rxjs', 'snakecase-keys', 'camelcase-keys', '@firestitch/message', '@angular/material/form-field', '@angular/material/core', '@angular/forms', '@angular/flex-layout/flex', 'lodash-es', '@firestitch/prompt'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.firestitch = global.firestitch || {}, global.firestitch["app-acl"] = {}), global.ng.flexLayout, global.ng.material.input, global.ng.material.radio, global.ng.material.button, global.ng.material.select, global.ng.material.checkbox, global.ng.material.dialog, global.ng.core, global.ng.common, global.i12, global.i2$1, global.i4, global.i15, global.i6, global.i7, global.i5$1, global.i1, global.rxjs.operators, global.filter, global.common, global.rxjs, global._snakecaseKeys, global._camelcaseKeys, global.i3, global.ng.material.formField, global.ng.material.core, global.ng.forms, global.ng.flexLayout.flex, global.lodashEs, global.i3$1));
5
+ })(this, (function (exports, flexLayout, i18, i8, i13, i10, i9, i2, i0, i7$1, i12, i2$1, i4, i15, i6, i7, i5$1, i1, operators, filter, common, rxjs, _snakecaseKeys, _camelcaseKeys, i3, i5, i11, i14, i17, lodashEs, i3$1) { 'use strict';
6
6
 
7
7
  function _interopNamespace(e) {
8
8
  if (e && e.__esModule) return e;
@@ -47,1186 +47,1158 @@
47
47
  var i17__namespace = /*#__PURE__*/_interopNamespace(i17);
48
48
  var i3__namespace$1 = /*#__PURE__*/_interopNamespace(i3$1);
49
49
 
50
- /*! *****************************************************************************
51
- Copyright (c) Microsoft Corporation.
52
-
53
- Permission to use, copy, modify, and/or distribute this software for any
54
- purpose with or without fee is hereby granted.
55
-
56
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
57
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
58
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
59
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
60
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
61
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
62
- PERFORMANCE OF THIS SOFTWARE.
63
- ***************************************************************************** */
64
- /* global Reflect, Promise */
65
- var extendStatics = function (d, b) {
66
- extendStatics = Object.setPrototypeOf ||
67
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
68
- function (d, b) { for (var p in b)
69
- if (Object.prototype.hasOwnProperty.call(b, p))
70
- d[p] = b[p]; };
71
- return extendStatics(d, b);
72
- };
73
- function __extends(d, b) {
74
- if (typeof b !== "function" && b !== null)
75
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
76
- extendStatics(d, b);
77
- function __() { this.constructor = d; }
78
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
79
- }
80
- var __assign = function () {
81
- __assign = Object.assign || function __assign(t) {
82
- for (var s, i = 1, n = arguments.length; i < n; i++) {
83
- s = arguments[i];
84
- for (var p in s)
85
- if (Object.prototype.hasOwnProperty.call(s, p))
86
- t[p] = s[p];
87
- }
88
- return t;
89
- };
90
- return __assign.apply(this, arguments);
91
- };
92
- function __rest(s, e) {
93
- var t = {};
94
- for (var p in s)
95
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
96
- t[p] = s[p];
97
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
98
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
99
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
100
- t[p[i]] = s[p[i]];
101
- }
102
- return t;
103
- }
104
- function __decorate(decorators, target, key, desc) {
105
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
106
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
107
- r = Reflect.decorate(decorators, target, key, desc);
108
- else
109
- for (var i = decorators.length - 1; i >= 0; i--)
110
- if (d = decorators[i])
111
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
112
- return c > 3 && r && Object.defineProperty(target, key, r), r;
113
- }
114
- function __param(paramIndex, decorator) {
115
- return function (target, key) { decorator(target, key, paramIndex); };
116
- }
117
- function __metadata(metadataKey, metadataValue) {
118
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
119
- return Reflect.metadata(metadataKey, metadataValue);
120
- }
121
- function __awaiter(thisArg, _arguments, P, generator) {
122
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
123
- return new (P || (P = Promise))(function (resolve, reject) {
124
- function fulfilled(value) { try {
125
- step(generator.next(value));
126
- }
127
- catch (e) {
128
- reject(e);
129
- } }
130
- function rejected(value) { try {
131
- step(generator["throw"](value));
132
- }
133
- catch (e) {
134
- reject(e);
135
- } }
136
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
137
- step((generator = generator.apply(thisArg, _arguments || [])).next());
138
- });
139
- }
140
- function __generator(thisArg, body) {
141
- var _ = { label: 0, sent: function () { if (t[0] & 1)
142
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
143
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
144
- function verb(n) { return function (v) { return step([n, v]); }; }
145
- function step(op) {
146
- if (f)
147
- throw new TypeError("Generator is already executing.");
148
- while (_)
149
- try {
150
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
151
- return t;
152
- if (y = 0, t)
153
- op = [op[0] & 2, t.value];
154
- switch (op[0]) {
155
- case 0:
156
- case 1:
157
- t = op;
158
- break;
159
- case 4:
160
- _.label++;
161
- return { value: op[1], done: false };
162
- case 5:
163
- _.label++;
164
- y = op[1];
165
- op = [0];
166
- continue;
167
- case 7:
168
- op = _.ops.pop();
169
- _.trys.pop();
170
- continue;
171
- default:
172
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
173
- _ = 0;
174
- continue;
175
- }
176
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
177
- _.label = op[1];
178
- break;
179
- }
180
- if (op[0] === 6 && _.label < t[1]) {
181
- _.label = t[1];
182
- t = op;
183
- break;
184
- }
185
- if (t && _.label < t[2]) {
186
- _.label = t[2];
187
- _.ops.push(op);
188
- break;
189
- }
190
- if (t[2])
191
- _.ops.pop();
192
- _.trys.pop();
193
- continue;
194
- }
195
- op = body.call(thisArg, _);
196
- }
197
- catch (e) {
198
- op = [6, e];
199
- y = 0;
200
- }
201
- finally {
202
- f = t = 0;
203
- }
204
- if (op[0] & 5)
205
- throw op[1];
206
- return { value: op[0] ? op[1] : void 0, done: true };
207
- }
208
- }
209
- var __createBinding = Object.create ? (function (o, m, k, k2) {
210
- if (k2 === undefined)
211
- k2 = k;
212
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
213
- }) : (function (o, m, k, k2) {
214
- if (k2 === undefined)
215
- k2 = k;
216
- o[k2] = m[k];
217
- });
218
- function __exportStar(m, o) {
219
- for (var p in m)
220
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
221
- __createBinding(o, m, p);
222
- }
223
- function __values(o) {
224
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
225
- if (m)
226
- return m.call(o);
227
- if (o && typeof o.length === "number")
228
- return {
229
- next: function () {
230
- if (o && i >= o.length)
231
- o = void 0;
232
- return { value: o && o[i++], done: !o };
233
- }
234
- };
235
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
236
- }
237
- function __read(o, n) {
238
- var m = typeof Symbol === "function" && o[Symbol.iterator];
239
- if (!m)
240
- return o;
241
- var i = m.call(o), r, ar = [], e;
242
- try {
243
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
244
- ar.push(r.value);
245
- }
246
- catch (error) {
247
- e = { error: error };
248
- }
249
- finally {
250
- try {
251
- if (r && !r.done && (m = i["return"]))
252
- m.call(i);
253
- }
254
- finally {
255
- if (e)
256
- throw e.error;
257
- }
258
- }
259
- return ar;
260
- }
261
- /** @deprecated */
262
- function __spread() {
263
- for (var ar = [], i = 0; i < arguments.length; i++)
264
- ar = ar.concat(__read(arguments[i]));
265
- return ar;
266
- }
267
- /** @deprecated */
268
- function __spreadArrays() {
269
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
270
- s += arguments[i].length;
271
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
272
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
273
- r[k] = a[j];
274
- return r;
275
- }
276
- function __spreadArray(to, from, pack) {
277
- if (pack || arguments.length === 2)
278
- for (var i = 0, l = from.length, ar; i < l; i++) {
279
- if (ar || !(i in from)) {
280
- if (!ar)
281
- ar = Array.prototype.slice.call(from, 0, i);
282
- ar[i] = from[i];
283
- }
284
- }
285
- return to.concat(ar || Array.prototype.slice.call(from));
286
- }
287
- function __await(v) {
288
- return this instanceof __await ? (this.v = v, this) : new __await(v);
289
- }
290
- function __asyncGenerator(thisArg, _arguments, generator) {
291
- if (!Symbol.asyncIterator)
292
- throw new TypeError("Symbol.asyncIterator is not defined.");
293
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
294
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
295
- function verb(n) { if (g[n])
296
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
297
- function resume(n, v) { try {
298
- step(g[n](v));
299
- }
300
- catch (e) {
301
- settle(q[0][3], e);
302
- } }
303
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
304
- function fulfill(value) { resume("next", value); }
305
- function reject(value) { resume("throw", value); }
306
- function settle(f, v) { if (f(v), q.shift(), q.length)
307
- resume(q[0][0], q[0][1]); }
308
- }
309
- function __asyncDelegator(o) {
310
- var i, p;
311
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
312
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
313
- }
314
- function __asyncValues(o) {
315
- if (!Symbol.asyncIterator)
316
- throw new TypeError("Symbol.asyncIterator is not defined.");
317
- var m = o[Symbol.asyncIterator], i;
318
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
319
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
320
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
321
- }
322
- function __makeTemplateObject(cooked, raw) {
323
- if (Object.defineProperty) {
324
- Object.defineProperty(cooked, "raw", { value: raw });
325
- }
326
- else {
327
- cooked.raw = raw;
328
- }
329
- return cooked;
330
- }
331
- ;
332
- var __setModuleDefault = Object.create ? (function (o, v) {
333
- Object.defineProperty(o, "default", { enumerable: true, value: v });
334
- }) : function (o, v) {
335
- o["default"] = v;
336
- };
337
- function __importStar(mod) {
338
- if (mod && mod.__esModule)
339
- return mod;
340
- var result = {};
341
- if (mod != null)
342
- for (var k in mod)
343
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
344
- __createBinding(result, mod, k);
345
- __setModuleDefault(result, mod);
346
- return result;
347
- }
348
- function __importDefault(mod) {
349
- return (mod && mod.__esModule) ? mod : { default: mod };
350
- }
351
- function __classPrivateFieldGet(receiver, state, kind, f) {
352
- if (kind === "a" && !f)
353
- throw new TypeError("Private accessor was defined without a getter");
354
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
355
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
356
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
357
- }
358
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
359
- if (kind === "m")
360
- throw new TypeError("Private method is not writable");
361
- if (kind === "a" && !f)
362
- throw new TypeError("Private accessor was defined without a setter");
363
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
364
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
365
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
50
+ /*! *****************************************************************************
51
+ Copyright (c) Microsoft Corporation.
52
+
53
+ Permission to use, copy, modify, and/or distribute this software for any
54
+ purpose with or without fee is hereby granted.
55
+
56
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
57
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
58
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
59
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
60
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
61
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
62
+ PERFORMANCE OF THIS SOFTWARE.
63
+ ***************************************************************************** */
64
+ /* global Reflect, Promise */
65
+ var extendStatics = function (d, b) {
66
+ extendStatics = Object.setPrototypeOf ||
67
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
68
+ function (d, b) { for (var p in b)
69
+ if (Object.prototype.hasOwnProperty.call(b, p))
70
+ d[p] = b[p]; };
71
+ return extendStatics(d, b);
72
+ };
73
+ function __extends(d, b) {
74
+ if (typeof b !== "function" && b !== null)
75
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
76
+ extendStatics(d, b);
77
+ function __() { this.constructor = d; }
78
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
79
+ }
80
+ var __assign = function () {
81
+ __assign = Object.assign || function __assign(t) {
82
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
83
+ s = arguments[i];
84
+ for (var p in s)
85
+ if (Object.prototype.hasOwnProperty.call(s, p))
86
+ t[p] = s[p];
87
+ }
88
+ return t;
89
+ };
90
+ return __assign.apply(this, arguments);
91
+ };
92
+ function __rest(s, e) {
93
+ var t = {};
94
+ for (var p in s)
95
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
96
+ t[p] = s[p];
97
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
98
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
99
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
100
+ t[p[i]] = s[p[i]];
101
+ }
102
+ return t;
103
+ }
104
+ function __decorate(decorators, target, key, desc) {
105
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
106
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
107
+ r = Reflect.decorate(decorators, target, key, desc);
108
+ else
109
+ for (var i = decorators.length - 1; i >= 0; i--)
110
+ if (d = decorators[i])
111
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
112
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
113
+ }
114
+ function __param(paramIndex, decorator) {
115
+ return function (target, key) { decorator(target, key, paramIndex); };
116
+ }
117
+ function __metadata(metadataKey, metadataValue) {
118
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
119
+ return Reflect.metadata(metadataKey, metadataValue);
120
+ }
121
+ function __awaiter(thisArg, _arguments, P, generator) {
122
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
123
+ return new (P || (P = Promise))(function (resolve, reject) {
124
+ function fulfilled(value) { try {
125
+ step(generator.next(value));
126
+ }
127
+ catch (e) {
128
+ reject(e);
129
+ } }
130
+ function rejected(value) { try {
131
+ step(generator["throw"](value));
132
+ }
133
+ catch (e) {
134
+ reject(e);
135
+ } }
136
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
137
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
138
+ });
139
+ }
140
+ function __generator(thisArg, body) {
141
+ var _ = { label: 0, sent: function () { if (t[0] & 1)
142
+ throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
143
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
144
+ function verb(n) { return function (v) { return step([n, v]); }; }
145
+ function step(op) {
146
+ if (f)
147
+ throw new TypeError("Generator is already executing.");
148
+ while (_)
149
+ try {
150
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
151
+ return t;
152
+ if (y = 0, t)
153
+ op = [op[0] & 2, t.value];
154
+ switch (op[0]) {
155
+ case 0:
156
+ case 1:
157
+ t = op;
158
+ break;
159
+ case 4:
160
+ _.label++;
161
+ return { value: op[1], done: false };
162
+ case 5:
163
+ _.label++;
164
+ y = op[1];
165
+ op = [0];
166
+ continue;
167
+ case 7:
168
+ op = _.ops.pop();
169
+ _.trys.pop();
170
+ continue;
171
+ default:
172
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
173
+ _ = 0;
174
+ continue;
175
+ }
176
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
177
+ _.label = op[1];
178
+ break;
179
+ }
180
+ if (op[0] === 6 && _.label < t[1]) {
181
+ _.label = t[1];
182
+ t = op;
183
+ break;
184
+ }
185
+ if (t && _.label < t[2]) {
186
+ _.label = t[2];
187
+ _.ops.push(op);
188
+ break;
189
+ }
190
+ if (t[2])
191
+ _.ops.pop();
192
+ _.trys.pop();
193
+ continue;
194
+ }
195
+ op = body.call(thisArg, _);
196
+ }
197
+ catch (e) {
198
+ op = [6, e];
199
+ y = 0;
200
+ }
201
+ finally {
202
+ f = t = 0;
203
+ }
204
+ if (op[0] & 5)
205
+ throw op[1];
206
+ return { value: op[0] ? op[1] : void 0, done: true };
207
+ }
208
+ }
209
+ var __createBinding = Object.create ? (function (o, m, k, k2) {
210
+ if (k2 === undefined)
211
+ k2 = k;
212
+ Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
213
+ }) : (function (o, m, k, k2) {
214
+ if (k2 === undefined)
215
+ k2 = k;
216
+ o[k2] = m[k];
217
+ });
218
+ function __exportStar(m, o) {
219
+ for (var p in m)
220
+ if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
221
+ __createBinding(o, m, p);
222
+ }
223
+ function __values(o) {
224
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
225
+ if (m)
226
+ return m.call(o);
227
+ if (o && typeof o.length === "number")
228
+ return {
229
+ next: function () {
230
+ if (o && i >= o.length)
231
+ o = void 0;
232
+ return { value: o && o[i++], done: !o };
233
+ }
234
+ };
235
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
236
+ }
237
+ function __read(o, n) {
238
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
239
+ if (!m)
240
+ return o;
241
+ var i = m.call(o), r, ar = [], e;
242
+ try {
243
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
244
+ ar.push(r.value);
245
+ }
246
+ catch (error) {
247
+ e = { error: error };
248
+ }
249
+ finally {
250
+ try {
251
+ if (r && !r.done && (m = i["return"]))
252
+ m.call(i);
253
+ }
254
+ finally {
255
+ if (e)
256
+ throw e.error;
257
+ }
258
+ }
259
+ return ar;
260
+ }
261
+ /** @deprecated */
262
+ function __spread() {
263
+ for (var ar = [], i = 0; i < arguments.length; i++)
264
+ ar = ar.concat(__read(arguments[i]));
265
+ return ar;
266
+ }
267
+ /** @deprecated */
268
+ function __spreadArrays() {
269
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++)
270
+ s += arguments[i].length;
271
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
272
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
273
+ r[k] = a[j];
274
+ return r;
275
+ }
276
+ function __spreadArray(to, from, pack) {
277
+ if (pack || arguments.length === 2)
278
+ for (var i = 0, l = from.length, ar; i < l; i++) {
279
+ if (ar || !(i in from)) {
280
+ if (!ar)
281
+ ar = Array.prototype.slice.call(from, 0, i);
282
+ ar[i] = from[i];
283
+ }
284
+ }
285
+ return to.concat(ar || Array.prototype.slice.call(from));
286
+ }
287
+ function __await(v) {
288
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
289
+ }
290
+ function __asyncGenerator(thisArg, _arguments, generator) {
291
+ if (!Symbol.asyncIterator)
292
+ throw new TypeError("Symbol.asyncIterator is not defined.");
293
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
294
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
295
+ function verb(n) { if (g[n])
296
+ i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
297
+ function resume(n, v) { try {
298
+ step(g[n](v));
299
+ }
300
+ catch (e) {
301
+ settle(q[0][3], e);
302
+ } }
303
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
304
+ function fulfill(value) { resume("next", value); }
305
+ function reject(value) { resume("throw", value); }
306
+ function settle(f, v) { if (f(v), q.shift(), q.length)
307
+ resume(q[0][0], q[0][1]); }
308
+ }
309
+ function __asyncDelegator(o) {
310
+ var i, p;
311
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
312
+ function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
313
+ }
314
+ function __asyncValues(o) {
315
+ if (!Symbol.asyncIterator)
316
+ throw new TypeError("Symbol.asyncIterator is not defined.");
317
+ var m = o[Symbol.asyncIterator], i;
318
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
319
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
320
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
321
+ }
322
+ function __makeTemplateObject(cooked, raw) {
323
+ if (Object.defineProperty) {
324
+ Object.defineProperty(cooked, "raw", { value: raw });
325
+ }
326
+ else {
327
+ cooked.raw = raw;
328
+ }
329
+ return cooked;
330
+ }
331
+ ;
332
+ var __setModuleDefault = Object.create ? (function (o, v) {
333
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
334
+ }) : function (o, v) {
335
+ o["default"] = v;
336
+ };
337
+ function __importStar(mod) {
338
+ if (mod && mod.__esModule)
339
+ return mod;
340
+ var result = {};
341
+ if (mod != null)
342
+ for (var k in mod)
343
+ if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
344
+ __createBinding(result, mod, k);
345
+ __setModuleDefault(result, mod);
346
+ return result;
347
+ }
348
+ function __importDefault(mod) {
349
+ return (mod && mod.__esModule) ? mod : { default: mod };
350
+ }
351
+ function __classPrivateFieldGet(receiver, state, kind, f) {
352
+ if (kind === "a" && !f)
353
+ throw new TypeError("Private accessor was defined without a getter");
354
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
355
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
356
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
357
+ }
358
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
359
+ if (kind === "m")
360
+ throw new TypeError("Private method is not writable");
361
+ if (kind === "a" && !f)
362
+ throw new TypeError("Private accessor was defined without a setter");
363
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
364
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
365
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
366
366
  }
367
367
 
368
- var AclRoleAccess;
369
- (function (AclRoleAccess) {
370
- AclRoleAccess[AclRoleAccess["None"] = 0] = "None";
371
- AclRoleAccess[AclRoleAccess["Read"] = 5] = "Read";
372
- AclRoleAccess[AclRoleAccess["Write"] = 10] = "Write";
373
- AclRoleAccess[AclRoleAccess["Full"] = 15] = "Full";
368
+ var AclRoleAccess;
369
+ (function (AclRoleAccess) {
370
+ AclRoleAccess[AclRoleAccess["None"] = 0] = "None";
371
+ AclRoleAccess[AclRoleAccess["Read"] = 5] = "Read";
372
+ AclRoleAccess[AclRoleAccess["Write"] = 10] = "Write";
373
+ AclRoleAccess[AclRoleAccess["Full"] = 15] = "Full";
374
374
  })(AclRoleAccess || (AclRoleAccess = {}));
375
375
 
376
- var AclRoleAccesses = [
377
- { name: 'None', value: AclRoleAccess.None },
378
- { name: 'Read', value: AclRoleAccess.Read },
379
- { name: 'Write', value: AclRoleAccess.Write },
380
- { name: 'Full', value: AclRoleAccess.Full }
376
+ var AclRoleAccesses = [
377
+ { name: 'None', value: AclRoleAccess.None },
378
+ { name: 'Read', value: AclRoleAccess.Read },
379
+ { name: 'Write', value: AclRoleAccess.Write },
380
+ { name: 'Full', value: AclRoleAccess.Full }
381
381
  ];
382
382
 
383
383
  var FS_APP_ACL_CONFIG = new i0.InjectionToken('fs-app-acl-config');
384
384
 
385
- var snakecaseKeys = _snakecaseKeys__namespace;
386
- var camelcaseKeys = _camelcaseKeys__namespace;
387
- var FsAppAclService = /** @class */ (function () {
388
- function FsAppAclService(_appAclConfig) {
389
- this._appAclConfig = _appAclConfig;
390
- }
391
- FsAppAclService.prototype.getPermissions = function () {
392
- var _this = this;
393
- if (!this._permissions$) {
394
- this._permissions$ = new rxjs.ReplaySubject();
395
- this._appAclConfig.permissions
396
- .pipe(operators.map(function (data) { return _this.input(data); }))
397
- .subscribe(function (permissions) {
398
- _this._permissions$.next(permissions);
399
- _this._permissions$.complete();
400
- });
401
- }
402
- return this._permissions$;
403
- };
404
- FsAppAclService.prototype.getLevels = function () {
405
- var _this = this;
406
- if (!this._levels$) {
407
- this._levels$ = new rxjs.ReplaySubject();
408
- this._appAclConfig.levels
409
- .pipe(operators.map(function (data) { return _this.input(data); }))
410
- .subscribe(function (levels) {
411
- _this._levels$.next(levels);
412
- _this._levels$.complete();
413
- });
414
- }
415
- return this._levels$;
416
- };
417
- FsAppAclService.prototype.getIndexedLevels = function () {
418
- return this.getLevels()
419
- .pipe(operators.map(function (data) {
420
- return common.list(data, 'name', 'value');
421
- }));
422
- };
423
- FsAppAclService.prototype.input = function (data) {
424
- var _this = this;
425
- if (lodashEs.isArray(data)) {
426
- return data.map(function (item) {
427
- return _this._appAclConfig.case === 'snake' ? camelcaseKeys(item, { deep: true }) : item;
428
- });
429
- }
430
- else {
431
- return this._appAclConfig.case === 'snake' ? camelcaseKeys(data, { deep: true }) : data;
432
- }
433
- };
434
- FsAppAclService.prototype.output = function (data) {
435
- var _this = this;
436
- if (lodashEs.isArray(data)) {
437
- return data.map(function (item) {
438
- return _this._appAclConfig.case === 'snake' ? snakecaseKeys(item, { deep: true }) : item;
439
- });
440
- }
441
- else {
442
- return this._appAclConfig.case === 'snake' ? snakecaseKeys(data, { deep: true }) : data;
443
- }
444
- };
445
- return FsAppAclService;
446
- }());
447
- FsAppAclService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAppAclService, deps: [{ token: FS_APP_ACL_CONFIG }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
448
- FsAppAclService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAppAclService, providedIn: 'root' });
449
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAppAclService, decorators: [{
450
- type: i0.Injectable,
451
- args: [{
452
- providedIn: 'root',
453
- }]
454
- }], ctorParameters: function () {
455
- return [{ type: undefined, decorators: [{
456
- type: i0.Inject,
457
- args: [FS_APP_ACL_CONFIG]
458
- }] }];
385
+ var snakecaseKeys = _snakecaseKeys__namespace;
386
+ var camelcaseKeys = _camelcaseKeys__namespace;
387
+ var FsAppAclService = /** @class */ (function () {
388
+ function FsAppAclService(_appAclConfig) {
389
+ this._appAclConfig = _appAclConfig;
390
+ }
391
+ FsAppAclService.prototype.getPermissions = function () {
392
+ var _this = this;
393
+ if (!this._permissions$) {
394
+ this._permissions$ = new rxjs.ReplaySubject();
395
+ this._appAclConfig.permissions
396
+ .subscribe(function (permissions) {
397
+ _this._permissions$.next(permissions);
398
+ _this._permissions$.complete();
399
+ });
400
+ }
401
+ return this._permissions$;
402
+ };
403
+ FsAppAclService.prototype.getLevels = function () {
404
+ var _this = this;
405
+ if (!this._levels$) {
406
+ this._levels$ = new rxjs.ReplaySubject();
407
+ this._appAclConfig.levels
408
+ .subscribe(function (levels) {
409
+ _this._levels$.next(levels);
410
+ _this._levels$.complete();
411
+ });
412
+ }
413
+ return this._levels$;
414
+ };
415
+ FsAppAclService.prototype.getIndexedLevels = function () {
416
+ return this.getLevels()
417
+ .pipe(operators.map(function (data) {
418
+ return common.list(data, 'name', 'value');
419
+ }));
420
+ };
421
+ return FsAppAclService;
422
+ }());
423
+ FsAppAclService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAppAclService, deps: [{ token: FS_APP_ACL_CONFIG }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
424
+ FsAppAclService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAppAclService, providedIn: 'root' });
425
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAppAclService, decorators: [{
426
+ type: i0.Injectable,
427
+ args: [{
428
+ providedIn: 'root',
429
+ }]
430
+ }], ctorParameters: function () {
431
+ return [{ type: undefined, decorators: [{
432
+ type: i0.Inject,
433
+ args: [FS_APP_ACL_CONFIG]
434
+ }] }];
459
435
  } });
460
436
 
461
- var FsAclRoleComponent = /** @class */ (function () {
462
- function FsAclRoleComponent(_appAclService, _dialogRef, _message, _data, _cdRef) {
463
- var _this = this;
464
- this._appAclService = _appAclService;
465
- this._dialogRef = _dialogRef;
466
- this._message = _message;
467
- this._data = _data;
468
- this._cdRef = _cdRef;
469
- this.aclRole = null;
470
- this.permissions = [];
471
- this.levelPermissions = [];
472
- this.AclRoleAccesses = AclRoleAccesses;
473
- this.indexedAccesses = {};
474
- this.aclLevels = [];
475
- this.indexedAclLevels = {};
476
- this.onlyFullAccess = false;
477
- this.AclLevels = {};
478
- this.aclRoleConfigs = [];
479
- this.levelAclRoleConfigs = [];
480
- this._destroy$ = new rxjs.Subject();
481
- this.save = function () {
482
- var aclRole = Object.assign(Object.assign({}, _this.aclRole), { permissions: _this.levelPermissions.map(function (permission) {
483
- return {
484
- value: permission.value,
485
- access: _this.aclRole.permissions[permission.value] || 0,
486
- };
487
- }), aclRoleConfigs: _this.levelAclRoleConfigs.map(function (item) {
488
- return {
489
- id: item.id,
490
- value: item.value,
491
- data: item.data,
492
- };
493
- }) });
494
- return _this._data.saveAclRole(_this._appAclService.output(aclRole))
495
- .pipe(operators.tap(function (response) {
496
- _this._message.success('Saved Changes');
497
- _this.close(response);
498
- }));
499
- };
500
- }
501
- FsAclRoleComponent.prototype.ngOnInit = function () {
502
- var _this = this;
503
- rxjs.forkJoin(this.getRole(), this._appAclService.getPermissions())
504
- .pipe(operators.takeUntil(this._destroy$))
505
- .subscribe(function (_a) {
506
- var _b = __read(_a, 2), aclRole = _b[0], aclPermissions = _b[1];
507
- _this.permissions = aclPermissions;
508
- _this.aclLevels = _this._data.aclLevels;
509
- _this.indexedAclLevels = common.list(_this.aclLevels, 'name', 'value');
510
- _this.indexedAccesses = common.list(AclRoleAccesses, 'name', 'value');
511
- _this.aclRole = Object.assign({
512
- aclPermissions: [],
513
- allPermissions: true,
514
- aclRoleConfigs: [],
515
- permissions: {},
516
- level: _this.aclLevels[0].value,
517
- }, aclRole);
518
- if (_this.aclRole.id) {
519
- _this.permissions.forEach(function (permission) {
520
- var access = 0;
521
- var aclPermission = _this.aclRole.aclPermissions.find(function (item) {
522
- return item.permission === permission.value;
523
- });
524
- if (aclPermission) {
525
- access = aclPermission.access;
526
- }
527
- _this.aclRole.permissions[permission.value] = access;
528
- });
529
- }
530
- if (_this.aclRole.allPermissions) {
531
- _this._applyMaxPermissionAccess();
532
- }
533
- _this._updatePermissions();
534
- _this._updateAclRoleConfigs();
535
- _this._cdRef.markForCheck();
536
- });
537
- this.listConfig = {
538
- status: false,
539
- paging: false,
540
- noResults: {
541
- message: '',
542
- },
543
- group: {
544
- initialExpand: true,
545
- groupBy: function (data) {
546
- return data;
547
- },
548
- compareBy: function (data) {
549
- return data.category || 'General';
550
- },
551
- },
552
- fetch: function () {
553
- return rxjs.of({
554
- data: _this.levelPermissions.sort(function (a, b) {
555
- a = a.name.toUpperCase();
556
- b = b.name.toUpperCase();
557
- if (a < b) {
558
- return -1;
559
- }
560
- else if (a > b) {
561
- return 1;
562
- }
563
- return 0;
564
- }),
565
- });
566
- },
567
- };
568
- };
569
- FsAclRoleComponent.prototype.levelChange = function () {
570
- var _this = this;
571
- this._updatePermissions();
572
- this._updateAclRoleConfigs();
573
- setTimeout(function () {
574
- _this.list.reload();
575
- });
576
- };
577
- FsAclRoleComponent.prototype.getRole = function () {
578
- var _this = this;
579
- if (!this._data.aclRole.id) {
580
- return rxjs.of(this._data.aclRole);
581
- }
582
- var query = {
583
- aclPermissions: true,
584
- aclRoleConfigs: true,
585
- };
586
- if (!this.environment) {
587
- query.environmentId = null;
588
- }
589
- return this._data.loadAclRole(this._data.aclRole, query)
590
- .pipe(operators.map(function (data) { return _this._appAclService.input(data); }));
591
- };
592
- FsAclRoleComponent.prototype.close = function (data) {
593
- if (data === void 0) { data = null; }
594
- this._dialogRef.close(data);
595
- };
596
- FsAclRoleComponent.prototype.allPermissionsChange = function (all) {
597
- this._updatePermissions();
598
- if (all) {
599
- this._applyMaxPermissionAccess();
600
- }
601
- };
602
- FsAclRoleComponent.prototype.ngOnDestroy = function () {
603
- this._destroy$.next();
604
- this._destroy$.complete();
605
- };
606
- FsAclRoleComponent.prototype._updatePermissions = function () {
607
- var _this = this;
608
- this.levelPermissions = this.permissions.filter(function (permission) {
609
- return permission.levels.some(function (item) {
610
- return item === _this.aclRole.level;
611
- });
612
- });
613
- };
614
- FsAclRoleComponent.prototype._updateAclRoleConfigs = function () {
615
- var _this = this;
616
- this.levelAclRoleConfigs = this.aclRoleConfigs.filter(function (item) {
617
- return _this.aclRole.level === item.level;
618
- });
619
- };
620
- FsAclRoleComponent.prototype._applyMaxPermissionAccess = function () {
621
- var _this = this;
622
- this.permissions.forEach(function (permission) {
623
- _this.aclRole.permissions[permission.value] = Math.max.apply(Math, __spreadArray([], __read(permission.accesses)));
624
- });
625
- };
626
- return FsAclRoleComponent;
627
- }());
628
- FsAclRoleComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAclRoleComponent, deps: [{ token: FsAppAclService }, { token: i2__namespace.MatDialogRef }, { token: i3__namespace.FsMessage }, { token: i2.MAT_DIALOG_DATA }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
629
- FsAclRoleComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsAclRoleComponent, selector: "ng-component", viewQueries: [{ propertyName: "list", first: true, predicate: i12.FsListComponent, descendants: true }], ngImport: i0__namespace, template: "<form fsForm [submit]=\"save\">\n <fs-dialog>\n <ng-container *ngIf=\"aclRole\">\n <div mat-dialog-title>{{ aclRole.id ? 'Edit' : 'Create' }} Role</div>\n <mat-dialog-content>\n <div fxLayout=\"row\" fxLayout.lt-md=\"column\" fxLayoutGap=\"40px\" fxLayoutGap.lt-md=\"0\">\n <div fxLayout=\"column\" fxFlex fxFlex.lt-md=\"0\">\n <mat-form-field>\n <input matInput placeholder=\"Name\" [(ngModel)]=\"aclRole.name\" name=\"name\" fsFormRequired>\n </mat-form-field>\n\n <fs-label-field *ngIf=\"aclRole.id || aclLevels.length === 1; else levels\">\n <fs-label>Level</fs-label>\n {{indexedAclLevels[aclRole.level]}}\n </fs-label-field>\n\n <ng-template #levels>\n <div class=\"level\">\n <fs-radio-group\n [(ngModel)]=\"aclRole.level\"\n (ngModelChange)=\"levelChange()\"\n fsFormRequired\n label=\"Level\"\n orientation=\"vertical\"\n name=\"level\">\n <mat-radio-button\n *ngFor=\"let item of aclLevels\"\n [value]=\"item.value\"\n [disabled]=\"!!aclRole.protected\">\n {{ item.name }}\n </mat-radio-button>\n </fs-radio-group>\n </div>\n </ng-template>\n\n <fs-label-field *ngIf=\"levelPermissions.length\">\n <fs-label>All Permissions</fs-label>\n <mat-checkbox\n [(ngModel)]=\"aclRole.allPermissions\"\n (ngModelChange)=\"allPermissionsChange($event)\"\n [disabled]=\"!!aclRole.protected\"\n name=\"allPermissions\">\n </mat-checkbox>\n </fs-label-field>\n\n <div fxLayout=\"column\" *ngFor=\"let config of levelAclRoleConfigs\">\n <fs-label-field *ngIf=\"config.interface === 'checkbox'\">\n <fs-label>{{config.name}}</fs-label>\n <mat-checkbox\n [(ngModel)]=\"config.data\"\n [name]=\"config.name\">\n </mat-checkbox>\n <fs-label-message>\n <mat-hint>{{config.description}}</mat-hint>\n </fs-label-message>\n </fs-label-field>\n\n <mat-form-field *ngIf=\"config.interface === 'select'\">\n <mat-select\n [(ngModel)]=\"config.data\"\n [name]=\"config.value\"\n [required]=\"config.required\"\n [placeholder]=\"config.name\">\n <mat-option\n *ngFor=\"let item of config.values\"\n [value]=\"item.value\">\n {{ item.name }}\n </mat-option>\n </mat-select>\n <mat-hint>{{config.description}}</mat-hint>\n </mat-form-field>\n </div>\n </div>\n\n <div fxLayout=\"column\" fxFlex=\"65\" fxFlex.lt-md=\"0\" *ngIf=\"aclRole.level\" [hidden]=\"!levelPermissions.length\" class=\"permissions\">\n\n <fs-list [config]=\"listConfig\">\n <fs-list-column title=\"Permissions\">\n <ng-template colspan=\"2\" fs-list-group-cell let-row=\"row\" class=\"permission-group\">\n <small><b>{{row.category || 'General'}}</b></small>\n </ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <div class=\"permission\">{{ row.name }}</div>\n <div class=\"description small\">{{ row.description }}</div>\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Access\" width=\"1%\" class=\"access\">\n <ng-template fs-list-cell let-row=\"permission\" let-permission=\"row\">\n <span *ngIf=\"aclRole.allPermissions; else elseAll\">\n {{ indexedAccesses[aclRole.permissions[permission.value]] }}\n </span>\n <ng-template #elseAll>\n <mat-form-field>\n <mat-select\n [(ngModel)]=\"aclRole.permissions[permission.value]\"\n [disabled]=\"!!aclRole.protected\"\n fsFormRequired\n name=\"access-{{ permission.value }}\">\n <ng-container *ngFor=\"let access of AclRoleAccesses\">\n <mat-option\n *ngIf=\"access.value === 0 || permission.accesses.indexOf(access.value) !== -1\"\n [value]=\"access.value\">\n {{ access.name }}\n </mat-option>\n </ng-container>\n </mat-select>\n </mat-form-field>\n </ng-template>\n </ng-template>\n </fs-list-column>\n </fs-list>\n </div>\n </div>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-button type=\"submit\" color=\"primary\">{{ aclRole.id ? 'Save' : 'Create' }}</button>\n <button mat-button [mat-dialog-close]=\"null\" type=\"button\">Cancel</button>\n </mat-dialog-actions>\n </ng-container>\n </fs-dialog>\n</form>\n", styles: [":host .permissions ::ng-deep .fs-list-row-group{background-color:#f6f6f6}:host .permissions ::ng-deep fs-list .access{white-space:nowrap}:host .permissions ::ng-deep .mat-form-field{width:100px}:host .permissions ::ng-deep .mat-form-field .mat-form-field-wrapper{padding-bottom:0}:host .permissions ::ng-deep .mat-form-field .mat-form-field-infix{border-top:0}:host .permissions ::ng-deep .mat-form-field .mat-form-field-underline{bottom:0}:host ::ng-deep fs-radio-group{width:100%}:host ::ng-deep fs-label-field{width:100%}:host .level{width:100%}\n"], components: [{ type: i4__namespace.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode"] }, { type: i5__namespace.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i6__namespace.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { type: i6__namespace.FsLabelComponent, selector: "fs-label" }, { type: i7__namespace.FsRadioGroupComponent, selector: "fs-radio-group", inputs: ["orientation", "label", "name", "disabled", "radioPosition", "compareWith", "required"] }, { type: i8__namespace.MatRadioButton, selector: "mat-radio-button", inputs: ["disableRipple", "tabIndex"], exportAs: ["matRadioButton"] }, { type: i9__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: i6__namespace.FsLabelMessageComponent, selector: "fs-label-message" }, { type: i10__namespace.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i11__namespace.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i12__namespace.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { type: i13__namespace.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i14__namespace.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i14__namespace.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i14__namespace.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i15__namespace.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"] }, { type: i7__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2__namespace.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i2__namespace.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i17__namespace.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { type: i17__namespace.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { type: i17__namespace.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { type: i18__namespace.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i14__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: i15__namespace.FsFormRequiredDirective, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }, { type: i14__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i14__namespace.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i7__namespace$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5__namespace.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { type: i14__namespace.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i12__namespace.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i12__namespace.FsListGroupHeaderDirective, selector: "[fs-list-group-cell],[fs-list-group-header]" }, { type: i12__namespace.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { type: i2__namespace.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i15__namespace.FsSubmitButtonDirective, selector: "button[type=\"submit\"]", inputs: ["name", "dirtySubmit"] }, { type: i2__namespace.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["type", "mat-dialog-close", "aria-label", "matDialogClose"], exportAs: ["matDialogClose"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
630
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAclRoleComponent, decorators: [{
631
- type: i0.Component,
632
- args: [{
633
- templateUrl: './acl-role.component.html',
634
- styleUrls: ['./acl-role.component.scss'],
635
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
636
- }]
637
- }], ctorParameters: function () {
638
- return [{ type: FsAppAclService }, { type: i2__namespace.MatDialogRef }, { type: i3__namespace.FsMessage }, { type: undefined, decorators: [{
639
- type: i0.Inject,
640
- args: [i2.MAT_DIALOG_DATA]
641
- }] }, { type: i0__namespace.ChangeDetectorRef }];
642
- }, propDecorators: { list: [{
643
- type: i0.ViewChild,
644
- args: [i12.FsListComponent]
437
+ var FsAclRoleComponent = /** @class */ (function () {
438
+ function FsAclRoleComponent(_appAclService, _dialogRef, _message, _data, _cdRef) {
439
+ var _this = this;
440
+ this._appAclService = _appAclService;
441
+ this._dialogRef = _dialogRef;
442
+ this._message = _message;
443
+ this._data = _data;
444
+ this._cdRef = _cdRef;
445
+ this.aclRole = null;
446
+ this.permissions = [];
447
+ this.levelPermissions = [];
448
+ this.AclRoleAccesses = AclRoleAccesses;
449
+ this.indexedAccesses = {};
450
+ this.aclLevels = [];
451
+ this.indexedAclLevels = {};
452
+ this.onlyFullAccess = false;
453
+ this.AclLevels = {};
454
+ this.aclRoleConfigs = [];
455
+ this.levelAclRoleConfigs = [];
456
+ this._destroy$ = new rxjs.Subject();
457
+ this.save = function () {
458
+ var aclRole = Object.assign(Object.assign({}, _this.aclRole), { permissions: _this.levelPermissions.map(function (permission) {
459
+ return {
460
+ value: permission.value,
461
+ access: _this.aclRole.permissions[permission.value] || 0,
462
+ };
463
+ }), aclRoleConfigs: _this.levelAclRoleConfigs.map(function (item) {
464
+ return {
465
+ id: item.id,
466
+ value: item.value,
467
+ data: item.data,
468
+ };
469
+ }) });
470
+ return _this._data.saveAclRole(aclRole)
471
+ .pipe(operators.tap(function (response) {
472
+ _this._message.success('Saved Changes');
473
+ _this.close(response);
474
+ }));
475
+ };
476
+ }
477
+ FsAclRoleComponent.prototype.ngOnInit = function () {
478
+ var _this = this;
479
+ rxjs.forkJoin(this.getRole(), this._appAclService.getPermissions())
480
+ .pipe(operators.takeUntil(this._destroy$))
481
+ .subscribe(function (_a) {
482
+ var _b = __read(_a, 2), aclRole = _b[0], aclPermissions = _b[1];
483
+ _this.permissions = aclPermissions;
484
+ _this.aclLevels = _this._data.aclLevels;
485
+ _this.indexedAclLevels = common.list(_this.aclLevels, 'name', 'value');
486
+ _this.indexedAccesses = common.list(AclRoleAccesses, 'name', 'value');
487
+ _this.aclRole = Object.assign({
488
+ aclPermissions: [],
489
+ allPermissions: true,
490
+ aclRoleConfigs: [],
491
+ permissions: {},
492
+ level: _this.aclLevels[0].value,
493
+ }, aclRole);
494
+ if (_this.aclRole.id) {
495
+ _this.permissions.forEach(function (permission) {
496
+ var access = 0;
497
+ var aclPermission = _this.aclRole.aclPermissions.find(function (item) {
498
+ return item.permission === permission.value;
499
+ });
500
+ if (aclPermission) {
501
+ access = aclPermission.access;
502
+ }
503
+ _this.aclRole.permissions[permission.value] = access;
504
+ });
505
+ }
506
+ if (_this.aclRole.allPermissions) {
507
+ _this._applyMaxPermissionAccess();
508
+ }
509
+ _this._updatePermissions();
510
+ _this._updateAclRoleConfigs();
511
+ _this._cdRef.markForCheck();
512
+ });
513
+ this.listConfig = {
514
+ status: false,
515
+ paging: false,
516
+ noResults: {
517
+ message: '',
518
+ },
519
+ group: {
520
+ initialExpand: true,
521
+ groupBy: function (data) {
522
+ return data;
523
+ },
524
+ compareBy: function (data) {
525
+ return data.category || 'General';
526
+ },
527
+ },
528
+ fetch: function () {
529
+ return rxjs.of({
530
+ data: _this.levelPermissions.sort(function (a, b) {
531
+ a = a.name.toUpperCase();
532
+ b = b.name.toUpperCase();
533
+ if (a < b) {
534
+ return -1;
535
+ }
536
+ else if (a > b) {
537
+ return 1;
538
+ }
539
+ return 0;
540
+ }),
541
+ });
542
+ },
543
+ };
544
+ };
545
+ FsAclRoleComponent.prototype.levelChange = function () {
546
+ var _this = this;
547
+ this._updatePermissions();
548
+ this._updateAclRoleConfigs();
549
+ setTimeout(function () {
550
+ _this.list.reload();
551
+ });
552
+ };
553
+ FsAclRoleComponent.prototype.getRole = function () {
554
+ if (!this._data.aclRole.id) {
555
+ return rxjs.of(this._data.aclRole);
556
+ }
557
+ var query = {
558
+ aclPermissions: true,
559
+ aclRoleConfigs: true,
560
+ };
561
+ if (!this.environment) {
562
+ query.environmentId = null;
563
+ }
564
+ return this._data.loadAclRole(this._data.aclRole, query);
565
+ };
566
+ FsAclRoleComponent.prototype.close = function (data) {
567
+ if (data === void 0) { data = null; }
568
+ this._dialogRef.close(data);
569
+ };
570
+ FsAclRoleComponent.prototype.allPermissionsChange = function (all) {
571
+ this._updatePermissions();
572
+ if (all) {
573
+ this._applyMaxPermissionAccess();
574
+ }
575
+ };
576
+ FsAclRoleComponent.prototype.ngOnDestroy = function () {
577
+ this._destroy$.next();
578
+ this._destroy$.complete();
579
+ };
580
+ FsAclRoleComponent.prototype._updatePermissions = function () {
581
+ var _this = this;
582
+ this.levelPermissions = this.permissions.filter(function (permission) {
583
+ return permission.levels.some(function (item) {
584
+ return item === _this.aclRole.level;
585
+ });
586
+ });
587
+ };
588
+ FsAclRoleComponent.prototype._updateAclRoleConfigs = function () {
589
+ var _this = this;
590
+ this.levelAclRoleConfigs = this.aclRoleConfigs.filter(function (item) {
591
+ return _this.aclRole.level === item.level;
592
+ });
593
+ };
594
+ FsAclRoleComponent.prototype._applyMaxPermissionAccess = function () {
595
+ var _this = this;
596
+ this.permissions.forEach(function (permission) {
597
+ _this.aclRole.permissions[permission.value] = Math.max.apply(Math, __spreadArray([], __read(permission.accesses)));
598
+ });
599
+ };
600
+ return FsAclRoleComponent;
601
+ }());
602
+ FsAclRoleComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAclRoleComponent, deps: [{ token: FsAppAclService }, { token: i2__namespace.MatDialogRef }, { token: i3__namespace.FsMessage }, { token: i2.MAT_DIALOG_DATA }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
603
+ FsAclRoleComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsAclRoleComponent, selector: "ng-component", viewQueries: [{ propertyName: "list", first: true, predicate: i12.FsListComponent, descendants: true }], ngImport: i0__namespace, template: "<form fsForm [submit]=\"save\">\n <fs-dialog>\n <ng-container *ngIf=\"aclRole\">\n <div mat-dialog-title>{{ aclRole.id ? 'Edit' : 'Create' }} Role</div>\n <mat-dialog-content>\n <div fxLayout=\"row\" fxLayout.lt-md=\"column\" fxLayoutGap=\"40px\" fxLayoutGap.lt-md=\"0\">\n <div fxLayout=\"column\" fxFlex fxFlex.lt-md=\"0\">\n <mat-form-field>\n <input matInput placeholder=\"Name\" [(ngModel)]=\"aclRole.name\" name=\"name\" fsFormRequired>\n </mat-form-field>\n\n <fs-label-field *ngIf=\"aclRole.id || aclLevels.length === 1; else levels\">\n <fs-label>Level</fs-label>\n {{indexedAclLevels[aclRole.level]}}\n </fs-label-field>\n\n <ng-template #levels>\n <div class=\"level\">\n <fs-radio-group\n [(ngModel)]=\"aclRole.level\"\n (ngModelChange)=\"levelChange()\"\n fsFormRequired\n label=\"Level\"\n orientation=\"vertical\"\n name=\"level\">\n <mat-radio-button\n *ngFor=\"let item of aclLevels\"\n [value]=\"item.value\"\n [disabled]=\"!!aclRole.protected\">\n {{ item.name }}\n </mat-radio-button>\n </fs-radio-group>\n </div>\n </ng-template>\n\n <fs-label-field *ngIf=\"levelPermissions.length\">\n <fs-label>All Permissions</fs-label>\n <mat-checkbox\n [(ngModel)]=\"aclRole.allPermissions\"\n (ngModelChange)=\"allPermissionsChange($event)\"\n [disabled]=\"!!aclRole.protected\"\n name=\"allPermissions\">\n </mat-checkbox>\n </fs-label-field>\n\n <div fxLayout=\"column\" *ngFor=\"let config of levelAclRoleConfigs\">\n <fs-label-field *ngIf=\"config.interface === 'checkbox'\">\n <fs-label>{{config.name}}</fs-label>\n <mat-checkbox\n [(ngModel)]=\"config.data\"\n [name]=\"config.name\">\n </mat-checkbox>\n <fs-label-message>\n <mat-hint>{{config.description}}</mat-hint>\n </fs-label-message>\n </fs-label-field>\n\n <mat-form-field *ngIf=\"config.interface === 'select'\">\n <mat-select\n [(ngModel)]=\"config.data\"\n [name]=\"config.value\"\n [required]=\"config.required\"\n [placeholder]=\"config.name\">\n <mat-option\n *ngFor=\"let item of config.values\"\n [value]=\"item.value\">\n {{ item.name }}\n </mat-option>\n </mat-select>\n <mat-hint>{{config.description}}</mat-hint>\n </mat-form-field>\n </div>\n </div>\n\n <div fxLayout=\"column\" fxFlex=\"65\" fxFlex.lt-md=\"0\" *ngIf=\"aclRole.level\" [hidden]=\"!levelPermissions.length\" class=\"permissions\">\n\n <fs-list [config]=\"listConfig\">\n <fs-list-column title=\"Permissions\">\n <ng-template colspan=\"2\" fs-list-group-cell let-row=\"row\" class=\"permission-group\">\n <small><b>{{row.category || 'General'}}</b></small>\n </ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <div class=\"permission\">{{ row.name }}</div>\n <div class=\"description small\">{{ row.description }}</div>\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Access\" width=\"1%\" class=\"access\">\n <ng-template fs-list-cell let-row=\"permission\" let-permission=\"row\">\n <span *ngIf=\"aclRole.allPermissions; else elseAll\">\n {{ indexedAccesses[aclRole.permissions[permission.value]] }}\n </span>\n <ng-template #elseAll>\n <mat-form-field>\n <mat-select\n [(ngModel)]=\"aclRole.permissions[permission.value]\"\n [disabled]=\"!!aclRole.protected\"\n fsFormRequired\n name=\"access-{{ permission.value }}\">\n <ng-container *ngFor=\"let access of AclRoleAccesses\">\n <mat-option\n *ngIf=\"access.value === 0 || permission.accesses.indexOf(access.value) !== -1\"\n [value]=\"access.value\">\n {{ access.name }}\n </mat-option>\n </ng-container>\n </mat-select>\n </mat-form-field>\n </ng-template>\n </ng-template>\n </fs-list-column>\n </fs-list>\n </div>\n </div>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-button type=\"submit\" color=\"primary\">{{ aclRole.id ? 'Save' : 'Create' }}</button>\n <button mat-button [mat-dialog-close]=\"null\" type=\"button\">Cancel</button>\n </mat-dialog-actions>\n </ng-container>\n </fs-dialog>\n</form>\n", styles: [":host .permissions ::ng-deep .fs-list-row-group{background-color:#f6f6f6}:host .permissions ::ng-deep fs-list .access{white-space:nowrap}:host .permissions ::ng-deep .mat-form-field{width:100px}:host .permissions ::ng-deep .mat-form-field .mat-form-field-wrapper{padding-bottom:0}:host .permissions ::ng-deep .mat-form-field .mat-form-field-infix{border-top:0}:host .permissions ::ng-deep .mat-form-field .mat-form-field-underline{bottom:0}:host ::ng-deep fs-radio-group{width:100%}:host ::ng-deep fs-label-field{width:100%}:host .level{width:100%}\n"], components: [{ type: i4__namespace.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode"] }, { type: i5__namespace.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i6__namespace.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { type: i6__namespace.FsLabelComponent, selector: "fs-label" }, { type: i7__namespace.FsRadioGroupComponent, selector: "fs-radio-group", inputs: ["orientation", "label", "name", "disabled", "radioPosition", "compareWith", "required"] }, { type: i8__namespace.MatRadioButton, selector: "mat-radio-button", inputs: ["disableRipple", "tabIndex"], exportAs: ["matRadioButton"] }, { type: i9__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: i6__namespace.FsLabelMessageComponent, selector: "fs-label-message" }, { type: i10__namespace.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i11__namespace.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i12__namespace.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { type: i13__namespace.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i14__namespace.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i14__namespace.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i14__namespace.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i15__namespace.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"] }, { type: i7__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2__namespace.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i2__namespace.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i17__namespace.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { type: i17__namespace.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { type: i17__namespace.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { type: i18__namespace.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i14__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: i15__namespace.FsFormRequiredDirective, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }, { type: i14__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i14__namespace.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i7__namespace$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5__namespace.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { type: i14__namespace.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i12__namespace.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i12__namespace.FsListGroupHeaderDirective, selector: "[fs-list-group-cell],[fs-list-group-header]" }, { type: i12__namespace.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { type: i2__namespace.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i15__namespace.FsSubmitButtonDirective, selector: "button[type=\"submit\"]", inputs: ["name", "dirtySubmit"] }, { type: i2__namespace.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["type", "mat-dialog-close", "aria-label", "matDialogClose"], exportAs: ["matDialogClose"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
604
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAclRoleComponent, decorators: [{
605
+ type: i0.Component,
606
+ args: [{
607
+ templateUrl: './acl-role.component.html',
608
+ styleUrls: ['./acl-role.component.scss'],
609
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
610
+ }]
611
+ }], ctorParameters: function () {
612
+ return [{ type: FsAppAclService }, { type: i2__namespace.MatDialogRef }, { type: i3__namespace.FsMessage }, { type: undefined, decorators: [{
613
+ type: i0.Inject,
614
+ args: [i2.MAT_DIALOG_DATA]
615
+ }] }, { type: i0__namespace.ChangeDetectorRef }];
616
+ }, propDecorators: { list: [{
617
+ type: i0.ViewChild,
618
+ args: [i12.FsListComponent]
645
619
  }] } });
646
620
 
647
- var FsAclPermissionPopoverComponent = /** @class */ (function () {
648
- function FsAclPermissionPopoverComponent(_appAclService) {
649
- this._appAclService = _appAclService;
650
- }
651
- FsAclPermissionPopoverComponent.prototype.ngOnInit = function () {
652
- var _this = this;
653
- this._appAclService.getPermissions()
654
- .subscribe(function (permissions) {
655
- _this.description = permissions.filter(function (item) {
656
- return item.value === _this.permission.value;
657
- }).map(function (item) {
658
- return item.description;
659
- })[0];
660
- });
661
- };
662
- return FsAclPermissionPopoverComponent;
663
- }());
664
- FsAclPermissionPopoverComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAclPermissionPopoverComponent, deps: [{ token: FsAppAclService }], target: i0__namespace.ɵɵFactoryTarget.Component });
665
- FsAclPermissionPopoverComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsAclPermissionPopoverComponent, selector: "acl-permission-popover", inputs: { permission: "permission" }, ngImport: i0__namespace, template: "\n<fs-popover [template]=\"popover\" maxWidth=\"400\">\n <ng-content></ng-content>\n</fs-popover>\n\n<ng-template #popover>\n {{permission.name}}\n <div class=\"small\">{{description}}</div>\n</ng-template>\n\n", styles: [":host{cursor:pointer}\n"], components: [{ type: i2__namespace$1.FsPopoverComponent, selector: "fs-popover", inputs: ["template", "data", "leaveDelay", "showDelay", "maxWidth", "wrapperClass", "autoShow", "autoClose", "loadingDiameter", "loading", "indication", "position", "theme", "size", "trigger"] }] });
666
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAclPermissionPopoverComponent, decorators: [{
667
- type: i0.Component,
668
- args: [{
669
- selector: 'acl-permission-popover',
670
- templateUrl: './acl-permission-popover.component.html',
671
- styleUrls: ['./acl-permission-popover.component.scss']
672
- }]
673
- }], ctorParameters: function () { return [{ type: FsAppAclService }]; }, propDecorators: { permission: [{
674
- type: i0.Input
621
+ var FsAclPermissionPopoverComponent = /** @class */ (function () {
622
+ function FsAclPermissionPopoverComponent(_appAclService) {
623
+ this._appAclService = _appAclService;
624
+ }
625
+ FsAclPermissionPopoverComponent.prototype.ngOnInit = function () {
626
+ var _this = this;
627
+ this._appAclService.getPermissions()
628
+ .subscribe(function (permissions) {
629
+ _this.description = permissions.filter(function (item) {
630
+ return item.value === _this.permission.value;
631
+ }).map(function (item) {
632
+ return item.description;
633
+ })[0];
634
+ });
635
+ };
636
+ return FsAclPermissionPopoverComponent;
637
+ }());
638
+ FsAclPermissionPopoverComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAclPermissionPopoverComponent, deps: [{ token: FsAppAclService }], target: i0__namespace.ɵɵFactoryTarget.Component });
639
+ FsAclPermissionPopoverComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsAclPermissionPopoverComponent, selector: "acl-permission-popover", inputs: { permission: "permission" }, ngImport: i0__namespace, template: "\n<fs-popover [template]=\"popover\" maxWidth=\"400\">\n <ng-content></ng-content>\n</fs-popover>\n\n<ng-template #popover>\n {{permission.name}}\n <div class=\"small\">{{description}}</div>\n</ng-template>\n\n", styles: [":host{cursor:pointer}\n"], components: [{ type: i2__namespace$1.FsPopoverComponent, selector: "fs-popover", inputs: ["template", "data", "leaveDelay", "showDelay", "maxWidth", "wrapperClass", "autoShow", "autoClose", "loadingDiameter", "loading", "indication", "position", "theme", "size", "trigger"] }] });
640
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAclPermissionPopoverComponent, decorators: [{
641
+ type: i0.Component,
642
+ args: [{
643
+ selector: 'acl-permission-popover',
644
+ templateUrl: './acl-permission-popover.component.html',
645
+ styleUrls: ['./acl-permission-popover.component.scss']
646
+ }]
647
+ }], ctorParameters: function () { return [{ type: FsAppAclService }]; }, propDecorators: { permission: [{
648
+ type: i0.Input
675
649
  }] } });
676
650
 
677
- var FsAclRolesComponent = /** @class */ (function () {
678
- function FsAclRolesComponent(_appAclService, _dialog, _cdRef) {
679
- this._appAclService = _appAclService;
680
- this._dialog = _dialog;
681
- this._cdRef = _cdRef;
682
- this.aclLevels = [];
683
- this.list = new i0.QueryList();
684
- this.indexedAclRoleLevels = {};
685
- this._destroy$ = new rxjs.Subject();
686
- }
687
- FsAclRolesComponent.prototype.ngOnInit = function () {
688
- var _this = this;
689
- new rxjs.Observable(function (observer) {
690
- if (_this.aclLevels.length) {
691
- observer.next(_this.aclLevels);
692
- observer.complete();
693
- }
694
- else {
695
- _this._appAclService.getLevels()
696
- .subscribe(function (aclLevels) {
697
- observer.next(aclLevels);
698
- observer.complete();
699
- });
700
- }
701
- })
702
- .subscribe(function (aclLevels) {
703
- _this.aclLevels = aclLevels;
704
- _this.indexedAclRoleLevels = common.list(_this.aclLevels, 'name', 'value');
705
- _this._loadListConfig();
706
- });
707
- };
708
- FsAclRolesComponent.prototype.openDialog = function (aclRole) {
709
- var _this = this;
710
- if (aclRole === void 0) { aclRole = { id: null }; }
711
- var dialogRef = this._dialog.open(FsAclRoleComponent, {
712
- width: '70%',
713
- data: {
714
- aclRole: aclRole,
715
- aclLevels: this.aclLevels,
716
- loadAclRole: this.loadAclRole,
717
- saveAclRole: this.saveAclRole,
718
- },
719
- });
720
- dialogRef.afterClosed()
721
- .pipe(operators.takeUntil(this._destroy$), operators.filter(function (response) { return !!response; }))
722
- .subscribe(function (response) {
723
- _this.list.forEach(function (list) {
724
- list.reload();
725
- });
726
- });
727
- };
728
- FsAclRolesComponent.prototype.ngOnDestroy = function () {
729
- this._destroy$.next();
730
- this._destroy$.complete();
731
- };
732
- FsAclRolesComponent.prototype._loadListConfig = function () {
733
- var _this = this;
734
- this.listConfig = {
735
- sort: { value: 'hierarchy' },
736
- filters: [
737
- {
738
- name: 'keyword',
739
- type: filter.ItemType.Keyword,
740
- label: 'Search',
741
- },
742
- {
743
- name: 'level',
744
- label: 'Level',
745
- type: filter.ItemType.Select,
746
- values: this.aclLevels,
747
- hide: this.aclLevels.length <= 1
748
- },
749
- {
750
- name: 'state',
751
- label: 'Show Deleted',
752
- type: filter.ItemType.Checkbox,
753
- unchecked: 'active',
754
- checked: 'deleted',
755
- },
756
- ],
757
- actions: [
758
- {
759
- click: function (event) {
760
- _this.openDialog();
761
- },
762
- label: 'Create',
763
- },
764
- ],
765
- rowActions: [
766
- {
767
- click: function (data) {
768
- return _this.deleteAclRole(_this._appAclService.output(data));
769
- },
770
- remove: {
771
- title: 'Confirm',
772
- template: 'Are you sure you would like to delete this role?',
773
- },
774
- menu: true,
775
- label: 'Delete',
776
- show: function (row) { return row.state !== 'deleted'; },
777
- },
778
- ],
779
- fetch: function (query) {
780
- query.permissions = true;
781
- return _this.loadAclRoles(query)
782
- .pipe(operators.map(function (data) { return _this._appAclService.input(data); }));
783
- },
784
- };
785
- };
786
- return FsAclRolesComponent;
787
- }());
788
- FsAclRolesComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAclRolesComponent, deps: [{ token: FsAppAclService }, { token: i2__namespace.MatDialog }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
789
- FsAclRolesComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsAclRolesComponent, selector: "fs-acl-roles", inputs: { deleteAclRole: "deleteAclRole", saveAclRole: "saveAclRole", loadAclRoles: "loadAclRoles", loadAclRole: "loadAclRole", aclLevels: "aclLevels" }, viewQueries: [{ propertyName: "list", predicate: i12.FsListComponent, descendants: true }], ngImport: i0__namespace, template: "<fs-list [config]=\"listConfig\" *ngIf=\"listConfig\">\n <fs-list-column title=\"Name\" name=\"name\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n <a (click)=\"openDialog(row)\">{{ row.name }}</a>\n </ng-template>\n </fs-list-column>\n <fs-list-column name=\"hierarchy\" title=\"Level\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n {{ indexedAclRoleLevels[row.level] }}\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Permissions\">\n <ng-template fs-list-cell let-row=\"row\">\n <div class=\"permissions\">\n <ng-container *ngFor=\"let permission of row.permissions\">\n <span *ngIf=\"permission.access\" class=\"permission\">\n <acl-permission-popover [permission]=\"permission\">{{permission.name}}</acl-permission-popover>\n </span>\n </ng-container>\n </div>\n </ng-template>\n </fs-list-column>\n</fs-list>\n", styles: [".permissions .permission+.permission:before{content:\", \"}\n"], components: [{ type: i12__namespace.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { type: FsAclPermissionPopoverComponent, selector: "acl-permission-popover", inputs: ["permission"] }], directives: [{ type: i7__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i12__namespace.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i12__namespace.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { type: i7__namespace$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
790
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAclRolesComponent, decorators: [{
791
- type: i0.Component,
792
- args: [{
793
- selector: 'fs-acl-roles',
794
- templateUrl: 'acl-roles.component.html',
795
- styleUrls: ['acl-roles.component.scss'],
796
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
797
- }]
798
- }], ctorParameters: function () { return [{ type: FsAppAclService }, { type: i2__namespace.MatDialog }, { type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { deleteAclRole: [{
799
- type: i0.Input
800
- }], saveAclRole: [{
801
- type: i0.Input
802
- }], loadAclRoles: [{
803
- type: i0.Input
804
- }], loadAclRole: [{
805
- type: i0.Input
806
- }], aclLevels: [{
807
- type: i0.Input
808
- }], list: [{
809
- type: i0.ViewChildren,
810
- args: [i12.FsListComponent]
651
+ var FsAclRolesComponent = /** @class */ (function () {
652
+ function FsAclRolesComponent(_appAclService, _dialog, _cdRef) {
653
+ this._appAclService = _appAclService;
654
+ this._dialog = _dialog;
655
+ this._cdRef = _cdRef;
656
+ this.aclLevels = [];
657
+ this.list = new i0.QueryList();
658
+ this.indexedAclRoleLevels = {};
659
+ this._destroy$ = new rxjs.Subject();
660
+ }
661
+ FsAclRolesComponent.prototype.ngOnInit = function () {
662
+ var _this = this;
663
+ new rxjs.Observable(function (observer) {
664
+ if (_this.aclLevels.length) {
665
+ observer.next(_this.aclLevels);
666
+ observer.complete();
667
+ }
668
+ else {
669
+ _this._appAclService.getLevels()
670
+ .subscribe(function (aclLevels) {
671
+ observer.next(aclLevels);
672
+ observer.complete();
673
+ });
674
+ }
675
+ })
676
+ .subscribe(function (aclLevels) {
677
+ _this.aclLevels = aclLevels;
678
+ _this.indexedAclRoleLevels = common.list(_this.aclLevels, 'name', 'value');
679
+ _this._loadListConfig();
680
+ });
681
+ };
682
+ FsAclRolesComponent.prototype.openDialog = function (aclRole) {
683
+ var _this = this;
684
+ if (aclRole === void 0) { aclRole = { id: null }; }
685
+ var dialogRef = this._dialog.open(FsAclRoleComponent, {
686
+ width: '70%',
687
+ data: {
688
+ aclRole: aclRole,
689
+ aclLevels: this.aclLevels,
690
+ loadAclRole: this.loadAclRole,
691
+ saveAclRole: this.saveAclRole,
692
+ },
693
+ });
694
+ dialogRef.afterClosed()
695
+ .pipe(operators.takeUntil(this._destroy$), operators.filter(function (response) { return !!response; }))
696
+ .subscribe(function (response) {
697
+ _this.list.forEach(function (list) {
698
+ list.reload();
699
+ });
700
+ });
701
+ };
702
+ FsAclRolesComponent.prototype.ngOnDestroy = function () {
703
+ this._destroy$.next();
704
+ this._destroy$.complete();
705
+ };
706
+ FsAclRolesComponent.prototype._loadListConfig = function () {
707
+ var _this = this;
708
+ this.listConfig = {
709
+ sort: { value: 'hierarchy' },
710
+ filters: [
711
+ {
712
+ name: 'keyword',
713
+ type: filter.ItemType.Keyword,
714
+ label: 'Search',
715
+ },
716
+ {
717
+ name: 'level',
718
+ label: 'Level',
719
+ type: filter.ItemType.Select,
720
+ values: this.aclLevels,
721
+ hide: this.aclLevels.length <= 1
722
+ },
723
+ {
724
+ name: 'state',
725
+ label: 'Show Deleted',
726
+ type: filter.ItemType.Checkbox,
727
+ unchecked: 'active',
728
+ checked: 'deleted',
729
+ },
730
+ ],
731
+ actions: [
732
+ {
733
+ click: function (event) {
734
+ _this.openDialog();
735
+ },
736
+ label: 'Create',
737
+ },
738
+ ],
739
+ rowActions: [
740
+ {
741
+ click: function (data) {
742
+ return _this.deleteAclRole(data);
743
+ },
744
+ remove: {
745
+ title: 'Confirm',
746
+ template: 'Are you sure you would like to delete this role?',
747
+ },
748
+ menu: true,
749
+ label: 'Delete',
750
+ show: function (row) { return row.state !== 'deleted'; },
751
+ },
752
+ ],
753
+ fetch: function (query) {
754
+ query.permissions = true;
755
+ return _this.loadAclRoles(query)
756
+ .pipe(operators.map(function (data) { return data; }));
757
+ },
758
+ };
759
+ };
760
+ return FsAclRolesComponent;
761
+ }());
762
+ FsAclRolesComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAclRolesComponent, deps: [{ token: FsAppAclService }, { token: i2__namespace.MatDialog }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
763
+ FsAclRolesComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsAclRolesComponent, selector: "fs-acl-roles", inputs: { deleteAclRole: "deleteAclRole", saveAclRole: "saveAclRole", loadAclRoles: "loadAclRoles", loadAclRole: "loadAclRole", aclLevels: "aclLevels" }, viewQueries: [{ propertyName: "list", predicate: i12.FsListComponent, descendants: true }], ngImport: i0__namespace, template: "<fs-list [config]=\"listConfig\" *ngIf=\"listConfig\">\n <fs-list-column title=\"Name\" name=\"name\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n <a (click)=\"openDialog(row)\">{{ row.name }}</a>\n </ng-template>\n </fs-list-column>\n <fs-list-column name=\"hierarchy\" title=\"Level\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n {{ indexedAclRoleLevels[row.level] }}\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Permissions\">\n <ng-template fs-list-cell let-row=\"row\">\n <div class=\"permissions\">\n <ng-container *ngFor=\"let permission of row.permissions\">\n <span *ngIf=\"permission.access\" class=\"permission\">\n <acl-permission-popover [permission]=\"permission\">{{permission.name}}</acl-permission-popover>\n </span>\n </ng-container>\n </div>\n </ng-template>\n </fs-list-column>\n</fs-list>\n", styles: [".permissions .permission+.permission:before{content:\", \"}\n"], components: [{ type: i12__namespace.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { type: FsAclPermissionPopoverComponent, selector: "acl-permission-popover", inputs: ["permission"] }], directives: [{ type: i7__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i12__namespace.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i12__namespace.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { type: i7__namespace$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
764
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAclRolesComponent, decorators: [{
765
+ type: i0.Component,
766
+ args: [{
767
+ selector: 'fs-acl-roles',
768
+ templateUrl: 'acl-roles.component.html',
769
+ styleUrls: ['acl-roles.component.scss'],
770
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
771
+ }]
772
+ }], ctorParameters: function () { return [{ type: FsAppAclService }, { type: i2__namespace.MatDialog }, { type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { deleteAclRole: [{
773
+ type: i0.Input
774
+ }], saveAclRole: [{
775
+ type: i0.Input
776
+ }], loadAclRoles: [{
777
+ type: i0.Input
778
+ }], loadAclRole: [{
779
+ type: i0.Input
780
+ }], aclLevels: [{
781
+ type: i0.Input
782
+ }], list: [{
783
+ type: i0.ViewChildren,
784
+ args: [i12.FsListComponent]
811
785
  }] } });
812
786
 
813
- var FsAclRolePopoverComponent = /** @class */ (function () {
814
- function FsAclRolePopoverComponent(_appAclService) {
815
- this._appAclService = _appAclService;
816
- this.permissions = [];
817
- }
818
- FsAclRolePopoverComponent.prototype.ngOnInit = function () {
819
- var _this = this;
820
- var aclRolePermissions = this.aclRole.permissions || [];
821
- this._appAclService.getPermissions()
822
- .subscribe(function (response) {
823
- _this.permissions = response.filter(function (item) {
824
- return aclRolePermissions.some(function (permission) {
825
- return item.value === permission.value;
826
- });
827
- });
828
- });
829
- };
830
- return FsAclRolePopoverComponent;
831
- }());
832
- FsAclRolePopoverComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAclRolePopoverComponent, deps: [{ token: FsAppAclService }], target: i0__namespace.ɵɵFactoryTarget.Component });
833
- FsAclRolePopoverComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsAclRolePopoverComponent, selector: "fs-acl-role-popover", inputs: { aclRole: "aclRole", objectName: "objectName" }, ngImport: i0__namespace, template: "\n<fs-popover [template]=\"popover\" maxWidth=\"400\">\n <ng-content></ng-content>\n</fs-popover>\n\n<ng-template #popover>\n <div class=\"name small\">{{aclRole.name}}<span *ngIf=\"objectName\">: {{objectName}}</span></div>\n\n <ng-container *ngIf=\"permissions.length; else nonePermission\">\n <div *ngFor=\"let permission of permissions\" class=\"permission\">\n <div>{{permission.name}}</div>\n <div class=\"small\">{{permission.description}}</div>\n </div>\n </ng-container>\n\n <ng-template #nonePermission>\n None\n </ng-template>\n</ng-template>\n", styles: [".name{padding-bottom:10px}.permission+.permission{padding-top:5px}:host{cursor:pointer}\n"], components: [{ type: i2__namespace$1.FsPopoverComponent, selector: "fs-popover", inputs: ["template", "data", "leaveDelay", "showDelay", "maxWidth", "wrapperClass", "autoShow", "autoClose", "loadingDiameter", "loading", "indication", "position", "theme", "size", "trigger"] }], directives: [{ type: i7__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7__namespace$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
834
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAclRolePopoverComponent, decorators: [{
835
- type: i0.Component,
836
- args: [{
837
- selector: 'fs-acl-role-popover',
838
- templateUrl: './acl-role-popover.component.html',
839
- styleUrls: ['./acl-role-popover.component.scss']
840
- }]
841
- }], ctorParameters: function () { return [{ type: FsAppAclService }]; }, propDecorators: { aclRole: [{
842
- type: i0.Input
843
- }], objectName: [{
844
- type: i0.Input
787
+ var FsAclRolePopoverComponent = /** @class */ (function () {
788
+ function FsAclRolePopoverComponent(_appAclService) {
789
+ this._appAclService = _appAclService;
790
+ this.permissions = [];
791
+ }
792
+ FsAclRolePopoverComponent.prototype.ngOnInit = function () {
793
+ var _this = this;
794
+ var aclRolePermissions = this.aclRole.permissions || [];
795
+ this._appAclService.getPermissions()
796
+ .subscribe(function (response) {
797
+ _this.permissions = response.filter(function (item) {
798
+ return aclRolePermissions.some(function (permission) {
799
+ return item.value === permission.value;
800
+ });
801
+ });
802
+ });
803
+ };
804
+ return FsAclRolePopoverComponent;
805
+ }());
806
+ FsAclRolePopoverComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAclRolePopoverComponent, deps: [{ token: FsAppAclService }], target: i0__namespace.ɵɵFactoryTarget.Component });
807
+ FsAclRolePopoverComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsAclRolePopoverComponent, selector: "fs-acl-role-popover", inputs: { aclRole: "aclRole", objectName: "objectName" }, ngImport: i0__namespace, template: "\n<fs-popover [template]=\"popover\" maxWidth=\"400\">\n <ng-content></ng-content>\n</fs-popover>\n\n<ng-template #popover>\n <div class=\"name small\">{{aclRole.name}}<span *ngIf=\"objectName\">: {{objectName}}</span></div>\n\n <ng-container *ngIf=\"permissions.length; else nonePermission\">\n <div *ngFor=\"let permission of permissions\" class=\"permission\">\n <div>{{permission.name}}</div>\n <div class=\"small\">{{permission.description}}</div>\n </div>\n </ng-container>\n\n <ng-template #nonePermission>\n None\n </ng-template>\n</ng-template>\n", styles: [".name{padding-bottom:10px}.permission+.permission{padding-top:5px}:host{cursor:pointer}\n"], components: [{ type: i2__namespace$1.FsPopoverComponent, selector: "fs-popover", inputs: ["template", "data", "leaveDelay", "showDelay", "maxWidth", "wrapperClass", "autoShow", "autoClose", "loadingDiameter", "loading", "indication", "position", "theme", "size", "trigger"] }], directives: [{ type: i7__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7__namespace$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
808
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAclRolePopoverComponent, decorators: [{
809
+ type: i0.Component,
810
+ args: [{
811
+ selector: 'fs-acl-role-popover',
812
+ templateUrl: './acl-role-popover.component.html',
813
+ styleUrls: ['./acl-role-popover.component.scss']
814
+ }]
815
+ }], ctorParameters: function () { return [{ type: FsAppAclService }]; }, propDecorators: { aclRole: [{
816
+ type: i0.Input
817
+ }], objectName: [{
818
+ type: i0.Input
845
819
  }] } });
846
820
 
847
- var FsAclObjectRolesComponent = /** @class */ (function () {
848
- function FsAclObjectRolesComponent() {
849
- this.aclRoles = [];
850
- this.required = false;
851
- this.multiple = false;
852
- this.disabled = false;
853
- this.aclObjectRoles = [];
854
- this.rolesLabel = 'Roles';
855
- this.levelLabel = '';
856
- this.change = new i0.EventEmitter();
857
- this.compareAclRole = function (o1, o2) {
858
- return o1 && o2 && o1.id === o2.id;
859
- };
860
- }
861
- FsAclObjectRolesComponent.prototype.changed = function () {
862
- this.change.emit(this.aclObjectRoles);
863
- };
864
- return FsAclObjectRolesComponent;
865
- }());
866
- FsAclObjectRolesComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAclObjectRolesComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
867
- FsAclObjectRolesComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsAclObjectRolesComponent, selector: "fs-acl-object-roles", inputs: { aclRoles: "aclRoles", required: "required", multiple: "multiple", disabled: "disabled", aclObjectRoles: "aclObjectRoles", rolesLabel: "rolesLabel", levelLabel: "levelLabel" }, outputs: { change: "change" }, ngImport: i0__namespace, template: "<ng-container *ngIf=\"!multiple\">\n <ng-container *ngFor=\"let aclObjectRole of aclObjectRoles\">\n <fs-checkbox-group\n [(ngModel)]=\"aclObjectRole.aclRoles\"\n (ngModelChange)=\"changed()\"\n name=\"roles\"\n [compareWith]=\"compareAclRole\"\n [disabled]=\"disabled\"\n [label]=\"rolesLabel\"\n [fsFormRequired]=\"required\"\n orientation=\"vertical\">\n <mat-checkbox [disabled]=\"disabled\" *ngFor=\"let aclRole of aclRoles\" [value]=\"aclRole\">\n {{ aclRole.name }}\n </mat-checkbox>\n </fs-checkbox-group>\n </ng-container>\n</ng-container>\n\n<ng-container *ngIf=\"multiple\">\n <table>\n <tr>\n <td>\n <small>{{levelLabel}}</small>\n </td>\n <td>\n <small>{{rolesLabel}}</small>\n </td>\n </tr>\n <tr *ngFor=\"let aclObjectRole of aclObjectRoles\">\n <td>{{aclObjectRole.object.name}}</td>\n <td>\n <mat-form-field class=\"form-field-padless\">\n <mat-select\n [(ngModel)]=\"aclObjectRole.aclRoles\"\n multiple=\"true\"\n [disabled]=\"disabled\"\n [compareWith]=\"compareAclRole\"\n (ngModelChange)=\"changed()\"\n name=\"aclRole_{{ aclObjectRole.object.id }}\">\n <mat-option *ngFor=\"let aclRole of aclRoles\" [value]=\"aclRole\">\n {{ aclRole.name }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </td>\n </tr>\n </table>\n</ng-container>\n", styles: ["table tr td:first-child{padding-right:15px}\n"], components: [{ type: i1__namespace.FsCheckboxGroupComponent, selector: "fs-checkbox-group", inputs: ["orientation", "position", "label", "disabled", "compareWith"], outputs: ["change"] }, { type: i9__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: i5__namespace.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i10__namespace.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i11__namespace.MatOption, selector: "mat-option", exportAs: ["matOption"] }], directives: [{ type: i7__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7__namespace$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i14__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i14__namespace.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i15__namespace.FsFormRequiredDirective, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }], viewProviders: [{ provide: i14.ControlContainer, useExisting: i14.NgForm }] });
868
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAclObjectRolesComponent, decorators: [{
869
- type: i0.Component,
870
- args: [{
871
- selector: 'fs-acl-object-roles',
872
- templateUrl: './acl-object-roles.component.html',
873
- styleUrls: ['./acl-object-roles.component.scss'],
874
- viewProviders: [{ provide: i14.ControlContainer, useExisting: i14.NgForm }]
875
- }]
876
- }], propDecorators: { aclRoles: [{
877
- type: i0.Input
878
- }], required: [{
879
- type: i0.Input
880
- }], multiple: [{
881
- type: i0.Input
882
- }], disabled: [{
883
- type: i0.Input
884
- }], aclObjectRoles: [{
885
- type: i0.Input
886
- }], rolesLabel: [{
887
- type: i0.Input
888
- }], levelLabel: [{
889
- type: i0.Input
890
- }], change: [{
891
- type: i0.Output
821
+ var FsAclObjectRolesComponent = /** @class */ (function () {
822
+ function FsAclObjectRolesComponent() {
823
+ this.aclRoles = [];
824
+ this.required = false;
825
+ this.multiple = false;
826
+ this.disabled = false;
827
+ this.aclObjectRoles = [];
828
+ this.rolesLabel = 'Roles';
829
+ this.levelLabel = '';
830
+ this.change = new i0.EventEmitter();
831
+ this.compareAclRole = function (o1, o2) {
832
+ return o1 && o2 && o1.id === o2.id;
833
+ };
834
+ }
835
+ FsAclObjectRolesComponent.prototype.changed = function () {
836
+ this.change.emit(this.aclObjectRoles);
837
+ };
838
+ return FsAclObjectRolesComponent;
839
+ }());
840
+ FsAclObjectRolesComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAclObjectRolesComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
841
+ FsAclObjectRolesComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsAclObjectRolesComponent, selector: "fs-acl-object-roles", inputs: { aclRoles: "aclRoles", required: "required", multiple: "multiple", disabled: "disabled", aclObjectRoles: "aclObjectRoles", rolesLabel: "rolesLabel", levelLabel: "levelLabel" }, outputs: { change: "change" }, ngImport: i0__namespace, template: "<ng-container *ngIf=\"!multiple\">\n <ng-container *ngFor=\"let aclObjectRole of aclObjectRoles\">\n <fs-checkbox-group\n [(ngModel)]=\"aclObjectRole.aclRoles\"\n (ngModelChange)=\"changed()\"\n name=\"roles\"\n [compareWith]=\"compareAclRole\"\n [disabled]=\"disabled\"\n [label]=\"rolesLabel\"\n [fsFormRequired]=\"required\"\n orientation=\"vertical\">\n <mat-checkbox [disabled]=\"disabled\" *ngFor=\"let aclRole of aclRoles\" [value]=\"aclRole\">\n {{ aclRole.name }}\n </mat-checkbox>\n </fs-checkbox-group>\n </ng-container>\n</ng-container>\n\n<ng-container *ngIf=\"multiple\">\n <table>\n <tr>\n <td>\n <small>{{levelLabel}}</small>\n </td>\n <td>\n <small>{{rolesLabel}}</small>\n </td>\n </tr>\n <tr *ngFor=\"let aclObjectRole of aclObjectRoles\">\n <td>{{aclObjectRole.object.name}}</td>\n <td>\n <mat-form-field class=\"form-field-padless\">\n <mat-select\n [(ngModel)]=\"aclObjectRole.aclRoles\"\n multiple=\"true\"\n [disabled]=\"disabled\"\n [compareWith]=\"compareAclRole\"\n (ngModelChange)=\"changed()\"\n name=\"aclRole_{{ aclObjectRole.object.id }}\">\n <mat-option *ngFor=\"let aclRole of aclRoles\" [value]=\"aclRole\">\n {{ aclRole.name }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </td>\n </tr>\n </table>\n</ng-container>\n", styles: ["table tr td:first-child{padding-right:15px}\n"], components: [{ type: i1__namespace.FsCheckboxGroupComponent, selector: "fs-checkbox-group", inputs: ["orientation", "position", "label", "disabled", "compareWith"], outputs: ["change"] }, { type: i9__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: i5__namespace.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i10__namespace.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i11__namespace.MatOption, selector: "mat-option", exportAs: ["matOption"] }], directives: [{ type: i7__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7__namespace$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i14__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i14__namespace.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i15__namespace.FsFormRequiredDirective, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }], viewProviders: [{ provide: i14.ControlContainer, useExisting: i14.NgForm }] });
842
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAclObjectRolesComponent, decorators: [{
843
+ type: i0.Component,
844
+ args: [{
845
+ selector: 'fs-acl-object-roles',
846
+ templateUrl: './acl-object-roles.component.html',
847
+ styleUrls: ['./acl-object-roles.component.scss'],
848
+ viewProviders: [{ provide: i14.ControlContainer, useExisting: i14.NgForm }]
849
+ }]
850
+ }], propDecorators: { aclRoles: [{
851
+ type: i0.Input
852
+ }], required: [{
853
+ type: i0.Input
854
+ }], multiple: [{
855
+ type: i0.Input
856
+ }], disabled: [{
857
+ type: i0.Input
858
+ }], aclObjectRoles: [{
859
+ type: i0.Input
860
+ }], rolesLabel: [{
861
+ type: i0.Input
862
+ }], levelLabel: [{
863
+ type: i0.Input
864
+ }], change: [{
865
+ type: i0.Output
892
866
  }] } });
893
867
 
894
- var FsAclEntryComponent = /** @class */ (function () {
895
- function FsAclEntryComponent(_appAclService, _dialogRef, _message, _data) {
896
- var _this = this;
897
- var _a;
898
- this._appAclService = _appAclService;
899
- this._dialogRef = _dialogRef;
900
- this._message = _message;
901
- this._data = _data;
902
- this.aclRoles = [];
903
- this.indexedAclRoleLevels = {};
904
- this.titleEdit = 'Edit Roles';
905
- this.titleAdd = 'Assign Roles';
906
- this.required = true;
907
- this.save = function () {
908
- return _this._data.saveAclObjectEntry(_this._appAclService.output(_this.aclObjectEntry))
909
- .subscribe(function (data) {
910
- _this._message.success('Saved Changes');
911
- _this.close(data);
912
- });
913
- };
914
- this.aclObjectEntry = Object.assign({}, _data.aclObjectEntry);
915
- this.required = (_a = _data.required) !== null && _a !== void 0 ? _a : true;
916
- if (_data.titleEdit) {
917
- this.titleEdit = _data.titleEdit;
918
- }
919
- if (_data.titleAdd) {
920
- this.titleAdd = _data.titleAdd;
921
- }
922
- }
923
- FsAclEntryComponent.prototype.ngOnInit = function () {
924
- var _this = this;
925
- rxjs.forkJoin(this._data.loadAclRoles({
926
- level: this.aclObjectEntry.level,
927
- environmentId: this.aclObjectEntry.environmentId,
928
- })
929
- .pipe(operators.map(function (data) { return _this._appAclService.input(data); })), this._appAclService.getIndexedLevels())
930
- .subscribe(function (_b) {
931
- var _c = __read(_b, 2), aclRoles = _c[0], levels = _c[1];
932
- _this.aclRoles = aclRoles;
933
- _this.indexedAclRoleLevels = levels;
934
- _this.aclObjectRole = {
935
- object: _this.aclObjectEntry.object,
936
- aclRoles: _this.aclObjectEntry.aclEntries
937
- .map(function (aclEntry) {
938
- return aclEntry.aclRole;
939
- })
940
- };
941
- });
942
- };
943
- FsAclEntryComponent.prototype.aclObjectRoleChange = function (aclObjectRoles) {
944
- this.aclObjectEntry.aclEntries = aclObjectRoles.reduce(function (aclEntries, aclObjectRole) {
945
- aclObjectRole.aclRoles.forEach(function (aclRole) {
946
- aclEntries.push({
947
- aclRoleId: aclRole.id,
948
- aclRole: aclRole,
949
- objectId: aclObjectRole.object ? aclObjectRole.object.id : null,
950
- object: aclObjectRole.object || null
951
- });
952
- });
953
- return aclEntries;
954
- }, []);
955
- };
956
- FsAclEntryComponent.prototype.close = function (data) {
957
- if (data === void 0) { data = null; }
958
- this._dialogRef.close(data);
959
- };
960
- return FsAclEntryComponent;
961
- }());
962
- FsAclEntryComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAclEntryComponent, deps: [{ token: FsAppAclService }, { token: i2__namespace.MatDialogRef }, { token: i3__namespace.FsMessage }, { token: i2.MAT_DIALOG_DATA }], target: i0__namespace.ɵɵFactoryTarget.Component });
963
- FsAclEntryComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsAclEntryComponent, selector: "ng-component", ngImport: i0__namespace, template: "<form fsForm [submit]=\"save\">\n <fs-dialog>\n <div mat-dialog-title>{{ titleEdit? titleEdit : titleAdd }}</div>\n <mat-dialog-content>\n <div *ngIf=\"aclObjectRole\">\n <fs-label-field *ngIf=\"aclObjectEntry.object\">\n <fs-label>{{indexedAclRoleLevels[aclObjectEntry.level]}}</fs-label>\n {{aclObjectEntry.object.name}}\n </fs-label-field>\n\n <fs-acl-object-roles\n [aclRoles]=\"aclRoles\"\n [aclObjectRoles]=\"[aclObjectRole]\"\n [required]=\"required\"\n (change)=\"aclObjectRoleChange($event)\">\n </fs-acl-object-roles>\n </div>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-button type=\"submit\" color=\"primary\">Save</button>\n <button mat-button mat-dialog-close type=\"button\">Cancel</button>\n </mat-dialog-actions>\n </fs-dialog>\n</form>\n", styles: ["::ng-deep .account-roles-autocomplete-panel .mat-option{line-height:normal}::ng-deep .account-roles-autocomplete-panel .mat-option .mat-option-text{display:flex;flex-direction:row;align-items:center}::ng-deep .account-roles-autocomplete-panel .mat-option .mat-option-text fs-badge{margin-right:5px}\n"], components: [{ type: i4__namespace.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode"] }, { type: i6__namespace.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { type: i6__namespace.FsLabelComponent, selector: "fs-label" }, { type: FsAclObjectRolesComponent, selector: "fs-acl-object-roles", inputs: ["aclRoles", "required", "multiple", "disabled", "aclObjectRoles", "rolesLabel", "levelLabel"], outputs: ["change"] }, { type: i13__namespace.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i14__namespace.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i14__namespace.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i14__namespace.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i15__namespace.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"] }, { type: i2__namespace.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i2__namespace.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i7__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2__namespace.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i15__namespace.FsSubmitButtonDirective, selector: "button[type=\"submit\"]", inputs: ["name", "dirtySubmit"] }, { type: i2__namespace.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["type", "mat-dialog-close", "aria-label", "matDialogClose"], exportAs: ["matDialogClose"] }] });
964
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAclEntryComponent, decorators: [{
965
- type: i0.Component,
966
- args: [{
967
- templateUrl: './acl-entry.component.html',
968
- styleUrls: ['./acl-entry.component.scss'],
969
- }]
970
- }], ctorParameters: function () {
971
- return [{ type: FsAppAclService }, { type: i2__namespace.MatDialogRef }, { type: i3__namespace.FsMessage }, { type: undefined, decorators: [{
972
- type: i0.Inject,
973
- args: [i2.MAT_DIALOG_DATA]
974
- }] }];
868
+ var FsAclEntryComponent = /** @class */ (function () {
869
+ function FsAclEntryComponent(_appAclService, _dialogRef, _message, _data) {
870
+ var _this = this;
871
+ var _a;
872
+ this._appAclService = _appAclService;
873
+ this._dialogRef = _dialogRef;
874
+ this._message = _message;
875
+ this._data = _data;
876
+ this.aclRoles = [];
877
+ this.aclEntries = [];
878
+ this.indexedAclRoleLevels = {};
879
+ this.titleEdit = 'Edit Roles';
880
+ this.titleAdd = 'Assign Roles';
881
+ this.required = true;
882
+ this.save = function () {
883
+ var aclObjectEntry = Object.assign(Object.assign({}, _this.aclObjectEntry), { aclEntries: _this.aclEntries });
884
+ return _this._data.saveAclObjectEntry(aclObjectEntry)
885
+ .subscribe(function (data) {
886
+ _this._message.success('Saved Changes');
887
+ _this.close(data);
888
+ });
889
+ };
890
+ this.aclObjectEntry = Object.assign({}, _data.aclObjectEntry);
891
+ this.required = (_a = _data.required) !== null && _a !== void 0 ? _a : true;
892
+ if (_data.titleEdit) {
893
+ this.titleEdit = _data.titleEdit;
894
+ }
895
+ if (_data.titleAdd) {
896
+ this.titleAdd = _data.titleAdd;
897
+ }
898
+ }
899
+ FsAclEntryComponent.prototype.ngOnInit = function () {
900
+ var _this = this;
901
+ rxjs.forkJoin(this._data.loadAclRoles(this.aclObjectEntry), this._appAclService.getIndexedLevels())
902
+ .subscribe(function (_b) {
903
+ var _c = __read(_b, 2), aclRoles = _c[0], levels = _c[1];
904
+ _this.aclRoles = aclRoles;
905
+ _this.indexedAclRoleLevels = levels;
906
+ _this.aclObjectRole = {
907
+ object: _this.aclObjectEntry.object,
908
+ aclRoles: _this.aclObjectEntry.aclEntries
909
+ .map(function (aclEntry) {
910
+ return aclEntry.aclRole;
911
+ }),
912
+ };
913
+ });
914
+ };
915
+ FsAclEntryComponent.prototype.aclObjectRoleChange = function (aclObjectRoles) {
916
+ this.aclEntries = aclObjectRoles.reduce(function (aclEntries, aclObjectRole) {
917
+ aclObjectRole.aclRoles.forEach(function (aclRole) {
918
+ aclEntries.push({
919
+ aclRoleId: aclRole.id,
920
+ aclRole: aclRole,
921
+ objectId: aclObjectRole.object ? aclObjectRole.object.id : null,
922
+ object: aclObjectRole.object || null
923
+ });
924
+ });
925
+ return aclEntries;
926
+ }, []);
927
+ };
928
+ FsAclEntryComponent.prototype.close = function (data) {
929
+ if (data === void 0) { data = null; }
930
+ this._dialogRef.close(data);
931
+ };
932
+ return FsAclEntryComponent;
933
+ }());
934
+ FsAclEntryComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAclEntryComponent, deps: [{ token: FsAppAclService }, { token: i2__namespace.MatDialogRef }, { token: i3__namespace.FsMessage }, { token: i2.MAT_DIALOG_DATA }], target: i0__namespace.ɵɵFactoryTarget.Component });
935
+ FsAclEntryComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsAclEntryComponent, selector: "ng-component", ngImport: i0__namespace, template: "<form fsForm [submit]=\"save\">\n <fs-dialog>\n <div mat-dialog-title>{{ titleEdit? titleEdit : titleAdd }}</div>\n <mat-dialog-content>\n <div *ngIf=\"aclObjectRole\">\n <fs-label-field *ngIf=\"aclObjectEntry.object\">\n <fs-label>{{indexedAclRoleLevels[aclObjectEntry.level]}}</fs-label>\n {{aclObjectEntry.object.name}}\n </fs-label-field>\n\n <fs-acl-object-roles\n [aclRoles]=\"aclRoles\"\n [aclObjectRoles]=\"[aclObjectRole]\"\n [required]=\"required\"\n (change)=\"aclObjectRoleChange($event)\">\n </fs-acl-object-roles>\n </div>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-button type=\"submit\" color=\"primary\">Save</button>\n <button mat-button mat-dialog-close type=\"button\">Cancel</button>\n </mat-dialog-actions>\n </fs-dialog>\n</form>\n", styles: ["::ng-deep .account-roles-autocomplete-panel .mat-option{line-height:normal}::ng-deep .account-roles-autocomplete-panel .mat-option .mat-option-text{display:flex;flex-direction:row;align-items:center}::ng-deep .account-roles-autocomplete-panel .mat-option .mat-option-text fs-badge{margin-right:5px}\n"], components: [{ type: i4__namespace.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode"] }, { type: i6__namespace.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { type: i6__namespace.FsLabelComponent, selector: "fs-label" }, { type: FsAclObjectRolesComponent, selector: "fs-acl-object-roles", inputs: ["aclRoles", "required", "multiple", "disabled", "aclObjectRoles", "rolesLabel", "levelLabel"], outputs: ["change"] }, { type: i13__namespace.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i14__namespace.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i14__namespace.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i14__namespace.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i15__namespace.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"] }, { type: i2__namespace.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i2__namespace.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i7__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2__namespace.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i15__namespace.FsSubmitButtonDirective, selector: "button[type=\"submit\"]", inputs: ["name", "dirtySubmit"] }, { type: i2__namespace.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["type", "mat-dialog-close", "aria-label", "matDialogClose"], exportAs: ["matDialogClose"] }] });
936
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAclEntryComponent, decorators: [{
937
+ type: i0.Component,
938
+ args: [{
939
+ templateUrl: './acl-entry.component.html',
940
+ styleUrls: ['./acl-entry.component.scss'],
941
+ }]
942
+ }], ctorParameters: function () {
943
+ return [{ type: FsAppAclService }, { type: i2__namespace.MatDialogRef }, { type: i3__namespace.FsMessage }, { type: undefined, decorators: [{
944
+ type: i0.Inject,
945
+ args: [i2.MAT_DIALOG_DATA]
946
+ }] }];
975
947
  } });
976
948
 
977
- var FsAclEntriesComponent = /** @class */ (function () {
978
- function FsAclEntriesComponent(_appAclService, _dialog, _confirm) {
979
- this._appAclService = _appAclService;
980
- this._dialog = _dialog;
981
- this._confirm = _confirm;
982
- this.environmentShow = true;
983
- this.environmentLabel = 'Environment';
984
- this.actions = [];
985
- this.aclEntriesList = null;
986
- this.aclEntriesConfig = null;
987
- this.permissions = [];
988
- this._destroy$ = new rxjs.Subject();
989
- }
990
- FsAclEntriesComponent.prototype.ngOnInit = function () {
991
- var _this = this;
992
- this._appAclService.getPermissions()
993
- .subscribe(function (response) {
994
- _this.permissions = response;
995
- });
996
- this.aclEntriesConfig = {
997
- status: false,
998
- paging: false,
999
- actions: this.actions,
1000
- rowActions: [
1001
- {
1002
- label: 'Remove All Roles',
1003
- click: function (aclObjectEntry) {
1004
- _this._confirm
1005
- .confirm({
1006
- title: 'Remove All Roles',
1007
- template: 'Are you sure you would like to remove all roles?',
1008
- }).subscribe(function () {
1009
- var data = _this._appAclService.output(Object.assign(Object.assign({}, aclObjectEntry), { aclEntries: [] }));
1010
- _this.saveAclObjectEntry(data)
1011
- .subscribe(function () {
1012
- _this.aclEntriesList.reload();
1013
- });
1014
- });
1015
- }
1016
- }
1017
- ],
1018
- fetch: function () {
1019
- return new rxjs.Observable(function (observer) {
1020
- _this.loadAclEntries({
1021
- aclRoles: true,
1022
- aclRolePermissions: true,
1023
- objects: true,
1024
- aclRoleState: 'active',
1025
- })
1026
- .pipe(operators.map(function (response) { return _this._appAclService.input(response); }))
1027
- .subscribe(function (aclEntries) {
1028
- var objects = aclEntries.reduce(function (items, item) {
1029
- if (item.object) {
1030
- items[item.object.id] = item.object;
1031
- }
1032
- return items;
1033
- }, {});
1034
- var environments = aclEntries.reduce(function (items, item) {
1035
- if (item.environment) {
1036
- items[item.environment.id] = item.environment;
1037
- }
1038
- return items;
1039
- }, {});
1040
- var aclObjectEntry = [];
1041
- var grouped = lodashEs.groupBy(aclEntries, function (item) {
1042
- return [item.aclRole.level, item.environmentId, item.objectId];
1043
- });
1044
- lodashEs.forOwn(grouped, function (group, key) {
1045
- key = key.split(',');
1046
- aclObjectEntry.push({
1047
- object: objects[key[2]],
1048
- level: key[0],
1049
- environmentId: key[1] ? parseInt(key[1]) : null,
1050
- environment: environments[key[1]],
1051
- aclEntries: group,
1052
- });
1053
- });
1054
- var hasApp = aclObjectEntry.some(function (item) {
1055
- return item.aclEntries.some(function (entry) {
1056
- return !entry.objectId;
1057
- });
1058
- });
1059
- if (!hasApp) {
1060
- aclObjectEntry.unshift({
1061
- object: null, aclEntries: [],
1062
- level: 'app',
1063
- environmentId: null,
1064
- });
1065
- }
1066
- aclObjectEntry = lodashEs.sortBy(aclObjectEntry, function (item) {
1067
- return item.object ? item.level : '';
1068
- });
1069
- observer.next({ data: aclObjectEntry });
1070
- observer.complete();
1071
- });
1072
- });
1073
- },
1074
- };
1075
- };
1076
- FsAclEntriesComponent.prototype.update = function (aclObjectEntry) {
1077
- var _this = this;
1078
- var data = {
1079
- aclObjectEntry: aclObjectEntry,
1080
- required: false,
1081
- loadAclRoles: this.loadAclRoles,
1082
- saveAclObjectEntry: this.saveAclObjectEntry
1083
- };
1084
- this._dialog.open(FsAclEntryComponent, {
1085
- data: data
1086
- })
1087
- .afterClosed()
1088
- .pipe(operators.takeUntil(this._destroy$))
1089
- .subscribe(function () {
1090
- _this.aclEntriesList.reload();
1091
- });
1092
- };
1093
- FsAclEntriesComponent.prototype.ngOnDestroy = function () {
1094
- this._destroy$.next();
1095
- this._destroy$.complete();
1096
- };
1097
- FsAclEntriesComponent.prototype.reload = function () {
1098
- this.aclEntriesList.reload();
1099
- };
1100
- return FsAclEntriesComponent;
1101
- }());
1102
- FsAclEntriesComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAclEntriesComponent, deps: [{ token: FsAppAclService }, { token: i2__namespace.MatDialog }, { token: i3__namespace$1.FsPrompt }], target: i0__namespace.ɵɵFactoryTarget.Component });
1103
- FsAclEntriesComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsAclEntriesComponent, selector: "fs-acl-entries", inputs: { loadAclEntries: "loadAclEntries", loadAclRoles: "loadAclRoles", saveAclObjectEntry: "saveAclObjectEntry", environmentShow: "environmentShow", environmentLabel: "environmentLabel", actions: "actions" }, viewQueries: [{ propertyName: "aclEntriesList", first: true, predicate: i12.FsListComponent, descendants: true }], ngImport: i0__namespace, template: "\n<fs-list [config]=\"aclEntriesConfig\">\n <fs-list-column>\n <ng-template fs-list-header>Context</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <div\n *ngIf=\"row.object; else elseObject\"\n fxLayout=\"row\"\n fxLayoutAlign=\"start center\"\n fxLayoutGap=\"10px\">\n <fs-badge *ngIf=\"row.object.imageUrl\" shape=\"circle\" image=\"{{ row.object.imageUrl }}\"></fs-badge>\n <span>\n <div><small>{{ row.object.className }}</small></div>\n <a (click)=\"update(row)\">{{ row.object.name }}</a>\n </span>\n </div>\n\n <ng-template #elseObject>\n <a (click)=\"update(row)\">App</a>\n </ng-template>\n </ng-template>\n </fs-list-column>\n\n <fs-list-column [show]=\"environmentShow\">\n <ng-template fs-list-header>{{environmentLabel}}</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n {{row.environment?.name}}\n </ng-template>\n </fs-list-column>\n\n <fs-list-column>\n <ng-template fs-list-header>Roles</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <div fxLayout=\"column\" fxLayoutGap=\"10px\">\n <div div *ngFor=\"let aclEntry of row.aclEntries\">\n <ng-container [ngSwitch]=\"row.level\">\n <ng-container *ngSwitchCase=\"'app'\">\n <fs-acl-role-popover [aclRole]=\"aclEntry.aclRole\" objectName=\"App\">{{aclEntry.aclRole.name}}</fs-acl-role-popover>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container *ngIf=\"row.object\">\n <fs-acl-role-popover [aclRole]=\"aclEntry.aclRole\">{{aclEntry.aclRole.name}}</fs-acl-role-popover>\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n </div>\n </ng-template>\n </fs-list-column>\n</fs-list>\n", styles: [""], components: [{ type: i12__namespace.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { type: i5__namespace$1.FsBadgeComponent, selector: "fs-badge", inputs: ["color", "text", "tooltip", "size", "shape", "image", "icon", "iconSize", "iconColor", "backgroundSize"] }, { type: FsAclRolePopoverComponent, selector: "fs-acl-role-popover", inputs: ["aclRole", "objectName"] }], directives: [{ type: i12__namespace.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i12__namespace.FsListHeaderDirective, selector: "[fs-list-header]", inputs: ["colspan", "align", "class"] }, { type: i12__namespace.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { type: i7__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i17__namespace.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { type: i17__namespace.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { type: i17__namespace.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { type: i7__namespace$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7__namespace$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i7__namespace$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i7__namespace$1.NgSwitchDefault, selector: "[ngSwitchDefault]" }] });
1104
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAclEntriesComponent, decorators: [{
1105
- type: i0.Component,
1106
- args: [{
1107
- selector: 'fs-acl-entries',
1108
- templateUrl: './acl-entries.component.html',
1109
- styleUrls: ['./acl-entries.component.scss']
1110
- }]
1111
- }], ctorParameters: function () { return [{ type: FsAppAclService }, { type: i2__namespace.MatDialog }, { type: i3__namespace$1.FsPrompt }]; }, propDecorators: { loadAclEntries: [{
1112
- type: i0.Input
1113
- }], loadAclRoles: [{
1114
- type: i0.Input
1115
- }], saveAclObjectEntry: [{
1116
- type: i0.Input
1117
- }], environmentShow: [{
1118
- type: i0.Input
1119
- }], environmentLabel: [{
1120
- type: i0.Input
1121
- }], actions: [{
1122
- type: i0.Input
1123
- }], aclEntriesList: [{
1124
- type: i0.ViewChild,
1125
- args: [i12.FsListComponent]
949
+ var FsAclEntriesComponent = /** @class */ (function () {
950
+ function FsAclEntriesComponent(_appAclService, _dialog, _confirm) {
951
+ this._appAclService = _appAclService;
952
+ this._dialog = _dialog;
953
+ this._confirm = _confirm;
954
+ this.environmentShow = true;
955
+ this.environmentLabel = 'Environment';
956
+ this.actions = [];
957
+ this.aclEntriesList = null;
958
+ this.aclEntriesConfig = null;
959
+ this.permissions = [];
960
+ this._destroy$ = new rxjs.Subject();
961
+ }
962
+ FsAclEntriesComponent.prototype.ngOnInit = function () {
963
+ var _this = this;
964
+ this._appAclService.getPermissions()
965
+ .subscribe(function (response) {
966
+ _this.permissions = response;
967
+ });
968
+ this.aclEntriesConfig = {
969
+ status: false,
970
+ paging: false,
971
+ actions: this.actions,
972
+ rowActions: [
973
+ {
974
+ label: 'Remove All Roles',
975
+ click: function (aclObjectEntry) {
976
+ _this._confirm
977
+ .confirm({
978
+ title: 'Remove All Roles',
979
+ template: 'Are you sure you would like to remove all roles?',
980
+ }).subscribe(function () {
981
+ var data = Object.assign(Object.assign({}, aclObjectEntry), { aclEntries: [] });
982
+ _this.saveAclObjectEntry(data)
983
+ .subscribe(function () {
984
+ _this.aclEntriesList.reload();
985
+ });
986
+ });
987
+ }
988
+ }
989
+ ],
990
+ fetch: function () {
991
+ return new rxjs.Observable(function (observer) {
992
+ _this.loadAclEntries({
993
+ aclRoles: true,
994
+ aclRolePermissions: true,
995
+ objects: true,
996
+ aclRoleState: 'active',
997
+ })
998
+ .subscribe(function (aclEntries) {
999
+ var objects = aclEntries
1000
+ .filter(function (aclEntry) { return (!!aclEntry.object); })
1001
+ .reduce(function (items, item) {
1002
+ var _a;
1003
+ return Object.assign(Object.assign({}, items), (_a = {}, _a[item.object.id] = item.object, _a));
1004
+ }, {});
1005
+ var environments = aclEntries
1006
+ .filter(function (aclEntry) { return (!!aclEntry.environment); })
1007
+ .reduce(function (items, item) {
1008
+ var _a;
1009
+ return Object.assign(Object.assign({}, items), (_a = {}, _a[item.environment.id] = item.environment, _a));
1010
+ }, {});
1011
+ var aclObjectEntry = [];
1012
+ var groupedAclEntries = lodashEs.groupBy(aclEntries, function (item) {
1013
+ return [item.aclRole.level, item.environmentId, item.objectId];
1014
+ });
1015
+ lodashEs.forOwn(groupedAclEntries, function (aclEntries, key) {
1016
+ key = key.split(',');
1017
+ aclObjectEntry.push({
1018
+ object: objects[key[2]],
1019
+ level: key[0],
1020
+ environmentId: key[1] ? parseInt(key[1]) : null,
1021
+ environment: environments[key[1]],
1022
+ aclEntries: aclEntries,
1023
+ });
1024
+ });
1025
+ var hasApp = aclObjectEntry.some(function (item) {
1026
+ return item.aclEntries.some(function (entry) {
1027
+ return !entry.objectId;
1028
+ });
1029
+ });
1030
+ if (!hasApp) {
1031
+ aclObjectEntry.unshift({
1032
+ object: null,
1033
+ aclEntries: [],
1034
+ level: 'app',
1035
+ environmentId: null,
1036
+ });
1037
+ }
1038
+ aclObjectEntry = lodashEs.sortBy(aclObjectEntry, function (item) {
1039
+ return item.object ? item.level : '';
1040
+ });
1041
+ observer.next({ data: aclObjectEntry });
1042
+ observer.complete();
1043
+ });
1044
+ });
1045
+ },
1046
+ };
1047
+ };
1048
+ FsAclEntriesComponent.prototype.update = function (aclObjectEntry) {
1049
+ var _this = this;
1050
+ var data = {
1051
+ aclObjectEntry: aclObjectEntry,
1052
+ required: false,
1053
+ loadAclRoles: this.loadAclRoles,
1054
+ saveAclObjectEntry: this.saveAclObjectEntry
1055
+ };
1056
+ this._dialog.open(FsAclEntryComponent, {
1057
+ data: data
1058
+ })
1059
+ .afterClosed()
1060
+ .pipe(operators.takeUntil(this._destroy$))
1061
+ .subscribe(function () {
1062
+ _this.aclEntriesList.reload();
1063
+ });
1064
+ };
1065
+ FsAclEntriesComponent.prototype.ngOnDestroy = function () {
1066
+ this._destroy$.next();
1067
+ this._destroy$.complete();
1068
+ };
1069
+ FsAclEntriesComponent.prototype.reload = function () {
1070
+ this.aclEntriesList.reload();
1071
+ };
1072
+ return FsAclEntriesComponent;
1073
+ }());
1074
+ FsAclEntriesComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAclEntriesComponent, deps: [{ token: FsAppAclService }, { token: i2__namespace.MatDialog }, { token: i3__namespace$1.FsPrompt }], target: i0__namespace.ɵɵFactoryTarget.Component });
1075
+ FsAclEntriesComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsAclEntriesComponent, selector: "fs-acl-entries", inputs: { loadAclEntries: "loadAclEntries", loadAclRoles: "loadAclRoles", saveAclObjectEntry: "saveAclObjectEntry", environmentShow: "environmentShow", environmentLabel: "environmentLabel", actions: "actions" }, viewQueries: [{ propertyName: "aclEntriesList", first: true, predicate: i12.FsListComponent, descendants: true }], ngImport: i0__namespace, template: "\n<fs-list [config]=\"aclEntriesConfig\">\n <fs-list-column>\n <ng-template fs-list-header>Context</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <div\n *ngIf=\"row.object; else elseObject\"\n fxLayout=\"row\"\n fxLayoutAlign=\"start center\"\n fxLayoutGap=\"10px\">\n <fs-badge *ngIf=\"row.object.imageUrl\" shape=\"circle\" image=\"{{ row.object.imageUrl }}\"></fs-badge>\n <span>\n <div><small>{{ row.object.className }}</small></div>\n <a (click)=\"update(row)\">{{ row.object.name }}</a>\n </span>\n </div>\n\n <ng-template #elseObject>\n <a (click)=\"update(row)\">App</a>\n </ng-template>\n </ng-template>\n </fs-list-column>\n\n <fs-list-column [show]=\"environmentShow\">\n <ng-template fs-list-header>{{environmentLabel}}</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n {{row.environment?.name}}\n </ng-template>\n </fs-list-column>\n\n <fs-list-column>\n <ng-template fs-list-header>Roles</ng-template>\n <ng-template fs-list-cell let-row=\"row\">\n <div fxLayout=\"column\" fxLayoutGap=\"10px\">\n <div div *ngFor=\"let aclEntry of row.aclEntries\">\n <ng-container [ngSwitch]=\"row.level\">\n <ng-container *ngSwitchCase=\"'app'\">\n <fs-acl-role-popover [aclRole]=\"aclEntry.aclRole\" objectName=\"App\">{{aclEntry.aclRole.name}}</fs-acl-role-popover>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container *ngIf=\"row.object\">\n <fs-acl-role-popover [aclRole]=\"aclEntry.aclRole\">{{aclEntry.aclRole.name}}</fs-acl-role-popover>\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n </div>\n </ng-template>\n </fs-list-column>\n</fs-list>\n", styles: [""], components: [{ type: i12__namespace.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { type: i5__namespace$1.FsBadgeComponent, selector: "fs-badge", inputs: ["color", "text", "tooltip", "size", "shape", "image", "icon", "iconSize", "iconColor", "backgroundSize"] }, { type: FsAclRolePopoverComponent, selector: "fs-acl-role-popover", inputs: ["aclRole", "objectName"] }], directives: [{ type: i12__namespace.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i12__namespace.FsListHeaderDirective, selector: "[fs-list-header]", inputs: ["colspan", "align", "class"] }, { type: i12__namespace.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { type: i7__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i17__namespace.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { type: i17__namespace.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { type: i17__namespace.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { type: i7__namespace$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7__namespace$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i7__namespace$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i7__namespace$1.NgSwitchDefault, selector: "[ngSwitchDefault]" }] });
1076
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAclEntriesComponent, decorators: [{
1077
+ type: i0.Component,
1078
+ args: [{
1079
+ selector: 'fs-acl-entries',
1080
+ templateUrl: './acl-entries.component.html',
1081
+ styleUrls: ['./acl-entries.component.scss']
1082
+ }]
1083
+ }], ctorParameters: function () { return [{ type: FsAppAclService }, { type: i2__namespace.MatDialog }, { type: i3__namespace$1.FsPrompt }]; }, propDecorators: { loadAclEntries: [{
1084
+ type: i0.Input
1085
+ }], loadAclRoles: [{
1086
+ type: i0.Input
1087
+ }], saveAclObjectEntry: [{
1088
+ type: i0.Input
1089
+ }], environmentShow: [{
1090
+ type: i0.Input
1091
+ }], environmentLabel: [{
1092
+ type: i0.Input
1093
+ }], actions: [{
1094
+ type: i0.Input
1095
+ }], aclEntriesList: [{
1096
+ type: i0.ViewChild,
1097
+ args: [i12.FsListComponent]
1126
1098
  }] } });
1127
1099
 
1128
- var FsAppAclModule = /** @class */ (function () {
1129
- function FsAppAclModule() {
1130
- }
1131
- return FsAppAclModule;
1132
- }());
1133
- FsAppAclModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAppAclModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1134
- FsAppAclModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAppAclModule, declarations: [FsAclRolesComponent,
1135
- FsAclPermissionPopoverComponent,
1136
- FsAclRoleComponent,
1137
- FsAclEntriesComponent,
1138
- FsAclRolePopoverComponent,
1139
- FsAclObjectRolesComponent,
1140
- FsAclEntryComponent], imports: [i7$1.CommonModule,
1141
- i14.FormsModule,
1142
- i2.MatDialogModule,
1143
- i5.MatFormFieldModule,
1144
- i9.MatCheckboxModule,
1145
- i10.MatSelectModule,
1146
- i13.MatButtonModule,
1147
- i8.MatRadioModule,
1148
- i18.MatInputModule,
1149
- flexLayout.FlexLayoutModule,
1150
- i12.FsListModule,
1151
- i2$1.FsPopoverModule,
1152
- i4.FsDialogModule,
1153
- i15.FsFormModule,
1154
- i6.FsLabelModule,
1155
- i7.FsRadioGroupModule,
1156
- i5$1.FsBadgeModule,
1157
- i1.FsCheckboxGroupModule], exports: [FsAclRolesComponent,
1158
- FsAclPermissionPopoverComponent,
1159
- FsAclRoleComponent,
1160
- FsAclEntriesComponent,
1161
- FsAclRolePopoverComponent,
1162
- FsAclObjectRolesComponent,
1163
- FsAclEntryComponent] });
1164
- FsAppAclModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAppAclModule, imports: [[
1165
- i7$1.CommonModule,
1166
- i14.FormsModule,
1167
- i2.MatDialogModule,
1168
- i5.MatFormFieldModule,
1169
- i9.MatCheckboxModule,
1170
- i10.MatSelectModule,
1171
- i13.MatButtonModule,
1172
- i8.MatRadioModule,
1173
- i18.MatInputModule,
1174
- flexLayout.FlexLayoutModule,
1175
- i12.FsListModule,
1176
- i2$1.FsPopoverModule,
1177
- i4.FsDialogModule,
1178
- i15.FsFormModule,
1179
- i6.FsLabelModule,
1180
- i7.FsRadioGroupModule,
1181
- i5$1.FsBadgeModule,
1182
- i1.FsCheckboxGroupModule,
1183
- ]] });
1184
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAppAclModule, decorators: [{
1185
- type: i0.NgModule,
1186
- args: [{
1187
- imports: [
1188
- i7$1.CommonModule,
1189
- i14.FormsModule,
1190
- i2.MatDialogModule,
1191
- i5.MatFormFieldModule,
1192
- i9.MatCheckboxModule,
1193
- i10.MatSelectModule,
1194
- i13.MatButtonModule,
1195
- i8.MatRadioModule,
1196
- i18.MatInputModule,
1197
- flexLayout.FlexLayoutModule,
1198
- i12.FsListModule,
1199
- i2$1.FsPopoverModule,
1200
- i4.FsDialogModule,
1201
- i15.FsFormModule,
1202
- i6.FsLabelModule,
1203
- i7.FsRadioGroupModule,
1204
- i5$1.FsBadgeModule,
1205
- i1.FsCheckboxGroupModule,
1206
- ],
1207
- declarations: [
1208
- FsAclRolesComponent,
1209
- FsAclPermissionPopoverComponent,
1210
- FsAclRoleComponent,
1211
- FsAclEntriesComponent,
1212
- FsAclRolePopoverComponent,
1213
- FsAclObjectRolesComponent,
1214
- FsAclEntryComponent,
1215
- ],
1216
- exports: [
1217
- FsAclRolesComponent,
1218
- FsAclPermissionPopoverComponent,
1219
- FsAclRoleComponent,
1220
- FsAclEntriesComponent,
1221
- FsAclRolePopoverComponent,
1222
- FsAclObjectRolesComponent,
1223
- FsAclEntryComponent,
1224
- ],
1225
- }]
1100
+ var FsAppAclModule = /** @class */ (function () {
1101
+ function FsAppAclModule() {
1102
+ }
1103
+ return FsAppAclModule;
1104
+ }());
1105
+ FsAppAclModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAppAclModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1106
+ FsAppAclModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAppAclModule, declarations: [FsAclRolesComponent,
1107
+ FsAclPermissionPopoverComponent,
1108
+ FsAclRoleComponent,
1109
+ FsAclEntriesComponent,
1110
+ FsAclRolePopoverComponent,
1111
+ FsAclObjectRolesComponent,
1112
+ FsAclEntryComponent], imports: [i7$1.CommonModule,
1113
+ i14.FormsModule,
1114
+ i2.MatDialogModule,
1115
+ i5.MatFormFieldModule,
1116
+ i9.MatCheckboxModule,
1117
+ i10.MatSelectModule,
1118
+ i13.MatButtonModule,
1119
+ i8.MatRadioModule,
1120
+ i18.MatInputModule,
1121
+ flexLayout.FlexLayoutModule,
1122
+ i12.FsListModule,
1123
+ i2$1.FsPopoverModule,
1124
+ i4.FsDialogModule,
1125
+ i15.FsFormModule,
1126
+ i6.FsLabelModule,
1127
+ i7.FsRadioGroupModule,
1128
+ i5$1.FsBadgeModule,
1129
+ i1.FsCheckboxGroupModule], exports: [FsAclRolesComponent,
1130
+ FsAclPermissionPopoverComponent,
1131
+ FsAclRoleComponent,
1132
+ FsAclEntriesComponent,
1133
+ FsAclRolePopoverComponent,
1134
+ FsAclObjectRolesComponent,
1135
+ FsAclEntryComponent] });
1136
+ FsAppAclModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAppAclModule, imports: [[
1137
+ i7$1.CommonModule,
1138
+ i14.FormsModule,
1139
+ i2.MatDialogModule,
1140
+ i5.MatFormFieldModule,
1141
+ i9.MatCheckboxModule,
1142
+ i10.MatSelectModule,
1143
+ i13.MatButtonModule,
1144
+ i8.MatRadioModule,
1145
+ i18.MatInputModule,
1146
+ flexLayout.FlexLayoutModule,
1147
+ i12.FsListModule,
1148
+ i2$1.FsPopoverModule,
1149
+ i4.FsDialogModule,
1150
+ i15.FsFormModule,
1151
+ i6.FsLabelModule,
1152
+ i7.FsRadioGroupModule,
1153
+ i5$1.FsBadgeModule,
1154
+ i1.FsCheckboxGroupModule,
1155
+ ]] });
1156
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsAppAclModule, decorators: [{
1157
+ type: i0.NgModule,
1158
+ args: [{
1159
+ imports: [
1160
+ i7$1.CommonModule,
1161
+ i14.FormsModule,
1162
+ i2.MatDialogModule,
1163
+ i5.MatFormFieldModule,
1164
+ i9.MatCheckboxModule,
1165
+ i10.MatSelectModule,
1166
+ i13.MatButtonModule,
1167
+ i8.MatRadioModule,
1168
+ i18.MatInputModule,
1169
+ flexLayout.FlexLayoutModule,
1170
+ i12.FsListModule,
1171
+ i2$1.FsPopoverModule,
1172
+ i4.FsDialogModule,
1173
+ i15.FsFormModule,
1174
+ i6.FsLabelModule,
1175
+ i7.FsRadioGroupModule,
1176
+ i5$1.FsBadgeModule,
1177
+ i1.FsCheckboxGroupModule,
1178
+ ],
1179
+ declarations: [
1180
+ FsAclRolesComponent,
1181
+ FsAclPermissionPopoverComponent,
1182
+ FsAclRoleComponent,
1183
+ FsAclEntriesComponent,
1184
+ FsAclRolePopoverComponent,
1185
+ FsAclObjectRolesComponent,
1186
+ FsAclEntryComponent,
1187
+ ],
1188
+ exports: [
1189
+ FsAclRolesComponent,
1190
+ FsAclPermissionPopoverComponent,
1191
+ FsAclRoleComponent,
1192
+ FsAclEntriesComponent,
1193
+ FsAclRolePopoverComponent,
1194
+ FsAclObjectRolesComponent,
1195
+ FsAclEntryComponent,
1196
+ ],
1197
+ }]
1226
1198
  }] });
1227
1199
 
1228
- /**
1229
- * Generated bundle index. Do not edit.
1200
+ /**
1201
+ * Generated bundle index. Do not edit.
1230
1202
  */
1231
1203
 
1232
1204
  exports.FS_APP_ACL_CONFIG = FS_APP_ACL_CONFIG;