This commit is contained in:
CITE\spapacharalampous 2024-07-18 17:59:45 +03:00
parent f68c79fc21
commit b9e5e07cc6
2 changed files with 2 additions and 7 deletions

View File

@ -2,7 +2,6 @@ import { Injectable } from '@angular/core';
import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
import { Description, DescriptionSectionPermissionResolver } from '@app/core/model/description/description';
import { DescriptionService } from '@app/core/services/description/description.service';
import { BreadcrumbService } from '@app/ui/misc/breadcrumb/breadcrumb.service';
import { BaseEditorResolver } from '@common/base/base-editor.resolver';
import { Guid } from '@common/types/guid';
import { mergeMap, takeUntil, tap } from 'rxjs/operators';
@ -15,7 +14,6 @@ export class DescriptionEditorPermissionsResolver extends BaseEditorResolver {
constructor(
private descriptionService: DescriptionService,
private breadcrumbService: BreadcrumbService,
) {
super();
}
@ -39,8 +37,8 @@ export class DescriptionEditorPermissionsResolver extends BaseEditorResolver {
const copyPlanId = route.paramMap.get('copyPlanId');
// const cloneid = route.paramMap.get('cloneid');
if (id != null && copyPlanId == null && planSectionId == null) {
return this.descriptionService.getSingle(Guid.parse(id), fields).pipe(tap(d => this.breadcrumbService.addIdResolvedValue(d.id.toString(), d.label)))
.pipe(mergeMap(description => {
return this.descriptionService.getSingle(Guid.parse(id), fields)
.pipe(mergeMap(description => {
const descriptionSectionPermissionResolverModel: DescriptionSectionPermissionResolver = {
planId: description.plan.id,
sectionIds: [description.planDescriptionTemplate.sectionId],

View File

@ -4,7 +4,6 @@ import { AppPermission } from '@app/core/common/enum/permission.enum';
import { DescriptionSectionPermissionResolver } from '@app/core/model/description/description';
import { DescriptionService } from '@app/core/services/description/description.service';
import { PlanService } from '@app/core/services/plan/plan.service';
import { BreadcrumbService } from '@app/ui/misc/breadcrumb/breadcrumb.service';
import { BaseEditorResolver } from '@common/base/base-editor.resolver';
import { Guid } from '@common/types/guid';
import { mergeMap, takeUntil, tap } from 'rxjs/operators';
@ -16,7 +15,6 @@ import { PlanBlueprint, PlanBlueprintDefinition, PlanBlueprintDefinitionSection
export class PlanEditorPermissionsResolver extends BaseEditorResolver {
constructor(private planService: PlanService,
private breadcrumbService: BreadcrumbService,
private descriptionService: DescriptionService,
) {
super();
@ -38,7 +36,6 @@ export class PlanEditorPermissionsResolver extends BaseEditorResolver {
if (id != null) {
return this.planService
.getSingle(Guid.parse(id), fields)
.pipe(tap(x => this.breadcrumbService.addIdResolvedValue(id, x.label)), takeUntil(this._destroyed))
.pipe(mergeMap( data => {
let descriptionSectionPermissionResolverModel: DescriptionSectionPermissionResolver = {
planId: data.id,