@bizdoc/core 3.8.1 → 3.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1136,6 +1136,35 @@ class SessionService {
1136
1136
  iconRegistry.addSvgIconLiteral('word', sanitizer.bypassSecurityTrustHtml(WORD_ICON));
1137
1137
  iconRegistry.addSvgIconLiteral('powerpoint', sanitizer.bypassSecurityTrustHtml(POWERPOINT_ICON));
1138
1138
  iconRegistry.addSvgIconLiteral('pdf', sanitizer.bypassSecurityTrustHtml(PDF_ICON));
1139
+ _hub.notify$.subscribe(n => {
1140
+ const { messages, messagesCount } = this.profile;
1141
+ messages.push(n.model);
1142
+ this.profile.messagesCount = !messagesCount ? 1 :
1143
+ messagesCount + 1;
1144
+ });
1145
+ //
1146
+ _hub.updateNotify$.subscribe(e => {
1147
+ const { originalRead, model: { id, sent, read } } = e, { messages, messagesCount } = this.profile;
1148
+ const item = messages.find(n => n.id === id);
1149
+ if (item)
1150
+ Object.assign(item, e.model);
1151
+ else
1152
+ messages.push(e.model);
1153
+ if (originalRead !== undefined && read !== originalRead &&
1154
+ this._isAboveWatermark(sent))
1155
+ this.profile.messagesCount = (messagesCount || 0) + (read ? -1 : 1);
1156
+ });
1157
+ //
1158
+ _hub.new$.subscribe(m => {
1159
+ const { userId, model: { folderId } } = m, { inboxCount, folders, userId: me } = this.profile;
1160
+ if (userId !== me)
1161
+ return;
1162
+ this.profile.inboxCount = !inboxCount ? 1 :
1163
+ inboxCount + 1;
1164
+ const folder = folders.find(f => f.name === folderId);
1165
+ folder.count = !folder.count ? 1 :
1166
+ folder.count + 1;
1167
+ });
1139
1168
  }
1140
1169
  /** */
