fixes on listing actions
This commit is contained in:
parent
55aa84532c
commit
da77e5f144
|
@ -74,7 +74,7 @@
|
|||
</ng-template>
|
||||
|
||||
<ng-template #actions let-row="row" let-item>
|
||||
<div class="row" (click)="$event.stopPropagation()">
|
||||
<div *ngIf="!isDeleted(row)" class="row" (click)="$event.stopPropagation()">
|
||||
<div class="col-auto">
|
||||
<button mat-icon-button [matMenuTriggerFor]="actionsMenu">
|
||||
<mat-icon>more_horiz</mat-icon>
|
||||
|
|
|
@ -130,6 +130,11 @@ export class StatusListingComponent extends BaseListingComponent<Status, StatusL
|
|||
//
|
||||
// Listing Component functions
|
||||
//
|
||||
|
||||
isDeleted(row: Status): boolean {
|
||||
return row?.isActive === IsActive.Inactive;
|
||||
}
|
||||
|
||||
onColumnsChanged(event: ColumnsChangedEvent) {
|
||||
super.onColumnsChanged(event);
|
||||
this.onColumnsChangedInternal(event.properties.map(x => x.toString()));
|
||||
|
|
|
@ -205,7 +205,7 @@ export class DescriptionTemplateListingComponent extends BaseListingComponent<De
|
|||
}
|
||||
|
||||
public canEdit(descriptionTemplate: DescriptionTemplate): boolean {
|
||||
return descriptionTemplate.status !== DescriptionTemplateStatus.Finalized && this.hasPermission(AppPermission.EditDescriptionTemplate, descriptionTemplate) && descriptionTemplate.belongsToCurrentTenant;
|
||||
return descriptionTemplate.status !== DescriptionTemplateStatus.Finalized && this.hasPermission(AppPermission.EditDescriptionTemplate, descriptionTemplate) && descriptionTemplate.belongsToCurrentTenant && descriptionTemplate.isActive == IsActive.Active;
|
||||
}
|
||||
|
||||
public canCreateNew(): boolean {
|
||||
|
@ -213,7 +213,7 @@ export class DescriptionTemplateListingComponent extends BaseListingComponent<De
|
|||
}
|
||||
|
||||
public canAddNewVersion(descriptionTemplate: DescriptionTemplate): boolean {
|
||||
return descriptionTemplate.belongsToCurrentTenant != false && this.canCreateNew();
|
||||
return descriptionTemplate.belongsToCurrentTenant != false && descriptionTemplate.isActive == IsActive.Active && this.canCreateNew();
|
||||
}
|
||||
|
||||
public canClone(descriptionTemplate: DescriptionTemplate): boolean {
|
||||
|
@ -221,7 +221,7 @@ export class DescriptionTemplateListingComponent extends BaseListingComponent<De
|
|||
}
|
||||
|
||||
public canViewVersions(descriptionTemplate: DescriptionTemplate): boolean {
|
||||
return descriptionTemplate.belongsToCurrentTenant != false && this.canCreateNew();
|
||||
return descriptionTemplate.belongsToCurrentTenant != false && descriptionTemplate.isActive == IsActive.Active && this.canCreateNew();
|
||||
}
|
||||
|
||||
public canDownloadXml(descriptionTemplate: DescriptionTemplate): boolean {
|
||||
|
@ -229,7 +229,7 @@ export class DescriptionTemplateListingComponent extends BaseListingComponent<De
|
|||
}
|
||||
|
||||
public canDelete(descriptionTemplate: DescriptionTemplate): boolean {
|
||||
return descriptionTemplate.belongsToCurrentTenant != false && this.hasPermission(AppPermission.DeleteDescriptionTemplate, descriptionTemplate);
|
||||
return descriptionTemplate.belongsToCurrentTenant != false && descriptionTemplate.isActive == IsActive.Active && this.hasPermission(AppPermission.DeleteDescriptionTemplate, descriptionTemplate);
|
||||
}
|
||||
|
||||
private onColumnsChangedInternal(columns: string[]) {
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
</ng-template>
|
||||
|
||||
<ng-template #actions let-row="row" let-item>
|
||||
<div class="row" (click)="$event.stopPropagation()">
|
||||
<div *ngIf="row?.belongsToCurrentTenant && !isDeleted(row)" class="row" (click)="$event.stopPropagation()">
|
||||
<div class="col-auto">
|
||||
<button mat-icon-button [matMenuTriggerFor]="actionsMenu" *ngIf="!isFinalized(row) || row.belongsToCurrentTenant != false">
|
||||
<mat-icon>more_horiz</mat-icon>
|
||||
|
|
|
@ -140,6 +140,10 @@ export class DescriptionTemplateTypeListingComponent extends BaseListingComponen
|
|||
// Listing Component functions
|
||||
//
|
||||
|
||||
isDeleted(row: DescriptionTemplateType): boolean {
|
||||
return row?.isActive === IsActive.Inactive;
|
||||
}
|
||||
|
||||
isFinalized(item: DescriptionTemplateType): boolean {
|
||||
return item.status === DescriptionTemplateTypeStatus.Finalized
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@
|
|||
</ng-template>
|
||||
|
||||
<ng-template #actions let-row="row" let-item>
|
||||
<div class="row" (click)="$event.stopPropagation()">
|
||||
<div *ngIf="!isDeleted(row)" class="row" (click)="$event.stopPropagation()">
|
||||
<div class="col-auto">
|
||||
<button mat-icon-button [matMenuTriggerFor]="actionsMenu">
|
||||
<mat-icon>more_horiz</mat-icon>
|
||||
|
|
|
@ -123,6 +123,11 @@ export class LanguageListingComponent extends BaseListingComponent<Language, Lan
|
|||
//
|
||||
// Listing Component functions
|
||||
//
|
||||
|
||||
isDeleted(row: Language): boolean {
|
||||
return row?.isActive === IsActive.Inactive;
|
||||
}
|
||||
|
||||
onColumnsChanged(event: ColumnsChangedEvent) {
|
||||
super.onColumnsChanged(event);
|
||||
this.onColumnsChangedInternal(event.properties.map(x => x.toString()));
|
||||
|
|
|
@ -85,7 +85,7 @@
|
|||
<mat-icon>more_horiz</mat-icon>
|
||||
</button>
|
||||
<mat-menu #actionsMenu="matMenu">
|
||||
<button *ngIf="(row.status != null && row.status === planBlueprintStatuses.Draft)" mat-menu-item [routerLink]="routerUtils.generateUrl(['/plan-blueprints/', row.id])">
|
||||
<button *ngIf="(row.status != null && row.status === planBlueprintStatuses.Draft && row.isActive == isActive.Active)" mat-menu-item [routerLink]="routerUtils.generateUrl(['/plan-blueprints/', row.id])">
|
||||
<mat-icon>edit</mat-icon>{{'PLAN-BLUEPRINT-LISTING.ACTIONS.EDIT' | translate}}
|
||||
</button>
|
||||
<button *ngIf="row.belongsToCurrentTenant != false && (row.status === planBlueprintStatuses.Finalized || row.status == null)" mat-menu-item [routerLink]="routerUtils.generateUrl(['/plan-blueprints/new-version/', row.id])">
|
||||
|
@ -94,14 +94,14 @@
|
|||
<button mat-menu-item [routerLink]="routerUtils.generateUrl(['/plan-blueprints/clone/', row.id])">
|
||||
<mat-icon>content_copy</mat-icon>{{'PLAN-BLUEPRINT-LISTING.ACTIONS.CLONE' | translate}}
|
||||
</button>
|
||||
<button mat-menu-item [routerLink]="routerUtils.generateUrl(['/plan-blueprints/versions/', row.groupId])">
|
||||
<button *ngIf="row.isActive == isActive.Active" mat-menu-item [routerLink]="routerUtils.generateUrl(['/plan-blueprints/versions/', row.groupId])">
|
||||
<mat-icon>library_books</mat-icon>
|
||||
{{'PLAN-BLUEPRINT-LISTING.ACTIONS.VIEW-VERSIONS' | translate}}
|
||||
</button>
|
||||
<button mat-menu-item (click)="export($event, row.id)">
|
||||
<mat-icon>download</mat-icon>{{'PLAN-BLUEPRINT-LISTING.ACTIONS.DOWNLOAD-XML' | translate}}
|
||||
</button>
|
||||
<button *ngIf="row.belongsToCurrentTenant != false" mat-menu-item (click)="delete(row.id)">
|
||||
<button *ngIf="row.belongsToCurrentTenant != false && row.isActive == isActive.Active" mat-menu-item (click)="delete(row.id)">
|
||||
<mat-icon>delete</mat-icon>
|
||||
{{'PLAN-BLUEPRINT-LISTING.ACTIONS.DELETE' | translate}}
|
||||
</button>
|
||||
|
|
|
@ -42,6 +42,7 @@ export class PlanBlueprintListingComponent extends BaseListingComponent<PlanBlue
|
|||
userSettingsKey = { key: 'PlanBlueprintListingUserSettings' };
|
||||
propertiesAvailableForOrder: ColumnDefinition[];
|
||||
planBlueprintStatuses = PlanBlueprintStatus;
|
||||
isActive = IsActive;
|
||||
mode;
|
||||
|
||||
@ViewChild('planBlueprintStatus', { static: true }) planBlueprintStatus?: TemplateRef<any>;
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
</ng-template>
|
||||
|
||||
<ng-template #actions let-row="row" let-item>
|
||||
<div class="row" (click)="$event.stopPropagation()">
|
||||
<div *ngIf="row?.belongsToCurrentTenant && !isDeleted(row)" class="row" (click)="$event.stopPropagation()">
|
||||
<div class="col-auto">
|
||||
<button mat-icon-button [matMenuTriggerFor]="actionsMenu">
|
||||
<mat-icon>more_horiz</mat-icon>
|
||||
|
|
|
@ -128,6 +128,11 @@ export class PrefillingSourceListingComponent extends BaseListingComponent<Prefi
|
|||
//
|
||||
// Listing Component functions
|
||||
//
|
||||
|
||||
isDeleted(row: PrefillingSource): boolean {
|
||||
return row?.isActive === IsActive.Inactive;
|
||||
}
|
||||
|
||||
onColumnsChanged(event: ColumnsChangedEvent) {
|
||||
super.onColumnsChanged(event);
|
||||
this.onColumnsChangedInternal(event.properties.map(x => x.toString()));
|
||||
|
|
|
@ -78,7 +78,7 @@
|
|||
</ng-template>
|
||||
|
||||
<ng-template #actions let-row="row" let-item>
|
||||
<div class="row" (click)="$event.stopPropagation()">
|
||||
<div *ngIf="row?.belongsToCurrentTenant && !isDeleted(row)" class="row" (click)="$event.stopPropagation()">
|
||||
<div class="col-auto">
|
||||
<button mat-icon-button [matMenuTriggerFor]="actionsMenu">
|
||||
<mat-icon>more_horiz</mat-icon>
|
||||
|
|
|
@ -128,6 +128,11 @@ export class ReferenceTypeListingComponent extends BaseListingComponent<Referenc
|
|||
//
|
||||
// Listing Component functions
|
||||
//
|
||||
|
||||
isDeleted(row: ReferenceType): boolean {
|
||||
return row?.isActive === IsActive.Inactive;
|
||||
}
|
||||
|
||||
onColumnsChanged(event: ColumnsChangedEvent) {
|
||||
super.onColumnsChanged(event);
|
||||
this.onColumnsChangedInternal(event.properties.map(x => x.toString()));
|
||||
|
|
|
@ -99,7 +99,7 @@
|
|||
</ng-template>
|
||||
|
||||
<ng-template #actions let-row="row" let-item>
|
||||
<div class="row" (click)="$event.stopPropagation()">
|
||||
<div *ngIf="row?.belongsToCurrentTenant && !isDeleted(row)" class="row" (click)="$event.stopPropagation()">
|
||||
<div class="col-auto">
|
||||
<button mat-icon-button [matMenuTriggerFor]="actionsMenu">
|
||||
<mat-icon>more_horiz</mat-icon>
|
||||
|
|
|
@ -147,6 +147,11 @@ export class ReferenceListingComponent extends BaseListingComponent<Reference, R
|
|||
//
|
||||
// Listing Component functions
|
||||
//
|
||||
|
||||
isDeleted(row: Reference): boolean {
|
||||
return row?.isActive === IsActive.Inactive;
|
||||
}
|
||||
|
||||
onColumnsChanged(event: ColumnsChangedEvent) {
|
||||
super.onColumnsChanged(event);
|
||||
this.onColumnsChangedInternal(event.properties.map(x => x.toString()));
|
||||
|
|
|
@ -78,7 +78,7 @@
|
|||
</ng-template>
|
||||
|
||||
<ng-template #actions let-row="row" let-item>
|
||||
<div class="row" (click)="$event.stopPropagation()">
|
||||
<div *ngIf="!isDeleted(row)" class="row" (click)="$event.stopPropagation()">
|
||||
<div class="col-auto">
|
||||
<button mat-icon-button [matMenuTriggerFor]="actionsMenu">
|
||||
<mat-icon>more_horiz</mat-icon>
|
||||
|
|
|
@ -127,6 +127,11 @@ export class TenantListingComponent extends BaseListingComponent<Tenant, TenantL
|
|||
//
|
||||
// Listing Component functions
|
||||
//
|
||||
|
||||
isDeleted(row: Tenant): boolean {
|
||||
return row?.isActive === IsActive.Inactive;
|
||||
}
|
||||
|
||||
onColumnsChanged(event: ColumnsChangedEvent) {
|
||||
super.onColumnsChanged(event);
|
||||
this.onColumnsChangedInternal(event.properties.map(x => x.toString()));
|
||||
|
|
|
@ -78,7 +78,7 @@
|
|||
</ng-template>
|
||||
|
||||
<ng-template #actions let-row="row" let-item>
|
||||
<div class="row" (click)="$event.stopPropagation()">
|
||||
<div *ngIf="row?.belongsToCurrentTenant && !isDeleted(row)" class="row" (click)="$event.stopPropagation()">
|
||||
<div class="col-auto">
|
||||
<button mat-icon-button [matMenuTriggerFor]="actionsMenu">
|
||||
<mat-icon>more_horiz</mat-icon>
|
||||
|
|
|
@ -137,6 +137,11 @@ export class UsageLimitListingComponent extends BaseListingComponent<UsageLimit,
|
|||
//
|
||||
// Listing Component functions
|
||||
//
|
||||
|
||||
isDeleted(row: UsageLimit): boolean {
|
||||
return row?.isActive === IsActive.Inactive;
|
||||
}
|
||||
|
||||
onColumnsChanged(event: ColumnsChangedEvent) {
|
||||
super.onColumnsChanged(event);
|
||||
this.onColumnsChangedInternal(event.properties.map(x => x.toString()));
|
||||
|
|
|
@ -92,7 +92,7 @@
|
|||
</ng-template>
|
||||
|
||||
<ng-template #actions let-row="row" let-item>
|
||||
<div class="row" (click)="$event.stopPropagation()">
|
||||
<div *ngIf="!isDeleted(row)" class="row" (click)="$event.stopPropagation()">
|
||||
<div class="col-auto">
|
||||
<button mat-icon-button [matMenuTriggerFor]="actionsMenu">
|
||||
<mat-icon>more_horiz</mat-icon>
|
||||
|
|
|
@ -141,6 +141,11 @@ export class NotificationTemplateListingComponent extends BaseListingComponent<N
|
|||
//
|
||||
// Listing Component functions
|
||||
//
|
||||
|
||||
isDeleted(row: NotificationTemplate): boolean {
|
||||
return row?.isActive === IsActive.Inactive;
|
||||
}
|
||||
|
||||
onColumnsChanged(event: ColumnsChangedEvent) {
|
||||
super.onColumnsChanged(event);
|
||||
this.onColumnsChangedInternal(event.properties.map(x => x.toString()));
|
||||
|
|
|
@ -80,7 +80,7 @@
|
|||
</ng-template>
|
||||
|
||||
<ng-template #actions let-row="row" let-item>
|
||||
<div class="row" (click)="$event.stopPropagation()">
|
||||
<div *ngIf="!isDeleted(row)" class="row" (click)="$event.stopPropagation()">
|
||||
<div class="col-auto">
|
||||
<button mat-icon-button [matMenuTriggerFor]="actionsMenu">
|
||||
<mat-icon>more_horiz</mat-icon>
|
||||
|
|
|
@ -181,6 +181,11 @@ export class NotificationListingComponent extends BaseListingComponent<Notificat
|
|||
//
|
||||
// Listing Component functions
|
||||
//
|
||||
|
||||
isDeleted(row: Notification): boolean {
|
||||
return row?.isActive === IsActive.Inactive;
|
||||
}
|
||||
|
||||
onColumnsChanged(event: ColumnsChangedEvent) {
|
||||
super.onColumnsChanged(event);
|
||||
this.onColumnsChangedInternal(event.properties.map(x => x.toString()));
|
||||
|
|
Loading…
Reference in New Issue