ngx-techlify-core 11.3.2 → 11.3.6

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.
Files changed (49) hide show
  1. package/bundles/ngx-techlify-core.umd.js +1302 -206
  2. package/bundles/ngx-techlify-core.umd.js.map +1 -1
  3. package/bundles/ngx-techlify-core.umd.min.js +2 -2
  4. package/bundles/ngx-techlify-core.umd.min.js.map +1 -1
  5. package/esm2015/lib/company-feature/company-feature.component.js +174 -0
  6. package/esm2015/lib/company-feature/company-feature.module.js +30 -0
  7. package/esm2015/lib/company-feature/company-feature.routing.js +12 -0
  8. package/esm2015/lib/company-feature/company-feature.service.js +28 -0
  9. package/esm2015/lib/company-feature/ngx-feature-enabled.directive.js +77 -0
  10. package/esm2015/lib/company-feature/on-off-switch/on-off-switch.component.js +27 -0
  11. package/esm2015/lib/note/comment-form/comment-form.component.js +73 -0
  12. package/esm2015/lib/note/index.js +2 -1
  13. package/esm2015/lib/note/note-list/note-list.component.js +33 -3
  14. package/esm2015/lib/note/note.module.js +7 -3
  15. package/esm2015/lib/read-more/read-more.component.js +43 -0
  16. package/esm2015/lib/read-more/read-more.module.js +21 -0
  17. package/esm2015/lib/techlify-tagger-tag-form-field/techlify-tagger-tag-form-config.model.js +15 -0
  18. package/esm2015/lib/techlify-tagger-tag-form-field/techlify-tagger-tag-form-field.component.js +269 -0
  19. package/esm2015/lib/techlify-tagger-tag-form-field/techlify-tagger-tag-form-field.module.js +25 -0
  20. package/esm2015/lib/techlify-tagger-tag-selector/techlify-tagger-tag-selector.component.js +168 -0
  21. package/esm2015/lib/techlify-tagger-tag-selector/techlify-tagger-tag-selector.module.js +29 -0
  22. package/esm2015/lib/techlify-update/techlify-update-history/techlify-update-history.module.js +2 -2
  23. package/esm2015/lib/techlify-update/techlify-update.module.js +2 -2
  24. package/esm2015/ngx-techlify-core.js +32 -31
  25. package/esm2015/public-api.js +13 -1
  26. package/fesm2015/ngx-techlify-core.js +950 -64
  27. package/fesm2015/ngx-techlify-core.js.map +1 -1
  28. package/lib/company-feature/company-feature.component.d.ts +34 -0
  29. package/lib/company-feature/company-feature.module.d.ts +2 -0
  30. package/lib/company-feature/company-feature.routing.d.ts +2 -0
  31. package/lib/company-feature/company-feature.service.d.ts +8 -0
  32. package/lib/company-feature/ngx-feature-enabled.directive.d.ts +16 -0
  33. package/lib/company-feature/on-off-switch/on-off-switch.component.d.ts +9 -0
  34. package/lib/note/comment-form/comment-form.component.d.ts +22 -0
  35. package/lib/note/index.d.ts +1 -0
  36. package/lib/note/note-list/note-list.component.d.ts +4 -0
  37. package/lib/{techlify-update/read-more → read-more}/read-more.component.d.ts +0 -0
  38. package/lib/{techlify-update/read-more → read-more}/read-more.module.d.ts +0 -0
  39. package/lib/techlify-tagger-tag-form-field/techlify-tagger-tag-form-config.model.d.ts +12 -0
  40. package/lib/techlify-tagger-tag-form-field/techlify-tagger-tag-form-field.component.d.ts +76 -0
  41. package/lib/techlify-tagger-tag-form-field/techlify-tagger-tag-form-field.module.d.ts +2 -0
  42. package/lib/techlify-tagger-tag-selector/techlify-tagger-tag-selector.component.d.ts +58 -0
  43. package/lib/techlify-tagger-tag-selector/techlify-tagger-tag-selector.module.d.ts +2 -0
  44. package/ngx-techlify-core.d.ts +31 -30
  45. package/ngx-techlify-core.metadata.json +1 -1
  46. package/package.json +1 -1
  47. package/public-api.d.ts +12 -0
  48. package/esm2015/lib/techlify-update/read-more/read-more.component.js +0 -43
  49. package/esm2015/lib/techlify-update/read-more/read-more.module.js +0 -21
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/material/dialog'), require('@angular/material/table'), require('@angular/material/sort'), require('@ngneat/until-destroy'), require('@angular/common'), require('@angular/forms'), require('@angular/common/http'), require('rxjs'), require('rxjs/operators'), require('@angular/material/snack-bar'), require('@angular/cdk/a11y'), require('@angular/cdk/coercion'), require('@angular/material/form-field'), require('@angular/material/select'), require('@angular/material/icon'), require('@angular/router'), require('@angular/material/tooltip'), require('@angular/material/core'), require('@angular/material/button'), require('@angular/material/checkbox'), require('@angular/material/input'), require('@angular/material/menu'), require('@angular/material/progress-spinner'), require('@angular/material/card'), require('@angular/material/divider'), require('@angular/material/chips'), require('@angular/material/datepicker'), require('@angular/material/list'), require('@angular/flex-layout'), require('ngx-infinite-scroll'), require('ngx-doc-viewer'), require('ngx-editor'), require('xlsx'), require('@angular/platform-browser'), require('jsondiffpatch')) :
3
- typeof define === 'function' && define.amd ? define('ngx-techlify-core', ['exports', '@angular/core', '@angular/material/dialog', '@angular/material/table', '@angular/material/sort', '@ngneat/until-destroy', '@angular/common', '@angular/forms', '@angular/common/http', 'rxjs', 'rxjs/operators', '@angular/material/snack-bar', '@angular/cdk/a11y', '@angular/cdk/coercion', '@angular/material/form-field', '@angular/material/select', '@angular/material/icon', '@angular/router', '@angular/material/tooltip', '@angular/material/core', '@angular/material/button', '@angular/material/checkbox', '@angular/material/input', '@angular/material/menu', '@angular/material/progress-spinner', '@angular/material/card', '@angular/material/divider', '@angular/material/chips', '@angular/material/datepicker', '@angular/material/list', '@angular/flex-layout', 'ngx-infinite-scroll', 'ngx-doc-viewer', 'ngx-editor', 'xlsx', '@angular/platform-browser', 'jsondiffpatch'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['ngx-techlify-core'] = {}, global.ng.core, global.ng.material.dialog, global.ng.material.table, global.ng.material.sort, global['@ngneat/until-destroy'], global.ng.common, global.ng.forms, global.ng.common.http, global.rxjs, global.rxjs.operators, global.ng.material.snackBar, global.ng.cdk.a11y, global.ng.cdk.coercion, global.ng.material.formField, global.ng.material.select, global.ng.material.icon, global.ng.router, global.ng.material.tooltip, global.ng.material.core, global.ng.material.button, global.ng.material.checkbox, global.ng.material.input, global.ng.material.menu, global.ng.material.progressSpinner, global.ng.material.card, global.ng.material.divider, global.ng.material.chips, global.ng.material.datepicker, global.ng.material.list, global.ng.flexLayout, global['ngx-infinite-scroll'], global['ngx-doc-viewer'], global['ngx-editor'], global.xlsx, global.ng.platformBrowser, global.jsondiffpatch));
5
- }(this, (function (exports, i0, dialog, table, sort, untilDestroy, common, forms, i1$1, rxjs, operators, i1, a11y, coercion, formField, select, icon, i1$2, tooltip, core, button, checkbox, input, menu, progressSpinner, card, divider, chips, datepicker, list, flexLayout, ngxInfiniteScroll, ngxDocViewer, ngxEditor, XLSX, platformBrowser, jsondiffpatch) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/material/dialog'), require('@angular/material/table'), require('@angular/material/sort'), require('@ngneat/until-destroy'), require('@angular/common'), require('@angular/forms'), require('@angular/common/http'), require('rxjs'), require('rxjs/operators'), require('@angular/material/snack-bar'), require('@angular/cdk/a11y'), require('@angular/cdk/coercion'), require('@angular/material/form-field'), require('@angular/material/select'), require('@angular/material/icon'), require('@angular/router'), require('@angular/material/tooltip'), require('@angular/material/core'), require('@angular/material/button'), require('@angular/material/checkbox'), require('@angular/material/input'), require('@angular/material/menu'), require('@angular/material/progress-spinner'), require('@angular/material/card'), require('@angular/material/divider'), require('@angular/material/chips'), require('@angular/material/datepicker'), require('@angular/material/list'), require('@angular/flex-layout'), require('ngx-infinite-scroll'), require('ngx-doc-viewer'), require('ngx-editor'), require('xlsx'), require('@angular/platform-browser'), require('jsondiffpatch'), require('@angular/cdk/keycodes'), require('@angular/material/autocomplete'), require('@angular/material/button-toggle'), require('@angular/material/slide-toggle')) :
3
+ typeof define === 'function' && define.amd ? define('ngx-techlify-core', ['exports', '@angular/core', '@angular/material/dialog', '@angular/material/table', '@angular/material/sort', '@ngneat/until-destroy', '@angular/common', '@angular/forms', '@angular/common/http', 'rxjs', 'rxjs/operators', '@angular/material/snack-bar', '@angular/cdk/a11y', '@angular/cdk/coercion', '@angular/material/form-field', '@angular/material/select', '@angular/material/icon', '@angular/router', '@angular/material/tooltip', '@angular/material/core', '@angular/material/button', '@angular/material/checkbox', '@angular/material/input', '@angular/material/menu', '@angular/material/progress-spinner', '@angular/material/card', '@angular/material/divider', '@angular/material/chips', '@angular/material/datepicker', '@angular/material/list', '@angular/flex-layout', 'ngx-infinite-scroll', 'ngx-doc-viewer', 'ngx-editor', 'xlsx', '@angular/platform-browser', 'jsondiffpatch', '@angular/cdk/keycodes', '@angular/material/autocomplete', '@angular/material/button-toggle', '@angular/material/slide-toggle'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['ngx-techlify-core'] = {}, global.ng.core, global.ng.material.dialog, global.ng.material.table, global.ng.material.sort, global['@ngneat/until-destroy'], global.ng.common, global.ng.forms, global.ng.common.http, global.rxjs, global.rxjs.operators, global.ng.material.snackBar, global.ng.cdk.a11y, global.ng.cdk.coercion, global.ng.material.formField, global.ng.material.select, global.ng.material.icon, global.ng.router, global.ng.material.tooltip, global.ng.material.core, global.ng.material.button, global.ng.material.checkbox, global.ng.material.input, global.ng.material.menu, global.ng.material.progressSpinner, global.ng.material.card, global.ng.material.divider, global.ng.material.chips, global.ng.material.datepicker, global.ng.material.list, global.ng.flexLayout, global['ngx-infinite-scroll'], global['ngx-doc-viewer'], global['ngx-editor'], global.xlsx, global.ng.platformBrowser, global.jsondiffpatch, global.ng.cdk.keycodes, global.ng.material.autocomplete, global.ng.material.buttonToggle, global.ng.material.slideToggle));
5
+ }(this, (function (exports, i0, dialog, table, sort, untilDestroy, common, forms, i1$1, rxjs, operators, i1, a11y, coercion, formField, select, icon, i1$2, tooltip, core, button, checkbox, input, menu, progressSpinner, card, divider, chips, datepicker, list, flexLayout, ngxInfiniteScroll, ngxDocViewer, ngxEditor, XLSX, platformBrowser, jsondiffpatch, keycodes, autocomplete, buttonToggle, slideToggle) { 'use strict';
6
6
 
7
7
  var ActionPopup = /** @class */ (function () {
8
8
  function ActionPopup() {
@@ -2000,6 +2000,7 @@
2000
2000
  this.dialog = dialog;
2001
2001
  this.readonly = false;
2002
2002
  this.labelText = 'Note';
2003
+ this.commentsView = false;
2003
2004
  this.notes = [];
2004
2005
  this.displayedColumns = [
2005
2006
  'index',
@@ -2113,12 +2114,57 @@
2113
2114
  this.loadData();
2114
2115
  }
2115
2116
  };
2117
+ NoteListComponent.prototype.commentAction = function (event) {
2118
+ if (event.type === "save") {
2119
+ if (event.value.id) {
2120
+ this.editComment(event.value);
2121
+ return;
2122
+ }
2123
+ this.addComment(event.value);
2124
+ return;
2125
+ }
2126
+ this.deleteNote(event.value);
2127
+ };
2128
+ NoteListComponent.prototype.editComment = function (comment) {
2129
+ return __awaiter(this, void 0, void 0, function () {
2130
+ var result, index;
2131
+ return __generator(this, function (_a) {
2132
+ switch (_a.label) {
2133
+ case 0: return [4 /*yield*/, this.noteService.editNote(comment)];
2134
+ case 1:
2135
+ result = _a.sent();
2136
+ index = this.notes.findIndex(function (x) { return x.id === comment.id; });
2137
+ if (index !== -1) {
2138
+ this.notes[index] = result.item;
2139
+ }
2140
+ return [2 /*return*/];
2141
+ }
2142
+ });
2143
+ });
2144
+ };
2145
+ NoteListComponent.prototype.addComment = function (comment) {
2146
+ return __awaiter(this, void 0, void 0, function () {
2147
+ var result;
2148
+ return __generator(this, function (_a) {
2149
+ switch (_a.label) {
2150
+ case 0:
2151
+ comment.related_model_id = this.relatedModelId;
2152
+ comment.model_type = this.modelType;
2153
+ return [4 /*yield*/, this.noteService.addNote(comment)];
2154
+ case 1:
2155
+ result = _a.sent();
2156
+ this.notes.push(result.item);
2157
+ return [2 /*return*/];
2158
+ }
2159
+ });
2160
+ });
2161
+ };
2116
2162
  return NoteListComponent;
2117
2163
  }());
2118
2164
  NoteListComponent.decorators = [
2119
2165
  { type: i0.Component, args: [{
2120
2166
  selector: 'app-note-list',
2121
- template: "<div fxLayout=\"column\" fxLayoutGap=\"1.5rem\" class=\"m-4\">\n\n <div fxLayout fxLayoutAlign=\"center center\" fxLayoutGap=\"1rem\">\n <h3 class=\"m-0 font-weight-bold mr-3\">{{labelText}}s</h3>\n <button class=\"d-print-none\" *ngIf=\"!readonly\" mat-raised-button color=\"primary\" type=\"button\"\n (click)=\"addNote()\">+ Add</button>\n </div>\n\n <div class=\"w-00 scroll-container\" infiniteScroll [infiniteScrollDistance]=\"1\" [infiniteScrollThrottle]=\"50\"\n (scrolled)=\"onScroll()\" [scrollWindow]=\"false\">\n <table mat-table [dataSource]=\"notes\" class=\"w-100\" multiTemplateDataRows>\n\n <!-- Index Column -->\n <ng-container matColumnDef=\"index\">\n <th mat-header-cell *matHeaderCellDef> # </th>\n <td mat-cell *matCellDef=\"let note; let i = dataIndex\"> {{ i+1 }} </td>\n </ng-container>\n\n\n <ng-container matColumnDef=\"note\">\n <th mat-header-cell *matHeaderCellDef> {{labelText}} </th>\n <td mat-cell *matCellDef=\"let note\">\n {{note?.note}}\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"actions\">\n <th mat-header-cell *matHeaderCellDef class=\"d-print-none\"> Actions </th>\n <td mat-cell *matCellDef=\"let note\" class=\"d-print-none\">\n <button type=\"button\" mat-icon-button (click)=\"editNote(note)\">\n <mat-icon>edit</mat-icon>\n </button>\n <button type=\"button\" mat-icon-button (click)=\"deleteNote(note)\">\n <mat-icon>delete</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</div>",
2167
+ template: "<div fxLayout=\"column\" fxLayoutGap=\"1.5rem\" class=\"m-4\" *ngIf=\"!commentsView\">\n\n <div fxLayout fxLayoutAlign=\"center center\" fxLayoutGap=\"1rem\">\n <h3 class=\"m-0 font-weight-bold mr-3\">{{labelText}}s</h3>\n <button class=\"d-print-none\" *ngIf=\"!readonly\" mat-raised-button color=\"primary\" type=\"button\" (click)=\"addNote()\">+\n Add</button>\n </div>\n\n <div class=\"w-100 scroll-container\" infiniteScroll [infiniteScrollDistance]=\"1\" [infiniteScrollThrottle]=\"50\"\n (scrolled)=\"onScroll()\" [scrollWindow]=\"false\">\n <table mat-table [dataSource]=\"notes\" class=\"w-100\" multiTemplateDataRows>\n\n <!-- Index Column -->\n <ng-container matColumnDef=\"index\">\n <th mat-header-cell *matHeaderCellDef> # </th>\n <td mat-cell *matCellDef=\"let note; let i = dataIndex\"> {{ i+1 }} </td>\n </ng-container>\n\n\n <ng-container matColumnDef=\"note\">\n <th mat-header-cell *matHeaderCellDef> {{labelText}} </th>\n <td mat-cell *matCellDef=\"let note\">\n {{note?.note}}\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"actions\">\n <th mat-header-cell *matHeaderCellDef class=\"d-print-none\"> Actions </th>\n <td mat-cell *matCellDef=\"let note\" class=\"d-print-none\">\n <button type=\"button\" mat-icon-button (click)=\"editNote(note)\">\n <mat-icon>edit</mat-icon>\n </button>\n <button type=\"button\" mat-icon-button (click)=\"deleteNote(note)\">\n <mat-icon>delete</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</div>\n\n<div fxLayout=\"column\" fxLayoutGap=\"1.5rem\" *ngIf=\"commentsView\">\n <div fxLayout fxLayoutAlign=\"center center\" fxLayoutGap=\"1rem\">\n <h3 class=\"m-0 font-weight-bold mr-3\">{{labelText}}s</h3>\n </div>\n\n <div fxLayout=\"column\" fxLayoutAlign=\"start\" fxFlex=\"100%\">\n <div class=\"w-100 scroll-container jumbotron\" infiniteScroll [infiniteScrollDistance]=\"1\"\n [infiniteScrollThrottle]=\"50\" (scrolled)=\"onScroll()\" [scrollWindow]=\"false\">\n <app-comment-form [commentData]=\"comment\" (action)=\"commentAction($event)\" *ngFor=\"let comment of notes\">\n </app-comment-form>\n <app-comment-form (action)=\"commentAction($event)\"></app-comment-form>\n </div>\n </div>\n</div>\n",
2122
2168
  styles: [".scroll-container{max-height:400px;overflow-y:auto}"]
2123
2169
  },] }
2124
2170
  ];
@@ -2130,11 +2176,95 @@
2130
2176
  relatedModelId: [{ type: i0.Input }],
2131
2177
  modelType: [{ type: i0.Input }],
2132
2178
  readonly: [{ type: i0.Input }],
2133
- labelText: [{ type: i0.Input }]
2179
+ labelText: [{ type: i0.Input }],
2180
+ commentsView: [{ type: i0.Input }]
2181
+ };
2182
+
2183
+ var CommentFormComponent = /** @class */ (function () {
2184
+ function CommentFormComponent(fb, credentialService) {
2185
+ this.fb = fb;
2186
+ this.credentialService = credentialService;
2187
+ this.action = new i0.EventEmitter();
2188
+ this.createForm();
2189
+ }
2190
+ Object.defineProperty(CommentFormComponent.prototype, "commentData", {
2191
+ set: function (data) {
2192
+ this.view = !!data;
2193
+ this._commentData = data;
2194
+ this.commentFormGroup.patchValue(data);
2195
+ },
2196
+ enumerable: false,
2197
+ configurable: true
2198
+ });
2199
+ CommentFormComponent.prototype.ngOnInit = function () { };
2200
+ Object.defineProperty(CommentFormComponent.prototype, "isLoggedIn", {
2201
+ get: function () {
2202
+ return this.credentialService.isAuthenticated;
2203
+ },
2204
+ enumerable: false,
2205
+ configurable: true
2206
+ });
2207
+ Object.defineProperty(CommentFormComponent.prototype, "currentUser", {
2208
+ get: function () {
2209
+ return this.credentialService.credentials.user;
2210
+ },
2211
+ enumerable: false,
2212
+ configurable: true
2213
+ });
2214
+ CommentFormComponent.prototype.createForm = function () {
2215
+ //TODO: Finialize and add more validations.
2216
+ this.commentFormGroup = this.fb.group({
2217
+ id: [""],
2218
+ note: [""],
2219
+ model_type: [""],
2220
+ related_model_id: [""],
2221
+ });
2222
+ };
2223
+ CommentFormComponent.prototype.submit = function () {
2224
+ if (this.commentFormGroup.get("note").value) {
2225
+ if (this._commentData) {
2226
+ this.view = !this.view;
2227
+ }
2228
+ this.action.emit({ type: "save", value: this.commentFormGroup.value });
2229
+ this.commentFormGroup.reset();
2230
+ }
2231
+ else if (this.commentFormGroup.get("id").value) {
2232
+ this.deleteComment();
2233
+ }
2234
+ };
2235
+ CommentFormComponent.prototype.hideEdit = function () {
2236
+ if (this.commentFormGroup.get("id").value) {
2237
+ this.view = !this.view;
2238
+ }
2239
+ };
2240
+ CommentFormComponent.prototype.editComment = function () {
2241
+ this.view = !this.view;
2242
+ this.commentFormGroup.patchValue(this._commentData);
2243
+ };
2244
+ CommentFormComponent.prototype.deleteComment = function () {
2245
+ this.action.emit({ type: "delete", value: this.commentFormGroup.value });
2246
+ };
2247
+ CommentFormComponent.prototype.ngOnDestroy = function () { };
2248
+ return CommentFormComponent;
2249
+ }());
2250
+ CommentFormComponent.decorators = [
2251
+ { type: i0.Component, args: [{
2252
+ selector: "app-comment-form",
2253
+ template: "<form (ngSubmit)=\"submit()\" [formGroup]=\"commentFormGroup\">\n <div fxLayout=\"column\" class=\"my-2\" [ngClass]=\"{ 'border border-primary shadow rounded ': view}\">\n <div *ngIf=\"!view\" fxLayout=\"column\">\n <mat-form-field appearance=\"outline\" style=\"background-color:white;\">\n <mat-label>Comment</mat-label>\n <textarea matInput rows=\"5\" placeholder=\"Add a comment...\" formControlName=\"note\" autocomplete=\"off\"></textarea>\n </mat-form-field>\n\n <div fxLayout fxLayoutGap=\"1rem\" class=\"mt-2\">\n <span fxFlex></span>\n <button *ngIf=\"_commentData\" mat-button type=\"button\" (click)=\"view = !view\">\n Cancel\n </button>\n <button mat-raised-button color=\"primary\" type=\"submit\">\n {{ _commentData ? \"Update\" : \"Post comment\" }}\n </button>\n </div>\n </div>\n\n <div fxLayout=\"column\" *ngIf=\"view\" class=\"p-2 m-2\">\n <div fxLayout=\"row wrap\" fxLayoutGap=\".5rem\">\n <div fxFlex=\"20%\" fxLayoutAlign=\"start\">\n <button mat-icon-button type=\"button\" style=\"color:grey\">\n <mat-icon style=\"font-size:60px\">account_circle</mat-icon>\n </button>\n </div>\n <div fxFlex=\"75%\">\n <div fxLayout=\"column\" fxLayoutGap=\".5rem\">\n <div class=\"font-weight-bold\">{{ _commentData?.creator?.name }}</div>\n <div class=\"text-muted\">{{ _commentData.updated_at | date:'medium' }}</div>\n </div>\n </div>\n </div>\n <app-read-more class=\"mt-2\" [text]=\"_commentData.note\"></app-read-more>\n <div fxLayout class=\"mt-1\" fxLayoutGap=\"1rem\" *ngIf=\"isLoggedIn && currentUser.id === _commentData.creator_id\">\n <a href=\"javascript:;\" (click)=\"editComment()\">\n Edit\n </a>\n <a href=\"javascript:;\" (click)=\"deleteComment()\">\n Delete\n </a>\n </div>\n </div>\n </div>\n</form>",
2254
+ styles: [":host ::ng-deep .mat-form-field-wrapper{margin:0!important;padding-bottom:0!important}"]
2255
+ },] }
2256
+ ];
2257
+ CommentFormComponent.ctorParameters = function () { return [
2258
+ { type: forms.FormBuilder },
2259
+ { type: CredentialsService }
2260
+ ]; };
2261
+ CommentFormComponent.propDecorators = {
2262
+ commentData: [{ type: i0.Input }],
2263
+ action: [{ type: i0.Output }]
2134
2264
  };
2135
2265
 
2136
2266
  var SearchableSelectorComponent_1;
2137
- exports.ɵt = SearchableSelectorComponent_1 = /** @class */ (function () {
2267
+ exports.ɵx = SearchableSelectorComponent_1 = /** @class */ (function () {
2138
2268
  function SearchableSelectorComponent(formBuilder, _focusMonitor, http, _elementRef, dialog, ngControl) {
2139
2269
  var _this = this;
2140
2270
  this._focusMonitor = _focusMonitor;
@@ -2383,8 +2513,8 @@
2383
2513
  };
2384
2514
  return SearchableSelectorComponent;
2385
2515
  }());
2386
- exports.ɵt.nextId = 0;
2387
- exports.ɵt.decorators = [
2516
+ exports.ɵx.nextId = 0;
2517
+ exports.ɵx.decorators = [
2388
2518
  { type: i0.Component, args: [{
2389
2519
  selector: 'app-searchable-selector',
2390
2520
  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>",
@@ -2397,7 +2527,7 @@
2397
2527
  styles: [".searchable-selctor-container{display:flex}.relative-icon{position:relative;top:-4px}"]
2398
2528
  },] }
2399
2529
  ];
2400
- exports.ɵt.ctorParameters = function () { return [
2530
+ exports.ɵx.ctorParameters = function () { return [
2401
2531
  { type: forms.FormBuilder },
2402
2532
  { type: a11y.FocusMonitor },
2403
2533
  { type: HttpService },
@@ -2405,7 +2535,7 @@
2405
2535
  { type: dialog.MatDialog },
2406
2536
  { type: forms.NgControl, decorators: [{ type: i0.Optional }, { type: i0.Self }] }
2407
2537
  ]; };
2408
- exports.ɵt.propDecorators = {
2538
+ exports.ɵx.propDecorators = {
2409
2539
  valueField: [{ type: i0.Input }],
2410
2540
  titleField: [{ type: i0.Input }],
2411
2541
  apiUrl: [{ type: i0.Input }],
@@ -2428,9 +2558,9 @@
2428
2558
  disabled: [{ type: i0.Input }],
2429
2559
  value: [{ type: i0.Input }]
2430
2560
  };
2431
- exports.ɵt = SearchableSelectorComponent_1 = __decorate([
2561
+ exports.ɵx = SearchableSelectorComponent_1 = __decorate([
2432
2562
  untilDestroy.UntilDestroy()
2433
- ], exports.ɵt);
2563
+ ], exports.ɵx);
2434
2564
 
2435
2565
  var MatSelectInfiniteScrollDirective = /** @class */ (function () {
2436
2566
  function MatSelectInfiniteScrollDirective(matSelect, ngZone) {
@@ -2738,7 +2868,7 @@
2738
2868
  Timeline.LAST_YEAR = 11;
2739
2869
  Timeline.ALL = 12;
2740
2870
 
2741
- exports.ɵx = /** @class */ (function () {
2871
+ exports.ɵbb = /** @class */ (function () {
2742
2872
  function TimelineFilterComponent() {
2743
2873
  this.timelineValue = new forms.FormControl('');
2744
2874
  this.timelines = [
@@ -2794,15 +2924,15 @@
2794
2924
  };
2795
2925
  return TimelineFilterComponent;
2796
2926
  }());
2797
- exports.ɵx.decorators = [
2927
+ exports.ɵbb.decorators = [
2798
2928
  { type: i0.Component, args: [{
2799
2929
  selector: 'app-timeline-filter',
2800
2930
  template: "<ng-container [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>",
2801
2931
  styles: [""]
2802
2932
  },] }
2803
2933
  ];
2804
- exports.ɵx.ctorParameters = function () { return []; };
2805
- exports.ɵx.propDecorators = {
2934
+ exports.ɵbb.ctorParameters = function () { return []; };
2935
+ exports.ɵbb.propDecorators = {
2806
2936
  timelineValue: [{ type: i0.Input }],
2807
2937
  timelines: [{ type: i0.Input }],
2808
2938
  labelText: [{ type: i0.Input }],
@@ -2813,9 +2943,9 @@
2813
2943
  form: [{ type: i0.Input }],
2814
2944
  defaultValue: [{ type: i0.Input }]
2815
2945
  };
2816
- exports.ɵx = __decorate([
2946
+ exports.ɵbb = __decorate([
2817
2947
  untilDestroy.UntilDestroy()
2818
- ], exports.ɵx);
2948
+ ], exports.ɵbb);
2819
2949
 
2820
2950
  var LoaderComponent = /** @class */ (function () {
2821
2951
  function LoaderComponent() {
@@ -3330,6 +3460,68 @@
3330
3460
  },] }
3331
3461
  ];
3332
3462
 
3463
+ var ReadMoreComponent = /** @class */ (function () {
3464
+ function ReadMoreComponent() {
3465
+ this.maxLength = 100;
3466
+ this.hideToggle = true;
3467
+ this.isCollapsed = true;
3468
+ }
3469
+ ReadMoreComponent.prototype.ngOnInit = function () {
3470
+ this.determineView();
3471
+ };
3472
+ ReadMoreComponent.prototype.toggleView = function () {
3473
+ this.isCollapsed = !this.isCollapsed;
3474
+ this.determineView();
3475
+ };
3476
+ ReadMoreComponent.prototype.determineView = function () {
3477
+ if (!this.text || this.text.length <= this.maxLength) {
3478
+ this.currentText = this.text;
3479
+ this.isCollapsed = false;
3480
+ this.hideToggle = true;
3481
+ return;
3482
+ }
3483
+ this.hideToggle = false;
3484
+ if (this.isCollapsed == true) {
3485
+ this.currentText = this.text.substring(0, this.maxLength) + "...";
3486
+ }
3487
+ else if (this.isCollapsed == false) {
3488
+ this.currentText = this.text;
3489
+ }
3490
+ };
3491
+ return ReadMoreComponent;
3492
+ }());
3493
+ ReadMoreComponent.decorators = [
3494
+ { type: i0.Component, args: [{
3495
+ selector: "app-read-more",
3496
+ template: "<div [innerHTML]=\"currentText\"></div>\n<a href=\"javascript:;\" *ngIf=\"!hideToggle\" class=\"primary-color hoverable\" (click)=\"toggleView()\">Read\n {{ isCollapsed ? \"more\" : \"less\" }}</a>",
3497
+ styles: ["div.collapsed{height:250px;overflow:hidden}.primary-color{color:#009fdd!important}"]
3498
+ },] }
3499
+ ];
3500
+ ReadMoreComponent.ctorParameters = function () { return []; };
3501
+ ReadMoreComponent.propDecorators = {
3502
+ text: [{ type: i0.Input }],
3503
+ maxLength: [{ type: i0.Input }]
3504
+ };
3505
+
3506
+ var ReadMoreModule = /** @class */ (function () {
3507
+ function ReadMoreModule() {
3508
+ }
3509
+ return ReadMoreModule;
3510
+ }());
3511
+ ReadMoreModule.decorators = [
3512
+ { type: i0.NgModule, args: [{
3513
+ declarations: [ReadMoreComponent],
3514
+ imports: [
3515
+ common.CommonModule,
3516
+ MaterialModule,
3517
+ flexLayout.FlexLayoutModule
3518
+ ],
3519
+ exports: [
3520
+ ReadMoreComponent
3521
+ ]
3522
+ },] }
3523
+ ];
3524
+
3333
3525
  var NoteModule = /** @class */ (function () {
3334
3526
  function NoteModule() {
3335
3527
  }
@@ -3339,7 +3531,8 @@
3339
3531
  { type: i0.NgModule, args: [{
3340
3532
  declarations: [
3341
3533
  NoteListComponent,
3342
- NoteFormComponent
3534
+ NoteFormComponent,
3535
+ CommentFormComponent,
3343
3536
  ],
3344
3537
  imports: [
3345
3538
  common.CommonModule,
@@ -3347,7 +3540,8 @@
3347
3540
  ngxInfiniteScroll.InfiniteScrollModule,
3348
3541
  flexLayout.FlexLayoutModule,
3349
3542
  ActionPopupModule,
3350
- MaterialModule
3543
+ MaterialModule,
3544
+ ReadMoreModule
3351
3545
  ],
3352
3546
  exports: [
3353
3547
  NoteListComponent
@@ -3370,11 +3564,11 @@
3370
3564
  MaterialModule
3371
3565
  ],
3372
3566
  declarations: [
3373
- exports.ɵt,
3567
+ exports.ɵx,
3374
3568
  MatSelectInfiniteScrollDirective
3375
3569
  ],
3376
3570
  exports: [
3377
- exports.ɵt,
3571
+ exports.ɵx,
3378
3572
  MatSelectInfiniteScrollDirective
3379
3573
  ]
3380
3574
  },] }
@@ -3418,7 +3612,7 @@
3418
3612
  }());
3419
3613
  TimelineFilterModule.decorators = [
3420
3614
  { type: i0.NgModule, args: [{
3421
- declarations: [exports.ɵx],
3615
+ declarations: [exports.ɵbb],
3422
3616
  imports: [
3423
3617
  common.CommonModule,
3424
3618
  TimelineFilterRoutingModule,
@@ -3426,7 +3620,7 @@
3426
3620
  MaterialModule,
3427
3621
  forms.ReactiveFormsModule
3428
3622
  ],
3429
- exports: [exports.ɵx]
3623
+ exports: [exports.ɵbb]
3430
3624
  },] }
3431
3625
  ];
3432
3626
 
@@ -3528,7 +3722,7 @@
3528
3722
  required: "Email Type is required"
3529
3723
  },
3530
3724
  };
3531
- exports.ɵba = /** @class */ (function () {
3725
+ exports.ɵbe = /** @class */ (function () {
3532
3726
  function EmailSubscriptionUserFormComponent(fb, formValidatorService, alertService, dialogRef, data, http) {
3533
3727
  this.fb = fb;
3534
3728
  this.formValidatorService = formValidatorService;
@@ -3590,14 +3784,14 @@
3590
3784
  };
3591
3785
  return EmailSubscriptionUserFormComponent;
3592
3786
  }());
3593
- exports.ɵba.decorators = [
3787
+ exports.ɵbe.decorators = [
3594
3788
  { type: i0.Component, args: [{
3595
3789
  selector: 'app-email-subscription-user-form',
3596
3790
  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>",
3597
3791
  styles: [""]
3598
3792
  },] }
3599
3793
  ];
3600
- exports.ɵba.ctorParameters = function () { return [
3794
+ exports.ɵbe.ctorParameters = function () { return [
3601
3795
  { type: forms.FormBuilder },
3602
3796
  { type: FormValidatorService },
3603
3797
  { type: AlertService },
@@ -3605,9 +3799,9 @@
3605
3799
  { type: undefined, decorators: [{ type: i0.Inject, args: [dialog.MAT_DIALOG_DATA,] }] },
3606
3800
  { type: HttpService }
3607
3801
  ]; };
3608
- exports.ɵba = __decorate([
3802
+ exports.ɵbe = __decorate([
3609
3803
  untilDestroy.UntilDestroy()
3610
- ], exports.ɵba);
3804
+ ], exports.ɵbe);
3611
3805
 
3612
3806
  var EmailSubscriptionUserFormModule = /** @class */ (function () {
3613
3807
  function EmailSubscriptionUserFormModule() {
@@ -3616,7 +3810,7 @@
3616
3810
  }());
3617
3811
  EmailSubscriptionUserFormModule.decorators = [
3618
3812
  { type: i0.NgModule, args: [{
3619
- declarations: [exports.ɵba],
3813
+ declarations: [exports.ɵbe],
3620
3814
  imports: [
3621
3815
  common.CommonModule,
3622
3816
  MaterialModule,
@@ -3626,12 +3820,12 @@
3626
3820
  EmailSubscriptionUserFormRoutingModule,
3627
3821
  LoaderModule
3628
3822
  ],
3629
- entryComponents: [exports.ɵba]
3823
+ entryComponents: [exports.ɵbe]
3630
3824
  },] }
3631
3825
  ];
3632
3826
 
3633
3827
  var log$4 = new Logger('EmailSubscriptionUser list');
3634
- exports.ɵbb = /** @class */ (function () {
3828
+ exports.ɵbf = /** @class */ (function () {
3635
3829
  function EmailSubscriptionUserListComponent(dialog, http, router) {
3636
3830
  this.dialog = dialog;
3637
3831
  this.http = http;
@@ -3692,7 +3886,7 @@
3692
3886
  };
3693
3887
  EmailSubscriptionUserListComponent.prototype.addEmailSubscriptionUser = function () {
3694
3888
  var _this = this;
3695
- var dialogRef = this.dialog.open(exports.ɵba, {
3889
+ var dialogRef = this.dialog.open(exports.ɵbe, {
3696
3890
  width: '800px',
3697
3891
  autoFocus: false,
3698
3892
  data: {} // Any data passed here will be injected into the model
@@ -3707,7 +3901,7 @@
3707
3901
  EmailSubscriptionUserListComponent.prototype.editEmailSubscriptionUser = function (event, esUser) {
3708
3902
  var _this = this;
3709
3903
  event.stopPropagation();
3710
- var dialogRef = this.dialog.open(exports.ɵba, {
3904
+ var dialogRef = this.dialog.open(exports.ɵbe, {
3711
3905
  width: '800px',
3712
3906
  autoFocus: false,
3713
3907
  data: {
@@ -3765,24 +3959,24 @@
3765
3959
  };
3766
3960
  return EmailSubscriptionUserListComponent;
3767
3961
  }());
3768
- exports.ɵbb.decorators = [
3962
+ exports.ɵbf.decorators = [
3769
3963
  { type: i0.Component, args: [{
3770
3964
  selector: 'app-email-subscription-user-list',
3771
3965
  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>",
3772
3966
  styles: [".scroll-container{max-height:800px;overflow-y:auto}"]
3773
3967
  },] }
3774
3968
  ];
3775
- exports.ɵbb.ctorParameters = function () { return [
3969
+ exports.ɵbf.ctorParameters = function () { return [
3776
3970
  { type: dialog.MatDialog },
3777
3971
  { type: HttpService },
3778
3972
  { type: i1$2.Router }
3779
3973
  ]; };
3780
- exports.ɵbb.propDecorators = {
3974
+ exports.ɵbf.propDecorators = {
3781
3975
  sort: [{ type: i0.ViewChild, args: [sort.MatSort, { static: true },] }]
3782
3976
  };
3783
- exports.ɵbb = __decorate([
3977
+ exports.ɵbf = __decorate([
3784
3978
  untilDestroy.UntilDestroy()
3785
- ], exports.ɵbb);
3979
+ ], exports.ɵbf);
3786
3980
 
3787
3981
  var esulr = {
3788
3982
  title: 'Email Subscription Users',
@@ -3794,7 +3988,7 @@
3794
3988
  var routes$4 = [
3795
3989
  {
3796
3990
  path: '',
3797
- component: exports.ɵbb,
3991
+ component: exports.ɵbf,
3798
3992
  canActivate: [AuthenticationGuard],
3799
3993
  data: esulr
3800
3994
  },
@@ -3824,7 +4018,7 @@
3824
4018
  },] }
3825
4019
  ];
3826
4020
 
3827
- exports.ɵbg = /** @class */ (function () {
4021
+ exports.ɵbh = /** @class */ (function () {
3828
4022
  function EmailSubscriptionUserListFilterComponent(fb) {
3829
4023
  this.fb = fb;
3830
4024
  this.valueChange = new i0.EventEmitter();
@@ -3853,22 +4047,22 @@
3853
4047
  };
3854
4048
  return EmailSubscriptionUserListFilterComponent;
3855
4049
  }());
3856
- exports.ɵbg.decorators = [
4050
+ exports.ɵbh.decorators = [
3857
4051
  { type: i0.Component, args: [{
3858
4052
  selector: 'app-email-subscription-user-list-filter',
3859
4053
  template: "<form [formGroup]=\"esUserFilterForm\" fxLayout=\"row wrap\" fxLayoutGap=\"1rem\" fxLayoutAlign=\"start center\">\n <mat-form-field class=\"ml-3\">\n <mat-label>User</mat-label>\n <app-searchable-selector formControlName=\"user_id\" apiUrl=\"api/users\" titleField=\"name\">\n </app-searchable-selector>\n <button mat-button *ngIf=\"getFieldValue('user_id')\" matSuffix mat-icon-button\n (click)=\"resetFieldValue('user_id')\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <mat-form-field class=\"ml-3\">\n <mat-label>Email Type</mat-label>\n <app-searchable-selector formControlName=\"email_type_id\" apiUrl=\"api/email-subscription-types\">\n </app-searchable-selector>\n <button mat-button *ngIf=\"getFieldValue('user_id')\" matSuffix mat-icon-button\n (click)=\"resetFieldValue('user_id')\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n</form>",
3860
4054
  styles: [""]
3861
4055
  },] }
3862
4056
  ];
3863
- exports.ɵbg.ctorParameters = function () { return [
4057
+ exports.ɵbh.ctorParameters = function () { return [
3864
4058
  { type: forms.FormBuilder }
3865
4059
  ]; };
3866
- exports.ɵbg.propDecorators = {
4060
+ exports.ɵbh.propDecorators = {
3867
4061
  valueChange: [{ type: i0.Output }]
3868
4062
  };
3869
- exports.ɵbg = __decorate([
4063
+ exports.ɵbh = __decorate([
3870
4064
  untilDestroy.UntilDestroy()
3871
- ], exports.ɵbg);
4065
+ ], exports.ɵbh);
3872
4066
 
3873
4067
  var EmailSubscriptionUserListFilterModule = /** @class */ (function () {
3874
4068
  function EmailSubscriptionUserListFilterModule() {
@@ -3877,7 +4071,7 @@
3877
4071
  }());
3878
4072
  EmailSubscriptionUserListFilterModule.decorators = [
3879
4073
  { type: i0.NgModule, args: [{
3880
- declarations: [exports.ɵbg],
4074
+ declarations: [exports.ɵbh],
3881
4075
  imports: [
3882
4076
  common.CommonModule,
3883
4077
  MaterialModule,
@@ -3886,7 +4080,7 @@
3886
4080
  SearchableSelectorModule,
3887
4081
  EmailSubscriptionUserListFilterRoutingModule
3888
4082
  ],
3889
- exports: [exports.ɵbg]
4083
+ exports: [exports.ɵbh]
3890
4084
  },] }
3891
4085
  ];
3892
4086
 
@@ -3897,7 +4091,7 @@
3897
4091
  }());
3898
4092
  EmailSubscriptionUserListModule.decorators = [
3899
4093
  { type: i0.NgModule, args: [{
3900
- declarations: [exports.ɵbb],
4094
+ declarations: [exports.ɵbf],
3901
4095
  imports: [
3902
4096
  common.CommonModule,
3903
4097
  ngxInfiniteScroll.InfiniteScrollModule,
@@ -3908,7 +4102,7 @@
3908
4102
  EmailSubscriptionUserFormModule,
3909
4103
  EmailSubscriptionUserListFilterModule
3910
4104
  ],
3911
- exports: [exports.ɵbb]
4105
+ exports: [exports.ɵbf]
3912
4106
  },] }
3913
4107
  ];
3914
4108
 
@@ -3964,7 +4158,7 @@
3964
4158
  required: "Frequency is required"
3965
4159
  },
3966
4160
  };
3967
- exports.ɵbh = /** @class */ (function () {
4161
+ exports.ɵbi = /** @class */ (function () {
3968
4162
  function EmailSubscriptionTypeFormComponent(fb, formValidatorService, alertService, dialogRef, data, http) {
3969
4163
  this.fb = fb;
3970
4164
  this.formValidatorService = formValidatorService;
@@ -4028,14 +4222,14 @@
4028
4222
  };
4029
4223
  return EmailSubscriptionTypeFormComponent;
4030
4224
  }());
4031
- exports.ɵbh.decorators = [
4225
+ exports.ɵbi.decorators = [
4032
4226
  { type: i0.Component, args: [{
4033
4227
  selector: 'app-email-subscription-type-form',
4034
4228
  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>",
4035
4229
  styles: [""]
4036
4230
  },] }
4037
4231
  ];
4038
- exports.ɵbh.ctorParameters = function () { return [
4232
+ exports.ɵbi.ctorParameters = function () { return [
4039
4233
  { type: forms.FormBuilder },
4040
4234
  { type: FormValidatorService },
4041
4235
  { type: AlertService },
@@ -4043,9 +4237,9 @@
4043
4237
  { type: undefined, decorators: [{ type: i0.Inject, args: [dialog.MAT_DIALOG_DATA,] }] },
4044
4238
  { type: HttpService }
4045
4239
  ]; };
4046
- exports.ɵbh = __decorate([
4240
+ exports.ɵbi = __decorate([
4047
4241
  untilDestroy.UntilDestroy()
4048
- ], exports.ɵbh);
4242
+ ], exports.ɵbi);
4049
4243
 
4050
4244
  var EmailSubscriptionTypeFormModule = /** @class */ (function () {
4051
4245
  function EmailSubscriptionTypeFormModule() {
@@ -4054,7 +4248,7 @@
4054
4248
  }());
4055
4249
  EmailSubscriptionTypeFormModule.decorators = [
4056
4250
  { type: i0.NgModule, args: [{
4057
- declarations: [exports.ɵbh],
4251
+ declarations: [exports.ɵbi],
4058
4252
  imports: [
4059
4253
  common.CommonModule,
4060
4254
  MaterialModule,
@@ -4064,12 +4258,12 @@
4064
4258
  EmailSubscriptionTypeFormRoutingModule,
4065
4259
  LoaderModule
4066
4260
  ],
4067
- exports: [exports.ɵbh],
4068
- entryComponents: [exports.ɵbh]
4261
+ exports: [exports.ɵbi],
4262
+ entryComponents: [exports.ɵbi]
4069
4263
  },] }
4070
4264
  ];
4071
4265
 
4072
- exports.ɵbi = /** @class */ (function () {
4266
+ exports.ɵbj = /** @class */ (function () {
4073
4267
  function EmailSubscriptionTypeListComponent(dialog, http) {
4074
4268
  this.dialog = dialog;
4075
4269
  this.http = http;
@@ -4133,7 +4327,7 @@
4133
4327
  };
4134
4328
  EmailSubscriptionTypeListComponent.prototype.addEmailSubscriptionType = function () {
4135
4329
  var _this = this;
4136
- var dialogRef = this.dialog.open(exports.ɵbh, {
4330
+ var dialogRef = this.dialog.open(exports.ɵbi, {
4137
4331
  width: '400px',
4138
4332
  autoFocus: false,
4139
4333
  data: {} // Any data passed here will be injected into the model
@@ -4147,7 +4341,7 @@
4147
4341
  EmailSubscriptionTypeListComponent.prototype.editEmailSubscriptionType = function (event, emailSubscriptionType) {
4148
4342
  var _this = this;
4149
4343
  event.stopPropagation();
4150
- var dialogRef = this.dialog.open(exports.ɵbh, {
4344
+ var dialogRef = this.dialog.open(exports.ɵbi, {
4151
4345
  width: '400px',
4152
4346
  autoFocus: false,
4153
4347
  data: {
@@ -4204,23 +4398,23 @@
4204
4398
  };
4205
4399
  return EmailSubscriptionTypeListComponent;
4206
4400
  }());
4207
- exports.ɵbi.decorators = [
4401
+ exports.ɵbj.decorators = [
4208
4402
  { type: i0.Component, args: [{
4209
4403
  selector: 'app-email-subscription-type-list',
4210
4404
  template: "<div class=\"mat-typography m-4\">\n <div fxLayout=\"row wrap\" fxLayoutAlign=\"start center\">\n <mat-form-field>\n <input matInput [formControl]=\"search\" placeholder=\"Email Type\" autocomplete=\"off\" />\n <button mat-button matSuffix mat-icon-button>\n <mat-icon>search</mat-icon>\n </button>\n <button mat-button *ngIf=\"search.value\" matSuffix mat-icon-button (click)=\"search.setValue('')\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n <div class=\"ml-2\">\n <button mat-raised-button color=\"primary\" type=\"button\" (click)=\"addEmailSubscriptionType()\">+ Email\n Type</button>\n </div>\n <span fxFlex></span>\n <mat-form-field appearance=\"outline\" class=\"no-padding\">\n <mat-label>Columns</mat-label>\n <mat-select [formControl]=\"displayColumns\" multiple (selectionChange)=\"columnsChange()\">\n <mat-option *ngFor=\"let column of availableDisplayColumns\" [value]=\"column.value\">{{column.name}}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n\n <section>\n <div class=\"scroll-container\" infiniteScroll [infiniteScrollDistance]=\"2\" [infiniteScrollThrottle]=\"50\"\n (scrolled)=\"onScroll()\" [scrollWindow]=\"false\">\n <table mat-table [dataSource]=\"emailSubscriptionTypeList\" matSort class=\"w-100 mt-1\" multiTemplateDataRows\n id=\"email-subscription-type-table\">\n\n <!-- Index Column -->\n <ng-container matColumnDef=\"index\">\n <th mat-header-cell *matHeaderCellDef> # </th>\n <td mat-cell *matCellDef=\"let emailSubscriptionType; let i = dataIndex\"> {{ i+1 }} </td>\n </ng-container>\n <ng-container matColumnDef=\"title\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header> Title </th>\n <td mat-cell *matCellDef=\"let emailSubscriptionType;\"> {{ emailSubscriptionType?.title }} </td>\n </ng-container>\n <ng-container matColumnDef=\"code\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header> Code </th>\n <td mat-cell *matCellDef=\"let emailSubscriptionType;\"> {{ emailSubscriptionType?.code }}\n </td>\n </ng-container>\n <ng-container matColumnDef=\"frequency.title\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header> Code </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>",
4211
4405
  styles: [".scroll-container{max-height:800px;overflow-y:auto}"]
4212
4406
  },] }
4213
4407
  ];
4214
- exports.ɵbi.ctorParameters = function () { return [
4408
+ exports.ɵbj.ctorParameters = function () { return [
4215
4409
  { type: dialog.MatDialog },
4216
4410
  { type: HttpService }
4217
4411
  ]; };
4218
- exports.ɵbi.propDecorators = {
4412
+ exports.ɵbj.propDecorators = {
4219
4413
  sort: [{ type: i0.ViewChild, args: [sort.MatSort, { static: true },] }]
4220
4414
  };
4221
- exports.ɵbi = __decorate([
4415
+ exports.ɵbj = __decorate([
4222
4416
  untilDestroy.UntilDestroy()
4223
- ], exports.ɵbi);
4417
+ ], exports.ɵbj);
4224
4418
 
4225
4419
  var estlr = {
4226
4420
  title: 'Email Subscription Type',
@@ -4232,7 +4426,7 @@
4232
4426
  var routes$8 = [
4233
4427
  {
4234
4428
  path: '',
4235
- component: exports.ɵbi,
4429
+ component: exports.ɵbj,
4236
4430
  canActivate: [AuthenticationGuard],
4237
4431
  data: estlr
4238
4432
  },
@@ -4256,7 +4450,7 @@
4256
4450
  }());
4257
4451
  EmailSubscriptionTypeListModule.decorators = [
4258
4452
  { type: i0.NgModule, args: [{
4259
- declarations: [exports.ɵbi],
4453
+ declarations: [exports.ɵbj],
4260
4454
  imports: [
4261
4455
  common.CommonModule,
4262
4456
  MaterialModule,
@@ -4266,11 +4460,11 @@
4266
4460
  EmailSubscriptionTypeFormModule,
4267
4461
  EmailSubscriptionTypeListRoutingModule
4268
4462
  ],
4269
- exports: [exports.ɵbi]
4463
+ exports: [exports.ɵbj]
4270
4464
  },] }
4271
4465
  ];
4272
4466
 
4273
- exports.ɵbj = /** @class */ (function () {
4467
+ exports.ɵbk = /** @class */ (function () {
4274
4468
  function EmailSubscriptionForUserComponent(http) {
4275
4469
  this.http = http;
4276
4470
  this.subscriptions = [];
@@ -4325,19 +4519,19 @@
4325
4519
  };
4326
4520
  return EmailSubscriptionForUserComponent;
4327
4521
  }());
4328
- exports.ɵbj.decorators = [
4522
+ exports.ɵbk.decorators = [
4329
4523
  { type: i0.Component, args: [{
4330
4524
  selector: 'app-email-subscription-for-user',
4331
4525
  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>",
4332
4526
  styles: [".scroll-container{max-height:800px;overflow-y:auto}"]
4333
4527
  },] }
4334
4528
  ];
4335
- exports.ɵbj.ctorParameters = function () { return [
4529
+ exports.ɵbk.ctorParameters = function () { return [
4336
4530
  { type: HttpService }
4337
4531
  ]; };
4338
- exports.ɵbj = __decorate([
4532
+ exports.ɵbk = __decorate([
4339
4533
  untilDestroy.UntilDestroy()
4340
- ], exports.ɵbj);
4534
+ ], exports.ɵbk);
4341
4535
 
4342
4536
  var esfur = {
4343
4537
  permissions: {
@@ -4347,7 +4541,7 @@
4347
4541
  var routes$9 = [
4348
4542
  {
4349
4543
  path: '',
4350
- component: exports.ɵbj,
4544
+ component: exports.ɵbk,
4351
4545
  canActivate: [AuthenticationGuard],
4352
4546
  data: esfur
4353
4547
  },
@@ -4371,7 +4565,7 @@
4371
4565
  }());
4372
4566
  EmailSubscriptionForUserModule.decorators = [
4373
4567
  { type: i0.NgModule, args: [{
4374
- declarations: [exports.ɵbj],
4568
+ declarations: [exports.ɵbk],
4375
4569
  imports: [
4376
4570
  common.CommonModule,
4377
4571
  ngxInfiniteScroll.InfiniteScrollModule,
@@ -4379,101 +4573,39 @@
4379
4573
  flexLayout.FlexLayoutModule,
4380
4574
  EmailSubscriptionForUserRoutingModule
4381
4575
  ],
4382
- exports: [exports.ɵbj]
4576
+ exports: [exports.ɵbk]
4383
4577
  },] }
4384
4578
  ];
4385
4579
 
4386
- var ReadMoreComponent = /** @class */ (function () {
4387
- function ReadMoreComponent() {
4388
- this.maxLength = 100;
4389
- this.hideToggle = true;
4390
- this.isCollapsed = true;
4580
+ var TechlifyUpdateService = /** @class */ (function () {
4581
+ function TechlifyUpdateService(http) {
4582
+ this.http = http;
4391
4583
  }
4392
- ReadMoreComponent.prototype.ngOnInit = function () {
4393
- this.determineView();
4584
+ TechlifyUpdateService.prototype.getTechlifyUpdates = function (filters) {
4585
+ return this.http.get("api/techlify-updates", { params: filters }).toPromise();
4394
4586
  };
4395
- ReadMoreComponent.prototype.toggleView = function () {
4396
- this.isCollapsed = !this.isCollapsed;
4397
- this.determineView();
4587
+ TechlifyUpdateService.prototype.createTechlifyUpdate = function (techlifyUpdate) {
4588
+ return this.http.post("api/techlify-updates", techlifyUpdate).toPromise();
4398
4589
  };
4399
- ReadMoreComponent.prototype.determineView = function () {
4400
- if (!this.text || this.text.length <= this.maxLength) {
4401
- this.currentText = this.text;
4402
- this.isCollapsed = false;
4403
- this.hideToggle = true;
4404
- return;
4405
- }
4406
- this.hideToggle = false;
4407
- if (this.isCollapsed == true) {
4408
- this.currentText = this.text.substring(0, this.maxLength) + "...";
4409
- }
4410
- else if (this.isCollapsed == false) {
4411
- this.currentText = this.text;
4412
- }
4590
+ TechlifyUpdateService.prototype.updateTechlifyUpdate = function (techlifyUpdate) {
4591
+ return this.http.put("api/techlify-updates/" + techlifyUpdate.id, techlifyUpdate).toPromise();
4413
4592
  };
4414
- return ReadMoreComponent;
4415
- }());
4416
- ReadMoreComponent.decorators = [
4417
- { type: i0.Component, args: [{
4418
- selector: "app-read-more",
4419
- template: "<div [innerHTML]=\"currentText\"></div>\n<a href=\"javascript:;\" *ngIf=\"!hideToggle\" class=\"primary-color hoverable\" (click)=\"toggleView()\">Read\n {{ isCollapsed ? \"more\" : \"less\" }}</a>",
4420
- styles: ["div.collapsed{height:250px;overflow:hidden}"]
4421
- },] }
4422
- ];
4423
- ReadMoreComponent.ctorParameters = function () { return []; };
4424
- ReadMoreComponent.propDecorators = {
4425
- text: [{ type: i0.Input }],
4426
- maxLength: [{ type: i0.Input }]
4427
- };
4428
-
4429
- var ReadMoreModule = /** @class */ (function () {
4430
- function ReadMoreModule() {
4431
- }
4432
- return ReadMoreModule;
4433
- }());
4434
- ReadMoreModule.decorators = [
4435
- { type: i0.NgModule, args: [{
4436
- declarations: [ReadMoreComponent],
4437
- imports: [
4438
- common.CommonModule,
4439
- MaterialModule,
4440
- flexLayout.FlexLayoutModule
4441
- ],
4442
- exports: [
4443
- ReadMoreComponent
4444
- ]
4445
- },] }
4446
- ];
4447
-
4448
- var TechlifyUpdateService = /** @class */ (function () {
4449
- function TechlifyUpdateService(http) {
4450
- this.http = http;
4451
- }
4452
- TechlifyUpdateService.prototype.getTechlifyUpdates = function (filters) {
4453
- return this.http.get("api/techlify-updates", { params: filters }).toPromise();
4454
- };
4455
- TechlifyUpdateService.prototype.createTechlifyUpdate = function (techlifyUpdate) {
4456
- return this.http.post("api/techlify-updates", techlifyUpdate).toPromise();
4457
- };
4458
- TechlifyUpdateService.prototype.updateTechlifyUpdate = function (techlifyUpdate) {
4459
- return this.http.put("api/techlify-updates/" + techlifyUpdate.id, techlifyUpdate).toPromise();
4460
- };
4461
- TechlifyUpdateService.prototype.deleteTechlifyUpdate = function (techlifyUpdateId) {
4462
- return this.http.delete("api/techlify-updates/" + techlifyUpdateId).toPromise();
4463
- };
4464
- TechlifyUpdateService.prototype.getTechlifyUpdate = function (techlifyUpdateId) {
4465
- return this.http.get("api/techlify-updates/" + techlifyUpdateId).toPromise();
4466
- };
4467
- TechlifyUpdateService.prototype.getNewUpdateForCurrentUser = function () {
4468
- return this.http.get("api/current-user-techlify-updates").toPromise();
4469
- };
4470
- TechlifyUpdateService.prototype.createUpdateViewRecord = function (techlifyUpdateView) {
4471
- return this.http.post("api/techlify-update-views", techlifyUpdateView).toPromise();
4472
- };
4473
- TechlifyUpdateService.prototype.updateCurrentUserUpdates = function () {
4474
- return this.http.get("api/techlify-updates/update-view").toPromise();
4475
- };
4476
- return TechlifyUpdateService;
4593
+ TechlifyUpdateService.prototype.deleteTechlifyUpdate = function (techlifyUpdateId) {
4594
+ return this.http.delete("api/techlify-updates/" + techlifyUpdateId).toPromise();
4595
+ };
4596
+ TechlifyUpdateService.prototype.getTechlifyUpdate = function (techlifyUpdateId) {
4597
+ return this.http.get("api/techlify-updates/" + techlifyUpdateId).toPromise();
4598
+ };
4599
+ TechlifyUpdateService.prototype.getNewUpdateForCurrentUser = function () {
4600
+ return this.http.get("api/current-user-techlify-updates").toPromise();
4601
+ };
4602
+ TechlifyUpdateService.prototype.createUpdateViewRecord = function (techlifyUpdateView) {
4603
+ return this.http.post("api/techlify-update-views", techlifyUpdateView).toPromise();
4604
+ };
4605
+ TechlifyUpdateService.prototype.updateCurrentUserUpdates = function () {
4606
+ return this.http.get("api/techlify-updates/update-view").toPromise();
4607
+ };
4608
+ return TechlifyUpdateService;
4477
4609
  }());
4478
4610
  TechlifyUpdateService.ɵprov = i0.ɵɵdefineInjectable({ factory: function TechlifyUpdateService_Factory() { return new TechlifyUpdateService(i0.ɵɵinject(HttpService)); }, token: TechlifyUpdateService, providedIn: "root" });
4479
4611
  TechlifyUpdateService.decorators = [
@@ -4633,7 +4765,7 @@
4633
4765
  },] }
4634
4766
  ];
4635
4767
 
4636
- exports.ɵbk = /** @class */ (function () {
4768
+ exports.ɵbl = /** @class */ (function () {
4637
4769
  function TechlifyUpdatesListComponent(dialog, alertService, techlifyUpdateService, fb) {
4638
4770
  this.dialog = dialog;
4639
4771
  this.alertService = alertService;
@@ -4793,26 +4925,26 @@
4793
4925
  };
4794
4926
  return TechlifyUpdatesListComponent;
4795
4927
  }());
4796
- exports.ɵbk.decorators = [
4928
+ exports.ɵbl.decorators = [
4797
4929
  { type: i0.Component, args: [{
4798
4930
  selector: 'app-techlify-updates-list',
4799
4931
  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",
4800
4932
  styles: [""]
4801
4933
  },] }
4802
4934
  ];
4803
- exports.ɵbk.ctorParameters = function () { return [
4935
+ exports.ɵbl.ctorParameters = function () { return [
4804
4936
  { type: dialog.MatDialog },
4805
4937
  { type: AlertService },
4806
4938
  { type: TechlifyUpdateService },
4807
4939
  { type: forms.FormBuilder }
4808
4940
  ]; };
4809
- exports.ɵbk = __decorate([
4941
+ exports.ɵbl = __decorate([
4810
4942
  untilDestroy.UntilDestroy()
4811
- ], exports.ɵbk);
4943
+ ], exports.ɵbl);
4812
4944
 
4813
4945
  var routes$a = [
4814
4946
  { path: '', redirectTo: 'all', pathMatch: 'full' },
4815
- { path: 'all', component: exports.ɵbk },
4947
+ { path: 'all', component: exports.ɵbl },
4816
4948
  //fallback
4817
4949
  {
4818
4950
  path: '**',
@@ -4839,7 +4971,7 @@
4839
4971
  }());
4840
4972
  TechlifyUpdateModule.decorators = [
4841
4973
  { type: i0.NgModule, args: [{
4842
- declarations: [exports.ɵbk],
4974
+ declarations: [exports.ɵbl],
4843
4975
  imports: [
4844
4976
  common.CommonModule,
4845
4977
  forms.ReactiveFormsModule,
@@ -4886,7 +5018,7 @@
4886
5018
  { type: i1$2.Router }
4887
5019
  ]; };
4888
5020
 
4889
- exports.ɵbs = /** @class */ (function () {
5021
+ exports.ɵbr = /** @class */ (function () {
4890
5022
  function TechlifyUpdateHistoryComponent(dialog, techlifyUpdateService, fb, alertService) {
4891
5023
  this.dialog = dialog;
4892
5024
  this.techlifyUpdateService = techlifyUpdateService;
@@ -5023,26 +5155,26 @@
5023
5155
  };
5024
5156
  return TechlifyUpdateHistoryComponent;
5025
5157
  }());
5026
- exports.ɵbs.decorators = [
5158
+ exports.ɵbr.decorators = [
5027
5159
  { type: i0.Component, args: [{
5028
5160
  selector: 'app-techlify-update-history',
5029
5161
  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",
5030
5162
  styles: [""]
5031
5163
  },] }
5032
5164
  ];
5033
- exports.ɵbs.ctorParameters = function () { return [
5165
+ exports.ɵbr.ctorParameters = function () { return [
5034
5166
  { type: dialog.MatDialog },
5035
5167
  { type: TechlifyUpdateService },
5036
5168
  { type: forms.FormBuilder },
5037
5169
  { type: AlertService }
5038
5170
  ]; };
5039
- exports.ɵbs = __decorate([
5171
+ exports.ɵbr = __decorate([
5040
5172
  untilDestroy.UntilDestroy()
5041
- ], exports.ɵbs);
5173
+ ], exports.ɵbr);
5042
5174
 
5043
5175
  var routes$b = [
5044
5176
  { path: '', redirectTo: 'update-history', pathMatch: 'full' },
5045
- { path: 'update-history', component: exports.ɵbs },
5177
+ { path: 'update-history', component: exports.ɵbr },
5046
5178
  //fallback
5047
5179
  {
5048
5180
  path: '**',
@@ -5079,7 +5211,7 @@
5079
5211
  ReadMoreModule,
5080
5212
  TechlifyUpdateHistoryRoutingModule
5081
5213
  ],
5082
- declarations: [exports.ɵbs]
5214
+ declarations: [exports.ɵbr]
5083
5215
  },] }
5084
5216
  ];
5085
5217
 
@@ -6464,6 +6596,955 @@
6464
6596
  },] }
6465
6597
  ];
6466
6598
 
6599
+ var TechlifyTaggerTagFormConfigModel = /** @class */ (function () {
6600
+ function TechlifyTaggerTagFormConfigModel() {
6601
+ this.selectable = true;
6602
+ this.removable = true;
6603
+ this.separatorKeysCodes = [keycodes.ENTER, keycodes.COMMA];
6604
+ this.placeholder = 'New Tag..';
6605
+ this.apiUrl = 'api/techlify-tagger-tags';
6606
+ this.createApiUrl = 'api/techlify-tagger-tags';
6607
+ this.isCreateable = true;
6608
+ this.isCacheTags = false;
6609
+ this.isSingle = false;
6610
+ }
6611
+ return TechlifyTaggerTagFormConfigModel;
6612
+ }());
6613
+
6614
+ var TechlifyTaggerTagFormFieldComponent_1;
6615
+ exports.TechlifyTaggerTagFormFieldComponent = TechlifyTaggerTagFormFieldComponent_1 = /** @class */ (function () {
6616
+ function TechlifyTaggerTagFormFieldComponent(_focusMonitor, _elementRef, httpService, _formField, ngControl) {
6617
+ var _this = this;
6618
+ this._focusMonitor = _focusMonitor;
6619
+ this._elementRef = _elementRef;
6620
+ this.httpService = httpService;
6621
+ this._formField = _formField;
6622
+ this.ngControl = ngControl;
6623
+ this.stateChanges = new rxjs.Subject();
6624
+ this.focused = false;
6625
+ this.controlType = 'techlify-tagger-form-field';
6626
+ this.id = "techlify-tagger-form-field-" + TechlifyTaggerTagFormFieldComponent_1.nextId++;
6627
+ this.onChange = function (_) { };
6628
+ this.onTouched = function () { };
6629
+ this.tagInputCtrl = new forms.FormControl();
6630
+ /**Pass the configuration for Techlify Tagger */
6631
+ this.config = new TechlifyTaggerTagFormConfigModel();
6632
+ /**Pass the default list of tags */
6633
+ this._allTags = [];
6634
+ /**Pass the Categories to filter for a model */
6635
+ this.categories = [];
6636
+ this._required = false;
6637
+ this._disabled = false;
6638
+ this._value = [];
6639
+ this.tagInputCtrl.valueChanges
6640
+ .subscribe(function (filterValue) {
6641
+ _this.filterString = filterValue;
6642
+ });
6643
+ //Set Focus Monitor
6644
+ _focusMonitor.monitor(_elementRef, true).subscribe(function (origin) {
6645
+ if (_this.focused && !origin) {
6646
+ _this.onTouched();
6647
+ }
6648
+ _this.focused = !!origin;
6649
+ _this.stateChanges.next();
6650
+ });
6651
+ if (this.ngControl != null) {
6652
+ this.ngControl.valueAccessor = this;
6653
+ }
6654
+ }
6655
+ Object.defineProperty(TechlifyTaggerTagFormFieldComponent.prototype, "allTags", {
6656
+ get: function () {
6657
+ return this._allTags;
6658
+ },
6659
+ set: function (value) {
6660
+ this._allTags = value;
6661
+ },
6662
+ enumerable: false,
6663
+ configurable: true
6664
+ });
6665
+ Object.defineProperty(TechlifyTaggerTagFormFieldComponent.prototype, "tags", {
6666
+ get: function () {
6667
+ var _this = this;
6668
+ return this.allTags.filter(function (x) { return _this.value.some(function (y) { return y == x.id; }); });
6669
+ },
6670
+ enumerable: false,
6671
+ configurable: true
6672
+ });
6673
+ Object.defineProperty(TechlifyTaggerTagFormFieldComponent.prototype, "empty", {
6674
+ //Default Getter and Setters for a Form Field Implementation
6675
+ get: function () {
6676
+ return this.value.length == 0;
6677
+ },
6678
+ enumerable: false,
6679
+ configurable: true
6680
+ });
6681
+ Object.defineProperty(TechlifyTaggerTagFormFieldComponent.prototype, "shouldLabelFloat", {
6682
+ get: function () {
6683
+ return this.focused || !this.empty || this.tagInputCtrl.value;
6684
+ },
6685
+ enumerable: false,
6686
+ configurable: true
6687
+ });
6688
+ Object.defineProperty(TechlifyTaggerTagFormFieldComponent.prototype, "required", {
6689
+ get: function () {
6690
+ return this._required;
6691
+ },
6692
+ set: function (value) {
6693
+ this._required = coercion.coerceBooleanProperty(value);
6694
+ this.stateChanges.next();
6695
+ },
6696
+ enumerable: false,
6697
+ configurable: true
6698
+ });
6699
+ Object.defineProperty(TechlifyTaggerTagFormFieldComponent.prototype, "disabled", {
6700
+ get: function () {
6701
+ return this._disabled;
6702
+ },
6703
+ set: function (value) {
6704
+ this._disabled = coercion.coerceBooleanProperty(value);
6705
+ this._disabled ? this.tagInputCtrl.disable() : this.tagInputCtrl.enable();
6706
+ this.stateChanges.next();
6707
+ },
6708
+ enumerable: false,
6709
+ configurable: true
6710
+ });
6711
+ Object.defineProperty(TechlifyTaggerTagFormFieldComponent.prototype, "value", {
6712
+ get: function () {
6713
+ return this._value;
6714
+ },
6715
+ set: function (tagIds) {
6716
+ this._value = tagIds || [];
6717
+ this.stateChanges.next();
6718
+ },
6719
+ enumerable: false,
6720
+ configurable: true
6721
+ });
6722
+ Object.defineProperty(TechlifyTaggerTagFormFieldComponent.prototype, "errorState", {
6723
+ get: function () {
6724
+ return this.tagInputCtrl.dirty && this.required && (this.value.length == 0);
6725
+ },
6726
+ enumerable: false,
6727
+ configurable: true
6728
+ });
6729
+ Object.defineProperty(TechlifyTaggerTagFormFieldComponent.prototype, "placeholder", {
6730
+ get: function () {
6731
+ return this._placeholder;
6732
+ },
6733
+ set: function (value) {
6734
+ this._placeholder = value;
6735
+ this.stateChanges.next();
6736
+ },
6737
+ enumerable: false,
6738
+ configurable: true
6739
+ });
6740
+ TechlifyTaggerTagFormFieldComponent.prototype.ngOnInit = function () {
6741
+ };
6742
+ TechlifyTaggerTagFormFieldComponent.prototype.ngOnChanges = function (changes) {
6743
+ var _this = this;
6744
+ //API to load all tags for the model type
6745
+ if (this.allTags.length == 0) {
6746
+ this.httpService
6747
+ .cache(!this.config.isCacheTags)
6748
+ .get(this.config.apiUrl, {
6749
+ params: {
6750
+ categories: this.categories.join(','),
6751
+ perPage: '1000'
6752
+ }
6753
+ }).pipe(operators.debounceTime(500), untilDestroy.untilDestroyed(this)).subscribe(function (result) {
6754
+ _this.allTags = result.data;
6755
+ });
6756
+ }
6757
+ //API to load only the selected tags for the model
6758
+ if (this.modelId && this.value.length == 0) {
6759
+ //Model Id is passed and no tags are present, so we query db for the avilable tags for the model ID.
6760
+ this.httpService
6761
+ .cache(!this.config.isCacheTags)
6762
+ .get(this.config.apiUrl, {
6763
+ params: {
6764
+ categories: this.categories.join(','),
6765
+ model_type: this.modelType,
6766
+ model_id: this.modelId,
6767
+ perPage: '1000'
6768
+ }
6769
+ }).pipe(operators.debounceTime(500), untilDestroy.untilDestroyed(this)).subscribe(function (result) {
6770
+ _this.value = ((result === null || result === void 0 ? void 0 : result.data) || []).map(function (x) { return x.id; });
6771
+ _this._handleInput();
6772
+ });
6773
+ }
6774
+ };
6775
+ TechlifyTaggerTagFormFieldComponent.prototype.init = function () {
6776
+ var _this = this;
6777
+ if (this.modelId && this.allTags.length == 0) {
6778
+ //Model Id is passed and no tags are passed, so we query db for the avilable tags for the model ID.
6779
+ this.httpService
6780
+ .cache(!this.config.isCacheTags)
6781
+ .get(this.config.apiUrl, {
6782
+ params: {
6783
+ categories: this.categories.join(','),
6784
+ model_type: this.modelType,
6785
+ model_id: this.modelId
6786
+ }
6787
+ }).pipe(untilDestroy.untilDestroyed(this)).subscribe(function (result) {
6788
+ _this.allTags = result.data;
6789
+ });
6790
+ }
6791
+ };
6792
+ Object.defineProperty(TechlifyTaggerTagFormFieldComponent.prototype, "filteredTags", {
6793
+ get: function () {
6794
+ return this._filter();
6795
+ },
6796
+ enumerable: false,
6797
+ configurable: true
6798
+ });
6799
+ TechlifyTaggerTagFormFieldComponent.prototype.setDescribedByIds = function (ids) {
6800
+ // Just a empty implementation for Mat Form Field Interface
6801
+ };
6802
+ TechlifyTaggerTagFormFieldComponent.prototype.onContainerClick = function () {
6803
+ // Just a empty implementation for Mat Form Field Interface
6804
+ };
6805
+ TechlifyTaggerTagFormFieldComponent.prototype.add = function (event) {
6806
+ return __awaiter(this, void 0, void 0, function () {
6807
+ var value, tags, tag, result, error_1;
6808
+ return __generator(this, function (_a) {
6809
+ switch (_a.label) {
6810
+ case 0:
6811
+ value = (event.value || '').trim();
6812
+ if (!(!this.config.isSingle || (this.value.length === 0))) return [3 /*break*/, 7];
6813
+ if (!(value && this.config.isCreateable)) return [3 /*break*/, 7];
6814
+ tags = this.allTags;
6815
+ tag = tags.find(function (item) { return item.title.toLowerCase() == value.toLowerCase(); });
6816
+ if (!!tag) return [3 /*break*/, 5];
6817
+ _a.label = 1;
6818
+ case 1:
6819
+ _a.trys.push([1, 3, , 4]);
6820
+ return [4 /*yield*/, this.httpService.post(this.config.createApiUrl, {
6821
+ title: value,
6822
+ description: value,
6823
+ category_title: (this.categories.length > 0) ? (this.defaultCreateCategory ? this.defaultCreateCategory : this.categories[0]) : ''
6824
+ }).toPromise()];
6825
+ case 2:
6826
+ result = _a.sent();
6827
+ tag = result.item;
6828
+ return [3 /*break*/, 4];
6829
+ case 3:
6830
+ error_1 = _a.sent();
6831
+ return [2 /*return*/];
6832
+ case 4:
6833
+ this.allTags.push(tag);
6834
+ return [3 /*break*/, 6];
6835
+ case 5:
6836
+ //Optionally clean the existing value, to avoid duplicate
6837
+ this.remove(tag);
6838
+ _a.label = 6;
6839
+ case 6:
6840
+ this.value.push(tag.id);
6841
+ this._handleInput();
6842
+ _a.label = 7;
6843
+ case 7:
6844
+ // Clear the input value
6845
+ event.input.value = '';
6846
+ this.tagInputCtrl.setValue(null);
6847
+ return [2 /*return*/];
6848
+ }
6849
+ });
6850
+ });
6851
+ };
6852
+ TechlifyTaggerTagFormFieldComponent.prototype.remove = function (tag) {
6853
+ this.value = this.value.filter(function (x) { return x !== tag.id; });
6854
+ this._handleInput();
6855
+ };
6856
+ TechlifyTaggerTagFormFieldComponent.prototype.selected = function (event) {
6857
+ // Validate for single mode
6858
+ if (!this.config.isSingle || (this.value.length === 0)) {
6859
+ //Clean the existing value, to avoid duplicate
6860
+ this.remove({ id: event.option.value });
6861
+ this.value.push(event.option.value);
6862
+ this._handleInput();
6863
+ }
6864
+ this.tagInput.nativeElement.value = '';
6865
+ this.tagInputCtrl.setValue(null);
6866
+ };
6867
+ TechlifyTaggerTagFormFieldComponent.prototype._filter = function () {
6868
+ var _this = this;
6869
+ var filterValue = this.filterString ? this.filterString.toString().toLowerCase() : null;
6870
+ var availableTags = this.allTags.filter(function (tag) { return !_this.value.some(function (item) { return item == tag.id; }); });
6871
+ return filterValue ? availableTags.filter(function (tag) { return tag.title.toLowerCase().includes(filterValue); }) : availableTags;
6872
+ };
6873
+ TechlifyTaggerTagFormFieldComponent.prototype.writeValue = function (tagIds) {
6874
+ this.value = tagIds || [];
6875
+ };
6876
+ TechlifyTaggerTagFormFieldComponent.prototype.registerOnChange = function (fn) {
6877
+ this.onChange = fn;
6878
+ };
6879
+ TechlifyTaggerTagFormFieldComponent.prototype.registerOnTouched = function (fn) {
6880
+ this.onTouched = fn;
6881
+ };
6882
+ TechlifyTaggerTagFormFieldComponent.prototype.setDisabledState = function (isDisabled) {
6883
+ this.disabled = isDisabled;
6884
+ };
6885
+ TechlifyTaggerTagFormFieldComponent.prototype._handleInput = function () {
6886
+ this.onChange(this.value);
6887
+ };
6888
+ TechlifyTaggerTagFormFieldComponent.prototype.ngOnDestroy = function () {
6889
+ this.stateChanges.complete();
6890
+ this._focusMonitor.stopMonitoring(this._elementRef);
6891
+ };
6892
+ return TechlifyTaggerTagFormFieldComponent;
6893
+ }());
6894
+ exports.TechlifyTaggerTagFormFieldComponent.nextId = 0;
6895
+ exports.TechlifyTaggerTagFormFieldComponent.decorators = [
6896
+ { type: i0.Component, args: [{
6897
+ selector: 'app-techlify-tagger-tag-form-field',
6898
+ template: "<mat-chip-list #chipList aria-label=\"Tag Selection\">\n <mat-chip *ngFor=\"let tag of tags\" [selectable]=\"config.selectable\" [removable]=\"config.removable\"\n (removed)=\"remove(tag)\">\n {{tag.title}}\n <button matChipRemove *ngIf=\"config.removable\" class=\"border-0\">\n <mat-icon class=\"mat-relative-icon\">cancel</mat-icon>\n </button>\n </mat-chip>\n <input placeholder=\"{{config.isCreateable? config.placeholder:''}}\" #tagInput [formControl]=\"tagInputCtrl\"\n [matAutocomplete]=\"auto\" [matChipInputFor]=\"chipList\"\n [matChipInputSeparatorKeyCodes]=\"config.separatorKeysCodes\" (matChipInputTokenEnd)=\"add($event)\"\n #trigger=\"matAutocompleteTrigger\" (click)=\"trigger.openPanel()\">\n</mat-chip-list>\n<mat-autocomplete #auto=\"matAutocomplete\" (optionSelected)=\"selected($event)\">\n <mat-option *ngFor=\"let tag of filteredTags\" [value]=\"tag.id\">\n {{tag.title}}\n </mat-option>\n</mat-autocomplete>",
6899
+ providers: [{ provide: formField.MatFormFieldControl, useExisting: TechlifyTaggerTagFormFieldComponent_1 }],
6900
+ styles: [".mat-relative-icon{font-size:20px;position:relative;right:7px;top:-3px}"]
6901
+ },] }
6902
+ ];
6903
+ exports.TechlifyTaggerTagFormFieldComponent.ctorParameters = function () { return [
6904
+ { type: a11y.FocusMonitor },
6905
+ { type: i0.ElementRef },
6906
+ { type: HttpService },
6907
+ { type: formField.MatFormField, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [formField.MAT_FORM_FIELD,] }] },
6908
+ { type: forms.NgControl, decorators: [{ type: i0.Optional }, { type: i0.Self }] }
6909
+ ]; };
6910
+ exports.TechlifyTaggerTagFormFieldComponent.propDecorators = {
6911
+ tagInput: [{ type: i0.ViewChild, args: ['tagInput',] }],
6912
+ config: [{ type: i0.Input }],
6913
+ modelType: [{ type: i0.Input }],
6914
+ modelId: [{ type: i0.Input }],
6915
+ allTags: [{ type: i0.Input }],
6916
+ categories: [{ type: i0.Input }],
6917
+ defaultCreateCategory: [{ type: i0.Input }],
6918
+ required: [{ type: i0.Input }],
6919
+ disabled: [{ type: i0.Input }],
6920
+ value: [{ type: i0.Input }],
6921
+ placeholder: [{ type: i0.Input }]
6922
+ };
6923
+ exports.TechlifyTaggerTagFormFieldComponent = TechlifyTaggerTagFormFieldComponent_1 = __decorate([
6924
+ untilDestroy.UntilDestroy()
6925
+ ], exports.TechlifyTaggerTagFormFieldComponent);
6926
+
6927
+ var TechlifyTaggerTagFormFieldModule = /** @class */ (function () {
6928
+ function TechlifyTaggerTagFormFieldModule() {
6929
+ }
6930
+ return TechlifyTaggerTagFormFieldModule;
6931
+ }());
6932
+ TechlifyTaggerTagFormFieldModule.decorators = [
6933
+ { type: i0.NgModule, args: [{
6934
+ declarations: [
6935
+ exports.TechlifyTaggerTagFormFieldComponent
6936
+ ],
6937
+ imports: [
6938
+ common.CommonModule,
6939
+ MaterialModule,
6940
+ flexLayout.FlexLayoutModule,
6941
+ autocomplete.MatAutocompleteModule,
6942
+ forms.ReactiveFormsModule
6943
+ ],
6944
+ exports: [exports.TechlifyTaggerTagFormFieldComponent]
6945
+ },] }
6946
+ ];
6947
+
6948
+ var TechlifyTaggerTagSelectorComponent_1;
6949
+ exports.TechlifyTaggerTagSelectorComponent = TechlifyTaggerTagSelectorComponent_1 = /** @class */ (function () {
6950
+ function TechlifyTaggerTagSelectorComponent(_focusMonitor, _elementRef, httpService, _formField, ngControl) {
6951
+ var _this = this;
6952
+ this._focusMonitor = _focusMonitor;
6953
+ this._elementRef = _elementRef;
6954
+ this.httpService = httpService;
6955
+ this._formField = _formField;
6956
+ this.ngControl = ngControl;
6957
+ /**Pass the Categories to filter for a model */
6958
+ this.categories = [];
6959
+ this.multiple = false;
6960
+ this.enableSearch = true;
6961
+ this.tagSelectorCtrl = new forms.FormControl();
6962
+ this.showAllTags = false;
6963
+ this.useSelectButtonStyle = false;
6964
+ this.tags = [];
6965
+ this.stateChanges = new rxjs.Subject();
6966
+ this.focused = false;
6967
+ this.controlType = 'techlify-tagger-selector';
6968
+ this.id = "techlify-tagger-selector-" + TechlifyTaggerTagSelectorComponent_1.nextId++;
6969
+ this.onChange = function (_) { };
6970
+ this.onTouched = function () { };
6971
+ this._required = false;
6972
+ this._disabled = false;
6973
+ //Set Focus Monitor
6974
+ _focusMonitor.monitor(_elementRef, true).subscribe(function (origin) {
6975
+ if (_this.focused && !origin) {
6976
+ _this.onTouched();
6977
+ }
6978
+ _this.focused = !!origin;
6979
+ _this.stateChanges.next();
6980
+ });
6981
+ if (this.ngControl != null) {
6982
+ this.ngControl.valueAccessor = this;
6983
+ }
6984
+ }
6985
+ Object.defineProperty(TechlifyTaggerTagSelectorComponent.prototype, "apiUrl", {
6986
+ get: function () {
6987
+ var _a;
6988
+ if (this.showAllTags) {
6989
+ return 'api/techlify-tagger-tags';
6990
+ }
6991
+ else if (((_a = this.categories) === null || _a === void 0 ? void 0 : _a.length) > 0) {
6992
+ return 'api/techlify-tagger-tags?categories=' + this.categories.join(',');
6993
+ }
6994
+ else {
6995
+ return '';
6996
+ }
6997
+ },
6998
+ enumerable: false,
6999
+ configurable: true
7000
+ });
7001
+ Object.defineProperty(TechlifyTaggerTagSelectorComponent.prototype, "empty", {
7002
+ //Default Getter and Setters for a Form Field Implementation
7003
+ get: function () {
7004
+ return this.value.length == 0;
7005
+ },
7006
+ enumerable: false,
7007
+ configurable: true
7008
+ });
7009
+ Object.defineProperty(TechlifyTaggerTagSelectorComponent.prototype, "shouldLabelFloat", {
7010
+ get: function () {
7011
+ return this.focused || !this.empty;
7012
+ },
7013
+ enumerable: false,
7014
+ configurable: true
7015
+ });
7016
+ Object.defineProperty(TechlifyTaggerTagSelectorComponent.prototype, "required", {
7017
+ get: function () {
7018
+ return this._required;
7019
+ },
7020
+ set: function (value) {
7021
+ this._required = coercion.coerceBooleanProperty(value);
7022
+ this.stateChanges.next();
7023
+ },
7024
+ enumerable: false,
7025
+ configurable: true
7026
+ });
7027
+ Object.defineProperty(TechlifyTaggerTagSelectorComponent.prototype, "disabled", {
7028
+ get: function () {
7029
+ return this._disabled;
7030
+ },
7031
+ set: function (value) {
7032
+ this._disabled = coercion.coerceBooleanProperty(value);
7033
+ this._disabled ? this.tagSelectorCtrl.disable() : this.tagSelectorCtrl.enable();
7034
+ this.stateChanges.next();
7035
+ },
7036
+ enumerable: false,
7037
+ configurable: true
7038
+ });
7039
+ Object.defineProperty(TechlifyTaggerTagSelectorComponent.prototype, "value", {
7040
+ get: function () {
7041
+ return this._value;
7042
+ },
7043
+ set: function (val) {
7044
+ this._value = val;
7045
+ this.tagSelectorCtrl.setValue(val);
7046
+ this.stateChanges.next();
7047
+ },
7048
+ enumerable: false,
7049
+ configurable: true
7050
+ });
7051
+ Object.defineProperty(TechlifyTaggerTagSelectorComponent.prototype, "errorState", {
7052
+ get: function () {
7053
+ return this.tagSelectorCtrl.dirty && this.required && (this.value.length == 0);
7054
+ },
7055
+ enumerable: false,
7056
+ configurable: true
7057
+ });
7058
+ Object.defineProperty(TechlifyTaggerTagSelectorComponent.prototype, "placeholder", {
7059
+ get: function () {
7060
+ return this._placeholder;
7061
+ },
7062
+ set: function (value) {
7063
+ this._placeholder = value;
7064
+ this.stateChanges.next();
7065
+ },
7066
+ enumerable: false,
7067
+ configurable: true
7068
+ });
7069
+ TechlifyTaggerTagSelectorComponent.prototype.ngOnInit = function () {
7070
+ var _this = this;
7071
+ if (this.useSelectButtonStyle) {
7072
+ this.httpService.get(this.apiUrl)
7073
+ .pipe(untilDestroy.untilDestroyed(this))
7074
+ .subscribe(function (res) {
7075
+ _this.tags = res.data;
7076
+ });
7077
+ }
7078
+ };
7079
+ TechlifyTaggerTagSelectorComponent.prototype.selectionChange = function (value) {
7080
+ this.value = value;
7081
+ this._handleInput();
7082
+ };
7083
+ TechlifyTaggerTagSelectorComponent.prototype.setDescribedByIds = function (ids) {
7084
+ // Just a empty implementation for Mat Form Field Interface
7085
+ };
7086
+ TechlifyTaggerTagSelectorComponent.prototype.onContainerClick = function () {
7087
+ // Just a empty implementation for Mat Form Field Interface
7088
+ };
7089
+ TechlifyTaggerTagSelectorComponent.prototype.writeValue = function (val) {
7090
+ this.value = val;
7091
+ };
7092
+ TechlifyTaggerTagSelectorComponent.prototype.registerOnChange = function (fn) {
7093
+ this.onChange = fn;
7094
+ };
7095
+ TechlifyTaggerTagSelectorComponent.prototype.registerOnTouched = function (fn) {
7096
+ this.onTouched = fn;
7097
+ };
7098
+ TechlifyTaggerTagSelectorComponent.prototype.setDisabledState = function (isDisabled) {
7099
+ this.disabled = isDisabled;
7100
+ };
7101
+ TechlifyTaggerTagSelectorComponent.prototype._handleInput = function () {
7102
+ this.onChange(this.value);
7103
+ };
7104
+ TechlifyTaggerTagSelectorComponent.prototype.ngOnDestroy = function () {
7105
+ this.stateChanges.complete();
7106
+ this._focusMonitor.stopMonitoring(this._elementRef);
7107
+ };
7108
+ return TechlifyTaggerTagSelectorComponent;
7109
+ }());
7110
+ exports.TechlifyTaggerTagSelectorComponent.nextId = 0;
7111
+ exports.TechlifyTaggerTagSelectorComponent.decorators = [
7112
+ { type: i0.Component, args: [{
7113
+ selector: 'app-techlify-tagger-tag-selector',
7114
+ template: "<app-searchable-selector *ngIf=\"apiUrl && !useSelectButtonStyle\" [formControl]=\"tagSelectorCtrl\" [apiUrl]=\"apiUrl\"\n [enableSearch]=\"enableSearch\" [multiple]=\"multiple\" (selectionChange)=\"selectionChange($event)\">\n</app-searchable-selector>\n\n<mat-button-toggle-group *ngIf=\"apiUrl && useSelectButtonStyle\" [formControl]=\"tagSelectorCtrl\" [multiple]=\"multiple\"\n (change)=\"selectionChange($event.value)\">\n <mat-button-toggle *ngFor=\"let tag of tags\" [value]=\"tag.id\">{{tag.title}}</mat-button-toggle>\n</mat-button-toggle-group>",
7115
+ providers: [{ provide: formField.MatFormFieldControl, useExisting: TechlifyTaggerTagSelectorComponent_1 }],
7116
+ styles: [""]
7117
+ },] }
7118
+ ];
7119
+ exports.TechlifyTaggerTagSelectorComponent.ctorParameters = function () { return [
7120
+ { type: a11y.FocusMonitor },
7121
+ { type: i0.ElementRef },
7122
+ { type: HttpService },
7123
+ { type: formField.MatFormField, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [formField.MAT_FORM_FIELD,] }] },
7124
+ { type: forms.NgControl, decorators: [{ type: i0.Optional }, { type: i0.Self }] }
7125
+ ]; };
7126
+ exports.TechlifyTaggerTagSelectorComponent.propDecorators = {
7127
+ categories: [{ type: i0.Input }],
7128
+ multiple: [{ type: i0.Input }],
7129
+ enableSearch: [{ type: i0.Input }],
7130
+ showAllTags: [{ type: i0.Input }],
7131
+ useSelectButtonStyle: [{ type: i0.Input }],
7132
+ required: [{ type: i0.Input }],
7133
+ disabled: [{ type: i0.Input }],
7134
+ value: [{ type: i0.Input }],
7135
+ placeholder: [{ type: i0.Input }]
7136
+ };
7137
+ exports.TechlifyTaggerTagSelectorComponent = TechlifyTaggerTagSelectorComponent_1 = __decorate([
7138
+ untilDestroy.UntilDestroy()
7139
+ ], exports.TechlifyTaggerTagSelectorComponent);
7140
+
7141
+ var TechlifyTaggerTagSelectorModule = /** @class */ (function () {
7142
+ function TechlifyTaggerTagSelectorModule() {
7143
+ }
7144
+ return TechlifyTaggerTagSelectorModule;
7145
+ }());
7146
+ TechlifyTaggerTagSelectorModule.decorators = [
7147
+ { type: i0.NgModule, args: [{
7148
+ declarations: [
7149
+ exports.TechlifyTaggerTagSelectorComponent
7150
+ ],
7151
+ imports: [
7152
+ common.CommonModule,
7153
+ MaterialModule,
7154
+ flexLayout.FlexLayoutModule,
7155
+ autocomplete.MatAutocompleteModule,
7156
+ forms.ReactiveFormsModule,
7157
+ SearchableSelectorModule,
7158
+ buttonToggle.MatButtonToggleModule
7159
+ ],
7160
+ exports: [exports.TechlifyTaggerTagSelectorComponent]
7161
+ },] }
7162
+ ];
7163
+
7164
+ var CompanyFeatureService = /** @class */ (function () {
7165
+ function CompanyFeatureService(dataManager) {
7166
+ this.dataManager = dataManager;
7167
+ }
7168
+ CompanyFeatureService.prototype.getFeatures = function () {
7169
+ return this.dataManager.GET("api/features");
7170
+ };
7171
+ CompanyFeatureService.prototype.disableFeature = function (id) {
7172
+ return this.dataManager.GET("api/feature/" + id + "/disable");
7173
+ };
7174
+ CompanyFeatureService.prototype.enableFeature = function (id) {
7175
+ return this.dataManager.GET("api/feature/" + id + "/enable");
7176
+ };
7177
+ return CompanyFeatureService;
7178
+ }());
7179
+ CompanyFeatureService.ɵprov = i0.ɵɵdefineInjectable({ factory: function CompanyFeatureService_Factory() { return new CompanyFeatureService(i0.ɵɵinject(DataManager)); }, token: CompanyFeatureService, providedIn: "root" });
7180
+ CompanyFeatureService.decorators = [
7181
+ { type: i0.Injectable, args: [{
7182
+ providedIn: 'root'
7183
+ },] }
7184
+ ];
7185
+ CompanyFeatureService.ctorParameters = function () { return [
7186
+ { type: DataManager }
7187
+ ]; };
7188
+
7189
+ exports.CompanyFeatureComponent = /** @class */ (function () {
7190
+ function CompanyFeatureComponent(dataManager, errorHandler, fb, alertService, dialog, storage, featureService) {
7191
+ this.dataManager = dataManager;
7192
+ this.errorHandler = errorHandler;
7193
+ this.fb = fb;
7194
+ this.alertService = alertService;
7195
+ this.dialog = dialog;
7196
+ this.storage = storage;
7197
+ this.featureService = featureService;
7198
+ this.features = [];
7199
+ this.displayedColumns = [
7200
+ 'index',
7201
+ 'feature',
7202
+ 'description',
7203
+ 'actions',
7204
+ ];
7205
+ this.dataSource = new table.MatTableDataSource();
7206
+ this.page = 1;
7207
+ this.perPage = 25;
7208
+ this.isWorking = false;
7209
+ this.filterFormGroup = this.fb.group({
7210
+ num_items: [""]
7211
+ });
7212
+ }
7213
+ CompanyFeatureComponent.prototype.ngOnInit = function () {
7214
+ this.loadData();
7215
+ this.listenForChanges();
7216
+ };
7217
+ CompanyFeatureComponent.prototype.listenForChanges = function () {
7218
+ var _this = this;
7219
+ this.filterFormGroup.valueChanges
7220
+ .pipe(operators.debounceTime(500), untilDestroy.untilDestroyed(this))
7221
+ .subscribe(function (changes) {
7222
+ _this.reload();
7223
+ });
7224
+ };
7225
+ CompanyFeatureComponent.prototype.loadData = function () {
7226
+ return __awaiter(this, void 0, void 0, function () {
7227
+ var result, filter, error_1;
7228
+ return __generator(this, function (_a) {
7229
+ switch (_a.label) {
7230
+ case 0:
7231
+ _a.trys.push([0, 2, 3, 4]);
7232
+ this.isWorking = true;
7233
+ filter = this.filterFormGroup.value;
7234
+ filter.page = this.page;
7235
+ filter.perPage = this.perPage;
7236
+ return [4 /*yield*/, this.dataManager.GET("api/features", filter)];
7237
+ case 1:
7238
+ result = _a.sent();
7239
+ this.features = this.features.concat(result.data);
7240
+ this.dataSource = new table.MatTableDataSource(this.features);
7241
+ if (!this.storage.getItem('features')) {
7242
+ this.setStorage(this.features);
7243
+ }
7244
+ this.isWorking = false;
7245
+ return [3 /*break*/, 4];
7246
+ case 2:
7247
+ error_1 = _a.sent();
7248
+ this.errorHandler.handleError(error_1);
7249
+ return [3 /*break*/, 4];
7250
+ case 3:
7251
+ this.isWorking = false;
7252
+ return [7 /*endfinally*/];
7253
+ case 4: return [2 /*return*/];
7254
+ }
7255
+ });
7256
+ });
7257
+ };
7258
+ CompanyFeatureComponent.prototype.toggeleFeature = function (element, feature) {
7259
+ return __awaiter(this, void 0, void 0, function () {
7260
+ var status, data, dialogRef;
7261
+ var _this = this;
7262
+ return __generator(this, function (_a) {
7263
+ status = element ? 'Off' : "On";
7264
+ dialogRef = this.dialog.open(ActionPopupComponent, {
7265
+ width: "400px",
7266
+ data: {
7267
+ title: "Turn this feature " + status + "?",
7268
+ message: "Would you like to turn " + feature.title + " feature " + status
7269
+ }
7270
+ });
7271
+ dialogRef.afterClosed().subscribe(function (result) { return __awaiter(_this, void 0, void 0, function () {
7272
+ var _a, error_2;
7273
+ return __generator(this, function (_b) {
7274
+ switch (_b.label) {
7275
+ case 0:
7276
+ if (!result) return [3 /*break*/, 9];
7277
+ _b.label = 1;
7278
+ case 1:
7279
+ _b.trys.push([1, 6, 7, 8]);
7280
+ if (!element) return [3 /*break*/, 3];
7281
+ return [4 /*yield*/, this.featureService.disableFeature(feature.id)];
7282
+ case 2:
7283
+ _a = _b.sent();
7284
+ return [3 /*break*/, 5];
7285
+ case 3: return [4 /*yield*/, this.featureService.enableFeature(feature.id)];
7286
+ case 4:
7287
+ _a = _b.sent();
7288
+ _b.label = 5;
7289
+ case 5:
7290
+ data = _a;
7291
+ return [3 /*break*/, 8];
7292
+ case 6:
7293
+ error_2 = _b.sent();
7294
+ this.errorHandler.handleError(error_2);
7295
+ return [3 /*break*/, 8];
7296
+ case 7:
7297
+ this.alertService.addAlert("You have just turned " + status + " the feature " + feature.title, 'success');
7298
+ this.reload();
7299
+ this.storage.removeItem('features');
7300
+ this.setStorage(this.features);
7301
+ this.isWorking = false;
7302
+ return [7 /*endfinally*/];
7303
+ case 8: return [3 /*break*/, 10];
7304
+ case 9:
7305
+ this.reload();
7306
+ _b.label = 10;
7307
+ case 10: return [2 /*return*/];
7308
+ }
7309
+ });
7310
+ }); });
7311
+ return [2 /*return*/];
7312
+ });
7313
+ });
7314
+ };
7315
+ CompanyFeatureComponent.prototype.setStorage = function (features) {
7316
+ var e_1, _a;
7317
+ var localFeatures = [];
7318
+ try {
7319
+ for (var features_1 = __values(features), features_1_1 = features_1.next(); !features_1_1.done; features_1_1 = features_1.next()) {
7320
+ var feature = features_1_1.value;
7321
+ if (!feature.client_feature) {
7322
+ if (feature.is_enabled_default) {
7323
+ localFeatures.push(feature.code);
7324
+ }
7325
+ }
7326
+ else {
7327
+ if (feature.client_feature.is_enabled) {
7328
+ localFeatures.push(feature.code);
7329
+ }
7330
+ }
7331
+ }
7332
+ }
7333
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
7334
+ finally {
7335
+ try {
7336
+ if (features_1_1 && !features_1_1.done && (_a = features_1.return)) _a.call(features_1);
7337
+ }
7338
+ finally { if (e_1) throw e_1.error; }
7339
+ }
7340
+ this.storage.setItem("features", localFeatures);
7341
+ };
7342
+ CompanyFeatureComponent.prototype.reload = function () {
7343
+ this.features = [];
7344
+ this.page = 1;
7345
+ if (!this.isWorking) {
7346
+ this.loadData();
7347
+ }
7348
+ };
7349
+ CompanyFeatureComponent.prototype.onScroll = function () {
7350
+ if (!this.isWorking && this.page < this.lastPage) {
7351
+ this.page += 1;
7352
+ this.loadData();
7353
+ }
7354
+ };
7355
+ CompanyFeatureComponent.prototype.sortColumn = function (event) {
7356
+ var direction = event.direction.toString().toUpperCase();
7357
+ this.assignFilter(event.active, direction);
7358
+ this.reload();
7359
+ };
7360
+ CompanyFeatureComponent.prototype.assignFilter = function (column, direction) {
7361
+ switch (column) {
7362
+ case 'name': {
7363
+ return this.filterFormGroup
7364
+ .get('sort_by')
7365
+ .setValue('first_name|' + direction);
7366
+ }
7367
+ case 'added_on': {
7368
+ return this.filterFormGroup
7369
+ .get('sort_by')
7370
+ .setValue('created_at|' + direction);
7371
+ }
7372
+ }
7373
+ };
7374
+ return CompanyFeatureComponent;
7375
+ }());
7376
+ exports.CompanyFeatureComponent.decorators = [
7377
+ { type: i0.Component, args: [{
7378
+ selector: 'app-company-feature',
7379
+ template: "<div fxLayout=\"column\" fxLayoutGap=\"3rem\" class=\"p-3\">\n <div fxLayout=\"column\" fxLayoutAlign=\"center center\" class=\"primary-color mt-3\">\n <h3>Features Configuration</h3>\n <mat-hint>\n <i> Here you can specify which optional features you'd like to have available to your team </i>\n </mat-hint>\n </div>\n\n\n <div>\n <mat-card>\n <mat-card-content fxlayout=\"column\" style=\"overflow: auto; height: 700px\" class=\"classifications-card\">\n <table mat-table [dataSource]=\"dataSource\" class=\"mat-elevation-z8 w-100\" matSort multiTemplateDataRows\n (matSortChange)=\"sortColumn($event)\" infiniteScroll [infiniteScrollDistance]=\"2\" [infiniteScrollThrottle]=\"50\"\n (scrolled)=\"onScroll()\" [fromRoot]=\"true\" [infiniteScrollContainer]=\"'.classifications-card'\">\n <!-- Index Column -->\n <ng-container matColumnDef=\"index\">\n <th mat-header-cell *matHeaderCellDef>#</th>\n <td mat-cell *matCellDef=\"let element; let i = dataIndex\">\n {{ i + 1 }}\n </td>\n </ng-container>\n\n <!-- Title Column -->\n <ng-container matColumnDef=\"feature\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header disableClear>\n Feature\n </th>\n <td mat-cell *matCellDef=\"let element\">{{ element?.title }}</td>\n </ng-container>\n\n <!-- Description Column -->\n <ng-container matColumnDef=\"description\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header disableClear>\n Descriptions\n </th>\n <td mat-cell *matCellDef=\"let element\">\n {{ element?.description }}\n </td>\n </ng-container>\n\n <!-- Actions Column -->\n <ng-container matColumnDef=\"actions\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header disableClear>\n Actions\n </th>\n <td mat-cell *matCellDef=\"let element\">\n <div *ngIf=\"!element?.client_feature\">\n <app-on-off-switch [value]=\"element?.is_enabled_default\"\n (click)=\"toggeleFeature(element?.is_enabled_default, element)\"></app-on-off-switch>\n </div>\n <div *ngIf=\"element?.client_feature\">\n <app-on-off-switch [value]=\"element?.client_feature?.is_enabled\"\n (click)=\"toggeleFeature(element?.client_feature?.is_enabled, element)\"></app-on-off-switch>\n </div>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns\"></tr>\n </table>\n </mat-card-content>\n </mat-card>\n </div>\n</div>\n",
7380
+ styles: [""]
7381
+ },] }
7382
+ ];
7383
+ exports.CompanyFeatureComponent.ctorParameters = function () { return [
7384
+ { type: DataManager },
7385
+ { type: ErrorHandlerService },
7386
+ { type: forms.FormBuilder },
7387
+ { type: AlertService },
7388
+ { type: dialog.MatDialog },
7389
+ { type: StorageService },
7390
+ { type: CompanyFeatureService }
7391
+ ]; };
7392
+ exports.CompanyFeatureComponent = __decorate([
7393
+ untilDestroy.UntilDestroy()
7394
+ ], exports.CompanyFeatureComponent);
7395
+
7396
+ var routes$n = [
7397
+ {
7398
+ path: '',
7399
+ component: exports.CompanyFeatureComponent,
7400
+ canActivate: [AuthenticationGuard]
7401
+ },
7402
+ ];
7403
+ var CompanyFeatureRoutes = i1$2.RouterModule.forChild(routes$n);
7404
+
7405
+ var OnOffSwitchComponent = /** @class */ (function () {
7406
+ function OnOffSwitchComponent(fb) {
7407
+ this.fb = fb;
7408
+ this.slideToggle = this.fb.group({
7409
+ toggle: [""]
7410
+ });
7411
+ }
7412
+ OnOffSwitchComponent.prototype.ngOnInit = function () {
7413
+ this.slideToggle.get('toggle').setValue(this.value);
7414
+ };
7415
+ return OnOffSwitchComponent;
7416
+ }());
7417
+ OnOffSwitchComponent.decorators = [
7418
+ { type: i0.Component, args: [{
7419
+ selector: 'app-on-off-switch',
7420
+ template: "<form [formGroup]=\"slideToggle\">\n <mat-slide-toggle formControlName=\"toggle\">On / Off\n </mat-slide-toggle>\n</form>\n",
7421
+ styles: [""]
7422
+ },] }
7423
+ ];
7424
+ OnOffSwitchComponent.ctorParameters = function () { return [
7425
+ { type: forms.FormBuilder }
7426
+ ]; };
7427
+ OnOffSwitchComponent.propDecorators = {
7428
+ value: [{ type: i0.Input }]
7429
+ };
7430
+
7431
+ var NgxFeatureEnabledDirective = /** @class */ (function () {
7432
+ function NgxFeatureEnabledDirective(el, featureService, errorHandler, storage) {
7433
+ this.el = el;
7434
+ this.featureService = featureService;
7435
+ this.errorHandler = errorHandler;
7436
+ this.storage = storage;
7437
+ this.localFeatures = [];
7438
+ }
7439
+ NgxFeatureEnabledDirective.prototype.ngOnInit = function () {
7440
+ if (!this.storage.getItem('features')) {
7441
+ this.getFeatures();
7442
+ }
7443
+ else {
7444
+ this.checkForFeatureEnabled();
7445
+ }
7446
+ };
7447
+ NgxFeatureEnabledDirective.prototype.getFeatures = function () {
7448
+ return __awaiter(this, void 0, void 0, function () {
7449
+ var features, _a, _b, feature, error_1;
7450
+ var e_1, _c;
7451
+ return __generator(this, function (_d) {
7452
+ switch (_d.label) {
7453
+ case 0:
7454
+ _d.trys.push([0, 2, 3, 4]);
7455
+ return [4 /*yield*/, this.featureService.getFeatures()];
7456
+ case 1:
7457
+ features = _d.sent();
7458
+ try {
7459
+ for (_a = __values(features.data), _b = _a.next(); !_b.done; _b = _a.next()) {
7460
+ feature = _b.value;
7461
+ if (!feature.client_feature) {
7462
+ if (feature.is_enabled_default) {
7463
+ this.localFeatures.push(feature.code);
7464
+ }
7465
+ }
7466
+ else {
7467
+ if (feature.client_feature.is_enabled) {
7468
+ this.localFeatures.push(feature.code);
7469
+ }
7470
+ }
7471
+ }
7472
+ }
7473
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
7474
+ finally {
7475
+ try {
7476
+ if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
7477
+ }
7478
+ finally { if (e_1) throw e_1.error; }
7479
+ }
7480
+ this.storage.setItem("features", this.localFeatures);
7481
+ return [3 /*break*/, 4];
7482
+ case 2:
7483
+ error_1 = _d.sent();
7484
+ this.errorHandler.handleError(error_1);
7485
+ return [3 /*break*/, 4];
7486
+ case 3:
7487
+ this.checkForFeatureEnabled();
7488
+ return [7 /*endfinally*/];
7489
+ case 4: return [2 /*return*/];
7490
+ }
7491
+ });
7492
+ });
7493
+ };
7494
+ NgxFeatureEnabledDirective.prototype.checkForFeatureEnabled = function () {
7495
+ try {
7496
+ var features = this.storage.getItem('features');
7497
+ var features_split = features.split(',');
7498
+ if (features_split.includes(this.enabledFeature)) {
7499
+ this.el.nativeElement.style.display = "show";
7500
+ }
7501
+ else {
7502
+ this.el.nativeElement.remove();
7503
+ }
7504
+ }
7505
+ catch (error) {
7506
+ this.errorHandler.handleError(error);
7507
+ }
7508
+ };
7509
+ return NgxFeatureEnabledDirective;
7510
+ }());
7511
+ NgxFeatureEnabledDirective.decorators = [
7512
+ { type: i0.Directive, args: [{
7513
+ selector: '[ngxFeatureEnabled]'
7514
+ },] }
7515
+ ];
7516
+ NgxFeatureEnabledDirective.ctorParameters = function () { return [
7517
+ { type: i0.ElementRef },
7518
+ { type: CompanyFeatureService },
7519
+ { type: ErrorHandlerService },
7520
+ { type: StorageService }
7521
+ ]; };
7522
+ NgxFeatureEnabledDirective.propDecorators = {
7523
+ enabledFeature: [{ type: i0.Input, args: ['ngxFeatureEnabled',] }]
7524
+ };
7525
+
7526
+ var CompanyFeatureModule = /** @class */ (function () {
7527
+ function CompanyFeatureModule() {
7528
+ }
7529
+ return CompanyFeatureModule;
7530
+ }());
7531
+ CompanyFeatureModule.decorators = [
7532
+ { type: i0.NgModule, args: [{
7533
+ imports: [
7534
+ common.CommonModule,
7535
+ MaterialModule,
7536
+ flexLayout.FlexLayoutModule,
7537
+ CompanyFeatureRoutes,
7538
+ slideToggle.MatSlideToggleModule,
7539
+ forms.FormsModule,
7540
+ forms.ReactiveFormsModule,
7541
+ ngxInfiniteScroll.InfiniteScrollModule
7542
+ ],
7543
+ declarations: [exports.CompanyFeatureComponent, OnOffSwitchComponent, NgxFeatureEnabledDirective],
7544
+ exports: [exports.CompanyFeatureComponent, NgxFeatureEnabledDirective]
7545
+ },] }
7546
+ ];
7547
+
6467
7548
  /*
6468
7549
  * Public API Surface of ngx-techlify-core
6469
7550
  */
@@ -6496,6 +7577,9 @@
6496
7577
  exports.AuthenticationGuard = AuthenticationGuard;
6497
7578
  exports.AuthenticationService = AuthenticationService;
6498
7579
  exports.CacheInterceptor = CacheInterceptor;
7580
+ exports.CommentFormComponent = CommentFormComponent;
7581
+ exports.CompanyFeatureModule = CompanyFeatureModule;
7582
+ exports.CompanyFeatureRoutes = CompanyFeatureRoutes;
6499
7583
  exports.ConfigService = ConfigService;
6500
7584
  exports.CoreModule = CoreModule;
6501
7585
  exports.CredentialsService = CredentialsService;
@@ -6507,24 +7591,24 @@
6507
7591
  exports.DateValidator = DateValidator;
6508
7592
  exports.DocumentViewerComponent = DocumentViewerComponent;
6509
7593
  exports.DocumentViewerModule = DocumentViewerModule;
6510
- exports.EmailSubscriptionForUserComponent = exports.ɵbj;
7594
+ exports.EmailSubscriptionForUserComponent = exports.ɵbk;
6511
7595
  exports.EmailSubscriptionForUserModule = EmailSubscriptionForUserModule;
6512
7596
  exports.EmailSubscriptionForUserRoutingModule = EmailSubscriptionForUserRoutingModule;
6513
7597
  exports.EmailSubscriptionModule = EmailSubscriptionModule;
6514
7598
  exports.EmailSubscriptionRoutingModule = EmailSubscriptionRoutingModule;
6515
- exports.EmailSubscriptionTypeFormComponent = exports.ɵbh;
7599
+ exports.EmailSubscriptionTypeFormComponent = exports.ɵbi;
6516
7600
  exports.EmailSubscriptionTypeFormModule = EmailSubscriptionTypeFormModule;
6517
7601
  exports.EmailSubscriptionTypeFormRoutingModule = EmailSubscriptionTypeFormRoutingModule;
6518
- exports.EmailSubscriptionTypeListComponent = exports.ɵbi;
7602
+ exports.EmailSubscriptionTypeListComponent = exports.ɵbj;
6519
7603
  exports.EmailSubscriptionTypeListModule = EmailSubscriptionTypeListModule;
6520
7604
  exports.EmailSubscriptionTypeListRoutingModule = EmailSubscriptionTypeListRoutingModule;
6521
7605
  exports.EmailSubscriptionTypeModule = EmailSubscriptionTypeModule;
6522
7606
  exports.EmailSubscriptionTypeRoutingModule = EmailSubscriptionTypeRoutingModule;
6523
- exports.EmailSubscriptionUserFormComponent = exports.ɵba;
7607
+ exports.EmailSubscriptionUserFormComponent = exports.ɵbe;
6524
7608
  exports.EmailSubscriptionUserFormModule = EmailSubscriptionUserFormModule;
6525
7609
  exports.EmailSubscriptionUserFormRoutingModule = EmailSubscriptionUserFormRoutingModule;
6526
- exports.EmailSubscriptionUserListComponent = exports.ɵbb;
6527
- exports.EmailSubscriptionUserListFilterComponent = exports.ɵbg;
7610
+ exports.EmailSubscriptionUserListComponent = exports.ɵbf;
7611
+ exports.EmailSubscriptionUserListFilterComponent = exports.ɵbh;
6528
7612
  exports.EmailSubscriptionUserListFilterModule = EmailSubscriptionUserListFilterModule;
6529
7613
  exports.EmailSubscriptionUserListFilterRoutingModule = EmailSubscriptionUserListFilterRoutingModule;
6530
7614
  exports.EmailSubscriptionUserListModule = EmailSubscriptionUserListModule;
@@ -6562,23 +7646,30 @@
6562
7646
  exports.LoginHistoryForUserRoutingModule = LoginHistoryForUserRoutingModule;
6563
7647
  exports.MatSelectInfiniteScrollDirective = MatSelectInfiniteScrollDirective;
6564
7648
  exports.MaterialModule = MaterialModule;
7649
+ exports.NgxFeatureEnabledDirective = NgxFeatureEnabledDirective;
6565
7650
  exports.NoteFormComponent = NoteFormComponent;
6566
7651
  exports.NoteListComponent = NoteListComponent;
6567
7652
  exports.NoteModule = NoteModule;
6568
7653
  exports.NumItemsSelector = NumItemsSelector;
6569
7654
  exports.NumberSelector = NumberSelector;
7655
+ exports.OnOffSwitchComponent = OnOffSwitchComponent;
6570
7656
  exports.PageEvent = PageEvent;
7657
+ exports.ReadMoreComponent = ReadMoreComponent;
7658
+ exports.ReadMoreModule = ReadMoreModule;
6571
7659
  exports.RouteReusableStrategy = RouteReusableStrategy;
6572
- exports.SearchableSelectorComponent = exports.ɵt;
7660
+ exports.SearchableSelectorComponent = exports.ɵx;
6573
7661
  exports.SearchableSelectorModule = SearchableSelectorModule;
6574
7662
  exports.SnackModule = SnackModule;
6575
7663
  exports.StorageService = StorageService;
6576
7664
  exports.SuccessSnackComponent = SuccessSnackComponent;
6577
7665
  exports.TechlifyConfig = TechlifyConfig;
7666
+ exports.TechlifyTaggerTagFormConfigModel = TechlifyTaggerTagFormConfigModel;
7667
+ exports.TechlifyTaggerTagFormFieldModule = TechlifyTaggerTagFormFieldModule;
7668
+ exports.TechlifyTaggerTagSelectorModule = TechlifyTaggerTagSelectorModule;
6578
7669
  exports.TechlifyUpdateHistoryModule = TechlifyUpdateHistoryModule;
6579
7670
  exports.TechlifyUpdateModule = TechlifyUpdateModule;
6580
7671
  exports.Timeline = Timeline;
6581
- exports.TimelineFilterComponent = exports.ɵx;
7672
+ exports.TimelineFilterComponent = exports.ɵbb;
6582
7673
  exports.TimelineFilterModule = TimelineFilterModule;
6583
7674
  exports.TokenInterceptor = TokenInterceptor;
6584
7675
  exports.UpdateNotifierComponent = UpdateNotifierComponent;
@@ -6591,22 +7682,26 @@
6591
7682
  exports.esulr = esulr;
6592
7683
  exports.ɵa = SnackModule;
6593
7684
  exports.ɵb = SuccessSnackComponent;
6594
- exports.ɵbc = AuthenticationGuard;
6595
- exports.ɵbd = CredentialsService;
6596
- exports.ɵbe = ConfigService;
6597
- exports.ɵbf = TechlifyConfig;
6598
- exports.ɵbl = TechlifyUpdateService;
6599
- exports.ɵbm = TechlifyUpdateRoutingModule;
6600
- exports.ɵbn = TechlifyUpdateFormModule;
6601
- exports.ɵbo = TechlifyUpdateFormComponent;
6602
- exports.ɵbp = ReadMoreModule;
6603
- exports.ɵbq = ReadMoreComponent;
6604
- exports.ɵbr = TechlifyUpdateHistoryRoutingModule;
6605
- exports.ɵbt = UpdateNotifierSnackComponent;
6606
- exports.ɵbu = UpdateViewModule;
6607
- exports.ɵbv = UpdateViewComponent;
7685
+ exports.ɵba = NumberSelector;
7686
+ exports.ɵbc = TimelineFilterRoutingModule;
7687
+ exports.ɵbd = LoaderComponent;
7688
+ exports.ɵbg = AuthenticationGuard;
7689
+ exports.ɵbm = TechlifyUpdateService;
7690
+ exports.ɵbn = TechlifyUpdateRoutingModule;
7691
+ exports.ɵbo = TechlifyUpdateFormModule;
7692
+ exports.ɵbp = TechlifyUpdateFormComponent;
7693
+ exports.ɵbq = TechlifyUpdateHistoryRoutingModule;
7694
+ exports.ɵbs = UpdateNotifierSnackComponent;
7695
+ exports.ɵbt = UpdateViewModule;
7696
+ exports.ɵbu = UpdateViewComponent;
7697
+ exports.ɵbv = DataManager;
6608
7698
  exports.ɵbw = DataManager;
7699
+ exports.ɵbx = ErrorHandlerService;
7700
+ exports.ɵby = AlertService;
7701
+ exports.ɵbz = StorageService;
6609
7702
  exports.ɵc = ErrorSnackComponent;
7703
+ exports.ɵca = CompanyFeatureService;
7704
+ exports.ɵcb = AuthenticationGuard;
6610
7705
  exports.ɵd = HTTP_DYNAMIC_INTERCEPTORS;
6611
7706
  exports.ɵe = HttpService;
6612
7707
  exports.ɵf = RouteReusableStrategy;
@@ -6621,11 +7716,12 @@
6621
7716
  exports.ɵq = NoteListComponent;
6622
7717
  exports.ɵr = NoteService;
6623
7718
  exports.ɵs = NoteFormComponent;
6624
- exports.ɵu = MatSelectInfiniteScrollDirective;
6625
- exports.ɵv = NumItemsSelector;
6626
- exports.ɵw = NumberSelector;
6627
- exports.ɵy = TimelineFilterRoutingModule;
6628
- exports.ɵz = LoaderComponent;
7719
+ exports.ɵt = CommentFormComponent;
7720
+ exports.ɵu = CredentialsService;
7721
+ exports.ɵv = ConfigService;
7722
+ exports.ɵw = TechlifyConfig;
7723
+ exports.ɵy = MatSelectInfiniteScrollDirective;
7724
+ exports.ɵz = NumItemsSelector;
6629
7725
 
6630
7726
  Object.defineProperty(exports, '__esModule', { value: true });
6631
7727