ngx-techlify-core 11.3.7 → 11.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/ngx-techlify-core.umd.js +163 -16
- 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/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/timeline-filter/calculate-timeline.js +2 -2
- package/esm2015/lib/timeline-filter/timeline-filter.component.js +146 -16
- package/fesm2015/ngx-techlify-core.js +151 -16
- 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/timeline-filter/calculate-timeline.d.ts +5 -0
- package/lib/timeline-filter/timeline-filter.component.d.ts +47 -6
- package/ngx-techlify-core.metadata.json +1 -1
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ import { __decorate, __awaiter } from 'tslib';
|
|
|
4
4
|
import { MatTableDataSource, MatTableModule } from '@angular/material/table';
|
|
5
5
|
import { MatSort, MatSortModule } from '@angular/material/sort';
|
|
6
6
|
import { untilDestroyed, UntilDestroy } from '@ngneat/until-destroy';
|
|
7
|
-
import { Location, CommonModule } from '@angular/common';
|
|
7
|
+
import { Location, DatePipe, CommonModule } from '@angular/common';
|
|
8
8
|
import { Validators, FormBuilder, FormControl, NgControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
9
9
|
import { HttpResponse, HttpClient, HttpHandler, HttpClientModule } from '@angular/common/http';
|
|
10
10
|
import { throwError, Observable, Subject, of, from, fromEvent } from 'rxjs';
|
|
@@ -2290,7 +2290,7 @@ function calculateTimeline(value) {
|
|
|
2290
2290
|
}
|
|
2291
2291
|
case 4: { // This Week
|
|
2292
2292
|
var first = date.getDate() - date.getDay() + 1; // First day is the day of the month - the day of the week
|
|
2293
|
-
var last = first + 6; // last day is the first day + 6
|
|
2293
|
+
var last = first + 6; // last day is the first day + 6
|
|
2294
2294
|
data.date_from = new Date(date.setDate(first));
|
|
2295
2295
|
data.date_to = new Date(date.setDate(last));
|
|
2296
2296
|
break;
|
|
@@ -2369,8 +2369,11 @@ Timeline.THIS_YEAR = 10;
|
|
|
2369
2369
|
Timeline.LAST_YEAR = 11;
|
|
2370
2370
|
Timeline.ALL = 12;
|
|
2371
2371
|
|
|
2372
|
-
|
|
2373
|
-
|
|
2372
|
+
var TimelineFilterComponent_1;
|
|
2373
|
+
let TimelineFilterComponent = TimelineFilterComponent_1 = class TimelineFilterComponent {
|
|
2374
|
+
constructor(formBuilder, ngControl, datePipe) {
|
|
2375
|
+
this.ngControl = ngControl;
|
|
2376
|
+
this.datePipe = datePipe;
|
|
2374
2377
|
this.timelineValue = new FormControl('');
|
|
2375
2378
|
this.timelines = [
|
|
2376
2379
|
{ value: 1, viewValue: 'Custom' },
|
|
@@ -2386,20 +2389,73 @@ let TimelineFilterComponent = class TimelineFilterComponent {
|
|
|
2386
2389
|
{ value: 11, viewValue: 'Last Year' },
|
|
2387
2390
|
{ value: 12, viewValue: 'All dates' },
|
|
2388
2391
|
];
|
|
2389
|
-
this.labelText = 'Select Timeline';
|
|
2390
2392
|
this.dateFrom = 'date_from';
|
|
2391
2393
|
this.dateTo = 'date_to';
|
|
2392
2394
|
this.appearance = "legacy";
|
|
2393
2395
|
this.showClearbutton = false;
|
|
2396
|
+
/**
|
|
2397
|
+
* @deprecated The form input is deprated
|
|
2398
|
+
*/
|
|
2399
|
+
this.form = null;
|
|
2400
|
+
this.labelText = 'Select Timeline';
|
|
2401
|
+
this.touchUi = true;
|
|
2402
|
+
this.selectedValueChange = new EventEmitter();
|
|
2403
|
+
this.selectionChange = new EventEmitter();
|
|
2404
|
+
this.onChange = () => { };
|
|
2405
|
+
this.onTouched = () => { };
|
|
2406
|
+
this.stateChanges = new Subject();
|
|
2407
|
+
this.controlType = 'timeline-filter';
|
|
2408
|
+
this.id = `timeline-filter-${TimelineFilterComponent_1.nextId++}`;
|
|
2409
|
+
this.describedBy = '';
|
|
2394
2410
|
this.showCustomDateFields = false;
|
|
2411
|
+
this._required = false;
|
|
2412
|
+
this._disabled = false;
|
|
2413
|
+
this.selectorForm = formBuilder.group({
|
|
2414
|
+
select_value: [null],
|
|
2415
|
+
});
|
|
2416
|
+
if (this.ngControl != null) {
|
|
2417
|
+
this.ngControl.valueAccessor = this;
|
|
2418
|
+
}
|
|
2395
2419
|
}
|
|
2396
2420
|
set defaultValue(value) {
|
|
2397
2421
|
this.timelineValue.setValue(value);
|
|
2398
2422
|
this.changeTimeline(value);
|
|
2399
2423
|
}
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2424
|
+
get required() { return this._required; }
|
|
2425
|
+
set required(value) {
|
|
2426
|
+
this.selectorForm.get('select_value').setValidators(Validators.required);
|
|
2427
|
+
this._required = coerceBooleanProperty(value);
|
|
2428
|
+
this.stateChanges.next();
|
|
2429
|
+
}
|
|
2430
|
+
get disabled() { return this._disabled; }
|
|
2431
|
+
set disabled(value) {
|
|
2432
|
+
this._disabled = coerceBooleanProperty(value);
|
|
2433
|
+
this._disabled ? this.selectorForm.disable() : this.selectorForm.enable();
|
|
2434
|
+
this.stateChanges.next();
|
|
2435
|
+
}
|
|
2436
|
+
get value() {
|
|
2437
|
+
if (this.selectorForm.valid) {
|
|
2438
|
+
return this.selectorForm.value.select_value;
|
|
2439
|
+
}
|
|
2440
|
+
return '';
|
|
2441
|
+
}
|
|
2442
|
+
set value(data) {
|
|
2443
|
+
this.selectorForm.patchValue({ select_value: data || '' });
|
|
2444
|
+
this._handleInput();
|
|
2445
|
+
this.stateChanges.next();
|
|
2446
|
+
}
|
|
2447
|
+
getDateRangeString() {
|
|
2448
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
2449
|
+
let str = "";
|
|
2450
|
+
if ((_a = this.selectedRange) === null || _a === void 0 ? void 0 : _a.show_custom_field) {
|
|
2451
|
+
if (((_b = this.selectedRange) === null || _b === void 0 ? void 0 : _b.date_from.toUTCString()) != 'Invalid Date') {
|
|
2452
|
+
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());
|
|
2453
|
+
}
|
|
2454
|
+
if (((_e = this.selectedRange) === null || _e === void 0 ? void 0 : _e.date_to.toUTCString()) != 'Invalid Date') {
|
|
2455
|
+
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());
|
|
2456
|
+
}
|
|
2457
|
+
}
|
|
2458
|
+
return str;
|
|
2403
2459
|
}
|
|
2404
2460
|
resetFieldValue(field) {
|
|
2405
2461
|
this.form.get(field).setValue('');
|
|
@@ -2418,27 +2474,97 @@ let TimelineFilterComponent = class TimelineFilterComponent {
|
|
|
2418
2474
|
this.showCustomDateFields = timeline.show_custom_field;
|
|
2419
2475
|
}
|
|
2420
2476
|
}
|
|
2477
|
+
_handleInput() {
|
|
2478
|
+
if (this.value == 1) {
|
|
2479
|
+
this.picker.open();
|
|
2480
|
+
return;
|
|
2481
|
+
}
|
|
2482
|
+
const range = calculateTimeline(this.value);
|
|
2483
|
+
this.selectedRange = range;
|
|
2484
|
+
this.onChange(this.value);
|
|
2485
|
+
this.selectedValueChange.emit(this.selectedValue);
|
|
2486
|
+
this.selectionChange.emit(range);
|
|
2487
|
+
}
|
|
2488
|
+
dateRangeChange(dateRangeStart, dateRangeEnd) {
|
|
2489
|
+
const range = {
|
|
2490
|
+
date_from: new Date(dateRangeStart.value),
|
|
2491
|
+
date_to: new Date(dateRangeEnd.value),
|
|
2492
|
+
show_custom_field: true
|
|
2493
|
+
};
|
|
2494
|
+
this.selectedRange = range;
|
|
2495
|
+
this.onChange(this.value);
|
|
2496
|
+
this.selectedValueChange.emit(this.selectedValue);
|
|
2497
|
+
this.selectionChange.emit(range);
|
|
2498
|
+
}
|
|
2499
|
+
onCustomDateChange(event) {
|
|
2500
|
+
console.log(event);
|
|
2501
|
+
}
|
|
2502
|
+
setDescribedByIds(ids) {
|
|
2503
|
+
this.describedBy = ids.join(' ');
|
|
2504
|
+
}
|
|
2505
|
+
onContainerClick(event) {
|
|
2506
|
+
event.stopPropagation();
|
|
2507
|
+
}
|
|
2508
|
+
writeValue(data) {
|
|
2509
|
+
this.value = data;
|
|
2510
|
+
}
|
|
2511
|
+
registerOnChange(fn) {
|
|
2512
|
+
this.onChange = fn;
|
|
2513
|
+
}
|
|
2514
|
+
registerOnTouched(fn) {
|
|
2515
|
+
this.onTouched = fn;
|
|
2516
|
+
}
|
|
2517
|
+
setDisabledState(isDisabled) {
|
|
2518
|
+
this.disabled = isDisabled;
|
|
2519
|
+
}
|
|
2520
|
+
ngOnInit() {
|
|
2521
|
+
console.log(this.form);
|
|
2522
|
+
this.timelineValue.valueChanges.
|
|
2523
|
+
pipe(debounceTime(100), distinctUntilChanged(), untilDestroyed(this)).subscribe(value => this.changeTimeline(value));
|
|
2524
|
+
}
|
|
2525
|
+
ngOnDestroy() {
|
|
2526
|
+
this.stateChanges.complete();
|
|
2527
|
+
}
|
|
2421
2528
|
};
|
|
2529
|
+
TimelineFilterComponent.nextId = 0;
|
|
2422
2530
|
TimelineFilterComponent.decorators = [
|
|
2423
2531
|
{ type: Component, args: [{
|
|
2424
2532
|
selector: 'app-timeline-filter',
|
|
2425
|
-
template: "<ng-container [formGroup]=\"form\">\n
|
|
2533
|
+
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",
|
|
2534
|
+
providers: [
|
|
2535
|
+
{
|
|
2536
|
+
provide: MatFormFieldControl,
|
|
2537
|
+
useExisting: TimelineFilterComponent_1
|
|
2538
|
+
}
|
|
2539
|
+
],
|
|
2426
2540
|
styles: [""]
|
|
2427
2541
|
},] }
|
|
2428
2542
|
];
|
|
2429
|
-
TimelineFilterComponent.ctorParameters = () => [
|
|
2543
|
+
TimelineFilterComponent.ctorParameters = () => [
|
|
2544
|
+
{ type: FormBuilder },
|
|
2545
|
+
{ type: NgControl, decorators: [{ type: Optional }, { type: Self }] },
|
|
2546
|
+
{ type: DatePipe }
|
|
2547
|
+
];
|
|
2430
2548
|
TimelineFilterComponent.propDecorators = {
|
|
2549
|
+
picker: [{ type: ViewChild, args: ['picker',] }],
|
|
2431
2550
|
timelineValue: [{ type: Input }],
|
|
2432
2551
|
timelines: [{ type: Input }],
|
|
2433
|
-
labelText: [{ type: Input }],
|
|
2434
2552
|
dateFrom: [{ type: Input }],
|
|
2435
2553
|
dateTo: [{ type: Input }],
|
|
2436
2554
|
appearance: [{ type: Input }],
|
|
2437
2555
|
showClearbutton: [{ type: Input }],
|
|
2438
2556
|
form: [{ type: Input }],
|
|
2439
|
-
|
|
2557
|
+
labelText: [{ type: Input }],
|
|
2558
|
+
selectedValue: [{ type: Input }],
|
|
2559
|
+
touchUi: [{ type: Input }],
|
|
2560
|
+
selectedValueChange: [{ type: Output }],
|
|
2561
|
+
selectionChange: [{ type: Output }],
|
|
2562
|
+
defaultValue: [{ type: Input }],
|
|
2563
|
+
required: [{ type: Input }],
|
|
2564
|
+
disabled: [{ type: Input }],
|
|
2565
|
+
value: [{ type: Input }]
|
|
2440
2566
|
};
|
|
2441
|
-
TimelineFilterComponent = __decorate([
|
|
2567
|
+
TimelineFilterComponent = TimelineFilterComponent_1 = __decorate([
|
|
2442
2568
|
UntilDestroy()
|
|
2443
2569
|
], TimelineFilterComponent);
|
|
2444
2570
|
|
|
@@ -3442,7 +3568,7 @@ let EmailSubscriptionUserListFilterComponent = class EmailSubscriptionUserListFi
|
|
|
3442
3568
|
EmailSubscriptionUserListFilterComponent.decorators = [
|
|
3443
3569
|
{ type: Component, args: [{
|
|
3444
3570
|
selector: 'app-email-subscription-user-list-filter',
|
|
3445
|
-
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('
|
|
3571
|
+
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>",
|
|
3446
3572
|
styles: [""]
|
|
3447
3573
|
},] }
|
|
3448
3574
|
];
|
|
@@ -3762,7 +3888,7 @@ let EmailSubscriptionTypeListComponent = class EmailSubscriptionTypeListComponen
|
|
|
3762
3888
|
EmailSubscriptionTypeListComponent.decorators = [
|
|
3763
3889
|
{ type: Component, args: [{
|
|
3764
3890
|
selector: 'app-email-subscription-type-list',
|
|
3765
|
-
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>
|
|
3891
|
+
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>",
|
|
3766
3892
|
styles: [".scroll-container{max-height:800px;overflow-y:auto}"]
|
|
3767
3893
|
},] }
|
|
3768
3894
|
];
|
|
@@ -5605,6 +5731,7 @@ let LoginHistoryForUserComponent = class LoginHistoryForUserComponent {
|
|
|
5605
5731
|
};
|
|
5606
5732
|
this.displayedColumns = ['index', 'created_at'];
|
|
5607
5733
|
this.historyFilterForm = this.fb.group({
|
|
5734
|
+
'duration': [''],
|
|
5608
5735
|
'date_from': [''],
|
|
5609
5736
|
'date_to': ['']
|
|
5610
5737
|
});
|
|
@@ -5620,6 +5747,14 @@ let LoginHistoryForUserComponent = class LoginHistoryForUserComponent {
|
|
|
5620
5747
|
});
|
|
5621
5748
|
this.initializeData();
|
|
5622
5749
|
}
|
|
5750
|
+
onTimelineChange(range) {
|
|
5751
|
+
let date_from = (range === null || range === void 0 ? void 0 : range.date_from) ? new Date(range.date_from) : '';
|
|
5752
|
+
let date_to = (range === null || range === void 0 ? void 0 : range.date_to) ? new Date(range.date_to) : '';
|
|
5753
|
+
this.historyFilterForm.patchValue({
|
|
5754
|
+
date_from,
|
|
5755
|
+
date_to
|
|
5756
|
+
});
|
|
5757
|
+
}
|
|
5623
5758
|
initializeData() {
|
|
5624
5759
|
this.http.get(`api/user-login-history`, { params: Object.assign(Object.assign({}, this.filters), this.pageEvent) })
|
|
5625
5760
|
.pipe(untilDestroyed(this))
|
|
@@ -5651,7 +5786,7 @@ let LoginHistoryForUserComponent = class LoginHistoryForUserComponent {
|
|
|
5651
5786
|
LoginHistoryForUserComponent.decorators = [
|
|
5652
5787
|
{ type: Component, args: [{
|
|
5653
5788
|
selector: 'app-login-history-for-user',
|
|
5654
|
-
template: "<div class=\"mat-typography m-4\">\n <form fxLayoutAlign=\" start center\">\n <app-timeline-filter
|
|
5789
|
+
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",
|
|
5655
5790
|
styles: [".scroll-container{max-height:800px;overflow-y:auto}"]
|
|
5656
5791
|
},] }
|
|
5657
5792
|
];
|