Skip to content

Commit

Permalink
fix: Migrate logic for button showing to Angular 17 blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
romeonicholas committed Nov 28, 2023
1 parent 7a82462 commit 6adf6cc
Showing 1 changed file with 34 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,40 @@
<div>
<div class="flex items-center">
<h2>Models</h2>
<a
mat-stroked-button
class="!ml-4"
[routerLink]="
project?.is_archived
? null
: [
'/project',
(projectService.project$ | async)?.slug,
'models',
'create'
]
"
*ngIf="projectUserService.verifyRole('manager')"
[matTooltip]="
project?.is_archived
? 'You cannot add a model to an archived project'
: 'Add a new model'
"
[disabled]="project?.is_archived"
>
<mat-icon id="add-icon">add</mat-icon>
</a>
<button
*ngIf="
models !== undefined &&
models.length > 1 &&
projectUserService.verifyRole('manager')
"
mat-stroked-button
matTooltip="Reorder models"
class="!ml-4"
(click)="openReorderModelsDialog(models)"
>
<mat-icon>list</mat-icon>
</button>
@if (projectUserService.verifyRole("manager")) {
<a
mat-stroked-button
class="!ml-4"
[routerLink]="
project?.is_archived
? null
: [
'/project',
(projectService.project$ | async)?.slug,
'models',
'create'
]
"
[matTooltip]="
project?.is_archived
? 'You cannot add a model to an archived project'
: 'Add a new model'
"
[disabled]="project?.is_archived"
>
<mat-icon id="add-icon">add</mat-icon>
</a>
@if (models !== undefined && models.length > 1) {
<button
mat-stroked-button
matTooltip="Reorder models"
class="!ml-4"
(click)="openReorderModelsDialog(models)"
>
<mat-icon>list</mat-icon>
</button>
}
}
</div>
<div class="flex flex-wrap">
<div class="flex" *ngIf="(modelService.models$ | async) === undefined">
Expand Down

0 comments on commit 6adf6cc

Please sign in to comment.