Skip to content

Commit

Permalink
SHIBUI-996 Renamed file
Browse files Browse the repository at this point in the history
  • Loading branch information
rmathis committed Nov 29, 2018
1 parent 98d18c0 commit b098b62
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<ng-container *ngIf="filter$ | async">
<router-outlet></router-outlet>
</ng-container>
Empty file.
Empty file.
39 changes: 39 additions & 0 deletions ui/src/app/metadata/filter/container/select-filter.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { Component, OnDestroy } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { Observable, Subscription } from 'rxjs';
import { distinctUntilChanged, map } from 'rxjs/operators';
import { Store } from '@ngrx/store';
import { NgbPopoverConfig } from '@ng-bootstrap/ng-bootstrap';

import { MetadataFilter } from '../../domain/model/metadata-filter';
import { SelectFilter } from '../action/collection.action';
import * as fromFilter from '../reducer';

@Component({
selector: 'select-filter-page',
templateUrl: './select-filter.component.html',
styleUrls: ['./select-filter.component.scss'],
providers: [NgbPopoverConfig]
})
export class SelectFilterComponent implements OnDestroy {
actionsSubscription: Subscription;
filter$: Observable<MetadataFilter>;

constructor(
private store: Store<fromFilter.State>,
private route: ActivatedRoute
) {
this.actionsSubscription = this.route.params.pipe(
distinctUntilChanged(),
map(params => {
return new SelectFilter(params.id);
})
).subscribe(store);

this.filter$ = this.store.select(fromFilter.getSelectedFilter);
}

ngOnDestroy() {
this.actionsSubscription.unsubscribe();
}
} /* istanbul ignore next */
7 changes: 7 additions & 0 deletions ui/src/app/metadata/filter/service/filter-resolver.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
this.provider$
.pipe(
takeUntil(this.ngUnsubscribe)
)
.subscribe(p => {
this.store.dispatch(new LoadFilterRequest(p.resourceId));
});

0 comments on commit b098b62

Please sign in to comment.