ngx-techlify-core 11.4.5-beta.6 → 11.4.5-beta.7

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.
@@ -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('moment'), 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/material/button-toggle'), 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/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', 'moment', '@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/material/button-toggle', '@angular/flex-layout', 'ngx-infinite-scroll', 'ngx-doc-viewer', 'ngx-editor', 'xlsx', '@angular/platform-browser', 'jsondiffpatch', '@angular/cdk/keycodes', '@angular/material/autocomplete', '@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.moment, 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.material.buttonToggle, 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.slideToggle));
5
- }(this, (function (exports, i0, dialog, table, sort, untilDestroy, common, forms, i1$1, rxjs, operators, i1, a11y, coercion, formField, select, moment_, icon, i1$2, tooltip, core, button, checkbox, input, menu, progressSpinner, card, divider, chips, datepicker, list, buttonToggle, flexLayout, ngxInfiniteScroll, ngxDocViewer, ngxEditor, XLSX, platformBrowser, jsondiffpatch, keycodes, autocomplete, slideToggle) { '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/material/icon'), require('@angular/router'), require('@angular/cdk/a11y'), require('@angular/cdk/coercion'), require('@angular/material/form-field'), require('@angular/material/select'), require('moment'), 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/material/button-toggle'), 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/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/material/icon', '@angular/router', '@angular/cdk/a11y', '@angular/cdk/coercion', '@angular/material/form-field', '@angular/material/select', 'moment', '@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/material/button-toggle', '@angular/flex-layout', 'ngx-infinite-scroll', 'ngx-doc-viewer', 'ngx-editor', 'xlsx', '@angular/platform-browser', 'jsondiffpatch', '@angular/cdk/keycodes', '@angular/material/autocomplete', '@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.material.icon, global.ng.router, global.ng.cdk.a11y, global.ng.cdk.coercion, global.ng.material.formField, global.ng.material.select, global.moment, 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.material.buttonToggle, 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.slideToggle));
5
+ }(this, (function (exports, i0, dialog, table, sort, untilDestroy, common, forms, i1$2, rxjs, operators, i1, icon, i1$1, a11y, coercion, formField, select, moment_, tooltip, core, button, checkbox, input, menu, progressSpinner, card, divider, chips, datepicker, list, buttonToggle, flexLayout, ngxInfiniteScroll, ngxDocViewer, ngxEditor, XLSX, platformBrowser, jsondiffpatch, keycodes, autocomplete, slideToggle) { 'use strict';
6
6
 
7
7
  function _interopNamespace(e) {
8
8
  if (e && e.__esModule) return e;
@@ -734,90 +734,6 @@
734
734
  */
735
735
  Logger.outputs = [];
736
736
 
737
- /**
738
- * Class that stores the configuration data
739
- *
740
- * @author Joshua Kissoon
741
- * @since 20180724
742
- */
743
- var TechlifyConfig = /** @class */ (function () {
744
- function TechlifyConfig(data) {
745
- this.data = data;
746
- this.projectKey = '';
747
- this.environment = '';
748
- this.authClientSecret = '';
749
- this.authGrantType = '';
750
- this.apiUrl = '';
751
- this.isLogoutWhileApiGetsFailed = false;
752
- this.loadFromMap();
753
- }
754
- TechlifyConfig.prototype.loadFromMap = function () {
755
- var _a, _b;
756
- this.projectKey = this.data.projectKey;
757
- this.environment = this.data.environment;
758
- this.authClientSecret = this.data.authClientSecret;
759
- this.authGrantType = this.data.authGrantType;
760
- this.apiUrl = this.data.apiUrl;
761
- this.storage = (_a = this.data) === null || _a === void 0 ? void 0 : _a.storage;
762
- this.rawConfigs = this.data;
763
- this.isLogoutWhileApiGetsFailed = (_b = this.data) === null || _b === void 0 ? void 0 : _b.isLogoutWhileApiGetsFailed;
764
- };
765
- return TechlifyConfig;
766
- }());
767
- TechlifyConfig.ɵprov = i0.ɵɵdefineInjectable({ factory: function TechlifyConfig_Factory() { return new TechlifyConfig(i0.ɵɵinject("data")); }, token: TechlifyConfig, providedIn: "root" });
768
- TechlifyConfig.decorators = [
769
- { type: i0.Injectable, args: [{
770
- providedIn: 'root'
771
- },] }
772
- ];
773
- TechlifyConfig.ctorParameters = function () { return [
774
- { type: undefined, decorators: [{ type: i0.Inject, args: ['data',] }] }
775
- ]; };
776
-
777
- /**
778
- * Service that provides settings for all other services
779
- *
780
- * @author Joshua Kissoon
781
- * @since 20170709
782
- */
783
- var ConfigService = /** @class */ (function () {
784
- function ConfigService(config) {
785
- this.config = config;
786
- }
787
- ConfigService.prototype.getConfigsRaw = function () {
788
- return this.config.rawConfigs;
789
- };
790
- ConfigService.prototype.getProjectKey = function () {
791
- return this.config.projectKey;
792
- };
793
- ConfigService.prototype.getApiUrl = function () {
794
- return this.config.apiUrl;
795
- };
796
- ConfigService.prototype.getAuthClientSecret = function () {
797
- return this.config.authClientSecret;
798
- };
799
- ConfigService.prototype.getStorage = function () {
800
- return this.config.storage ? this.config.storage : localStorage;
801
- };
802
- ConfigService.prototype.getAuthGrantType = function () {
803
- return this.config.authGrantType;
804
- };
805
- ConfigService.prototype.getCredentialsKey = function () {
806
- return this.config.projectKey + "_" + ConfigService.BASE_CREDENTIALS;
807
- };
808
- return ConfigService;
809
- }());
810
- ConfigService.BASE_CREDENTIALS = "credentials";
811
- ConfigService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ConfigService_Factory() { return new ConfigService(i0.ɵɵinject(TechlifyConfig)); }, token: ConfigService, providedIn: "root" });
812
- ConfigService.decorators = [
813
- { type: i0.Injectable, args: [{
814
- providedIn: 'root'
815
- },] }
816
- ];
817
- ConfigService.ctorParameters = function () { return [
818
- { type: TechlifyConfig }
819
- ]; };
820
-
821
737
  var SuccessSnackComponent = /** @class */ (function () {
822
738
  function SuccessSnackComponent(data) {
823
739
  this.data = data;
@@ -851,6 +767,29 @@
851
767
  { type: undefined, decorators: [{ type: i0.Inject, args: [i1.MAT_SNACK_BAR_DATA,] }] }
852
768
  ]; };
853
769
 
770
+ var SnackModule = /** @class */ (function () {
771
+ function SnackModule() {
772
+ }
773
+ return SnackModule;
774
+ }());
775
+ SnackModule.decorators = [
776
+ { type: i0.NgModule, args: [{
777
+ declarations: [
778
+ SuccessSnackComponent,
779
+ ErrorSnackComponent
780
+ ],
781
+ imports: [
782
+ common.CommonModule,
783
+ i1.MatSnackBarModule,
784
+ icon.MatIconModule
785
+ ],
786
+ exports: [
787
+ SuccessSnackComponent,
788
+ ErrorSnackComponent,
789
+ ]
790
+ },] }
791
+ ];
792
+
854
793
  /**
855
794
  * Service used to manage alerts in the entire system frontend
856
795
  *
@@ -889,124 +828,236 @@
889
828
  ]; };
890
829
 
891
830
  /**
892
- * Service used to handle errors from the request
893
- *
894
- * @author Joshua Kissoon
895
- * @since 20171202
831
+ * Prefixes all requests not starting with `http[s]` with `environment.serverUrl`.
896
832
  */
897
- var ErrorHandlerService = /** @class */ (function () {
898
- function ErrorHandlerService(alerter) {
899
- this.alerter = alerter;
833
+ var ApiPrefixInterceptor = /** @class */ (function () {
834
+ function ApiPrefixInterceptor(configService) {
835
+ this.configService = configService;
900
836
  }
901
- ErrorHandlerService.prototype.handleError = function (errorResponse, msg) {
902
- if (msg === void 0) { msg = ''; }
903
- var _a, _b, _c, _d;
904
- // 1 - Create empty array to store errors
905
- var errors = [];
906
- // 2 - check if the error object is present in the response
907
- if (errorResponse === null || errorResponse === void 0 ? void 0 : errorResponse.error) {
908
- // 3 - Check for Laravel form validation error messages object
909
- if ((_a = errorResponse === null || errorResponse === void 0 ? void 0 : errorResponse.error) === null || _a === void 0 ? void 0 : _a.errors) {
910
- // 4 - For each error property (which is a form field)
911
- for (var property in errorResponse.error.errors) {
912
- if ((_b = errorResponse.error.errors) === null || _b === void 0 ? void 0 : _b.hasOwnProperty(property)) {
913
- // 5 - Extract it's array of errors
914
- var propertyErrors = (_c = errorResponse === null || errorResponse === void 0 ? void 0 : errorResponse.error) === null || _c === void 0 ? void 0 : _c.errors[property];
915
- // 6 - Push all errors in the array to the errors array
916
- propertyErrors.forEach(function (error) { return errors.push(error); });
917
- }
918
- }
919
- }
920
- if (errors.length === 0) {
921
- // 7 - Push the main error message to the array of errors if there is no validation error
922
- errors.push(errorResponse.error.message ? errorResponse.error.message : (_d = errorResponse.error) === null || _d === void 0 ? void 0 : _d.error);
923
- }
837
+ ApiPrefixInterceptor.prototype.intercept = function (request, next) {
838
+ if (!/^(http|https):/i.test(request.url)) {
839
+ request = request.clone({ url: this.configService.getApiUrl() + request.url });
924
840
  }
925
- var errMessage = errors.length ? errors[0] : msg;
926
- this.alerter.addAlert("Error: " + errMessage, "warning");
841
+ return next.handle(request);
927
842
  };
928
- return ErrorHandlerService;
843
+ return ApiPrefixInterceptor;
929
844
  }());
930
- ErrorHandlerService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ErrorHandlerService_Factory() { return new ErrorHandlerService(i0.ɵɵinject(AlertService)); }, token: ErrorHandlerService, providedIn: "root" });
931
- ErrorHandlerService.decorators = [
845
+ ApiPrefixInterceptor.ɵprov = i0.ɵɵdefineInjectable({ factory: function ApiPrefixInterceptor_Factory() { return new ApiPrefixInterceptor(i0.ɵɵinject(ConfigService)); }, token: ApiPrefixInterceptor, providedIn: "root" });
846
+ ApiPrefixInterceptor.decorators = [
932
847
  { type: i0.Injectable, args: [{
933
848
  providedIn: 'root'
934
849
  },] }
935
850
  ];
936
- ErrorHandlerService.ctorParameters = function () { return [
937
- { type: AlertService }
851
+ ApiPrefixInterceptor.ctorParameters = function () { return [
852
+ { type: ConfigService }
938
853
  ]; };
939
854
 
940
- var log = new Logger('ErrorHandlerInterceptor');
941
855
  /**
942
- * Adds a default error handler to all requests.
856
+ * Provides storage for authentication credentials.
857
+ * The Credentials interface should be replaced with proper implementation.
943
858
  */
944
- var ErrorHandlerInterceptor = /** @class */ (function () {
945
- function ErrorHandlerInterceptor(configService, errorHandler) {
859
+ var CredentialsService = /** @class */ (function () {
860
+ function CredentialsService(configService) {
946
861
  this.configService = configService;
947
- this.errorHandler = errorHandler;
862
+ this._credentials = null;
948
863
  }
949
- ErrorHandlerInterceptor.prototype.intercept = function (request, next) {
950
- var _this = this;
951
- return next.handle(request).pipe(operators.catchError(function (error) { return _this.handleError(error); }));
952
- };
953
- // Customize the default error handler here if needed
954
- ErrorHandlerInterceptor.prototype.handleError = function (error) {
955
- var _a, _b;
956
- var errorMessage = '';
957
- if (error.error instanceof ErrorEvent) {
958
- // client-side error
959
- errorMessage = "Client Error: " + ((_a = this.configService) === null || _a === void 0 ? void 0 : _a.getProjectKey()) + ": " + error.error.message;
864
+ Object.defineProperty(CredentialsService.prototype, "isAuthenticated", {
865
+ /**
866
+ * Checks is the user is authenticated.
867
+ * @return True if the user is authenticated.
868
+ */
869
+ get: function () {
870
+ return !!this.credentials;
871
+ },
872
+ enumerable: false,
873
+ configurable: true
874
+ });
875
+ Object.defineProperty(CredentialsService.prototype, "credentials", {
876
+ /**
877
+ * Gets the user credentials.
878
+ * @return The user credentials or null if the user is not authenticated.
879
+ */
880
+ get: function () {
881
+ if (!this._credentials) {
882
+ this._credentials = JSON.parse(sessionStorage.getItem(this.configService.getCredentialsKey()) || localStorage.getItem(this.configService.getCredentialsKey()));
883
+ }
884
+ return this._credentials;
885
+ },
886
+ enumerable: false,
887
+ configurable: true
888
+ });
889
+ /**
890
+ * Sets the user credentials.
891
+ * The credentials may be persisted across sessions by setting the `remember` parameter to true.
892
+ * Otherwise, the credentials are only persisted for the current session.
893
+ * @param credentials The user credentials.
894
+ * @param remember True to remember credentials across sessions.
895
+ */
896
+ CredentialsService.prototype.setCredentials = function (credentials, remember) {
897
+ this._credentials = credentials || null;
898
+ if (credentials) {
899
+ (remember ? localStorage : sessionStorage).setItem(this.configService.getCredentialsKey(), JSON.stringify(credentials));
960
900
  }
961
901
  else {
962
- // server-side error
963
- errorMessage = "Server Error: " + ((_b = this.configService) === null || _b === void 0 ? void 0 : _b.getProjectKey());
964
- try {
965
- this.errorHandler.handleError(error, 'Unexpected Server Error, try later or contact service team');
966
- }
967
- catch (e) {
968
- console.log("Unable to handle server error", e);
969
- }
902
+ sessionStorage.clear();
903
+ localStorage.clear();
904
+ this._credentials = null;
970
905
  }
971
- return rxjs.throwError(error);
972
906
  };
973
- return ErrorHandlerInterceptor;
907
+ CredentialsService.prototype.getAccessToken = function () {
908
+ var _a, _b, _c, _d;
909
+ var expiration = ((_b = (_a = this.credentials) === null || _a === void 0 ? void 0 : _a.token) === null || _b === void 0 ? void 0 : _b.expires_in) || '';
910
+ var token = ((_d = (_c = this.credentials) === null || _c === void 0 ? void 0 : _c.token) === null || _d === void 0 ? void 0 : _d.access_token) || '';
911
+ if (!token || !expiration) {
912
+ return null;
913
+ }
914
+ if (Date.now() > parseInt(expiration)) {
915
+ this.setCredentials();
916
+ return null;
917
+ }
918
+ return token;
919
+ };
920
+ CredentialsService.prototype.getExpiration = function () {
921
+ var _a, _b;
922
+ return ((_b = (_a = this.credentials) === null || _a === void 0 ? void 0 : _a.token) === null || _b === void 0 ? void 0 : _b.expires_in) || '';
923
+ };
924
+ CredentialsService.prototype.getRefreshToken = function () {
925
+ var _a, _b;
926
+ return ((_b = (_a = this.credentials) === null || _a === void 0 ? void 0 : _a.token) === null || _b === void 0 ? void 0 : _b.refresh_token) || '';
927
+ };
928
+ CredentialsService.prototype.refresh = function () {
929
+ this._credentials = null;
930
+ return this;
931
+ };
932
+ return CredentialsService;
974
933
  }());
975
- ErrorHandlerInterceptor.ɵprov = i0.ɵɵdefineInjectable({ factory: function ErrorHandlerInterceptor_Factory() { return new ErrorHandlerInterceptor(i0.ɵɵinject(ConfigService), i0.ɵɵinject(ErrorHandlerService)); }, token: ErrorHandlerInterceptor, providedIn: "root" });
976
- ErrorHandlerInterceptor.decorators = [
934
+ CredentialsService.ɵprov = i0.ɵɵdefineInjectable({ factory: function CredentialsService_Factory() { return new CredentialsService(i0.ɵɵinject(ConfigService)); }, token: CredentialsService, providedIn: "root" });
935
+ CredentialsService.decorators = [
977
936
  { type: i0.Injectable, args: [{
978
937
  providedIn: 'root'
979
938
  },] }
980
939
  ];
981
- ErrorHandlerInterceptor.ctorParameters = function () { return [
982
- { type: ConfigService },
983
- { type: ErrorHandlerService }
940
+ CredentialsService.ctorParameters = function () { return [
941
+ { type: ConfigService }
984
942
  ]; };
985
943
 
986
- var log$1 = new Logger('HttpCacheService');
987
- /**
988
- * Provides a cache facility for HTTP requests with configurable persistence policy.
989
- */
990
- var HttpCacheService = /** @class */ (function () {
991
- function HttpCacheService(configService) {
992
- this.configService = configService;
993
- this.cachedData = {};
994
- this.storage = this.configService.getStorage();
995
- this.cachePersistenceKey = this.configService.getProjectKey() + '_HTTP_CACHE';
996
- this.loadCacheData();
944
+ var log = new Logger('AuthenticationGuard');
945
+ var AuthenticationGuard = /** @class */ (function () {
946
+ function AuthenticationGuard(router, credentialsService) {
947
+ this.router = router;
948
+ this.credentialsService = credentialsService;
997
949
  }
998
- /**
999
- * Sets the cache data for the specified request.
1000
- * @param {!string} url The request URL.
1001
- * @param {ResponseOptions} data The received data.
1002
- * @param {Date=} lastUpdated The cache last update, current date is used if not specified.
1003
- */
1004
- HttpCacheService.prototype.setCacheData = function (url, data, lastUpdated) {
1005
- this.cachedData[url] = {
1006
- lastUpdated: lastUpdated || new Date(),
1007
- data: data
1008
- };
1009
- log$1.debug("Cache set for key: \"" + url + "\"");
950
+ AuthenticationGuard.prototype.canActivate = function (route, state) {
951
+ return this.isUserAuthenticated(route, state);
952
+ };
953
+ AuthenticationGuard.prototype.canLoad = function (route, state) {
954
+ return this.isUserAuthenticated(route, state);
955
+ };
956
+ AuthenticationGuard.prototype.isUserAuthenticated = function (route, state) {
957
+ if (this.credentialsService.isAuthenticated) {
958
+ return true;
959
+ }
960
+ log.debug('Not authenticated, redirecting and adding redirect url...');
961
+ this.router.navigate(['/login'], { queryParams: { redirect: state.url }, replaceUrl: true });
962
+ return false;
963
+ };
964
+ return AuthenticationGuard;
965
+ }());
966
+ AuthenticationGuard.ɵprov = i0.ɵɵdefineInjectable({ factory: function AuthenticationGuard_Factory() { return new AuthenticationGuard(i0.ɵɵinject(i1$1.Router), i0.ɵɵinject(CredentialsService)); }, token: AuthenticationGuard, providedIn: "root" });
967
+ AuthenticationGuard.decorators = [
968
+ { type: i0.Injectable, args: [{
969
+ providedIn: 'root'
970
+ },] }
971
+ ];
972
+ AuthenticationGuard.ctorParameters = function () { return [
973
+ { type: i1$1.Router },
974
+ { type: CredentialsService }
975
+ ]; };
976
+
977
+ /**
978
+ * Provides a base for authentication workflow.
979
+ * The login/logout methods should be replaced with proper implementation.
980
+ */
981
+ var AuthenticationService = /** @class */ (function () {
982
+ function AuthenticationService(credentialsService, http) {
983
+ this.credentialsService = credentialsService;
984
+ this.http = http;
985
+ }
986
+ /**
987
+ * Authenticates the user.
988
+ * @param context The login parameters.
989
+ * @return The user credentials.
990
+ */
991
+ AuthenticationService.prototype.login = function (context) {
992
+ var _this = this;
993
+ var data = {};
994
+ return this.http
995
+ .skipToken()
996
+ .post('oauth/token', context)
997
+ .pipe(operators.concatMap(function (tokenInfo) { return __awaiter(_this, void 0, void 0, function () {
998
+ var userInfo;
999
+ return __generator(this, function (_a) {
1000
+ switch (_a.label) {
1001
+ case 0:
1002
+ tokenInfo.expires_in = Date.now() + (tokenInfo.expires_in * 1000);
1003
+ data.token = tokenInfo;
1004
+ data.user = {};
1005
+ this.credentialsService.setCredentials(data, context.remember);
1006
+ return [4 /*yield*/, this.http.get('api/user/current').toPromise()];
1007
+ case 1:
1008
+ userInfo = _a.sent();
1009
+ data.user = userInfo === null || userInfo === void 0 ? void 0 : userInfo.user;
1010
+ this.credentialsService.setCredentials(data, context.remember);
1011
+ return [2 /*return*/, data];
1012
+ }
1013
+ });
1014
+ }); }));
1015
+ };
1016
+ /**
1017
+ * Logs out the user and clear credentials.
1018
+ * @return True if the user was logged out successfully.
1019
+ */
1020
+ AuthenticationService.prototype.logout = function () {
1021
+ this.credentialsService.setCredentials();
1022
+ return rxjs.of(true);
1023
+ };
1024
+ return AuthenticationService;
1025
+ }());
1026
+ AuthenticationService.ɵprov = i0.ɵɵdefineInjectable({ factory: function AuthenticationService_Factory() { return new AuthenticationService(i0.ɵɵinject(CredentialsService), i0.ɵɵinject(HttpService)); }, token: AuthenticationService, providedIn: "root" });
1027
+ AuthenticationService.decorators = [
1028
+ { type: i0.Injectable, args: [{
1029
+ providedIn: 'root'
1030
+ },] }
1031
+ ];
1032
+ AuthenticationService.ctorParameters = function () { return [
1033
+ { type: CredentialsService },
1034
+ { type: HttpService }
1035
+ ]; };
1036
+
1037
+ var log$1 = new Logger('HttpCacheService');
1038
+ /**
1039
+ * Provides a cache facility for HTTP requests with configurable persistence policy.
1040
+ */
1041
+ var HttpCacheService = /** @class */ (function () {
1042
+ function HttpCacheService(configService) {
1043
+ this.configService = configService;
1044
+ this.cachedData = {};
1045
+ this.storage = this.configService.getStorage();
1046
+ this.cachePersistenceKey = this.configService.getProjectKey() + '_HTTP_CACHE';
1047
+ this.loadCacheData();
1048
+ }
1049
+ /**
1050
+ * Sets the cache data for the specified request.
1051
+ * @param {!string} url The request URL.
1052
+ * @param {ResponseOptions} data The received data.
1053
+ * @param {Date=} lastUpdated The cache last update, current date is used if not specified.
1054
+ */
1055
+ HttpCacheService.prototype.setCacheData = function (url, data, lastUpdated) {
1056
+ this.cachedData[url] = {
1057
+ lastUpdated: lastUpdated || new Date(),
1058
+ data: data
1059
+ };
1060
+ log$1.debug("Cache set for key: \"" + url + "\"");
1010
1061
  this.saveCacheData();
1011
1062
  };
1012
1063
  /**
@@ -1120,13 +1171,13 @@
1120
1171
  var cachedData = _this.forceUpdate ? null : _this.httpCacheService.getCacheData(request.urlWithParams);
1121
1172
  if (cachedData !== null) {
1122
1173
  // Create new response to avoid side-effects
1123
- subscriber.next(new i1$1.HttpResponse(cachedData));
1174
+ subscriber.next(new i1$2.HttpResponse(cachedData));
1124
1175
  subscriber.complete();
1125
1176
  }
1126
1177
  else {
1127
1178
  next.handle(request)
1128
1179
  .subscribe(function (event) {
1129
- if (event instanceof i1$1.HttpResponse) {
1180
+ if (event instanceof i1$2.HttpResponse) {
1130
1181
  _this.httpCacheService.setCacheData(request.urlWithParams, event);
1131
1182
  }
1132
1183
  subscriber.next(event);
@@ -1147,121 +1198,153 @@
1147
1198
  ]; };
1148
1199
 
1149
1200
  /**
1150
- * Prefixes all requests not starting with `http[s]` with `environment.serverUrl`.
1201
+ * Service used to handle errors from the request
1202
+ *
1203
+ * @author Joshua Kissoon
1204
+ * @since 20171202
1151
1205
  */
1152
- var ApiPrefixInterceptor = /** @class */ (function () {
1153
- function ApiPrefixInterceptor(configService) {
1154
- this.configService = configService;
1206
+ var ErrorHandlerService = /** @class */ (function () {
1207
+ function ErrorHandlerService(alerter) {
1208
+ this.alerter = alerter;
1155
1209
  }
1156
- ApiPrefixInterceptor.prototype.intercept = function (request, next) {
1157
- if (!/^(http|https):/i.test(request.url)) {
1158
- request = request.clone({ url: this.configService.getApiUrl() + request.url });
1210
+ ErrorHandlerService.prototype.handleError = function (errorResponse, msg) {
1211
+ if (msg === void 0) { msg = ''; }
1212
+ var _a, _b, _c, _d;
1213
+ // 1 - Create empty array to store errors
1214
+ var errors = [];
1215
+ // 2 - check if the error object is present in the response
1216
+ if (errorResponse === null || errorResponse === void 0 ? void 0 : errorResponse.error) {
1217
+ // 3 - Check for Laravel form validation error messages object
1218
+ if ((_a = errorResponse === null || errorResponse === void 0 ? void 0 : errorResponse.error) === null || _a === void 0 ? void 0 : _a.errors) {
1219
+ // 4 - For each error property (which is a form field)
1220
+ for (var property in errorResponse.error.errors) {
1221
+ if ((_b = errorResponse.error.errors) === null || _b === void 0 ? void 0 : _b.hasOwnProperty(property)) {
1222
+ // 5 - Extract it's array of errors
1223
+ var propertyErrors = (_c = errorResponse === null || errorResponse === void 0 ? void 0 : errorResponse.error) === null || _c === void 0 ? void 0 : _c.errors[property];
1224
+ // 6 - Push all errors in the array to the errors array
1225
+ propertyErrors.forEach(function (error) { return errors.push(error); });
1226
+ }
1227
+ }
1228
+ }
1229
+ if (errors.length === 0) {
1230
+ // 7 - Push the main error message to the array of errors if there is no validation error
1231
+ errors.push(errorResponse.error.message ? errorResponse.error.message : (_d = errorResponse.error) === null || _d === void 0 ? void 0 : _d.error);
1232
+ }
1159
1233
  }
1160
- return next.handle(request);
1234
+ var errMessage = errors.length ? errors[0] : msg;
1235
+ this.alerter.addAlert("Error: " + errMessage, "warning");
1161
1236
  };
1162
- return ApiPrefixInterceptor;
1237
+ return ErrorHandlerService;
1163
1238
  }());
1164
- ApiPrefixInterceptor.ɵprov = i0.ɵɵdefineInjectable({ factory: function ApiPrefixInterceptor_Factory() { return new ApiPrefixInterceptor(i0.ɵɵinject(ConfigService)); }, token: ApiPrefixInterceptor, providedIn: "root" });
1165
- ApiPrefixInterceptor.decorators = [
1239
+ ErrorHandlerService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ErrorHandlerService_Factory() { return new ErrorHandlerService(i0.ɵɵinject(AlertService)); }, token: ErrorHandlerService, providedIn: "root" });
1240
+ ErrorHandlerService.decorators = [
1166
1241
  { type: i0.Injectable, args: [{
1167
1242
  providedIn: 'root'
1168
1243
  },] }
1169
1244
  ];
1170
- ApiPrefixInterceptor.ctorParameters = function () { return [
1171
- { type: ConfigService }
1245
+ ErrorHandlerService.ctorParameters = function () { return [
1246
+ { type: AlertService }
1172
1247
  ]; };
1173
1248
 
1174
- /**
1175
- * Provides storage for authentication credentials.
1176
- * The Credentials interface should be replaced with proper implementation.
1177
- */
1178
- var CredentialsService = /** @class */ (function () {
1179
- function CredentialsService(configService) {
1180
- this.configService = configService;
1181
- this._credentials = null;
1249
+ var FormValidatorService = /** @class */ (function () {
1250
+ function FormValidatorService() {
1182
1251
  }
1183
- Object.defineProperty(CredentialsService.prototype, "isAuthenticated", {
1184
- /**
1185
- * Checks is the user is authenticated.
1186
- * @return True if the user is authenticated.
1187
- */
1188
- get: function () {
1189
- return !!this.credentials;
1190
- },
1191
- enumerable: false,
1192
- configurable: true
1193
- });
1194
- Object.defineProperty(CredentialsService.prototype, "credentials", {
1195
- /**
1196
- * Gets the user credentials.
1197
- * @return The user credentials or null if the user is not authenticated.
1198
- */
1199
- get: function () {
1200
- if (!this._credentials) {
1201
- this._credentials = JSON.parse(sessionStorage.getItem(this.configService.getCredentialsKey()) || localStorage.getItem(this.configService.getCredentialsKey()));
1202
- }
1203
- return this._credentials;
1204
- },
1205
- enumerable: false,
1206
- configurable: true
1207
- });
1208
- /**
1209
- * Sets the user credentials.
1210
- * The credentials may be persisted across sessions by setting the `remember` parameter to true.
1211
- * Otherwise, the credentials are only persisted for the current session.
1212
- * @param credentials The user credentials.
1213
- * @param remember True to remember credentials across sessions.
1214
- */
1215
- CredentialsService.prototype.setCredentials = function (credentials, remember) {
1216
- this._credentials = credentials || null;
1217
- if (credentials) {
1218
- (remember ? localStorage : sessionStorage).setItem(this.configService.getCredentialsKey(), JSON.stringify(credentials));
1219
- }
1220
- else {
1221
- sessionStorage.clear();
1222
- localStorage.clear();
1223
- this._credentials = null;
1224
- }
1225
- };
1226
- CredentialsService.prototype.getAccessToken = function () {
1227
- var _a, _b, _c, _d;
1228
- var expiration = ((_b = (_a = this.credentials) === null || _a === void 0 ? void 0 : _a.token) === null || _b === void 0 ? void 0 : _b.expires_in) || '';
1229
- var token = ((_d = (_c = this.credentials) === null || _c === void 0 ? void 0 : _c.token) === null || _d === void 0 ? void 0 : _d.access_token) || '';
1230
- if (!token || !expiration) {
1231
- return null;
1232
- }
1233
- if (Date.now() > parseInt(expiration)) {
1234
- this.setCredentials();
1235
- return null;
1236
- }
1237
- return token;
1238
- };
1239
- CredentialsService.prototype.getExpiration = function () {
1240
- var _a, _b;
1241
- return ((_b = (_a = this.credentials) === null || _a === void 0 ? void 0 : _a.token) === null || _b === void 0 ? void 0 : _b.expires_in) || '';
1242
- };
1243
- CredentialsService.prototype.getRefreshToken = function () {
1244
- var _a, _b;
1245
- return ((_b = (_a = this.credentials) === null || _a === void 0 ? void 0 : _a.token) === null || _b === void 0 ? void 0 : _b.refresh_token) || '';
1252
+ /**Method to evaluate form fields*/
1253
+ FormValidatorService.prototype.isFieldValid = function (field, formGroup, firstAttempt) {
1254
+ return (!formGroup.get(field).valid && formGroup.get(field).touched) ||
1255
+ (!formGroup.get(field).valid && formGroup.get(field).untouched && firstAttempt);
1246
1256
  };
1247
- CredentialsService.prototype.refresh = function () {
1248
- this._credentials = null;
1249
- return this;
1257
+ /**Method to find error in form fields*/
1258
+ FormValidatorService.prototype.getErrorMessage = function (field, formGroup, errorMessages, errorField) {
1259
+ var error = Object.keys(formGroup.get(field).errors);
1260
+ return (error.length > 0) ? (errorMessages[errorField || field][error[0]] ? errorMessages[errorField || field][error[0]] : '') : '';
1250
1261
  };
1251
- return CredentialsService;
1262
+ return FormValidatorService;
1252
1263
  }());
1253
- CredentialsService.ɵprov = i0.ɵɵdefineInjectable({ factory: function CredentialsService_Factory() { return new CredentialsService(i0.ɵɵinject(ConfigService)); }, token: CredentialsService, providedIn: "root" });
1254
- CredentialsService.decorators = [
1264
+ FormValidatorService.ɵprov = i0.ɵɵdefineInjectable({ factory: function FormValidatorService_Factory() { return new FormValidatorService(); }, token: FormValidatorService, providedIn: "root" });
1265
+ FormValidatorService.decorators = [
1255
1266
  { type: i0.Injectable, args: [{
1256
1267
  providedIn: 'root'
1257
1268
  },] }
1258
1269
  ];
1259
- CredentialsService.ctorParameters = function () { return [
1260
- { type: ConfigService }
1261
- ]; };
1270
+ FormValidatorService.ctorParameters = function () { return []; };
1262
1271
 
1263
1272
  /**
1264
- * Prefixes all requests not starting with `http[s]` with `environment.serverUrl`.
1273
+ * A route strategy allowing for explicit route reuse.
1274
+ * Used as a workaround for https://github.com/angular/angular/issues/18374
1275
+ * To reuse a given route, add `data: { reuse: true }` to the route definition.
1276
+ */
1277
+ var RouteReusableStrategy = /** @class */ (function (_super) {
1278
+ __extends(RouteReusableStrategy, _super);
1279
+ function RouteReusableStrategy() {
1280
+ return _super !== null && _super.apply(this, arguments) || this;
1281
+ }
1282
+ RouteReusableStrategy.prototype.shouldDetach = function (route) {
1283
+ return false;
1284
+ };
1285
+ RouteReusableStrategy.prototype.store = function (route, detachedTree) { };
1286
+ RouteReusableStrategy.prototype.shouldAttach = function (route) {
1287
+ return false;
1288
+ };
1289
+ RouteReusableStrategy.prototype.retrieve = function (route) {
1290
+ return null;
1291
+ };
1292
+ RouteReusableStrategy.prototype.shouldReuseRoute = function (future, curr) {
1293
+ var _a, _b, _c;
1294
+ // Reuse the route if the RouteConfig is the same, or if both routes use the
1295
+ // same component, because the latter can have different RouteConfigs.
1296
+ return future.routeConfig === curr.routeConfig ||
1297
+ Boolean(((_a = future.routeConfig) === null || _a === void 0 ? void 0 : _a.component) &&
1298
+ ((_b = future.routeConfig) === null || _b === void 0 ? void 0 : _b.component) === ((_c = curr.routeConfig) === null || _c === void 0 ? void 0 : _c.component));
1299
+ };
1300
+ return RouteReusableStrategy;
1301
+ }(i1$1.RouteReuseStrategy));
1302
+ RouteReusableStrategy.ɵprov = i0.ɵɵdefineInjectable({ factory: function RouteReusableStrategy_Factory() { return new RouteReusableStrategy(); }, token: RouteReusableStrategy, providedIn: "root" });
1303
+ RouteReusableStrategy.decorators = [
1304
+ { type: i0.Injectable, args: [{
1305
+ providedIn: 'root'
1306
+ },] }
1307
+ ];
1308
+
1309
+ /**
1310
+ * Service used to manage Local Storage
1311
+ *
1312
+ * @author Joshua Kissoon
1313
+ * @since 20190623
1314
+ */
1315
+ var StorageService = /** @class */ (function () {
1316
+ function StorageService() {
1317
+ this.storageSub = new rxjs.Subject();
1318
+ }
1319
+ StorageService.prototype.watch = function () {
1320
+ return this.storageSub.asObservable();
1321
+ };
1322
+ StorageService.prototype.setItem = function (key, data) {
1323
+ localStorage.setItem(key, data);
1324
+ this.storageSub.next({ key: key, value: data });
1325
+ };
1326
+ StorageService.prototype.getItem = function (key) {
1327
+ return localStorage.getItem(key);
1328
+ };
1329
+ StorageService.prototype.removeItem = function (key) {
1330
+ var data = this.getItem(key);
1331
+ localStorage.removeItem(key);
1332
+ this.storageSub.next({ key: key, value: data });
1333
+ };
1334
+ return StorageService;
1335
+ }());
1336
+ StorageService.ɵprov = i0.ɵɵdefineInjectable({ factory: function StorageService_Factory() { return new StorageService(); }, token: StorageService, providedIn: "root" });
1337
+ StorageService.decorators = [
1338
+ { type: i0.Injectable, args: [{
1339
+ providedIn: 'root'
1340
+ },] }
1341
+ ];
1342
+ StorageService.ctorParameters = function () { return []; };
1343
+
1344
+ var TECHLIFY_CORE_CONFIG_TOKEN = new i0.InjectionToken('TECHLIFY_CORE_CONFIG_TOKEN');
1345
+
1346
+ /**
1347
+ * Prefixes all requests not starting with `http[s]` with `environment.serverUrl`.
1265
1348
  */
1266
1349
  var TokenInterceptor = /** @class */ (function () {
1267
1350
  function TokenInterceptor(credentials) {
@@ -1288,85 +1371,319 @@
1288
1371
  ]; };
1289
1372
 
1290
1373
  /**
1291
- * Prefixes all requests not starting with `http[s]` with `environment.serverUrl`.
1374
+ * Service that provides a wrapper for retrieving data from the server
1375
+ * @deprecated use HttpService Instead
1376
+ * @author Joshua Kissoon
1377
+ * @since 20170709
1292
1378
  */
1293
- var HeaderInterceptor = /** @class */ (function () {
1294
- function HeaderInterceptor() {
1379
+ var DataManager = /** @class */ (function () {
1380
+ function DataManager(http) {
1381
+ this.http = http;
1295
1382
  }
1296
- HeaderInterceptor.prototype.intercept = function (request, next) {
1297
- request = request.clone({
1298
- setHeaders: {
1299
- 'Content-Type': request.headers.get('Content-Type') || 'application/json',
1300
- }
1301
- });
1302
- return next.handle(request);
1383
+ /**
1384
+ * Callback wrapper for the HTTP GET Call
1385
+ *
1386
+ * @param urlq The query part of the URL to be sent to the server
1387
+ *
1388
+ * @author Joshua Kissoon
1389
+ * @since 20160826
1390
+ * @updated 20170711 to add parameters
1391
+ */
1392
+ DataManager.prototype.GET = function (urlq, params) {
1393
+ if (params === void 0) { params = {}; }
1394
+ return this.http
1395
+ .get(urlq, { params: params })
1396
+ .toPromise();
1303
1397
  };
1304
- return HeaderInterceptor;
1398
+ /**
1399
+ * Callback wrapper for the HTTP POST Call
1400
+ *
1401
+ * @param urlq The query part of the URL to be sent to the server
1402
+ * @param object The object containing the POST data to be sent
1403
+ *
1404
+ * @author Joshua Kissoon
1405
+ * @since 20160826
1406
+ */
1407
+ DataManager.prototype.POST = function (urlq, object) {
1408
+ if (null == object) {
1409
+ object = { "blank": "blank" };
1410
+ }
1411
+ return this.http
1412
+ .post(urlq, object)
1413
+ .toPromise();
1414
+ };
1415
+ /**
1416
+ * Callback wrapper for the HTTP POST Call
1417
+ *
1418
+ * @param urlq The query part of the URL to be sent to the server
1419
+ * @param object The object containing the POST data to be sent
1420
+ *
1421
+ * @author Joshua Kissoon
1422
+ * @since 20160826
1423
+ */
1424
+ DataManager.prototype.POSTRAW = function (urlq, object) {
1425
+ if (null == object) {
1426
+ object = { "blank": "blank" };
1427
+ }
1428
+ return this.http
1429
+ .skipHeader()
1430
+ .post(urlq, object)
1431
+ .toPromise();
1432
+ };
1433
+ /**
1434
+ * Callback wrapper for the HTTP PUT Call
1435
+ *
1436
+ * @param urlq The query part of the URL to be sent to the server
1437
+ * @param object The object containing the PUT data to be sent
1438
+ *
1439
+ * @author Joshua Kissoon
1440
+ * @since 20160826
1441
+ */
1442
+ DataManager.prototype.PUT = function (urlq, object) {
1443
+ if (null == object) {
1444
+ object = { "blank": "blank" };
1445
+ }
1446
+ return this.http
1447
+ .put(urlq, object)
1448
+ .toPromise();
1449
+ };
1450
+ /**
1451
+ * Callback wrapper for the HTTP PATCH Call
1452
+ *
1453
+ * @param urlq The query part of the URL to be sent to the server
1454
+ * @param object The object containing the PUT data to be sent
1455
+ *
1456
+ * @author Joshua Kissoon
1457
+ * @since 20161107
1458
+ */
1459
+ DataManager.prototype.PATCH = function (urlq, object) {
1460
+ if (null == object) {
1461
+ object = { "blank": "blank" };
1462
+ }
1463
+ return this.http
1464
+ .patch(urlq, object)
1465
+ .toPromise();
1466
+ };
1467
+ /**
1468
+ * Callback wrapper for the HTTP DELETE Call
1469
+ *
1470
+ * @param urlq The query part of the URL to be sent to the server
1471
+ *
1472
+ * @author Joshua Kissoon
1473
+ * @since 20160826
1474
+ */
1475
+ DataManager.prototype.DELETE = function (urlq) {
1476
+ return this.http
1477
+ .delete(urlq)
1478
+ .toPromise();
1479
+ };
1480
+ return DataManager;
1305
1481
  }());
1306
- HeaderInterceptor.ɵprov = i0.ɵɵdefineInjectable({ factory: function HeaderInterceptor_Factory() { return new HeaderInterceptor(); }, token: HeaderInterceptor, providedIn: "root" });
1307
- HeaderInterceptor.decorators = [
1482
+ DataManager.ɵprov = i0.ɵɵdefineInjectable({ factory: function DataManager_Factory() { return new DataManager(i0.ɵɵinject(HttpService)); }, token: DataManager, providedIn: "root" });
1483
+ DataManager.decorators = [
1308
1484
  { type: i0.Injectable, args: [{
1309
1485
  providedIn: 'root'
1310
1486
  },] }
1311
1487
  ];
1488
+ DataManager.ctorParameters = function () { return [
1489
+ { type: HttpService }
1490
+ ]; };
1312
1491
 
1313
- // From @angular/common/http/src/interceptor: allows to chain interceptors
1314
- var HttpInterceptorHandler = /** @class */ (function () {
1315
- function HttpInterceptorHandler(next, interceptor) {
1316
- this.next = next;
1317
- this.interceptor = interceptor;
1492
+ var TechlifyConfigModule = /** @class */ (function () {
1493
+ function TechlifyConfigModule() {
1318
1494
  }
1319
- HttpInterceptorHandler.prototype.handle = function (request) {
1320
- return this.interceptor.intercept(request, this.next);
1495
+ TechlifyConfigModule.forRoot = function (techlifyConfig) {
1496
+ return {
1497
+ ngModule: TechlifyConfigModule,
1498
+ providers: [
1499
+ {
1500
+ provide: TECHLIFY_CORE_CONFIG_TOKEN,
1501
+ useValue: techlifyConfig
1502
+ }
1503
+ ]
1504
+ };
1321
1505
  };
1322
- return HttpInterceptorHandler;
1506
+ return TechlifyConfigModule;
1323
1507
  }());
1508
+ TechlifyConfigModule.decorators = [
1509
+ { type: i0.NgModule, args: [{
1510
+ declarations: [],
1511
+ imports: [],
1512
+ exports: []
1513
+ },] }
1514
+ ];
1515
+
1324
1516
  /**
1325
- * Allows to override default dynamic interceptors that can be disabled with the HttpService extension.
1326
- * Except for very specific needs, you should better configure these interceptors directly in the constructor below
1327
- * for better readability.
1517
+ * Service that provides settings for all other services
1328
1518
  *
1329
- * For static interceptors that should always be enabled (like ApiPrefixInterceptor), use the standard
1330
- * HTTP_INTERCEPTORS token.
1331
- */
1332
- var HTTP_DYNAMIC_INTERCEPTORS = new i0.InjectionToken('HTTP_DYNAMIC_INTERCEPTORS');
1333
- /**
1334
- * Extends HttpClient with per request configuration using dynamic interceptors.
1519
+ * @author Joshua Kissoon
1520
+ * @since 20170709
1335
1521
  */
1336
- var HttpService = /** @class */ (function (_super) {
1337
- __extends(HttpService, _super);
1338
- function HttpService(httpHandler, injector, interceptors) {
1339
- if (interceptors === void 0) { interceptors = []; }
1340
- var _this = _super.call(this, httpHandler) || this;
1341
- _this.httpHandler = httpHandler;
1342
- _this.injector = injector;
1343
- _this.interceptors = interceptors;
1344
- if (!_this.interceptors) {
1345
- // Configure default interceptors that can be disabled here
1346
- _this.interceptors = [_this.injector.get(ApiPrefixInterceptor), _this.injector.get(HeaderInterceptor), _this.injector.get(TokenInterceptor), _this.injector.get(ErrorHandlerInterceptor)];
1347
- }
1348
- return _this;
1522
+ var ConfigService = /** @class */ (function () {
1523
+ function ConfigService(techlifyConfig) {
1524
+ this.techlifyConfig = techlifyConfig;
1525
+ this.config = techlifyConfig;
1349
1526
  }
1350
- HttpService.prototype.cache = function (forceUpdate) {
1351
- var cacheInterceptor = this.injector.get(CacheInterceptor).configure({ update: forceUpdate });
1352
- return this.addInterceptor(cacheInterceptor);
1527
+ ConfigService.prototype.getConfigsRaw = function () {
1528
+ return this.config.rawConfigs;
1353
1529
  };
1354
- HttpService.prototype.skipErrorHandler = function () {
1355
- return this.removeInterceptor(ErrorHandlerInterceptor);
1530
+ ConfigService.prototype.getProjectKey = function () {
1531
+ return this.config.projectKey;
1356
1532
  };
1357
- HttpService.prototype.skipApiPrefix = function () {
1358
- return this.removeInterceptor(ApiPrefixInterceptor);
1533
+ ConfigService.prototype.getApiUrl = function () {
1534
+ return this.config.apiUrl;
1359
1535
  };
1360
- HttpService.prototype.skipToken = function () {
1361
- return this.removeInterceptor(TokenInterceptor);
1536
+ ConfigService.prototype.getAuthClientSecret = function () {
1537
+ return this.config.authClientSecret;
1362
1538
  };
1363
- HttpService.prototype.skipHeader = function () {
1364
- return this.removeInterceptor(HeaderInterceptor);
1539
+ ConfigService.prototype.getStorage = function () {
1540
+ return this.config.storage ? this.config.storage : localStorage;
1541
+ };
1542
+ ConfigService.prototype.getAuthGrantType = function () {
1543
+ return this.config.authGrantType;
1544
+ };
1545
+ ConfigService.prototype.getCredentialsKey = function () {
1546
+ return this.config.projectKey + "_" + ConfigService.BASE_CREDENTIALS;
1547
+ };
1548
+ return ConfigService;
1549
+ }());
1550
+ ConfigService.BASE_CREDENTIALS = "credentials";
1551
+ ConfigService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ConfigService_Factory() { return new ConfigService(i0.ɵɵinject(TECHLIFY_CORE_CONFIG_TOKEN)); }, token: ConfigService, providedIn: "root" });
1552
+ ConfigService.decorators = [
1553
+ { type: i0.Injectable, args: [{
1554
+ providedIn: 'root'
1555
+ },] }
1556
+ ];
1557
+ ConfigService.ctorParameters = function () { return [
1558
+ { type: undefined, decorators: [{ type: i0.Inject, args: [TECHLIFY_CORE_CONFIG_TOKEN,] }] }
1559
+ ]; };
1560
+
1561
+ var log$2 = new Logger('ErrorHandlerInterceptor');
1562
+ /**
1563
+ * Adds a default error handler to all requests.
1564
+ */
1565
+ var ErrorHandlerInterceptor = /** @class */ (function () {
1566
+ function ErrorHandlerInterceptor(configService, errorHandler) {
1567
+ this.configService = configService;
1568
+ this.errorHandler = errorHandler;
1569
+ }
1570
+ ErrorHandlerInterceptor.prototype.intercept = function (request, next) {
1571
+ var _this = this;
1572
+ return next.handle(request).pipe(operators.catchError(function (error) { return _this.handleError(error); }));
1573
+ };
1574
+ // Customize the default error handler here if needed
1575
+ ErrorHandlerInterceptor.prototype.handleError = function (error) {
1576
+ var _a, _b;
1577
+ var errorMessage = '';
1578
+ if (error.error instanceof ErrorEvent) {
1579
+ // client-side error
1580
+ errorMessage = "Client Error: " + ((_a = this.configService) === null || _a === void 0 ? void 0 : _a.getProjectKey()) + ": " + error.error.message;
1581
+ }
1582
+ else {
1583
+ // server-side error
1584
+ errorMessage = "Server Error: " + ((_b = this.configService) === null || _b === void 0 ? void 0 : _b.getProjectKey());
1585
+ try {
1586
+ this.errorHandler.handleError(error, 'Unexpected Server Error, try later or contact service team');
1587
+ }
1588
+ catch (e) {
1589
+ console.log("Unable to handle server error", e);
1590
+ }
1591
+ }
1592
+ return rxjs.throwError(error);
1593
+ };
1594
+ return ErrorHandlerInterceptor;
1595
+ }());
1596
+ ErrorHandlerInterceptor.ɵprov = i0.ɵɵdefineInjectable({ factory: function ErrorHandlerInterceptor_Factory() { return new ErrorHandlerInterceptor(i0.ɵɵinject(ConfigService), i0.ɵɵinject(ErrorHandlerService)); }, token: ErrorHandlerInterceptor, providedIn: "root" });
1597
+ ErrorHandlerInterceptor.decorators = [
1598
+ { type: i0.Injectable, args: [{
1599
+ providedIn: 'root'
1600
+ },] }
1601
+ ];
1602
+ ErrorHandlerInterceptor.ctorParameters = function () { return [
1603
+ { type: ConfigService },
1604
+ { type: ErrorHandlerService }
1605
+ ]; };
1606
+
1607
+ /**
1608
+ * Prefixes all requests not starting with `http[s]` with `environment.serverUrl`.
1609
+ */
1610
+ var HeaderInterceptor = /** @class */ (function () {
1611
+ function HeaderInterceptor() {
1612
+ }
1613
+ HeaderInterceptor.prototype.intercept = function (request, next) {
1614
+ request = request.clone({
1615
+ setHeaders: {
1616
+ 'Content-Type': request.headers.get('Content-Type') || 'application/json',
1617
+ }
1618
+ });
1619
+ return next.handle(request);
1620
+ };
1621
+ return HeaderInterceptor;
1622
+ }());
1623
+ HeaderInterceptor.ɵprov = i0.ɵɵdefineInjectable({ factory: function HeaderInterceptor_Factory() { return new HeaderInterceptor(); }, token: HeaderInterceptor, providedIn: "root" });
1624
+ HeaderInterceptor.decorators = [
1625
+ { type: i0.Injectable, args: [{
1626
+ providedIn: 'root'
1627
+ },] }
1628
+ ];
1629
+
1630
+ // From @angular/common/http/src/interceptor: allows to chain interceptors
1631
+ var HttpInterceptorHandler = /** @class */ (function () {
1632
+ function HttpInterceptorHandler(next, interceptor) {
1633
+ this.next = next;
1634
+ this.interceptor = interceptor;
1635
+ }
1636
+ HttpInterceptorHandler.prototype.handle = function (request) {
1637
+ return this.interceptor.intercept(request, this.next);
1638
+ };
1639
+ return HttpInterceptorHandler;
1640
+ }());
1641
+ /**
1642
+ * Allows to override default dynamic interceptors that can be disabled with the HttpService extension.
1643
+ * Except for very specific needs, you should better configure these interceptors directly in the constructor below
1644
+ * for better readability.
1645
+ *
1646
+ * For static interceptors that should always be enabled (like ApiPrefixInterceptor), use the standard
1647
+ * HTTP_INTERCEPTORS token.
1648
+ */
1649
+ var HTTP_DYNAMIC_INTERCEPTORS = new i0.InjectionToken('HTTP_DYNAMIC_INTERCEPTORS');
1650
+ /**
1651
+ * Extends HttpClient with per request configuration using dynamic interceptors.
1652
+ */
1653
+ var HttpService = /** @class */ (function (_super) {
1654
+ __extends(HttpService, _super);
1655
+ function HttpService(httpHandler, injector, interceptors) {
1656
+ if (interceptors === void 0) { interceptors = []; }
1657
+ var _this = _super.call(this, httpHandler) || this;
1658
+ _this.httpHandler = httpHandler;
1659
+ _this.injector = injector;
1660
+ _this.interceptors = interceptors;
1661
+ if (!_this.interceptors) {
1662
+ // Configure default interceptors that can be disabled here
1663
+ _this.interceptors = [_this.injector.get(ApiPrefixInterceptor), _this.injector.get(HeaderInterceptor), _this.injector.get(TokenInterceptor), _this.injector.get(ErrorHandlerInterceptor)];
1664
+ }
1665
+ return _this;
1666
+ }
1667
+ HttpService.prototype.cache = function (forceUpdate) {
1668
+ var cacheInterceptor = this.injector.get(CacheInterceptor).configure({ update: forceUpdate });
1669
+ return this.addInterceptor(cacheInterceptor);
1670
+ };
1671
+ HttpService.prototype.skipErrorHandler = function () {
1672
+ return this.removeInterceptor(ErrorHandlerInterceptor);
1673
+ };
1674
+ HttpService.prototype.skipApiPrefix = function () {
1675
+ return this.removeInterceptor(ApiPrefixInterceptor);
1676
+ };
1677
+ HttpService.prototype.skipToken = function () {
1678
+ return this.removeInterceptor(TokenInterceptor);
1679
+ };
1680
+ HttpService.prototype.skipHeader = function () {
1681
+ return this.removeInterceptor(HeaderInterceptor);
1365
1682
  };
1366
1683
  // Override the original method to wire interceptors when triggering the request.
1367
1684
  HttpService.prototype.request = function (method, url, options) {
1368
1685
  var handler = this.interceptors.reduceRight(function (next, interceptor) { return new HttpInterceptorHandler(next, interceptor); }, this.httpHandler);
1369
- return new i1$1.HttpClient(handler).request(method, url, options);
1686
+ return new i1$2.HttpClient(handler).request(method, url, options);
1370
1687
  };
1371
1688
  HttpService.prototype.removeInterceptor = function (interceptorType) {
1372
1689
  return new HttpService(this.httpHandler, this.injector, this.interceptors.filter(function (i) { return !(i instanceof interceptorType); }));
@@ -1375,15 +1692,15 @@
1375
1692
  return new HttpService(this.httpHandler, this.injector, this.interceptors.concat([interceptor]));
1376
1693
  };
1377
1694
  return HttpService;
1378
- }(i1$1.HttpClient));
1379
- HttpService.ɵprov = i0.ɵɵdefineInjectable({ factory: function HttpService_Factory() { return new HttpService(i0.ɵɵinject(i1$1.HttpHandler), i0.ɵɵinject(i0.INJECTOR), i0.ɵɵinject(HTTP_DYNAMIC_INTERCEPTORS, 8)); }, token: HttpService, providedIn: "root" });
1695
+ }(i1$2.HttpClient));
1696
+ HttpService.ɵprov = i0.ɵɵdefineInjectable({ factory: function HttpService_Factory() { return new HttpService(i0.ɵɵinject(i1$2.HttpHandler), i0.ɵɵinject(i0.INJECTOR), i0.ɵɵinject(HTTP_DYNAMIC_INTERCEPTORS, 8)); }, token: HttpService, providedIn: "root" });
1380
1697
  HttpService.decorators = [
1381
1698
  { type: i0.Injectable, args: [{
1382
1699
  providedIn: 'root'
1383
1700
  },] }
1384
1701
  ];
1385
1702
  HttpService.ctorParameters = function () { return [
1386
- { type: i1$1.HttpHandler },
1703
+ { type: i1$2.HttpHandler },
1387
1704
  { type: i0.Injector },
1388
1705
  { type: Array, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [HTTP_DYNAMIC_INTERCEPTORS,] }] }
1389
1706
  ]; };
@@ -1427,29 +1744,6 @@
1427
1744
  { type: HttpService }
1428
1745
  ]; };
1429
1746
 
1430
- var FormValidatorService = /** @class */ (function () {
1431
- function FormValidatorService() {
1432
- }
1433
- /**Method to evaluate form fields*/
1434
- FormValidatorService.prototype.isFieldValid = function (field, formGroup, firstAttempt) {
1435
- return (!formGroup.get(field).valid && formGroup.get(field).touched) ||
1436
- (!formGroup.get(field).valid && formGroup.get(field).untouched && firstAttempt);
1437
- };
1438
- /**Method to find error in form fields*/
1439
- FormValidatorService.prototype.getErrorMessage = function (field, formGroup, errorMessages, errorField) {
1440
- var error = Object.keys(formGroup.get(field).errors);
1441
- return (error.length > 0) ? (errorMessages[errorField || field][error[0]] ? errorMessages[errorField || field][error[0]] : '') : '';
1442
- };
1443
- return FormValidatorService;
1444
- }());
1445
- FormValidatorService.ɵprov = i0.ɵɵdefineInjectable({ factory: function FormValidatorService_Factory() { return new FormValidatorService(); }, token: FormValidatorService, providedIn: "root" });
1446
- FormValidatorService.decorators = [
1447
- { type: i0.Injectable, args: [{
1448
- providedIn: 'root'
1449
- },] }
1450
- ];
1451
- FormValidatorService.ctorParameters = function () { return []; };
1452
-
1453
1747
  var errorMessages = {
1454
1748
  url: {
1455
1749
  required: "File is required"
@@ -2352,7 +2646,7 @@
2352
2646
  };
2353
2647
 
2354
2648
  var SearchableSelectorComponent_1;
2355
- exports.ɵx = SearchableSelectorComponent_1 = /** @class */ (function () {
2649
+ exports.ɵy = SearchableSelectorComponent_1 = /** @class */ (function () {
2356
2650
  function SearchableSelectorComponent(formBuilder, _focusMonitor, http, _elementRef, dialog, ngControl) {
2357
2651
  var _this = this;
2358
2652
  this._focusMonitor = _focusMonitor;
@@ -2630,8 +2924,8 @@
2630
2924
  };
2631
2925
  return SearchableSelectorComponent;
2632
2926
  }());
2633
- exports.ɵx.nextId = 0;
2634
- exports.ɵx.decorators = [
2927
+ exports.ɵy.nextId = 0;
2928
+ exports.ɵy.decorators = [
2635
2929
  { type: i0.Component, args: [{
2636
2930
  selector: 'app-searchable-selector',
2637
2931
  template: "<div [formGroup]=\"selectorForm\" class=\"searchable-selctor-container\">\n <mat-select formControlName=\"select_value\" focused=\"false\" [multiple]=\"multiple\" [required]=\"required\"\n autocomplete=\"off\" (selectionChange)=\"_handleInput()\" msInfiniteScroll (infiniteScroll)=\"onScroll()\"\n (openedChange)=\"openedChange($event)\">\n <mat-form-field *ngIf=\"enableSearch\" class=\"p-1 w-100\">\n <input matInput formControlName=\"search\" placeholder=\"Search...\" (keydown)=\"$event.stopPropagation();\"\n autocomplete=\"off\">\n </mat-form-field>\n <div>\n <!-- TODO:Implement scroll only for options and have search fixed -->\n <mat-option *ngFor=\" let item of dataItems\" [value]=\"getPropertyValue(item,valueField)\">\n {{getPropertyValue(item,titleField)}}\n </mat-option>\n </div>\n <div fxlayout=\"column\" class=\"w-100\" fxLayoutAlign=\"center center\">\n <mat-spinner class=\"my-4\" color=\"primary\" diameter=\"30\" *ngIf=\"isLoading\"></mat-spinner>\n </div>\n </mat-select>\n <mat-icon *ngIf=\"add\" class=\"relative-icon\" matSuffix (click)=\"addItem($event)\">add_circle_outline</mat-icon>\n <mat-icon *ngIf=\"edit && selectedValue\" class=\"relative-icon\" matSuffix (click)=\"editItem($event)\">edit</mat-icon>\n</div>",
@@ -2644,7 +2938,7 @@
2644
2938
  styles: [".searchable-selctor-container{display:flex}.relative-icon{position:relative;top:-4px}"]
2645
2939
  },] }
2646
2940
  ];
2647
- exports.ɵx.ctorParameters = function () { return [
2941
+ exports.ɵy.ctorParameters = function () { return [
2648
2942
  { type: forms.FormBuilder },
2649
2943
  { type: a11y.FocusMonitor },
2650
2944
  { type: HttpService },
@@ -2652,7 +2946,7 @@
2652
2946
  { type: dialog.MatDialog },
2653
2947
  { type: forms.NgControl, decorators: [{ type: i0.Optional }, { type: i0.Self }] }
2654
2948
  ]; };
2655
- exports.ɵx.propDecorators = {
2949
+ exports.ɵy.propDecorators = {
2656
2950
  valueField: [{ type: i0.Input }],
2657
2951
  titleField: [{ type: i0.Input }],
2658
2952
  apiUrl: [{ type: i0.Input }],
@@ -2679,9 +2973,9 @@
2679
2973
  disabled: [{ type: i0.Input }],
2680
2974
  value: [{ type: i0.Input }]
2681
2975
  };
2682
- exports.ɵx = SearchableSelectorComponent_1 = __decorate([
2976
+ exports.ɵy = SearchableSelectorComponent_1 = __decorate([
2683
2977
  untilDestroy.UntilDestroy()
2684
- ], exports.ɵx);
2978
+ ], exports.ɵy);
2685
2979
 
2686
2980
  var MatSelectInfiniteScrollDirective = /** @class */ (function () {
2687
2981
  function MatSelectInfiniteScrollDirective(matSelect, ngZone) {
@@ -3003,7 +3297,7 @@
3003
3297
  }
3004
3298
 
3005
3299
  var TimelineFilterComponent_1;
3006
- exports.ɵbb = TimelineFilterComponent_1 = /** @class */ (function () {
3300
+ exports.ɵbc = TimelineFilterComponent_1 = /** @class */ (function () {
3007
3301
  function TimelineFilterComponent(formBuilder, ngControl, datePipe) {
3008
3302
  this.ngControl = ngControl;
3009
3303
  this.datePipe = datePipe;
@@ -3101,454 +3395,147 @@
3101
3395
  var str = "";
3102
3396
  if ((_a = this.selectedRange) === null || _a === void 0 ? void 0 : _a.show_custom_field) {
3103
3397
  if (((_b = this.selectedRange) === null || _b === void 0 ? void 0 : _b.date_from.toUTCString()) != 'Invalid Date') {
3104
- 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());
3105
- }
3106
- if (((_e = this.selectedRange) === null || _e === void 0 ? void 0 : _e.date_to.toUTCString()) != 'Invalid Date') {
3107
- 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());
3108
- }
3109
- }
3110
- return str;
3111
- };
3112
- TimelineFilterComponent.prototype.resetFieldValue = function (field) {
3113
- this.form.get(field).setValue('');
3114
- };
3115
- TimelineFilterComponent.prototype.getFieldValue = function (field) {
3116
- return this.form.get(field).value;
3117
- };
3118
- TimelineFilterComponent.prototype.setFieldValue = function (field, value) {
3119
- this.form.get(field).setValue(value);
3120
- };
3121
- TimelineFilterComponent.prototype.changeTimeline = function (value) {
3122
- var timeline = calculateTimeline(value);
3123
- if (timeline) {
3124
- this.setFieldValue(this.dateFrom, timeline.date_from);
3125
- this.setFieldValue(this.dateTo, timeline.date_to);
3126
- this.showCustomDateFields = timeline.show_custom_field;
3127
- }
3128
- };
3129
- TimelineFilterComponent.prototype._handleInput = function () {
3130
- if (this.value == 1) {
3131
- this.picker.open();
3132
- return;
3133
- }
3134
- var range = calculateTimeline(this.value);
3135
- this.selectedRange = range;
3136
- this.onChange(this.value);
3137
- this.selectedValueChange.emit(this.selectedValue);
3138
- this.selectionChange.emit(range);
3139
- };
3140
- TimelineFilterComponent.prototype.dateRangeChange = function (dateRangeStart, dateRangeEnd) {
3141
- var range = {
3142
- date_from: new Date(dateRangeStart.value),
3143
- date_to: new Date(dateRangeEnd.value),
3144
- show_custom_field: true
3145
- };
3146
- this.selectedRange = range;
3147
- this.onChange(this.value);
3148
- this.selectedValueChange.emit(this.selectedValue);
3149
- this.selectionChange.emit(range);
3150
- };
3151
- TimelineFilterComponent.prototype.onCustomDateChange = function (event) {
3152
- };
3153
- TimelineFilterComponent.prototype.setDescribedByIds = function (ids) {
3154
- this.describedBy = ids.join(' ');
3155
- };
3156
- TimelineFilterComponent.prototype.onContainerClick = function (event) {
3157
- event.stopPropagation();
3158
- };
3159
- TimelineFilterComponent.prototype.writeValue = function (data) {
3160
- this.value = data;
3161
- };
3162
- TimelineFilterComponent.prototype.registerOnChange = function (fn) {
3163
- this.onChange = fn;
3164
- };
3165
- TimelineFilterComponent.prototype.registerOnTouched = function (fn) {
3166
- this.onTouched = fn;
3167
- };
3168
- TimelineFilterComponent.prototype.setDisabledState = function (isDisabled) {
3169
- this.disabled = isDisabled;
3170
- };
3171
- TimelineFilterComponent.prototype.ngOnInit = function () {
3172
- var _this = this;
3173
- console.log(this.form);
3174
- this.timelineValue.valueChanges.
3175
- pipe(operators.debounceTime(100), operators.distinctUntilChanged(), untilDestroy.untilDestroyed(this)).subscribe(function (value) { return _this.changeTimeline(value); });
3176
- };
3177
- TimelineFilterComponent.prototype.ngOnDestroy = function () {
3178
- this.stateChanges.complete();
3179
- };
3180
- return TimelineFilterComponent;
3181
- }());
3182
- exports.ɵbb.nextId = 0;
3183
- exports.ɵbb.decorators = [
3184
- { type: i0.Component, args: [{
3185
- selector: 'app-timeline-filter',
3186
- 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",
3187
- providers: [
3188
- {
3189
- provide: formField.MatFormFieldControl,
3190
- useExisting: TimelineFilterComponent_1
3191
- }
3192
- ],
3193
- styles: [""]
3194
- },] }
3195
- ];
3196
- exports.ɵbb.ctorParameters = function () { return [
3197
- { type: forms.FormBuilder },
3198
- { type: forms.NgControl, decorators: [{ type: i0.Optional }, { type: i0.Self }] },
3199
- { type: common.DatePipe }
3200
- ]; };
3201
- exports.ɵbb.propDecorators = {
3202
- picker: [{ type: i0.ViewChild, args: ['picker',] }],
3203
- timelineValue: [{ type: i0.Input }],
3204
- timelines: [{ type: i0.Input }],
3205
- dateFrom: [{ type: i0.Input }],
3206
- dateTo: [{ type: i0.Input }],
3207
- appearance: [{ type: i0.Input }],
3208
- showClearbutton: [{ type: i0.Input }],
3209
- form: [{ type: i0.Input }],
3210
- labelText: [{ type: i0.Input }],
3211
- selectedValue: [{ type: i0.Input }],
3212
- touchUi: [{ type: i0.Input }],
3213
- selectedValueChange: [{ type: i0.Output }],
3214
- selectionChange: [{ type: i0.Output }],
3215
- defaultValue: [{ type: i0.Input }],
3216
- required: [{ type: i0.Input }],
3217
- disabled: [{ type: i0.Input }],
3218
- value: [{ type: i0.Input }]
3219
- };
3220
- exports.ɵbb = TimelineFilterComponent_1 = __decorate([
3221
- untilDestroy.UntilDestroy()
3222
- ], exports.ɵbb);
3223
-
3224
- var LoaderComponent = /** @class */ (function () {
3225
- function LoaderComponent() {
3226
- this.isLoading = false;
3227
- this.size = 0.6;
3228
- }
3229
- LoaderComponent.prototype.ngOnInit = function () { };
3230
- return LoaderComponent;
3231
- }());
3232
- LoaderComponent.decorators = [
3233
- { type: i0.Component, args: [{
3234
- selector: 'app-loader',
3235
- template: "<div [hidden]=\"!isLoading\">\n <mat-progress-spinner mode=\"indeterminate\" [strokeWidth]=\"2\" [diameter]=\"32 * size\"></mat-progress-spinner>\n <span class=\"message\">{{message}}</span>\n</div>\n",
3236
- styles: [".mat-progress-spinner{display:inline-block;vertical-align:middle}.message{margin-left:.5em}"]
3237
- },] }
3238
- ];
3239
- LoaderComponent.ctorParameters = function () { return []; };
3240
- LoaderComponent.propDecorators = {
3241
- isLoading: [{ type: i0.Input }],
3242
- size: [{ type: i0.Input }],
3243
- message: [{ type: i0.Input }]
3244
- };
3245
-
3246
- var SnackModule = /** @class */ (function () {
3247
- function SnackModule() {
3248
- }
3249
- return SnackModule;
3250
- }());
3251
- SnackModule.decorators = [
3252
- { type: i0.NgModule, args: [{
3253
- declarations: [
3254
- SuccessSnackComponent,
3255
- ErrorSnackComponent
3256
- ],
3257
- imports: [
3258
- common.CommonModule,
3259
- i1.MatSnackBarModule,
3260
- icon.MatIconModule
3261
- ],
3262
- exports: [
3263
- SuccessSnackComponent,
3264
- ErrorSnackComponent,
3265
- ]
3266
- },] }
3267
- ];
3268
-
3269
- var log$2 = new Logger('AuthenticationGuard');
3270
- var AuthenticationGuard = /** @class */ (function () {
3271
- function AuthenticationGuard(router, credentialsService) {
3272
- this.router = router;
3273
- this.credentialsService = credentialsService;
3274
- }
3275
- AuthenticationGuard.prototype.canActivate = function (route, state) {
3276
- return this.isUserAuthenticated(route, state);
3277
- };
3278
- AuthenticationGuard.prototype.canLoad = function (route, state) {
3279
- return this.isUserAuthenticated(route, state);
3280
- };
3281
- AuthenticationGuard.prototype.isUserAuthenticated = function (route, state) {
3282
- if (this.credentialsService.isAuthenticated) {
3283
- return true;
3284
- }
3285
- log$2.debug('Not authenticated, redirecting and adding redirect url...');
3286
- this.router.navigate(['/login'], { queryParams: { redirect: state.url }, replaceUrl: true });
3287
- return false;
3288
- };
3289
- return AuthenticationGuard;
3290
- }());
3291
- AuthenticationGuard.ɵprov = i0.ɵɵdefineInjectable({ factory: function AuthenticationGuard_Factory() { return new AuthenticationGuard(i0.ɵɵinject(i1$2.Router), i0.ɵɵinject(CredentialsService)); }, token: AuthenticationGuard, providedIn: "root" });
3292
- AuthenticationGuard.decorators = [
3293
- { type: i0.Injectable, args: [{
3294
- providedIn: 'root'
3295
- },] }
3296
- ];
3297
- AuthenticationGuard.ctorParameters = function () { return [
3298
- { type: i1$2.Router },
3299
- { type: CredentialsService }
3300
- ]; };
3301
-
3302
- /**
3303
- * Provides a base for authentication workflow.
3304
- * The login/logout methods should be replaced with proper implementation.
3305
- */
3306
- var AuthenticationService = /** @class */ (function () {
3307
- function AuthenticationService(credentialsService, http) {
3308
- this.credentialsService = credentialsService;
3309
- this.http = http;
3310
- }
3311
- /**
3312
- * Authenticates the user.
3313
- * @param context The login parameters.
3314
- * @return The user credentials.
3315
- */
3316
- AuthenticationService.prototype.login = function (context) {
3317
- var _this = this;
3318
- var data = {};
3319
- return this.http
3320
- .skipToken()
3321
- .post('oauth/token', context)
3322
- .pipe(operators.concatMap(function (tokenInfo) { return __awaiter(_this, void 0, void 0, function () {
3323
- var userInfo;
3324
- return __generator(this, function (_a) {
3325
- switch (_a.label) {
3326
- case 0:
3327
- tokenInfo.expires_in = Date.now() + (tokenInfo.expires_in * 1000);
3328
- data.token = tokenInfo;
3329
- data.user = {};
3330
- this.credentialsService.setCredentials(data, context.remember);
3331
- return [4 /*yield*/, this.http.get('api/user/current').toPromise()];
3332
- case 1:
3333
- userInfo = _a.sent();
3334
- data.user = userInfo === null || userInfo === void 0 ? void 0 : userInfo.user;
3335
- this.credentialsService.setCredentials(data, context.remember);
3336
- return [2 /*return*/, data];
3337
- }
3338
- });
3339
- }); }));
3340
- };
3341
- /**
3342
- * Logs out the user and clear credentials.
3343
- * @return True if the user was logged out successfully.
3344
- */
3345
- AuthenticationService.prototype.logout = function () {
3346
- this.credentialsService.setCredentials();
3347
- return rxjs.of(true);
3348
- };
3349
- return AuthenticationService;
3350
- }());
3351
- AuthenticationService.ɵprov = i0.ɵɵdefineInjectable({ factory: function AuthenticationService_Factory() { return new AuthenticationService(i0.ɵɵinject(CredentialsService), i0.ɵɵinject(HttpService)); }, token: AuthenticationService, providedIn: "root" });
3352
- AuthenticationService.decorators = [
3353
- { type: i0.Injectable, args: [{
3354
- providedIn: 'root'
3355
- },] }
3356
- ];
3357
- AuthenticationService.ctorParameters = function () { return [
3358
- { type: CredentialsService },
3359
- { type: HttpService }
3360
- ]; };
3361
-
3362
- /**
3363
- * A route strategy allowing for explicit route reuse.
3364
- * Used as a workaround for https://github.com/angular/angular/issues/18374
3365
- * To reuse a given route, add `data: { reuse: true }` to the route definition.
3366
- */
3367
- var RouteReusableStrategy = /** @class */ (function (_super) {
3368
- __extends(RouteReusableStrategy, _super);
3369
- function RouteReusableStrategy() {
3370
- return _super !== null && _super.apply(this, arguments) || this;
3371
- }
3372
- RouteReusableStrategy.prototype.shouldDetach = function (route) {
3373
- return false;
3374
- };
3375
- RouteReusableStrategy.prototype.store = function (route, detachedTree) { };
3376
- RouteReusableStrategy.prototype.shouldAttach = function (route) {
3377
- return false;
3378
- };
3379
- RouteReusableStrategy.prototype.retrieve = function (route) {
3380
- return null;
3381
- };
3382
- RouteReusableStrategy.prototype.shouldReuseRoute = function (future, curr) {
3383
- var _a, _b, _c;
3384
- // Reuse the route if the RouteConfig is the same, or if both routes use the
3385
- // same component, because the latter can have different RouteConfigs.
3386
- return future.routeConfig === curr.routeConfig ||
3387
- Boolean(((_a = future.routeConfig) === null || _a === void 0 ? void 0 : _a.component) &&
3388
- ((_b = future.routeConfig) === null || _b === void 0 ? void 0 : _b.component) === ((_c = curr.routeConfig) === null || _c === void 0 ? void 0 : _c.component));
3389
- };
3390
- return RouteReusableStrategy;
3391
- }(i1$2.RouteReuseStrategy));
3392
- RouteReusableStrategy.ɵprov = i0.ɵɵdefineInjectable({ factory: function RouteReusableStrategy_Factory() { return new RouteReusableStrategy(); }, token: RouteReusableStrategy, providedIn: "root" });
3393
- RouteReusableStrategy.decorators = [
3394
- { type: i0.Injectable, args: [{
3395
- providedIn: 'root'
3396
- },] }
3397
- ];
3398
-
3399
- /**
3400
- * Service used to manage Local Storage
3401
- *
3402
- * @author Joshua Kissoon
3403
- * @since 20190623
3404
- */
3405
- var StorageService = /** @class */ (function () {
3406
- function StorageService() {
3407
- this.storageSub = new rxjs.Subject();
3408
- }
3409
- StorageService.prototype.watch = function () {
3410
- return this.storageSub.asObservable();
3411
- };
3412
- StorageService.prototype.setItem = function (key, data) {
3413
- localStorage.setItem(key, data);
3414
- this.storageSub.next({ key: key, value: data });
3415
- };
3416
- StorageService.prototype.getItem = function (key) {
3417
- return localStorage.getItem(key);
3418
- };
3419
- StorageService.prototype.removeItem = function (key) {
3420
- var data = this.getItem(key);
3421
- localStorage.removeItem(key);
3422
- this.storageSub.next({ key: key, value: data });
3423
- };
3424
- return StorageService;
3425
- }());
3426
- StorageService.ɵprov = i0.ɵɵdefineInjectable({ factory: function StorageService_Factory() { return new StorageService(); }, token: StorageService, providedIn: "root" });
3427
- StorageService.decorators = [
3428
- { type: i0.Injectable, args: [{
3429
- providedIn: 'root'
3430
- },] }
3431
- ];
3432
- StorageService.ctorParameters = function () { return []; };
3433
-
3434
- /**
3435
- * Service that provides a wrapper for retrieving data from the server
3436
- * @deprecated use HttpService Instead
3437
- * @author Joshua Kissoon
3438
- * @since 20170709
3439
- */
3440
- var DataManager = /** @class */ (function () {
3441
- function DataManager(http) {
3442
- this.http = http;
3443
- }
3444
- /**
3445
- * Callback wrapper for the HTTP GET Call
3446
- *
3447
- * @param urlq The query part of the URL to be sent to the server
3448
- *
3449
- * @author Joshua Kissoon
3450
- * @since 20160826
3451
- * @updated 20170711 to add parameters
3452
- */
3453
- DataManager.prototype.GET = function (urlq, params) {
3454
- if (params === void 0) { params = {}; }
3455
- return this.http
3456
- .get(urlq, { params: params })
3457
- .toPromise();
3458
- };
3459
- /**
3460
- * Callback wrapper for the HTTP POST Call
3461
- *
3462
- * @param urlq The query part of the URL to be sent to the server
3463
- * @param object The object containing the POST data to be sent
3464
- *
3465
- * @author Joshua Kissoon
3466
- * @since 20160826
3467
- */
3468
- DataManager.prototype.POST = function (urlq, object) {
3469
- if (null == object) {
3470
- object = { "blank": "blank" };
3398
+ 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());
3399
+ }
3400
+ if (((_e = this.selectedRange) === null || _e === void 0 ? void 0 : _e.date_to.toUTCString()) != 'Invalid Date') {
3401
+ 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());
3402
+ }
3471
3403
  }
3472
- return this.http
3473
- .post(urlq, object)
3474
- .toPromise();
3404
+ return str;
3475
3405
  };
3476
- /**
3477
- * Callback wrapper for the HTTP POST Call
3478
- *
3479
- * @param urlq The query part of the URL to be sent to the server
3480
- * @param object The object containing the POST data to be sent
3481
- *
3482
- * @author Joshua Kissoon
3483
- * @since 20160826
3484
- */
3485
- DataManager.prototype.POSTRAW = function (urlq, object) {
3486
- if (null == object) {
3487
- object = { "blank": "blank" };
3488
- }
3489
- return this.http
3490
- .skipHeader()
3491
- .post(urlq, object)
3492
- .toPromise();
3406
+ TimelineFilterComponent.prototype.resetFieldValue = function (field) {
3407
+ this.form.get(field).setValue('');
3493
3408
  };
3494
- /**
3495
- * Callback wrapper for the HTTP PUT Call
3496
- *
3497
- * @param urlq The query part of the URL to be sent to the server
3498
- * @param object The object containing the PUT data to be sent
3499
- *
3500
- * @author Joshua Kissoon
3501
- * @since 20160826
3502
- */
3503
- DataManager.prototype.PUT = function (urlq, object) {
3504
- if (null == object) {
3505
- object = { "blank": "blank" };
3409
+ TimelineFilterComponent.prototype.getFieldValue = function (field) {
3410
+ return this.form.get(field).value;
3411
+ };
3412
+ TimelineFilterComponent.prototype.setFieldValue = function (field, value) {
3413
+ this.form.get(field).setValue(value);
3414
+ };
3415
+ TimelineFilterComponent.prototype.changeTimeline = function (value) {
3416
+ var timeline = calculateTimeline(value);
3417
+ if (timeline) {
3418
+ this.setFieldValue(this.dateFrom, timeline.date_from);
3419
+ this.setFieldValue(this.dateTo, timeline.date_to);
3420
+ this.showCustomDateFields = timeline.show_custom_field;
3506
3421
  }
3507
- return this.http
3508
- .put(urlq, object)
3509
- .toPromise();
3510
3422
  };
3511
- /**
3512
- * Callback wrapper for the HTTP PATCH Call
3513
- *
3514
- * @param urlq The query part of the URL to be sent to the server
3515
- * @param object The object containing the PUT data to be sent
3516
- *
3517
- * @author Joshua Kissoon
3518
- * @since 20161107
3519
- */
3520
- DataManager.prototype.PATCH = function (urlq, object) {
3521
- if (null == object) {
3522
- object = { "blank": "blank" };
3423
+ TimelineFilterComponent.prototype._handleInput = function () {
3424
+ if (this.value == 1) {
3425
+ this.picker.open();
3426
+ return;
3523
3427
  }
3524
- return this.http
3525
- .patch(urlq, object)
3526
- .toPromise();
3428
+ var range = calculateTimeline(this.value);
3429
+ this.selectedRange = range;
3430
+ this.onChange(this.value);
3431
+ this.selectedValueChange.emit(this.selectedValue);
3432
+ this.selectionChange.emit(range);
3527
3433
  };
3528
- /**
3529
- * Callback wrapper for the HTTP DELETE Call
3530
- *
3531
- * @param urlq The query part of the URL to be sent to the server
3532
- *
3533
- * @author Joshua Kissoon
3534
- * @since 20160826
3535
- */
3536
- DataManager.prototype.DELETE = function (urlq) {
3537
- return this.http
3538
- .delete(urlq)
3539
- .toPromise();
3434
+ TimelineFilterComponent.prototype.dateRangeChange = function (dateRangeStart, dateRangeEnd) {
3435
+ var range = {
3436
+ date_from: new Date(dateRangeStart.value),
3437
+ date_to: new Date(dateRangeEnd.value),
3438
+ show_custom_field: true
3439
+ };
3440
+ this.selectedRange = range;
3441
+ this.onChange(this.value);
3442
+ this.selectedValueChange.emit(this.selectedValue);
3443
+ this.selectionChange.emit(range);
3540
3444
  };
3541
- return DataManager;
3445
+ TimelineFilterComponent.prototype.onCustomDateChange = function (event) {
3446
+ };
3447
+ TimelineFilterComponent.prototype.setDescribedByIds = function (ids) {
3448
+ this.describedBy = ids.join(' ');
3449
+ };
3450
+ TimelineFilterComponent.prototype.onContainerClick = function (event) {
3451
+ event.stopPropagation();
3452
+ };
3453
+ TimelineFilterComponent.prototype.writeValue = function (data) {
3454
+ this.value = data;
3455
+ };
3456
+ TimelineFilterComponent.prototype.registerOnChange = function (fn) {
3457
+ this.onChange = fn;
3458
+ };
3459
+ TimelineFilterComponent.prototype.registerOnTouched = function (fn) {
3460
+ this.onTouched = fn;
3461
+ };
3462
+ TimelineFilterComponent.prototype.setDisabledState = function (isDisabled) {
3463
+ this.disabled = isDisabled;
3464
+ };
3465
+ TimelineFilterComponent.prototype.ngOnInit = function () {
3466
+ var _this = this;
3467
+ console.log(this.form);
3468
+ this.timelineValue.valueChanges.
3469
+ pipe(operators.debounceTime(100), operators.distinctUntilChanged(), untilDestroy.untilDestroyed(this)).subscribe(function (value) { return _this.changeTimeline(value); });
3470
+ };
3471
+ TimelineFilterComponent.prototype.ngOnDestroy = function () {
3472
+ this.stateChanges.complete();
3473
+ };
3474
+ return TimelineFilterComponent;
3542
3475
  }());
3543
- DataManager.ɵprov = i0.ɵɵdefineInjectable({ factory: function DataManager_Factory() { return new DataManager(i0.ɵɵinject(HttpService)); }, token: DataManager, providedIn: "root" });
3544
- DataManager.decorators = [
3545
- { type: i0.Injectable, args: [{
3546
- providedIn: 'root'
3476
+ exports.ɵbc.nextId = 0;
3477
+ exports.ɵbc.decorators = [
3478
+ { type: i0.Component, args: [{
3479
+ selector: 'app-timeline-filter',
3480
+ 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",
3481
+ providers: [
3482
+ {
3483
+ provide: formField.MatFormFieldControl,
3484
+ useExisting: TimelineFilterComponent_1
3485
+ }
3486
+ ],
3487
+ styles: [""]
3547
3488
  },] }
3548
3489
  ];
3549
- DataManager.ctorParameters = function () { return [
3550
- { type: HttpService }
3490
+ exports.ɵbc.ctorParameters = function () { return [
3491
+ { type: forms.FormBuilder },
3492
+ { type: forms.NgControl, decorators: [{ type: i0.Optional }, { type: i0.Self }] },
3493
+ { type: common.DatePipe }
3551
3494
  ]; };
3495
+ exports.ɵbc.propDecorators = {
3496
+ picker: [{ type: i0.ViewChild, args: ['picker',] }],
3497
+ timelineValue: [{ type: i0.Input }],
3498
+ timelines: [{ type: i0.Input }],
3499
+ dateFrom: [{ type: i0.Input }],
3500
+ dateTo: [{ type: i0.Input }],
3501
+ appearance: [{ type: i0.Input }],
3502
+ showClearbutton: [{ type: i0.Input }],
3503
+ form: [{ type: i0.Input }],
3504
+ labelText: [{ type: i0.Input }],
3505
+ selectedValue: [{ type: i0.Input }],
3506
+ touchUi: [{ type: i0.Input }],
3507
+ selectedValueChange: [{ type: i0.Output }],
3508
+ selectionChange: [{ type: i0.Output }],
3509
+ defaultValue: [{ type: i0.Input }],
3510
+ required: [{ type: i0.Input }],
3511
+ disabled: [{ type: i0.Input }],
3512
+ value: [{ type: i0.Input }]
3513
+ };
3514
+ exports.ɵbc = TimelineFilterComponent_1 = __decorate([
3515
+ untilDestroy.UntilDestroy()
3516
+ ], exports.ɵbc);
3517
+
3518
+ var LoaderComponent = /** @class */ (function () {
3519
+ function LoaderComponent() {
3520
+ this.isLoading = false;
3521
+ this.size = 0.6;
3522
+ }
3523
+ LoaderComponent.prototype.ngOnInit = function () { };
3524
+ return LoaderComponent;
3525
+ }());
3526
+ LoaderComponent.decorators = [
3527
+ { type: i0.Component, args: [{
3528
+ selector: 'app-loader',
3529
+ template: "<div [hidden]=\"!isLoading\">\n <mat-progress-spinner mode=\"indeterminate\" [strokeWidth]=\"2\" [diameter]=\"32 * size\"></mat-progress-spinner>\n <span class=\"message\">{{message}}</span>\n</div>\n",
3530
+ styles: [".mat-progress-spinner{display:inline-block;vertical-align:middle}.message{margin-left:.5em}"]
3531
+ },] }
3532
+ ];
3533
+ LoaderComponent.ctorParameters = function () { return []; };
3534
+ LoaderComponent.propDecorators = {
3535
+ isLoading: [{ type: i0.Input }],
3536
+ size: [{ type: i0.Input }],
3537
+ message: [{ type: i0.Input }]
3538
+ };
3552
3539
 
3553
3540
  var MaterialModule = /** @class */ (function () {
3554
3541
  function MaterialModule() {
@@ -3599,17 +3586,17 @@
3599
3586
  { type: i0.NgModule, args: [{
3600
3587
  imports: [
3601
3588
  common.CommonModule,
3602
- i1$1.HttpClientModule,
3603
- i1$2.RouterModule,
3589
+ i1$2.HttpClientModule,
3590
+ i1$1.RouterModule,
3604
3591
  SnackModule
3605
3592
  ],
3606
3593
  providers: [
3607
3594
  {
3608
- provide: i1$1.HttpClient,
3595
+ provide: i1$2.HttpClient,
3609
3596
  useClass: HttpService
3610
3597
  },
3611
3598
  {
3612
- provide: i1$2.RouteReuseStrategy,
3599
+ provide: i1$1.RouteReuseStrategy,
3613
3600
  useClass: RouteReusableStrategy
3614
3601
  }
3615
3602
  ],
@@ -3839,11 +3826,11 @@
3839
3826
  MaterialModule
3840
3827
  ],
3841
3828
  declarations: [
3842
- exports.ɵx,
3829
+ exports.ɵy,
3843
3830
  MatSelectInfiniteScrollDirective
3844
3831
  ],
3845
3832
  exports: [
3846
- exports.ɵx,
3833
+ exports.ɵy,
3847
3834
  MatSelectInfiniteScrollDirective
3848
3835
  ]
3849
3836
  },] }
@@ -3875,8 +3862,8 @@
3875
3862
  }());
3876
3863
  TimelineFilterRoutingModule.decorators = [
3877
3864
  { type: i0.NgModule, args: [{
3878
- imports: [i1$2.RouterModule.forChild(routes)],
3879
- exports: [i1$2.RouterModule]
3865
+ imports: [i1$1.RouterModule.forChild(routes)],
3866
+ exports: [i1$1.RouterModule]
3880
3867
  },] }
3881
3868
  ];
3882
3869
 
@@ -3887,7 +3874,7 @@
3887
3874
  }());
3888
3875
  TimelineFilterModule.decorators = [
3889
3876
  { type: i0.NgModule, args: [{
3890
- declarations: [exports.ɵbb],
3877
+ declarations: [exports.ɵbc],
3891
3878
  imports: [
3892
3879
  common.CommonModule,
3893
3880
  TimelineFilterRoutingModule,
@@ -3895,7 +3882,7 @@
3895
3882
  MaterialModule,
3896
3883
  forms.ReactiveFormsModule
3897
3884
  ],
3898
- exports: [exports.ɵbb]
3885
+ exports: [exports.ɵbc]
3899
3886
  },] }
3900
3887
  ];
3901
3888
 
@@ -3927,8 +3914,8 @@
3927
3914
  }());
3928
3915
  EmailSubscriptionRoutingModule.decorators = [
3929
3916
  { type: i0.NgModule, args: [{
3930
- imports: [i1$2.RouterModule.forChild(routes$1)],
3931
- exports: [i1$2.RouterModule]
3917
+ imports: [i1$1.RouterModule.forChild(routes$1)],
3918
+ exports: [i1$1.RouterModule]
3932
3919
  },] }
3933
3920
  ];
3934
3921
 
@@ -3955,8 +3942,8 @@
3955
3942
  }());
3956
3943
  EmailSubscriptionUserRoutingModule.decorators = [
3957
3944
  { type: i0.NgModule, args: [{
3958
- imports: [i1$2.RouterModule.forChild(routes$2)],
3959
- exports: [i1$2.RouterModule]
3945
+ imports: [i1$1.RouterModule.forChild(routes$2)],
3946
+ exports: [i1$1.RouterModule]
3960
3947
  },] }
3961
3948
  ];
3962
3949
 
@@ -3983,8 +3970,8 @@
3983
3970
  }());
3984
3971
  EmailSubscriptionUserFormRoutingModule.decorators = [
3985
3972
  { type: i0.NgModule, args: [{
3986
- imports: [i1$2.RouterModule.forChild(routes$3)],
3987
- exports: [i1$2.RouterModule]
3973
+ imports: [i1$1.RouterModule.forChild(routes$3)],
3974
+ exports: [i1$1.RouterModule]
3988
3975
  },] }
3989
3976
  ];
3990
3977
 
@@ -3997,7 +3984,7 @@
3997
3984
  required: "Email Type is required"
3998
3985
  },
3999
3986
  };
4000
- exports.ɵbe = /** @class */ (function () {
3987
+ exports.ɵbf = /** @class */ (function () {
4001
3988
  function EmailSubscriptionUserFormComponent(fb, formValidatorService, alertService, dialogRef, data, http) {
4002
3989
  this.fb = fb;
4003
3990
  this.formValidatorService = formValidatorService;
@@ -4059,14 +4046,14 @@
4059
4046
  };
4060
4047
  return EmailSubscriptionUserFormComponent;
4061
4048
  }());
4062
- exports.ɵbe.decorators = [
4049
+ exports.ɵbf.decorators = [
4063
4050
  { type: i0.Component, args: [{
4064
4051
  selector: 'app-email-subscription-user-form',
4065
4052
  template: "<form [formGroup]=\"esUserFormGroup\" (ngSubmit)=\"submit()\" class=\"mat-typography\">\n <div fxLayout=\"column\">\n <div mat-dialog-title class=\"text-center\">\n <div>Email Subscription User</div>\n </div>\n\n <div mat-dialog-content fxLayout=\"column\">\n <div fxLayout=\"row wrap\" fxLayoutAlign=\"space-between center\">\n\n <mat-form-field fxFlex=\"48%\" class=\"mt-1\">\n <mat-label>User</mat-label>\n <app-searchable-selector formControlName=\"user_id\" apiUrl=\"api/users\" titleField=\"name\" required\n [selectedValue]=\"selectedUser\">\n </app-searchable-selector>\n <mat-error *ngIf=\"isFieldValid('user_id')\">{{getErrorMessage('user_id')}}</mat-error>\n </mat-form-field>\n\n <mat-form-field fxFlex=\"48%\" class=\"mt-1\">\n <mat-label>Email Type</mat-label>\n <app-searchable-selector formControlName=\"email_type_id\" apiUrl=\"api/email-subscription-types\"\n required [selectedValue]=\"selectedType\">\n </app-searchable-selector>\n <mat-error *ngIf=\"isFieldValid('email_type_id')\">{{getErrorMessage('email_type_id')}}</mat-error>\n </mat-form-field>\n\n <div class=\"my-2\" fxLayout=\"row\" fxLayoutGap=\"30px\" fxLayoutAlign=\"end\" fxFlex=\"100%\">\n <button mat-raised-button type=\"button\" (click)=\"cancel()\">Cancel</button>\n <button mat-raised-button type=\"submit\" color=\"primary\" [disabled]=\"isSubmitLoading\">\n <app-loader class=\"inline-loader\" [isLoading]=\"isSubmitLoading\"></app-loader>\n Save\n </button>\n </div>\n </div>\n </div>\n\n\n </div>\n</form>",
4066
4053
  styles: [""]
4067
4054
  },] }
4068
4055
  ];
4069
- exports.ɵbe.ctorParameters = function () { return [
4056
+ exports.ɵbf.ctorParameters = function () { return [
4070
4057
  { type: forms.FormBuilder },
4071
4058
  { type: FormValidatorService },
4072
4059
  { type: AlertService },
@@ -4074,9 +4061,9 @@
4074
4061
  { type: undefined, decorators: [{ type: i0.Inject, args: [dialog.MAT_DIALOG_DATA,] }] },
4075
4062
  { type: HttpService }
4076
4063
  ]; };
4077
- exports.ɵbe = __decorate([
4064
+ exports.ɵbf = __decorate([
4078
4065
  untilDestroy.UntilDestroy()
4079
- ], exports.ɵbe);
4066
+ ], exports.ɵbf);
4080
4067
 
4081
4068
  var EmailSubscriptionUserFormModule = /** @class */ (function () {
4082
4069
  function EmailSubscriptionUserFormModule() {
@@ -4085,7 +4072,7 @@
4085
4072
  }());
4086
4073
  EmailSubscriptionUserFormModule.decorators = [
4087
4074
  { type: i0.NgModule, args: [{
4088
- declarations: [exports.ɵbe],
4075
+ declarations: [exports.ɵbf],
4089
4076
  imports: [
4090
4077
  common.CommonModule,
4091
4078
  MaterialModule,
@@ -4095,12 +4082,12 @@
4095
4082
  EmailSubscriptionUserFormRoutingModule,
4096
4083
  LoaderModule
4097
4084
  ],
4098
- entryComponents: [exports.ɵbe]
4085
+ entryComponents: [exports.ɵbf]
4099
4086
  },] }
4100
4087
  ];
4101
4088
 
4102
4089
  var log$4 = new Logger('EmailSubscriptionUser list');
4103
- exports.ɵbf = /** @class */ (function () {
4090
+ exports.ɵbg = /** @class */ (function () {
4104
4091
  function EmailSubscriptionUserListComponent(dialog, http, router) {
4105
4092
  this.dialog = dialog;
4106
4093
  this.http = http;
@@ -4161,7 +4148,7 @@
4161
4148
  };
4162
4149
  EmailSubscriptionUserListComponent.prototype.addEmailSubscriptionUser = function () {
4163
4150
  var _this = this;
4164
- var dialogRef = this.dialog.open(exports.ɵbe, {
4151
+ var dialogRef = this.dialog.open(exports.ɵbf, {
4165
4152
  width: '800px',
4166
4153
  autoFocus: false,
4167
4154
  data: {} // Any data passed here will be injected into the model
@@ -4176,7 +4163,7 @@
4176
4163
  EmailSubscriptionUserListComponent.prototype.editEmailSubscriptionUser = function (event, esUser) {
4177
4164
  var _this = this;
4178
4165
  event.stopPropagation();
4179
- var dialogRef = this.dialog.open(exports.ɵbe, {
4166
+ var dialogRef = this.dialog.open(exports.ɵbf, {
4180
4167
  width: '800px',
4181
4168
  autoFocus: false,
4182
4169
  data: {
@@ -4234,24 +4221,24 @@
4234
4221
  };
4235
4222
  return EmailSubscriptionUserListComponent;
4236
4223
  }());
4237
- exports.ɵbf.decorators = [
4224
+ exports.ɵbg.decorators = [
4238
4225
  { type: i0.Component, args: [{
4239
4226
  selector: 'app-email-subscription-user-list',
4240
4227
  template: "<div class=\"mat-typography m-4\">\n <div fxLayout=\"row\" fxLayoutAlign=\"start center\">\n <app-email-subscription-user-list-filter (valueChange)=\"filterChange($event)\">\n </app-email-subscription-user-list-filter>\n <div class=\"ml-2\">\n <button mat-raised-button color=\"primary\" type=\"button\" (click)=\"addEmailSubscriptionUser()\">+\n User Subscription</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\n\n <section>\n <div class=\"scroll-container\" infiniteScroll [infiniteScrollDistance]=\"2\" [infiniteScrollThrottle]=\"50\"\n (scrolled)=\"onScroll()\" [scrollWindow]=\"false\">\n <table mat-table [dataSource]=\"esUserList\" matSort class=\"w-100 mt-1\" multiTemplateDataRows\n id=\"email-subscription-user-table\">\n\n <!-- Index Column -->\n <ng-container matColumnDef=\"index\">\n <th mat-header-cell *matHeaderCellDef> # </th>\n <td mat-cell *matCellDef=\"let esUser; let i = dataIndex\"> {{ i+1 }} </td>\n </ng-container>\n <ng-container matColumnDef=\"user.name\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header> User </th>\n <td mat-cell *matCellDef=\"let esUser;\"> {{ esUser?.user?.name }} </td>\n </ng-container>\n\n <ng-container matColumnDef=\"email_type.title\">\n <th mat-header-cell *matHeaderCellDef> Email Type </th>\n <td mat-cell *matCellDef=\"let esUser;\"> {{ esUser?.email_type?.title }} </td>\n </ng-container>\n\n <ng-container matColumnDef=\"creator.name\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header> Creator</th>\n <td mat-cell *matCellDef=\"let esUser;\">\n {{esUser?.creator?.name }}\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"created_at\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header> Created On</th>\n <td mat-cell *matCellDef=\"let esUser;\">\n {{esUser?.created_at | date:'medium' }}\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 esUser\">\n <button type=\"button\" mat-icon-button (click)=\"deleteEmailSubscriptionUser($event,esUser)\">\n <mat-icon>delete</mat-icon>\n </button>\n <button type=\"button\" mat-icon-button (click)=\"editEmailSubscriptionUser($event,esUser)\">\n <mat-icon>edit</mat-icon>\n </button>\n </td>\n </ng-container>\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>",
4241
4228
  styles: [".scroll-container{max-height:800px;overflow-y:auto}"]
4242
4229
  },] }
4243
4230
  ];
4244
- exports.ɵbf.ctorParameters = function () { return [
4231
+ exports.ɵbg.ctorParameters = function () { return [
4245
4232
  { type: dialog.MatDialog },
4246
4233
  { type: HttpService },
4247
- { type: i1$2.Router }
4234
+ { type: i1$1.Router }
4248
4235
  ]; };
4249
- exports.ɵbf.propDecorators = {
4236
+ exports.ɵbg.propDecorators = {
4250
4237
  sort: [{ type: i0.ViewChild, args: [sort.MatSort, { static: true },] }]
4251
4238
  };
4252
- exports.ɵbf = __decorate([
4239
+ exports.ɵbg = __decorate([
4253
4240
  untilDestroy.UntilDestroy()
4254
- ], exports.ɵbf);
4241
+ ], exports.ɵbg);
4255
4242
 
4256
4243
  var esulr = {
4257
4244
  title: 'Email Subscription Users',
@@ -4263,7 +4250,7 @@
4263
4250
  var routes$4 = [
4264
4251
  {
4265
4252
  path: '',
4266
- component: exports.ɵbf,
4253
+ component: exports.ɵbg,
4267
4254
  canActivate: [AuthenticationGuard],
4268
4255
  data: esulr
4269
4256
  },
@@ -4275,8 +4262,8 @@
4275
4262
  }());
4276
4263
  EmailSubscriptionUserListRoutingModule.decorators = [
4277
4264
  { type: i0.NgModule, args: [{
4278
- imports: [i1$2.RouterModule.forChild(routes$4)],
4279
- exports: [i1$2.RouterModule]
4265
+ imports: [i1$1.RouterModule.forChild(routes$4)],
4266
+ exports: [i1$1.RouterModule]
4280
4267
  },] }
4281
4268
  ];
4282
4269
 
@@ -4288,12 +4275,12 @@
4288
4275
  }());
4289
4276
  EmailSubscriptionUserListFilterRoutingModule.decorators = [
4290
4277
  { type: i0.NgModule, args: [{
4291
- imports: [i1$2.RouterModule.forChild(routes$5)],
4292
- exports: [i1$2.RouterModule]
4278
+ imports: [i1$1.RouterModule.forChild(routes$5)],
4279
+ exports: [i1$1.RouterModule]
4293
4280
  },] }
4294
4281
  ];
4295
4282
 
4296
- exports.ɵbh = /** @class */ (function () {
4283
+ exports.ɵbi = /** @class */ (function () {
4297
4284
  function EmailSubscriptionUserListFilterComponent(fb) {
4298
4285
  this.fb = fb;
4299
4286
  this.valueChange = new i0.EventEmitter();
@@ -4322,22 +4309,22 @@
4322
4309
  };
4323
4310
  return EmailSubscriptionUserListFilterComponent;
4324
4311
  }());
4325
- exports.ɵbh.decorators = [
4312
+ exports.ɵbi.decorators = [
4326
4313
  { type: i0.Component, args: [{
4327
4314
  selector: 'app-email-subscription-user-list-filter',
4328
4315
  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>",
4329
4316
  styles: [""]
4330
4317
  },] }
4331
4318
  ];
4332
- exports.ɵbh.ctorParameters = function () { return [
4319
+ exports.ɵbi.ctorParameters = function () { return [
4333
4320
  { type: forms.FormBuilder }
4334
4321
  ]; };
4335
- exports.ɵbh.propDecorators = {
4322
+ exports.ɵbi.propDecorators = {
4336
4323
  valueChange: [{ type: i0.Output }]
4337
4324
  };
4338
- exports.ɵbh = __decorate([
4325
+ exports.ɵbi = __decorate([
4339
4326
  untilDestroy.UntilDestroy()
4340
- ], exports.ɵbh);
4327
+ ], exports.ɵbi);
4341
4328
 
4342
4329
  var EmailSubscriptionUserListFilterModule = /** @class */ (function () {
4343
4330
  function EmailSubscriptionUserListFilterModule() {
@@ -4346,7 +4333,7 @@
4346
4333
  }());
4347
4334
  EmailSubscriptionUserListFilterModule.decorators = [
4348
4335
  { type: i0.NgModule, args: [{
4349
- declarations: [exports.ɵbh],
4336
+ declarations: [exports.ɵbi],
4350
4337
  imports: [
4351
4338
  common.CommonModule,
4352
4339
  MaterialModule,
@@ -4355,7 +4342,7 @@
4355
4342
  SearchableSelectorModule,
4356
4343
  EmailSubscriptionUserListFilterRoutingModule
4357
4344
  ],
4358
- exports: [exports.ɵbh]
4345
+ exports: [exports.ɵbi]
4359
4346
  },] }
4360
4347
  ];
4361
4348
 
@@ -4366,7 +4353,7 @@
4366
4353
  }());
4367
4354
  EmailSubscriptionUserListModule.decorators = [
4368
4355
  { type: i0.NgModule, args: [{
4369
- declarations: [exports.ɵbf],
4356
+ declarations: [exports.ɵbg],
4370
4357
  imports: [
4371
4358
  common.CommonModule,
4372
4359
  ngxInfiniteScroll.InfiniteScrollModule,
@@ -4377,7 +4364,7 @@
4377
4364
  EmailSubscriptionUserFormModule,
4378
4365
  EmailSubscriptionUserListFilterModule
4379
4366
  ],
4380
- exports: [exports.ɵbf]
4367
+ exports: [exports.ɵbg]
4381
4368
  },] }
4382
4369
  ];
4383
4370
 
@@ -4389,8 +4376,8 @@
4389
4376
  }());
4390
4377
  EmailSubscriptionTypeRoutingModule.decorators = [
4391
4378
  { type: i0.NgModule, args: [{
4392
- imports: [i1$2.RouterModule.forChild(routes$6)],
4393
- exports: [i1$2.RouterModule]
4379
+ imports: [i1$1.RouterModule.forChild(routes$6)],
4380
+ exports: [i1$1.RouterModule]
4394
4381
  },] }
4395
4382
  ];
4396
4383
 
@@ -4417,8 +4404,8 @@
4417
4404
  }());
4418
4405
  EmailSubscriptionTypeFormRoutingModule.decorators = [
4419
4406
  { type: i0.NgModule, args: [{
4420
- imports: [i1$2.RouterModule.forChild(routes$7)],
4421
- exports: [i1$2.RouterModule]
4407
+ imports: [i1$1.RouterModule.forChild(routes$7)],
4408
+ exports: [i1$1.RouterModule]
4422
4409
  },] }
4423
4410
  ];
4424
4411
 
@@ -4433,7 +4420,7 @@
4433
4420
  required: "Frequency is required"
4434
4421
  },
4435
4422
  };
4436
- exports.ɵbi = /** @class */ (function () {
4423
+ exports.ɵbj = /** @class */ (function () {
4437
4424
  function EmailSubscriptionTypeFormComponent(fb, formValidatorService, alertService, dialogRef, data, http) {
4438
4425
  this.fb = fb;
4439
4426
  this.formValidatorService = formValidatorService;
@@ -4497,14 +4484,14 @@
4497
4484
  };
4498
4485
  return EmailSubscriptionTypeFormComponent;
4499
4486
  }());
4500
- exports.ɵbi.decorators = [
4487
+ exports.ɵbj.decorators = [
4501
4488
  { type: i0.Component, args: [{
4502
4489
  selector: 'app-email-subscription-type-form',
4503
4490
  template: "<form [formGroup]=\"emailSubscriptionTypeFormGroup\" (ngSubmit)=\"submit()\" class=\"mat-typography\">\n <div fxLayout=\"column\">\n <div mat-dialog-title class=\"text-center\">\n <div>Email Subscription Type</div>\n </div>\n\n <div mat-dialog-content fxLayout=\"column\">\n <div fxLayout=\"row wrap\" fxLayoutAlign=\"space-between center\">\n\n <mat-form-field fxFlex=\"100%\" class=\"mt-1\">\n <input matInput formControlName=\"title\" placeholder=\"Title\" autocomplete=\"off\" required />\n <mat-error *ngIf=\"isFieldValid('title')\">{{getErrorMessage('title')}}</mat-error>\n </mat-form-field>\n\n <mat-form-field fxFlex=\"100%\" class=\"mt-1\">\n <input matInput formControlName=\"code\" placeholder=\"Code\" autocomplete=\"off\" required />\n <mat-hint align=\"end\">Unique Value</mat-hint>\n <mat-error *ngIf=\"isFieldValid('code')\">{{getErrorMessage('code')}}</mat-error>\n </mat-form-field>\n\n <mat-form-field fxFlex=\"100%\" class=\"mt-1\">\n <mat-label>Frequency</mat-label>\n <app-searchable-selector formControlName=\"frequency_id\" apiUrl=\"api/email-subscription-frequencies\"\n [(selectedValue)]=\"selectedFrequency\" [enableSearch]=\"false\" required>\n </app-searchable-selector>\n <mat-error *ngIf=\"isFieldValid('frequency_id')\">{{getErrorMessage('frequency_id')}}\n </mat-error>\n </mat-form-field>\n\n <mat-form-field fxFlex=\"100%\" class=\"mt-1\">\n <textarea matInput formControlName=\"description\" placeholder=\"Description\"\n autocomplete=\"off\"></textarea>\n </mat-form-field>\n\n <div class=\"my-2\" fxLayout=\"row\" fxLayoutGap=\"30px\" fxLayoutAlign=\"end\" fxFlex=\"100%\">\n <button mat-raised-button type=\"button\" (click)=\"cancel()\">Cancel</button>\n <button mat-raised-button type=\"submit\" color=\"primary\" [disabled]=\"isSubmitLoading\">\n <app-loader class=\"inline-loader\" [isLoading]=\"isSubmitLoading\"></app-loader>\n Save\n </button>\n </div>\n </div>\n </div>\n\n\n </div>\n</form>",
4504
4491
  styles: [""]
4505
4492
  },] }
4506
4493
  ];
4507
- exports.ɵbi.ctorParameters = function () { return [
4494
+ exports.ɵbj.ctorParameters = function () { return [
4508
4495
  { type: forms.FormBuilder },
4509
4496
  { type: FormValidatorService },
4510
4497
  { type: AlertService },
@@ -4512,9 +4499,9 @@
4512
4499
  { type: undefined, decorators: [{ type: i0.Inject, args: [dialog.MAT_DIALOG_DATA,] }] },
4513
4500
  { type: HttpService }
4514
4501
  ]; };
4515
- exports.ɵbi = __decorate([
4502
+ exports.ɵbj = __decorate([
4516
4503
  untilDestroy.UntilDestroy()
4517
- ], exports.ɵbi);
4504
+ ], exports.ɵbj);
4518
4505
 
4519
4506
  var EmailSubscriptionTypeFormModule = /** @class */ (function () {
4520
4507
  function EmailSubscriptionTypeFormModule() {
@@ -4523,7 +4510,7 @@
4523
4510
  }());
4524
4511
  EmailSubscriptionTypeFormModule.decorators = [
4525
4512
  { type: i0.NgModule, args: [{
4526
- declarations: [exports.ɵbi],
4513
+ declarations: [exports.ɵbj],
4527
4514
  imports: [
4528
4515
  common.CommonModule,
4529
4516
  MaterialModule,
@@ -4533,12 +4520,12 @@
4533
4520
  EmailSubscriptionTypeFormRoutingModule,
4534
4521
  LoaderModule
4535
4522
  ],
4536
- exports: [exports.ɵbi],
4537
- entryComponents: [exports.ɵbi]
4523
+ exports: [exports.ɵbj],
4524
+ entryComponents: [exports.ɵbj]
4538
4525
  },] }
4539
4526
  ];
4540
4527
 
4541
- exports.ɵbj = /** @class */ (function () {
4528
+ exports.ɵbk = /** @class */ (function () {
4542
4529
  function EmailSubscriptionTypeListComponent(dialog, http) {
4543
4530
  this.dialog = dialog;
4544
4531
  this.http = http;
@@ -4602,7 +4589,7 @@
4602
4589
  };
4603
4590
  EmailSubscriptionTypeListComponent.prototype.addEmailSubscriptionType = function () {
4604
4591
  var _this = this;
4605
- var dialogRef = this.dialog.open(exports.ɵbi, {
4592
+ var dialogRef = this.dialog.open(exports.ɵbj, {
4606
4593
  width: '400px',
4607
4594
  autoFocus: false,
4608
4595
  data: {} // Any data passed here will be injected into the model
@@ -4616,7 +4603,7 @@
4616
4603
  EmailSubscriptionTypeListComponent.prototype.editEmailSubscriptionType = function (event, emailSubscriptionType) {
4617
4604
  var _this = this;
4618
4605
  event.stopPropagation();
4619
- var dialogRef = this.dialog.open(exports.ɵbi, {
4606
+ var dialogRef = this.dialog.open(exports.ɵbj, {
4620
4607
  width: '400px',
4621
4608
  autoFocus: false,
4622
4609
  data: {
@@ -4673,23 +4660,23 @@
4673
4660
  };
4674
4661
  return EmailSubscriptionTypeListComponent;
4675
4662
  }());
4676
- exports.ɵbj.decorators = [
4663
+ exports.ɵbk.decorators = [
4677
4664
  { type: i0.Component, args: [{
4678
4665
  selector: 'app-email-subscription-type-list',
4679
4666
  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>",
4680
4667
  styles: [".scroll-container{max-height:800px;overflow-y:auto}"]
4681
4668
  },] }
4682
4669
  ];
4683
- exports.ɵbj.ctorParameters = function () { return [
4670
+ exports.ɵbk.ctorParameters = function () { return [
4684
4671
  { type: dialog.MatDialog },
4685
4672
  { type: HttpService }
4686
4673
  ]; };
4687
- exports.ɵbj.propDecorators = {
4674
+ exports.ɵbk.propDecorators = {
4688
4675
  sort: [{ type: i0.ViewChild, args: [sort.MatSort, { static: true },] }]
4689
4676
  };
4690
- exports.ɵbj = __decorate([
4677
+ exports.ɵbk = __decorate([
4691
4678
  untilDestroy.UntilDestroy()
4692
- ], exports.ɵbj);
4679
+ ], exports.ɵbk);
4693
4680
 
4694
4681
  var estlr = {
4695
4682
  title: 'Email Subscription Type',
@@ -4701,7 +4688,7 @@
4701
4688
  var routes$8 = [
4702
4689
  {
4703
4690
  path: '',
4704
- component: exports.ɵbj,
4691
+ component: exports.ɵbk,
4705
4692
  canActivate: [AuthenticationGuard],
4706
4693
  data: estlr
4707
4694
  },
@@ -4713,8 +4700,8 @@
4713
4700
  }());
4714
4701
  EmailSubscriptionTypeListRoutingModule.decorators = [
4715
4702
  { type: i0.NgModule, args: [{
4716
- imports: [i1$2.RouterModule.forChild(routes$8)],
4717
- exports: [i1$2.RouterModule]
4703
+ imports: [i1$1.RouterModule.forChild(routes$8)],
4704
+ exports: [i1$1.RouterModule]
4718
4705
  },] }
4719
4706
  ];
4720
4707
 
@@ -4725,7 +4712,7 @@
4725
4712
  }());
4726
4713
  EmailSubscriptionTypeListModule.decorators = [
4727
4714
  { type: i0.NgModule, args: [{
4728
- declarations: [exports.ɵbj],
4715
+ declarations: [exports.ɵbk],
4729
4716
  imports: [
4730
4717
  common.CommonModule,
4731
4718
  MaterialModule,
@@ -4735,11 +4722,11 @@
4735
4722
  EmailSubscriptionTypeFormModule,
4736
4723
  EmailSubscriptionTypeListRoutingModule
4737
4724
  ],
4738
- exports: [exports.ɵbj]
4725
+ exports: [exports.ɵbk]
4739
4726
  },] }
4740
4727
  ];
4741
4728
 
4742
- exports.ɵbk = /** @class */ (function () {
4729
+ exports.ɵbl = /** @class */ (function () {
4743
4730
  function EmailSubscriptionForUserComponent(http) {
4744
4731
  this.http = http;
4745
4732
  this.subscriptions = [];
@@ -4794,19 +4781,19 @@
4794
4781
  };
4795
4782
  return EmailSubscriptionForUserComponent;
4796
4783
  }());
4797
- exports.ɵbk.decorators = [
4784
+ exports.ɵbl.decorators = [
4798
4785
  { type: i0.Component, args: [{
4799
4786
  selector: 'app-email-subscription-for-user',
4800
4787
  template: "<div fxLayout=\"column\" class=\"container my-4\">\n\n <div class=\"scroll-container\" infiniteScroll [infiniteScrollDistance]=\"2\" [infiniteScrollThrottle]=\"50\"\n (scrolled)=\"onScroll()\" [scrollWindow]=\"false\">\n <mat-list>\n <div mat-subheader>Available Subscriptions</div>\n <mat-list-item *ngFor=\"let sub of subscriptions\">\n <mat-icon mat-list-icon>email</mat-icon>\n <div mat-line>{{sub?.title}} </div>\n <div mat-line class=\"text-secondary\">{{sub?.frequency?.title}}</div>\n <div mat-line> {{sub?.description}} </div>\n <div fxLayout fxLayoutAlign=\"end\">\n <button type=\"button\" *ngIf=\"!sub?.current_user_subscription\" mat-raised-button color=\"primary\"\n (click)=\"subscribe(sub)\">Subscribe</button>\n <button type=\"button\" *ngIf=\"sub?.current_user_subscription\" mat-stroked-button color=\"primary\"\n (click)=\"unsubscribe(sub)\">Unsubscribe</button>\n </div>\n <mat-divider></mat-divider>\n </mat-list-item>\n </mat-list>\n </div>\n\n</div>",
4801
4788
  styles: [".scroll-container{max-height:800px;overflow-y:auto}"]
4802
4789
  },] }
4803
4790
  ];
4804
- exports.ɵbk.ctorParameters = function () { return [
4791
+ exports.ɵbl.ctorParameters = function () { return [
4805
4792
  { type: HttpService }
4806
4793
  ]; };
4807
- exports.ɵbk = __decorate([
4794
+ exports.ɵbl = __decorate([
4808
4795
  untilDestroy.UntilDestroy()
4809
- ], exports.ɵbk);
4796
+ ], exports.ɵbl);
4810
4797
 
4811
4798
  var esfur = {
4812
4799
  permissions: {
@@ -4816,7 +4803,7 @@
4816
4803
  var routes$9 = [
4817
4804
  {
4818
4805
  path: '',
4819
- component: exports.ɵbk,
4806
+ component: exports.ɵbl,
4820
4807
  canActivate: [AuthenticationGuard],
4821
4808
  data: esfur
4822
4809
  },
@@ -4828,8 +4815,8 @@
4828
4815
  }());
4829
4816
  EmailSubscriptionForUserRoutingModule.decorators = [
4830
4817
  { type: i0.NgModule, args: [{
4831
- imports: [i1$2.RouterModule.forChild(routes$9)],
4832
- exports: [i1$2.RouterModule]
4818
+ imports: [i1$1.RouterModule.forChild(routes$9)],
4819
+ exports: [i1$1.RouterModule]
4833
4820
  },] }
4834
4821
  ];
4835
4822
 
@@ -4840,7 +4827,7 @@
4840
4827
  }());
4841
4828
  EmailSubscriptionForUserModule.decorators = [
4842
4829
  { type: i0.NgModule, args: [{
4843
- declarations: [exports.ɵbk],
4830
+ declarations: [exports.ɵbl],
4844
4831
  imports: [
4845
4832
  common.CommonModule,
4846
4833
  ngxInfiniteScroll.InfiniteScrollModule,
@@ -4848,7 +4835,7 @@
4848
4835
  flexLayout.FlexLayoutModule,
4849
4836
  EmailSubscriptionForUserRoutingModule
4850
4837
  ],
4851
- exports: [exports.ɵbk]
4838
+ exports: [exports.ɵbl]
4852
4839
  },] }
4853
4840
  ];
4854
4841
 
@@ -5040,7 +5027,7 @@
5040
5027
  },] }
5041
5028
  ];
5042
5029
 
5043
- exports.ɵbl = /** @class */ (function () {
5030
+ exports.ɵbm = /** @class */ (function () {
5044
5031
  function TechlifyUpdatesListComponent(dialog, alertService, techlifyUpdateService, fb) {
5045
5032
  this.dialog = dialog;
5046
5033
  this.alertService = alertService;
@@ -5200,26 +5187,26 @@
5200
5187
  };
5201
5188
  return TechlifyUpdatesListComponent;
5202
5189
  }());
5203
- exports.ɵbl.decorators = [
5190
+ exports.ɵbm.decorators = [
5204
5191
  { type: i0.Component, args: [{
5205
5192
  selector: 'app-techlify-updates-list',
5206
5193
  template: "<section class=\"p-4\" fxLayout=\"column\">\n <h3 class=\"primary-color text-center\">\n App Updates\n <button mat-raised-button (click)=\"modifyTechlifyUpdate()\" class=\"primary-bg text-white\">\n <mat-icon>\n add\n </mat-icon>\n Create\n </button>\n </h3>\n <form [formGroup]=\"filterFormGroup\" fxLayout=\"row wrap\" fxLayoutGap=\"0.5rem\" fxFlex=\"100%\" style=\"font-size: 12px;\">\n <mat-form-field fxFlex=\"0 1 calc(100% - 0.5rem)\" fxFlex.gt-md=\"0 1 calc(15% - 0.5rem)\" appearance=\"outline\"\n fxFlex.gt-sm=\"0 1 calc(20% - 0.5rem)\">\n <input type=\"text\" matInput formControlName=\"search\" placeholder=\"Title\" autocomplete=\"off\" />\n <button mat-button *ngIf=\"filterFormGroup.get('search').value\" matSuffix mat-icon-button\n (click)=\"resetFieldValue('search')\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n <mat-form-field fxFlex=\"0 1 calc(100% - 0.5rem)\" fxFlex.gt-md=\"0 1 calc(15% - 0.5rem)\" appearance=\"outline\"\n fxFlex.gt-sm=\"0 1 calc(20% - 0.5rem)\">\n <input type=\"text\" matInput formControlName=\"version\" placeholder=\"Version\" autocomplete=\"off\" />\n <button mat-button *ngIf=\"filterFormGroup.get('version').value\" matSuffix mat-icon-button\n (click)=\"resetFieldValue('version')\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n </form>\n\n <table mat-table [dataSource]=\"techlifyUpdates\" class=\"mat-elevation-z8 w-100\" matSort multiTemplateDataRows\n (matSortChange)=\"sortColumn($event)\" infiniteScroll [infiniteScrollDistance]=\"2\" [infiniteScrollThrottle]=\"50\"\n (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 <!-- Course Column -->\n <ng-container matColumnDef=\"title\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header disableClear> Title </th>\n <td mat-cell *matCellDef=\"let element\"> {{element?.title}} </td>\n </ng-container>\n\n <!-- Version Column -->\n <ng-container matColumnDef=\"version\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header disableClear> Version </th>\n <td mat-cell *matCellDef=\"let element\"> {{element?.version}} </td>\n </ng-container>\n\n <!-- Released On Column -->\n <ng-container matColumnDef=\"released_on\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header disableClear> Released On </th>\n <td mat-cell *matCellDef=\"let element\"> {{element?.released_on | date:'mediumDate'}} </td>\n </ng-container>\n\n <!-- Learn More Link Column -->\n <ng-container matColumnDef=\"learn_more_link\">\n <th mat-header-cell *matHeaderCellDef> Learn more link </th>\n <td mat-cell *matCellDef=\"let element\">\n <a [href]=\"element?.learn_more_link\" target=\"_blank\">\n {{element?.learn_more_link}}\n </a>\n </td>\n </ng-container>\n\n <!-- Description Column -->\n <ng-container matColumnDef=\"description\">\n <th mat-header-cell *matHeaderCellDef> Description </th>\n <td mat-cell *matCellDef=\"let element\">\n <app-read-more [text]=\"element?.description\" [maxLength]=\"50\"></app-read-more>\n </td>\n </ng-container>\n\n <!-- Creator Column -->\n <ng-container matColumnDef=\"creator\">\n <th mat-header-cell *matHeaderCellDef> Creator </th>\n <td mat-cell *matCellDef=\"let element\">\n {{element?.creator?.name}}\n <div fxLayout class=\"small\">\n {{element?.created_at | date : 'mediumDate'}}\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\" class=\"secondary-color\">\n <button type=\"button\" class=\"secondary-color\" mat-icon-button (click)=\"modifyTechlifyUpdate(element)\">\n <mat-icon>edit</mat-icon>\n </button>\n\n <button type=\"button\" class=\"secondary-color\" mat-icon-button (click)=\"deleteTechlifyUpdate(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</section>\n",
5207
5194
  styles: [""]
5208
5195
  },] }
5209
5196
  ];
5210
- exports.ɵbl.ctorParameters = function () { return [
5197
+ exports.ɵbm.ctorParameters = function () { return [
5211
5198
  { type: dialog.MatDialog },
5212
5199
  { type: AlertService },
5213
5200
  { type: TechlifyUpdateService },
5214
5201
  { type: forms.FormBuilder }
5215
5202
  ]; };
5216
- exports.ɵbl = __decorate([
5203
+ exports.ɵbm = __decorate([
5217
5204
  untilDestroy.UntilDestroy()
5218
- ], exports.ɵbl);
5205
+ ], exports.ɵbm);
5219
5206
 
5220
5207
  var routes$a = [
5221
5208
  { path: '', redirectTo: 'all', pathMatch: 'full' },
5222
- { path: 'all', component: exports.ɵbl },
5209
+ { path: 'all', component: exports.ɵbm },
5223
5210
  //fallback
5224
5211
  {
5225
5212
  path: '**',
@@ -5234,8 +5221,8 @@
5234
5221
  }());
5235
5222
  TechlifyUpdateRoutingModule.decorators = [
5236
5223
  { type: i0.NgModule, args: [{
5237
- imports: [i1$2.RouterModule.forChild(routes$a)],
5238
- exports: [i1$2.RouterModule]
5224
+ imports: [i1$1.RouterModule.forChild(routes$a)],
5225
+ exports: [i1$1.RouterModule]
5239
5226
  },] }
5240
5227
  ];
5241
5228
 
@@ -5246,7 +5233,7 @@
5246
5233
  }());
5247
5234
  TechlifyUpdateModule.decorators = [
5248
5235
  { type: i0.NgModule, args: [{
5249
- declarations: [exports.ɵbl],
5236
+ declarations: [exports.ɵbm],
5250
5237
  imports: [
5251
5238
  common.CommonModule,
5252
5239
  forms.ReactiveFormsModule,
@@ -5290,10 +5277,10 @@
5290
5277
  UpdateViewComponent.ctorParameters = function () { return [
5291
5278
  { type: dialog.MatDialogRef },
5292
5279
  { type: undefined, decorators: [{ type: i0.Inject, args: [dialog.MAT_DIALOG_DATA,] }] },
5293
- { type: i1$2.Router }
5280
+ { type: i1$1.Router }
5294
5281
  ]; };
5295
5282
 
5296
- exports.ɵbr = /** @class */ (function () {
5283
+ exports.ɵbs = /** @class */ (function () {
5297
5284
  function TechlifyUpdateHistoryComponent(dialog, techlifyUpdateService, fb, alertService) {
5298
5285
  this.dialog = dialog;
5299
5286
  this.techlifyUpdateService = techlifyUpdateService;
@@ -5430,26 +5417,26 @@
5430
5417
  };
5431
5418
  return TechlifyUpdateHistoryComponent;
5432
5419
  }());
5433
- exports.ɵbr.decorators = [
5420
+ exports.ɵbs.decorators = [
5434
5421
  { type: i0.Component, args: [{
5435
5422
  selector: 'app-techlify-update-history',
5436
5423
  template: "<section class=\"p-4\" fxLayout=\"column\">\n <h3 class=\"primary-color text-center\">\n App Updates\n </h3>\n <form [formGroup]=\"filterFormGroup\" fxLayout=\"row wrap\" fxLayoutGap=\"0.5rem\" fxFlex=\"100%\" style=\"font-size: 12px;\">\n <mat-form-field fxFlex=\"0 1 calc(100% - 0.5rem)\" fxFlex.gt-md=\"0 1 calc(15% - 0.5rem)\" appearance=\"outline\"\n fxFlex.gt-sm=\"0 1 calc(20% - 0.5rem)\">\n <input type=\"text\" matInput formControlName=\"search\" placeholder=\"Title\" autocomplete=\"off\" />\n <button mat-button *ngIf=\"filterFormGroup.get('search').value\" matSuffix mat-icon-button\n (click)=\"resetFieldValue('search')\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n <mat-form-field fxFlex=\"0 1 calc(100% - 0.5rem)\" fxFlex.gt-md=\"0 1 calc(15% - 0.5rem)\" appearance=\"outline\"\n fxFlex.gt-sm=\"0 1 calc(20% - 0.5rem)\">\n <input type=\"text\" matInput formControlName=\"version\" placeholder=\"Version\" autocomplete=\"off\" />\n <button mat-button *ngIf=\"filterFormGroup.get('version').value\" matSuffix mat-icon-button\n (click)=\"resetFieldValue('version')\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n </form>\n\n <table mat-table [dataSource]=\"techlifyUpdates\" class=\"mat-elevation-z8 w-100\" matSort multiTemplateDataRows\n (matSortChange)=\"sortColumn($event)\" infiniteScroll [infiniteScrollDistance]=\"2\" [infiniteScrollThrottle]=\"50\"\n (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 <!-- Course Column -->\n <ng-container matColumnDef=\"title\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header disableClear> Title </th>\n <td mat-cell *matCellDef=\"let element\"> {{element?.title}} </td>\n </ng-container>\n\n <!-- Version Column -->\n <ng-container matColumnDef=\"version\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header disableClear> Version </th>\n <td mat-cell *matCellDef=\"let element\"> {{element?.version}} </td>\n </ng-container>\n\n <!-- Released On Column -->\n <ng-container matColumnDef=\"released_on\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header disableClear> Released On </th>\n <td mat-cell *matCellDef=\"let element\"> {{element?.released_on | date:'mediumDate'}} </td>\n </ng-container>\n\n <!-- Learn More Link Column -->\n <ng-container matColumnDef=\"learn_more_link\">\n <th mat-header-cell *matHeaderCellDef> Learn more link </th>\n <td mat-cell *matCellDef=\"let element\">\n <a [href]=\"element?.learn_more_link\" target=\"_blank\">\n {{element?.learn_more_link}}\n </a>\n </td>\n </ng-container>\n\n <!-- Description Column -->\n <ng-container matColumnDef=\"description\">\n <th mat-header-cell *matHeaderCellDef> Description </th>\n <td mat-cell *matCellDef=\"let element\">\n <app-read-more [text]=\"element?.description\" [maxLength]=\"50\"></app-read-more>\n </td>\n </ng-container>\n\n <!-- Creator Column -->\n <ng-container matColumnDef=\"creator\">\n <th mat-header-cell *matHeaderCellDef> Creator </th>\n <td mat-cell *matCellDef=\"let element\">\n {{element?.creator?.name}}\n <div fxLayout class=\"small\">\n {{element?.created_at | date : 'mediumDate'}}\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\" class=\"secondary-color\">\n <button type=\"button\" class=\"secondary-color\" mat-icon-button (click)=\"openUpdateView(element)\">\n <mat-icon>remove_red_eye</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</section>\n",
5437
5424
  styles: [""]
5438
5425
  },] }
5439
5426
  ];
5440
- exports.ɵbr.ctorParameters = function () { return [
5427
+ exports.ɵbs.ctorParameters = function () { return [
5441
5428
  { type: dialog.MatDialog },
5442
5429
  { type: TechlifyUpdateService },
5443
5430
  { type: forms.FormBuilder },
5444
5431
  { type: AlertService }
5445
5432
  ]; };
5446
- exports.ɵbr = __decorate([
5433
+ exports.ɵbs = __decorate([
5447
5434
  untilDestroy.UntilDestroy()
5448
- ], exports.ɵbr);
5435
+ ], exports.ɵbs);
5449
5436
 
5450
5437
  var routes$b = [
5451
5438
  { path: '', redirectTo: 'update-history', pathMatch: 'full' },
5452
- { path: 'update-history', component: exports.ɵbr },
5439
+ { path: 'update-history', component: exports.ɵbs },
5453
5440
  //fallback
5454
5441
  {
5455
5442
  path: '**',
@@ -5464,8 +5451,8 @@
5464
5451
  }());
5465
5452
  TechlifyUpdateHistoryRoutingModule.decorators = [
5466
5453
  { type: i0.NgModule, args: [{
5467
- imports: [i1$2.RouterModule.forChild(routes$b)],
5468
- exports: [i1$2.RouterModule]
5454
+ imports: [i1$1.RouterModule.forChild(routes$b)],
5455
+ exports: [i1$1.RouterModule]
5469
5456
  },] }
5470
5457
  ];
5471
5458
 
@@ -5486,7 +5473,7 @@
5486
5473
  ReadMoreModule,
5487
5474
  TechlifyUpdateHistoryRoutingModule
5488
5475
  ],
5489
- declarations: [exports.ɵbr]
5476
+ declarations: [exports.ɵbs]
5490
5477
  },] }
5491
5478
  ];
5492
5479
 
@@ -5592,7 +5579,7 @@
5592
5579
  { type: undefined, decorators: [{ type: i0.Inject, args: [i1.MAT_SNACK_BAR_DATA,] }] },
5593
5580
  { type: i1.MatSnackBarRef },
5594
5581
  { type: dialog.MatDialog },
5595
- { type: i1$2.Router },
5582
+ { type: i1$1.Router },
5596
5583
  { type: TechlifyUpdateService },
5597
5584
  { type: AlertService }
5598
5585
  ]; };
@@ -5799,7 +5786,7 @@
5799
5786
  AuditLogsViewModelComponent.prototype.ngOnInit = function () {
5800
5787
  var _this = this;
5801
5788
  this.router.events
5802
- .pipe(operators.filter(function (event) { return event instanceof i1$2.NavigationEnd; }), untilDestroy.untilDestroyed(this))
5789
+ .pipe(operators.filter(function (event) { return event instanceof i1$1.NavigationEnd; }), untilDestroy.untilDestroyed(this))
5803
5790
  .subscribe(function (_) { return _this.dialogRef.close(); });
5804
5791
  };
5805
5792
  return AuditLogsViewModelComponent;
@@ -5814,7 +5801,7 @@
5814
5801
  exports.AuditLogsViewModelComponent.ctorParameters = function () { return [
5815
5802
  { type: dialog.MatDialogRef },
5816
5803
  { type: undefined, decorators: [{ type: i0.Inject, args: [dialog.MAT_DIALOG_DATA,] }] },
5817
- { type: i1$2.Router }
5804
+ { type: i1$1.Router }
5818
5805
  ]; };
5819
5806
  exports.AuditLogsViewModelComponent = __decorate([
5820
5807
  untilDestroy.UntilDestroy()
@@ -5874,8 +5861,8 @@
5874
5861
  }());
5875
5862
  AuditLogForModelRoutingModule.decorators = [
5876
5863
  { type: i0.NgModule, args: [{
5877
- imports: [i1$2.RouterModule.forChild(routes$c)],
5878
- exports: [i1$2.RouterModule]
5864
+ imports: [i1$1.RouterModule.forChild(routes$c)],
5865
+ exports: [i1$1.RouterModule]
5879
5866
  },] }
5880
5867
  ];
5881
5868
 
@@ -5887,8 +5874,8 @@
5887
5874
  }());
5888
5875
  AuditLogViewModelRoutingModule.decorators = [
5889
5876
  { type: i0.NgModule, args: [{
5890
- imports: [i1$2.RouterModule.forChild(routes$d)],
5891
- exports: [i1$2.RouterModule]
5877
+ imports: [i1$1.RouterModule.forChild(routes$d)],
5878
+ exports: [i1$1.RouterModule]
5892
5879
  },] }
5893
5880
  ];
5894
5881
 
@@ -5918,8 +5905,8 @@
5918
5905
  }());
5919
5906
  AuditLogsViewModelRoutingModule.decorators = [
5920
5907
  { type: i0.NgModule, args: [{
5921
- imports: [i1$2.RouterModule.forChild(routes$e)],
5922
- exports: [i1$2.RouterModule]
5908
+ imports: [i1$1.RouterModule.forChild(routes$e)],
5909
+ exports: [i1$1.RouterModule]
5923
5910
  },] }
5924
5911
  ];
5925
5912
 
@@ -5931,8 +5918,8 @@
5931
5918
  }());
5932
5919
  AuditLogListRoutingModule.decorators = [
5933
5920
  { type: i0.NgModule, args: [{
5934
- imports: [i1$2.RouterModule.forChild(routes$f)],
5935
- exports: [i1$2.RouterModule]
5921
+ imports: [i1$1.RouterModule.forChild(routes$f)],
5922
+ exports: [i1$1.RouterModule]
5936
5923
  },] }
5937
5924
  ];
5938
5925
 
@@ -6060,7 +6047,7 @@
6060
6047
  ];
6061
6048
  exports.AuditLogListComponent.ctorParameters = function () { return [
6062
6049
  { type: DataManager },
6063
- { type: i1$2.Router },
6050
+ { type: i1$1.Router },
6064
6051
  { type: platformBrowser.DomSanitizer }
6065
6052
  ]; };
6066
6053
  exports.AuditLogListComponent.propDecorators = {
@@ -6083,8 +6070,8 @@
6083
6070
  }());
6084
6071
  AuditLogListFilterRoutingModule.decorators = [
6085
6072
  { type: i0.NgModule, args: [{
6086
- imports: [i1$2.RouterModule.forChild(routes$g)],
6087
- exports: [i1$2.RouterModule]
6073
+ imports: [i1$1.RouterModule.forChild(routes$g)],
6074
+ exports: [i1$1.RouterModule]
6088
6075
  },] }
6089
6076
  ];
6090
6077
 
@@ -6304,7 +6291,7 @@
6304
6291
  ];
6305
6292
  AuditLogViewComponent.ctorParameters = function () { return [
6306
6293
  { type: DataManager },
6307
- { type: i1$2.ActivatedRoute },
6294
+ { type: i1$1.ActivatedRoute },
6308
6295
  { type: common.Location }
6309
6296
  ]; };
6310
6297
 
@@ -6316,8 +6303,8 @@
6316
6303
  }());
6317
6304
  AuditLogViewRoutingModule.decorators = [
6318
6305
  { type: i0.NgModule, args: [{
6319
- imports: [i1$2.RouterModule.forChild(routes$h)],
6320
- exports: [i1$2.RouterModule]
6306
+ imports: [i1$1.RouterModule.forChild(routes$h)],
6307
+ exports: [i1$1.RouterModule]
6321
6308
  },] }
6322
6309
  ];
6323
6310
 
@@ -6351,8 +6338,8 @@
6351
6338
  }());
6352
6339
  AuditLogRoutingModule.decorators = [
6353
6340
  { type: i0.NgModule, args: [{
6354
- imports: [i1$2.RouterModule.forChild(routes$i)],
6355
- exports: [i1$2.RouterModule]
6341
+ imports: [i1$1.RouterModule.forChild(routes$i)],
6342
+ exports: [i1$1.RouterModule]
6356
6343
  },] }
6357
6344
  ];
6358
6345
 
@@ -6882,7 +6869,7 @@
6882
6869
  forms.FormsModule,
6883
6870
  forms.ReactiveFormsModule,
6884
6871
  flexLayout.FlexLayoutModule,
6885
- i1$2.RouterModule,
6872
+ i1$1.RouterModule,
6886
6873
  MaterialModule,
6887
6874
  flexLayout.FlexLayoutModule,
6888
6875
  FileDropperModule,
@@ -7002,8 +6989,8 @@
7002
6989
  }());
7003
6990
  LoginHistoryForUserRoutingModule.decorators = [
7004
6991
  { type: i0.NgModule, args: [{
7005
- imports: [i1$2.RouterModule.forChild(routes$j)],
7006
- exports: [i1$2.RouterModule]
6992
+ imports: [i1$1.RouterModule.forChild(routes$j)],
6993
+ exports: [i1$1.RouterModule]
7007
6994
  },] }
7008
6995
  ];
7009
6996
 
@@ -7832,7 +7819,7 @@
7832
7819
  canActivate: [AuthenticationGuard]
7833
7820
  },
7834
7821
  ];
7835
- var TechlifyFeatureRoutes = i1$2.RouterModule.forChild(routes$k);
7822
+ var TechlifyFeatureRoutes = i1$1.RouterModule.forChild(routes$k);
7836
7823
 
7837
7824
  var OnOffSwitchComponent = /** @class */ (function () {
7838
7825
  function OnOffSwitchComponent(fb) {
@@ -8021,24 +8008,24 @@
8021
8008
  exports.DateValidator = DateValidator;
8022
8009
  exports.DocumentViewerComponent = DocumentViewerComponent;
8023
8010
  exports.DocumentViewerModule = DocumentViewerModule;
8024
- exports.EmailSubscriptionForUserComponent = exports.ɵbk;
8011
+ exports.EmailSubscriptionForUserComponent = exports.ɵbl;
8025
8012
  exports.EmailSubscriptionForUserModule = EmailSubscriptionForUserModule;
8026
8013
  exports.EmailSubscriptionForUserRoutingModule = EmailSubscriptionForUserRoutingModule;
8027
8014
  exports.EmailSubscriptionModule = EmailSubscriptionModule;
8028
8015
  exports.EmailSubscriptionRoutingModule = EmailSubscriptionRoutingModule;
8029
- exports.EmailSubscriptionTypeFormComponent = exports.ɵbi;
8016
+ exports.EmailSubscriptionTypeFormComponent = exports.ɵbj;
8030
8017
  exports.EmailSubscriptionTypeFormModule = EmailSubscriptionTypeFormModule;
8031
8018
  exports.EmailSubscriptionTypeFormRoutingModule = EmailSubscriptionTypeFormRoutingModule;
8032
- exports.EmailSubscriptionTypeListComponent = exports.ɵbj;
8019
+ exports.EmailSubscriptionTypeListComponent = exports.ɵbk;
8033
8020
  exports.EmailSubscriptionTypeListModule = EmailSubscriptionTypeListModule;
8034
8021
  exports.EmailSubscriptionTypeListRoutingModule = EmailSubscriptionTypeListRoutingModule;
8035
8022
  exports.EmailSubscriptionTypeModule = EmailSubscriptionTypeModule;
8036
8023
  exports.EmailSubscriptionTypeRoutingModule = EmailSubscriptionTypeRoutingModule;
8037
- exports.EmailSubscriptionUserFormComponent = exports.ɵbe;
8024
+ exports.EmailSubscriptionUserFormComponent = exports.ɵbf;
8038
8025
  exports.EmailSubscriptionUserFormModule = EmailSubscriptionUserFormModule;
8039
8026
  exports.EmailSubscriptionUserFormRoutingModule = EmailSubscriptionUserFormRoutingModule;
8040
- exports.EmailSubscriptionUserListComponent = exports.ɵbf;
8041
- exports.EmailSubscriptionUserListFilterComponent = exports.ɵbh;
8027
+ exports.EmailSubscriptionUserListComponent = exports.ɵbg;
8028
+ exports.EmailSubscriptionUserListFilterComponent = exports.ɵbi;
8042
8029
  exports.EmailSubscriptionUserListFilterModule = EmailSubscriptionUserListFilterModule;
8043
8030
  exports.EmailSubscriptionUserListFilterRoutingModule = EmailSubscriptionUserListFilterRoutingModule;
8044
8031
  exports.EmailSubscriptionUserListModule = EmailSubscriptionUserListModule;
@@ -8077,12 +8064,13 @@
8077
8064
  exports.ReadMoreComponent = ReadMoreComponent;
8078
8065
  exports.ReadMoreModule = ReadMoreModule;
8079
8066
  exports.RouteReusableStrategy = RouteReusableStrategy;
8080
- exports.SearchableSelectorComponent = exports.ɵx;
8067
+ exports.SearchableSelectorComponent = exports.ɵy;
8081
8068
  exports.SearchableSelectorModule = SearchableSelectorModule;
8082
8069
  exports.SnackModule = SnackModule;
8083
8070
  exports.StorageService = StorageService;
8084
8071
  exports.SuccessSnackComponent = SuccessSnackComponent;
8085
- exports.TechlifyConfig = TechlifyConfig;
8072
+ exports.TECHLIFY_CORE_CONFIG_TOKEN = TECHLIFY_CORE_CONFIG_TOKEN;
8073
+ exports.TechlifyConfigModule = TechlifyConfigModule;
8086
8074
  exports.TechlifyFeatureEnabledDirective = TechlifyFeatureEnabledDirective;
8087
8075
  exports.TechlifyFeatureModule = TechlifyFeatureModule;
8088
8076
  exports.TechlifyFeatureRoutes = TechlifyFeatureRoutes;
@@ -8092,7 +8080,7 @@
8092
8080
  exports.TechlifyUpdateHistoryModule = TechlifyUpdateHistoryModule;
8093
8081
  exports.TechlifyUpdateModule = TechlifyUpdateModule;
8094
8082
  exports.Timeline = Timeline;
8095
- exports.TimelineFilterComponent = exports.ɵbb;
8083
+ exports.TimelineFilterComponent = exports.ɵbc;
8096
8084
  exports.TimelineFilterModule = TimelineFilterModule;
8097
8085
  exports.TokenInterceptor = TokenInterceptor;
8098
8086
  exports.UpdateNotifierComponent = UpdateNotifierComponent;
@@ -8105,29 +8093,30 @@
8105
8093
  exports.esulr = esulr;
8106
8094
  exports.ɵa = SnackModule;
8107
8095
  exports.ɵb = SuccessSnackComponent;
8108
- exports.ɵba = NumberSelector;
8109
- exports.ɵbc = TimelineFilterRoutingModule;
8110
- exports.ɵbd = LoaderComponent;
8111
- exports.ɵbg = AuthenticationGuard;
8112
- exports.ɵbm = TechlifyUpdateService;
8113
- exports.ɵbn = TechlifyUpdateRoutingModule;
8114
- exports.ɵbo = TechlifyUpdateFormModule;
8115
- exports.ɵbp = TechlifyUpdateFormComponent;
8116
- exports.ɵbq = TechlifyUpdateHistoryRoutingModule;
8117
- exports.ɵbs = UpdateNotifierSnackComponent;
8118
- exports.ɵbt = UpdateViewModule;
8119
- exports.ɵbu = UpdateViewComponent;
8120
- exports.ɵbv = DataManager;
8121
- exports.ɵbw = ErrorHandlerService;
8122
- exports.ɵbx = FieldMappingComponent;
8123
- exports.ɵby = FailedItemsListComponent;
8124
- exports.ɵbz = ImportHistoryListComponent;
8096
+ exports.ɵba = NumItemsSelector;
8097
+ exports.ɵbb = NumberSelector;
8098
+ exports.ɵbd = TimelineFilterRoutingModule;
8099
+ exports.ɵbe = LoaderComponent;
8100
+ exports.ɵbh = AuthenticationGuard;
8101
+ exports.ɵbn = TechlifyUpdateService;
8102
+ exports.ɵbo = TechlifyUpdateRoutingModule;
8103
+ exports.ɵbp = TechlifyUpdateFormModule;
8104
+ exports.ɵbq = TechlifyUpdateFormComponent;
8105
+ exports.ɵbr = TechlifyUpdateHistoryRoutingModule;
8106
+ exports.ɵbt = UpdateNotifierSnackComponent;
8107
+ exports.ɵbu = UpdateViewModule;
8108
+ exports.ɵbv = UpdateViewComponent;
8109
+ exports.ɵbw = DataManager;
8110
+ exports.ɵbx = ErrorHandlerService;
8111
+ exports.ɵby = FieldMappingComponent;
8112
+ exports.ɵbz = FailedItemsListComponent;
8125
8113
  exports.ɵc = ErrorSnackComponent;
8126
- exports.ɵca = ImportSuccessComponent;
8127
- exports.ɵcb = DataImportComponent;
8128
- exports.ɵcc = StorageService;
8129
- exports.ɵcd = TechlifyFeatureService;
8130
- exports.ɵce = OnOffSwitchComponent;
8114
+ exports.ɵca = ImportHistoryListComponent;
8115
+ exports.ɵcb = ImportSuccessComponent;
8116
+ exports.ɵcc = DataImportComponent;
8117
+ exports.ɵcd = StorageService;
8118
+ exports.ɵce = TechlifyFeatureService;
8119
+ exports.ɵcf = OnOffSwitchComponent;
8131
8120
  exports.ɵd = HTTP_DYNAMIC_INTERCEPTORS;
8132
8121
  exports.ɵe = HttpService;
8133
8122
  exports.ɵf = RouteReusableStrategy;
@@ -8145,9 +8134,8 @@
8145
8134
  exports.ɵt = CommentFormComponent;
8146
8135
  exports.ɵu = CredentialsService;
8147
8136
  exports.ɵv = ConfigService;
8148
- exports.ɵw = TechlifyConfig;
8149
- exports.ɵy = MatSelectInfiniteScrollDirective;
8150
- exports.ɵz = NumItemsSelector;
8137
+ exports.ɵw = TECHLIFY_CORE_CONFIG_TOKEN;
8138
+ exports.ɵz = MatSelectInfiniteScrollDirective;
8151
8139
 
8152
8140
  Object.defineProperty(exports, '__esModule', { value: true });
8153
8141