1141
1170
  get tags() {
@@ -1151,10 +1180,11 @@ class SessionService {
1151
1180
  get accentPalette() {
1152
1181
  return this._accentpalette;
1153
1182
  }
1154
- isAboveWatermark(date) {
1183
+ _isAboveWatermark(date) {
1184
+ const { notificationsView } = this.profile.options;
1155
1185
  return !this.isImpersonating &&
1156
- this.profile.options.notificationsView !== undefined &&
1157
- this.profile.options.notificationsView < date;
1186
+ notificationsView !== undefined &&
1187
+ notificationsView < date;
1158
1188
  }
1159
1189
  get primeryPalette() {
1160
1190
  return this._primarypalette;
@@ -7153,7 +7183,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImpor
7153
7183
 
7154
7184
  const DOCUMENT_MODEL = new InjectionToken('model');
7155
7185
  class MailboxService {
7156
- constructor(messaging, _session, _auth, _http) {
7186
+ constructor(_session, _auth, _http) {
7157
7187
  this._session = _session;
7158
7188
  this._auth = _auth;
7159
7189
  this._http = _http;
@@ -7171,18 +7201,6 @@ class MailboxService {
7171
7201
  this._change$.next(m);
7172
7202
  }));
7173
7203
  };
7174
- messaging.new$.
7175
- subscribe(m => {
7176
- if (m.userId !== _session.profile.userId)
7177
- return;
7178
- if (!_session.profile.inboxCount)
7179
- _session.profile.inboxCount = 0;
7180
- _session.profile.inboxCount++;
7181
- const folder = _session.profile.folders.find(f => f.name === m.model.folderId);
7182
- if (!folder.count)
7183
- folder.count = 0;
7184
- folder.count++;
7185
- });
7186
7204
  }
7187
7205
  async formatDownloadUrl(document, file) {
7188
7206
  let url = `/api/attachments/${document.documentId}/${file.id}`;
@@ -7208,12 +7226,12 @@ class MailboxService {
7208
7226
  return this._http.delete(`/api/attachments/${recipientId}/${fileId}`);
7209
7227
  }
7210
7228
  markAsRead(id, read, folderId, received) {
7211
- return this._http.put(`/api/mailbox/read/${id}`, undefined, { params: { read } }).pipe(tap(() => folderId && received && this._updateunreadcounter(received, folderId, read ? 1 : -1)));
7229
+ return this._http.put(`/api/mailbox/read/${id}`, undefined, { params: { read } }).pipe(tap(() => folderId && received && this._updateUnreadWatermark(received, folderId, read ? 1 : -1)));
7212
7230
  }
7213
7231
  listComments(id, before) {
7214
7232
  return this._http.get(`/api/comments/${id}`, { params: { before: new Date(before).toJSON() } });
7215
7233
  }
7216
- updateRecipientTags(id, tags) {
7234
+ updateTags(id, tags) {
7217
7235
  return this._http.put(`/api/mailbox/tag/${id}`, { tags }).pipe(tap(() => {
7218
7236
  this._change$.next({ id, tags });
7219
7237
  }));
@@ -7421,21 +7439,19 @@ class MailboxService {
7421
7439
  */
7422
7440
  get(id, read) {
7423
7441
  return this._http.get(`/api/mail/${id}`).pipe(tap((m) => read === false && m.read === true &&
7424
- this._updateunreadcounter(m.received, m.folderId, -1)));
7442
+ this._updateUnreadWatermark(m.received, m.folderId, -1)));
7425
7443
  }
7426
- _updateunreadcounter(date, folderId, val) {
7444
+ _updateUnreadWatermark(date, folderId, move) {
7445
+ const { inboxCount, folders, options: { inboxView } } = this._session.profile;
7427
7446
  if (
7428
7447
  // date is above watermark
7429
- this._session.profile.options.inboxView &&
7430
- this._session.profile.options.inboxView < date) {
7431
- if (!this._session.profile.inboxCount)
7432
- this._session.profile.inboxCount = 0;
7433
- this._session.profile.inboxCount += val;
7434
- }
7448
+ inboxView &&
7449
+ inboxView < date)
7450
+ this._session.profile.inboxCount = !inboxCount ? 0 :
7451
+ inboxCount + move;
7435
7452
  // decrease
7436
- const folder = this._session.profile.folders.
7437
- find(f => f.name === folderId);
7438
- folder.count = Math.max(0, (folder.count || 0) + val);
7453
+ const folder = folders.find(f => f.name === folderId);
7454
+ folder.count = Math.max(0, (folder.count || 0) + move);
7439
7455
  }
7440
7456
  save(id, form, version, model, files) {
7441
7457
  //const fd = new FormData();
@@ -7471,7 +7487,7 @@ class MailboxService {
7471
7487
  delete(id) {
7472
7488
  return this._http.delete(`/api/mail/${id}`).pipe(tap(() => this._delete$.next(id)));
7473
7489
  }
7474
- toggleRemoveComment(id, value) {
7490
+ toggleCommentHide(id, value) {
7475
7491
  return this._http.delete(`/api/comments/${id}?value=${value}`);
7476
7492
  }
7477
7493
  //post<T = any>(form: string, model?: T): Observable<RecipientModel<T>> {
@@ -7488,7 +7504,7 @@ class MailboxService {
7488
7504
  return this._geoLocation(form).pipe(switchMap(params => this._http.put(`/api/mail/${id}?version=${version}&go=true`, model, { params })), this._sync());
7489
7505
  }
7490
7506
  send(id, version, form, model, action, actionArgs, read, folderId, received) {
7491
- return this._geoLocation(form).pipe(switchMap(params => this._http.put(`/api/mail/${id}?version=${version}&action=${action}`, model, { params: { ...params, ...actionArgs } })), tap(() => read === false && received && folderId && this._updateunreadcounter(received, folderId, -1)), this._sync());
7507
+ return this._geoLocation(form).pipe(switchMap(params => this._http.put(`/api/mail/${id}?version=${version}&action=${action}`, model, { params: { ...params, ...actionArgs } })), tap(() => read === false && received && folderId && this._updateUnreadWatermark(received, folderId, -1)), this._sync());
7492
7508
  }
7493
7509
  listEvents(starting, ending, contains) {
7494
7510
  return this._http.get(`/api/events`, {
@@ -7532,13 +7548,13 @@ class MailboxService {
7532
7548
  }
7533
7549
  });
7534
7550
  }
7535
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: MailboxService, deps: [{ token: HubService }, { token: SessionService }, { token: AuthenticationImpl }, { token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
7551
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: MailboxService, deps: [{ token: SessionService }, { token: AuthenticationImpl }, { token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
7536
7552
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: MailboxService, providedIn: 'root' }); }
7537
7553
  }
7538
7554
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: MailboxService, decorators: [{
7539
7555
  type: Injectable,
7540
7556
  args: [{ providedIn: 'root' }]
7541
- }], ctorParameters: () => [{ type: HubService }, { type: SessionService }, { type: AuthenticationImpl }, { type: i1.HttpClient }] });
7557
+ }], ctorParameters: () => [{ type: SessionService }, { type: AuthenticationImpl }, { type: i1.HttpClient }] });
7542
7558
  function isHttpResponse(event) {
7543
7559
  return event.type === HttpEventType.Response;
7544
7560
  }
@@ -8124,10 +8140,9 @@ const FILTER_DEBOUNCE = 250;
8124
8140
  /** browse-filter component*/
8125
8141
  class BrowseFilterComponent {
8126
8142
  /** browse-filter ctor */
8127
- constructor(_fb, _session, _cd, _mailbox, _accounts, _config) {
8143
+ constructor(_fb, _session, _mailbox, _accounts, _config) {
8128
8144
  this._fb = _fb;
8129
8145
  this._session = _session;
8130
- this._cd = _cd;
8131
8146
  this._mailbox = _mailbox;
8132
8147
  this._accounts = _accounts;
8133
8148
  this._config = _config;
@@ -8172,9 +8187,6 @@ class BrowseFilterComponent {
8172
8187
  ngAfterViewInit() {
8173
8188
  this.focus();
8174
8189
  }
8175
- displayName(val) {
8176
- return isObject(val) ? val.name : null;
8177
- }
8178
8190
  change(axis, evt) {
8179
8191
  this.form.get(axis).setValue(evt.option.value.key);
8180
8192
  }
@@ -8187,38 +8199,33 @@ class BrowseFilterComponent {
8187
8199
  cleanup(value);
8188
8200
  this.valuesChange.emit(value);
8189
8201
  }
8190
- toggleTag(evt) {
8191
- //const tag = (evt.value as Tag)?.name;
8192
- //this.form.controls.tags.setValue(this.form.controls.tags.value !== tag ? tag : null);
8193
- }
8194
- displayFn(item) {
8195
- return item ? item.name : undefined;
8202
+ displayFn(person) {
8203
+ return person ? person.name : undefined;
8196
8204
  }
8197
8205
  drop(evt) {
8198
8206
  evt.item.data;
8199
8207
  }
8200
8208
  senderSelected(e) {
8201
- const info = e.option.value;
8202
- this.form.patchValue({ senderId: info ? info.id : null });
8209
+ const person = e.option.value;
8210
+ this.form.patchValue({ senderId: person ? person.id : null });
8203
8211
  }
8204
8212
  focus() {
8205
8213
  if (this.containsEl)
8206
- this.containsEl.nativeElement.focus();
8207
- else if (this.senderEl)
8208
- this.senderEl.nativeElement.focus();
8209
- //this._cd.detectChanges();
8214
+ this.containsEl.focus();
8215
+ else
8216
+ this.senderEl.focus();
8210
8217
  }
8211
8218
  ngOnDestroy() {
8212
8219
  this._destroy.next();
8213
8220
  this._destroy.complete();
8214
8221
  }
8215
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: BrowseFilterComponent, deps: [{ token: i1$2.FormBuilder }, { token: SessionService }, { token: i0.ChangeDetectorRef }, { token: MailboxService }, { token: AccountService }, { token: BIZDOC_CONFIG }], target: i0.ɵɵFactoryTarget.Component }); }
8216
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.2", type: BrowseFilterComponent, isStandalone: false, selector: "bizdoc-browse-filter", inputs: { values: "values", folderId: "folderId", exclude: "exclude" }, outputs: { valuesChange: "valuesChange" }, viewQueries: [{ propertyName: "chips", first: true, predicate: MatChipListbox, descendants: true, static: true }, { propertyName: "containsEl", first: true, predicate: ["contains"], descendants: true, read: ElementRef, static: true }, { propertyName: "senderEl", first: true, predicate: ["sender"], descendants: true, read: ElementRef, static: true }], ngImport: i0, template: "<form [formGroup]=\"form\" class=\"column gap\" autocomplete=\"off\">\r\n <!--@if (!exclude || exclude.indexOf('contains') < 0) {\r\n <mat-form-field subscriptSizing=\"dynamic\">\r\n <input matInput formControlName=\"contains\" [placeholder]=\"'Contains' | translate\" #contains>\r\n @if (form.value.contains) {\r\n <button matSuffix mat-icon-button aria-label=\"\" (click)=\"form.controls.contains.setValue(null)\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n }\r\n </mat-form-field>\r\n }-->\r\n <mat-form-field subscriptSizing=\"dynamic\">\r\n <input matInput [matAutocomplete]=\"senders\" [placeholder]=\"'Sender' | translate\" [formControl]=\"sendername\" #sender />\r\n <mat-autocomplete #senders [displayWith]=\"displayName\" (optionSelected)=\"senderSelected($event)\">\r\n @for (u of senders$ | async; track u.id) {\r\n <mat-option [value]=\"u\">\r\n <span>{{u.name}}</span>\r\n </mat-option>\r\n }\r\n </mat-autocomplete>\r\n @if (sendername.value) {\r\n <button matSuffix mat-icon-button (click)=\"clearSender()\"><mat-icon>clear</mat-icon></button>\r\n }\r\n </mat-form-field>\r\n <mat-form-field subscriptSizing=\"dynamic\">\r\n <mat-select [placeholder]=\"'Status'|translate\" formControlName=\"stateId\" multiple>\r\n <mat-option>\r\n {{ 'All' | translate }}\r\n </mat-option>\r\n @for (s of states; track s.name) {\r\n <mat-option [value]=\"s.name\">\r\n {{s.title}}\r\n </mat-option>\r\n }\r\n </mat-select>\r\n </mat-form-field>\r\n <mat-form-field subscriptSizing=\"dynamic\">\r\n <mat-select [placeholder]=\"'Form' | translate\" formControlName=\"formId\">\r\n <mat-option>\r\n {{ 'All' | translate }}\r\n </mat-option>\r\n @for (f of forms; track f.name) {\r\n <mat-option [value]=\"f.name\">{{f.title}}</mat-option>\r\n }\r\n </mat-select>\r\n </mat-form-field>\r\n <mat-form-field subscriptSizing=\"dynamic\">\r\n <mat-label>{{'Received' | translate}}</mat-label>\r\n <mat-date-range-input [rangePicker]=\"datePicker\" [formGroup]=\"form\">\r\n <input matStartDate [placeholder]=\"'StartDate'| translate\" formControlName=\"fromDate\">\r\n <input matEndDate [placeholder]=\"'EndDate' | translate\" formControlName=\"toDate\">\r\n </mat-date-range-input>\r\n <mat-datepicker-toggle matIconSuffix [for]=\"datePicker\"></mat-datepicker-toggle>\r\n <mat-date-range-picker #datePicker></mat-date-range-picker>\r\n </mat-form-field>\r\n <mat-chip-listbox id=\"tags\" [multiple]=true formControlName=\"tags\">\r\n @for (tag of tags; track tag.name) {\r\n <mat-chip-option [value]=\"tag.name\" [highlighted]=false>\r\n @if(tag.icon) {\r\n <mat-icon matChipAvatar>{{tag.icon}}</mat-icon>\r\n }\r\n {{tag.title || tag.name}}\r\n </mat-chip-option>\r\n }\r\n </mat-chip-listbox>\r\n @if (filters) {\r\n <bizdoc-cube-filter class=\"cube-filter\"\r\n [cube]=\"filters.cube\"\r\n [include]=\"filters.axes\"\r\n [axes]=\"values\"\r\n [autofocus]=\"false\"\r\n (axesChange)=\"axesChange($event)\"></bizdoc-cube-filter>\r\n }\r\n</form>\r\n", styles: [".cube-filter ::ng-deep form{padding:0}\n"], dependencies: [{ kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i4.MatChipAvatar, selector: "mat-chip-avatar, [matChipAvatar]" }, { kind: "component", type: i4.MatChipListbox, selector: "mat-chip-listbox", inputs: ["multiple", "aria-orientation", "selectable", "compareWith", "required", "hideSingleSelectionIndicator", "value"], outputs: ["change"] }, { kind: "component", type: i4.MatChipOption, selector: "mat-basic-chip-option, [mat-basic-chip-option], mat-chip-option, [mat-chip-option]", inputs: ["selectable", "selected"], outputs: ["selectionChange"] }, { kind: "component", type: i2$4.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "component", type: i2$4.MatDateRangeInput, selector: "mat-date-range-input", inputs: ["rangePicker", "required", "dateFilter", "min", "max", "disabled", "separator", "comparisonStart", "comparisonEnd"], exportAs: ["matDateRangeInput"] }, { kind: "directive", type: i2$4.MatStartDate, selector: "input[matStartDate]", outputs: ["dateChange", "dateInput"] }, { kind: "directive", type: i2$4.MatEndDate, selector: "input[matEndDate]", outputs: ["dateChange", "dateInput"] }, { kind: "component", type: i2$4.MatDateRangePicker, selector: "mat-date-range-picker", exportAs: ["matDateRangePicker"] }, { kind: "component", type: i2$6.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i2$6.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i2$6.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "component", type: i3$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i3$1.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i8.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: i4$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i7.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: CubeFilterComponent, selector: "bizdoc-cube-filter", inputs: ["cube", "exclude", "include", "axes", "autofocus"], outputs: ["axesChange"] }, { kind: "pipe", type: i9.AsyncPipe, name: "async" }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
8222
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: BrowseFilterComponent, deps: [{ token: i1$2.FormBuilder }, { token: SessionService }, { token: MailboxService }, { token: AccountService }, { token: BIZDOC_CONFIG }], target: i0.ɵɵFactoryTarget.Component }); }
8223
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.2", type: BrowseFilterComponent, isStandalone: false, selector: "bizdoc-browse-filter", inputs: { values: "values", folderId: "folderId", exclude: "exclude" }, outputs: { valuesChange: "valuesChange" }, viewQueries: [{ propertyName: "chips", first: true, predicate: MatChipListbox, descendants: true, static: true }, { propertyName: "containsEl", first: true, predicate: ["contains"], descendants: true, read: MatInput, static: true }, { propertyName: "senderEl", first: true, predicate: ["sender"], descendants: true, read: MatInput, static: true }], ngImport: i0, template: "<form [formGroup]=\"form\" class=\"column gap\" autocomplete=\"off\">\r\n <!--@if (!exclude || exclude.indexOf('contains') < 0) {\r\n <mat-form-field subscriptSizing=\"dynamic\">\r\n <input matInput formControlName=\"contains\" [placeholder]=\"'Contains' | translate\" #contains>\r\n @if (form.value.contains) {\r\n <button matSuffix mat-icon-button aria-label=\"\" (click)=\"form.controls.contains.setValue(null)\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n }\r\n </mat-form-field>\r\n }-->\r\n <mat-form-field subscriptSizing=\"dynamic\">\r\n <input matInput [matAutocomplete]=\"senders\" [placeholder]=\"'Sender' | translate\" [formControl]=\"sendername\" #sender />\r\n <mat-autocomplete #senders [displayWith]=\"displayFn\" (optionSelected)=\"senderSelected($event)\">\r\n @for (u of senders$ | async; track u.id) {\r\n <mat-option [value]=\"u\">\r\n <span>{{u.name}}</span>\r\n </mat-option>\r\n }\r\n </mat-autocomplete>\r\n @if (sendername.value) {\r\n <button matSuffix mat-icon-button (click)=\"clearSender()\"><mat-icon>clear</mat-icon></button>\r\n }\r\n </mat-form-field>\r\n <mat-form-field subscriptSizing=\"dynamic\">\r\n <mat-select [placeholder]=\"'Status'|translate\" formControlName=\"stateId\" multiple>\r\n <!--<mat-option>\r\n {{ 'All' | translate }}\r\n </mat-option>-->\r\n @for (s of states; track s.name) {\r\n <mat-option [value]=\"s.name\">\r\n {{s.title}}\r\n </mat-option>\r\n }\r\n </mat-select>\r\n </mat-form-field>\r\n <mat-form-field subscriptSizing=\"dynamic\">\r\n <mat-select [placeholder]=\"'Form' | translate\" formControlName=\"formId\">\r\n <mat-option>\r\n {{ 'All' | translate }}\r\n </mat-option>\r\n @for (f of forms; track f.name) {\r\n <mat-option [value]=\"f.name\">{{f.title}}</mat-option>\r\n }\r\n </mat-select>\r\n </mat-form-field>\r\n <mat-form-field subscriptSizing=\"dynamic\">\r\n <mat-label>{{'Received' | translate}}</mat-label>\r\n <mat-date-range-input [rangePicker]=\"datePicker\" [formGroup]=\"form\">\r\n <input matStartDate [placeholder]=\"'StartDate'| translate\" formControlName=\"fromDate\">\r\n <input matEndDate [placeholder]=\"'EndDate' | translate\" formControlName=\"toDate\">\r\n </mat-date-range-input>\r\n <mat-datepicker-toggle matIconSuffix [for]=\"datePicker\"></mat-datepicker-toggle>\r\n <mat-date-range-picker #datePicker></mat-date-range-picker>\r\n </mat-form-field>\r\n <mat-chip-listbox id=\"tags\" [multiple]=true formControlName=\"tags\">\r\n @for (tag of tags; track tag.name) {\r\n <mat-chip-option [value]=\"tag.name\" [highlighted]=false>\r\n @if(tag.icon) {\r\n <mat-icon matChipAvatar>{{tag.icon}}</mat-icon>\r\n }\r\n {{tag.title || tag.name}}\r\n </mat-chip-option>\r\n }\r\n </mat-chip-listbox>\r\n @if (filters) {\r\n <bizdoc-cube-filter class=\"cube-filter\"\r\n [cube]=\"filters.cube\"\r\n [include]=\"filters.axes\"\r\n [axes]=\"values\"\r\n [autofocus]=\"false\"\r\n (axesChange)=\"axesChange($event)\"></bizdoc-cube-filter>\r\n }\r\n</form>\r\n", styles: [".cube-filter ::ng-deep form{padding:0}\n"], dependencies: [{ kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i4.MatChipAvatar, selector: "mat-chip-avatar, [matChipAvatar]" }, { kind: "component", type: i4.MatChipListbox, selector: "mat-chip-listbox", inputs: ["multiple", "aria-orientation", "selectable", "compareWith", "required", "hideSingleSelectionIndicator", "value"], outputs: ["change"] }, { kind: "component", type: i4.MatChipOption, selector: "mat-basic-chip-option, [mat-basic-chip-option], mat-chip-option, [mat-chip-option]", inputs: ["selectable", "selected"], outputs: ["selectionChange"] }, { kind: "component", type: i2$4.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "component", type: i2$4.MatDateRangeInput, selector: "mat-date-range-input", inputs: ["rangePicker", "required", "dateFilter", "min", "max", "disabled", "separator", "comparisonStart", "comparisonEnd"], exportAs: ["matDateRangeInput"] }, { kind: "directive", type: i2$4.MatStartDate, selector: "input[matStartDate]", outputs: ["dateChange", "dateInput"] }, { kind: "directive", type: i2$4.MatEndDate, selector: "input[matEndDate]", outputs: ["dateChange", "dateInput"] }, { kind: "component", type: i2$4.MatDateRangePicker, selector: "mat-date-range-picker", exportAs: ["matDateRangePicker"] }, { kind: "component", type: i2$6.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i2$6.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i2$6.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "component", type: i3$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i3$1.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i8.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: i4$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i7.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: CubeFilterComponent, selector: "bizdoc-cube-filter", inputs: ["cube", "exclude", "include", "axes", "autofocus"], outputs: ["axesChange"] }, { kind: "pipe", type: i9.AsyncPipe, name: "async" }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
8217
8224
  }
8218
8225
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: BrowseFilterComponent, decorators: [{
8219
8226
  type: Component,
8220
- args: [{ standalone: false, selector: 'bizdoc-browse-filter', template: "<form [formGroup]=\"form\" class=\"column gap\" autocomplete=\"off\">\r\n <!--@if (!exclude || exclude.indexOf('contains') < 0) {\r\n <mat-form-field subscriptSizing=\"dynamic\">\r\n <input matInput formControlName=\"contains\" [placeholder]=\"'Contains' | translate\" #contains>\r\n @if (form.value.contains) {\r\n <button matSuffix mat-icon-button aria-label=\"\" (click)=\"form.controls.contains.setValue(null)\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n }\r\n </mat-form-field>\r\n }-->\r\n <mat-form-field subscriptSizing=\"dynamic\">\r\n <input matInput [matAutocomplete]=\"senders\" [placeholder]=\"'Sender' | translate\" [formControl]=\"sendername\" #sender />\r\n <mat-autocomplete #senders [displayWith]=\"displayName\" (optionSelected)=\"senderSelected($event)\">\r\n @for (u of senders$ | async; track u.id) {\r\n <mat-option [value]=\"u\">\r\n <span>{{u.name}}</span>\r\n </mat-option>\r\n }\r\n </mat-autocomplete>\r\n @if (sendername.value) {\r\n <button matSuffix mat-icon-button (click)=\"clearSender()\"><mat-icon>clear</mat-icon></button>\r\n }\r\n </mat-form-field>\r\n <mat-form-field subscriptSizing=\"dynamic\">\r\n <mat-select [placeholder]=\"'Status'|translate\" formControlName=\"stateId\" multiple>\r\n <mat-option>\r\n {{ 'All' | translate }}\r\n </mat-option>\r\n @for (s of states; track s.name) {\r\n <mat-option [value]=\"s.name\">\r\n {{s.title}}\r\n </mat-option>\r\n }\r\n </mat-select>\r\n </mat-form-field>\r\n <mat-form-field subscriptSizing=\"dynamic\">\r\n <mat-select [placeholder]=\"'Form' | translate\" formControlName=\"formId\">\r\n <mat-option>\r\n {{ 'All' | translate }}\r\n </mat-option>\r\n @for (f of forms; track f.name) {\r\n <mat-option [value]=\"f.name\">{{f.title}}</mat-option>\r\n }\r\n </mat-select>\r\n </mat-form-field>\r\n <mat-form-field subscriptSizing=\"dynamic\">\r\n <mat-label>{{'Received' | translate}}</mat-label>\r\n <mat-date-range-input [rangePicker]=\"datePicker\" [formGroup]=\"form\">\r\n <input matStartDate [placeholder]=\"'StartDate'| translate\" formControlName=\"fromDate\">\r\n <input matEndDate [placeholder]=\"'EndDate' | translate\" formControlName=\"toDate\">\r\n </mat-date-range-input>\r\n <mat-datepicker-toggle matIconSuffix [for]=\"datePicker\"></mat-datepicker-toggle>\r\n <mat-date-range-picker #datePicker></mat-date-range-picker>\r\n </mat-form-field>\r\n <mat-chip-listbox id=\"tags\" [multiple]=true formControlName=\"tags\">\r\n @for (tag of tags; track tag.name) {\r\n <mat-chip-option [value]=\"tag.name\" [highlighted]=false>\r\n @if(tag.icon) {\r\n <mat-icon matChipAvatar>{{tag.icon}}</mat-icon>\r\n }\r\n {{tag.title || tag.name}}\r\n </mat-chip-option>\r\n }\r\n </mat-chip-listbox>\r\n @if (filters) {\r\n <bizdoc-cube-filter class=\"cube-filter\"\r\n [cube]=\"filters.cube\"\r\n [include]=\"filters.axes\"\r\n [axes]=\"values\"\r\n [autofocus]=\"false\"\r\n (axesChange)=\"axesChange($event)\"></bizdoc-cube-filter>\r\n }\r\n</form>\r\n", styles: [".cube-filter ::ng-deep form{padding:0}\n"] }]
8221
- }], ctorParameters: () => [{ type: i1$2.FormBuilder }, { type: SessionService }, { type: i0.ChangeDetectorRef }, { type: MailboxService }, { type: AccountService }, { type: undefined, decorators: [{
8227
+ args: [{ standalone: false, selector: 'bizdoc-browse-filter', template: "<form [formGroup]=\"form\" class=\"column gap\" autocomplete=\"off\">\r\n <!--@if (!exclude || exclude.indexOf('contains') < 0) {\r\n <mat-form-field subscriptSizing=\"dynamic\">\r\n <input matInput formControlName=\"contains\" [placeholder]=\"'Contains' | translate\" #contains>\r\n @if (form.value.contains) {\r\n <button matSuffix mat-icon-button aria-label=\"\" (click)=\"form.controls.contains.setValue(null)\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n }\r\n </mat-form-field>\r\n }-->\r\n <mat-form-field subscriptSizing=\"dynamic\">\r\n <input matInput [matAutocomplete]=\"senders\" [placeholder]=\"'Sender' | translate\" [formControl]=\"sendername\" #sender />\r\n <mat-autocomplete #senders [displayWith]=\"displayFn\" (optionSelected)=\"senderSelected($event)\">\r\n @for (u of senders$ | async; track u.id) {\r\n <mat-option [value]=\"u\">\r\n <span>{{u.name}}</span>\r\n </mat-option>\r\n }\r\n </mat-autocomplete>\r\n @if (sendername.value) {\r\n <button matSuffix mat-icon-button (click)=\"clearSender()\"><mat-icon>clear</mat-icon></button>\r\n }\r\n </mat-form-field>\r\n <mat-form-field subscriptSizing=\"dynamic\">\r\n <mat-select [placeholder]=\"'Status'|translate\" formControlName=\"stateId\" multiple>\r\n <!--<mat-option>\r\n {{ 'All' | translate }}\r\n </mat-option>-->\r\n @for (s of states; track s.name) {\r\n <mat-option [value]=\"s.name\">\r\n {{s.title}}\r\n </mat-option>\r\n }\r\n </mat-select>\r\n </mat-form-field>\r\n <mat-form-field subscriptSizing=\"dynamic\">\r\n <mat-select [placeholder]=\"'Form' | translate\" formControlName=\"formId\">\r\n <mat-option>\r\n {{ 'All' | translate }}\r\n </mat-option>\r\n @for (f of forms; track f.name) {\r\n <mat-option [value]=\"f.name\">{{f.title}}</mat-option>\r\n }\r\n </mat-select>\r\n </mat-form-field>\r\n <mat-form-field subscriptSizing=\"dynamic\">\r\n <mat-label>{{'Received' | translate}}</mat-label>\r\n <mat-date-range-input [rangePicker]=\"datePicker\" [formGroup]=\"form\">\r\n <input matStartDate [placeholder]=\"'StartDate'| translate\" formControlName=\"fromDate\">\r\n <input matEndDate [placeholder]=\"'EndDate' | translate\" formControlName=\"toDate\">\r\n </mat-date-range-input>\r\n <mat-datepicker-toggle matIconSuffix [for]=\"datePicker\"></mat-datepicker-toggle>\r\n <mat-date-range-picker #datePicker></mat-date-range-picker>\r\n </mat-form-field>\r\n <mat-chip-listbox id=\"tags\" [multiple]=true formControlName=\"tags\">\r\n @for (tag of tags; track tag.name) {\r\n <mat-chip-option [value]=\"tag.name\" [highlighted]=false>\r\n @if(tag.icon) {\r\n <mat-icon matChipAvatar>{{tag.icon}}</mat-icon>\r\n }\r\n {{tag.title || tag.name}}\r\n </mat-chip-option>\r\n }\r\n </mat-chip-listbox>\r\n @if (filters) {\r\n <bizdoc-cube-filter class=\"cube-filter\"\r\n [cube]=\"filters.cube\"\r\n [include]=\"filters.axes\"\r\n [axes]=\"values\"\r\n [autofocus]=\"false\"\r\n (axesChange)=\"axesChange($event)\"></bizdoc-cube-filter>\r\n }\r\n</form>\r\n", styles: [".cube-filter ::ng-deep form{padding:0}\n"] }]
8228
+ }], ctorParameters: () => [{ type: i1$2.FormBuilder }, { type: SessionService }, { type: MailboxService }, { type: AccountService }, { type: undefined, decorators: [{
8222
8229
  type: Inject,
8223
8230
  args: [BIZDOC_CONFIG]
8224
8231
  }] }], propDecorators: { values: [{
@@ -8234,10 +8241,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImpor
8234
8241
  args: [MatChipListbox, { static: true }]
8235
8242
  }], containsEl: [{
8236
8243
  type: ViewChild,
8237
- args: ['contains', { static: true, read: ElementRef }]
8244
+ args: ['contains', { static: true, read: MatInput }]
8238
8245
  }], senderEl: [{
8239
8246
  type: ViewChild,
8240
- args: ['sender', { static: true, read: ElementRef }]
8247
+ args: ['sender', { static: true, read: MatInput }]
8241
8248
  }] } });
8242
8249
 
8243
8250
  /** */
@@ -9348,7 +9355,7 @@ class BrowseItemsComponent {
9348
9355
  this._retrieve(mail).subscribe(item => {
9349
9356
  if (item.tags && item.tags.indexOf(tag) > -1)
9350
9357
  return;
9351
- this._mailbox.updateRecipientTags(mail.id, item.tags).subscribe(() => {
9358
+ this._mailbox.updateTags(mail.id, item.tags).subscribe(() => {
9352
9359
  if (!item.tags)
9353
9360
  item.tags = [tag];
9354
9361
  else
@@ -9745,7 +9752,7 @@ class TagsComponent {
9745
9752
  setTimeout(() => this.inputElement.nativeElement.focus());
9746
9753
  }
9747
9754
  _save() {
9748
- this._mailbox.updateRecipientTags(this._data.id, this._data.tags.map(t => t.name)).subscribe();
9755
+ this._mailbox.updateTags(this._data.id, this._data.tags.map(t => t.name)).subscribe();
9749
9756
  }
9750
9757
  add(event) {
9751
9758
  if (!this.auto.isOpen) {
@@ -13540,7 +13547,7 @@ class CommentComponent {
13540
13547
  return this._popup.open(component, this.bodyElement, { position: 'start', data });
13541
13548
  }
13542
13549
  delete(value) {
13543
- this._mailbox.toggleRemoveComment(this.item.id, value).subscribe({
13550
+ this._mailbox.toggleCommentHide(this.item.id, value).subscribe({
13544
13551
  next: () => {
13545
13552
  this.item.deleted = value;
13546
13553
  this.deleted.emit(value);
@@ -18271,7 +18278,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImpor
18271
18278
  }], ctorParameters: () => [{ type: i0.ViewContainerRef }] });
18272
18279
 
18273
18280
  class NotificationsService {
18274
- constructor(_http, messaging, _session) {
18281
+ constructor(_http, _session) {
18275
18282
  this._http = _http;
18276
18283
  this._session = _session;
18277
18284
  }
@@ -18292,13 +18299,14 @@ class NotificationsService {
18292
18299
  params
18293
18300
  });
18294
18301
  }
18295
- read(id, date, read) {
18302
+ markAsRead(id, date, read) {
18296
18303
  return this._http.put(`/api/notifications/${id}?read=${read}`, {}, { headers: { 'no-progress': 'true' } }).pipe(tap(() => {
18297
- if (this._session.isAboveWatermark(date)) {
18298
- if (!this._session.profile.messagesCount)
18299
- this._session.profile.messagesCount = 0;
18300
- this._session.profile.messagesCount--;
18301
- }
18304
+ const { messagesCount, options: { notificationsView } } = this._session.profile;
18305
+ if (!this._session.isImpersonating &&
18306
+ notificationsView !== undefined &&
18307
+ notificationsView < date)
18308
+ this._session.profile.messagesCount = !messagesCount ? 0 :
18309
+ messagesCount - 1;
18302
18310
  }));
18303
18311
  }
18304
18312
  get(id) {
@@ -18310,13 +18318,13 @@ class NotificationsService {
18310
18318
  delete(id) {
18311
18319
  return this._http.delete(`/api/notifications/${id}`);
18312
18320
  }
18313
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: NotificationsService, deps: [{ token: i1.HttpClient }, { token: HubService }, { token: SessionService }], target: i0.ɵɵFactoryTarget.Injectable }); }
18321
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: NotificationsService, deps: [{ token: i1.HttpClient }, { token: SessionService }], target: i0.ɵɵFactoryTarget.Injectable }); }
18314
18322
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: NotificationsService, providedIn: 'root' }); }
18315
18323
  }
18316
18324
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: NotificationsService, decorators: [{
18317
18325
  type: Injectable,
18318
18326
  args: [{ providedIn: 'root' }]
18319
- }], ctorParameters: () => [{ type: i1.HttpClient }, { type: HubService }, { type: SessionService }] });
18327
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: SessionService }] });
18320
18328
 
