Skip to content

Commit

Permalink
Merged in bugfix/SHIBUI-1013 (pull request #244)
Browse files Browse the repository at this point in the history
Bugfix/SHIBUI-1013

Approved-by: Ryan Mathis <rmathis@unicon.net>
  • Loading branch information
rmathis committed Nov 27, 2018
2 parents 0c2978a + ed8ef6f commit b402ca7
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ export class NewFilterComponent implements OnDestroy, OnInit {
this.statusChangeEmitted$
.pipe(takeUntil(this.ngUnsubscribe))
.subscribe(valid => {
console.log(valid);
this.isValid = valid.value ? valid.value.length === 0 : true;
});

Expand Down
8 changes: 8 additions & 0 deletions ui/src/app/metadata/filter/effect/collection.effect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,14 @@ export class FilterCollectionEffects {
tap(([filter, provider]) => this.router.navigate(['/', 'metadata', 'provider', provider, 'filters']))
);

@Effect()
addFilterSuccessReloadParent$ = this.actions$.pipe(
ofType<AddFilterSuccess>(FilterCollectionActionTypes.ADD_FILTER_SUCCESS),
map(action => action.payload),
withLatestFrom(this.store.select(fromProvider.getSelectedProviderId).pipe(skipWhile(id => !id))),
map(([filter, provider]) => new SelectProviderRequest(provider))
);

@Effect()
updateFilter$ = this.actions$.pipe(
ofType<UpdateFilterRequest>(FilterCollectionActionTypes.UPDATE_FILTER_REQUEST),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,18 @@ export class ProviderEditStepComponent implements OnDestroy {

this.valueChangeEmitted$.pipe(
map(changes => changes.value),
withLatestFrom(this.definition$),
skipWhile(([ changes, definition ]) => !definition || !changes),
map(([ changes, definition ]) => definition.parser(changes))
withLatestFrom(this.definition$, this.store.select(fromProvider.getSelectedProvider)),
filter(([ changes, definition, provider ]) => definition && changes && provider),
map(([ changes, definition, provider ]) => {
const parsed = definition.parser(changes);
return ({
...parsed,
metadataFilters: [
...provider.metadataFilters,
...(parsed.metadataFilters || [])
]
});
})
)
.subscribe(changes => this.store.dispatch(new UpdateProvider(changes)));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ export class ProviderSelectComponent implements OnDestroy {
map(params => new SelectProviderRequest(params.providerId))
).subscribe(store);

this.route.params.subscribe(params => console.log(params));

this.provider$ = this.store.select(fromProviders.getSelectedProvider).pipe(skipWhile(p => !p));

this.provider$.subscribe(provider => this.setDefinition(provider));
Expand Down

0 comments on commit b402ca7

Please sign in to comment.