Skip to content

Commit

Permalink
SHIBUI-1517 Added link to filters page
Browse files Browse the repository at this point in the history
  • Loading branch information
rmathis committed Oct 8, 2019
1 parent daef4b5 commit 40829d1
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</button>
&nbsp;
<button class="btn btn-secondary"
(click)="cancel()" aria-label="Cancel changes, go back to dashboard"
(click)="cancel(provider.resourceId)" aria-label="Cancel changes, go back to dashboard"
role="button">
<translate-i18n key="action.cancel">Cancel</translate-i18n>
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ describe('Provider Edit Component', () => {
});

describe('cancel method', () => {
it('should route to the metadata manager', () => {
it('should route to the provider', () => {
spyOn(router, 'navigate');
spyOn(app, 'clear');
app.cancel();
app.cancel('foo');
expect(router.navigate).toHaveBeenCalled();
expect(app.clear).toHaveBeenCalled();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ export class ProviderEditComponent implements OnDestroy, CanComponentDeactivate
this.store.dispatch(new UpdateProviderRequest(this.latest));
}

cancel(): void {
cancel(id): void {
this.clear();
this.router.navigate(['dashboard', 'metadata', 'manager', 'providers']);
this.router.navigate(['/', 'metadata', 'provider', id, 'configuration', 'options']);
}

canDeactivate(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@
</a>
</editor-nav>
</div>
<div class="col-6 col-lg-12 order-2 text-right">
<div class="col-6 col-lg-12 order-2 text-right d-flex justify-content-end justify-content-lg-between">
<a class="btn btn-link"
[routerLink]="['/', 'metadata', 'provider', (provider$ | async).resourceId, 'configuration', 'options']">
<i class="fa fa-arrow-left" aria-hidden="true"></i>&nbsp;
Return to Provider
</a>
<a [routerLink]="['../', 'filter', 'new']"
class="btn btn-success">
<i class="fa fa-plus-circle"></i>
Expand Down
2 changes: 1 addition & 1 deletion ui/src/app/metadata/provider/effect/collection.effect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export class CollectionEffects {
createProviderSuccessRedirect$ = this.actions$.pipe(
ofType<AddProviderSuccess>(ProviderCollectionActionTypes.ADD_PROVIDER_SUCCESS),
map(action => action.payload),
tap(provider => this.navigateToProvider(provider.id))
tap(provider => this.navigateToProvider(provider.resourceId))
);

@Effect()
Expand Down

0 comments on commit 40829d1

Please sign in to comment.