ngx-techlify-core 11.4.3 → 11.4.5-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/ngx-techlify-core.umd.js +209 -113
- 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/core/error-handler.service.js +13 -4
- package/esm2015/lib/core/techlify-config.model.js +3 -1
- package/esm2015/lib/entity-files/entity-file-form/entity-file-form.component.js +6 -9
- package/esm2015/lib/entity-files/entity-file.service.js +6 -2
- package/esm2015/lib/entity-files/entity-files-view-all.component.js +47 -4
- package/esm2015/lib/import-csv/import-csv.component.js +3 -2
- package/esm2015/lib/import-csv/import-history-list/import-history-list.component.js +3 -2
- package/esm2015/lib/material.module.js +4 -2
- package/esm2015/lib/techlify-feature/techlify-feature.routing.js +2 -2
- package/esm2015/lib/techlify-feature/techlify-feature.service.js +2 -2
- package/esm2015/lib/timeline-filter/calculate-timeline.js +62 -50
- package/esm2015/lib/timeline-filter/timeline-filter.component.js +17 -13
- package/esm2015/lib/timeline-filter/timeline.model.js +4 -1
- package/esm2015/ngx-techlify-core.js +10 -11
- package/fesm2015/ngx-techlify-core.js +165 -94
- package/fesm2015/ngx-techlify-core.js.map +1 -1
- package/lib/core/error-handler.service.d.ts +3 -1
- package/lib/core/techlify-config.model.d.ts +1 -0
- package/lib/entity-files/entity-file.service.d.ts +1 -1
- package/lib/entity-files/entity-files-view-all.component.d.ts +6 -0
- package/lib/import-csv/import-csv.component.d.ts +2 -1
- package/lib/import-csv/import-history-list/import-history-list.component.d.ts +2 -1
- package/lib/techlify-feature/techlify-feature.service.d.ts +1 -1
- package/lib/timeline-filter/timeline.model.d.ts +3 -0
- package/ngx-techlify-core.d.ts +9 -10
- package/ngx-techlify-core.metadata.json +1 -1
- package/package.json +3 -2
|
@@ -14,6 +14,7 @@ import { FocusMonitor } from '@angular/cdk/a11y';
|
|
|
14
14
|
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
15
15
|
import { MatFormFieldControl, MatFormFieldModule, MatFormField, MAT_FORM_FIELD } from '@angular/material/form-field';
|
|
16
16
|
import { SELECT_ITEM_HEIGHT_EM, MatSelect, MatSelectModule } from '@angular/material/select';
|
|
17
|
+
import * as moment_ from 'moment';
|
|
17
18
|
import { MatIconModule } from '@angular/material/icon';
|
|
18
19
|
import { Router, RouteReuseStrategy, RouterModule, NavigationEnd, ActivatedRoute } from '@angular/router';
|
|
19
20
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
@@ -28,6 +29,7 @@ import { MatDividerModule } from '@angular/material/divider';
|
|
|
28
29
|
import { MatChipsModule } from '@angular/material/chips';
|
|
29
30
|
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
30
31
|
import { MatListModule } from '@angular/material/list';
|
|
32
|
+
import { MatButtonToggleModule } from '@angular/material/button-toggle';
|
|
31
33
|
import { FlexLayoutModule } from '@angular/flex-layout';
|
|
32
34
|
import { InfiniteScrollModule } from 'ngx-infinite-scroll';
|
|
33
35
|
import { NgxDocViewerModule } from 'ngx-doc-viewer';
|
|
@@ -37,7 +39,6 @@ import { DomSanitizer } from '@angular/platform-browser';
|
|
|
37
39
|
import { diff, formatters } from 'jsondiffpatch';
|
|
38
40
|
import { ENTER, COMMA } from '@angular/cdk/keycodes';
|
|
39
41
|
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
40
|
-
import { MatButtonToggleModule } from '@angular/material/button-toggle';
|
|
41
42
|
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
|
|
42
43
|
|
|
43
44
|
class ActionPopup {
|
|
@@ -440,6 +441,7 @@ class TechlifyConfig {
|
|
|
440
441
|
this.authClientSecret = '';
|
|
441
442
|
this.authGrantType = '';
|
|
442
443
|
this.apiUrl = '';
|
|
444
|
+
this.isLogoutWhileApiGetsFailed = false;
|
|
443
445
|
this.loadFromMap(data);
|
|
444
446
|
}
|
|
445
447
|
loadFromMap(data) {
|
|
@@ -450,6 +452,7 @@ class TechlifyConfig {
|
|
|
450
452
|
this.apiUrl = data.apiUrl;
|
|
451
453
|
this.storage = data === null || data === void 0 ? void 0 : data.storage;
|
|
452
454
|
this.rawConfigs = data;
|
|
455
|
+
this.isLogoutWhileApiGetsFailed = data === null || data === void 0 ? void 0 : data.isLogoutWhileApiGetsFailed;
|
|
453
456
|
}
|
|
454
457
|
}
|
|
455
458
|
|
|
@@ -569,8 +572,9 @@ AlertService.ctorParameters = () => [
|
|
|
569
572
|
* @since 20171202
|
|
570
573
|
*/
|
|
571
574
|
class ErrorHandlerService {
|
|
572
|
-
constructor(alerter) {
|
|
575
|
+
constructor(alerter, config) {
|
|
573
576
|
this.alerter = alerter;
|
|
577
|
+
this.config = config;
|
|
574
578
|
}
|
|
575
579
|
handleError(errorResponse, msg = '') {
|
|
576
580
|
var _a, _b, _c, _d;
|
|
@@ -597,16 +601,22 @@ class ErrorHandlerService {
|
|
|
597
601
|
}
|
|
598
602
|
var errMessage = errors.length ? errors[0] : msg;
|
|
599
603
|
this.alerter.addAlert("Error: " + errMessage, "warning");
|
|
604
|
+
if (errorResponse.status == 403 && this.config.isLogoutWhileApiGetsFailed) {
|
|
605
|
+
sessionStorage.clear();
|
|
606
|
+
localStorage.clear();
|
|
607
|
+
location.reload();
|
|
608
|
+
}
|
|
600
609
|
}
|
|
601
610
|
}
|
|
602
|
-
ErrorHandlerService.ɵprov = ɵɵdefineInjectable({ factory: function ErrorHandlerService_Factory() { return new ErrorHandlerService(ɵɵinject(AlertService)); }, token: ErrorHandlerService, providedIn: "root" });
|
|
611
|
+
ErrorHandlerService.ɵprov = ɵɵdefineInjectable({ factory: function ErrorHandlerService_Factory() { return new ErrorHandlerService(ɵɵinject(AlertService), ɵɵinject(TechlifyConfig)); }, token: ErrorHandlerService, providedIn: "root" });
|
|
603
612
|
ErrorHandlerService.decorators = [
|
|
604
613
|
{ type: Injectable, args: [{
|
|
605
614
|
providedIn: 'root'
|
|
606
615
|
},] }
|
|
607
616
|
];
|
|
608
617
|
ErrorHandlerService.ctorParameters = () => [
|
|
609
|
-
{ type: AlertService }
|
|
618
|
+
{ type: AlertService },
|
|
619
|
+
{ type: TechlifyConfig }
|
|
610
620
|
];
|
|
611
621
|
|
|
612
622
|
const log = new Logger('ErrorHandlerInterceptor');
|
|
@@ -1051,9 +1061,13 @@ class EntityFileService {
|
|
|
1051
1061
|
deleteEntityFile(model) {
|
|
1052
1062
|
return this.http.delete(`api/entity-files/${model.id}`).toPromise();
|
|
1053
1063
|
}
|
|
1054
|
-
uploadEntityFile(file) {
|
|
1064
|
+
uploadEntityFile(file, params) {
|
|
1055
1065
|
const formData = new FormData();
|
|
1056
1066
|
formData.append("fileData", file, file.name);
|
|
1067
|
+
if (params === null || params === void 0 ? void 0 : params.entity_id) {
|
|
1068
|
+
formData.append('entity_id', params.entity_id);
|
|
1069
|
+
formData.append('entity_type', params.entity_type);
|
|
1070
|
+
}
|
|
1057
1071
|
return this.http
|
|
1058
1072
|
.skipHeader()
|
|
1059
1073
|
.post("api/entity-files-upload", formData).toPromise();
|
|
@@ -1116,7 +1130,8 @@ class EntityFileFormComponent {
|
|
|
1116
1130
|
entity_type: [''],
|
|
1117
1131
|
entity_id: [],
|
|
1118
1132
|
file: ['', Validators.required],
|
|
1119
|
-
url: ['', Validators.required]
|
|
1133
|
+
url: ['', Validators.required],
|
|
1134
|
+
file_size: ['', Validators.required],
|
|
1120
1135
|
});
|
|
1121
1136
|
}
|
|
1122
1137
|
ngOnInit() {
|
|
@@ -1174,12 +1189,8 @@ class EntityFileFormComponent {
|
|
|
1174
1189
|
this.fileList = event;
|
|
1175
1190
|
if (this.fileList.length > 0) {
|
|
1176
1191
|
const result = yield this.entityFileService.uploadEntityFile(this.fileList[0]);
|
|
1177
|
-
this.entityFileGroup
|
|
1178
|
-
|
|
1179
|
-
.setValue(result.item.file);
|
|
1180
|
-
this.entityFileGroup
|
|
1181
|
-
.get("url")
|
|
1182
|
-
.setValue(result.item.url);
|
|
1192
|
+
this.entityFileGroup.patchValue(result.item);
|
|
1193
|
+
;
|
|
1183
1194
|
this.fileList = [];
|
|
1184
1195
|
}
|
|
1185
1196
|
});
|
|
@@ -1211,7 +1222,7 @@ class EntityFileFormComponent {
|
|
|
1211
1222
|
EntityFileFormComponent.decorators = [
|
|
1212
1223
|
{ type: Component, args: [{
|
|
1213
1224
|
selector: 'entity-file-form',
|
|
1214
|
-
template: "<form [formGroup]=\"entityFileGroup\" (ngSubmit)=\"submit()\">\n
|
|
1225
|
+
template: "<form [formGroup]=\"entityFileGroup\" (ngSubmit)=\"submit()\">\n <div fxLayout=\"column\" class=\"mat-typography\">\n <div mat-dialog-title class=\"text-center\">\n <div>Entity File</div>\n </div>\n <div mat-dialog-content fxLayout=\"column\" fxLayoutAlign.=\"start\">\n <ng-container *ngIf=\"!hideTitleAndDetails\">\n <mat-form-field>\n <input type=\"text\" matInput formControlName=\"title\" placeholder=\"Title\" autocomplete=\"off\">\n </mat-form-field>\n <mat-form-field>\n <textarea matInput formControlName=\"details\" placeholder=\"Details\" autocomplete=\"off\"></textarea>\n </mat-form-field>\n </ng-container>\n <ng-template #fileUpload>\n <section fxFlex=\"100%\">\n <div>Entity File*</div>\n <app-file-dropper [config]=\"fileConfig\" (fileChanged)=\"fileChanged($event)\" [fileArray]=\"fileList\">\n </app-file-dropper>\n <div class=\"text-danger\" *ngIf=\"isFieldValid('url')\">\n {{getErrorMessage(\"url\")}}\n </div>\n </section>\n </ng-template>\n <div fxFlex=\"100%\" class=\"mt-2\" *ngIf=\"entityFileGroup.get('url').value;else fileUpload;\">\n <app-document-viewer [file]=\"entityFileGroup.get('file').value\" [fileUrl]=\"entityFileGroup.get('url').value\"\n [config]=\"this.viewerConfig\" (remove)=\"removeFile()\" [disableEdit]=\"updateMode\">\n </app-document-viewer>\n </div>\n <div class=\"mt-4 mb-2\" fxLayout=\"row\" fxLayoutGap=\"30px\" fxLayoutAlign=\"end\" fxFlex=\"100%\">\n <button mat-raised-button type=\"button\" (click)=\"dialogRef.close()\">\n Cancel\n </button>\n <button mat-raised-button type=\"submit\" color=\"primary\">Save</button>\n </div>\n </div>\n </div>\n</form>\n",
|
|
1215
1226
|
styles: [""]
|
|
1216
1227
|
},] }
|
|
1217
1228
|
];
|
|
@@ -1231,16 +1242,36 @@ let EntityFilesViewAllComponent = class EntityFilesViewAllComponent {
|
|
|
1231
1242
|
this.alertService = alertService;
|
|
1232
1243
|
this.dialog = dialog;
|
|
1233
1244
|
this.viewOnly = false;
|
|
1245
|
+
this.title = "File";
|
|
1234
1246
|
this.filters = {};
|
|
1235
1247
|
this.entityFiles = [];
|
|
1236
|
-
this.displayedColumns = [
|
|
1248
|
+
this.displayedColumns = [
|
|
1249
|
+
'index',
|
|
1250
|
+
'title',
|
|
1251
|
+
'details',
|
|
1252
|
+
'file_size',
|
|
1253
|
+
'uploaded_on',
|
|
1254
|
+
];
|
|
1237
1255
|
this.isWorking = false;
|
|
1238
1256
|
this.search = new FormControl('');
|
|
1239
1257
|
this.page = 1;
|
|
1240
1258
|
this.perPage = 25;
|
|
1241
1259
|
this.lastPage = 0;
|
|
1260
|
+
this.fileList = [];
|
|
1242
1261
|
}
|
|
1243
1262
|
ngOnInit() {
|
|
1263
|
+
//File dropper config
|
|
1264
|
+
this.fileConfig = {
|
|
1265
|
+
fileId: "entityDashboardDropper",
|
|
1266
|
+
containerId: "entityDashboardDropperContainer",
|
|
1267
|
+
styles: {
|
|
1268
|
+
height: "500px"
|
|
1269
|
+
},
|
|
1270
|
+
multiple: false,
|
|
1271
|
+
acceptFile: "*",
|
|
1272
|
+
maxSize: 10,
|
|
1273
|
+
acceptFileText: "All Files"
|
|
1274
|
+
};
|
|
1244
1275
|
this.viewerConfig = {
|
|
1245
1276
|
imageStyle: {
|
|
1246
1277
|
height: '200px',
|
|
@@ -1272,6 +1303,7 @@ let EntityFilesViewAllComponent = class EntityFilesViewAllComponent {
|
|
|
1272
1303
|
fetchEntityFilesDetails() {
|
|
1273
1304
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1274
1305
|
this.filters.page = this.page;
|
|
1306
|
+
this.filters.perPage = this.perPage;
|
|
1275
1307
|
this.isWorking = true;
|
|
1276
1308
|
const result = yield this.entityFileService.getEntityFiles(this.filters);
|
|
1277
1309
|
this.lastPage = result.last_page || this.page;
|
|
@@ -1347,11 +1379,32 @@ let EntityFilesViewAllComponent = class EntityFilesViewAllComponent {
|
|
|
1347
1379
|
resetFieldValue() {
|
|
1348
1380
|
this.search.setValue("");
|
|
1349
1381
|
}
|
|
1382
|
+
sizeOf(bytes) {
|
|
1383
|
+
if (!bytes) {
|
|
1384
|
+
return "0.00 B";
|
|
1385
|
+
}
|
|
1386
|
+
var e = Math.floor(Math.log(bytes) / Math.log(1024));
|
|
1387
|
+
return (bytes / Math.pow(1024, e)).toFixed(2) + ' ' + ' KMGTP'.charAt(e) + 'B';
|
|
1388
|
+
}
|
|
1389
|
+
fileChanged(event) {
|
|
1390
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1391
|
+
this.fileList = event;
|
|
1392
|
+
if (this.fileList.length > 0) {
|
|
1393
|
+
const result = yield this.entityFileService.uploadEntityFile(this.fileList[0], {
|
|
1394
|
+
entity_type: this.entityType,
|
|
1395
|
+
entity_id: this.entityId,
|
|
1396
|
+
});
|
|
1397
|
+
this.fileList = [];
|
|
1398
|
+
this.alertService.addAlert('Successfull uploaded', 'success');
|
|
1399
|
+
this.reload();
|
|
1400
|
+
}
|
|
1401
|
+
});
|
|
1402
|
+
}
|
|
1350
1403
|
};
|
|
1351
1404
|
EntityFilesViewAllComponent.decorators = [
|
|
1352
1405
|
{ type: Component, args: [{
|
|
1353
1406
|
selector: 'app-entity-files-view-all',
|
|
1354
|
-
template: "<div
|
|
1407
|
+
template: "<div class=\"mat-typography\" *ngIf=\"!displayMode\">\n <div fxLayout=\"row\" fxLayoutGap=\"1rem\">\n <mat-card fxFlex=\"70%\">\n <mat-card-title fxLayout fxLayoutGap=\"1rem\">\n <h3 class=\"font-weight-bold primary-color\" fxLayout=\"center center\">\n <mat-icon>\n <span class=\"material-icons\">\n description\n </span>\n </mat-icon>\n {{title}}s\n </h3>\n <div>\n <button type=\"button\" class=\"mx-1\" mat-raised-button color=\"primary\" (click)=\"addEntityFile()\"\n *ngIf=\"!viewOnly\">\n <mat-icon>\n <span class=\"material-icons\">\n add_circle_outline\n </span>\n </mat-icon>\n {{title}}\n </button>\n </div>\n <mat-form-field *ngIf=\"!removeSearch\" appearance=\"outline\" style=\"font-size: 10px;\">\n <mat-label>Search</mat-label>\n <input type=\"text\" matInput [formControl]=\"search\" placeholder=\"Search\" name=\"title\" autocomplete=\"off\" />\n <button mat-button *ngIf=\"filters.title\" matSuffix mat-icon-button (click)=\"resetFieldValue()\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n </mat-card-title>\n <mat-card-content class=\"entity-file-card\">\n <table mat-table [dataSource]=\"entityFiles\" class=\"w-100\" matSort multiTemplateDataRows infiniteScroll\n [infiniteScrollDistance]=\"1.5\" [infiniteScrollThrottle]=\"50\" (scrolled)=\"onScroll()\">\n\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\"> {{ i+1 }} </td>\n </ng-container>\n\n <!-- Title Column -->\n <ng-container matColumnDef=\"title\">\n <th mat-header-cell *matHeaderCellDef> Title </th>\n <td mat-cell *matCellDef=\"let element\">\n <div>\n <span>\n {{element.title}}\n </span>\n <span>\n <a href=\"{{element.url}}\" target=\"_blank\" class=\"text-decoration-none text-muted\">\n <button mat-icon-button type=\"button\">\n <mat-icon>download</mat-icon>\n </button>\n </a>\n </span>\n </div>\n </td>\n </ng-container>\n\n <!-- Details Column -->\n <ng-container matColumnDef=\"details\">\n <th mat-header-cell *matHeaderCellDef> Details </th>\n <td mat-cell *matCellDef=\"let element\"> {{element.details}} </td>\n </ng-container>\n\n <!-- File size Column -->\n <ng-container matColumnDef=\"file_size\">\n <th mat-header-cell *matHeaderCellDef> File Size </th>\n <td mat-cell *matCellDef=\"let element\"> {{ sizeOf(element.file_size)}} </td>\n </ng-container>\n\n <!-- Uploaded On Column -->\n <ng-container matColumnDef=\"uploaded_on\">\n <th mat-header-cell *matHeaderCellDef> Uploaded On </th>\n <td mat-cell *matCellDef=\"let element\">\n <div>\n {{element.created_at | date: 'mediumDate'}}\n </div>\n <div class=\"text-muted\">\n By {{element.creator?.name}}\n </div>\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 element\" style=\"min-width:110px\" class=\"text-muted\">\n <button type=\"button\" mat-icon-button (click)=\"editEntityFile(element)\">\n <mat-icon>edit</mat-icon>\n </button>\n <button type=\"button\" mat-icon-button (click)=\"deleteEntityFile(element)\">\n <mat-icon>delete</mat-icon>\n </button>\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 <section fxFlex=\"30%\">\n <app-file-dropper [config]=\"fileConfig\" (fileChanged)=\"fileChanged($event)\" [fileArray]=\"fileList\">\n </app-file-dropper>\n </section>\n </div>\n</div>\n\n<div fxLayout=\"row wrap\" fxLayoutGap=\"1rem\" class=\"mat-typography p-4\" *ngIf=\"displayMode\">\n <div *ngFor=\"let efile of entityFiles\">\n <app-document-viewer [file]=\"efile.file\" [fileUrl]=\"efile.url\" [config]=\"this.viewerConfig\" [disableEdit]=\"true\">\n </app-document-viewer>\n <a href=\"{{efile.url}}\" target=\"_blank\">\n <button mat-button type=\"button\">View</button>\n </a>\n </div>\n</div>\n",
|
|
1355
1408
|
styles: [""]
|
|
1356
1409
|
},] }
|
|
1357
1410
|
];
|
|
@@ -1367,7 +1420,8 @@ EntityFilesViewAllComponent.propDecorators = {
|
|
|
1367
1420
|
viewOnly: [{ type: Input }],
|
|
1368
1421
|
removeSearch: [{ type: Input }],
|
|
1369
1422
|
hideTitleAndDetails: [{ type: Input }],
|
|
1370
|
-
displayMode: [{ type: Input }]
|
|
1423
|
+
displayMode: [{ type: Input }],
|
|
1424
|
+
title: [{ type: Input }]
|
|
1371
1425
|
};
|
|
1372
1426
|
EntityFilesViewAllComponent = __decorate([
|
|
1373
1427
|
UntilDestroy()
|
|
@@ -2296,6 +2350,25 @@ NumberSelector.propDecorators = {
|
|
|
2296
2350
|
selectedValue: [{ type: Input }]
|
|
2297
2351
|
};
|
|
2298
2352
|
|
|
2353
|
+
class Timeline {
|
|
2354
|
+
}
|
|
2355
|
+
Timeline.CUSTOM = 1;
|
|
2356
|
+
Timeline.TODAY = 2;
|
|
2357
|
+
Timeline.YESTERDAY = 3;
|
|
2358
|
+
Timeline.THIS_WEEK = 4;
|
|
2359
|
+
Timeline.LAST_WEEK = 5;
|
|
2360
|
+
Timeline.THIS_MONTH = 6;
|
|
2361
|
+
Timeline.LAST_MONTH = 7;
|
|
2362
|
+
Timeline.THIS_QUARTER = 8;
|
|
2363
|
+
Timeline.LAST_QUARTER = 9;
|
|
2364
|
+
Timeline.THIS_YEAR = 10;
|
|
2365
|
+
Timeline.LAST_YEAR = 11;
|
|
2366
|
+
Timeline.ALL = 12;
|
|
2367
|
+
Timeline.TOMMOROW = 13;
|
|
2368
|
+
Timeline.NEXT_WEEK = 14;
|
|
2369
|
+
Timeline.NEXT_MONTH = 15;
|
|
2370
|
+
|
|
2371
|
+
const moment = moment_;
|
|
2299
2372
|
function calculateTimeline(value) {
|
|
2300
2373
|
const date = new Date();
|
|
2301
2374
|
const data = {
|
|
@@ -2304,77 +2377,86 @@ function calculateTimeline(value) {
|
|
|
2304
2377
|
'show_custom_field': false
|
|
2305
2378
|
};
|
|
2306
2379
|
switch (value) {
|
|
2307
|
-
case
|
|
2380
|
+
case Timeline.CUSTOM: { //Custom
|
|
2308
2381
|
data.show_custom_field = true;
|
|
2309
2382
|
break;
|
|
2310
2383
|
}
|
|
2311
|
-
case
|
|
2312
|
-
|
|
2313
|
-
data.
|
|
2384
|
+
case Timeline.TODAY: { // Today
|
|
2385
|
+
let now = moment();
|
|
2386
|
+
data.date_from = now.startOf('day').toISOString();
|
|
2387
|
+
data.date_to = now.endOf('day').toISOString();
|
|
2388
|
+
break;
|
|
2389
|
+
}
|
|
2390
|
+
case Timeline.YESTERDAY: { // Yesterday
|
|
2391
|
+
let now = moment().subtract(1, 'day');
|
|
2392
|
+
data.date_from = now.startOf('day').toISOString();
|
|
2393
|
+
data.date_to = now.endOf('day').toISOString();
|
|
2394
|
+
break;
|
|
2395
|
+
}
|
|
2396
|
+
case Timeline.THIS_WEEK: { // This Week
|
|
2397
|
+
let now = moment();
|
|
2398
|
+
data.date_from = now.startOf('isoWeek').toISOString();
|
|
2399
|
+
data.date_to = now.endOf('isoWeek').toISOString();
|
|
2314
2400
|
break;
|
|
2315
2401
|
}
|
|
2316
|
-
case
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
data.
|
|
2320
|
-
data.date_to = yesterday;
|
|
2402
|
+
case Timeline.LAST_WEEK: { // Last Week
|
|
2403
|
+
let now = moment().subtract(1, 'week');
|
|
2404
|
+
data.date_from = now.startOf('isoWeek').toISOString();
|
|
2405
|
+
data.date_to = now.endOf('isoWeek').toISOString();
|
|
2321
2406
|
break;
|
|
2322
2407
|
}
|
|
2323
|
-
case
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
data.
|
|
2327
|
-
data.date_to = new Date(date.setDate(last));
|
|
2408
|
+
case Timeline.THIS_MONTH: { //This Month
|
|
2409
|
+
let now = moment();
|
|
2410
|
+
data.date_from = now.startOf('month').toISOString();
|
|
2411
|
+
data.date_to = now.endOf('month').toISOString();
|
|
2328
2412
|
break;
|
|
2329
2413
|
}
|
|
2330
|
-
case
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
data.date_from = new Date(from);
|
|
2335
|
-
data.date_to = new Date(to);
|
|
2414
|
+
case Timeline.LAST_MONTH: { // Last Month
|
|
2415
|
+
let now = moment().subtract(1, 'month');
|
|
2416
|
+
data.date_from = now.startOf('month').toISOString();
|
|
2417
|
+
data.date_to = now.endOf('month').toISOString();
|
|
2336
2418
|
break;
|
|
2337
2419
|
}
|
|
2338
|
-
case
|
|
2339
|
-
|
|
2340
|
-
data.
|
|
2420
|
+
case Timeline.THIS_QUARTER: { // This Quarter
|
|
2421
|
+
let now = moment();
|
|
2422
|
+
data.date_from = now.startOf('quarter').toISOString();
|
|
2423
|
+
data.date_to = now.endOf('quarter').toISOString();
|
|
2341
2424
|
break;
|
|
2342
2425
|
}
|
|
2343
|
-
case
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
data.date_from = new Date(date.getFullYear(), date.getMonth() - 1, 1);
|
|
2348
|
-
data.date_to = d;
|
|
2426
|
+
case Timeline.LAST_QUARTER: { // Last Quarter
|
|
2427
|
+
let now = moment().subtract(1, 'quarter');
|
|
2428
|
+
data.date_from = now.startOf('quarter').toISOString();
|
|
2429
|
+
data.date_to = now.endOf('quarter').toISOString();
|
|
2349
2430
|
break;
|
|
2350
2431
|
}
|
|
2351
|
-
case
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
data.date_from = startFullQuarter;
|
|
2356
|
-
data.date_to = endFullQuarter;
|
|
2432
|
+
case Timeline.THIS_YEAR: { // This Year
|
|
2433
|
+
let now = moment();
|
|
2434
|
+
data.date_from = now.startOf('year').toISOString();
|
|
2435
|
+
data.date_to = now.endOf('year').toISOString();
|
|
2357
2436
|
break;
|
|
2358
2437
|
}
|
|
2359
|
-
case
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
data.date_from = startFullQuarter;
|
|
2364
|
-
data.date_to = endFullQuarter;
|
|
2438
|
+
case Timeline.LAST_YEAR: { // Last Year
|
|
2439
|
+
let now = moment().subtract(1, 'year');
|
|
2440
|
+
data.date_from = now.startOf('year').toISOString();
|
|
2441
|
+
data.date_to = now.endOf('year').toISOString();
|
|
2365
2442
|
break;
|
|
2366
2443
|
}
|
|
2367
|
-
case
|
|
2368
|
-
|
|
2369
|
-
;
|
|
2370
|
-
data.date_to =
|
|
2444
|
+
case Timeline.TOMMOROW: {
|
|
2445
|
+
let now = moment().add(1, 'day');
|
|
2446
|
+
data.date_from = now.startOf('day').toISOString();
|
|
2447
|
+
data.date_to = now.endOf('day').toISOString();
|
|
2371
2448
|
break;
|
|
2372
2449
|
}
|
|
2373
|
-
case
|
|
2374
|
-
|
|
2375
|
-
;
|
|
2376
|
-
data.date_to =
|
|
2450
|
+
case Timeline.NEXT_WEEK: {
|
|
2451
|
+
let now = moment().add(1, 'week');
|
|
2452
|
+
data.date_from = now.startOf('isoWeek').toISOString();
|
|
2453
|
+
data.date_to = now.endOf('isoWeek').toISOString();
|
|
2377
2454
|
break;
|
|
2455
|
+
}
|
|
2456
|
+
case Timeline.NEXT_MONTH: {
|
|
2457
|
+
let now = moment().add(1, 'month');
|
|
2458
|
+
data.date_from = now.startOf('month').toISOString();
|
|
2459
|
+
data.date_to = now.endOf('month').toISOString();
|
|
2378
2460
|
break;
|
|
2379
2461
|
}
|
|
2380
2462
|
default: { // All
|
|
@@ -2386,21 +2468,6 @@ function calculateTimeline(value) {
|
|
|
2386
2468
|
return data;
|
|
2387
2469
|
}
|
|
2388
2470
|
|
|
2389
|
-
class Timeline {
|
|
2390
|
-
}
|
|
2391
|
-
Timeline.CUSTOM = 1;
|
|
2392
|
-
Timeline.TODAY = 2;
|
|
2393
|
-
Timeline.YESTERDAY = 3;
|
|
2394
|
-
Timeline.THIS_WEEK = 4;
|
|
2395
|
-
Timeline.LAST_WEEK = 5;
|
|
2396
|
-
Timeline.THIS_MONTH = 6;
|
|
2397
|
-
Timeline.LAST_MONTH = 7;
|
|
2398
|
-
Timeline.THIS_QUARTER = 8;
|
|
2399
|
-
Timeline.LAST_QUARTER = 9;
|
|
2400
|
-
Timeline.THIS_YEAR = 10;
|
|
2401
|
-
Timeline.LAST_YEAR = 11;
|
|
2402
|
-
Timeline.ALL = 12;
|
|
2403
|
-
|
|
2404
2471
|
var TimelineFilterComponent_1;
|
|
2405
2472
|
let TimelineFilterComponent = TimelineFilterComponent_1 = class TimelineFilterComponent {
|
|
2406
2473
|
constructor(formBuilder, ngControl, datePipe) {
|
|
@@ -2408,18 +2475,21 @@ let TimelineFilterComponent = TimelineFilterComponent_1 = class TimelineFilterCo
|
|
|
2408
2475
|
this.datePipe = datePipe;
|
|
2409
2476
|
this.timelineValue = new FormControl('');
|
|
2410
2477
|
this.timelines = [
|
|
2411
|
-
{ value:
|
|
2412
|
-
{ value:
|
|
2413
|
-
{ value:
|
|
2414
|
-
{ value:
|
|
2415
|
-
{ value:
|
|
2416
|
-
{ value:
|
|
2417
|
-
{ value:
|
|
2418
|
-
{ value:
|
|
2419
|
-
{ value:
|
|
2420
|
-
{ value:
|
|
2421
|
-
{ value:
|
|
2422
|
-
{ value:
|
|
2478
|
+
{ value: Timeline.CUSTOM, viewValue: 'Custom' },
|
|
2479
|
+
{ value: Timeline.TODAY, viewValue: 'Today' },
|
|
2480
|
+
{ value: Timeline.YESTERDAY, viewValue: 'Yesterday' },
|
|
2481
|
+
{ value: Timeline.TOMMOROW, viewValue: 'Tomorrow' },
|
|
2482
|
+
{ value: Timeline.THIS_WEEK, viewValue: 'This Week' },
|
|
2483
|
+
{ value: Timeline.LAST_WEEK, viewValue: 'Last Week' },
|
|
2484
|
+
{ value: Timeline.NEXT_WEEK, viewValue: 'Next Week' },
|
|
2485
|
+
{ value: Timeline.THIS_MONTH, viewValue: 'This Month' },
|
|
2486
|
+
{ value: Timeline.LAST_MONTH, viewValue: 'Last Month' },
|
|
2487
|
+
{ value: Timeline.NEXT_MONTH, viewValue: 'Next Month' },
|
|
2488
|
+
{ value: Timeline.THIS_QUARTER, viewValue: 'This Quarter' },
|
|
2489
|
+
{ value: Timeline.LAST_QUARTER, viewValue: 'Last Quarter' },
|
|
2490
|
+
{ value: Timeline.THIS_YEAR, viewValue: 'This Year' },
|
|
2491
|
+
{ value: Timeline.LAST_YEAR, viewValue: 'Last Year' },
|
|
2492
|
+
{ value: Timeline.ALL, viewValue: 'All dates' },
|
|
2423
2493
|
];
|
|
2424
2494
|
this.dateFrom = 'date_from';
|
|
2425
2495
|
this.dateTo = 'date_to';
|
|
@@ -2932,7 +3002,8 @@ MaterialModule.decorators = [
|
|
|
2932
3002
|
MatChipsModule,
|
|
2933
3003
|
MatDatepickerModule,
|
|
2934
3004
|
MatListModule,
|
|
2935
|
-
MatTooltipModule
|
|
3005
|
+
MatTooltipModule,
|
|
3006
|
+
MatButtonToggleModule
|
|
2936
3007
|
]
|
|
2937
3008
|
},] }
|
|
2938
3009
|
];
|
|
@@ -6804,5 +6875,5 @@ TechlifyFeatureModule.decorators = [
|
|
|
6804
6875
|
* Generated bundle index. Do not edit.
|
|
6805
6876
|
*/
|
|
6806
6877
|
|
|
6807
|
-
export { ActionPopup, ActionPopupComponent, ActionPopupModule, AlertService, ApiPrefixInterceptor, AuditLogForModelComponent, AuditLogForModelModule, AuditLogForModelRoutingModule, AuditLogListComponent, AuditLogListFilterComponent, AuditLogListFilterModule, AuditLogListFilterRoutingModule, AuditLogListModule, AuditLogListRoutingModule, AuditLogModule, AuditLogRoutingModule, AuditLogViewComponent, AuditLogViewModelComponent, AuditLogViewModelModule, AuditLogViewModelRoutingModule, AuditLogViewModule, AuditLogViewRoutingModule, AuditLogsViewModelComponent, AuditLogsViewModelModule, AuditLogsViewModelRoutingModule, AuthenticationGuard, AuthenticationService, CacheInterceptor, CommentFormComponent, ConfigService, CoreModule, CredentialsService, DataManager, DataTable, DataTableComponent, DataTableModule, DateUtils, DateValidator, DocumentViewerComponent, DocumentViewerModule, EmailSubscriptionForUserComponent, EmailSubscriptionForUserModule, EmailSubscriptionForUserRoutingModule, EmailSubscriptionModule, EmailSubscriptionRoutingModule, EmailSubscriptionTypeFormComponent, EmailSubscriptionTypeFormModule, EmailSubscriptionTypeFormRoutingModule, EmailSubscriptionTypeListComponent, EmailSubscriptionTypeListModule, EmailSubscriptionTypeListRoutingModule, EmailSubscriptionTypeModule, EmailSubscriptionTypeRoutingModule, EmailSubscriptionUserFormComponent, EmailSubscriptionUserFormModule, EmailSubscriptionUserFormRoutingModule, EmailSubscriptionUserListComponent, EmailSubscriptionUserListFilterComponent, EmailSubscriptionUserListFilterModule, EmailSubscriptionUserListFilterRoutingModule, EmailSubscriptionUserListModule, EmailSubscriptionUserListRoutingModule, EmailSubscriptionUserModule, EmailSubscriptionUserRoutingModule, EntityFileFormComponent, EntityFilesViewAllComponent, EntityFilesViewAllModule, ErrorHandlerInterceptor, ErrorHandlerService, ErrorSnackComponent, ExportExcelButtonComponent, ExportExcelModule, FileDropperComponent, FileDropperConfig, FileDropperModule, FormValidatorService, HTTP_DYNAMIC_INTERCEPTORS, HttpCacheService, HttpService, ImportCsvComponent, ImportCsvModule, LoaderComponent, LoaderModule, LogLevel, Logger, LoginHistoryForUserComponent, LoginHistoryForUserModule, LoginHistoryForUserRoutingModule, MatSelectInfiniteScrollDirective, MaterialModule, NoteFormComponent, NoteListComponent, NoteModule, NumItemsSelector, NumberSelector, PageEvent, ReadMoreComponent, ReadMoreModule, RouteReusableStrategy, SearchableSelectorComponent, SearchableSelectorModule, SnackModule, StorageService, SuccessSnackComponent, TechlifyConfig, TechlifyFeatureEnabledDirective, TechlifyFeatureListingComponent, TechlifyFeatureModule, TechlifyFeatureRoutes, TechlifyTaggerTagFormConfigModel, TechlifyTaggerTagFormFieldComponent, TechlifyTaggerTagFormFieldModule, TechlifyTaggerTagSelectorComponent, TechlifyTaggerTagSelectorModule, TechlifyUpdateHistoryModule, TechlifyUpdateModule, Timeline, TimelineFilterComponent, TimelineFilterModule, TokenInterceptor, UpdateNotifierComponent, UpdateNotifierModule, UtilityModule, ViewerConfig, calculateTimeline, esfur, estlr, esulr, SnackModule as ɵa, SuccessSnackComponent as ɵb, NumberSelector as ɵba, TimelineFilterComponent as ɵbb, TimelineFilterRoutingModule as ɵbc, LoaderComponent as ɵbd, EmailSubscriptionUserFormComponent as ɵbe, EmailSubscriptionUserListComponent as ɵbf, AuthenticationGuard as ɵbg, EmailSubscriptionUserListFilterComponent as ɵbh, EmailSubscriptionTypeFormComponent as ɵbi, EmailSubscriptionTypeListComponent as ɵbj, EmailSubscriptionForUserComponent as ɵbk, TechlifyUpdatesListComponent as ɵbl, TechlifyUpdateService as ɵbm, TechlifyUpdateRoutingModule as ɵbn, TechlifyUpdateFormModule as ɵbo, TechlifyUpdateFormComponent as ɵbp, TechlifyUpdateHistoryRoutingModule as ɵbq, TechlifyUpdateHistoryComponent as ɵbr, UpdateNotifierSnackComponent as ɵbs, UpdateViewModule as ɵbt, UpdateViewComponent as ɵbu, DataManager as ɵbv,
|
|
6878
|
+
export { ActionPopup, ActionPopupComponent, ActionPopupModule, AlertService, ApiPrefixInterceptor, AuditLogForModelComponent, AuditLogForModelModule, AuditLogForModelRoutingModule, AuditLogListComponent, AuditLogListFilterComponent, AuditLogListFilterModule, AuditLogListFilterRoutingModule, AuditLogListModule, AuditLogListRoutingModule, AuditLogModule, AuditLogRoutingModule, AuditLogViewComponent, AuditLogViewModelComponent, AuditLogViewModelModule, AuditLogViewModelRoutingModule, AuditLogViewModule, AuditLogViewRoutingModule, AuditLogsViewModelComponent, AuditLogsViewModelModule, AuditLogsViewModelRoutingModule, AuthenticationGuard, AuthenticationService, CacheInterceptor, CommentFormComponent, ConfigService, CoreModule, CredentialsService, DataManager, DataTable, DataTableComponent, DataTableModule, DateUtils, DateValidator, DocumentViewerComponent, DocumentViewerModule, EmailSubscriptionForUserComponent, EmailSubscriptionForUserModule, EmailSubscriptionForUserRoutingModule, EmailSubscriptionModule, EmailSubscriptionRoutingModule, EmailSubscriptionTypeFormComponent, EmailSubscriptionTypeFormModule, EmailSubscriptionTypeFormRoutingModule, EmailSubscriptionTypeListComponent, EmailSubscriptionTypeListModule, EmailSubscriptionTypeListRoutingModule, EmailSubscriptionTypeModule, EmailSubscriptionTypeRoutingModule, EmailSubscriptionUserFormComponent, EmailSubscriptionUserFormModule, EmailSubscriptionUserFormRoutingModule, EmailSubscriptionUserListComponent, EmailSubscriptionUserListFilterComponent, EmailSubscriptionUserListFilterModule, EmailSubscriptionUserListFilterRoutingModule, EmailSubscriptionUserListModule, EmailSubscriptionUserListRoutingModule, EmailSubscriptionUserModule, EmailSubscriptionUserRoutingModule, EntityFileFormComponent, EntityFilesViewAllComponent, EntityFilesViewAllModule, ErrorHandlerInterceptor, ErrorHandlerService, ErrorSnackComponent, ExportExcelButtonComponent, ExportExcelModule, FileDropperComponent, FileDropperConfig, FileDropperModule, FormValidatorService, HTTP_DYNAMIC_INTERCEPTORS, HttpCacheService, HttpService, ImportCsvComponent, ImportCsvModule, LoaderComponent, LoaderModule, LogLevel, Logger, LoginHistoryForUserComponent, LoginHistoryForUserModule, LoginHistoryForUserRoutingModule, MatSelectInfiniteScrollDirective, MaterialModule, NoteFormComponent, NoteListComponent, NoteModule, NumItemsSelector, NumberSelector, PageEvent, ReadMoreComponent, ReadMoreModule, RouteReusableStrategy, SearchableSelectorComponent, SearchableSelectorModule, SnackModule, StorageService, SuccessSnackComponent, TechlifyConfig, TechlifyFeatureEnabledDirective, TechlifyFeatureListingComponent, TechlifyFeatureModule, TechlifyFeatureRoutes, TechlifyTaggerTagFormConfigModel, TechlifyTaggerTagFormFieldComponent, TechlifyTaggerTagFormFieldModule, TechlifyTaggerTagSelectorComponent, TechlifyTaggerTagSelectorModule, TechlifyUpdateHistoryModule, TechlifyUpdateModule, Timeline, TimelineFilterComponent, TimelineFilterModule, TokenInterceptor, UpdateNotifierComponent, UpdateNotifierModule, UtilityModule, ViewerConfig, calculateTimeline, esfur, estlr, esulr, SnackModule as ɵa, SuccessSnackComponent as ɵb, NumberSelector as ɵba, TimelineFilterComponent as ɵbb, TimelineFilterRoutingModule as ɵbc, LoaderComponent as ɵbd, EmailSubscriptionUserFormComponent as ɵbe, EmailSubscriptionUserListComponent as ɵbf, AuthenticationGuard as ɵbg, EmailSubscriptionUserListFilterComponent as ɵbh, EmailSubscriptionTypeFormComponent as ɵbi, EmailSubscriptionTypeListComponent as ɵbj, EmailSubscriptionForUserComponent as ɵbk, TechlifyUpdatesListComponent as ɵbl, TechlifyUpdateService as ɵbm, TechlifyUpdateRoutingModule as ɵbn, TechlifyUpdateFormModule as ɵbo, TechlifyUpdateFormComponent as ɵbp, TechlifyUpdateHistoryRoutingModule as ɵbq, TechlifyUpdateHistoryComponent as ɵbr, UpdateNotifierSnackComponent as ɵbs, UpdateViewModule as ɵbt, UpdateViewComponent as ɵbu, DataManager as ɵbv, ErrorHandlerService as ɵbw, FieldMappingComponent as ɵbx, FailedItemsListComponent as ɵby, ImportHistoryListComponent as ɵbz, ErrorSnackComponent as ɵc, ImportSuccessComponent as ɵca, DataImportComponent as ɵcb, StorageService as ɵcc, TechlifyFeatureService as ɵcd, OnOffSwitchComponent as ɵce, HTTP_DYNAMIC_INTERCEPTORS as ɵd, HttpService as ɵe, RouteReusableStrategy as ɵf, ActionPopupComponent as ɵg, ActionPopup as ɵh, DataTableComponent as ɵi, DocumentViewerComponent as ɵj, EntityFileFormComponent as ɵk, FormValidatorService as ɵl, EntityFileService as ɵm, AlertService as ɵn, EntityFilesViewAllComponent as ɵo, FileDropperComponent as ɵp, NoteListComponent as ɵq, NoteService as ɵr, NoteFormComponent as ɵs, CommentFormComponent as ɵt, CredentialsService as ɵu, ConfigService as ɵv, TechlifyConfig as ɵw, SearchableSelectorComponent as ɵx, MatSelectInfiniteScrollDirective as ɵy, NumItemsSelector as ɵz };
|
|
6808
6879
|
//# sourceMappingURL=ngx-techlify-core.js.map
|