Skip to content
Snippets Groups Projects
Commit 9326820b authored by Isaac Evavold's avatar Isaac Evavold
Browse files

fix metadata table observables

parent b8c2418b
No related branches found
No related tags found
No related merge requests found
......@@ -20,6 +20,7 @@ import {
NewWhatIfAuditDialogComponent,
NewWhatIfAuditFields,
} from '../new-what-if-audit-dialog/new-what-if-audit-dialog.component';
import { shareReplay } from 'rxjs/operators';
@Component({
selector: 'cse-dars-view',
......@@ -47,8 +48,12 @@ export class DARSViewComponent implements OnInit {
public ngOnInit() {
this.store.dispatch(new darsActions.StartLoadingMetadata());
this.metadataStatus$ = this.store.select(selectors.metadataStatus);
this.programMetadata$ = this.store.select(selectors.programMetadata);
this.whatIfMetadata$ = this.store.select(selectors.whatIfMetadata);
this.programMetadata$ = this.store
.select(selectors.programMetadata)
.pipe(shareReplay());
this.whatIfMetadata$ = this.store
.select(selectors.whatIfMetadata)
.pipe(shareReplay());
this.visibleAuditStatus$ = this.store.select(selectors.visibleAuditStatus);
this.audit$ = this.store.select(selectors.visibleAudit);
this.alerts$ = this.store.select(selectors.alerts);
......
......@@ -56,12 +56,10 @@ export class DarsMetadataTableComponent implements OnInit {
}
public ngOnInit() {
this.metadata.pipe(
tap(metadata => {
const sorted = DarsMetadataTableComponent.sortMetadata(metadata);
this.dataSource = new MatTableDataSource<AuditMetadata>(sorted);
this.dataSource.paginator = this.paginator;
}),
);
this.metadata.subscribe(metadata => {
const sorted = DarsMetadataTableComponent.sortMetadata(metadata);
this.dataSource = new MatTableDataSource<AuditMetadata>(sorted);
this.dataSource.paginator = this.paginator;
});
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment