Skip to content

Commit

Permalink
fixed-button dont redirect unconditionally if we dont provide him an …
Browse files Browse the repository at this point in the history
…addresse and create action preserve query params
  • Loading branch information
sambaptista committed Nov 8, 2024
1 parent ff1c7e7 commit 759e172
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion projects/natural/src/lib/classes/abstract-detail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ export class NaturalAbstractDetail<
const newUrl = oldUrl.replace('/new', '/' + model.id) + (nextUrl ? '/' + nextUrl : '');
return this.router.navigateByUrl(newUrl); // replace /new by /123
} else {
return this.router.navigate(['..', model.id], {relativeTo: this.route});
const queryParams = this.route.snapshot.queryParams;
return this.router.navigate(['..', model.id], {relativeTo: this.route, queryParams});
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {MatButtonModule} from '@angular/material/button';
})
export class NaturalFixedButtonComponent {
@Input({required: true}) public icon!: string;
@Input() public link: RouterLink['routerLink'] = [];
@Input() public link: RouterLink['routerLink'] | null = null;
@Input() public color: ThemePalette = 'accent';
@Input() public disabled = false;
}

0 comments on commit 759e172

Please sign in to comment.