Fix some delegate view bugs

This commit is contained in:
Joshua Sangmeister 2020-06-16 13:56:07 +02:00
parent ac4cb39105
commit 44f1d1e819
11 changed files with 64 additions and 44 deletions

View File

@ -0,0 +1,8 @@
.mat-basic-chip .mat-chip-ripple {
top: 0;
left: 0;
right: 0;
bottom: 0;
position: absolute;
pointer-events: none;
}

View File

@ -1,4 +1,4 @@
import { Component, Input, OnDestroy } from '@angular/core';
import { Component, Input, OnDestroy, ViewEncapsulation } from '@angular/core';
import { Subscription } from 'rxjs';
import { distinctUntilChanged } from 'rxjs/operators';
@ -19,7 +19,9 @@ import {
*/
@Component({
selector: 'os-speaker-button',
templateUrl: './speaker-button.component.html'
templateUrl: './speaker-button.component.html',
styleUrls: ['./speaker-button.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class SpeakerButtonComponent implements OnDestroy {
@Input()

View File

@ -155,23 +155,26 @@
<mat-icon>cloud_upload</mat-icon>
<span>{{ 'Import' | translate }}</span>
</button>
<div *osPerms="'agenda.can_manage'">
<mat-divider></mat-divider>
<button
mat-menu-item
*osPerms="'agenda.can_manage'"
class="red-warning-text"
(click)="deleteAllSpeakersOfAllListsOfSpeakers()"
>
<mat-icon>delete</mat-icon>
<span>{{ 'Clear all list of speakers' | translate }}</span>
</button>
</div>
<div *osPerms="'core.can_manage_config'">
<mat-divider></mat-divider>
<!-- Settings -->
<button mat-menu-item *osPerms="'core.can_manage_config'" routerLink="/settings/agenda">
<button mat-menu-item routerLink="/settings/agenda">
<mat-icon>settings</mat-icon>
<span>{{ 'Settings' | translate }}</span>
</button>
</div>
</div>
<div *ngIf="isMultiSelect">
<!-- Select all -->

View File

@ -98,13 +98,15 @@
<mat-icon>archive</mat-icon>
<span>{{ 'Export ...' | translate }}</span>
</button>
<div *osPerms="'core.can_manage_config'">
<mat-divider></mat-divider>
<!-- Settings -->
<button mat-menu-item *osPerms="'core.can_manage_config'" routerLink="/settings/elections">
<button mat-menu-item routerLink="/settings/elections">
<mat-icon>settings</mat-icon>
<span>{{ 'Settings' | translate }}</span>
</button>
</div>
</div>
<div *ngIf="isMultiSelect">
<button mat-menu-item (click)="selectAll()">

View File

@ -209,7 +209,6 @@
[object]="mediafile"
[menuItem]="true"
></os-projector-button>
<os-speaker-button [object]="mediafile" [menuItem]="true"></os-speaker-button>
<div *ngIf="canEdit">
<button mat-menu-item (click)="onEditFile(mediafile)">
<mat-icon>edit</mat-icon>

View File

@ -255,7 +255,6 @@ export class MediafileListComponent extends BaseListViewComponent<ViewMediafile>
*/
public showFileMenu(file: ViewMediafile): boolean {
return (
this.operator.hasPerms(Permission.agendaCanSeeListOfSpeakers) ||
(file.isProjectable() && this.operator.hasPerms(Permission.coreCanManageProjector)) ||
(file.isFont() && this.operator.hasPerms(Permission.coreCanManageLogosAndFonts)) ||
(file.isImage() && this.operator.hasPerms(Permission.coreCanManageLogosAndFonts)) ||

View File

@ -64,7 +64,7 @@
<mat-icon>picture_as_pdf</mat-icon>
<span>{{ 'PDF' | translate }}</span>
</button>
<mat-divider></mat-divider>
<mat-divider *osPerms="['core.can_manage_projector', 'agenda.can_manage', 'core.can_see_history']"></mat-divider>
<!-- Project -->
<os-projector-button
[object]="motion"
@ -93,7 +93,7 @@
{{ 'History' | translate }}
</span>
</button>
<mat-divider></mat-divider>
<mat-divider *ngIf="perms.isAllowed('update', motion) || perms.isAllowed('manage')"></mat-divider>
<!-- Edit-->
<button mat-menu-item (click)="setEditMode(true)" *ngIf="perms.isAllowed('update', motion)">
<mat-icon>edit</mat-icon>

View File

@ -262,7 +262,8 @@
</div>
<mat-divider
*ngIf="categories.length || motionBlocks.length || hasAmendments() || perms.isAllowed('manage')"
*ngIf="(categories.length || motionBlocks.length || hasAmendments() || perms.isAllowed('manage'))
&& (perms.isAllowed('manage') || selectedView === 'list' || operator.hasPerms('core.can_manage_config'))"
></mat-divider>
<div *ngIf="perms.isAllowed('manage')">
@ -313,14 +314,16 @@
</button>
</div>
<div *osPerms="'core.can_manage_config'">
<mat-divider></mat-divider>
<!-- Settings -->
<button mat-menu-item *osPerms="'core.can_manage_config'" routerLink="/settings/motions">
<button mat-menu-item routerLink="/settings/motions">
<mat-icon>settings</mat-icon>
<span>{{ 'Settings' | translate }}</span>
</button>
</div>
</div>
<div *ngIf="isMultiSelect">
<button mat-menu-item (click)="selectAll()">
<mat-icon>done_all</mat-icon>

View File

@ -7,6 +7,7 @@ import { ActivatedRoute, Router } from '@angular/router';
import { TranslateService } from '@ngx-translate/core';
import { PblColumnDefinition } from '@pebula/ngrid';
import { OperatorService } from 'app/core/core-services/operator.service';
import { StorageService } from 'app/core/core-services/storage.service';
import { CategoryRepositoryService } from 'app/core/repositories/motions/category-repository.service';
import { MotionBlockRepositoryService } from 'app/core/repositories/motions/motion-block-repository.service';
@ -222,7 +223,8 @@ export class MotionListComponent extends BaseListViewComponent<ViewMotion> imple
public perms: LocalPermissionsService,
private motionExport: MotionExportService,
private overlayService: OverlayService,
public vp: ViewportService
public vp: ViewportService,
public operator: OperatorService
) {
super(titleService, translate, matSnackBar, storage);
this.canMultiSelect = true;

View File

@ -105,9 +105,9 @@
<mat-menu #topicExtraMenu="matMenu">
<os-projector-button [object]="topic" [menuItem]="true"></os-projector-button>
<os-speaker-button [object]="topic" [menuItem]="true"></os-speaker-button>
<div>
<div *osPerms="'agenda.can_manage'">
<mat-divider></mat-divider>
<button *osPerms="'agenda.can_manage'" mat-menu-item class="red-warning-text" (click)="onDeleteButton()">
<button mat-menu-item class="red-warning-text" (click)="onDeleteButton()">
<mat-icon>delete</mat-icon>
<span>{{ 'Delete' | translate }}</span>
</button>

View File

@ -178,14 +178,16 @@
<span>{{ 'Import' | translate }}</span>
</button>
<div *osPerms="'core.can_manage_config'">
<mat-divider></mat-divider>
<!-- Settings -->
<button mat-menu-item *osPerms="'core.can_manage_config'" routerLink="/settings/participants">
<button mat-menu-item routerLink="/settings/participants">
<mat-icon>settings</mat-icon>
<span>{{ 'Settings' | translate }}</span>
</button>
</div>
</div>
<div *ngIf="isMultiSelect">
<button mat-menu-item (click)="selectAll()">
<mat-icon>done_all</mat-icon>