ngx-techlify-core 11.3.5 → 11.3.9
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 +576 -39
- 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/audit-log/audit-log-view/audit-log-view.component.js +7 -9
- package/esm2015/lib/audit-log/audit-log-view-model/audit-log-view-model.component.js +7 -9
- package/esm2015/lib/email-subscription/email-subscription-type/email-subscription-type-list/email-subscription-type-list.component.js +2 -2
- package/esm2015/lib/email-subscription/email-subscription-user/email-subscription-user-list-filter/email-subscription-user-list-filter.component.js +2 -2
- package/esm2015/lib/login-history-for-user/login-history-for-user.component.js +11 -2
- package/esm2015/lib/techlify-feature/on-off-switch/on-off-switch.component.js +27 -0
- package/esm2015/lib/techlify-feature/techlify-feature-enabled.directive.js +77 -0
- package/esm2015/lib/techlify-feature/techlify-feature-listing.component.js +174 -0
- package/esm2015/lib/techlify-feature/techlify-feature.module.js +30 -0
- package/esm2015/lib/techlify-feature/techlify-feature.routing.js +12 -0
- package/esm2015/lib/techlify-feature/techlify-feature.service.js +28 -0
- package/esm2015/lib/timeline-filter/calculate-timeline.js +2 -2
- package/esm2015/lib/timeline-filter/timeline-filter.component.js +146 -16
- package/esm2015/ngx-techlify-core.js +4 -1
- package/esm2015/public-api.js +5 -1
- package/fesm2015/ngx-techlify-core.js +478 -33
- package/fesm2015/ngx-techlify-core.js.map +1 -1
- package/lib/login-history-for-user/login-history-for-user.component.d.ts +2 -0
- package/lib/techlify-feature/on-off-switch/on-off-switch.component.d.ts +9 -0
- package/lib/techlify-feature/techlify-feature-enabled.directive.d.ts +16 -0
- package/lib/techlify-feature/techlify-feature-listing.component.d.ts +34 -0
- package/lib/techlify-feature/techlify-feature.module.d.ts +2 -0
- package/lib/techlify-feature/techlify-feature.routing.d.ts +2 -0
- package/lib/techlify-feature/techlify-feature.service.d.ts +8 -0
- package/lib/timeline-filter/calculate-timeline.d.ts +5 -0
- package/lib/timeline-filter/timeline-filter.component.d.ts +47 -6
- package/ngx-techlify-core.d.ts +3 -0
- package/ngx-techlify-core.metadata.json +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +4 -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() {
|
|
@@ -2786,7 +2786,7 @@
|
|
|
2786
2786
|
}
|
|
2787
2787
|
case 4: { // This Week
|
|
2788
2788
|
var first = date.getDate() - date.getDay() + 1; // First day is the day of the month - the day of the week
|
|
2789
|
-
var last = first + 6; // last day is the first day + 6
|
|
2789
|
+
var last = first + 6; // last day is the first day + 6
|
|
2790
2790
|
data.date_from = new Date(date.setDate(first));
|
|
2791
2791
|
data.date_to = new Date(date.setDate(last));
|
|
2792
2792
|
break;
|
|
@@ -2868,8 +2868,11 @@
|
|
|
2868
2868
|
Timeline.LAST_YEAR = 11;
|
|
2869
2869
|
Timeline.ALL = 12;
|
|
2870
2870
|
|
|
2871
|
-
|
|
2872
|
-
|
|
2871
|
+
var TimelineFilterComponent_1;
|
|
2872
|
+
exports.ɵbb = TimelineFilterComponent_1 = /** @class */ (function () {
|
|
2873
|
+
function TimelineFilterComponent(formBuilder, ngControl, datePipe) {
|
|
2874
|
+
this.ngControl = ngControl;
|
|
2875
|
+
this.datePipe = datePipe;
|
|
2873
2876
|
this.timelineValue = new forms.FormControl('');
|
|
2874
2877
|
this.timelines = [
|
|
2875
2878
|
{ value: 1, viewValue: 'Custom' },
|
|
@@ -2885,12 +2888,33 @@
|
|
|
2885
2888
|
{ value: 11, viewValue: 'Last Year' },
|
|
2886
2889
|
{ value: 12, viewValue: 'All dates' },
|
|
2887
2890
|
];
|
|
2888
|
-
this.labelText = 'Select Timeline';
|
|
2889
2891
|
this.dateFrom = 'date_from';
|
|
2890
2892
|
this.dateTo = 'date_to';
|
|
2891
2893
|
this.appearance = "legacy";
|
|
2892
2894
|
this.showClearbutton = false;
|
|
2895
|
+
/**
|
|
2896
|
+
* @deprecated The form input is deprated
|
|
2897
|
+
*/
|
|
2898
|
+
this.form = null;
|
|
2899
|
+
this.labelText = 'Select Timeline';
|
|
2900
|
+
this.touchUi = true;
|
|
2901
|
+
this.selectedValueChange = new i0.EventEmitter();
|
|
2902
|
+
this.selectionChange = new i0.EventEmitter();
|
|
2903
|
+
this.onChange = function () { };
|
|
2904
|
+
this.onTouched = function () { };
|
|
2905
|
+
this.stateChanges = new rxjs.Subject();
|
|
2906
|
+
this.controlType = 'timeline-filter';
|
|
2907
|
+
this.id = "timeline-filter-" + TimelineFilterComponent_1.nextId++;
|
|
2908
|
+
this.describedBy = '';
|
|
2893
2909
|
this.showCustomDateFields = false;
|
|
2910
|
+
this._required = false;
|
|
2911
|
+
this._disabled = false;
|
|
2912
|
+
this.selectorForm = formBuilder.group({
|
|
2913
|
+
select_value: [null],
|
|
2914
|
+
});
|
|
2915
|
+
if (this.ngControl != null) {
|
|
2916
|
+
this.ngControl.valueAccessor = this;
|
|
2917
|
+
}
|
|
2894
2918
|
}
|
|
2895
2919
|
Object.defineProperty(TimelineFilterComponent.prototype, "defaultValue", {
|
|
2896
2920
|
set: function (value) {
|
|
@@ -2900,10 +2924,53 @@
|
|
|
2900
2924
|
enumerable: false,
|
|
2901
2925
|
configurable: true
|
|
2902
2926
|
});
|
|
2903
|
-
TimelineFilterComponent.prototype
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2927
|
+
Object.defineProperty(TimelineFilterComponent.prototype, "required", {
|
|
2928
|
+
get: function () { return this._required; },
|
|
2929
|
+
set: function (value) {
|
|
2930
|
+
this.selectorForm.get('select_value').setValidators(forms.Validators.required);
|
|
2931
|
+
this._required = coercion.coerceBooleanProperty(value);
|
|
2932
|
+
this.stateChanges.next();
|
|
2933
|
+
},
|
|
2934
|
+
enumerable: false,
|
|
2935
|
+
configurable: true
|
|
2936
|
+
});
|
|
2937
|
+
Object.defineProperty(TimelineFilterComponent.prototype, "disabled", {
|
|
2938
|
+
get: function () { return this._disabled; },
|
|
2939
|
+
set: function (value) {
|
|
2940
|
+
this._disabled = coercion.coerceBooleanProperty(value);
|
|
2941
|
+
this._disabled ? this.selectorForm.disable() : this.selectorForm.enable();
|
|
2942
|
+
this.stateChanges.next();
|
|
2943
|
+
},
|
|
2944
|
+
enumerable: false,
|
|
2945
|
+
configurable: true
|
|
2946
|
+
});
|
|
2947
|
+
Object.defineProperty(TimelineFilterComponent.prototype, "value", {
|
|
2948
|
+
get: function () {
|
|
2949
|
+
if (this.selectorForm.valid) {
|
|
2950
|
+
return this.selectorForm.value.select_value;
|
|
2951
|
+
}
|
|
2952
|
+
return '';
|
|
2953
|
+
},
|
|
2954
|
+
set: function (data) {
|
|
2955
|
+
this.selectorForm.patchValue({ select_value: data || '' });
|
|
2956
|
+
this._handleInput();
|
|
2957
|
+
this.stateChanges.next();
|
|
2958
|
+
},
|
|
2959
|
+
enumerable: false,
|
|
2960
|
+
configurable: true
|
|
2961
|
+
});
|
|
2962
|
+
TimelineFilterComponent.prototype.getDateRangeString = function () {
|
|
2963
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
2964
|
+
var str = "";
|
|
2965
|
+
if ((_a = this.selectedRange) === null || _a === void 0 ? void 0 : _a.show_custom_field) {
|
|
2966
|
+
if (((_b = this.selectedRange) === null || _b === void 0 ? void 0 : _b.date_from.toUTCString()) != 'Invalid Date') {
|
|
2967
|
+
str += ' - ' + this.datePipe.transform((_d = (_c = this.selectedRange) === null || _c === void 0 ? void 0 : _c.date_from) === null || _d === void 0 ? void 0 : _d.toUTCString());
|
|
2968
|
+
}
|
|
2969
|
+
if (((_e = this.selectedRange) === null || _e === void 0 ? void 0 : _e.date_to.toUTCString()) != 'Invalid Date') {
|
|
2970
|
+
str += ' - ' + this.datePipe.transform((_g = (_f = this.selectedRange) === null || _f === void 0 ? void 0 : _f.date_to) === null || _g === void 0 ? void 0 : _g.toUTCString());
|
|
2971
|
+
}
|
|
2972
|
+
}
|
|
2973
|
+
return str;
|
|
2907
2974
|
};
|
|
2908
2975
|
TimelineFilterComponent.prototype.resetFieldValue = function (field) {
|
|
2909
2976
|
this.form.get(field).setValue('');
|
|
@@ -2922,28 +2989,99 @@
|
|
|
2922
2989
|
this.showCustomDateFields = timeline.show_custom_field;
|
|
2923
2990
|
}
|
|
2924
2991
|
};
|
|
2992
|
+
TimelineFilterComponent.prototype._handleInput = function () {
|
|
2993
|
+
if (this.value == 1) {
|
|
2994
|
+
this.picker.open();
|
|
2995
|
+
return;
|
|
2996
|
+
}
|
|
2997
|
+
var range = calculateTimeline(this.value);
|
|
2998
|
+
this.selectedRange = range;
|
|
2999
|
+
this.onChange(this.value);
|
|
3000
|
+
this.selectedValueChange.emit(this.selectedValue);
|
|
3001
|
+
this.selectionChange.emit(range);
|
|
3002
|
+
};
|
|
3003
|
+
TimelineFilterComponent.prototype.dateRangeChange = function (dateRangeStart, dateRangeEnd) {
|
|
3004
|
+
var range = {
|
|
3005
|
+
date_from: new Date(dateRangeStart.value),
|
|
3006
|
+
date_to: new Date(dateRangeEnd.value),
|
|
3007
|
+
show_custom_field: true
|
|
3008
|
+
};
|
|
3009
|
+
this.selectedRange = range;
|
|
3010
|
+
this.onChange(this.value);
|
|
3011
|
+
this.selectedValueChange.emit(this.selectedValue);
|
|
3012
|
+
this.selectionChange.emit(range);
|
|
3013
|
+
};
|
|
3014
|
+
TimelineFilterComponent.prototype.onCustomDateChange = function (event) {
|
|
3015
|
+
console.log(event);
|
|
3016
|
+
};
|
|
3017
|
+
TimelineFilterComponent.prototype.setDescribedByIds = function (ids) {
|
|
3018
|
+
this.describedBy = ids.join(' ');
|
|
3019
|
+
};
|
|
3020
|
+
TimelineFilterComponent.prototype.onContainerClick = function (event) {
|
|
3021
|
+
event.stopPropagation();
|
|
3022
|
+
};
|
|
3023
|
+
TimelineFilterComponent.prototype.writeValue = function (data) {
|
|
3024
|
+
this.value = data;
|
|
3025
|
+
};
|
|
3026
|
+
TimelineFilterComponent.prototype.registerOnChange = function (fn) {
|
|
3027
|
+
this.onChange = fn;
|
|
3028
|
+
};
|
|
3029
|
+
TimelineFilterComponent.prototype.registerOnTouched = function (fn) {
|
|
3030
|
+
this.onTouched = fn;
|
|
3031
|
+
};
|
|
3032
|
+
TimelineFilterComponent.prototype.setDisabledState = function (isDisabled) {
|
|
3033
|
+
this.disabled = isDisabled;
|
|
3034
|
+
};
|
|
3035
|
+
TimelineFilterComponent.prototype.ngOnInit = function () {
|
|
3036
|
+
var _this = this;
|
|
3037
|
+
console.log(this.form);
|
|
3038
|
+
this.timelineValue.valueChanges.
|
|
3039
|
+
pipe(operators.debounceTime(100), operators.distinctUntilChanged(), untilDestroy.untilDestroyed(this)).subscribe(function (value) { return _this.changeTimeline(value); });
|
|
3040
|
+
};
|
|
3041
|
+
TimelineFilterComponent.prototype.ngOnDestroy = function () {
|
|
3042
|
+
this.stateChanges.complete();
|
|
3043
|
+
};
|
|
2925
3044
|
return TimelineFilterComponent;
|
|
2926
3045
|
}());
|
|
3046
|
+
exports.ɵbb.nextId = 0;
|
|
2927
3047
|
exports.ɵbb.decorators = [
|
|
2928
3048
|
{ type: i0.Component, args: [{
|
|
2929
3049
|
selector: 'app-timeline-filter',
|
|
2930
|
-
template: "<ng-container [formGroup]=\"form\">\n
|
|
3050
|
+
template: "<ng-container *ngIf=\"form\" [formGroup]=\"form\">\n <mat-form-field [appearance]=\"appearance\">\n <mat-label>{{labelText}}</mat-label>\n <mat-select [formControl]=\"timelineValue\">\n <mat-option *ngFor=\"let timeline of timelines\" [value]=\"timeline.value\">\n {{timeline.viewValue}}\n </mat-option>\n </mat-select>\n <button mat-button *ngIf=\"showClearbutton && timelineValue.value\" matSuffix mat-icon-button\n (click)=\"timelineValue.setValue('')\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <ng-container *ngIf=\"showCustomDateFields\">\n <mat-form-field [appearance]=\"appearance\">\n <mat-label>From Date</mat-label>\n <input matInput formControlName=\"{{dateFrom}}\" [matDatepicker]=\"fromPicker\" (click)=\"fromPicker.open()\"\n placeholder=\"From Date\" readonly />\n <mat-datepicker-toggle matSuffix [for]=\"fromPicker\"></mat-datepicker-toggle>\n <mat-datepicker #fromPicker></mat-datepicker>\n <button mat-button *ngIf=\"getFieldValue(dateFrom)\" matSuffix mat-icon-button\n (click)=\"resetFieldValue(dateFrom)\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <mat-form-field [appearance]=\"appearance\">\n <mat-label>To Date</mat-label>\n <input matInput formControlName=\"{{dateTo}}\" [matDatepicker]=\"toPicker\" (click)=\"toPicker.open()\"\n placeholder=\"To Date\" readonly />\n <mat-datepicker-toggle matSuffix [for]=\"\"></mat-datepicker-toggle>\n <mat-datepicker #toPicker></mat-datepicker>\n <button mat-button *ngIf=\"getFieldValue(dateTo)\" matSuffix mat-icon-button\n (click)=\"resetFieldValue(dateTo)\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n </ng-container>\n</ng-container>\n<div *ngIf=\"!form\" [formGroup]=\"selectorForm\">\n <mat-select formControlName=\"select_value\" focused=\"false\" [required]=\"required\"\n autocomplete=\"off\" (selectionChange)=\"_handleInput()\">\n <mat-option *ngFor=\"let timeline of timelines\" [value]=\"timeline?.value\">\n {{ timeline?.viewValue }} {{ selectedRange?.show_custom_field && timeline?.value == 1 ? getDateRangeString() : '' }}\n </mat-option>\n </mat-select>\n <mat-date-range-input hidden (dateChange)=\"onCustomDateChange($event)\" [rangePicker]=\"picker\">\n <input matStartDate #customStartDate>\n <input matEndDate (dateChange)=\"dateRangeChange(customStartDate, customEndDate)\" #customEndDate>\n </mat-date-range-input>\n <mat-date-range-picker #picker [touchUi]=\"touchUi\"></mat-date-range-picker>\n</div>\n",
|
|
3051
|
+
providers: [
|
|
3052
|
+
{
|
|
3053
|
+
provide: formField.MatFormFieldControl,
|
|
3054
|
+
useExisting: TimelineFilterComponent_1
|
|
3055
|
+
}
|
|
3056
|
+
],
|
|
2931
3057
|
styles: [""]
|
|
2932
3058
|
},] }
|
|
2933
3059
|
];
|
|
2934
|
-
exports.ɵbb.ctorParameters = function () { return [
|
|
3060
|
+
exports.ɵbb.ctorParameters = function () { return [
|
|
3061
|
+
{ type: forms.FormBuilder },
|
|
3062
|
+
{ type: forms.NgControl, decorators: [{ type: i0.Optional }, { type: i0.Self }] },
|
|
3063
|
+
{ type: common.DatePipe }
|
|
3064
|
+
]; };
|
|
2935
3065
|
exports.ɵbb.propDecorators = {
|
|
3066
|
+
picker: [{ type: i0.ViewChild, args: ['picker',] }],
|
|
2936
3067
|
timelineValue: [{ type: i0.Input }],
|
|
2937
3068
|
timelines: [{ type: i0.Input }],
|
|
2938
|
-
labelText: [{ type: i0.Input }],
|
|
2939
3069
|
dateFrom: [{ type: i0.Input }],
|
|
2940
3070
|
dateTo: [{ type: i0.Input }],
|
|
2941
3071
|
appearance: [{ type: i0.Input }],
|
|
2942
3072
|
showClearbutton: [{ type: i0.Input }],
|
|
2943
3073
|
form: [{ type: i0.Input }],
|
|
2944
|
-
|
|
3074
|
+
labelText: [{ type: i0.Input }],
|
|
3075
|
+
selectedValue: [{ type: i0.Input }],
|
|
3076
|
+
touchUi: [{ type: i0.Input }],
|
|
3077
|
+
selectedValueChange: [{ type: i0.Output }],
|
|
3078
|
+
selectionChange: [{ type: i0.Output }],
|
|
3079
|
+
defaultValue: [{ type: i0.Input }],
|
|
3080
|
+
required: [{ type: i0.Input }],
|
|
3081
|
+
disabled: [{ type: i0.Input }],
|
|
3082
|
+
value: [{ type: i0.Input }]
|
|
2945
3083
|
};
|
|
2946
|
-
exports.ɵbb = __decorate([
|
|
3084
|
+
exports.ɵbb = TimelineFilterComponent_1 = __decorate([
|
|
2947
3085
|
untilDestroy.UntilDestroy()
|
|
2948
3086
|
], exports.ɵbb);
|
|
2949
3087
|
|
|
@@ -4050,7 +4188,7 @@
|
|
|
4050
4188
|
exports.ɵbh.decorators = [
|
|
4051
4189
|
{ type: i0.Component, args: [{
|
|
4052
4190
|
selector: 'app-email-subscription-user-list-filter',
|
|
4053
|
-
template: "<form [formGroup]=\"esUserFilterForm\" fxLayout=\"row wrap\" fxLayoutGap=\"1rem\" fxLayoutAlign=\"start center\">\n <mat-form-field class=\"ml-3\">\n <mat-label>User</mat-label>\n <app-searchable-selector formControlName=\"user_id\" apiUrl=\"api/users\" titleField=\"name\">\n </app-searchable-selector>\n <button mat-button *ngIf=\"getFieldValue('user_id')\" matSuffix mat-icon-button\n (click)=\"resetFieldValue('user_id')\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <mat-form-field class=\"ml-3\">\n <mat-label>Email Type</mat-label>\n <app-searchable-selector formControlName=\"email_type_id\" apiUrl=\"api/email-subscription-types\">\n </app-searchable-selector>\n <button mat-button *ngIf=\"getFieldValue('
|
|
4191
|
+
template: "<form [formGroup]=\"esUserFilterForm\" fxLayout=\"row wrap\" fxLayoutGap=\"1rem\" fxLayoutAlign=\"start center\">\n <mat-form-field class=\"ml-3\">\n <mat-label>User</mat-label>\n <app-searchable-selector formControlName=\"user_id\" apiUrl=\"api/users\" titleField=\"name\">\n </app-searchable-selector>\n <button mat-button *ngIf=\"getFieldValue('user_id')\" matSuffix mat-icon-button\n (click)=\"resetFieldValue('user_id')\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <mat-form-field class=\"ml-3\">\n <mat-label>Email Type</mat-label>\n <app-searchable-selector formControlName=\"email_type_id\" apiUrl=\"api/email-subscription-types\">\n </app-searchable-selector>\n <button mat-button *ngIf=\"getFieldValue('email_type_id')\" matSuffix mat-icon-button\n (click)=\"resetFieldValue('email_type_id')\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n</form>",
|
|
4054
4192
|
styles: [""]
|
|
4055
4193
|
},] }
|
|
4056
4194
|
];
|
|
@@ -4401,7 +4539,7 @@
|
|
|
4401
4539
|
exports.ɵbj.decorators = [
|
|
4402
4540
|
{ type: i0.Component, args: [{
|
|
4403
4541
|
selector: 'app-email-subscription-type-list',
|
|
4404
|
-
template: "<div class=\"mat-typography m-4\">\n <div fxLayout=\"row wrap\" fxLayoutAlign=\"start center\">\n <mat-form-field>\n <input matInput [formControl]=\"search\" placeholder=\"Email Type\" autocomplete=\"off\" />\n <button mat-button matSuffix mat-icon-button>\n <mat-icon>search</mat-icon>\n </button>\n <button mat-button *ngIf=\"search.value\" matSuffix mat-icon-button (click)=\"search.setValue('')\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n <div class=\"ml-2\">\n <button mat-raised-button color=\"primary\" type=\"button\" (click)=\"addEmailSubscriptionType()\">+ Email\n Type</button>\n </div>\n <span fxFlex></span>\n <mat-form-field appearance=\"outline\" class=\"no-padding\">\n <mat-label>Columns</mat-label>\n <mat-select [formControl]=\"displayColumns\" multiple (selectionChange)=\"columnsChange()\">\n <mat-option *ngFor=\"let column of availableDisplayColumns\" [value]=\"column.value\">{{column.name}}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n\n <section>\n <div class=\"scroll-container\" infiniteScroll [infiniteScrollDistance]=\"2\" [infiniteScrollThrottle]=\"50\"\n (scrolled)=\"onScroll()\" [scrollWindow]=\"false\">\n <table mat-table [dataSource]=\"emailSubscriptionTypeList\" matSort class=\"w-100 mt-1\" multiTemplateDataRows\n id=\"email-subscription-type-table\">\n\n <!-- Index Column -->\n <ng-container matColumnDef=\"index\">\n <th mat-header-cell *matHeaderCellDef> # </th>\n <td mat-cell *matCellDef=\"let emailSubscriptionType; let i = dataIndex\"> {{ i+1 }} </td>\n </ng-container>\n <ng-container matColumnDef=\"title\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header> Title </th>\n <td mat-cell *matCellDef=\"let emailSubscriptionType;\"> {{ emailSubscriptionType?.title }} </td>\n </ng-container>\n <ng-container matColumnDef=\"code\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header> Code </th>\n <td mat-cell *matCellDef=\"let emailSubscriptionType;\"> {{ emailSubscriptionType?.code }}\n </td>\n </ng-container>\n <ng-container matColumnDef=\"frequency.title\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>
|
|
4542
|
+
template: "<div class=\"mat-typography m-4\">\n <div fxLayout=\"row wrap\" fxLayoutAlign=\"start center\">\n <mat-form-field>\n <input matInput [formControl]=\"search\" placeholder=\"Email Type\" autocomplete=\"off\" />\n <button mat-button matSuffix mat-icon-button>\n <mat-icon>search</mat-icon>\n </button>\n <button mat-button *ngIf=\"search.value\" matSuffix mat-icon-button (click)=\"search.setValue('')\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n <div class=\"ml-2\">\n <button mat-raised-button color=\"primary\" type=\"button\" (click)=\"addEmailSubscriptionType()\">+ Email\n Type</button>\n </div>\n <span fxFlex></span>\n <mat-form-field appearance=\"outline\" class=\"no-padding\">\n <mat-label>Columns</mat-label>\n <mat-select [formControl]=\"displayColumns\" multiple (selectionChange)=\"columnsChange()\">\n <mat-option *ngFor=\"let column of availableDisplayColumns\" [value]=\"column.value\">{{column.name}}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n\n <section>\n <div class=\"scroll-container\" infiniteScroll [infiniteScrollDistance]=\"2\" [infiniteScrollThrottle]=\"50\"\n (scrolled)=\"onScroll()\" [scrollWindow]=\"false\">\n <table mat-table [dataSource]=\"emailSubscriptionTypeList\" matSort class=\"w-100 mt-1\" multiTemplateDataRows\n id=\"email-subscription-type-table\">\n\n <!-- Index Column -->\n <ng-container matColumnDef=\"index\">\n <th mat-header-cell *matHeaderCellDef> # </th>\n <td mat-cell *matCellDef=\"let emailSubscriptionType; let i = dataIndex\"> {{ i+1 }} </td>\n </ng-container>\n <ng-container matColumnDef=\"title\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header> Title </th>\n <td mat-cell *matCellDef=\"let emailSubscriptionType;\"> {{ emailSubscriptionType?.title }} </td>\n </ng-container>\n <ng-container matColumnDef=\"code\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header> Code </th>\n <td mat-cell *matCellDef=\"let emailSubscriptionType;\"> {{ emailSubscriptionType?.code }}\n </td>\n </ng-container>\n <ng-container matColumnDef=\"frequency.title\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header> Frequency </th>\n <td mat-cell *matCellDef=\"let emailSubscriptionType;\"> {{ emailSubscriptionType?.frequency?.title }}\n </td>\n </ng-container>\n <ng-container matColumnDef=\"description\">\n <th mat-header-cell *matHeaderCellDef> Description </th>\n <td mat-cell *matCellDef=\"let emailSubscriptionType;\"> {{ emailSubscriptionType?.description }}\n </td>\n </ng-container>\n\n <!-- Actions Column -->\n <ng-container matColumnDef=\"actions\">\n <th mat-header-cell *matHeaderCellDef> Actions </th>\n <td mat-cell *matCellDef=\"let emailSubscriptionType\">\n <button type=\"button\" mat-icon-button\n (click)=\"deleteEmailSubscriptionType($event,emailSubscriptionType)\">\n <mat-icon>delete</mat-icon>\n </button>\n <button type=\"button\" mat-icon-button\n (click)=\"editEmailSubscriptionType($event,emailSubscriptionType)\">\n <mat-icon>edit</mat-icon>\n </button>\n </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns; sticky:true\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\n </table>\n </div>\n </section>\n</div>",
|
|
4405
4543
|
styles: [".scroll-container{max-height:800px;overflow-y:auto}"]
|
|
4406
4544
|
},] }
|
|
4407
4545
|
];
|
|
@@ -5487,14 +5625,12 @@
|
|
|
5487
5625
|
AuditLogViewModelComponent.prototype.getTransformedChanges = function () {
|
|
5488
5626
|
var _this = this;
|
|
5489
5627
|
var _a, _b, _c, _d;
|
|
5490
|
-
|
|
5491
|
-
|
|
5492
|
-
|
|
5493
|
-
|
|
5494
|
-
|
|
5495
|
-
|
|
5496
|
-
});
|
|
5497
|
-
}
|
|
5628
|
+
var changes = ((((_a = this.logInfo) === null || _a === void 0 ? void 0 : _a.action) === 'deleted') ? Object.keys((_b = this.logInfo) === null || _b === void 0 ? void 0 : _b.object) : Object.keys((_d = (_c = this.logInfo) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.changes)) || [];
|
|
5629
|
+
changes.forEach(function (key) {
|
|
5630
|
+
var _a, _b, _c, _d, _e;
|
|
5631
|
+
var displayAttribute = key.split('_').map(function (x) { return x.charAt(0).toUpperCase() + x.slice(1); }).join(' ');
|
|
5632
|
+
_this.changeList.push({ displayAttribute: displayAttribute, attribute: key, newValue: (((_a = _this.logInfo) === null || _a === void 0 ? void 0 : _a.action) === 'deleted') ? '' : ((_c = (_b = _this.logInfo) === null || _b === void 0 ? void 0 : _b.object[key]) !== null && _c !== void 0 ? _c : ''), oldValue: (_e = (_d = _this.logInfo) === null || _d === void 0 ? void 0 : _d.pre_object[key]) !== null && _e !== void 0 ? _e : '' });
|
|
5633
|
+
});
|
|
5498
5634
|
};
|
|
5499
5635
|
AuditLogViewModelComponent.prototype.close = function () {
|
|
5500
5636
|
this.dialogRef.close();
|
|
@@ -5992,23 +6128,21 @@
|
|
|
5992
6128
|
AuditLogViewComponent.prototype.getTransformedChanges = function () {
|
|
5993
6129
|
var _this = this;
|
|
5994
6130
|
var _a, _b, _c, _d;
|
|
5995
|
-
|
|
5996
|
-
|
|
5997
|
-
|
|
5998
|
-
|
|
5999
|
-
|
|
6000
|
-
|
|
6001
|
-
});
|
|
6002
|
-
}
|
|
6131
|
+
var changes = ((((_a = this.logInfo) === null || _a === void 0 ? void 0 : _a.action) === 'deleted') ? Object.keys((_b = this.logInfo) === null || _b === void 0 ? void 0 : _b.object) : Object.keys((_d = (_c = this.logInfo) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.changes)) || [];
|
|
6132
|
+
changes.forEach(function (key) {
|
|
6133
|
+
var _a, _b, _c, _d, _e;
|
|
6134
|
+
var displayAttribute = key.split('_').map(function (x) { return x.charAt(0).toUpperCase() + x.slice(1); }).join(' ');
|
|
6135
|
+
_this.changeList.push({ displayAttribute: displayAttribute, attribute: key, newValue: (((_a = _this.logInfo) === null || _a === void 0 ? void 0 : _a.action) === 'deleted') ? '' : ((_c = (_b = _this.logInfo) === null || _b === void 0 ? void 0 : _b.object[key]) !== null && _c !== void 0 ? _c : ''), oldValue: (_e = (_d = _this.logInfo) === null || _d === void 0 ? void 0 : _d.pre_object[key]) !== null && _e !== void 0 ? _e : '' });
|
|
6136
|
+
});
|
|
6003
6137
|
};
|
|
6004
6138
|
AuditLogViewComponent.prototype.fetchLogDetail = function (logId) {
|
|
6005
6139
|
return __awaiter(this, void 0, void 0, function () {
|
|
6006
6140
|
var result;
|
|
6007
|
-
return __generator(this, function (
|
|
6008
|
-
switch (
|
|
6141
|
+
return __generator(this, function (_f) {
|
|
6142
|
+
switch (_f.label) {
|
|
6009
6143
|
case 0: return [4 /*yield*/, this.dataManager.GET("api/audit-logs/" + logId)];
|
|
6010
6144
|
case 1:
|
|
6011
|
-
result =
|
|
6145
|
+
result = _f.sent();
|
|
6012
6146
|
this.logInfo = result.item;
|
|
6013
6147
|
this.getTransformedChanges();
|
|
6014
6148
|
this.patchDelta();
|
|
@@ -6492,6 +6626,7 @@
|
|
|
6492
6626
|
};
|
|
6493
6627
|
this.displayedColumns = ['index', 'created_at'];
|
|
6494
6628
|
this.historyFilterForm = this.fb.group({
|
|
6629
|
+
'duration': [''],
|
|
6495
6630
|
'date_from': [''],
|
|
6496
6631
|
'date_to': ['']
|
|
6497
6632
|
});
|
|
@@ -6508,6 +6643,14 @@
|
|
|
6508
6643
|
});
|
|
6509
6644
|
this.initializeData();
|
|
6510
6645
|
};
|
|
6646
|
+
LoginHistoryForUserComponent.prototype.onTimelineChange = function (range) {
|
|
6647
|
+
var date_from = (range === null || range === void 0 ? void 0 : range.date_from) ? new Date(range.date_from) : '';
|
|
6648
|
+
var date_to = (range === null || range === void 0 ? void 0 : range.date_to) ? new Date(range.date_to) : '';
|
|
6649
|
+
this.historyFilterForm.patchValue({
|
|
6650
|
+
date_from: date_from,
|
|
6651
|
+
date_to: date_to
|
|
6652
|
+
});
|
|
6653
|
+
};
|
|
6511
6654
|
LoginHistoryForUserComponent.prototype.initializeData = function () {
|
|
6512
6655
|
var _this = this;
|
|
6513
6656
|
this.http.get("api/user-login-history", { params: Object.assign(Object.assign({}, this.filters), this.pageEvent) })
|
|
@@ -6541,7 +6684,7 @@
|
|
|
6541
6684
|
exports.LoginHistoryForUserComponent.decorators = [
|
|
6542
6685
|
{ type: i0.Component, args: [{
|
|
6543
6686
|
selector: 'app-login-history-for-user',
|
|
6544
|
-
template: "<div class=\"mat-typography m-4\">\n <form fxLayoutAlign=\" start center\">\n <app-timeline-filter
|
|
6687
|
+
template: "<div class=\"mat-typography m-4\">\n <form [formGroup]=\"historyFilterForm\" fxLayoutAlign=\" start center\">\n <app-timeline-filter formControlName=\"duration\" (selectionChange)=\"onTimelineChange($event)\"></app-timeline-filter>\n </form>\n\n <section>\n <div class=\"scroll-container\" infiniteScroll [infiniteScrollDistance]=\"2\" [infiniteScrollThrottle]=\"50\"\n (scrolled)=\"onScroll()\" [scrollWindow]=\"false\">\n <table mat-table [dataSource]=\"loginHistoryList\" matSort class=\"w-100 mt-1\" multiTemplateDataRows\n id=\"login-history-table\">\n\n <!-- Index Column -->\n <ng-container matColumnDef=\"index\">\n <th mat-header-cell *matHeaderCellDef> # </th>\n <td mat-cell *matCellDef=\"let loginHistory; let i = dataIndex\"> {{ i+1 }} </td>\n </ng-container>\n\n <ng-container matColumnDef=\"created_at\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header> Last Login</th>\n <td mat-cell *matCellDef=\"let loginHistory;\">\n {{loginHistory?.created_at | date:'medium' }}\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 </div>\n\n </section>\n</div>\n",
|
|
6545
6688
|
styles: [".scroll-container{max-height:800px;overflow-y:auto}"]
|
|
6546
6689
|
},] }
|
|
6547
6690
|
];
|
|
@@ -7161,6 +7304,390 @@
|
|
|
7161
7304
|
},] }
|
|
7162
7305
|
];
|
|
7163
7306
|
|
|
7307
|
+
var TechlifyFeatureService = /** @class */ (function () {
|
|
7308
|
+
function TechlifyFeatureService(dataManager) {
|
|
7309
|
+
this.dataManager = dataManager;
|
|
7310
|
+
}
|
|
7311
|
+
TechlifyFeatureService.prototype.getFeatures = function () {
|
|
7312
|
+
return this.dataManager.GET("api/features");
|
|
7313
|
+
};
|
|
7314
|
+
TechlifyFeatureService.prototype.disableFeature = function (id) {
|
|
7315
|
+
return this.dataManager.GET("api/feature/" + id + "/disable");
|
|
7316
|
+
};
|
|
7317
|
+
TechlifyFeatureService.prototype.enableFeature = function (id) {
|
|
7318
|
+
return this.dataManager.GET("api/feature/" + id + "/enable");
|
|
7319
|
+
};
|
|
7320
|
+
return TechlifyFeatureService;
|
|
7321
|
+
}());
|
|
7322
|
+
TechlifyFeatureService.ɵprov = i0.ɵɵdefineInjectable({ factory: function TechlifyFeatureService_Factory() { return new TechlifyFeatureService(i0.ɵɵinject(DataManager)); }, token: TechlifyFeatureService, providedIn: "root" });
|
|
7323
|
+
TechlifyFeatureService.decorators = [
|
|
7324
|
+
{ type: i0.Injectable, args: [{
|
|
7325
|
+
providedIn: 'root'
|
|
7326
|
+
},] }
|
|
7327
|
+
];
|
|
7328
|
+
TechlifyFeatureService.ctorParameters = function () { return [
|
|
7329
|
+
{ type: DataManager }
|
|
7330
|
+
]; };
|
|
7331
|
+
|
|
7332
|
+
exports.TechlifyFeatureListingComponent = /** @class */ (function () {
|
|
7333
|
+
function TechlifyFeatureListingComponent(dataManager, errorHandler, fb, alertService, dialog, storage, featureService) {
|
|
7334
|
+
this.dataManager = dataManager;
|
|
7335
|
+
this.errorHandler = errorHandler;
|
|
7336
|
+
this.fb = fb;
|
|
7337
|
+
this.alertService = alertService;
|
|
7338
|
+
this.dialog = dialog;
|
|
7339
|
+
this.storage = storage;
|
|
7340
|
+
this.featureService = featureService;
|
|
7341
|
+
this.features = [];
|
|
7342
|
+
this.displayedColumns = [
|
|
7343
|
+
'index',
|
|
7344
|
+
'feature',
|
|
7345
|
+
'description',
|
|
7346
|
+
'actions',
|
|
7347
|
+
];
|
|
7348
|
+
this.dataSource = new table.MatTableDataSource();
|
|
7349
|
+
this.page = 1;
|
|
7350
|
+
this.perPage = 25;
|
|
7351
|
+
this.isWorking = false;
|
|
7352
|
+
this.filterFormGroup = this.fb.group({
|
|
7353
|
+
num_items: [""]
|
|
7354
|
+
});
|
|
7355
|
+
}
|
|
7356
|
+
TechlifyFeatureListingComponent.prototype.ngOnInit = function () {
|
|
7357
|
+
this.loadData();
|
|
7358
|
+
this.listenForChanges();
|
|
7359
|
+
};
|
|
7360
|
+
TechlifyFeatureListingComponent.prototype.listenForChanges = function () {
|
|
7361
|
+
var _this = this;
|
|
7362
|
+
this.filterFormGroup.valueChanges
|
|
7363
|
+
.pipe(operators.debounceTime(500), untilDestroy.untilDestroyed(this))
|
|
7364
|
+
.subscribe(function (changes) {
|
|
7365
|
+
_this.reload();
|
|
7366
|
+
});
|
|
7367
|
+
};
|
|
7368
|
+
TechlifyFeatureListingComponent.prototype.loadData = function () {
|
|
7369
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7370
|
+
var result, filter, error_1;
|
|
7371
|
+
return __generator(this, function (_a) {
|
|
7372
|
+
switch (_a.label) {
|
|
7373
|
+
case 0:
|
|
7374
|
+
_a.trys.push([0, 2, 3, 4]);
|
|
7375
|
+
this.isWorking = true;
|
|
7376
|
+
filter = this.filterFormGroup.value;
|
|
7377
|
+
filter.page = this.page;
|
|
7378
|
+
filter.perPage = this.perPage;
|
|
7379
|
+
return [4 /*yield*/, this.dataManager.GET("api/features", filter)];
|
|
7380
|
+
case 1:
|
|
7381
|
+
result = _a.sent();
|
|
7382
|
+
this.features = this.features.concat(result.data);
|
|
7383
|
+
this.dataSource = new table.MatTableDataSource(this.features);
|
|
7384
|
+
if (!this.storage.getItem('features')) {
|
|
7385
|
+
this.setStorage(this.features);
|
|
7386
|
+
}
|
|
7387
|
+
this.isWorking = false;
|
|
7388
|
+
return [3 /*break*/, 4];
|
|
7389
|
+
case 2:
|
|
7390
|
+
error_1 = _a.sent();
|
|
7391
|
+
this.errorHandler.handleError(error_1);
|
|
7392
|
+
return [3 /*break*/, 4];
|
|
7393
|
+
case 3:
|
|
7394
|
+
this.isWorking = false;
|
|
7395
|
+
return [7 /*endfinally*/];
|
|
7396
|
+
case 4: return [2 /*return*/];
|
|
7397
|
+
}
|
|
7398
|
+
});
|
|
7399
|
+
});
|
|
7400
|
+
};
|
|
7401
|
+
TechlifyFeatureListingComponent.prototype.toggeleFeature = function (element, feature) {
|
|
7402
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7403
|
+
var status, data, dialogRef;
|
|
7404
|
+
var _this = this;
|
|
7405
|
+
return __generator(this, function (_a) {
|
|
7406
|
+
status = element ? 'Off' : "On";
|
|
7407
|
+
dialogRef = this.dialog.open(ActionPopupComponent, {
|
|
7408
|
+
width: "400px",
|
|
7409
|
+
data: {
|
|
7410
|
+
title: "Turn this feature " + status + "?",
|
|
7411
|
+
message: "Would you like to turn " + feature.title + " feature " + status
|
|
7412
|
+
}
|
|
7413
|
+
});
|
|
7414
|
+
dialogRef.afterClosed().subscribe(function (result) { return __awaiter(_this, void 0, void 0, function () {
|
|
7415
|
+
var _a, error_2;
|
|
7416
|
+
return __generator(this, function (_b) {
|
|
7417
|
+
switch (_b.label) {
|
|
7418
|
+
case 0:
|
|
7419
|
+
if (!result) return [3 /*break*/, 9];
|
|
7420
|
+
_b.label = 1;
|
|
7421
|
+
case 1:
|
|
7422
|
+
_b.trys.push([1, 6, 7, 8]);
|
|
7423
|
+
if (!element) return [3 /*break*/, 3];
|
|
7424
|
+
return [4 /*yield*/, this.featureService.disableFeature(feature.id)];
|
|
7425
|
+
case 2:
|
|
7426
|
+
_a = _b.sent();
|
|
7427
|
+
return [3 /*break*/, 5];
|
|
7428
|
+
case 3: return [4 /*yield*/, this.featureService.enableFeature(feature.id)];
|
|
7429
|
+
case 4:
|
|
7430
|
+
_a = _b.sent();
|
|
7431
|
+
_b.label = 5;
|
|
7432
|
+
case 5:
|
|
7433
|
+
data = _a;
|
|
7434
|
+
return [3 /*break*/, 8];
|
|
7435
|
+
case 6:
|
|
7436
|
+
error_2 = _b.sent();
|
|
7437
|
+
this.errorHandler.handleError(error_2);
|
|
7438
|
+
return [3 /*break*/, 8];
|
|
7439
|
+
case 7:
|
|
7440
|
+
this.alertService.addAlert("You have just turned " + status + " the feature " + feature.title, 'success');
|
|
7441
|
+
this.reload();
|
|
7442
|
+
this.storage.removeItem('features');
|
|
7443
|
+
this.setStorage(this.features);
|
|
7444
|
+
this.isWorking = false;
|
|
7445
|
+
return [7 /*endfinally*/];
|
|
7446
|
+
case 8: return [3 /*break*/, 10];
|
|
7447
|
+
case 9:
|
|
7448
|
+
this.reload();
|
|
7449
|
+
_b.label = 10;
|
|
7450
|
+
case 10: return [2 /*return*/];
|
|
7451
|
+
}
|
|
7452
|
+
});
|
|
7453
|
+
}); });
|
|
7454
|
+
return [2 /*return*/];
|
|
7455
|
+
});
|
|
7456
|
+
});
|
|
7457
|
+
};
|
|
7458
|
+
TechlifyFeatureListingComponent.prototype.setStorage = function (features) {
|
|
7459
|
+
var e_1, _a;
|
|
7460
|
+
var localFeatures = [];
|
|
7461
|
+
try {
|
|
7462
|
+
for (var features_1 = __values(features), features_1_1 = features_1.next(); !features_1_1.done; features_1_1 = features_1.next()) {
|
|
7463
|
+
var feature = features_1_1.value;
|
|
7464
|
+
if (!feature.client_feature) {
|
|
7465
|
+
if (feature.is_enabled_default) {
|
|
7466
|
+
localFeatures.push(feature.code);
|
|
7467
|
+
}
|
|
7468
|
+
}
|
|
7469
|
+
else {
|
|
7470
|
+
if (feature.client_feature.is_enabled) {
|
|
7471
|
+
localFeatures.push(feature.code);
|
|
7472
|
+
}
|
|
7473
|
+
}
|
|
7474
|
+
}
|
|
7475
|
+
}
|
|
7476
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
7477
|
+
finally {
|
|
7478
|
+
try {
|
|
7479
|
+
if (features_1_1 && !features_1_1.done && (_a = features_1.return)) _a.call(features_1);
|
|
7480
|
+
}
|
|
7481
|
+
finally { if (e_1) throw e_1.error; }
|
|
7482
|
+
}
|
|
7483
|
+
this.storage.setItem("features", localFeatures);
|
|
7484
|
+
};
|
|
7485
|
+
TechlifyFeatureListingComponent.prototype.reload = function () {
|
|
7486
|
+
this.features = [];
|
|
7487
|
+
this.page = 1;
|
|
7488
|
+
if (!this.isWorking) {
|
|
7489
|
+
this.loadData();
|
|
7490
|
+
}
|
|
7491
|
+
};
|
|
7492
|
+
TechlifyFeatureListingComponent.prototype.onScroll = function () {
|
|
7493
|
+
if (!this.isWorking && this.page < this.lastPage) {
|
|
7494
|
+
this.page += 1;
|
|
7495
|
+
this.loadData();
|
|
7496
|
+
}
|
|
7497
|
+
};
|
|
7498
|
+
TechlifyFeatureListingComponent.prototype.sortColumn = function (event) {
|
|
7499
|
+
var direction = event.direction.toString().toUpperCase();
|
|
7500
|
+
this.assignFilter(event.active, direction);
|
|
7501
|
+
this.reload();
|
|
7502
|
+
};
|
|
7503
|
+
TechlifyFeatureListingComponent.prototype.assignFilter = function (column, direction) {
|
|
7504
|
+
switch (column) {
|
|
7505
|
+
case 'name': {
|
|
7506
|
+
return this.filterFormGroup
|
|
7507
|
+
.get('sort_by')
|
|
7508
|
+
.setValue('first_name|' + direction);
|
|
7509
|
+
}
|
|
7510
|
+
case 'added_on': {
|
|
7511
|
+
return this.filterFormGroup
|
|
7512
|
+
.get('sort_by')
|
|
7513
|
+
.setValue('created_at|' + direction);
|
|
7514
|
+
}
|
|
7515
|
+
}
|
|
7516
|
+
};
|
|
7517
|
+
return TechlifyFeatureListingComponent;
|
|
7518
|
+
}());
|
|
7519
|
+
exports.TechlifyFeatureListingComponent.decorators = [
|
|
7520
|
+
{ type: i0.Component, args: [{
|
|
7521
|
+
selector: 'app-techlify-listing-feature',
|
|
7522
|
+
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",
|
|
7523
|
+
styles: [""]
|
|
7524
|
+
},] }
|
|
7525
|
+
];
|
|
7526
|
+
exports.TechlifyFeatureListingComponent.ctorParameters = function () { return [
|
|
7527
|
+
{ type: DataManager },
|
|
7528
|
+
{ type: ErrorHandlerService },
|
|
7529
|
+
{ type: forms.FormBuilder },
|
|
7530
|
+
{ type: AlertService },
|
|
7531
|
+
{ type: dialog.MatDialog },
|
|
7532
|
+
{ type: StorageService },
|
|
7533
|
+
{ type: TechlifyFeatureService }
|
|
7534
|
+
]; };
|
|
7535
|
+
exports.TechlifyFeatureListingComponent = __decorate([
|
|
7536
|
+
untilDestroy.UntilDestroy()
|
|
7537
|
+
], exports.TechlifyFeatureListingComponent);
|
|
7538
|
+
|
|
7539
|
+
var routes$n = [
|
|
7540
|
+
{
|
|
7541
|
+
path: '',
|
|
7542
|
+
component: exports.TechlifyFeatureListingComponent,
|
|
7543
|
+
canActivate: [AuthenticationGuard]
|
|
7544
|
+
},
|
|
7545
|
+
];
|
|
7546
|
+
var TechlifyFeatureRoutes = i1$2.RouterModule.forChild(routes$n);
|
|
7547
|
+
|
|
7548
|
+
var OnOffSwitchComponent = /** @class */ (function () {
|
|
7549
|
+
function OnOffSwitchComponent(fb) {
|
|
7550
|
+
this.fb = fb;
|
|
7551
|
+
this.slideToggle = this.fb.group({
|
|
7552
|
+
toggle: [""]
|
|
7553
|
+
});
|
|
7554
|
+
}
|
|
7555
|
+
OnOffSwitchComponent.prototype.ngOnInit = function () {
|
|
7556
|
+
this.slideToggle.get('toggle').setValue(this.value);
|
|
7557
|
+
};
|
|
7558
|
+
return OnOffSwitchComponent;
|
|
7559
|
+
}());
|
|
7560
|
+
OnOffSwitchComponent.decorators = [
|
|
7561
|
+
{ type: i0.Component, args: [{
|
|
7562
|
+
selector: 'app-on-off-switch',
|
|
7563
|
+
template: "<form [formGroup]=\"slideToggle\">\n <mat-slide-toggle formControlName=\"toggle\">On / Off\n </mat-slide-toggle>\n</form>\n",
|
|
7564
|
+
styles: [""]
|
|
7565
|
+
},] }
|
|
7566
|
+
];
|
|
7567
|
+
OnOffSwitchComponent.ctorParameters = function () { return [
|
|
7568
|
+
{ type: forms.FormBuilder }
|
|
7569
|
+
]; };
|
|
7570
|
+
OnOffSwitchComponent.propDecorators = {
|
|
7571
|
+
value: [{ type: i0.Input }]
|
|
7572
|
+
};
|
|
7573
|
+
|
|
7574
|
+
var TechlifyFeatureEnabledDirective = /** @class */ (function () {
|
|
7575
|
+
function TechlifyFeatureEnabledDirective(el, featureService, errorHandler, storage) {
|
|
7576
|
+
this.el = el;
|
|
7577
|
+
this.featureService = featureService;
|
|
7578
|
+
this.errorHandler = errorHandler;
|
|
7579
|
+
this.storage = storage;
|
|
7580
|
+
this.localFeatures = [];
|
|
7581
|
+
}
|
|
7582
|
+
TechlifyFeatureEnabledDirective.prototype.ngOnInit = function () {
|
|
7583
|
+
if (!this.storage.getItem('features')) {
|
|
7584
|
+
this.getFeatures();
|
|
7585
|
+
}
|
|
7586
|
+
else {
|
|
7587
|
+
this.checkForFeatureEnabled();
|
|
7588
|
+
}
|
|
7589
|
+
};
|
|
7590
|
+
TechlifyFeatureEnabledDirective.prototype.getFeatures = function () {
|
|
7591
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7592
|
+
var features, _a, _b, feature, error_1;
|
|
7593
|
+
var e_1, _c;
|
|
7594
|
+
return __generator(this, function (_d) {
|
|
7595
|
+
switch (_d.label) {
|
|
7596
|
+
case 0:
|
|
7597
|
+
_d.trys.push([0, 2, 3, 4]);
|
|
7598
|
+
return [4 /*yield*/, this.featureService.getFeatures()];
|
|
7599
|
+
case 1:
|
|
7600
|
+
features = _d.sent();
|
|
7601
|
+
try {
|
|
7602
|
+
for (_a = __values(features.data), _b = _a.next(); !_b.done; _b = _a.next()) {
|
|
7603
|
+
feature = _b.value;
|
|
7604
|
+
if (!feature.client_feature) {
|
|
7605
|
+
if (feature.is_enabled_default) {
|
|
7606
|
+
this.localFeatures.push(feature.code);
|
|
7607
|
+
}
|
|
7608
|
+
}
|
|
7609
|
+
else {
|
|
7610
|
+
if (feature.client_feature.is_enabled) {
|
|
7611
|
+
this.localFeatures.push(feature.code);
|
|
7612
|
+
}
|
|
7613
|
+
}
|
|
7614
|
+
}
|
|
7615
|
+
}
|
|
7616
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
7617
|
+
finally {
|
|
7618
|
+
try {
|
|
7619
|
+
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
7620
|
+
}
|
|
7621
|
+
finally { if (e_1) throw e_1.error; }
|
|
7622
|
+
}
|
|
7623
|
+
this.storage.setItem("features", this.localFeatures);
|
|
7624
|
+
return [3 /*break*/, 4];
|
|
7625
|
+
case 2:
|
|
7626
|
+
error_1 = _d.sent();
|
|
7627
|
+
this.errorHandler.handleError(error_1);
|
|
7628
|
+
return [3 /*break*/, 4];
|
|
7629
|
+
case 3:
|
|
7630
|
+
this.checkForFeatureEnabled();
|
|
7631
|
+
return [7 /*endfinally*/];
|
|
7632
|
+
case 4: return [2 /*return*/];
|
|
7633
|
+
}
|
|
7634
|
+
});
|
|
7635
|
+
});
|
|
7636
|
+
};
|
|
7637
|
+
TechlifyFeatureEnabledDirective.prototype.checkForFeatureEnabled = function () {
|
|
7638
|
+
try {
|
|
7639
|
+
var features = this.storage.getItem('features');
|
|
7640
|
+
var features_split = features.split(',');
|
|
7641
|
+
if (features_split.includes(this.enabledFeature)) {
|
|
7642
|
+
this.el.nativeElement.style.display = "show";
|
|
7643
|
+
}
|
|
7644
|
+
else {
|
|
7645
|
+
this.el.nativeElement.remove();
|
|
7646
|
+
}
|
|
7647
|
+
}
|
|
7648
|
+
catch (error) {
|
|
7649
|
+
this.errorHandler.handleError(error);
|
|
7650
|
+
}
|
|
7651
|
+
};
|
|
7652
|
+
return TechlifyFeatureEnabledDirective;
|
|
7653
|
+
}());
|
|
7654
|
+
TechlifyFeatureEnabledDirective.decorators = [
|
|
7655
|
+
{ type: i0.Directive, args: [{
|
|
7656
|
+
selector: '[techlifyFeatureEnabled]'
|
|
7657
|
+
},] }
|
|
7658
|
+
];
|
|
7659
|
+
TechlifyFeatureEnabledDirective.ctorParameters = function () { return [
|
|
7660
|
+
{ type: i0.ElementRef },
|
|
7661
|
+
{ type: TechlifyFeatureService },
|
|
7662
|
+
{ type: ErrorHandlerService },
|
|
7663
|
+
{ type: StorageService }
|
|
7664
|
+
]; };
|
|
7665
|
+
TechlifyFeatureEnabledDirective.propDecorators = {
|
|
7666
|
+
enabledFeature: [{ type: i0.Input, args: ['techlifyFeatureEnabled',] }]
|
|
7667
|
+
};
|
|
7668
|
+
|
|
7669
|
+
var TechlifyFeatureModule = /** @class */ (function () {
|
|
7670
|
+
function TechlifyFeatureModule() {
|
|
7671
|
+
}
|
|
7672
|
+
return TechlifyFeatureModule;
|
|
7673
|
+
}());
|
|
7674
|
+
TechlifyFeatureModule.decorators = [
|
|
7675
|
+
{ type: i0.NgModule, args: [{
|
|
7676
|
+
imports: [
|
|
7677
|
+
common.CommonModule,
|
|
7678
|
+
MaterialModule,
|
|
7679
|
+
flexLayout.FlexLayoutModule,
|
|
7680
|
+
TechlifyFeatureRoutes,
|
|
7681
|
+
slideToggle.MatSlideToggleModule,
|
|
7682
|
+
forms.FormsModule,
|
|
7683
|
+
forms.ReactiveFormsModule,
|
|
7684
|
+
ngxInfiniteScroll.InfiniteScrollModule
|
|
7685
|
+
],
|
|
7686
|
+
declarations: [exports.TechlifyFeatureListingComponent, OnOffSwitchComponent, TechlifyFeatureEnabledDirective],
|
|
7687
|
+
exports: [exports.TechlifyFeatureListingComponent, TechlifyFeatureEnabledDirective]
|
|
7688
|
+
},] }
|
|
7689
|
+
];
|
|
7690
|
+
|
|
7164
7691
|
/*
|
|
7165
7692
|
* Public API Surface of ngx-techlify-core
|
|
7166
7693
|
*/
|
|
@@ -7275,6 +7802,9 @@
|
|
|
7275
7802
|
exports.StorageService = StorageService;
|
|
7276
7803
|
exports.SuccessSnackComponent = SuccessSnackComponent;
|
|
7277
7804
|
exports.TechlifyConfig = TechlifyConfig;
|
|
7805
|
+
exports.TechlifyFeatureEnabledDirective = TechlifyFeatureEnabledDirective;
|
|
7806
|
+
exports.TechlifyFeatureModule = TechlifyFeatureModule;
|
|
7807
|
+
exports.TechlifyFeatureRoutes = TechlifyFeatureRoutes;
|
|
7278
7808
|
exports.TechlifyTaggerTagFormConfigModel = TechlifyTaggerTagFormConfigModel;
|
|
7279
7809
|
exports.TechlifyTaggerTagFormFieldModule = TechlifyTaggerTagFormFieldModule;
|
|
7280
7810
|
exports.TechlifyTaggerTagSelectorModule = TechlifyTaggerTagSelectorModule;
|
|
@@ -7307,7 +7837,14 @@
|
|
|
7307
7837
|
exports.ɵbt = UpdateViewModule;
|
|
7308
7838
|
exports.ɵbu = UpdateViewComponent;
|
|
7309
7839
|
exports.ɵbv = DataManager;
|
|
7840
|
+
exports.ɵbw = DataManager;
|
|
7841
|
+
exports.ɵbx = ErrorHandlerService;
|
|
7842
|
+
exports.ɵby = AlertService;
|
|
7843
|
+
exports.ɵbz = StorageService;
|
|
7310
7844
|
exports.ɵc = ErrorSnackComponent;
|
|
7845
|
+
exports.ɵca = TechlifyFeatureService;
|
|
7846
|
+
exports.ɵcb = AuthenticationGuard;
|
|
7847
|
+
exports.ɵcc = OnOffSwitchComponent;
|
|
7311
7848
|
exports.ɵd = HTTP_DYNAMIC_INTERCEPTORS;
|
|
7312
7849
|
exports.ɵe = HttpService;
|
|
7313
7850
|
exports.ɵf = RouteReusableStrategy;
|