ngx-techlify-core 11.4.5-beta.3 → 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,79 +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.projectKey = '';
746
- this.environment = '';
747
- this.authClientSecret = '';
748
- this.authGrantType = '';
749
- this.apiUrl = '';
750
- this.isLogoutWhileApiGetsFailed = false;
751
- this.loadFromMap(data);
752
- }
753
- TechlifyConfig.prototype.loadFromMap = function (data) {
754
- this.projectKey = data.projectKey;
755
- this.environment = data.environment;
756
- this.authClientSecret = data.authClientSecret;
757
- this.authGrantType = data.authGrantType;
758
- this.apiUrl = data.apiUrl;
759
- this.storage = data === null || data === void 0 ? void 0 : data.storage;
760
- this.rawConfigs = data;
761
- this.isLogoutWhileApiGetsFailed = data === null || data === void 0 ? void 0 : data.isLogoutWhileApiGetsFailed;
762
- };
763
- return TechlifyConfig;
764
- }());
765
-
766
- /**
767
- * Service that provides settings for all other services
768
- *
769
- * @author Joshua Kissoon
770
- * @since 20170709
771
- */
772
- var ConfigService = /** @class */ (function () {
773
- function ConfigService(config) {
774
- this.config = config;
775
- }
776
- ConfigService.prototype.getConfigsRaw = function () {
777
- return this.config.rawConfigs;
778
- };
779
- ConfigService.prototype.getProjectKey = function () {
780
- return this.config.projectKey;
781
- };
782
- ConfigService.prototype.getApiUrl = function () {
783
- return this.config.apiUrl;
784
- };
785
- ConfigService.prototype.getAuthClientSecret = function () {
786
- return this.config.authClientSecret;
787
- };
788
- ConfigService.prototype.getStorage = function () {
789
- return this.config.storage ? this.config.storage : localStorage;
790
- };
791
- ConfigService.prototype.getAuthGrantType = function () {
792
- return this.config.authGrantType;
793
- };
794
- ConfigService.prototype.getCredentialsKey = function () {
795
- return this.config.projectKey + "_" + ConfigService.BASE_CREDENTIALS;
796
- };
797
- return ConfigService;
798
- }());
799
- ConfigService.BASE_CREDENTIALS = "credentials";
800
- ConfigService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ConfigService_Factory() { return new ConfigService(i0.ɵɵinject(TechlifyConfig)); }, token: ConfigService, providedIn: "root" });
801
- ConfigService.decorators = [
802
- { type: i0.Injectable, args: [{
803
- providedIn: 'root'
804
- },] }
805
- ];
806
- ConfigService.ctorParameters = function () { return [
807
- { type: TechlifyConfig }
808
- ]; };
809
-
810
737
  var SuccessSnackComponent = /** @class */ (function () {
811
738
  function SuccessSnackComponent(data) {
812
739
  this.data = data;
@@ -840,6 +767,29 @@
840
767
  { type: undefined, decorators: [{ type: i0.Inject, args: [i1.MAT_SNACK_BAR_DATA,] }] }
841
768
  ]; };
842
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
+
843
793
  /**
844
794
  * Service used to manage alerts in the entire system frontend
845
795
  *
@@ -878,133 +828,240 @@
878
828
  ]; };
879
829
 
880
830
  /**
881
- * Service used to handle errors from the request
882
- *
883
- * @author Joshua Kissoon
884
- * @since 20171202
831
+ * Prefixes all requests not starting with `http[s]` with `environment.serverUrl`.
885
832
  */
886
- var ErrorHandlerService = /** @class */ (function () {
887
- function ErrorHandlerService(alerter) {
888
- this.alerter = alerter;
833
+ var ApiPrefixInterceptor = /** @class */ (function () {
834
+ function ApiPrefixInterceptor(configService) {
835
+ this.configService = configService;
889
836
  }
890
- ErrorHandlerService.prototype.handleError = function (errorResponse, msg) {
891
- if (msg === void 0) { msg = ''; }
892
- var _a, _b, _c, _d;
893
- // 1 - Create empty array to store errors
894
- var errors = [];
895
- // 2 - check if the error object is present in the response
896
- if (errorResponse === null || errorResponse === void 0 ? void 0 : errorResponse.error) {
897
- // 3 - Check for Laravel form validation error messages object
898
- if ((_a = errorResponse === null || errorResponse === void 0 ? void 0 : errorResponse.error) === null || _a === void 0 ? void 0 : _a.errors) {
899
- // 4 - For each error property (which is a form field)
900
- for (var property in errorResponse.error.errors) {
901
- if ((_b = errorResponse.error.errors) === null || _b === void 0 ? void 0 : _b.hasOwnProperty(property)) {
902
- // 5 - Extract it's array of errors
903
- var propertyErrors = (_c = errorResponse === null || errorResponse === void 0 ? void 0 : errorResponse.error) === null || _c === void 0 ? void 0 : _c.errors[property];
904
- // 6 - Push all errors in the array to the errors array
905
- propertyErrors.forEach(function (error) { return errors.push(error); });
906
- }
907
- }
908
- }
909
- if (errors.length === 0) {
910
- // 7 - Push the main error message to the array of errors if there is no validation error
911
- errors.push(errorResponse.error.message ? errorResponse.error.message : (_d = errorResponse.error) === null || _d === void 0 ? void 0 : _d.error);
912
- }
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 });
913
840
  }
914
- var errMessage = errors.length ? errors[0] : msg;
915
- this.alerter.addAlert("Error: " + errMessage, "warning");
841
+ return next.handle(request);
916
842
  };
917
- return ErrorHandlerService;
843
+ return ApiPrefixInterceptor;
918
844
  }());
919
- ErrorHandlerService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ErrorHandlerService_Factory() { return new ErrorHandlerService(i0.ɵɵinject(AlertService)); }, token: ErrorHandlerService, providedIn: "root" });
920
- ErrorHandlerService.decorators = [
845
+ ApiPrefixInterceptor.ɵprov = i0.ɵɵdefineInjectable({ factory: function ApiPrefixInterceptor_Factory() { return new ApiPrefixInterceptor(i0.ɵɵinject(ConfigService)); }, token: ApiPrefixInterceptor, providedIn: "root" });
846
+ ApiPrefixInterceptor.decorators = [
921
847
  { type: i0.Injectable, args: [{
922
848
  providedIn: 'root'
923
849
  },] }
924
850
  ];
925
- ErrorHandlerService.ctorParameters = function () { return [
926
- { type: AlertService }
851
+ ApiPrefixInterceptor.ctorParameters = function () { return [
852
+ { type: ConfigService }
927
853
  ]; };
928
854
 
929
- var log = new Logger('ErrorHandlerInterceptor');
930
855
  /**
931
- * Adds a default error handler to all requests.
856
+ * Provides storage for authentication credentials.
857
+ * The Credentials interface should be replaced with proper implementation.
932
858
  */
933
- var ErrorHandlerInterceptor = /** @class */ (function () {
934
- function ErrorHandlerInterceptor(configService, errorHandler) {
859
+ var CredentialsService = /** @class */ (function () {
860
+ function CredentialsService(configService) {
935
861
  this.configService = configService;
936
- this.errorHandler = errorHandler;
862
+ this._credentials = null;
937
863
  }
938
- ErrorHandlerInterceptor.prototype.intercept = function (request, next) {
939
- var _this = this;
940
- return next.handle(request).pipe(operators.catchError(function (error) { return _this.handleError(error); }));
941
- };
942
- // Customize the default error handler here if needed
943
- ErrorHandlerInterceptor.prototype.handleError = function (error) {
944
- var _a, _b, _c;
945
- var errorMessage = '';
946
- if (error.error instanceof ErrorEvent) {
947
- // client-side error
948
- 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));
949
900
  }
950
901
  else {
951
- // server-side error
952
- errorMessage = "Server Error: " + ((_b = this.configService) === null || _b === void 0 ? void 0 : _b.getProjectKey());
953
- try {
954
- if (error.status == 403 && ((_c = this.configService.getConfigsRaw()) === null || _c === void 0 ? void 0 : _c.isLogoutWhileApiGetsFailed)) {
955
- sessionStorage.clear();
956
- localStorage.clear();
957
- location.reload();
958
- }
959
- this.errorHandler.handleError(error, 'Unexpected Server Error, try later or contact service team');
960
- }
961
- catch (e) {
962
- console.log("Unable to handle server error", e);
963
- }
902
+ sessionStorage.clear();
903
+ localStorage.clear();
904
+ this._credentials = null;
964
905
  }
965
- return rxjs.throwError(error);
966
906
  };
967
- 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;
968
933
  }());
969
- ErrorHandlerInterceptor.ɵprov = i0.ɵɵdefineInjectable({ factory: function ErrorHandlerInterceptor_Factory() { return new ErrorHandlerInterceptor(i0.ɵɵinject(ConfigService), i0.ɵɵinject(ErrorHandlerService)); }, token: ErrorHandlerInterceptor, providedIn: "root" });
970
- ErrorHandlerInterceptor.decorators = [
934
+ CredentialsService.ɵprov = i0.ɵɵdefineInjectable({ factory: function CredentialsService_Factory() { return new CredentialsService(i0.ɵɵinject(ConfigService)); }, token: CredentialsService, providedIn: "root" });
935
+ CredentialsService.decorators = [
971
936
  { type: i0.Injectable, args: [{
972
937
  providedIn: 'root'
973
938
  },] }
974
939
  ];
975
- ErrorHandlerInterceptor.ctorParameters = function () { return [
976
- { type: ConfigService },
977
- { type: ErrorHandlerService }
940
+ CredentialsService.ctorParameters = function () { return [
941
+ { type: ConfigService }
978
942
  ]; };
979
943
 
980
- var log$1 = new Logger('HttpCacheService');
981
- /**
982
- * Provides a cache facility for HTTP requests with configurable persistence policy.
983
- */
984
- var HttpCacheService = /** @class */ (function () {
985
- function HttpCacheService(configService) {
986
- this.configService = configService;
987
- this.cachedData = {};
988
- this.storage = this.configService.getStorage();
989
- this.cachePersistenceKey = this.configService.getProjectKey() + '_HTTP_CACHE';
990
- 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;
991
949
  }
992
- /**
993
- * Sets the cache data for the specified request.
994
- * @param {!string} url The request URL.
995
- * @param {ResponseOptions} data The received data.
996
- * @param {Date=} lastUpdated The cache last update, current date is used if not specified.
997
- */
998
- HttpCacheService.prototype.setCacheData = function (url, data, lastUpdated) {
999
- this.cachedData[url] = {
1000
- lastUpdated: lastUpdated || new Date(),
1001
- data: data
1002
- };
1003
- log$1.debug("Cache set for key: \"" + url + "\"");
1004
- this.saveCacheData();
950
+ AuthenticationGuard.prototype.canActivate = function (route, state) {
951
+ return this.isUserAuthenticated(route, state);
1005
952
  };
1006
- /**
1007
- * Gets the cached data for the specified request.
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 + "\"");
1061
+ this.saveCacheData();
1062
+ };
1063
+ /**
1064
+ * Gets the cached data for the specified request.
1008
1065
  * @param {!string} url The request URL.
1009
1066
  * @return {?ResponseOptions} The cached data or null if no cached data exists for this request.
1010
1067
  */
@@ -1114,13 +1171,13 @@
1114
1171
  var cachedData = _this.forceUpdate ? null : _this.httpCacheService.getCacheData(request.urlWithParams);
1115
1172
  if (cachedData !== null) {
1116
1173
  // Create new response to avoid side-effects
1117
- subscriber.next(new i1$1.HttpResponse(cachedData));
1174
+ subscriber.next(new i1$2.HttpResponse(cachedData));
1118
1175
  subscriber.complete();
1119
1176
  }
1120
1177
  else {
1121
1178
  next.handle(request)
1122
1179
  .subscribe(function (event) {
1123
- if (event instanceof i1$1.HttpResponse) {
1180
+ if (event instanceof i1$2.HttpResponse) {
1124
1181
  _this.httpCacheService.setCacheData(request.urlWithParams, event);
1125
1182
  }
1126
1183
  subscriber.next(event);
@@ -1141,123 +1198,155 @@
1141
1198
  ]; };
1142
1199
 
1143
1200
  /**
1144
- * 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
1145
1205
  */
1146
- var ApiPrefixInterceptor = /** @class */ (function () {
1147
- function ApiPrefixInterceptor(configService) {
1148
- this.configService = configService;
1206
+ var ErrorHandlerService = /** @class */ (function () {
1207
+ function ErrorHandlerService(alerter) {
1208
+ this.alerter = alerter;
1149
1209
  }
1150
- ApiPrefixInterceptor.prototype.intercept = function (request, next) {
1151
- if (!/^(http|https):/i.test(request.url)) {
1152
- 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
+ }
1153
1233
  }
1154
- return next.handle(request);
1234
+ var errMessage = errors.length ? errors[0] : msg;
1235
+ this.alerter.addAlert("Error: " + errMessage, "warning");
1155
1236
  };
1156
- return ApiPrefixInterceptor;
1237
+ return ErrorHandlerService;
1157
1238
  }());
1158
- ApiPrefixInterceptor.ɵprov = i0.ɵɵdefineInjectable({ factory: function ApiPrefixInterceptor_Factory() { return new ApiPrefixInterceptor(i0.ɵɵinject(ConfigService)); }, token: ApiPrefixInterceptor, providedIn: "root" });
1159
- ApiPrefixInterceptor.decorators = [
1239
+ ErrorHandlerService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ErrorHandlerService_Factory() { return new ErrorHandlerService(i0.ɵɵinject(AlertService)); }, token: ErrorHandlerService, providedIn: "root" });
1240
+ ErrorHandlerService.decorators = [
1160
1241
  { type: i0.Injectable, args: [{
1161
1242
  providedIn: 'root'
1162
1243
  },] }
1163
1244
  ];
1164
- ApiPrefixInterceptor.ctorParameters = function () { return [
1165
- { type: ConfigService }
1245
+ ErrorHandlerService.ctorParameters = function () { return [
1246
+ { type: AlertService }
1166
1247
  ]; };
1167
1248
 
1168
- /**
1169
- * Provides storage for authentication credentials.
1170
- * The Credentials interface should be replaced with proper implementation.
1171
- */
1172
- var CredentialsService = /** @class */ (function () {
1173
- function CredentialsService(configService) {
1174
- this.configService = configService;
1175
- this._credentials = null;
1249
+ var FormValidatorService = /** @class */ (function () {
1250
+ function FormValidatorService() {
1176
1251
  }
1177
- Object.defineProperty(CredentialsService.prototype, "isAuthenticated", {
1178
- /**
1179
- * Checks is the user is authenticated.
1180
- * @return True if the user is authenticated.
1181
- */
1182
- get: function () {
1183
- return !!this.credentials;
1184
- },
1185
- enumerable: false,
1186
- configurable: true
1187
- });
1188
- Object.defineProperty(CredentialsService.prototype, "credentials", {
1189
- /**
1190
- * Gets the user credentials.
1191
- * @return The user credentials or null if the user is not authenticated.
1192
- */
1193
- get: function () {
1194
- if (!this._credentials) {
1195
- this._credentials = JSON.parse(sessionStorage.getItem(this.configService.getCredentialsKey()) || localStorage.getItem(this.configService.getCredentialsKey()));
1196
- }
1197
- return this._credentials;
1198
- },
1199
- enumerable: false,
1200
- configurable: true
1201
- });
1202
- /**
1203
- * Sets the user credentials.
1204
- * The credentials may be persisted across sessions by setting the `remember` parameter to true.
1205
- * Otherwise, the credentials are only persisted for the current session.
1206
- * @param credentials The user credentials.
1207
- * @param remember True to remember credentials across sessions.
1208
- */
1209
- CredentialsService.prototype.setCredentials = function (credentials, remember) {
1210
- this._credentials = credentials || null;
1211
- if (credentials) {
1212
- (remember ? localStorage : sessionStorage).setItem(this.configService.getCredentialsKey(), JSON.stringify(credentials));
1213
- }
1214
- else {
1215
- sessionStorage.clear();
1216
- localStorage.clear();
1217
- this._credentials = null;
1218
- }
1219
- };
1220
- CredentialsService.prototype.getAccessToken = function () {
1221
- var _a, _b, _c, _d;
1222
- var expiration = ((_b = (_a = this.credentials) === null || _a === void 0 ? void 0 : _a.token) === null || _b === void 0 ? void 0 : _b.expires_in) || '';
1223
- var token = ((_d = (_c = this.credentials) === null || _c === void 0 ? void 0 : _c.token) === null || _d === void 0 ? void 0 : _d.access_token) || '';
1224
- if (!token || !expiration) {
1225
- return null;
1226
- }
1227
- if (Date.now() > parseInt(expiration)) {
1228
- this.setCredentials();
1229
- return null;
1230
- }
1231
- return token;
1232
- };
1233
- CredentialsService.prototype.getExpiration = function () {
1234
- var _a, _b;
1235
- return ((_b = (_a = this.credentials) === null || _a === void 0 ? void 0 : _a.token) === null || _b === void 0 ? void 0 : _b.expires_in) || '';
1236
- };
1237
- CredentialsService.prototype.getRefreshToken = function () {
1238
- var _a, _b;
1239
- 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);
1240
1256
  };
1241
- CredentialsService.prototype.refresh = function () {
1242
- this._credentials = null;
1243
- 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]] : '') : '';
1244
1261
  };
1245
- return CredentialsService;
1262
+ return FormValidatorService;
1246
1263
  }());
1247
- CredentialsService.ɵprov = i0.ɵɵdefineInjectable({ factory: function CredentialsService_Factory() { return new CredentialsService(i0.ɵɵinject(ConfigService)); }, token: CredentialsService, providedIn: "root" });
1248
- CredentialsService.decorators = [
1264
+ FormValidatorService.ɵprov = i0.ɵɵdefineInjectable({ factory: function FormValidatorService_Factory() { return new FormValidatorService(); }, token: FormValidatorService, providedIn: "root" });
1265
+ FormValidatorService.decorators = [
1249
1266
  { type: i0.Injectable, args: [{
1250
1267
  providedIn: 'root'
1251
1268
  },] }
1252
1269
  ];
1253
- CredentialsService.ctorParameters = function () { return [
1254
- { type: ConfigService }
1255
- ]; };
1270
+ FormValidatorService.ctorParameters = function () { return []; };
1256
1271
 
1257
1272
  /**
1258
- * Prefixes all requests not starting with `http[s]` with `environment.serverUrl`.
1259
- */
1260
- var TokenInterceptor = /** @class */ (function () {
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`.
1348
+ */
1349
+ var TokenInterceptor = /** @class */ (function () {
1261
1350
  function TokenInterceptor(credentials) {
1262
1351
  this.credentials = credentials;
1263
1352
  }
@@ -1282,77 +1371,311 @@
1282
1371
  ]; };
1283
1372
 
1284
1373
  /**
1285
- * 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
1286
1378
  */
1287
- var HeaderInterceptor = /** @class */ (function () {
1288
- function HeaderInterceptor() {
1379
+ var DataManager = /** @class */ (function () {
1380
+ function DataManager(http) {
1381
+ this.http = http;
1289
1382
  }
1290
- HeaderInterceptor.prototype.intercept = function (request, next) {
1291
- request = request.clone({
1292
- setHeaders: {
1293
- 'Content-Type': request.headers.get('Content-Type') || 'application/json',
1294
- }
1295
- });
1296
- 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();
1297
1397
  };
1298
- 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;
1299
1481
  }());
1300
- HeaderInterceptor.ɵprov = i0.ɵɵdefineInjectable({ factory: function HeaderInterceptor_Factory() { return new HeaderInterceptor(); }, token: HeaderInterceptor, providedIn: "root" });
1301
- HeaderInterceptor.decorators = [
1482
+ DataManager.ɵprov = i0.ɵɵdefineInjectable({ factory: function DataManager_Factory() { return new DataManager(i0.ɵɵinject(HttpService)); }, token: DataManager, providedIn: "root" });
1483
+ DataManager.decorators = [
1302
1484
  { type: i0.Injectable, args: [{
1303
1485
  providedIn: 'root'
1304
1486
  },] }
1305
1487
  ];
1488
+ DataManager.ctorParameters = function () { return [
1489
+ { type: HttpService }
1490
+ ]; };
1306
1491
 
1307
- // From @angular/common/http/src/interceptor: allows to chain interceptors
1308
- var HttpInterceptorHandler = /** @class */ (function () {
1309
- function HttpInterceptorHandler(next, interceptor) {
1310
- this.next = next;
1311
- this.interceptor = interceptor;
1492
+ var TechlifyConfigModule = /** @class */ (function () {
1493
+ function TechlifyConfigModule() {
1312
1494
  }
1313
- HttpInterceptorHandler.prototype.handle = function (request) {
1314
- 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
+ };
1315
1505
  };
1316
- return HttpInterceptorHandler;
1506
+ return TechlifyConfigModule;
1317
1507
  }());
1508
+ TechlifyConfigModule.decorators = [
1509
+ { type: i0.NgModule, args: [{
1510
+ declarations: [],
1511
+ imports: [],
1512
+ exports: []
1513
+ },] }
1514
+ ];
1515
+
1318
1516
  /**
1319
- * Allows to override default dynamic interceptors that can be disabled with the HttpService extension.
1320
- * Except for very specific needs, you should better configure these interceptors directly in the constructor below
1321
- * for better readability.
1517
+ * Service that provides settings for all other services
1322
1518
  *
1323
- * For static interceptors that should always be enabled (like ApiPrefixInterceptor), use the standard
1324
- * HTTP_INTERCEPTORS token.
1325
- */
1326
- var HTTP_DYNAMIC_INTERCEPTORS = new i0.InjectionToken('HTTP_DYNAMIC_INTERCEPTORS');
1327
- /**
1328
- * Extends HttpClient with per request configuration using dynamic interceptors.
1519
+ * @author Joshua Kissoon
1520
+ * @since 20170709
1329
1521
  */
1330
- var HttpService = /** @class */ (function (_super) {
1331
- __extends(HttpService, _super);
1332
- function HttpService(httpHandler, injector, interceptors) {
1333
- if (interceptors === void 0) { interceptors = []; }
1334
- var _this = _super.call(this, httpHandler) || this;
1335
- _this.httpHandler = httpHandler;
1336
- _this.injector = injector;
1337
- _this.interceptors = interceptors;
1338
- if (!_this.interceptors) {
1339
- // Configure default interceptors that can be disabled here
1340
- _this.interceptors = [_this.injector.get(ApiPrefixInterceptor), _this.injector.get(HeaderInterceptor), _this.injector.get(TokenInterceptor), _this.injector.get(ErrorHandlerInterceptor)];
1341
- }
1342
- return _this;
1522
+ var ConfigService = /** @class */ (function () {
1523
+ function ConfigService(techlifyConfig) {
1524
+ this.techlifyConfig = techlifyConfig;
1525
+ this.config = techlifyConfig;
1343
1526
  }
1344
- HttpService.prototype.cache = function (forceUpdate) {
1345
- var cacheInterceptor = this.injector.get(CacheInterceptor).configure({ update: forceUpdate });
1346
- return this.addInterceptor(cacheInterceptor);
1347
- };
1348
- HttpService.prototype.skipErrorHandler = function () {
1349
- return this.removeInterceptor(ErrorHandlerInterceptor);
1527
+ ConfigService.prototype.getConfigsRaw = function () {
1528
+ return this.config.rawConfigs;
1350
1529
  };
1351
- HttpService.prototype.skipApiPrefix = function () {
1352
- return this.removeInterceptor(ApiPrefixInterceptor);
1530
+ ConfigService.prototype.getProjectKey = function () {
1531
+ return this.config.projectKey;
1353
1532
  };
1354
- HttpService.prototype.skipToken = function () {
1355
- return this.removeInterceptor(TokenInterceptor);
1533
+ ConfigService.prototype.getApiUrl = function () {
1534
+ return this.config.apiUrl;
1535
+ };
1536
+ ConfigService.prototype.getAuthClientSecret = function () {
1537
+ return this.config.authClientSecret;
1538
+ };
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);
1356
1679
  };
1357
1680
  HttpService.prototype.skipHeader = function () {
1358
1681
  return this.removeInterceptor(HeaderInterceptor);
@@ -1360,7 +1683,7 @@
1360
1683
  // Override the original method to wire interceptors when triggering the request.
1361
1684
  HttpService.prototype.request = function (method, url, options) {
1362
1685
  var handler = this.interceptors.reduceRight(function (next, interceptor) { return new HttpInterceptorHandler(next, interceptor); }, this.httpHandler);
1363
- return new i1$1.HttpClient(handler).request(method, url, options);
1686
+ return new i1$2.HttpClient(handler).request(method, url, options);
1364
1687
  };
1365
1688
  HttpService.prototype.removeInterceptor = function (interceptorType) {
1366
1689
  return new HttpService(this.httpHandler, this.injector, this.interceptors.filter(function (i) { return !(i instanceof interceptorType); }));
@@ -1369,15 +1692,15 @@
1369
1692
  return new HttpService(this.httpHandler, this.injector, this.interceptors.concat([interceptor]));
1370
1693
  };
1371
1694
  return HttpService;
1372
- }(i1$1.HttpClient));
1373
- 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" });
1374
1697
  HttpService.decorators = [
1375
1698
  { type: i0.Injectable, args: [{
1376
1699
  providedIn: 'root'
1377
1700
  },] }
1378
1701
  ];
1379
1702
  HttpService.ctorParameters = function () { return [
1380
- { type: i1$1.HttpHandler },
1703
+ { type: i1$2.HttpHandler },
1381
1704
  { type: i0.Injector },
1382
1705
  { type: Array, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [HTTP_DYNAMIC_INTERCEPTORS,] }] }
1383
1706
  ]; };
@@ -1421,29 +1744,6 @@
1421
1744
  { type: HttpService }
1422
1745
  ]; };
1423
1746
 
1424
- var FormValidatorService = /** @class */ (function () {
1425
- function FormValidatorService() {
1426
- }
1427
- /**Method to evaluate form fields*/
1428
- FormValidatorService.prototype.isFieldValid = function (field, formGroup, firstAttempt) {
1429
- return (!formGroup.get(field).valid && formGroup.get(field).touched) ||
1430
- (!formGroup.get(field).valid && formGroup.get(field).untouched && firstAttempt);
1431
- };
1432
- /**Method to find error in form fields*/
1433
- FormValidatorService.prototype.getErrorMessage = function (field, formGroup, errorMessages, errorField) {
1434
- var error = Object.keys(formGroup.get(field).errors);
1435
- return (error.length > 0) ? (errorMessages[errorField || field][error[0]] ? errorMessages[errorField || field][error[0]] : '') : '';
1436
- };
1437
- return FormValidatorService;
1438
- }());
1439
- FormValidatorService.ɵprov = i0.ɵɵdefineInjectable({ factory: function FormValidatorService_Factory() { return new FormValidatorService(); }, token: FormValidatorService, providedIn: "root" });
1440
- FormValidatorService.decorators = [
1441
- { type: i0.Injectable, args: [{
1442
- providedIn: 'root'
1443
- },] }
1444
- ];
1445
- FormValidatorService.ctorParameters = function () { return []; };
1446
-
1447
1747
  var errorMessages = {
1448
1748
  url: {
1449
1749
  required: "File is required"
@@ -2346,7 +2646,7 @@
2346
2646
  };
2347
2647
 
2348
2648
  var SearchableSelectorComponent_1;
2349
- exports.ɵx = SearchableSelectorComponent_1 = /** @class */ (function () {
2649
+ exports.ɵy = SearchableSelectorComponent_1 = /** @class */ (function () {
2350
2650
  function SearchableSelectorComponent(formBuilder, _focusMonitor, http, _elementRef, dialog, ngControl) {
2351
2651
  var _this = this;
2352
2652
  this._focusMonitor = _focusMonitor;
@@ -2624,8 +2924,8 @@
2624
2924
  };
2625
2925
  return SearchableSelectorComponent;
2626
2926
  }());
2627
- exports.ɵx.nextId = 0;
2628
- exports.ɵx.decorators = [
2927
+ exports.ɵy.nextId = 0;
2928
+ exports.ɵy.decorators = [
2629
2929
  { type: i0.Component, args: [{
2630
2930
  selector: 'app-searchable-selector',
2631
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>",
@@ -2638,7 +2938,7 @@
2638
2938
  styles: [".searchable-selctor-container{display:flex}.relative-icon{position:relative;top:-4px}"]
2639
2939
  },] }
2640
2940
  ];
2641
- exports.ɵx.ctorParameters = function () { return [
2941
+ exports.ɵy.ctorParameters = function () { return [
2642
2942
  { type: forms.FormBuilder },
2643
2943
  { type: a11y.FocusMonitor },
2644
2944
  { type: HttpService },
@@ -2646,7 +2946,7 @@
2646
2946
  { type: dialog.MatDialog },
2647
2947
  { type: forms.NgControl, decorators: [{ type: i0.Optional }, { type: i0.Self }] }
2648
2948
  ]; };
2649
- exports.ɵx.propDecorators = {
2949
+ exports.ɵy.propDecorators = {
2650
2950
  valueField: [{ type: i0.Input }],
2651
2951
  titleField: [{ type: i0.Input }],
2652
2952
  apiUrl: [{ type: i0.Input }],
@@ -2673,9 +2973,9 @@
2673
2973
  disabled: [{ type: i0.Input }],
2674
2974
  value: [{ type: i0.Input }]
2675
2975
  };
2676
- exports.ɵx = SearchableSelectorComponent_1 = __decorate([
2976
+ exports.ɵy = SearchableSelectorComponent_1 = __decorate([
2677
2977
  untilDestroy.UntilDestroy()
2678
- ], exports.ɵx);
2978
+ ], exports.ɵy);
2679
2979
 
2680
2980
  var MatSelectInfiniteScrollDirective = /** @class */ (function () {
2681
2981
  function MatSelectInfiniteScrollDirective(matSelect, ngZone) {
@@ -2997,7 +3297,7 @@
2997
3297
  }
2998
3298
 
2999
3299
  var TimelineFilterComponent_1;
3000
- exports.ɵbb = TimelineFilterComponent_1 = /** @class */ (function () {
3300
+ exports.ɵbc = TimelineFilterComponent_1 = /** @class */ (function () {
3001
3301
  function TimelineFilterComponent(formBuilder, ngControl, datePipe) {
3002
3302
  this.ngControl = ngControl;
3003
3303
  this.datePipe = datePipe;
@@ -3095,454 +3395,147 @@
3095
3395
  var str = "";
3096
3396
  if ((_a = this.selectedRange) === null || _a === void 0 ? void 0 : _a.show_custom_field) {
3097
3397
  if (((_b = this.selectedRange) === null || _b === void 0 ? void 0 : _b.date_from.toUTCString()) != 'Invalid Date') {
3098
- 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());
3099
- }
3100
- if (((_e = this.selectedRange) === null || _e === void 0 ? void 0 : _e.date_to.toUTCString()) != 'Invalid Date') {
3101
- 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());
3102
- }
3103
- }
3104
- return str;
3105
- };
3106
- TimelineFilterComponent.prototype.resetFieldValue = function (field) {
3107
- this.form.get(field).setValue('');
3108
- };
3109
- TimelineFilterComponent.prototype.getFieldValue = function (field) {
3110
- return this.form.get(field).value;
3111
- };
3112
- TimelineFilterComponent.prototype.setFieldValue = function (field, value) {
3113
- this.form.get(field).setValue(value);
3114
- };
3115
- TimelineFilterComponent.prototype.changeTimeline = function (value) {
3116
- var timeline = calculateTimeline(value);
3117
- if (timeline) {
3118
- this.setFieldValue(this.dateFrom, timeline.date_from);
3119
- this.setFieldValue(this.dateTo, timeline.date_to);
3120
- this.showCustomDateFields = timeline.show_custom_field;
3121
- }
3122
- };
3123
- TimelineFilterComponent.prototype._handleInput = function () {
3124
- if (this.value == 1) {
3125
- this.picker.open();
3126
- return;
3127
- }
3128
- var range = calculateTimeline(this.value);
3129
- this.selectedRange = range;
3130
- this.onChange(this.value);
3131
- this.selectedValueChange.emit(this.selectedValue);
3132
- this.selectionChange.emit(range);
3133
- };
3134
- TimelineFilterComponent.prototype.dateRangeChange = function (dateRangeStart, dateRangeEnd) {
3135
- var range = {
3136
- date_from: new Date(dateRangeStart.value),
3137
- date_to: new Date(dateRangeEnd.value),
3138
- show_custom_field: true
3139
- };
3140
- this.selectedRange = range;
3141
- this.onChange(this.value);
3142
- this.selectedValueChange.emit(this.selectedValue);
3143
- this.selectionChange.emit(range);
3144
- };
3145
- TimelineFilterComponent.prototype.onCustomDateChange = function (event) {
3146
- };
3147
- TimelineFilterComponent.prototype.setDescribedByIds = function (ids) {
3148
- this.describedBy = ids.join(' ');
3149
- };
3150
- TimelineFilterComponent.prototype.onContainerClick = function (event) {
3151
- event.stopPropagation();
3152
- };
3153
- TimelineFilterComponent.prototype.writeValue = function (data) {
3154
- this.value = data;
3155
- };
3156
- TimelineFilterComponent.prototype.registerOnChange = function (fn) {
3157
- this.onChange = fn;
3158
- };
3159
- TimelineFilterComponent.prototype.registerOnTouched = function (fn) {
3160
- this.onTouched = fn;
3161
- };
3162
- TimelineFilterComponent.prototype.setDisabledState = function (isDisabled) {
3163
- this.disabled = isDisabled;
3164
- };
3165
- TimelineFilterComponent.prototype.ngOnInit = function () {
3166
- var _this = this;
3167
- console.log(this.form);
3168
- this.timelineValue.valueChanges.
3169
- pipe(operators.debounceTime(100), operators.distinctUntilChanged(), untilDestroy.untilDestroyed(this)).subscribe(function (value) { return _this.changeTimeline(value); });
3170
- };
3171
- TimelineFilterComponent.prototype.ngOnDestroy = function () {
3172
- this.stateChanges.complete();
3173
- };
3174
- return TimelineFilterComponent;
3175
- }());
3176
- exports.ɵbb.nextId = 0;
3177
- exports.ɵbb.decorators = [
3178
- { type: i0.Component, args: [{
3179
- selector: 'app-timeline-filter',
3180
- 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",
3181
- providers: [
3182
- {
3183
- provide: formField.MatFormFieldControl,
3184
- useExisting: TimelineFilterComponent_1
3185
- }
3186
- ],
3187
- styles: [""]
3188
- },] }
3189
- ];
3190
- exports.ɵbb.ctorParameters = function () { return [
3191
- { type: forms.FormBuilder },
3192
- { type: forms.NgControl, decorators: [{ type: i0.Optional }, { type: i0.Self }] },
3193
- { type: common.DatePipe }
3194
- ]; };
3195
- exports.ɵbb.propDecorators = {
3196
- picker: [{ type: i0.ViewChild, args: ['picker',] }],
3197
- timelineValue: [{ type: i0.Input }],
3198
- timelines: [{ type: i0.Input }],
3199
- dateFrom: [{ type: i0.Input }],
3200
- dateTo: [{ type: i0.Input }],
3201
- appearance: [{ type: i0.Input }],
3202
- showClearbutton: [{ type: i0.Input }],
3203
- form: [{ type: i0.Input }],
3204
- labelText: [{ type: i0.Input }],
3205
- selectedValue: [{ type: i0.Input }],
3206
- touchUi: [{ type: i0.Input }],
3207
- selectedValueChange: [{ type: i0.Output }],
3208
- selectionChange: [{ type: i0.Output }],
3209
- defaultValue: [{ type: i0.Input }],
3210
- required: [{ type: i0.Input }],
3211
- disabled: [{ type: i0.Input }],
3212
- value: [{ type: i0.Input }]
3213
- };
3214
- exports.ɵbb = TimelineFilterComponent_1 = __decorate([
3215
- untilDestroy.UntilDestroy()
3216
- ], exports.ɵbb);
3217
-
3218
- var LoaderComponent = /** @class */ (function () {
3219
- function LoaderComponent() {
3220
- this.isLoading = false;
3221
- this.size = 0.6;
3222
- }
3223
- LoaderComponent.prototype.ngOnInit = function () { };
3224
- return LoaderComponent;
3225
- }());
3226
- LoaderComponent.decorators = [
3227
- { type: i0.Component, args: [{
3228
- selector: 'app-loader',
3229
- 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",
3230
- styles: [".mat-progress-spinner{display:inline-block;vertical-align:middle}.message{margin-left:.5em}"]
3231
- },] }
3232
- ];
3233
- LoaderComponent.ctorParameters = function () { return []; };
3234
- LoaderComponent.propDecorators = {
3235
- isLoading: [{ type: i0.Input }],
3236
- size: [{ type: i0.Input }],
3237
- message: [{ type: i0.Input }]
3238
- };
3239
-
3240
- var SnackModule = /** @class */ (function () {
3241
- function SnackModule() {
3242
- }
3243
- return SnackModule;
3244
- }());
3245
- SnackModule.decorators = [
3246
- { type: i0.NgModule, args: [{
3247
- declarations: [
3248
- SuccessSnackComponent,
3249
- ErrorSnackComponent
3250
- ],
3251
- imports: [
3252
- common.CommonModule,
3253
- i1.MatSnackBarModule,
3254
- icon.MatIconModule
3255
- ],
3256
- exports: [
3257
- SuccessSnackComponent,
3258
- ErrorSnackComponent,
3259
- ]
3260
- },] }
3261
- ];
3262
-
3263
- var log$2 = new Logger('AuthenticationGuard');
3264
- var AuthenticationGuard = /** @class */ (function () {
3265
- function AuthenticationGuard(router, credentialsService) {
3266
- this.router = router;
3267
- this.credentialsService = credentialsService;
3268
- }
3269
- AuthenticationGuard.prototype.canActivate = function (route, state) {
3270
- return this.isUserAuthenticated(route, state);
3271
- };
3272
- AuthenticationGuard.prototype.canLoad = function (route, state) {
3273
- return this.isUserAuthenticated(route, state);
3274
- };
3275
- AuthenticationGuard.prototype.isUserAuthenticated = function (route, state) {
3276
- if (this.credentialsService.isAuthenticated) {
3277
- return true;
3278
- }
3279
- log$2.debug('Not authenticated, redirecting and adding redirect url...');
3280
- this.router.navigate(['/login'], { queryParams: { redirect: state.url }, replaceUrl: true });
3281
- return false;
3282
- };
3283
- return AuthenticationGuard;
3284
- }());
3285
- AuthenticationGuard.ɵprov = i0.ɵɵdefineInjectable({ factory: function AuthenticationGuard_Factory() { return new AuthenticationGuard(i0.ɵɵinject(i1$2.Router), i0.ɵɵinject(CredentialsService)); }, token: AuthenticationGuard, providedIn: "root" });
3286
- AuthenticationGuard.decorators = [
3287
- { type: i0.Injectable, args: [{
3288
- providedIn: 'root'
3289
- },] }
3290
- ];
3291
- AuthenticationGuard.ctorParameters = function () { return [
3292
- { type: i1$2.Router },
3293
- { type: CredentialsService }
3294
- ]; };
3295
-
3296
- /**
3297
- * Provides a base for authentication workflow.
3298
- * The login/logout methods should be replaced with proper implementation.
3299
- */
3300
- var AuthenticationService = /** @class */ (function () {
3301
- function AuthenticationService(credentialsService, http) {
3302
- this.credentialsService = credentialsService;
3303
- this.http = http;
3304
- }
3305
- /**
3306
- * Authenticates the user.
3307
- * @param context The login parameters.
3308
- * @return The user credentials.
3309
- */
3310
- AuthenticationService.prototype.login = function (context) {
3311
- var _this = this;
3312
- var data = {};
3313
- return this.http
3314
- .skipToken()
3315
- .post('oauth/token', context)
3316
- .pipe(operators.concatMap(function (tokenInfo) { return __awaiter(_this, void 0, void 0, function () {
3317
- var userInfo;
3318
- return __generator(this, function (_a) {
3319
- switch (_a.label) {
3320
- case 0:
3321
- tokenInfo.expires_in = Date.now() + (tokenInfo.expires_in * 1000);
3322
- data.token = tokenInfo;
3323
- data.user = {};
3324
- this.credentialsService.setCredentials(data, context.remember);
3325
- return [4 /*yield*/, this.http.get('api/user/current').toPromise()];
3326
- case 1:
3327
- userInfo = _a.sent();
3328
- data.user = userInfo === null || userInfo === void 0 ? void 0 : userInfo.user;
3329
- this.credentialsService.setCredentials(data, context.remember);
3330
- return [2 /*return*/, data];
3331
- }
3332
- });
3333
- }); }));
3334
- };
3335
- /**
3336
- * Logs out the user and clear credentials.
3337
- * @return True if the user was logged out successfully.
3338
- */
3339
- AuthenticationService.prototype.logout = function () {
3340
- this.credentialsService.setCredentials();
3341
- return rxjs.of(true);
3342
- };
3343
- return AuthenticationService;
3344
- }());
3345
- AuthenticationService.ɵprov = i0.ɵɵdefineInjectable({ factory: function AuthenticationService_Factory() { return new AuthenticationService(i0.ɵɵinject(CredentialsService), i0.ɵɵinject(HttpService)); }, token: AuthenticationService, providedIn: "root" });
3346
- AuthenticationService.decorators = [
3347
- { type: i0.Injectable, args: [{
3348
- providedIn: 'root'
3349
- },] }
3350
- ];
3351
- AuthenticationService.ctorParameters = function () { return [
3352
- { type: CredentialsService },
3353
- { type: HttpService }
3354
- ]; };
3355
-
3356
- /**
3357
- * A route strategy allowing for explicit route reuse.
3358
- * Used as a workaround for https://github.com/angular/angular/issues/18374
3359
- * To reuse a given route, add `data: { reuse: true }` to the route definition.
3360
- */
3361
- var RouteReusableStrategy = /** @class */ (function (_super) {
3362
- __extends(RouteReusableStrategy, _super);
3363
- function RouteReusableStrategy() {
3364
- return _super !== null && _super.apply(this, arguments) || this;
3365
- }
3366
- RouteReusableStrategy.prototype.shouldDetach = function (route) {
3367
- return false;
3368
- };
3369
- RouteReusableStrategy.prototype.store = function (route, detachedTree) { };
3370
- RouteReusableStrategy.prototype.shouldAttach = function (route) {
3371
- return false;
3372
- };
3373
- RouteReusableStrategy.prototype.retrieve = function (route) {
3374
- return null;
3375
- };
3376
- RouteReusableStrategy.prototype.shouldReuseRoute = function (future, curr) {
3377
- var _a, _b, _c;
3378
- // Reuse the route if the RouteConfig is the same, or if both routes use the
3379
- // same component, because the latter can have different RouteConfigs.
3380
- return future.routeConfig === curr.routeConfig ||
3381
- Boolean(((_a = future.routeConfig) === null || _a === void 0 ? void 0 : _a.component) &&
3382
- ((_b = future.routeConfig) === null || _b === void 0 ? void 0 : _b.component) === ((_c = curr.routeConfig) === null || _c === void 0 ? void 0 : _c.component));
3383
- };
3384
- return RouteReusableStrategy;
3385
- }(i1$2.RouteReuseStrategy));
3386
- RouteReusableStrategy.ɵprov = i0.ɵɵdefineInjectable({ factory: function RouteReusableStrategy_Factory() { return new RouteReusableStrategy(); }, token: RouteReusableStrategy, providedIn: "root" });
3387
- RouteReusableStrategy.decorators = [
3388
- { type: i0.Injectable, args: [{
3389
- providedIn: 'root'
3390
- },] }
3391
- ];
3392
-
3393
- /**
3394
- * Service used to manage Local Storage
3395
- *
3396
- * @author Joshua Kissoon
3397
- * @since 20190623
3398
- */
3399
- var StorageService = /** @class */ (function () {
3400
- function StorageService() {
3401
- this.storageSub = new rxjs.Subject();
3402
- }
3403
- StorageService.prototype.watch = function () {
3404
- return this.storageSub.asObservable();
3405
- };
3406
- StorageService.prototype.setItem = function (key, data) {
3407
- localStorage.setItem(key, data);
3408
- this.storageSub.next({ key: key, value: data });
3409
- };
3410
- StorageService.prototype.getItem = function (key) {
3411
- return localStorage.getItem(key);
3412
- };
3413
- StorageService.prototype.removeItem = function (key) {
3414
- var data = this.getItem(key);
3415
- localStorage.removeItem(key);
3416
- this.storageSub.next({ key: key, value: data });
3417
- };
3418
- return StorageService;
3419
- }());
3420
- StorageService.ɵprov = i0.ɵɵdefineInjectable({ factory: function StorageService_Factory() { return new StorageService(); }, token: StorageService, providedIn: "root" });
3421
- StorageService.decorators = [
3422
- { type: i0.Injectable, args: [{
3423
- providedIn: 'root'
3424
- },] }
3425
- ];
3426
- StorageService.ctorParameters = function () { return []; };
3427
-
3428
- /**
3429
- * Service that provides a wrapper for retrieving data from the server
3430
- * @deprecated use HttpService Instead
3431
- * @author Joshua Kissoon
3432
- * @since 20170709
3433
- */
3434
- var DataManager = /** @class */ (function () {
3435
- function DataManager(http) {
3436
- this.http = http;
3437
- }
3438
- /**
3439
- * Callback wrapper for the HTTP GET Call
3440
- *
3441
- * @param urlq The query part of the URL to be sent to the server
3442
- *
3443
- * @author Joshua Kissoon
3444
- * @since 20160826
3445
- * @updated 20170711 to add parameters
3446
- */
3447
- DataManager.prototype.GET = function (urlq, params) {
3448
- if (params === void 0) { params = {}; }
3449
- return this.http
3450
- .get(urlq, { params: params })
3451
- .toPromise();
3452
- };
3453
- /**
3454
- * Callback wrapper for the HTTP POST Call
3455
- *
3456
- * @param urlq The query part of the URL to be sent to the server
3457
- * @param object The object containing the POST data to be sent
3458
- *
3459
- * @author Joshua Kissoon
3460
- * @since 20160826
3461
- */
3462
- DataManager.prototype.POST = function (urlq, object) {
3463
- if (null == object) {
3464
- 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
+ }
3465
3403
  }
3466
- return this.http
3467
- .post(urlq, object)
3468
- .toPromise();
3404
+ return str;
3469
3405
  };
3470
- /**
3471
- * Callback wrapper for the HTTP POST Call
3472
- *
3473
- * @param urlq The query part of the URL to be sent to the server
3474
- * @param object The object containing the POST data to be sent
3475
- *
3476
- * @author Joshua Kissoon
3477
- * @since 20160826
3478
- */
3479
- DataManager.prototype.POSTRAW = function (urlq, object) {
3480
- if (null == object) {
3481
- object = { "blank": "blank" };
3482
- }
3483
- return this.http
3484
- .skipHeader()
3485
- .post(urlq, object)
3486
- .toPromise();
3406
+ TimelineFilterComponent.prototype.resetFieldValue = function (field) {
3407
+ this.form.get(field).setValue('');
3487
3408
  };
3488
- /**
3489
- * Callback wrapper for the HTTP PUT Call
3490
- *
3491
- * @param urlq The query part of the URL to be sent to the server
3492
- * @param object The object containing the PUT data to be sent
3493
- *
3494
- * @author Joshua Kissoon
3495
- * @since 20160826
3496
- */
3497
- DataManager.prototype.PUT = function (urlq, object) {
3498
- if (null == object) {
3499
- 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;
3500
3421
  }
3501
- return this.http
3502
- .put(urlq, object)
3503
- .toPromise();
3504
3422
  };
3505
- /**
3506
- * Callback wrapper for the HTTP PATCH Call
3507
- *
3508
- * @param urlq The query part of the URL to be sent to the server
3509
- * @param object The object containing the PUT data to be sent
3510
- *
3511
- * @author Joshua Kissoon
3512
- * @since 20161107
3513
- */
3514
- DataManager.prototype.PATCH = function (urlq, object) {
3515
- if (null == object) {
3516
- object = { "blank": "blank" };
3423
+ TimelineFilterComponent.prototype._handleInput = function () {
3424
+ if (this.value == 1) {
3425
+ this.picker.open();
3426
+ return;
3517
3427
  }
3518
- return this.http
3519
- .patch(urlq, object)
3520
- .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);
3521
3433
  };
3522
- /**
3523
- * Callback wrapper for the HTTP DELETE Call
3524
- *
3525
- * @param urlq The query part of the URL to be sent to the server
3526
- *
3527
- * @author Joshua Kissoon
3528
- * @since 20160826
3529
- */
3530
- DataManager.prototype.DELETE = function (urlq) {
3531
- return this.http
3532
- .delete(urlq)
3533
- .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);
3534
3444
  };
3535
- 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;
3536
3475
  }());
3537
- DataManager.ɵprov = i0.ɵɵdefineInjectable({ factory: function DataManager_Factory() { return new DataManager(i0.ɵɵinject(HttpService)); }, token: DataManager, providedIn: "root" });
3538
- DataManager.decorators = [
3539
- { type: i0.Injectable, args: [{
3540
- 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: [""]
3541
3488
  },] }
3542
3489
  ];
3543
- DataManager.ctorParameters = function () { return [
3544
- { 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 }
3545
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
+ };
3546
3539
 
3547
3540
  var MaterialModule = /** @class */ (function () {
3548
3541
  function MaterialModule() {
@@ -3593,17 +3586,17 @@
3593
3586
  { type: i0.NgModule, args: [{
3594
3587
  imports: [
3595
3588
  common.CommonModule,
3596
- i1$1.HttpClientModule,
3597
- i1$2.RouterModule,
3589
+ i1$2.HttpClientModule,
3590
+ i1$1.RouterModule,
3598
3591
  SnackModule
3599
3592
  ],
3600
3593
  providers: [
3601
3594
  {
3602
- provide: i1$1.HttpClient,
3595
+ provide: i1$2.HttpClient,
3603
3596
  useClass: HttpService
3604
3597
  },
3605
3598
  {
3606
- provide: i1$2.RouteReuseStrategy,
3599
+ provide: i1$1.RouteReuseStrategy,
3607
3600
  useClass: RouteReusableStrategy
3608
3601
  }
3609
3602
  ],
@@ -3833,11 +3826,11 @@
3833
3826
  MaterialModule
3834
3827
  ],
3835
3828
  declarations: [
3836
- exports.ɵx,
3829
+ exports.ɵy,
3837
3830
  MatSelectInfiniteScrollDirective
3838
3831
  ],
3839
3832
  exports: [
3840
- exports.ɵx,
3833
+ exports.ɵy,
3841
3834
  MatSelectInfiniteScrollDirective
3842
3835
  ]
3843
3836
  },] }
@@ -3869,8 +3862,8 @@
3869
3862
  }());
3870
3863
  TimelineFilterRoutingModule.decorators = [
3871
3864
  { type: i0.NgModule, args: [{
3872
- imports: [i1$2.RouterModule.forChild(routes)],
3873
- exports: [i1$2.RouterModule]
3865
+ imports: [i1$1.RouterModule.forChild(routes)],
3866
+ exports: [i1$1.RouterModule]
3874
3867
  },] }
3875
3868
  ];
3876
3869
 
@@ -3881,7 +3874,7 @@
3881
3874
  }());
3882
3875
  TimelineFilterModule.decorators = [
3883
3876
  { type: i0.NgModule, args: [{
3884
- declarations: [exports.ɵbb],
3877
+ declarations: [exports.ɵbc],
3885
3878
  imports: [
3886
3879
  common.CommonModule,
3887
3880
  TimelineFilterRoutingModule,
@@ -3889,7 +3882,7 @@
3889
3882
  MaterialModule,
3890
3883
  forms.ReactiveFormsModule
3891
3884
  ],
3892
- exports: [exports.ɵbb]
3885
+ exports: [exports.ɵbc]
3893
3886
  },] }
3894
3887
  ];
3895
3888
 
@@ -3921,8 +3914,8 @@
3921
3914
  }());
3922
3915
  EmailSubscriptionRoutingModule.decorators = [
3923
3916
  { type: i0.NgModule, args: [{
3924
- imports: [i1$2.RouterModule.forChild(routes$1)],
3925
- exports: [i1$2.RouterModule]
3917
+ imports: [i1$1.RouterModule.forChild(routes$1)],
3918
+ exports: [i1$1.RouterModule]
3926
3919
  },] }
3927
3920
  ];
3928
3921
 
@@ -3949,8 +3942,8 @@
3949
3942
  }());
3950
3943
  EmailSubscriptionUserRoutingModule.decorators = [
3951
3944
  { type: i0.NgModule, args: [{
3952
- imports: [i1$2.RouterModule.forChild(routes$2)],
3953
- exports: [i1$2.RouterModule]
3945
+ imports: [i1$1.RouterModule.forChild(routes$2)],
3946
+ exports: [i1$1.RouterModule]
3954
3947
  },] }
3955
3948
  ];
3956
3949
 
@@ -3977,8 +3970,8 @@
3977
3970
  }());
3978
3971
  EmailSubscriptionUserFormRoutingModule.decorators = [
3979
3972
  { type: i0.NgModule, args: [{
3980
- imports: [i1$2.RouterModule.forChild(routes$3)],
3981
- exports: [i1$2.RouterModule]
3973
+ imports: [i1$1.RouterModule.forChild(routes$3)],
3974
+ exports: [i1$1.RouterModule]
3982
3975
  },] }
3983
3976
  ];
3984
3977
 
@@ -3991,7 +3984,7 @@
3991
3984
  required: "Email Type is required"
3992
3985
  },
3993
3986
  };
3994
- exports.ɵbe = /** @class */ (function () {
3987
+ exports.ɵbf = /** @class */ (function () {
3995
3988
  function EmailSubscriptionUserFormComponent(fb, formValidatorService, alertService, dialogRef, data, http) {
3996
3989
  this.fb = fb;
3997
3990
  this.formValidatorService = formValidatorService;
@@ -4053,14 +4046,14 @@
4053
4046
  };
4054
4047
  return EmailSubscriptionUserFormComponent;
4055
4048
  }());
4056
- exports.ɵbe.decorators = [
4049
+ exports.ɵbf.decorators = [
4057
4050
  { type: i0.Component, args: [{
4058
4051
  selector: 'app-email-subscription-user-form',
4059
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>",
4060
4053
  styles: [""]
4061
4054
  },] }
4062
4055
  ];
4063
- exports.ɵbe.ctorParameters = function () { return [
4056
+ exports.ɵbf.ctorParameters = function () { return [
4064
4057
  { type: forms.FormBuilder },
4065
4058
  { type: FormValidatorService },
4066
4059
  { type: AlertService },
@@ -4068,9 +4061,9 @@
4068
4061
  { type: undefined, decorators: [{ type: i0.Inject, args: [dialog.MAT_DIALOG_DATA,] }] },
4069
4062
  { type: HttpService }
4070
4063
  ]; };
4071
- exports.ɵbe = __decorate([
4064
+ exports.ɵbf = __decorate([
4072
4065
  untilDestroy.UntilDestroy()
4073
- ], exports.ɵbe);
4066
+ ], exports.ɵbf);
4074
4067
 
4075
4068
  var EmailSubscriptionUserFormModule = /** @class */ (function () {
4076
4069
  function EmailSubscriptionUserFormModule() {
@@ -4079,7 +4072,7 @@
4079
4072
  }());
4080
4073
  EmailSubscriptionUserFormModule.decorators = [
4081
4074
  { type: i0.NgModule, args: [{
4082
- declarations: [exports.ɵbe],
4075
+ declarations: [exports.ɵbf],
4083
4076
  imports: [
4084
4077
  common.CommonModule,
4085
4078
  MaterialModule,
@@ -4089,12 +4082,12 @@
4089
4082
  EmailSubscriptionUserFormRoutingModule,
4090
4083
  LoaderModule
4091
4084
  ],
4092
- entryComponents: [exports.ɵbe]
4085
+ entryComponents: [exports.ɵbf]
4093
4086
  },] }
4094
4087
  ];
4095
4088
 
4096
4089
  var log$4 = new Logger('EmailSubscriptionUser list');
4097
- exports.ɵbf = /** @class */ (function () {
4090
+ exports.ɵbg = /** @class */ (function () {
4098
4091
  function EmailSubscriptionUserListComponent(dialog, http, router) {
4099
4092
  this.dialog = dialog;
4100
4093
  this.http = http;
@@ -4155,7 +4148,7 @@
4155
4148
  };
4156
4149
  EmailSubscriptionUserListComponent.prototype.addEmailSubscriptionUser = function () {
4157
4150
  var _this = this;
4158
- var dialogRef = this.dialog.open(exports.ɵbe, {
4151
+ var dialogRef = this.dialog.open(exports.ɵbf, {
4159
4152
  width: '800px',
4160
4153
  autoFocus: false,
4161
4154
  data: {} // Any data passed here will be injected into the model
@@ -4170,7 +4163,7 @@
4170
4163
  EmailSubscriptionUserListComponent.prototype.editEmailSubscriptionUser = function (event, esUser) {
4171
4164
  var _this = this;
4172
4165
  event.stopPropagation();
4173
- var dialogRef = this.dialog.open(exports.ɵbe, {
4166
+ var dialogRef = this.dialog.open(exports.ɵbf, {
4174
4167
  width: '800px',
4175
4168
  autoFocus: false,
4176
4169
  data: {
@@ -4228,24 +4221,24 @@
4228
4221
  };
4229
4222
  return EmailSubscriptionUserListComponent;
4230
4223
  }());
4231
- exports.ɵbf.decorators = [
4224
+ exports.ɵbg.decorators = [
4232
4225
  { type: i0.Component, args: [{
4233
4226
  selector: 'app-email-subscription-user-list',
4234
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>",
4235
4228
  styles: [".scroll-container{max-height:800px;overflow-y:auto}"]
4236
4229
  },] }
4237
4230
  ];
4238
- exports.ɵbf.ctorParameters = function () { return [
4231
+ exports.ɵbg.ctorParameters = function () { return [
4239
4232
  { type: dialog.MatDialog },
4240
4233
  { type: HttpService },
4241
- { type: i1$2.Router }
4234
+ { type: i1$1.Router }
4242
4235
  ]; };
4243
- exports.ɵbf.propDecorators = {
4236
+ exports.ɵbg.propDecorators = {
4244
4237
  sort: [{ type: i0.ViewChild, args: [sort.MatSort, { static: true },] }]
4245
4238
  };
4246
- exports.ɵbf = __decorate([
4239
+ exports.ɵbg = __decorate([
4247
4240
  untilDestroy.UntilDestroy()
4248
- ], exports.ɵbf);
4241
+ ], exports.ɵbg);
4249
4242
 
4250
4243
  var esulr = {
4251
4244
  title: 'Email Subscription Users',
@@ -4257,7 +4250,7 @@
4257
4250
  var routes$4 = [
4258
4251
  {
4259
4252
  path: '',
4260
- component: exports.ɵbf,
4253
+ component: exports.ɵbg,
4261
4254
  canActivate: [AuthenticationGuard],
4262
4255
  data: esulr
4263
4256
  },
@@ -4269,8 +4262,8 @@
4269
4262
  }());
4270
4263
  EmailSubscriptionUserListRoutingModule.decorators = [
4271
4264
  { type: i0.NgModule, args: [{
4272
- imports: [i1$2.RouterModule.forChild(routes$4)],
4273
- exports: [i1$2.RouterModule]
4265
+ imports: [i1$1.RouterModule.forChild(routes$4)],
4266
+ exports: [i1$1.RouterModule]
4274
4267
  },] }
4275
4268
  ];
4276
4269
 
@@ -4282,12 +4275,12 @@
4282
4275
  }());
4283
4276
  EmailSubscriptionUserListFilterRoutingModule.decorators = [
4284
4277
  { type: i0.NgModule, args: [{
4285
- imports: [i1$2.RouterModule.forChild(routes$5)],
4286
- exports: [i1$2.RouterModule]
4278
+ imports: [i1$1.RouterModule.forChild(routes$5)],
4279
+ exports: [i1$1.RouterModule]
4287
4280
  },] }
4288
4281
  ];
4289
4282
 
4290
- exports.ɵbh = /** @class */ (function () {
4283
+ exports.ɵbi = /** @class */ (function () {
4291
4284
  function EmailSubscriptionUserListFilterComponent(fb) {
4292
4285
  this.fb = fb;
4293
4286
  this.valueChange = new i0.EventEmitter();
@@ -4316,22 +4309,22 @@
4316
4309
  };
4317
4310
  return EmailSubscriptionUserListFilterComponent;
4318
4311
  }());
4319
- exports.ɵbh.decorators = [
4312
+ exports.ɵbi.decorators = [
4320
4313
  { type: i0.Component, args: [{
4321
4314
  selector: 'app-email-subscription-user-list-filter',
4322
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>",
4323
4316
  styles: [""]
4324
4317
  },] }
4325
4318
  ];
4326
- exports.ɵbh.ctorParameters = function () { return [
4319
+ exports.ɵbi.ctorParameters = function () { return [
4327
4320
  { type: forms.FormBuilder }
4328
4321
  ]; };
4329
- exports.ɵbh.propDecorators = {
4322
+ exports.ɵbi.propDecorators = {
4330
4323
  valueChange: [{ type: i0.Output }]
4331
4324
  };
4332
- exports.ɵbh = __decorate([
4325
+ exports.ɵbi = __decorate([
4333
4326
  untilDestroy.UntilDestroy()
4334
- ], exports.ɵbh);
4327
+ ], exports.ɵbi);
4335
4328
 
4336
4329
  var EmailSubscriptionUserListFilterModule = /** @class */ (function () {
4337
4330
  function EmailSubscriptionUserListFilterModule() {
@@ -4340,7 +4333,7 @@
4340
4333
  }());
4341
4334
  EmailSubscriptionUserListFilterModule.decorators = [
4342
4335
  { type: i0.NgModule, args: [{
4343
- declarations: [exports.ɵbh],
4336
+ declarations: [exports.ɵbi],
4344
4337
  imports: [
4345
4338
  common.CommonModule,
4346
4339
  MaterialModule,
@@ -4349,7 +4342,7 @@
4349
4342
  SearchableSelectorModule,
4350
4343
  EmailSubscriptionUserListFilterRoutingModule
4351
4344
  ],
4352
- exports: [exports.ɵbh]
4345
+ exports: [exports.ɵbi]
4353
4346
  },] }
4354
4347
  ];
4355
4348
 
@@ -4360,7 +4353,7 @@
4360
4353
  }());
4361
4354
  EmailSubscriptionUserListModule.decorators = [
4362
4355
  { type: i0.NgModule, args: [{
4363
- declarations: [exports.ɵbf],
4356
+ declarations: [exports.ɵbg],
4364
4357
  imports: [
4365
4358
  common.CommonModule,
4366
4359
  ngxInfiniteScroll.InfiniteScrollModule,
@@ -4371,7 +4364,7 @@
4371
4364
  EmailSubscriptionUserFormModule,
4372
4365
  EmailSubscriptionUserListFilterModule
4373
4366
  ],
4374
- exports: [exports.ɵbf]
4367
+ exports: [exports.ɵbg]
4375
4368
  },] }
4376
4369
  ];
4377
4370
 
@@ -4383,8 +4376,8 @@
4383
4376
  }());
4384
4377
  EmailSubscriptionTypeRoutingModule.decorators = [
4385
4378
  { type: i0.NgModule, args: [{
4386
- imports: [i1$2.RouterModule.forChild(routes$6)],
4387
- exports: [i1$2.RouterModule]
4379
+ imports: [i1$1.RouterModule.forChild(routes$6)],
4380
+ exports: [i1$1.RouterModule]
4388
4381
  },] }
4389
4382
  ];
4390
4383
 
@@ -4411,8 +4404,8 @@
4411
4404
  }());
4412
4405
  EmailSubscriptionTypeFormRoutingModule.decorators = [
4413
4406
  { type: i0.NgModule, args: [{
4414
- imports: [i1$2.RouterModule.forChild(routes$7)],
4415
- exports: [i1$2.RouterModule]
4407
+ imports: [i1$1.RouterModule.forChild(routes$7)],
4408
+ exports: [i1$1.RouterModule]
4416
4409
  },] }
4417
4410
  ];
4418
4411
 
@@ -4427,7 +4420,7 @@
4427
4420
  required: "Frequency is required"
4428
4421
  },
4429
4422
  };
4430
- exports.ɵbi = /** @class */ (function () {
4423
+ exports.ɵbj = /** @class */ (function () {
4431
4424
  function EmailSubscriptionTypeFormComponent(fb, formValidatorService, alertService, dialogRef, data, http) {
4432
4425
  this.fb = fb;
4433
4426
  this.formValidatorService = formValidatorService;
@@ -4491,14 +4484,14 @@
4491
4484
  };
4492
4485
  return EmailSubscriptionTypeFormComponent;
4493
4486
  }());
4494
- exports.ɵbi.decorators = [
4487
+ exports.ɵbj.decorators = [
4495
4488
  { type: i0.Component, args: [{
4496
4489
  selector: 'app-email-subscription-type-form',
4497
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>",
4498
4491
  styles: [""]
4499
4492
  },] }
4500
4493
  ];
4501
- exports.ɵbi.ctorParameters = function () { return [
4494
+ exports.ɵbj.ctorParameters = function () { return [
4502
4495
  { type: forms.FormBuilder },
4503
4496
  { type: FormValidatorService },
4504
4497
  { type: AlertService },
@@ -4506,9 +4499,9 @@
4506
4499
  { type: undefined, decorators: [{ type: i0.Inject, args: [dialog.MAT_DIALOG_DATA,] }] },
4507
4500
  { type: HttpService }
4508
4501
  ]; };
4509
- exports.ɵbi = __decorate([
4502
+ exports.ɵbj = __decorate([
4510
4503
  untilDestroy.UntilDestroy()
4511
- ], exports.ɵbi);
4504
+ ], exports.ɵbj);
4512
4505
 
4513
4506
  var EmailSubscriptionTypeFormModule = /** @class */ (function () {
4514
4507
  function EmailSubscriptionTypeFormModule() {
@@ -4517,7 +4510,7 @@
4517
4510
  }());
4518
4511
  EmailSubscriptionTypeFormModule.decorators = [
4519
4512
  { type: i0.NgModule, args: [{
4520
- declarations: [exports.ɵbi],
4513
+ declarations: [exports.ɵbj],
4521
4514
  imports: [
4522
4515
  common.CommonModule,
4523
4516
  MaterialModule,
@@ -4527,12 +4520,12 @@
4527
4520
  EmailSubscriptionTypeFormRoutingModule,
4528
4521
  LoaderModule
4529
4522
  ],
4530
- exports: [exports.ɵbi],
4531
- entryComponents: [exports.ɵbi]
4523
+ exports: [exports.ɵbj],
4524
+ entryComponents: [exports.ɵbj]
4532
4525
  },] }
4533
4526
  ];
4534
4527
 
4535
- exports.ɵbj = /** @class */ (function () {
4528
+ exports.ɵbk = /** @class */ (function () {
4536
4529
  function EmailSubscriptionTypeListComponent(dialog, http) {
4537
4530
  this.dialog = dialog;
4538
4531
  this.http = http;
@@ -4596,7 +4589,7 @@
4596
4589
  };
4597
4590
  EmailSubscriptionTypeListComponent.prototype.addEmailSubscriptionType = function () {
4598
4591
  var _this = this;
4599
- var dialogRef = this.dialog.open(exports.ɵbi, {
4592
+ var dialogRef = this.dialog.open(exports.ɵbj, {
4600
4593
  width: '400px',
4601
4594
  autoFocus: false,
4602
4595
  data: {} // Any data passed here will be injected into the model
@@ -4610,7 +4603,7 @@
4610
4603
  EmailSubscriptionTypeListComponent.prototype.editEmailSubscriptionType = function (event, emailSubscriptionType) {
4611
4604
  var _this = this;
4612
4605
  event.stopPropagation();
4613
- var dialogRef = this.dialog.open(exports.ɵbi, {
4606
+ var dialogRef = this.dialog.open(exports.ɵbj, {
4614
4607
  width: '400px',
4615
4608
  autoFocus: false,
4616
4609
  data: {
@@ -4667,23 +4660,23 @@
4667
4660
  };
4668
4661
  return EmailSubscriptionTypeListComponent;
4669
4662
  }());
4670
- exports.ɵbj.decorators = [
4663
+ exports.ɵbk.decorators = [
4671
4664
  { type: i0.Component, args: [{
4672
4665
  selector: 'app-email-subscription-type-list',
4673
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>",
4674
4667
  styles: [".scroll-container{max-height:800px;overflow-y:auto}"]
4675
4668
  },] }
4676
4669
  ];
4677
- exports.ɵbj.ctorParameters = function () { return [
4670
+ exports.ɵbk.ctorParameters = function () { return [
4678
4671
  { type: dialog.MatDialog },
4679
4672
  { type: HttpService }
4680
4673
  ]; };
4681
- exports.ɵbj.propDecorators = {
4674
+ exports.ɵbk.propDecorators = {
4682
4675
  sort: [{ type: i0.ViewChild, args: [sort.MatSort, { static: true },] }]
4683
4676
  };
4684
- exports.ɵbj = __decorate([
4677
+ exports.ɵbk = __decorate([
4685
4678
  untilDestroy.UntilDestroy()
4686
- ], exports.ɵbj);
4679
+ ], exports.ɵbk);
4687
4680
 
4688
4681
  var estlr = {
4689
4682
  title: 'Email Subscription Type',
@@ -4695,7 +4688,7 @@
4695
4688
  var routes$8 = [
4696
4689
  {
4697
4690
  path: '',
4698
- component: exports.ɵbj,
4691
+ component: exports.ɵbk,
4699
4692
  canActivate: [AuthenticationGuard],
4700
4693
  data: estlr
4701
4694
  },
@@ -4707,8 +4700,8 @@
4707
4700
  }());
4708
4701
  EmailSubscriptionTypeListRoutingModule.decorators = [
4709
4702
  { type: i0.NgModule, args: [{
4710
- imports: [i1$2.RouterModule.forChild(routes$8)],
4711
- exports: [i1$2.RouterModule]
4703
+ imports: [i1$1.RouterModule.forChild(routes$8)],
4704
+ exports: [i1$1.RouterModule]
4712
4705
  },] }
4713
4706
  ];
4714
4707
 
@@ -4719,7 +4712,7 @@
4719
4712
  }());
4720
4713
  EmailSubscriptionTypeListModule.decorators = [
4721
4714
  { type: i0.NgModule, args: [{
4722
- declarations: [exports.ɵbj],
4715
+ declarations: [exports.ɵbk],
4723
4716
  imports: [
4724
4717
  common.CommonModule,
4725
4718
  MaterialModule,
@@ -4729,11 +4722,11 @@
4729
4722
  EmailSubscriptionTypeFormModule,
4730
4723
  EmailSubscriptionTypeListRoutingModule
4731
4724
  ],
4732
- exports: [exports.ɵbj]
4725
+ exports: [exports.ɵbk]
4733
4726
  },] }
4734
4727
  ];
4735
4728
 
4736
- exports.ɵbk = /** @class */ (function () {
4729
+ exports.ɵbl = /** @class */ (function () {
4737
4730
  function EmailSubscriptionForUserComponent(http) {
4738
4731
  this.http = http;
4739
4732
  this.subscriptions = [];
@@ -4788,19 +4781,19 @@
4788
4781
  };
4789
4782
  return EmailSubscriptionForUserComponent;
4790
4783
  }());
4791
- exports.ɵbk.decorators = [
4784
+ exports.ɵbl.decorators = [
4792
4785
  { type: i0.Component, args: [{
4793
4786
  selector: 'app-email-subscription-for-user',
4794
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>",
4795
4788
  styles: [".scroll-container{max-height:800px;overflow-y:auto}"]
4796
4789
  },] }
4797
4790
  ];
4798
- exports.ɵbk.ctorParameters = function () { return [
4791
+ exports.ɵbl.ctorParameters = function () { return [
4799
4792
  { type: HttpService }
4800
4793
  ]; };
4801
- exports.ɵbk = __decorate([
4794
+ exports.ɵbl = __decorate([
4802
4795
  untilDestroy.UntilDestroy()
4803
- ], exports.ɵbk);
4796
+ ], exports.ɵbl);
4804
4797
 
4805
4798
  var esfur = {
4806
4799
  permissions: {
@@ -4810,7 +4803,7 @@
4810
4803
  var routes$9 = [
4811
4804
  {
4812
4805
  path: '',
4813
- component: exports.ɵbk,
4806
+ component: exports.ɵbl,
4814
4807
  canActivate: [AuthenticationGuard],
4815
4808
  data: esfur
4816
4809
  },
@@ -4822,8 +4815,8 @@
4822
4815
  }());
4823
4816
  EmailSubscriptionForUserRoutingModule.decorators = [
4824
4817
  { type: i0.NgModule, args: [{
4825
- imports: [i1$2.RouterModule.forChild(routes$9)],
4826
- exports: [i1$2.RouterModule]
4818
+ imports: [i1$1.RouterModule.forChild(routes$9)],
4819
+ exports: [i1$1.RouterModule]
4827
4820
  },] }
4828
4821
  ];
4829
4822
 
@@ -4834,7 +4827,7 @@
4834
4827
  }());
4835
4828
  EmailSubscriptionForUserModule.decorators = [
4836
4829
  { type: i0.NgModule, args: [{
4837
- declarations: [exports.ɵbk],
4830
+ declarations: [exports.ɵbl],
4838
4831
  imports: [
4839
4832
  common.CommonModule,
4840
4833
  ngxInfiniteScroll.InfiniteScrollModule,
@@ -4842,7 +4835,7 @@
4842
4835
  flexLayout.FlexLayoutModule,
4843
4836
  EmailSubscriptionForUserRoutingModule
4844
4837
  ],
4845
- exports: [exports.ɵbk]
4838
+ exports: [exports.ɵbl]
4846
4839
  },] }
4847
4840
  ];
4848
4841
 
@@ -5034,7 +5027,7 @@
5034
5027
  },] }
5035
5028
  ];
5036
5029
 
5037
- exports.ɵbl = /** @class */ (function () {
5030
+ exports.ɵbm = /** @class */ (function () {
5038
5031
  function TechlifyUpdatesListComponent(dialog, alertService, techlifyUpdateService, fb) {
5039
5032
  this.dialog = dialog;
5040
5033
  this.alertService = alertService;
@@ -5194,26 +5187,26 @@
5194
5187
  };
5195
5188
  return TechlifyUpdatesListComponent;
5196
5189
  }());
5197
- exports.ɵbl.decorators = [
5190
+ exports.ɵbm.decorators = [
5198
5191
  { type: i0.Component, args: [{
5199
5192
  selector: 'app-techlify-updates-list',
5200
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",
5201
5194
  styles: [""]
5202
5195
  },] }
5203
5196
  ];
5204
- exports.ɵbl.ctorParameters = function () { return [
5197
+ exports.ɵbm.ctorParameters = function () { return [
5205
5198
  { type: dialog.MatDialog },
5206
5199
  { type: AlertService },
5207
5200
  { type: TechlifyUpdateService },
5208
5201
  { type: forms.FormBuilder }
5209
5202
  ]; };
5210
- exports.ɵbl = __decorate([
5203
+ exports.ɵbm = __decorate([
5211
5204
  untilDestroy.UntilDestroy()
5212
- ], exports.ɵbl);
5205
+ ], exports.ɵbm);
5213
5206
 
5214
5207
  var routes$a = [
5215
5208
  { path: '', redirectTo: 'all', pathMatch: 'full' },
5216
- { path: 'all', component: exports.ɵbl },
5209
+ { path: 'all', component: exports.ɵbm },
5217
5210
  //fallback
5218
5211
  {
5219
5212
  path: '**',
@@ -5228,8 +5221,8 @@
5228
5221
  }());
5229
5222
  TechlifyUpdateRoutingModule.decorators = [
5230
5223
  { type: i0.NgModule, args: [{
5231
- imports: [i1$2.RouterModule.forChild(routes$a)],
5232
- exports: [i1$2.RouterModule]
5224
+ imports: [i1$1.RouterModule.forChild(routes$a)],
5225
+ exports: [i1$1.RouterModule]
5233
5226
  },] }
5234
5227
  ];
5235
5228
 
@@ -5240,7 +5233,7 @@
5240
5233
  }());
5241
5234
  TechlifyUpdateModule.decorators = [
5242
5235
  { type: i0.NgModule, args: [{
5243
- declarations: [exports.ɵbl],
5236
+ declarations: [exports.ɵbm],
5244
5237
  imports: [
5245
5238
  common.CommonModule,
5246
5239
  forms.ReactiveFormsModule,
@@ -5284,10 +5277,10 @@
5284
5277
  UpdateViewComponent.ctorParameters = function () { return [
5285
5278
  { type: dialog.MatDialogRef },
5286
5279
  { type: undefined, decorators: [{ type: i0.Inject, args: [dialog.MAT_DIALOG_DATA,] }] },
5287
- { type: i1$2.Router }
5280
+ { type: i1$1.Router }
5288
5281
  ]; };
5289
5282
 
5290
- exports.ɵbr = /** @class */ (function () {
5283
+ exports.ɵbs = /** @class */ (function () {
5291
5284
  function TechlifyUpdateHistoryComponent(dialog, techlifyUpdateService, fb, alertService) {
5292
5285
  this.dialog = dialog;
5293
5286
  this.techlifyUpdateService = techlifyUpdateService;
@@ -5424,26 +5417,26 @@
5424
5417
  };
5425
5418
  return TechlifyUpdateHistoryComponent;
5426
5419
  }());
5427
- exports.ɵbr.decorators = [
5420
+ exports.ɵbs.decorators = [
5428
5421
  { type: i0.Component, args: [{
5429
5422
  selector: 'app-techlify-update-history',
5430
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",
5431
5424
  styles: [""]
5432
5425
  },] }
5433
5426
  ];
5434
- exports.ɵbr.ctorParameters = function () { return [
5427
+ exports.ɵbs.ctorParameters = function () { return [
5435
5428
  { type: dialog.MatDialog },
5436
5429
  { type: TechlifyUpdateService },
5437
5430
  { type: forms.FormBuilder },
5438
5431
  { type: AlertService }
5439
5432
  ]; };
5440
- exports.ɵbr = __decorate([
5433
+ exports.ɵbs = __decorate([
5441
5434
  untilDestroy.UntilDestroy()
5442
- ], exports.ɵbr);
5435
+ ], exports.ɵbs);
5443
5436
 
5444
5437
  var routes$b = [
5445
5438
  { path: '', redirectTo: 'update-history', pathMatch: 'full' },
5446
- { path: 'update-history', component: exports.ɵbr },
5439
+ { path: 'update-history', component: exports.ɵbs },
5447
5440
  //fallback
5448
5441
  {
5449
5442
  path: '**',
@@ -5458,8 +5451,8 @@
5458
5451
  }());
5459
5452
  TechlifyUpdateHistoryRoutingModule.decorators = [
5460
5453
  { type: i0.NgModule, args: [{
5461
- imports: [i1$2.RouterModule.forChild(routes$b)],
5462
- exports: [i1$2.RouterModule]
5454
+ imports: [i1$1.RouterModule.forChild(routes$b)],
5455
+ exports: [i1$1.RouterModule]
5463
5456
  },] }
5464
5457
  ];
5465
5458
 
@@ -5480,7 +5473,7 @@
5480
5473
  ReadMoreModule,
5481
5474
  TechlifyUpdateHistoryRoutingModule
5482
5475
  ],
5483
- declarations: [exports.ɵbr]
5476
+ declarations: [exports.ɵbs]
5484
5477
  },] }
5485
5478
  ];
5486
5479
 
@@ -5586,7 +5579,7 @@
5586
5579
  { type: undefined, decorators: [{ type: i0.Inject, args: [i1.MAT_SNACK_BAR_DATA,] }] },
5587
5580
  { type: i1.MatSnackBarRef },
5588
5581
  { type: dialog.MatDialog },
5589
- { type: i1$2.Router },
5582
+ { type: i1$1.Router },
5590
5583
  { type: TechlifyUpdateService },
5591
5584
  { type: AlertService }
5592
5585
  ]; };
@@ -5793,7 +5786,7 @@
5793
5786
  AuditLogsViewModelComponent.prototype.ngOnInit = function () {
5794
5787
  var _this = this;
5795
5788
  this.router.events
5796
- .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))
5797
5790
  .subscribe(function (_) { return _this.dialogRef.close(); });
5798
5791
  };
5799
5792
  return AuditLogsViewModelComponent;
@@ -5808,7 +5801,7 @@
5808
5801
  exports.AuditLogsViewModelComponent.ctorParameters = function () { return [
5809
5802
  { type: dialog.MatDialogRef },
5810
5803
  { type: undefined, decorators: [{ type: i0.Inject, args: [dialog.MAT_DIALOG_DATA,] }] },
5811
- { type: i1$2.Router }
5804
+ { type: i1$1.Router }
5812
5805
  ]; };
5813
5806
  exports.AuditLogsViewModelComponent = __decorate([
5814
5807
  untilDestroy.UntilDestroy()
@@ -5868,8 +5861,8 @@
5868
5861
  }());
5869
5862
  AuditLogForModelRoutingModule.decorators = [
5870
5863
  { type: i0.NgModule, args: [{
5871
- imports: [i1$2.RouterModule.forChild(routes$c)],
5872
- exports: [i1$2.RouterModule]
5864
+ imports: [i1$1.RouterModule.forChild(routes$c)],
5865
+ exports: [i1$1.RouterModule]
5873
5866
  },] }
5874
5867
  ];
5875
5868
 
@@ -5881,8 +5874,8 @@
5881
5874
  }());
5882
5875
  AuditLogViewModelRoutingModule.decorators = [
5883
5876
  { type: i0.NgModule, args: [{
5884
- imports: [i1$2.RouterModule.forChild(routes$d)],
5885
- exports: [i1$2.RouterModule]
5877
+ imports: [i1$1.RouterModule.forChild(routes$d)],
5878
+ exports: [i1$1.RouterModule]
5886
5879
  },] }
5887
5880
  ];
5888
5881
 
@@ -5912,8 +5905,8 @@
5912
5905
  }());
5913
5906
  AuditLogsViewModelRoutingModule.decorators = [
5914
5907
  { type: i0.NgModule, args: [{
5915
- imports: [i1$2.RouterModule.forChild(routes$e)],
5916
- exports: [i1$2.RouterModule]
5908
+ imports: [i1$1.RouterModule.forChild(routes$e)],
5909
+ exports: [i1$1.RouterModule]
5917
5910
  },] }
5918
5911
  ];
5919
5912
 
@@ -5925,8 +5918,8 @@
5925
5918
  }());
5926
5919
  AuditLogListRoutingModule.decorators = [
5927
5920
  { type: i0.NgModule, args: [{
5928
- imports: [i1$2.RouterModule.forChild(routes$f)],
5929
- exports: [i1$2.RouterModule]
5921
+ imports: [i1$1.RouterModule.forChild(routes$f)],
5922
+ exports: [i1$1.RouterModule]
5930
5923
  },] }
5931
5924
  ];
5932
5925
 
@@ -6054,7 +6047,7 @@
6054
6047
  ];
6055
6048
  exports.AuditLogListComponent.ctorParameters = function () { return [
6056
6049
  { type: DataManager },
6057
- { type: i1$2.Router },
6050
+ { type: i1$1.Router },
6058
6051
  { type: platformBrowser.DomSanitizer }
6059
6052
  ]; };
6060
6053
  exports.AuditLogListComponent.propDecorators = {
@@ -6077,8 +6070,8 @@
6077
6070
  }());
6078
6071
  AuditLogListFilterRoutingModule.decorators = [
6079
6072
  { type: i0.NgModule, args: [{
6080
- imports: [i1$2.RouterModule.forChild(routes$g)],
6081
- exports: [i1$2.RouterModule]
6073
+ imports: [i1$1.RouterModule.forChild(routes$g)],
6074
+ exports: [i1$1.RouterModule]
6082
6075
  },] }
6083
6076
  ];
6084
6077
 
@@ -6298,7 +6291,7 @@
6298
6291
  ];
6299
6292
  AuditLogViewComponent.ctorParameters = function () { return [
6300
6293
  { type: DataManager },
6301
- { type: i1$2.ActivatedRoute },
6294
+ { type: i1$1.ActivatedRoute },
6302
6295
  { type: common.Location }
6303
6296
  ]; };
6304
6297
 
@@ -6310,8 +6303,8 @@
6310
6303
  }());
6311
6304
  AuditLogViewRoutingModule.decorators = [
6312
6305
  { type: i0.NgModule, args: [{
6313
- imports: [i1$2.RouterModule.forChild(routes$h)],
6314
- exports: [i1$2.RouterModule]
6306
+ imports: [i1$1.RouterModule.forChild(routes$h)],
6307
+ exports: [i1$1.RouterModule]
6315
6308
  },] }
6316
6309
  ];
6317
6310
 
@@ -6345,8 +6338,8 @@
6345
6338
  }());
6346
6339
  AuditLogRoutingModule.decorators = [
6347
6340
  { type: i0.NgModule, args: [{
6348
- imports: [i1$2.RouterModule.forChild(routes$i)],
6349
- exports: [i1$2.RouterModule]
6341
+ imports: [i1$1.RouterModule.forChild(routes$i)],
6342
+ exports: [i1$1.RouterModule]
6350
6343
  },] }
6351
6344
  ];
6352
6345
 
@@ -6876,7 +6869,7 @@
6876
6869
  forms.FormsModule,
6877
6870
  forms.ReactiveFormsModule,
6878
6871
  flexLayout.FlexLayoutModule,
6879
- i1$2.RouterModule,
6872
+ i1$1.RouterModule,
6880
6873
  MaterialModule,
6881
6874
  flexLayout.FlexLayoutModule,
6882
6875
  FileDropperModule,
@@ -6996,8 +6989,8 @@
6996
6989
  }());
6997
6990
  LoginHistoryForUserRoutingModule.decorators = [
6998
6991
  { type: i0.NgModule, args: [{
6999
- imports: [i1$2.RouterModule.forChild(routes$j)],
7000
- exports: [i1$2.RouterModule]
6992
+ imports: [i1$1.RouterModule.forChild(routes$j)],
6993
+ exports: [i1$1.RouterModule]
7001
6994
  },] }
7002
6995
  ];
7003
6996
 
@@ -7826,7 +7819,7 @@
7826
7819
  canActivate: [AuthenticationGuard]
7827
7820
  },
7828
7821
  ];
7829
- var TechlifyFeatureRoutes = i1$2.RouterModule.forChild(routes$k);
7822
+ var TechlifyFeatureRoutes = i1$1.RouterModule.forChild(routes$k);
7830
7823
 
7831
7824
  var OnOffSwitchComponent = /** @class */ (function () {
7832
7825
  function OnOffSwitchComponent(fb) {
@@ -8015,24 +8008,24 @@
8015
8008
  exports.DateValidator = DateValidator;
8016
8009
  exports.DocumentViewerComponent = DocumentViewerComponent;
8017
8010
  exports.DocumentViewerModule = DocumentViewerModule;
8018
- exports.EmailSubscriptionForUserComponent = exports.ɵbk;
8011
+ exports.EmailSubscriptionForUserComponent = exports.ɵbl;
8019
8012
  exports.EmailSubscriptionForUserModule = EmailSubscriptionForUserModule;
8020
8013
  exports.EmailSubscriptionForUserRoutingModule = EmailSubscriptionForUserRoutingModule;
8021
8014
  exports.EmailSubscriptionModule = EmailSubscriptionModule;
8022
8015
  exports.EmailSubscriptionRoutingModule = EmailSubscriptionRoutingModule;
8023
- exports.EmailSubscriptionTypeFormComponent = exports.ɵbi;
8016
+ exports.EmailSubscriptionTypeFormComponent = exports.ɵbj;
8024
8017
  exports.EmailSubscriptionTypeFormModule = EmailSubscriptionTypeFormModule;
8025
8018
  exports.EmailSubscriptionTypeFormRoutingModule = EmailSubscriptionTypeFormRoutingModule;
8026
- exports.EmailSubscriptionTypeListComponent = exports.ɵbj;
8019
+ exports.EmailSubscriptionTypeListComponent = exports.ɵbk;
8027
8020
  exports.EmailSubscriptionTypeListModule = EmailSubscriptionTypeListModule;
8028
8021
  exports.EmailSubscriptionTypeListRoutingModule = EmailSubscriptionTypeListRoutingModule;
8029
8022
  exports.EmailSubscriptionTypeModule = EmailSubscriptionTypeModule;
8030
8023
  exports.EmailSubscriptionTypeRoutingModule = EmailSubscriptionTypeRoutingModule;
8031
- exports.EmailSubscriptionUserFormComponent = exports.ɵbe;
8024
+ exports.EmailSubscriptionUserFormComponent = exports.ɵbf;
8032
8025
  exports.EmailSubscriptionUserFormModule = EmailSubscriptionUserFormModule;
8033
8026
  exports.EmailSubscriptionUserFormRoutingModule = EmailSubscriptionUserFormRoutingModule;
8034
- exports.EmailSubscriptionUserListComponent = exports.ɵbf;
8035
- exports.EmailSubscriptionUserListFilterComponent = exports.ɵbh;
8027
+ exports.EmailSubscriptionUserListComponent = exports.ɵbg;
8028
+ exports.EmailSubscriptionUserListFilterComponent = exports.ɵbi;
8036
8029
  exports.EmailSubscriptionUserListFilterModule = EmailSubscriptionUserListFilterModule;
8037
8030
  exports.EmailSubscriptionUserListFilterRoutingModule = EmailSubscriptionUserListFilterRoutingModule;
8038
8031
  exports.EmailSubscriptionUserListModule = EmailSubscriptionUserListModule;
@@ -8071,12 +8064,13 @@
8071
8064
  exports.ReadMoreComponent = ReadMoreComponent;
8072
8065
  exports.ReadMoreModule = ReadMoreModule;
8073
8066
  exports.RouteReusableStrategy = RouteReusableStrategy;
8074
- exports.SearchableSelectorComponent = exports.ɵx;
8067
+ exports.SearchableSelectorComponent = exports.ɵy;
8075
8068
  exports.SearchableSelectorModule = SearchableSelectorModule;
8076
8069
  exports.SnackModule = SnackModule;
8077
8070
  exports.StorageService = StorageService;
8078
8071
  exports.SuccessSnackComponent = SuccessSnackComponent;
8079
- exports.TechlifyConfig = TechlifyConfig;
8072
+ exports.TECHLIFY_CORE_CONFIG_TOKEN = TECHLIFY_CORE_CONFIG_TOKEN;
8073
+ exports.TechlifyConfigModule = TechlifyConfigModule;
8080
8074
  exports.TechlifyFeatureEnabledDirective = TechlifyFeatureEnabledDirective;
8081
8075
  exports.TechlifyFeatureModule = TechlifyFeatureModule;
8082
8076
  exports.TechlifyFeatureRoutes = TechlifyFeatureRoutes;
@@ -8086,7 +8080,7 @@
8086
8080
  exports.TechlifyUpdateHistoryModule = TechlifyUpdateHistoryModule;
8087
8081
  exports.TechlifyUpdateModule = TechlifyUpdateModule;
8088
8082
  exports.Timeline = Timeline;
8089
- exports.TimelineFilterComponent = exports.ɵbb;
8083
+ exports.TimelineFilterComponent = exports.ɵbc;
8090
8084
  exports.TimelineFilterModule = TimelineFilterModule;
8091
8085
  exports.TokenInterceptor = TokenInterceptor;
8092
8086
  exports.UpdateNotifierComponent = UpdateNotifierComponent;
@@ -8099,29 +8093,30 @@
8099
8093
  exports.esulr = esulr;
8100
8094
  exports.ɵa = SnackModule;
8101
8095
  exports.ɵb = SuccessSnackComponent;
8102
- exports.ɵba = NumberSelector;
8103
- exports.ɵbc = TimelineFilterRoutingModule;
8104
- exports.ɵbd = LoaderComponent;
8105
- exports.ɵbg = AuthenticationGuard;
8106
- exports.ɵbm = TechlifyUpdateService;
8107
- exports.ɵbn = TechlifyUpdateRoutingModule;
8108
- exports.ɵbo = TechlifyUpdateFormModule;
8109
- exports.ɵbp = TechlifyUpdateFormComponent;
8110
- exports.ɵbq = TechlifyUpdateHistoryRoutingModule;
8111
- exports.ɵbs = UpdateNotifierSnackComponent;
8112
- exports.ɵbt = UpdateViewModule;
8113
- exports.ɵbu = UpdateViewComponent;
8114
- exports.ɵbv = DataManager;
8115
- exports.ɵbw = ErrorHandlerService;
8116
- exports.ɵbx = FieldMappingComponent;
8117
- exports.ɵby = FailedItemsListComponent;
8118
- 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;
8119
8113
  exports.ɵc = ErrorSnackComponent;
8120
- exports.ɵca = ImportSuccessComponent;
8121
- exports.ɵcb = DataImportComponent;
8122
- exports.ɵcc = StorageService;
8123
- exports.ɵcd = TechlifyFeatureService;
8124
- 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;
8125
8120
  exports.ɵd = HTTP_DYNAMIC_INTERCEPTORS;
8126
8121
  exports.ɵe = HttpService;
8127
8122
  exports.ɵf = RouteReusableStrategy;
@@ -8139,9 +8134,8 @@
8139
8134
  exports.ɵt = CommentFormComponent;
8140
8135
  exports.ɵu = CredentialsService;
8141
8136
  exports.ɵv = ConfigService;
8142
- exports.ɵw = TechlifyConfig;
8143
- exports.ɵy = MatSelectInfiniteScrollDirective;
8144
- exports.ɵz = NumItemsSelector;
8137
+ exports.ɵw = TECHLIFY_CORE_CONFIG_TOKEN;
8138
+ exports.ɵz = MatSelectInfiniteScrollDirective;
8145
8139
 
8146
8140
  Object.defineProperty(exports, '__esModule', { value: true });
8147
8141