18321
18329
  class NotificationsComponentBase {
18322
18330
  constructor() {
@@ -18419,7 +18427,7 @@ class NotificationsTableComponent extends NotificationsComponentBase {
18419
18427
  }
18420
18428
  read(item, read) {
18421
18429
  if (item.read !== read)
18422
- this._service.read(item.id, item.sent, read).subscribe(() => item.read = read);
18430
+ this._service.markAsRead(item.id, item.sent, read).subscribe(() => item.read = read);
18423
18431
  }
18424
18432
  isMuted(item) {
18425
18433
  return this._service.get(item.id).pipe(map(i => i.muted));
@@ -19464,43 +19472,29 @@ class HomeBase {
19464
19472
  const { model: { formId: name, subject, number, pending } } = m;
19465
19473
  if (!pending)
19466
19474
  return;
19467
- const form = this._session.profile.forms.find(f => f.name === name), msg = this._translate.get('NewMail', form.title, number, subject || '');
19468
- this._snackBar.open(msg, m.userId === this._session.profile.userId ? this._translate.get('OpenNew') : undefined, {
19475
+ const { userId, forms, options: { notifications } } = this._session.profile;
19476
+ const form = forms.find(f => f.name === name), msg = this._translate.get('NewMail', form.title, number, subject || ''), action = m.userId === userId ? this._translate.get('OpenNew') : undefined;
19477
+ this._snackBar.open(msg, action, {
19469
19478
  duration: 5000,
19470
19479
  direction: this._session.direction,
19471
19480
  politeness: 'assertive'
19472
- }).onAction().subscribe(() => this.onNewMessage(m.model));
19473
- this._session.profile.options.notifications.sound &&
19481
+ }).onAction().subscribe(() => this.navToMessage(m.model));
19482
+ notifications.sound &&
19474
19483
  playAudio('notification_simple-01');
19475
19484
  });
19485
+ //
19476
19486
  this._messaging.notify$.subscribe(n => {
19477
- this._session.profile.options.notifications.sound &&
19478
- playAudio('notification_simple-01');
19479
- this._session.profile.messages.push(n.model);
19480
- if (!this._session.profile.messagesCount)
19481
- this._session.profile.messagesCount = 0;
19482
- this._session.profile.messagesCount++;
19483
- });
19484
- this._messaging.updateNotify$.subscribe(e => {
19485
- const item = this._session.profile.messages.find(n => n.id === e.model.id);
19486
- if (item)
19487
- Object.assign(item, e.model);
19488
- else
19489
- this._session.profile.messages.push(e.model);
19490
- if (e.originalRead !== undefined && e.model.read !== e.originalRead &&
19491
- this._session.isAboveWatermark(e.model.sent)) {
19492
- const val = e.model.read ? -1 : 1;
19493
- if (!this._session.profile.messagesCount)
19494
- this._session.profile.messagesCount = 0;
19495
- this._session.profile.messagesCount += val;
19496
- }
19487
+ const { options: { notifications }, messages, messagesCount } = this._session.profile;
19488
+ notifications.sound && playAudio('notification_simple-01');
19497
19489
  });
19490
+ //
19498
19491
  if (this._session.isImpersonating)
19499
19492
  this._snackBar.open(this._translate.get('Impersonating', this._session.profile.name), undefined, {
19500
19493
  duration: TOAST_DURATION,
19501
19494
  verticalPosition: 'top',
19502
19495
  direction: this._session.direction
19503
19496
  });
19497
+ //
19504
19498
  else if (this._session.isOutOfOffice) {
19505
19499
  const options = this._session.profile.options.outOfOffice;
19506
19500
  this._snackBar.openFromComponent(OutOfOfficeToast, {
@@ -19597,7 +19591,7 @@ class QuickNotificationsComponent extends NotificationsComponentBase {
19597
19591
  open(item, evt) {
19598
19592
  if (evt.target.tagName !== 'MAT-ICON') {
19599
19593
  if (!item.read)
19600
- this._service.read(item.id, item.sent, true).subscribe(() => item.read = true);
19594
+ this._service.markAsRead(item.id, item.sent, true).subscribe(() => item.read = true);
19601
19595
  this._popupRef.close();
19602
19596
  }
19603
19597
  }
@@ -21336,7 +21330,7 @@ class HomeComponent extends HomeBase {
21336
21330
  this.subMenu = null;
21337
21331
  this.collapseSubMenu();
21338
21332
  }
21339
- onNewMessage(model) {
21333
+ navToMessage(model) {
21340
21334
  this._router.navigate(['mailbox/i', model.id.encodeId()], {
21341
21335
  state: { item: model },
21342
21336
  policy: OpenPolicy.Clear
@@ -21638,7 +21632,7 @@ class HomeMobileComponent extends HomeBase {
21638
21632
  setTimeout(() => this.composeState = 'done', 500);
21639
21633
  });
21640
21634
  }
21641
- onNewMessage(model) {
21635
+ navToMessage(model) {
21642
21636
  this._router.navigate(['mailbox/i', model.id.encodeId()], {
21643
21637
  state: { item: model }
21644
21638
  });