disable multiselect options if nothing selected

This commit is contained in:
Maximilian Krambach 2019-04-12 13:57:22 +02:00
parent 2bd9172006
commit 48593acc25
5 changed files with 52 additions and 25 deletions

View File

@ -169,20 +169,20 @@
</button>
<!-- Deselect all -->
<button mat-menu-item (click)="deselectAll()">
<button mat-menu-item [disabled]="!selectedRows.length" (click)="deselectAll()">
<mat-icon>clear</mat-icon>
<span translate>Deselect all</span>
</button>
<mat-divider></mat-divider>
<div *osPerms="'agenda.can_manage'">
<!-- Close selected -->
<button mat-menu-item (click)="setClosedSelected(true)">
<button mat-menu-item [disabled]="!selectedRows.length" (click)="setClosedSelected(true)">
<mat-icon>done</mat-icon>
<span translate>Close</span>
</button>
<!-- Open selected -->
<button mat-menu-item (click)="setClosedSelected(false)">
<button mat-menu-item [disabled]="!selectedRows.length" (click)="setClosedSelected(false)">
<mat-icon>redo</mat-icon>
<span translate>Open</span>
</button>
@ -190,26 +190,26 @@
<mat-divider></mat-divider>
<!-- Set multiple to public -->
<button mat-menu-item (click)="setAgendaType(1)">
<button mat-menu-item [disabled]="!selectedRows.length" (click)="setAgendaType(1)">
<mat-icon>public</mat-icon>
<span translate>Set public</span>
</button>
<!-- Set multiple to internal -->
<button mat-menu-item (click)="setAgendaType(2)">
<button mat-menu-item [disabled]="!selectedRows.length" (click)="setAgendaType(2)">
<mat-icon>visibility</mat-icon>
<span translate>Set internal</span>
</button>
<!-- Set multiple to hidden -->
<button mat-menu-item (click)="setAgendaType(3)">
<button mat-menu-item [disabled]="!selectedRows.length" (click)="setAgendaType(3)">
<mat-icon>visibility_off</mat-icon>
<span translate>Set hidden</span>
</button>
<mat-divider></mat-divider>
<!-- Delete selected -->
<button mat-menu-item class="red-warning-text" (click)="deleteSelected()">
<button mat-menu-item [disabled]="!selectedRows.length" class="red-warning-text" (click)="deleteSelected()">
<mat-icon>delete</mat-icon>
<span translate>Delete</span>
</button>

View File

@ -95,7 +95,7 @@
<mat-icon>done_all</mat-icon>
<span translate>Select all</span>
</button>
<button mat-menu-item (click)="deselectAll()">
<button mat-menu-item [disabled]="!selectedRows.length" (click)="deselectAll()">
<mat-icon>clear</mat-icon>
<span translate>Deselect all</span>
</button>
@ -104,6 +104,7 @@
mat-menu-item
class="red-warning-text"
*osPerms="'assignment.can_manage'"
[disabled]="!selectedRows.length"
(click)="deleteSelected()"
>
<mat-icon>delete</mat-icon>

View File

@ -196,12 +196,17 @@
<mat-icon>done_all</mat-icon>
<span translate>Select all</span>
</button>
<button mat-menu-item (click)="deselectAll()">
<button mat-menu-item [disabled]="!selectedRows.length" (click)="deselectAll()">
<mat-icon>clear</mat-icon>
<span translate>Deselect all</span>
</button>
<mat-divider></mat-divider>
<button mat-menu-item *osPerms="'mediafiles.can_manage'" (click)="deleteSelected()">
<button
mat-menu-item
*osPerms="'mediafiles.can_manage'"
[disabled]="!selectedRows.length"
(click)="deleteSelected()"
>
<mat-icon>delete</mat-icon>
<span translate>Delete</span>
</button>

View File

