fix multiple subscribes

This commit is contained in:
Dan Percic 2021-10-07 19:34:58 +03:00
parent 6311fab415
commit 31f1ab09d9
8 changed files with 35 additions and 19 deletions

View File

@ -6,11 +6,11 @@
<mat-menu #menu="matMenu" class="search-menu" xPosition="after">
<ng-template matMenuContent>
<div class="wrapper">
<div *ngIf="currentActionIdx$ | async as currentIndex" class="wrapper">
<button
(click)="item.action(valueChanges$.getValue())"
*ngFor="let item of shownActions; let index = index"
[class.highlight]="(currentActionIdx$ | async) === index"
[class.highlight]="currentIndex === index"
class="spotlight-row pointer"
>
<mat-icon [svgIcon]="item.icon"></mat-icon>

View File

@ -22,9 +22,11 @@
type="text"
/>
<mat-autocomplete #auto="matAutocomplete" autoActiveFirstOption>
<mat-option *ngFor="let field of filteredKeyOptions | async" [value]="field">
{{ field }}
</mat-option>
<ng-container *ngIf="filteredKeyOptions | async as fields">
<mat-option *ngFor="let field of fields" [value]="field">
{{ field }}
</mat-option>
</ng-container>
</mat-autocomplete>
</mat-form-field>
</div>
@ -95,12 +97,12 @@
width="full"
></iqser-input-with-action>
</div>
<div [class.search-open]="isSearchOpen" class="csv-header-pill-content">
<div *ngIf="sortedDisplayedEntities$ | async as fields" [class.search-open]="isSearchOpen" class="csv-header-pill-content">
<div
(click)="toggleFieldActive(field)"
(mouseenter)="setHoveredColumn(field.csvColumn)"
(mouseleave)="setHoveredColumn()"
*ngFor="let field of sortedDisplayedEntities$ | async"
*ngFor="let field of fields"
class="csv-header-pill-wrapper"
>
<div [class.selected]="isActive(field)" class="csv-header-pill">

View File

@ -48,10 +48,10 @@
></redaction-simple-doughnut-chart>
</div>
<div *ngIf="dossier.hasFiles" class="mt-24 legend pb-32">
<div *ngIf="dossier.hasFiles && needsWorkFilters$ | async as filters" class="mt-24 legend pb-32">
<div
(click)="filterService.toggleFilter('needsWorkFilters', filter.id)"
*ngFor="let filter of needsWorkFilters$ | async"
*ngFor="let filter of filters"
[class.active]="filter.checked"
>
<redaction-type-filter [filter]="filter"></redaction-type-filter>

View File

@ -94,18 +94,18 @@
</ng-template>
<ng-template #viewModeSelection>
<div class="view-mode-selection">
<div *ngIf="listingMode$ | async as mode" class="view-mode-selection">
<div class="all-caps-label" translate="view-mode.view-as"></div>
<iqser-circle-button
(action)="listingMode = listingModes.workflow"
[attr.aria-expanded]="(listingMode$ | async) === listingModes.workflow"
[attr.aria-expanded]="mode === listingModes.workflow"
[tooltip]="'view-mode.workflow' | translate"
icon="iqser:lanes"
></iqser-circle-button>
<iqser-circle-button
(action)="listingMode = listingModes.table"
[attr.aria-expanded]="(listingMode$ | async) === listingModes.table"
[attr.aria-expanded]="mode === listingModes.table"
[tooltip]="'view-mode.list' | translate"
icon="iqser:list"
></iqser-circle-button>

View File

@ -1,4 +1,5 @@
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
ElementRef,
@ -57,6 +58,7 @@ import { DossierTemplatesService } from '../../../services/dossier-templates.ser
templateUrl: './dossier-overview-screen.component.html',
styleUrls: ['./dossier-overview-screen.component.scss'],
providers: [...DefaultListingServices, { provide: ListingComponent, useExisting: forwardRef(() => DossierOverviewScreenComponent) }],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class DossierOverviewScreenComponent extends ListingComponent<File> implements OnInit, OnDestroy, OnDetach, OnAttach {
readonly listingModes = ListingModes;

View File

@ -1,4 +1,14 @@
import { AfterViewInit, Component, forwardRef, Injector, OnDestroy, OnInit, TemplateRef, ViewChild } from '@angular/core';
import {
AfterViewInit,
ChangeDetectionStrategy,
Component,
forwardRef,
Injector,
OnDestroy,
OnInit,
TemplateRef,
ViewChild,
} from '@angular/core';
import { DossierStatuses } from '@redaction/red-ui-http';
import { AppStateService } from '@state/app-state.service';
import { Dossier } from '@state/model/dossier';
@ -25,10 +35,12 @@ import { DossiersService } from '../../../services/dossiers.service';
{ provide: EntitiesService, useExisting: DossiersService },
{ provide: ListingComponent, useExisting: forwardRef(() => DossiersListingScreenComponent) },
],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class DossiersListingScreenComponent
extends ListingComponent<Dossier>
implements OnInit, AfterViewInit, OnDestroy, OnAttach, OnDetach {
implements OnInit, AfterViewInit, OnDestroy, OnAttach, OnDetach
{
readonly currentUser = this._userService.currentUser;
readonly tableColumnConfigs = this._configService.tableConfig;
readonly tableHeaderLabel = _('dossier-listing.table-header.title');

View File

@ -32,10 +32,10 @@
</div>
<ng-container *ngIf="filterByDossierTemplate">
<div class="iqser-input-group w-200 mt-0 mr-8">
<div *ngIf="dossierTemplatesService.all$ | async as templates" class="iqser-input-group w-200 mt-0 mr-8">
<mat-select [(ngModel)]="dossierTemplate" [disabled]="!compare">
<mat-option [value]="selectDossierTemplate">{{ selectDossierTemplate.name | translate }}</mat-option>
<mat-option *ngFor="let dossierTemplate of dossierTemplatesService.all$ | async" [value]="dossierTemplate">
<mat-option *ngFor="let dossierTemplate of templates" [value]="dossierTemplate">
{{ dossierTemplate.name }}
</mat-option>
</mat-select>
@ -51,10 +51,10 @@
</div>
</ng-container>
<div *ngIf="!filterByDossierTemplate" class="iqser-input-group w-200 mt-0">
<div *ngIf="!filterByDossierTemplate && dossiersService.all$ | async as dossiers" class="iqser-input-group w-200 mt-0">
<mat-select [(ngModel)]="dossier" [disabled]="!compare">
<mat-option [value]="selectDossier">{{ selectDossier.dossierName | translate }}</mat-option>
<mat-option *ngFor="let dossier of dossiersService.all$ | async" [value]="dossier">
<mat-option *ngFor="let dossier of dossiers" [value]="dossier">
{{ dossier.dossierName }}
</mat-option>
</mat-select>

@ -1 +1 @@
Subproject commit adf27211ddb6547dea0b2c570d1681cb00e84cdf
Subproject commit feaaa5d8dc9ebc1075e03a6e7b92f3ccec893fc3