add belongsToCurrentTenant to ui
This commit is contained in:
parent
6a89feb31b
commit
4963d8ffc3
|
@ -5,6 +5,7 @@ import eu.eudat.authorization.AuthorizationFlags;
|
||||||
import eu.eudat.authorization.Permission;
|
import eu.eudat.authorization.Permission;
|
||||||
import eu.eudat.commons.XmlHandlingService;
|
import eu.eudat.commons.XmlHandlingService;
|
||||||
import eu.eudat.commons.enums.*;
|
import eu.eudat.commons.enums.*;
|
||||||
|
import eu.eudat.commons.scope.tenant.TenantScope;
|
||||||
import eu.eudat.commons.types.dmpblueprint.*;
|
import eu.eudat.commons.types.dmpblueprint.*;
|
||||||
import eu.eudat.commons.types.dmpblueprint.importexport.*;
|
import eu.eudat.commons.types.dmpblueprint.importexport.*;
|
||||||
import eu.eudat.convention.ConventionService;
|
import eu.eudat.convention.ConventionService;
|
||||||
|
@ -51,10 +52,7 @@ import javax.xml.transform.TransformerException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.LinkedList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class DmpBlueprintServiceImpl implements DmpBlueprintService {
|
public class DmpBlueprintServiceImpl implements DmpBlueprintService {
|
||||||
|
@ -82,19 +80,19 @@ public class DmpBlueprintServiceImpl implements DmpBlueprintService {
|
||||||
private final ErrorThesaurusProperties errors;
|
private final ErrorThesaurusProperties errors;
|
||||||
|
|
||||||
private final ValidatorFactory validatorFactory;
|
private final ValidatorFactory validatorFactory;
|
||||||
|
private final TenantScope tenantScope;
|
||||||
@Autowired
|
@Autowired
|
||||||
public DmpBlueprintServiceImpl(
|
public DmpBlueprintServiceImpl(
|
||||||
TenantEntityManager entityManager,
|
TenantEntityManager entityManager,
|
||||||
AuthorizationService authorizationService,
|
AuthorizationService authorizationService,
|
||||||
DeleterFactory deleterFactory,
|
DeleterFactory deleterFactory,
|
||||||
BuilderFactory builderFactory,
|
BuilderFactory builderFactory,
|
||||||
ConventionService conventionService,
|
ConventionService conventionService,
|
||||||
MessageSource messageSource, QueryFactory queryFactory,
|
MessageSource messageSource, QueryFactory queryFactory,
|
||||||
ResponseUtilsService responseUtilsService,
|
ResponseUtilsService responseUtilsService,
|
||||||
XmlHandlingService xmlHandlingService,
|
XmlHandlingService xmlHandlingService,
|
||||||
ErrorThesaurusProperties errors,
|
ErrorThesaurusProperties errors,
|
||||||
ValidatorFactory validatorFactory) {
|
ValidatorFactory validatorFactory, TenantScope tenantScope) {
|
||||||
this.entityManager = entityManager;
|
this.entityManager = entityManager;
|
||||||
this.authorizationService = authorizationService;
|
this.authorizationService = authorizationService;
|
||||||
this.deleterFactory = deleterFactory;
|
this.deleterFactory = deleterFactory;
|
||||||
|
@ -106,6 +104,7 @@ public class DmpBlueprintServiceImpl implements DmpBlueprintService {
|
||||||
this.xmlHandlingService = xmlHandlingService;
|
this.xmlHandlingService = xmlHandlingService;
|
||||||
this.errors = errors;
|
this.errors = errors;
|
||||||
this.validatorFactory = validatorFactory;
|
this.validatorFactory = validatorFactory;
|
||||||
|
this.tenantScope = tenantScope;
|
||||||
}
|
}
|
||||||
|
|
||||||
//region Persist
|
//region Persist
|
||||||
|
@ -394,6 +393,7 @@ public class DmpBlueprintServiceImpl implements DmpBlueprintService {
|
||||||
throw new MyNotFoundException(messageSource.getMessage("General_ItemNotFound", new Object[]{model.getId(), DmpBlueprint.class.getSimpleName()}, LocaleContextHolder.getLocale()));
|
throw new MyNotFoundException(messageSource.getMessage("General_ItemNotFound", new Object[]{model.getId(), DmpBlueprint.class.getSimpleName()}, LocaleContextHolder.getLocale()));
|
||||||
if (!this.conventionService.hashValue(oldDmpBlueprintEntity.getUpdatedAt()).equals(model.getHash()))
|
if (!this.conventionService.hashValue(oldDmpBlueprintEntity.getUpdatedAt()).equals(model.getHash()))
|
||||||
throw new MyValidationException(this.errors.getHashConflict().getCode(), this.errors.getHashConflict().getMessage());
|
throw new MyValidationException(this.errors.getHashConflict().getCode(), this.errors.getHashConflict().getMessage());
|
||||||
|
if (!this.tenantScope.isSet() || !Objects.equals(oldDmpBlueprintEntity.getTenantId(), this.tenantScope.getTenant())) throw new MyForbiddenException(this.errors.getTenantTampering().getCode(), this.errors.getTenantTampering().getMessage());
|
||||||
|
|
||||||
List<DmpBlueprintEntity> latestVersionDmpBlueprints = this.queryFactory.query(DmpBlueprintQuery.class)
|
List<DmpBlueprintEntity> latestVersionDmpBlueprints = this.queryFactory.query(DmpBlueprintQuery.class)
|
||||||
.versionStatuses(DmpBlueprintVersionStatus.Current)
|
.versionStatuses(DmpBlueprintVersionStatus.Current)
|
||||||
|
|
|
@ -10,6 +10,7 @@ export interface Lock {
|
||||||
lockedBy: User;
|
lockedBy: User;
|
||||||
lockedAt: Date;
|
lockedAt: Date;
|
||||||
touchedAt: Date;
|
touchedAt: Date;
|
||||||
|
belongsToCurrentTenant?: boolean;
|
||||||
hash: String;
|
hash: String;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -98,7 +98,7 @@
|
||||||
<button mat-menu-item [routerLink]="['/description-templates/', row.id]">
|
<button mat-menu-item [routerLink]="['/description-templates/', row.id]">
|
||||||
<mat-icon>edit</mat-icon>{{'DESCRIPTION-TEMPLATE-LISTING.ACTIONS.EDIT' | translate}}
|
<mat-icon>edit</mat-icon>{{'DESCRIPTION-TEMPLATE-LISTING.ACTIONS.EDIT' | translate}}
|
||||||
</button>
|
</button>
|
||||||
<button mat-menu-item [routerLink]="['/description-templates/new-version/', row.id]">
|
<button *ngIf="row.belongsToCurrentTenant != false" mat-menu-item [routerLink]="['/description-templates/new-version/', row.id]">
|
||||||
<mat-icon>queue</mat-icon>{{'DESCRIPTION-TEMPLATE-LISTING.ACTIONS.NEW-VERSION' | translate}}
|
<mat-icon>queue</mat-icon>{{'DESCRIPTION-TEMPLATE-LISTING.ACTIONS.NEW-VERSION' | translate}}
|
||||||
</button>
|
</button>
|
||||||
<button mat-menu-item [routerLink]="['/description-templates/clone/', row.id]">
|
<button mat-menu-item [routerLink]="['/description-templates/clone/', row.id]">
|
||||||
|
@ -111,7 +111,7 @@
|
||||||
<button mat-menu-item (click)="export(row.id)" [routerLink]="['/description-templates/', row.id]">
|
<button mat-menu-item (click)="export(row.id)" [routerLink]="['/description-templates/', row.id]">
|
||||||
<mat-icon>download</mat-icon>{{'DESCRIPTION-TEMPLATE-LISTING.ACTIONS.DOWNLOAD-XML' | translate}}
|
<mat-icon>download</mat-icon>{{'DESCRIPTION-TEMPLATE-LISTING.ACTIONS.DOWNLOAD-XML' | translate}}
|
||||||
</button>
|
</button>
|
||||||
<button mat-menu-item (click)="delete(row.id)">
|
<button *ngIf="row.belongsToCurrentTenant != false" mat-menu-item (click)="delete(row.id)">
|
||||||
<mat-icon>delete</mat-icon>
|
<mat-icon>delete</mat-icon>
|
||||||
{{'DESCRIPTION-TEMPLATE-LISTING.ACTIONS.DELETE' | translate}}
|
{{'DESCRIPTION-TEMPLATE-LISTING.ACTIONS.DELETE' | translate}}
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -57,6 +57,7 @@ export class DescriptionTemplateListingComponent extends BaseListingComponent<De
|
||||||
nameof<DescriptionTemplate>(x => x.updatedAt),
|
nameof<DescriptionTemplate>(x => x.updatedAt),
|
||||||
nameof<DescriptionTemplate>(x => x.createdAt),
|
nameof<DescriptionTemplate>(x => x.createdAt),
|
||||||
nameof<DescriptionTemplate>(x => x.hash),
|
nameof<DescriptionTemplate>(x => x.hash),
|
||||||
|
nameof<DescriptionTemplate>(x => x.belongsToCurrentTenant),
|
||||||
nameof<DescriptionTemplate>(x => x.isActive)
|
nameof<DescriptionTemplate>(x => x.isActive)
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -40,15 +40,15 @@ export class DescriptionTemplateTypeEditorComponent extends BaseEditor<Descripti
|
||||||
|
|
||||||
|
|
||||||
protected get canDelete(): boolean {
|
protected get canDelete(): boolean {
|
||||||
return !this.isDeleted && !this.isNew && this.hasPermission(this.authService.permissionEnum.DeleteDescriptionTemplateType);
|
return !this.isDeleted && !this.isNew && this.hasPermission(this.authService.permissionEnum.DeleteDescriptionTemplateType) && this.editorModel.belongsToCurrentTenant != false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected get canSave(): boolean {
|
protected get canSave(): boolean {
|
||||||
return !this.isDeleted && this.hasPermission(this.authService.permissionEnum.EditDescriptionTemplateType);
|
return !this.isDeleted && this.hasPermission(this.authService.permissionEnum.EditDescriptionTemplateType) && this.editorModel.belongsToCurrentTenant != false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected get canFinalize(): boolean {
|
protected get canFinalize(): boolean {
|
||||||
return !this.isDeleted && this.hasPermission(this.authService.permissionEnum.EditDescriptionTemplateType);
|
return !this.isDeleted && this.hasPermission(this.authService.permissionEnum.EditDescriptionTemplateType) && this.editorModel.belongsToCurrentTenant != false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@ export class DescriptionTemplateTypeEditorModel extends BaseEditorModel implemen
|
||||||
|
|
||||||
public fromModel(item: DescriptionTemplateType): DescriptionTemplateTypeEditorModel {
|
public fromModel(item: DescriptionTemplateType): DescriptionTemplateTypeEditorModel {
|
||||||
if (item) {
|
if (item) {
|
||||||
|
super.fromModel(item);
|
||||||
this.id = item.id;
|
this.id = item.id;
|
||||||
this.name = item.name;
|
this.name = item.name;
|
||||||
this.status = item.status;
|
this.status = item.status;
|
||||||
|
|
|
@ -98,7 +98,7 @@
|
||||||
<button mat-menu-item [routerLink]="['/description-template-type/' + row.id]">
|
<button mat-menu-item [routerLink]="['/description-template-type/' + row.id]">
|
||||||
<mat-icon>edit</mat-icon>{{'DESCRIPTION-TEMPLATE-TYPE-LISTING.ACTIONS.EDIT' | translate}}
|
<mat-icon>edit</mat-icon>{{'DESCRIPTION-TEMPLATE-TYPE-LISTING.ACTIONS.EDIT' | translate}}
|
||||||
</button>
|
</button>
|
||||||
<button mat-menu-item (click)="deleteType(row.id)">
|
<button *ngIf="row.belongsToCurrentTenant != false" mat-menu-item (click)="deleteType(row.id)">
|
||||||
<mat-icon>delete</mat-icon>
|
<mat-icon>delete</mat-icon>
|
||||||
{{'DESCRIPTION-TEMPLATE-TYPE-LISTING.ACTIONS.DELETE' | translate}}
|
{{'DESCRIPTION-TEMPLATE-TYPE-LISTING.ACTIONS.DELETE' | translate}}
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -45,6 +45,7 @@ export class DescriptionTemplateTypeListingComponent extends BaseListingComponen
|
||||||
nameof<DescriptionTemplateType>(x => x.updatedAt),
|
nameof<DescriptionTemplateType>(x => x.updatedAt),
|
||||||
nameof<DescriptionTemplateType>(x => x.createdAt),
|
nameof<DescriptionTemplateType>(x => x.createdAt),
|
||||||
nameof<DescriptionTemplateType>(x => x.hash),
|
nameof<DescriptionTemplateType>(x => x.hash),
|
||||||
|
nameof<DescriptionTemplateType>(x => x.belongsToCurrentTenant),
|
||||||
nameof<DescriptionTemplateType>(x => x.isActive)
|
nameof<DescriptionTemplateType>(x => x.isActive)
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
{{formGroup.get('label').value}}
|
{{formGroup.get('label').value}}
|
||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-auto mb-md-0 col-12 mb-2" *ngIf="!isNew">
|
<div class="col-md-auto mb-md-0 col-12 mb-2" *ngIf="!isNew && this.editorModel.belongsToCurrentTenant != false">
|
||||||
<button [disabled]="isLocked" mat-button class="action-btn" type="button" (click)="delete()">
|
<button [disabled]="isLocked" mat-button class="action-btn" type="button" (click)="delete()">
|
||||||
<mat-icon>delete</mat-icon>
|
<mat-icon>delete</mat-icon>
|
||||||
{{'DMP-BLUEPRINT-EDITOR.ACTIONS.DELETE' | translate}}
|
{{'DMP-BLUEPRINT-EDITOR.ACTIONS.DELETE' | translate}}
|
||||||
|
|
|
@ -94,7 +94,7 @@
|
||||||
<button mat-menu-item [routerLink]="['/dmp-blueprints/', row.id]">
|
<button mat-menu-item [routerLink]="['/dmp-blueprints/', row.id]">
|
||||||
<mat-icon>edit</mat-icon>{{'DMP-BLUEPRINT-LISTING.ACTIONS.EDIT' | translate}}
|
<mat-icon>edit</mat-icon>{{'DMP-BLUEPRINT-LISTING.ACTIONS.EDIT' | translate}}
|
||||||
</button>
|
</button>
|
||||||
<button mat-menu-item [routerLink]="['/dmp-blueprints/new-version' , row.id]">
|
<button *ngIf="row.belongsToCurrentTenant != false" mat-menu-item [routerLink]="['/dmp-blueprints/new-version' , row.id]">
|
||||||
<mat-icon>queue</mat-icon>{{'DMP-BLUEPRINT-LISTING.ACTIONS.NEW-VERSION' | translate}}
|
<mat-icon>queue</mat-icon>{{'DMP-BLUEPRINT-LISTING.ACTIONS.NEW-VERSION' | translate}}
|
||||||
</button>
|
</button>
|
||||||
<button mat-menu-item [routerLink]="['/dmp-blueprints/clone' , row.id]">
|
<button mat-menu-item [routerLink]="['/dmp-blueprints/clone' , row.id]">
|
||||||
|
@ -107,7 +107,7 @@
|
||||||
<button mat-menu-item (click)="export(row.id)" [routerLink]="['/dmp-blueprints/', row.id]">
|
<button mat-menu-item (click)="export(row.id)" [routerLink]="['/dmp-blueprints/', row.id]">
|
||||||
<mat-icon>download</mat-icon>{{'DMP-BLUEPRINT-LISTING.ACTIONS.DOWNLOAD-XML' | translate}}
|
<mat-icon>download</mat-icon>{{'DMP-BLUEPRINT-LISTING.ACTIONS.DOWNLOAD-XML' | translate}}
|
||||||
</button>
|
</button>
|
||||||
<button mat-menu-item (click)="delete(row.id)">
|
<button *ngIf="row.belongsToCurrentTenant != false" mat-menu-item (click)="delete(row.id)">
|
||||||
<mat-icon>delete</mat-icon>
|
<mat-icon>delete</mat-icon>
|
||||||
{{'DMP-BLUEPRINT-LISTING.ACTIONS.DELETE' | translate}}
|
{{'DMP-BLUEPRINT-LISTING.ACTIONS.DELETE' | translate}}
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -56,7 +56,8 @@ export class DmpBlueprintListingComponent extends BaseListingComponent<DmpBluepr
|
||||||
nameof<DmpBlueprint>(x => x.updatedAt),
|
nameof<DmpBlueprint>(x => x.updatedAt),
|
||||||
nameof<DmpBlueprint>(x => x.createdAt),
|
nameof<DmpBlueprint>(x => x.createdAt),
|
||||||
nameof<DmpBlueprint>(x => x.hash),
|
nameof<DmpBlueprint>(x => x.hash),
|
||||||
nameof<DmpBlueprint>(x => x.isActive)
|
nameof<DmpBlueprint>(x => x.isActive),
|
||||||
|
nameof<DmpBlueprint>(x => x.belongsToCurrentTenant)
|
||||||
];
|
];
|
||||||
|
|
||||||
rowIdentity = x => x.id;
|
rowIdentity = x => x.id;
|
||||||
|
|
|
@ -75,12 +75,12 @@
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
||||||
<ng-template #actions let-row="row" let-item>
|
<ng-template #actions let-row="row" let-item>
|
||||||
<div class="row" (click)="$event.stopPropagation()">
|
<div *ngIf="row.belongsToCurrentTenant != false" class="row" (click)="$event.stopPropagation()">
|
||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
<button mat-icon-button [matMenuTriggerFor]="actionsMenu">
|
<button mat-icon-button [matMenuTriggerFor]="actionsMenu">
|
||||||
<mat-icon>more_horiz</mat-icon>
|
<mat-icon>more_horiz</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<mat-menu #actionsMenu="matMenu">
|
<mat-menu #actionsMenu="matMenu">
|
||||||
<button mat-menu-item (click)="deleteType(row.id, row.target)">
|
<button mat-menu-item (click)="deleteType(row.id, row.target)">
|
||||||
<mat-icon>delete</mat-icon>
|
<mat-icon>delete</mat-icon>
|
||||||
{{'LOCK-LISTING.ACTIONS.DELETE' | translate}}
|
{{'LOCK-LISTING.ACTIONS.DELETE' | translate}}
|
||||||
|
|
|
@ -43,6 +43,7 @@ export class LockListingComponent extends BaseListingComponent<Lock, LockLookup>
|
||||||
[nameof<Lock>(x => x.lockedBy), nameof<User>(x => x.name)].join('.'),
|
[nameof<Lock>(x => x.lockedBy), nameof<User>(x => x.name)].join('.'),
|
||||||
nameof<Lock>(x => x.lockedAt),
|
nameof<Lock>(x => x.lockedAt),
|
||||||
nameof<Lock>(x => x.touchedAt),
|
nameof<Lock>(x => x.touchedAt),
|
||||||
|
nameof<Lock>(x => x.belongsToCurrentTenant),
|
||||||
nameof<Lock>(x => x.hash),
|
nameof<Lock>(x => x.hash),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
<button mat-button class="action-btn" (click)="cancel()" type="button">{{'LANGUAGE-EDITOR.ACTIONS.CANCEL' | translate}}</button>
|
<button mat-button class="action-btn" (click)="cancel()" type="button">{{'LANGUAGE-EDITOR.ACTIONS.CANCEL' | translate}}</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto" *ngIf="!isNew">
|
<div class="col-auto" *ngIf="!isNew && this.editorModel.belongsToCurrentTenant != false">
|
||||||
<button mat-button class="action-btn" type="button" (click)="delete()">
|
<button mat-button class="action-btn" type="button" (click)="delete()">
|
||||||
<mat-icon>delete</mat-icon>
|
<mat-icon>delete</mat-icon>
|
||||||
{{'LANGUAGE-EDITOR.ACTIONS.DELETE' | translate}}
|
{{'LANGUAGE-EDITOR.ACTIONS.DELETE' | translate}}
|
||||||
|
@ -66,7 +66,7 @@
|
||||||
<mat-error *ngIf="formGroup.get('payload').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
<mat-error *ngIf="formGroup.get('payload').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<h9 class="col-12">{{'LANGUAGE-EDITOR.FIELDS.OVERRIDE' | translate}}
|
<h9 class="col-12">{{'LANGUAGE-EDITOR.FIELDS.OVERRIDE' | translate}}
|
||||||
<mat-checkbox (change)="overrideFromFile($event, formGroup.get('code').value)"></mat-checkbox>
|
<mat-checkbox [disabled]="this.editorModel.belongsToCurrentTenant == false" (change)="overrideFromFile($event, formGroup.get('code').value)"></mat-checkbox>
|
||||||
</h9>
|
</h9>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -53,7 +53,7 @@ export class LanguageEditorComponent extends BaseEditor<LanguageEditorModel, Lan
|
||||||
}
|
}
|
||||||
|
|
||||||
protected get canSave(): boolean {
|
protected get canSave(): boolean {
|
||||||
return !this.isDeleted && this.hasPermission(this.authService.permissionEnum.EditLanguage);
|
return !this.isDeleted && this.hasPermission(this.authService.permissionEnum.EditLanguage) && this.editorModel.belongsToCurrentTenant != false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected get canFinalize(): boolean {
|
protected get canFinalize(): boolean {
|
||||||
|
|
|
@ -86,7 +86,7 @@
|
||||||
<button mat-menu-item [routerLink]="['/language/' + row.id]">
|
<button mat-menu-item [routerLink]="['/language/' + row.id]">
|
||||||
<mat-icon>edit</mat-icon>{{'LANGUAGE-LISTING.ACTIONS.EDIT' | translate}}
|
<mat-icon>edit</mat-icon>{{'LANGUAGE-LISTING.ACTIONS.EDIT' | translate}}
|
||||||
</button>
|
</button>
|
||||||
<button mat-menu-item (click)="deleteType(row.id)">
|
<button *ngIf="row.belongsToCurrentTenant != false" mat-menu-item (click)="deleteType(row.id)">
|
||||||
<mat-icon>delete</mat-icon>
|
<mat-icon>delete</mat-icon>
|
||||||
{{'LANGUAGE-LISTING.ACTIONS.DELETE' | translate}}
|
{{'LANGUAGE-LISTING.ACTIONS.DELETE' | translate}}
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -42,6 +42,7 @@ export class LanguageListingComponent extends BaseListingComponent<Language, Lan
|
||||||
nameof<Language>(x => x.updatedAt),
|
nameof<Language>(x => x.updatedAt),
|
||||||
nameof<Language>(x => x.createdAt),
|
nameof<Language>(x => x.createdAt),
|
||||||
nameof<Language>(x => x.hash),
|
nameof<Language>(x => x.hash),
|
||||||
|
nameof<Language>(x => x.belongsToCurrentTenant),
|
||||||
nameof<Language>(x => x.isActive)
|
nameof<Language>(x => x.isActive)
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -45,11 +45,11 @@ export class PrefillingSourceEditorComponent extends BaseEditor<PrefillingSource
|
||||||
showInactiveDetails = false;
|
showInactiveDetails = false;
|
||||||
|
|
||||||
protected get canDelete(): boolean {
|
protected get canDelete(): boolean {
|
||||||
return !this.isDeleted && !this.isNew && this.hasPermission(this.authService.permissionEnum.DeletePrefillingSource);
|
return !this.isDeleted && !this.isNew && this.hasPermission(this.authService.permissionEnum.DeletePrefillingSource) && this.editorModel.belongsToCurrentTenant != false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected get canSave(): boolean {
|
protected get canSave(): boolean {
|
||||||
return !this.isDeleted && this.hasPermission(this.authService.permissionEnum.EditPrefillingSource);
|
return !this.isDeleted && this.hasPermission(this.authService.permissionEnum.EditPrefillingSource) && this.editorModel.belongsToCurrentTenant != false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private hasPermission(permission: AppPermission): boolean {
|
private hasPermission(permission: AppPermission): boolean {
|
||||||
|
|
|
@ -88,7 +88,7 @@
|
||||||
<button mat-menu-item [routerLink]="['/prefilling-sources/' + row.id]">
|
<button mat-menu-item [routerLink]="['/prefilling-sources/' + row.id]">
|
||||||
<mat-icon>edit</mat-icon>{{'PREFILLING-SOURCE-LISTING.ACTIONS.EDIT' | translate}}
|
<mat-icon>edit</mat-icon>{{'PREFILLING-SOURCE-LISTING.ACTIONS.EDIT' | translate}}
|
||||||
</button>
|
</button>
|
||||||
<button mat-menu-item (click)="deleteType(row.id)">
|
<button *ngIf="row.belongsToCurrentTenant != false" mat-menu-item (click)="deleteType(row.id)">
|
||||||
<mat-icon>delete</mat-icon>
|
<mat-icon>delete</mat-icon>
|
||||||
{{'PREFILLING-SOURCE-LISTING.ACTIONS.DELETE' | translate}}
|
{{'PREFILLING-SOURCE-LISTING.ACTIONS.DELETE' | translate}}
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -42,6 +42,7 @@ export class PrefillingSourceListingComponent extends BaseListingComponent<Prefi
|
||||||
nameof<PrefillingSource>(x => x.updatedAt),
|
nameof<PrefillingSource>(x => x.updatedAt),
|
||||||
nameof<PrefillingSource>(x => x.createdAt),
|
nameof<PrefillingSource>(x => x.createdAt),
|
||||||
nameof<PrefillingSource>(x => x.hash),
|
nameof<PrefillingSource>(x => x.hash),
|
||||||
|
nameof<PrefillingSource>(x => x.belongsToCurrentTenant),
|
||||||
nameof<PrefillingSource>(x => x.isActive)
|
nameof<PrefillingSource>(x => x.isActive)
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -53,11 +53,11 @@ export class ReferenceTypeEditorComponent extends BaseEditor<ReferenceTypeEditor
|
||||||
sourceKeysMap: Map<Guid, string[]> = new Map<Guid, string[]>();
|
sourceKeysMap: Map<Guid, string[]> = new Map<Guid, string[]>();
|
||||||
|
|
||||||
protected get canDelete(): boolean {
|
protected get canDelete(): boolean {
|
||||||
return !this.isDeleted && !this.isNew && this.hasPermission(this.authService.permissionEnum.DeleteReferenceType);
|
return !this.isDeleted && !this.isNew && this.hasPermission(this.authService.permissionEnum.DeleteReferenceType) && this.editorModel.belongsToCurrentTenant != false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected get canSave(): boolean {
|
protected get canSave(): boolean {
|
||||||
return !this.isDeleted && this.hasPermission(this.authService.permissionEnum.EditReferenceType);
|
return !this.isDeleted && this.hasPermission(this.authService.permissionEnum.EditReferenceType) && this.editorModel.belongsToCurrentTenant != false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected get canFinalize(): boolean {
|
protected get canFinalize(): boolean {
|
||||||
|
|
|
@ -21,6 +21,7 @@ export class ReferenceTypeEditorModel extends BaseEditorModel implements Referen
|
||||||
|
|
||||||
public fromModel(item: ReferenceType): ReferenceTypeEditorModel {
|
public fromModel(item: ReferenceType): ReferenceTypeEditorModel {
|
||||||
if (item) {
|
if (item) {
|
||||||
|
super.fromModel(item);
|
||||||
this.id = item.id;
|
this.id = item.id;
|
||||||
this.name = item.name;
|
this.name = item.name;
|
||||||
this.code = item.code;
|
this.code = item.code;
|
||||||
|
|
|
@ -101,7 +101,7 @@
|
||||||
<button mat-menu-item [routerLink]="['/reference-type/' + row.id]">
|
<button mat-menu-item [routerLink]="['/reference-type/' + row.id]">
|
||||||
<mat-icon>edit</mat-icon>{{'REFERENCE-TYPE-LISTING.ACTIONS.EDIT' | translate}}
|
<mat-icon>edit</mat-icon>{{'REFERENCE-TYPE-LISTING.ACTIONS.EDIT' | translate}}
|
||||||
</button>
|
</button>
|
||||||
<button mat-menu-item (click)="deleteType(row.id)">
|
<button *ngIf="row.belongsToCurrentTenant != false" mat-menu-item (click)="deleteType(row.id)">
|
||||||
<mat-icon>delete</mat-icon>
|
<mat-icon>delete</mat-icon>
|
||||||
{{'REFERENCE-TYPE-LISTING.ACTIONS.DELETE' | translate}}
|
{{'REFERENCE-TYPE-LISTING.ACTIONS.DELETE' | translate}}
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -43,6 +43,7 @@ export class ReferenceTypeListingComponent extends BaseListingComponent<Referenc
|
||||||
nameof<ReferenceType>(x => x.code),
|
nameof<ReferenceType>(x => x.code),
|
||||||
nameof<ReferenceType>(x => x.updatedAt),
|
nameof<ReferenceType>(x => x.updatedAt),
|
||||||
nameof<ReferenceType>(x => x.createdAt),
|
nameof<ReferenceType>(x => x.createdAt),
|
||||||
|
nameof<ReferenceType>(x => x.belongsToCurrentTenant),
|
||||||
nameof<ReferenceType>(x => x.isActive)
|
nameof<ReferenceType>(x => x.isActive)
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
<button mat-button class="action-btn" (click)="cancel()" type="button">{{'REFERENCE-EDITOR.ACTIONS.CANCEL' | translate}}</button>
|
<button mat-button class="action-btn" (click)="cancel()" type="button">{{'REFERENCE-EDITOR.ACTIONS.CANCEL' | translate}}</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto" *ngIf="!isNew">
|
<div class="col-auto" *ngIf="canDelete">
|
||||||
<button mat-button class="action-btn" type="button" (click)="delete()">
|
<button mat-button class="action-btn" type="button" (click)="delete()">
|
||||||
<mat-icon>delete</mat-icon>
|
<mat-icon>delete</mat-icon>
|
||||||
{{'REFERENCE-EDITOR.ACTIONS.DELETE' | translate}}
|
{{'REFERENCE-EDITOR.ACTIONS.DELETE' | translate}}
|
||||||
|
|
|
@ -50,11 +50,11 @@ export class ReferenceEditorComponent extends BaseEditor<ReferenceEditorModel, R
|
||||||
public referenceFieldDataTypeEnum = this.enumUtils.getEnumValues(ReferenceFieldDataType);
|
public referenceFieldDataTypeEnum = this.enumUtils.getEnumValues(ReferenceFieldDataType);
|
||||||
|
|
||||||
protected get canDelete(): boolean {
|
protected get canDelete(): boolean {
|
||||||
return !this.isDeleted && !this.isNew && this.hasPermission(this.authService.permissionEnum.DeleteReference);
|
return !this.isDeleted && !this.isNew && this.hasPermission(this.authService.permissionEnum.DeleteReference) && this.editorModel.belongsToCurrentTenant != false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected get canSave(): boolean {
|
protected get canSave(): boolean {
|
||||||
return !this.isDeleted && this.hasPermission(this.authService.permissionEnum.EditReference);
|
return !this.isDeleted && this.hasPermission(this.authService.permissionEnum.EditReference) && this.editorModel.belongsToCurrentTenant != false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected get canFinalize(): boolean {
|
protected get canFinalize(): boolean {
|
||||||
|
|
|
@ -110,7 +110,7 @@
|
||||||
<button mat-menu-item [routerLink]="['/tenant/' + row.id]">
|
<button mat-menu-item [routerLink]="['/tenant/' + row.id]">
|
||||||
<mat-icon>edit</mat-icon>{{'REFERENCE-LISTING.ACTIONS.EDIT' | translate}}
|
<mat-icon>edit</mat-icon>{{'REFERENCE-LISTING.ACTIONS.EDIT' | translate}}
|
||||||
</button>
|
</button>
|
||||||
<button mat-menu-item (click)="deleteType(row.id)">
|
<button *ngIf="row.belongsToCurrentTenant != false" mat-menu-item (click)="deleteType(row.id)">
|
||||||
<mat-icon>delete</mat-icon>
|
<mat-icon>delete</mat-icon>
|
||||||
{{'REFERENCE-LISTING.ACTIONS.DELETE' | translate}}
|
{{'REFERENCE-LISTING.ACTIONS.DELETE' | translate}}
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -46,6 +46,7 @@ export class ReferenceListingComponent extends BaseListingComponent<Reference, R
|
||||||
nameof<Reference>(x => x.updatedAt),
|
nameof<Reference>(x => x.updatedAt),
|
||||||
nameof<Reference>(x => x.createdAt),
|
nameof<Reference>(x => x.createdAt),
|
||||||
nameof<Reference>(x => x.hash),
|
nameof<Reference>(x => x.hash),
|
||||||
|
nameof<Reference>(x => x.belongsToCurrentTenant),
|
||||||
nameof<Reference>(x => x.isActive)
|
nameof<Reference>(x => x.isActive)
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -549,6 +549,9 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
|
||||||
}
|
}
|
||||||
this.isDeleted = data ? data.isActive === IsActive.Inactive : false;
|
this.isDeleted = data ? data.isActive === IsActive.Inactive : false;
|
||||||
this.buildForm();
|
this.buildForm();
|
||||||
|
if (this.formGroup && this.editorModel.belongsToCurrentTenant == false) {
|
||||||
|
this.formGroup.disable();
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.error('Could not parse Description item: ' + data + error);
|
this.logger.error('Could not parse Description item: ' + data + error);
|
||||||
this.uiNotificationService.snackBarNotification(this.language.instant('COMMONS.ERRORS.DEFAULT'), SnackBarNotificationLevel.Error);
|
this.uiNotificationService.snackBarNotification(this.language.instant('COMMONS.ERRORS.DEFAULT'), SnackBarNotificationLevel.Error);
|
||||||
|
|
Loading…
Reference in New Issue