@ -215,22 +215,23 @@
<mat-icon>done_all</mat-icon>
<span translate>Select all</span>
</button>
<button mat-menu-item (click)="deselectAll()">
<button mat-menu-item [disabled]="!selectedRows.length" (click)="deselectAll()">
<mat-icon>clear</mat-icon>
<span translate>Deselect all</span>
</button>
<div *ngIf="perms.isAllowed('change_metadata')">
<mat-divider></mat-divider>
<button mat-menu-item (click)="multiselectWrapper(multiselectService.bulkToggleFavorite(selectedRows))">
<button mat-menu-item [disabled]="!selectedRows.length" (click)="multiselectWrapper(multiselectService.bulkSetFavorite(selectedRows))">
<mat-icon>star</mat-icon>
<span translate>Set/unset Favorite</span>
</button>
<button mat-menu-item (click)="multiselectWrapper(multiselectService.setStateOfMultiple(selectedRows))">
<button mat-menu-item [disabled]="!selectedRows.length" (click)="multiselectWrapper(multiselectService.setStateOfMultiple(selectedRows))">
<mat-icon>label</mat-icon>
<span translate>Set status</span>
</button>
<button
*ngIf="recomendationEnabled"
[disabled]="!selectedRows.length"
mat-menu-item
(click)="multiselectWrapper(multiselectService.setRecommendation(selectedRows))"
>
@ -240,6 +241,7 @@
</button>
<button
mat-menu-item
[disabled]="!selectedRows.length"
*ngIf="categories.length"
(click)="multiselectWrapper(multiselectService.setCategory(selectedRows))"
>
@ -250,6 +252,7 @@
<button
mat-menu-item
*ngIf="motionBlocks.length"
[disabled]="!selectedRows.length"
(click)="multiselectWrapper(multiselectService.setMotionBlock(selectedRows))"
>
<mat-icon>widgets</mat-icon>
@ -257,7 +260,9 @@
<span translate>Set motion block</span>
</button>
<button mat-menu-item (click)="multiselectWrapper(multiselectService.changeSubmitters(selectedRows))">
<button mat-menu-item
[disabled]="!selectedRows.length"
(click)="multiselectWrapper(multiselectService.changeSubmitters(selectedRows))">
<mat-icon>person_add</mat-icon>
<!-- TODO: icon -->
<span translate>Add/remove submitters</span>
@ -265,17 +270,22 @@
<button
mat-menu-item
*ngIf="tags.length"
[disabled]="!selectedRows.length"
(click)="multiselectWrapper(multiselectService.changeTags(selectedRows))"
>
<mat-icon>bookmarks</mat-icon>
<!-- TODO: icon -->
<span translate>Add/remove tags</span>
</button>
<button mat-menu-item (click)="multiselectWrapper(multiselectService.moveToItem(selectedRows))">
<button mat-menu-item
[disabled]="!selectedRows.length"
(click)="multiselectWrapper(multiselectService.moveToItem(selectedRows))">
<mat-icon>sort</mat-icon>
<span translate>Move to agenda item</span>
</button>
<button mat-menu-item (click)="multiselectWrapper(multiselectService.bulkMoveItems(selectedRows))">
<button mat-menu-item
[disabled]="!selectedRows.length"
(click)="multiselectWrapper(multiselectService.bulkMoveItems(selectedRows))">
<mat-icon>format_indent_increase</mat-icon>
<span translate>Move in call list</span>
</button>
@ -285,6 +295,7 @@
<button
mat-menu-item
class="red-warning-text"
[disabled]="!selectedRows.length"
(click)="multiselectService.delete(selectedRows); toggleMultiSelect()"
>
<mat-icon>delete</mat-icon>

View File

@ -152,20 +152,25 @@
<span translate>Select all</span>
</button>
<button mat-menu-item (click)="deselectAll()">
<button mat-menu-item [disabled]="!selectedRows.length" (click)="deselectAll()">
<mat-icon>clear</mat-icon>
<span translate>Deselect all</span>
</button>
<div *osPerms="'users.can_manage'">
<mat-divider></mat-divider>
<button mat-menu-item (click)="setGroupSelected()">
<button mat-menu-item [disabled]="!selectedRows.length" (click)="setGroupSelected()">
<mat-icon>people</mat-icon>
<span translate>Add/remove groups ...</span>
</button>
<div *ngIf="presenceViewConfigured">
<button mat-menu-item *osPerms="'users.can_manage'" routerLink="presence">
<button
mat-menu-item
*osPerms="'users.can_manage'"
[disabled]="!selectedRows.length"
routerLink="presence"
>
<mat-icon>transfer_within_a_station</mat-icon>
<span translate>Presence</span>
</button>
@ -179,34 +184,39 @@
<div *osPerms="'users.can_manage'">
<mat-divider></mat-divider>
<button mat-menu-item (click)="setActiveSelected()">
<button mat-menu-item [disabled]="!selectedRows.length" (click)="setActiveSelected()">
<mat-icon>block</mat-icon>
<span translate>Enable/disable account ...</span>
</button>
<button mat-menu-item (click)="setPresentSelected()">
<button mat-menu-item [disabled]="!selectedRows.length" (click)="setPresentSelected()">
<mat-icon>check_box</mat-icon>
<span translate>Set presence ...</span>
</button>
<button mat-menu-item (click)="setCommitteeSelected()">
<button mat-menu-item [disabled]="!selectedRows.length" (click)="setCommitteeSelected()">
<mat-icon>account_balance</mat-icon>
<span translate>Set committee ...</span>
</button>
<mat-divider></mat-divider>
<button mat-menu-item (click)="sendInvitationEmailSelected()">
<button mat-menu-item [disabled]="!selectedRows.length" (click)="sendInvitationEmailSelected()">
<mat-icon>mail</mat-icon>
<span translate>Send invitation email</span>
</button>
<button mat-menu-item (click)="resetPasswordsSelected()">
<button mat-menu-item [disabled]="!selectedRows.length" (click)="resetPasswordsSelected()">
<mat-icon>vpn_key</mat-icon>
<span translate>Generate new passwords</span>
</button>
<mat-divider></mat-divider>
<button mat-menu-item class="red-warning-text" (click)="deleteSelected()">
<button
mat-menu-item
class="red-warning-text"
[disabled]="!selectedRows.length"
(click)="deleteSelected()"
>
<mat-icon>delete</mat-icon>
<span translate>Delete</span>
</button>