ngx-techlify-core 11.3.5 → 11.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/ngx-techlify-core.umd.js +398 -4
- package/bundles/ngx-techlify-core.umd.js.map +1 -1
- package/bundles/ngx-techlify-core.umd.min.js +2 -2
- package/bundles/ngx-techlify-core.umd.min.js.map +1 -1
- package/esm2015/lib/company-feature/company-feature.component.js +174 -0
- package/esm2015/lib/company-feature/company-feature.module.js +30 -0
- package/esm2015/lib/company-feature/company-feature.routing.js +12 -0
- package/esm2015/lib/company-feature/company-feature.service.js +28 -0
- package/esm2015/lib/company-feature/ngx-feature-enabled.directive.js +77 -0
- package/esm2015/lib/company-feature/on-off-switch/on-off-switch.component.js +27 -0
- package/esm2015/ngx-techlify-core.js +3 -1
- package/esm2015/public-api.js +6 -1
- package/fesm2015/ngx-techlify-core.js +315 -1
- package/fesm2015/ngx-techlify-core.js.map +1 -1
- package/lib/company-feature/company-feature.component.d.ts +34 -0
- package/lib/company-feature/company-feature.module.d.ts +2 -0
- package/lib/company-feature/company-feature.routing.d.ts +2 -0
- package/lib/company-feature/company-feature.service.d.ts +8 -0
- package/lib/company-feature/ngx-feature-enabled.directive.d.ts +16 -0
- package/lib/company-feature/on-off-switch/on-off-switch.component.d.ts +9 -0
- package/ngx-techlify-core.d.ts +2 -0
- package/ngx-techlify-core.metadata.json +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +5 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/material/dialog'), require('@angular/material/table'), require('@angular/material/sort'), require('@ngneat/until-destroy'), require('@angular/common'), require('@angular/forms'), require('@angular/common/http'), require('rxjs'), require('rxjs/operators'), require('@angular/material/snack-bar'), require('@angular/cdk/a11y'), require('@angular/cdk/coercion'), require('@angular/material/form-field'), require('@angular/material/select'), require('@angular/material/icon'), require('@angular/router'), require('@angular/material/tooltip'), require('@angular/material/core'), require('@angular/material/button'), require('@angular/material/checkbox'), require('@angular/material/input'), require('@angular/material/menu'), require('@angular/material/progress-spinner'), require('@angular/material/card'), require('@angular/material/divider'), require('@angular/material/chips'), require('@angular/material/datepicker'), require('@angular/material/list'), require('@angular/flex-layout'), require('ngx-infinite-scroll'), require('ngx-doc-viewer'), require('ngx-editor'), require('xlsx'), require('@angular/platform-browser'), require('jsondiffpatch'), require('@angular/cdk/keycodes'), require('@angular/material/autocomplete'), require('@angular/material/button-toggle')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('ngx-techlify-core', ['exports', '@angular/core', '@angular/material/dialog', '@angular/material/table', '@angular/material/sort', '@ngneat/until-destroy', '@angular/common', '@angular/forms', '@angular/common/http', 'rxjs', 'rxjs/operators', '@angular/material/snack-bar', '@angular/cdk/a11y', '@angular/cdk/coercion', '@angular/material/form-field', '@angular/material/select', '@angular/material/icon', '@angular/router', '@angular/material/tooltip', '@angular/material/core', '@angular/material/button', '@angular/material/checkbox', '@angular/material/input', '@angular/material/menu', '@angular/material/progress-spinner', '@angular/material/card', '@angular/material/divider', '@angular/material/chips', '@angular/material/datepicker', '@angular/material/list', '@angular/flex-layout', 'ngx-infinite-scroll', 'ngx-doc-viewer', 'ngx-editor', 'xlsx', '@angular/platform-browser', 'jsondiffpatch', '@angular/cdk/keycodes', '@angular/material/autocomplete', '@angular/material/button-toggle'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['ngx-techlify-core'] = {}, global.ng.core, global.ng.material.dialog, global.ng.material.table, global.ng.material.sort, global['@ngneat/until-destroy'], global.ng.common, global.ng.forms, global.ng.common.http, global.rxjs, global.rxjs.operators, global.ng.material.snackBar, global.ng.cdk.a11y, global.ng.cdk.coercion, global.ng.material.formField, global.ng.material.select, global.ng.material.icon, global.ng.router, global.ng.material.tooltip, global.ng.material.core, global.ng.material.button, global.ng.material.checkbox, global.ng.material.input, global.ng.material.menu, global.ng.material.progressSpinner, global.ng.material.card, global.ng.material.divider, global.ng.material.chips, global.ng.material.datepicker, global.ng.material.list, global.ng.flexLayout, global['ngx-infinite-scroll'], global['ngx-doc-viewer'], global['ngx-editor'], global.xlsx, global.ng.platformBrowser, global.jsondiffpatch, global.ng.cdk.keycodes, global.ng.material.autocomplete, global.ng.material.buttonToggle));
|
|
5
|
-
}(this, (function (exports, i0, dialog, table, sort, untilDestroy, common, forms, i1$1, rxjs, operators, i1, a11y, coercion, formField, select, icon, i1$2, tooltip, core, button, checkbox, input, menu, progressSpinner, card, divider, chips, datepicker, list, flexLayout, ngxInfiniteScroll, ngxDocViewer, ngxEditor, XLSX, platformBrowser, jsondiffpatch, keycodes, autocomplete, buttonToggle) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/material/dialog'), require('@angular/material/table'), require('@angular/material/sort'), require('@ngneat/until-destroy'), require('@angular/common'), require('@angular/forms'), require('@angular/common/http'), require('rxjs'), require('rxjs/operators'), require('@angular/material/snack-bar'), require('@angular/cdk/a11y'), require('@angular/cdk/coercion'), require('@angular/material/form-field'), require('@angular/material/select'), require('@angular/material/icon'), require('@angular/router'), require('@angular/material/tooltip'), require('@angular/material/core'), require('@angular/material/button'), require('@angular/material/checkbox'), require('@angular/material/input'), require('@angular/material/menu'), require('@angular/material/progress-spinner'), require('@angular/material/card'), require('@angular/material/divider'), require('@angular/material/chips'), require('@angular/material/datepicker'), require('@angular/material/list'), require('@angular/flex-layout'), require('ngx-infinite-scroll'), require('ngx-doc-viewer'), require('ngx-editor'), require('xlsx'), require('@angular/platform-browser'), require('jsondiffpatch'), require('@angular/cdk/keycodes'), require('@angular/material/autocomplete'), require('@angular/material/button-toggle'), require('@angular/material/slide-toggle')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('ngx-techlify-core', ['exports', '@angular/core', '@angular/material/dialog', '@angular/material/table', '@angular/material/sort', '@ngneat/until-destroy', '@angular/common', '@angular/forms', '@angular/common/http', 'rxjs', 'rxjs/operators', '@angular/material/snack-bar', '@angular/cdk/a11y', '@angular/cdk/coercion', '@angular/material/form-field', '@angular/material/select', '@angular/material/icon', '@angular/router', '@angular/material/tooltip', '@angular/material/core', '@angular/material/button', '@angular/material/checkbox', '@angular/material/input', '@angular/material/menu', '@angular/material/progress-spinner', '@angular/material/card', '@angular/material/divider', '@angular/material/chips', '@angular/material/datepicker', '@angular/material/list', '@angular/flex-layout', 'ngx-infinite-scroll', 'ngx-doc-viewer', 'ngx-editor', 'xlsx', '@angular/platform-browser', 'jsondiffpatch', '@angular/cdk/keycodes', '@angular/material/autocomplete', '@angular/material/button-toggle', '@angular/material/slide-toggle'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['ngx-techlify-core'] = {}, global.ng.core, global.ng.material.dialog, global.ng.material.table, global.ng.material.sort, global['@ngneat/until-destroy'], global.ng.common, global.ng.forms, global.ng.common.http, global.rxjs, global.rxjs.operators, global.ng.material.snackBar, global.ng.cdk.a11y, global.ng.cdk.coercion, global.ng.material.formField, global.ng.material.select, global.ng.material.icon, global.ng.router, global.ng.material.tooltip, global.ng.material.core, global.ng.material.button, global.ng.material.checkbox, global.ng.material.input, global.ng.material.menu, global.ng.material.progressSpinner, global.ng.material.card, global.ng.material.divider, global.ng.material.chips, global.ng.material.datepicker, global.ng.material.list, global.ng.flexLayout, global['ngx-infinite-scroll'], global['ngx-doc-viewer'], global['ngx-editor'], global.xlsx, global.ng.platformBrowser, global.jsondiffpatch, global.ng.cdk.keycodes, global.ng.material.autocomplete, global.ng.material.buttonToggle, global.ng.material.slideToggle));
|
|
5
|
+
}(this, (function (exports, i0, dialog, table, sort, untilDestroy, common, forms, i1$1, rxjs, operators, i1, a11y, coercion, formField, select, icon, i1$2, tooltip, core, button, checkbox, input, menu, progressSpinner, card, divider, chips, datepicker, list, flexLayout, ngxInfiniteScroll, ngxDocViewer, ngxEditor, XLSX, platformBrowser, jsondiffpatch, keycodes, autocomplete, buttonToggle, slideToggle) { 'use strict';
|
|
6
6
|
|
|
7
7
|
var ActionPopup = /** @class */ (function () {
|
|
8
8
|
function ActionPopup() {
|
|
@@ -7161,6 +7161,390 @@
|
|
|
7161
7161
|
},] }
|
|
7162
7162
|
];
|
|
7163
7163
|
|
|
7164
|
+
var CompanyFeatureService = /** @class */ (function () {
|
|
7165
|
+
function CompanyFeatureService(dataManager) {
|
|
7166
|
+
this.dataManager = dataManager;
|
|
7167
|
+
}
|
|
7168
|
+
CompanyFeatureService.prototype.getFeatures = function () {
|
|
7169
|
+
return this.dataManager.GET("api/features");
|
|
7170
|
+
};
|
|
7171
|
+
CompanyFeatureService.prototype.disableFeature = function (id) {
|
|
7172
|
+
return this.dataManager.GET("api/feature/" + id + "/disable");
|
|
7173
|
+
};
|
|
7174
|
+
CompanyFeatureService.prototype.enableFeature = function (id) {
|
|
7175
|
+
return this.dataManager.GET("api/feature/" + id + "/enable");
|
|
7176
|
+
};
|
|
7177
|
+
return CompanyFeatureService;
|
|
7178
|
+
}());
|
|
7179
|
+
CompanyFeatureService.ɵprov = i0.ɵɵdefineInjectable({ factory: function CompanyFeatureService_Factory() { return new CompanyFeatureService(i0.ɵɵinject(DataManager)); }, token: CompanyFeatureService, providedIn: "root" });
|
|
7180
|
+
CompanyFeatureService.decorators = [
|
|
7181
|
+
{ type: i0.Injectable, args: [{
|
|
7182
|
+
providedIn: 'root'
|
|
7183
|
+
},] }
|
|
7184
|
+
];
|
|
7185
|
+
CompanyFeatureService.ctorParameters = function () { return [
|
|
7186
|
+
{ type: DataManager }
|
|
7187
|
+
]; };
|
|
7188
|
+
|
|
7189
|
+
exports.CompanyFeatureComponent = /** @class */ (function () {
|
|
7190
|
+
function CompanyFeatureComponent(dataManager, errorHandler, fb, alertService, dialog, storage, featureService) {
|
|
7191
|
+
this.dataManager = dataManager;
|
|
7192
|
+
this.errorHandler = errorHandler;
|
|
7193
|
+
this.fb = fb;
|
|
7194
|
+
this.alertService = alertService;
|
|
7195
|
+
this.dialog = dialog;
|
|
7196
|
+
this.storage = storage;
|
|
7197
|
+
this.featureService = featureService;
|
|
7198
|
+
this.features = [];
|
|
7199
|
+
this.displayedColumns = [
|
|
7200
|
+
'index',
|
|
7201
|
+
'feature',
|
|
7202
|
+
'description',
|
|
7203
|
+
'actions',
|
|
7204
|
+
];
|
|
7205
|
+
this.dataSource = new table.MatTableDataSource();
|
|
7206
|
+
this.page = 1;
|
|
7207
|
+
this.perPage = 25;
|
|
7208
|
+
this.isWorking = false;
|
|
7209
|
+
this.filterFormGroup = this.fb.group({
|
|
7210
|
+
num_items: [""]
|
|
7211
|
+
});
|
|
7212
|
+
}
|
|
7213
|
+
CompanyFeatureComponent.prototype.ngOnInit = function () {
|
|
7214
|
+
this.loadData();
|
|
7215
|
+
this.listenForChanges();
|
|
7216
|
+
};
|
|
7217
|
+
CompanyFeatureComponent.prototype.listenForChanges = function () {
|
|
7218
|
+
var _this = this;
|
|
7219
|
+
this.filterFormGroup.valueChanges
|
|
7220
|
+
.pipe(operators.debounceTime(500), untilDestroy.untilDestroyed(this))
|
|
7221
|
+
.subscribe(function (changes) {
|
|
7222
|
+
_this.reload();
|
|
7223
|
+
});
|
|
7224
|
+
};
|
|
7225
|
+
CompanyFeatureComponent.prototype.loadData = function () {
|
|
7226
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7227
|
+
var result, filter, error_1;
|
|
7228
|
+
return __generator(this, function (_a) {
|
|
7229
|
+
switch (_a.label) {
|
|
7230
|
+
case 0:
|
|
7231
|
+
_a.trys.push([0, 2, 3, 4]);
|
|
7232
|
+
this.isWorking = true;
|
|
7233
|
+
filter = this.filterFormGroup.value;
|
|
7234
|
+
filter.page = this.page;
|
|
7235
|
+
filter.perPage = this.perPage;
|
|
7236
|
+
return [4 /*yield*/, this.dataManager.GET("api/features", filter)];
|
|
7237
|
+
case 1:
|
|
7238
|
+
result = _a.sent();
|
|
7239
|
+
this.features = this.features.concat(result.data);
|
|
7240
|
+
this.dataSource = new table.MatTableDataSource(this.features);
|
|
7241
|
+
if (!this.storage.getItem('features')) {
|
|
7242
|
+
this.setStorage(this.features);
|
|
7243
|
+
}
|
|
7244
|
+
this.isWorking = false;
|
|
7245
|
+
return [3 /*break*/, 4];
|
|
7246
|
+
case 2:
|
|
7247
|
+
error_1 = _a.sent();
|
|
7248
|
+
this.errorHandler.handleError(error_1);
|
|
7249
|
+
return [3 /*break*/, 4];
|
|
7250
|
+
case 3:
|
|
7251
|
+
this.isWorking = false;
|
|
7252
|
+
return [7 /*endfinally*/];
|
|
7253
|
+
case 4: return [2 /*return*/];
|
|
7254
|
+
}
|
|
7255
|
+
});
|
|
7256
|
+
});
|
|
7257
|
+
};
|
|
7258
|
+
CompanyFeatureComponent.prototype.toggeleFeature = function (element, feature) {
|
|
7259
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7260
|
+
var status, data, dialogRef;
|
|
7261
|
+
var _this = this;
|
|
7262
|
+
return __generator(this, function (_a) {
|
|
7263
|
+
status = element ? 'Off' : "On";
|
|
7264
|
+
dialogRef = this.dialog.open(ActionPopupComponent, {
|
|
7265
|
+
width: "400px",
|
|
7266
|
+
data: {
|
|
7267
|
+
title: "Turn this feature " + status + "?",
|
|
7268
|
+
message: "Would you like to turn " + feature.title + " feature " + status
|
|
7269
|
+
}
|
|
7270
|
+
});
|
|
7271
|
+
dialogRef.afterClosed().subscribe(function (result) { return __awaiter(_this, void 0, void 0, function () {
|
|
7272
|
+
var _a, error_2;
|
|
7273
|
+
return __generator(this, function (_b) {
|
|
7274
|
+
switch (_b.label) {
|
|
7275
|
+
case 0:
|
|
7276
|
+
if (!result) return [3 /*break*/, 9];
|
|
7277
|
+
_b.label = 1;
|
|
7278
|
+
case 1:
|
|
7279
|
+
_b.trys.push([1, 6, 7, 8]);
|
|
7280
|
+
if (!element) return [3 /*break*/, 3];
|
|
7281
|
+
return [4 /*yield*/, this.featureService.disableFeature(feature.id)];
|
|
7282
|
+
case 2:
|
|
7283
|
+
_a = _b.sent();
|
|
7284
|
+
return [3 /*break*/, 5];
|
|
7285
|
+
case 3: return [4 /*yield*/, this.featureService.enableFeature(feature.id)];
|
|
7286
|
+
case 4:
|
|
7287
|
+
_a = _b.sent();
|
|
7288
|
+
_b.label = 5;
|
|
7289
|
+
case 5:
|
|
7290
|
+
data = _a;
|
|
7291
|
+
return [3 /*break*/, 8];
|
|
7292
|
+
case 6:
|
|
7293
|
+
error_2 = _b.sent();
|
|
7294
|
+
this.errorHandler.handleError(error_2);
|
|
7295
|
+
return [3 /*break*/, 8];
|
|
7296
|
+
case 7:
|
|
7297
|
+
this.alertService.addAlert("You have just turned " + status + " the feature " + feature.title, 'success');
|
|
7298
|
+
this.reload();
|
|
7299
|
+
this.storage.removeItem('features');
|
|
7300
|
+
this.setStorage(this.features);
|
|
7301
|
+
this.isWorking = false;
|
|
7302
|
+
return [7 /*endfinally*/];
|
|
7303
|
+
case 8: return [3 /*break*/, 10];
|
|
7304
|
+
case 9:
|
|
7305
|
+
this.reload();
|
|
7306
|
+
_b.label = 10;
|
|
7307
|
+
case 10: return [2 /*return*/];
|
|
7308
|
+
}
|
|
7309
|
+
});
|
|
7310
|
+
}); });
|
|
7311
|
+
return [2 /*return*/];
|
|
7312
|
+
});
|
|
7313
|
+
});
|
|
7314
|
+
};
|
|
7315
|
+
CompanyFeatureComponent.prototype.setStorage = function (features) {
|
|
7316
|
+
var e_1, _a;
|
|
7317
|
+
var localFeatures = [];
|
|
7318
|
+
try {
|
|
7319
|
+
for (var features_1 = __values(features), features_1_1 = features_1.next(); !features_1_1.done; features_1_1 = features_1.next()) {
|
|
7320
|
+
var feature = features_1_1.value;
|
|
7321
|
+
if (!feature.client_feature) {
|
|
7322
|
+
if (feature.is_enabled_default) {
|
|
7323
|
+
localFeatures.push(feature.code);
|
|
7324
|
+
}
|
|
7325
|
+
}
|
|
7326
|
+
else {
|
|
7327
|
+
if (feature.client_feature.is_enabled) {
|
|
7328
|
+
localFeatures.push(feature.code);
|
|
7329
|
+
}
|
|
7330
|
+
}
|
|
7331
|
+
}
|
|
7332
|
+
}
|
|
7333
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
7334
|
+
finally {
|
|
7335
|
+
try {
|
|
7336
|
+
if (features_1_1 && !features_1_1.done && (_a = features_1.return)) _a.call(features_1);
|
|
7337
|
+
}
|
|
7338
|
+
finally { if (e_1) throw e_1.error; }
|
|
7339
|
+
}
|
|
7340
|
+
this.storage.setItem("features", localFeatures);
|
|
7341
|
+
};
|
|
7342
|
+
CompanyFeatureComponent.prototype.reload = function () {
|
|
7343
|
+
this.features = [];
|
|
7344
|
+
this.page = 1;
|
|
7345
|
+
if (!this.isWorking) {
|
|
7346
|
+
this.loadData();
|
|
7347
|
+
}
|
|
7348
|
+
};
|
|
7349
|
+
CompanyFeatureComponent.prototype.onScroll = function () {
|
|
7350
|
+
if (!this.isWorking && this.page < this.lastPage) {
|
|
7351
|
+
this.page += 1;
|
|
7352
|
+
this.loadData();
|
|
7353
|
+
}
|
|
7354
|
+
};
|
|
7355
|
+
CompanyFeatureComponent.prototype.sortColumn = function (event) {
|
|
7356
|
+
var direction = event.direction.toString().toUpperCase();
|
|
7357
|
+
this.assignFilter(event.active, direction);
|
|
7358
|
+
this.reload();
|
|
7359
|
+
};
|
|
7360
|
+
CompanyFeatureComponent.prototype.assignFilter = function (column, direction) {
|
|
7361
|
+
switch (column) {
|
|
7362
|
+
case 'name': {
|
|
7363
|
+
return this.filterFormGroup
|
|
7364
|
+
.get('sort_by')
|
|
7365
|
+
.setValue('first_name|' + direction);
|
|
7366
|
+
}
|
|
7367
|
+
case 'added_on': {
|
|
7368
|
+
return this.filterFormGroup
|
|
7369
|
+
.get('sort_by')
|
|
7370
|
+
.setValue('created_at|' + direction);
|
|
7371
|
+
}
|
|
7372
|
+
}
|
|
7373
|
+
};
|
|
7374
|
+
return CompanyFeatureComponent;
|
|
7375
|
+
}());
|
|
7376
|
+
exports.CompanyFeatureComponent.decorators = [
|
|
7377
|
+
{ type: i0.Component, args: [{
|
|
7378
|
+
selector: 'app-company-feature',
|
|
7379
|
+
template: "<div fxLayout=\"column\" fxLayoutGap=\"3rem\" class=\"p-3\">\n <div fxLayout=\"column\" fxLayoutAlign=\"center center\" class=\"primary-color mt-3\">\n <h3>Features Configuration</h3>\n <mat-hint>\n <i> Here you can specify which optional features you'd like to have available to your team </i>\n </mat-hint>\n </div>\n\n\n <div>\n <mat-card>\n <mat-card-content fxlayout=\"column\" style=\"overflow: auto; height: 700px\" class=\"classifications-card\">\n <table mat-table [dataSource]=\"dataSource\" class=\"mat-elevation-z8 w-100\" matSort multiTemplateDataRows\n (matSortChange)=\"sortColumn($event)\" infiniteScroll [infiniteScrollDistance]=\"2\" [infiniteScrollThrottle]=\"50\"\n (scrolled)=\"onScroll()\" [fromRoot]=\"true\" [infiniteScrollContainer]=\"'.classifications-card'\">\n <!-- Index Column -->\n <ng-container matColumnDef=\"index\">\n <th mat-header-cell *matHeaderCellDef>#</th>\n <td mat-cell *matCellDef=\"let element; let i = dataIndex\">\n {{ i + 1 }}\n </td>\n </ng-container>\n\n <!-- Title Column -->\n <ng-container matColumnDef=\"feature\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header disableClear>\n Feature\n </th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.title }}</td>\n </ng-container>\n\n <!-- Description Column -->\n <ng-container matColumnDef=\"description\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header disableClear>\n Descriptions\n </th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element?.description }}\n </td>\n </ng-container>\n\n <!-- Actions Column -->\n <ng-container matColumnDef=\"actions\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header disableClear>\n Actions\n </th>\n <td mat-cell *matCellDef=\"let element\">\n <div *ngIf=\"!element?.client_feature\">\n <app-on-off-switch [value]=\"element?.is_enabled_default\"\n (click)=\"toggeleFeature(element?.is_enabled_default, element)\"></app-on-off-switch>\n </div>\n <div *ngIf=\"element?.client_feature\">\n <app-on-off-switch [value]=\"element?.client_feature?.is_enabled\"\n (click)=\"toggeleFeature(element?.client_feature?.is_enabled, element)\"></app-on-off-switch>\n </div>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns\"></tr>\n </table>\n </mat-card-content>\n </mat-card>\n </div>\n</div>\n",
|
|
7380
|
+
styles: [""]
|
|
7381
|
+
},] }
|
|
7382
|
+
];
|
|
7383
|
+
exports.CompanyFeatureComponent.ctorParameters = function () { return [
|
|
7384
|
+
{ type: DataManager },
|
|
7385
|
+
{ type: ErrorHandlerService },
|
|
7386
|
+
{ type: forms.FormBuilder },
|
|
7387
|
+
{ type: AlertService },
|
|
7388
|
+
{ type: dialog.MatDialog },
|
|
7389
|
+
{ type: StorageService },
|
|
7390
|
+
{ type: CompanyFeatureService }
|
|
7391
|
+
]; };
|
|
7392
|
+
exports.CompanyFeatureComponent = __decorate([
|
|
7393
|
+
untilDestroy.UntilDestroy()
|
|
7394
|
+
], exports.CompanyFeatureComponent);
|
|
7395
|
+
|
|
7396
|
+
var routes$n = [
|
|
7397
|
+
{
|
|
7398
|
+
path: '',
|
|
7399
|
+
component: exports.CompanyFeatureComponent,
|
|
7400
|
+
canActivate: [AuthenticationGuard]
|
|
7401
|
+
},
|
|
7402
|
+
];
|
|
7403
|
+
var CompanyFeatureRoutes = i1$2.RouterModule.forChild(routes$n);
|
|
7404
|
+
|
|
7405
|
+
var OnOffSwitchComponent = /** @class */ (function () {
|
|
7406
|
+
function OnOffSwitchComponent(fb) {
|
|
7407
|
+
this.fb = fb;
|
|
7408
|
+
this.slideToggle = this.fb.group({
|
|
7409
|
+
toggle: [""]
|
|
7410
|
+
});
|
|
7411
|
+
}
|
|
7412
|
+
OnOffSwitchComponent.prototype.ngOnInit = function () {
|
|
7413
|
+
this.slideToggle.get('toggle').setValue(this.value);
|
|
7414
|
+
};
|
|
7415
|
+
return OnOffSwitchComponent;
|
|
7416
|
+
}());
|
|
7417
|
+
OnOffSwitchComponent.decorators = [
|
|
7418
|
+
{ type: i0.Component, args: [{
|
|
7419
|
+
selector: 'app-on-off-switch',
|
|
7420
|
+
template: "<form [formGroup]=\"slideToggle\">\n <mat-slide-toggle formControlName=\"toggle\">On / Off\n </mat-slide-toggle>\n</form>\n",
|
|
7421
|
+
styles: [""]
|
|
7422
|
+
},] }
|
|
7423
|
+
];
|
|
7424
|
+
OnOffSwitchComponent.ctorParameters = function () { return [
|
|
7425
|
+
{ type: forms.FormBuilder }
|
|
7426
|
+
]; };
|
|
7427
|
+
OnOffSwitchComponent.propDecorators = {
|
|
7428
|
+
value: [{ type: i0.Input }]
|
|
7429
|
+
};
|
|
7430
|
+
|
|
7431
|
+
var NgxFeatureEnabledDirective = /** @class */ (function () {
|
|
7432
|
+
function NgxFeatureEnabledDirective(el, featureService, errorHandler, storage) {
|
|
7433
|
+
this.el = el;
|
|
7434
|
+
this.featureService = featureService;
|
|
7435
|
+
this.errorHandler = errorHandler;
|
|
7436
|
+
this.storage = storage;
|
|
7437
|
+
this.localFeatures = [];
|
|
7438
|
+
}
|
|
7439
|
+
NgxFeatureEnabledDirective.prototype.ngOnInit = function () {
|
|
7440
|
+
if (!this.storage.getItem('features')) {
|
|
7441
|
+
this.getFeatures();
|
|
7442
|
+
}
|
|
7443
|
+
else {
|
|
7444
|
+
this.checkForFeatureEnabled();
|
|
7445
|
+
}
|
|
7446
|
+
};
|
|
7447
|
+
NgxFeatureEnabledDirective.prototype.getFeatures = function () {
|
|
7448
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7449
|
+
var features, _a, _b, feature, error_1;
|
|
7450
|
+
var e_1, _c;
|
|
7451
|
+
return __generator(this, function (_d) {
|
|
7452
|
+
switch (_d.label) {
|
|
7453
|
+
case 0:
|
|
7454
|
+
_d.trys.push([0, 2, 3, 4]);
|
|
7455
|
+
return [4 /*yield*/, this.featureService.getFeatures()];
|
|
7456
|
+
case 1:
|
|
7457
|
+
features = _d.sent();
|
|
7458
|
+
try {
|
|
7459
|
+
for (_a = __values(features.data), _b = _a.next(); !_b.done; _b = _a.next()) {
|
|
7460
|
+
feature = _b.value;
|
|
7461
|
+
if (!feature.client_feature) {
|
|
7462
|
+
if (feature.is_enabled_default) {
|
|
7463
|
+
this.localFeatures.push(feature.code);
|
|
7464
|
+
}
|
|
7465
|
+
}
|
|
7466
|
+
else {
|
|
7467
|
+
if (feature.client_feature.is_enabled) {
|
|
7468
|
+
this.localFeatures.push(feature.code);
|
|
7469
|
+
}
|
|
7470
|
+
}
|
|
7471
|
+
}
|
|
7472
|
+
}
|
|
7473
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
7474
|
+
finally {
|
|
7475
|
+
try {
|
|
7476
|
+
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
7477
|
+
}
|
|
7478
|
+
finally { if (e_1) throw e_1.error; }
|
|
7479
|
+
}
|
|
7480
|
+
this.storage.setItem("features", this.localFeatures);
|
|
7481
|
+
return [3 /*break*/, 4];
|
|
7482
|
+
case 2:
|
|
7483
|
+
error_1 = _d.sent();
|
|
7484
|
+
this.errorHandler.handleError(error_1);
|
|
7485
|
+
return [3 /*break*/, 4];
|
|
7486
|
+
case 3:
|
|
7487
|
+
this.checkForFeatureEnabled();
|
|
7488
|
+
return [7 /*endfinally*/];
|
|
7489
|
+
case 4: return [2 /*return*/];
|
|
7490
|
+
}
|
|
7491
|
+
});
|
|
7492
|
+
});
|
|
7493
|
+
};
|
|
7494
|
+
NgxFeatureEnabledDirective.prototype.checkForFeatureEnabled = function () {
|
|
7495
|
+
try {
|
|
7496
|
+
var features = this.storage.getItem('features');
|
|
7497
|
+
var features_split = features.split(',');
|
|
7498
|
+
if (features_split.includes(this.enabledFeature)) {
|
|
7499
|
+
this.el.nativeElement.style.display = "show";
|
|
7500
|
+
}
|
|
7501
|
+
else {
|
|
7502
|
+
this.el.nativeElement.remove();
|
|
7503
|
+
}
|
|
7504
|
+
}
|
|
7505
|
+
catch (error) {
|
|
7506
|
+
this.errorHandler.handleError(error);
|
|
7507
|
+
}
|
|
7508
|
+
};
|
|
7509
|
+
return NgxFeatureEnabledDirective;
|
|
7510
|
+
}());
|
|
7511
|
+
NgxFeatureEnabledDirective.decorators = [
|
|
7512
|
+
{ type: i0.Directive, args: [{
|
|
7513
|
+
selector: '[ngxFeatureEnabled]'
|
|
7514
|
+
},] }
|
|
7515
|
+
];
|
|
7516
|
+
NgxFeatureEnabledDirective.ctorParameters = function () { return [
|
|
7517
|
+
{ type: i0.ElementRef },
|
|
7518
|
+
{ type: CompanyFeatureService },
|
|
7519
|
+
{ type: ErrorHandlerService },
|
|
7520
|
+
{ type: StorageService }
|
|
7521
|
+
]; };
|
|
7522
|
+
NgxFeatureEnabledDirective.propDecorators = {
|
|
7523
|
+
enabledFeature: [{ type: i0.Input, args: ['ngxFeatureEnabled',] }]
|
|
7524
|
+
};
|
|
7525
|
+
|
|
7526
|
+
var CompanyFeatureModule = /** @class */ (function () {
|
|
7527
|
+
function CompanyFeatureModule() {
|
|
7528
|
+
}
|
|
7529
|
+
return CompanyFeatureModule;
|
|
7530
|
+
}());
|
|
7531
|
+
CompanyFeatureModule.decorators = [
|
|
7532
|
+
{ type: i0.NgModule, args: [{
|
|
7533
|
+
imports: [
|
|
7534
|
+
common.CommonModule,
|
|
7535
|
+
MaterialModule,
|
|
7536
|
+
flexLayout.FlexLayoutModule,
|
|
7537
|
+
CompanyFeatureRoutes,
|
|
7538
|
+
slideToggle.MatSlideToggleModule,
|
|
7539
|
+
forms.FormsModule,
|
|
7540
|
+
forms.ReactiveFormsModule,
|
|
7541
|
+
ngxInfiniteScroll.InfiniteScrollModule
|
|
7542
|
+
],
|
|
7543
|
+
declarations: [exports.CompanyFeatureComponent, OnOffSwitchComponent, NgxFeatureEnabledDirective],
|
|
7544
|
+
exports: [exports.CompanyFeatureComponent, NgxFeatureEnabledDirective]
|
|
7545
|
+
},] }
|
|
7546
|
+
];
|
|
7547
|
+
|
|
7164
7548
|
/*
|
|
7165
7549
|
* Public API Surface of ngx-techlify-core
|
|
7166
7550
|
*/
|
|
@@ -7194,6 +7578,8 @@
|
|
|
7194
7578
|
exports.AuthenticationService = AuthenticationService;
|
|
7195
7579
|
exports.CacheInterceptor = CacheInterceptor;
|
|
7196
7580
|
exports.CommentFormComponent = CommentFormComponent;
|
|
7581
|
+
exports.CompanyFeatureModule = CompanyFeatureModule;
|
|
7582
|
+
exports.CompanyFeatureRoutes = CompanyFeatureRoutes;
|
|
7197
7583
|
exports.ConfigService = ConfigService;
|
|
7198
7584
|
exports.CoreModule = CoreModule;
|
|
7199
7585
|
exports.CredentialsService = CredentialsService;
|
|
@@ -7260,11 +7646,13 @@
|
|
|
7260
7646
|
exports.LoginHistoryForUserRoutingModule = LoginHistoryForUserRoutingModule;
|
|
7261
7647
|
exports.MatSelectInfiniteScrollDirective = MatSelectInfiniteScrollDirective;
|
|
7262
7648
|
exports.MaterialModule = MaterialModule;
|
|
7649
|
+
exports.NgxFeatureEnabledDirective = NgxFeatureEnabledDirective;
|
|
7263
7650
|
exports.NoteFormComponent = NoteFormComponent;
|
|
7264
7651
|
exports.NoteListComponent = NoteListComponent;
|
|
7265
7652
|
exports.NoteModule = NoteModule;
|
|
7266
7653
|
exports.NumItemsSelector = NumItemsSelector;
|
|
7267
7654
|
exports.NumberSelector = NumberSelector;
|
|
7655
|
+
exports.OnOffSwitchComponent = OnOffSwitchComponent;
|
|
7268
7656
|
exports.PageEvent = PageEvent;
|
|
7269
7657
|
exports.ReadMoreComponent = ReadMoreComponent;
|
|
7270
7658
|
exports.ReadMoreModule = ReadMoreModule;
|
|
@@ -7307,7 +7695,13 @@
|
|
|
7307
7695
|
exports.ɵbt = UpdateViewModule;
|
|
7308
7696
|
exports.ɵbu = UpdateViewComponent;
|
|
7309
7697
|
exports.ɵbv = DataManager;
|
|
7698
|
+
exports.ɵbw = DataManager;
|
|
7699
|
+
exports.ɵbx = ErrorHandlerService;
|
|
7700
|
+
exports.ɵby = AlertService;
|
|
7701
|
+
exports.ɵbz = StorageService;
|
|
7310
7702
|
exports.ɵc = ErrorSnackComponent;
|
|
7703
|
+
exports.ɵca = CompanyFeatureService;
|
|
7704
|
+
exports.ɵcb = AuthenticationGuard;
|
|
7311
7705
|
exports.ɵd = HTTP_DYNAMIC_INTERCEPTORS;
|
|
7312
7706
|
exports.ɵe = HttpService;
|
|
7313
7707
|
exports.ɵf = RouteReusableStrategy;
|