remove required description from plan clone. new version
This commit is contained in:
parent
728f022a16
commit
6edefb3db9
|
@ -91,10 +91,7 @@ public class ClonePlanPersist {
|
||||||
.failOn(ClonePlanPersist._id).failWith(messageSource.getMessage("Validation_Required", new Object[]{ClonePlanPersist._id}, LocaleContextHolder.getLocale())),
|
.failOn(ClonePlanPersist._id).failWith(messageSource.getMessage("Validation_Required", new Object[]{ClonePlanPersist._id}, LocaleContextHolder.getLocale())),
|
||||||
this.spec()
|
this.spec()
|
||||||
.must(() -> !this.isEmpty(item.getLabel()))
|
.must(() -> !this.isEmpty(item.getLabel()))
|
||||||
.failOn(ClonePlanPersist._label).failWith(messageSource.getMessage("Validation_Required", new Object[]{ClonePlanPersist._label}, LocaleContextHolder.getLocale())),
|
.failOn(ClonePlanPersist._label).failWith(messageSource.getMessage("Validation_Required", new Object[]{ClonePlanPersist._label}, LocaleContextHolder.getLocale()))
|
||||||
this.spec()
|
|
||||||
.must(() -> !this.isEmpty(item.getDescription()))
|
|
||||||
.failOn(ClonePlanPersist._description).failWith(messageSource.getMessage("Validation_Required", new Object[]{ClonePlanPersist._description}, LocaleContextHolder.getLocale()))
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -123,9 +123,6 @@ public class NewVersionPlanPersist {
|
||||||
.iff(() -> !this.isEmpty(item.getLabel()))
|
.iff(() -> !this.isEmpty(item.getLabel()))
|
||||||
.must(() -> this.lessEqualLength(item.getLabel(), PlanEntity._labelLength))
|
.must(() -> this.lessEqualLength(item.getLabel(), PlanEntity._labelLength))
|
||||||
.failOn(NewVersionPlanPersist._label).failWith(this.messageSource.getMessage("Validation_MaxLength", new Object[]{NewVersionPlanPersist._label}, LocaleContextHolder.getLocale())),
|
.failOn(NewVersionPlanPersist._label).failWith(this.messageSource.getMessage("Validation_MaxLength", new Object[]{NewVersionPlanPersist._label}, LocaleContextHolder.getLocale())),
|
||||||
this.spec()
|
|
||||||
.must(() -> !this.isEmpty(item.getDescription()))
|
|
||||||
.failOn(NewVersionPlanPersist._description).failWith(this.messageSource.getMessage("Validation_Required", new Object[]{NewVersionPlanPersist._description}, LocaleContextHolder.getLocale())),
|
|
||||||
this.spec()
|
this.spec()
|
||||||
.must(() -> this.isValidGuid(item.getBlueprintId()))
|
.must(() -> this.isValidGuid(item.getBlueprintId()))
|
||||||
.failOn(NewVersionPlanPersist._blueprintId).failWith(this.messageSource.getMessage("Validation_Required", new Object[]{NewVersionPlanPersist._blueprintId}, LocaleContextHolder.getLocale())),
|
.failOn(NewVersionPlanPersist._blueprintId).failWith(this.messageSource.getMessage("Validation_Required", new Object[]{NewVersionPlanPersist._blueprintId}, LocaleContextHolder.getLocale())),
|
||||||
|
|
|
@ -584,7 +584,7 @@ public class PlanServiceImpl implements PlanService {
|
||||||
this.usageLimitService.checkIncrease(UsageLimitTargetMetric.DESCRIPTION_COUNT);
|
this.usageLimitService.checkIncrease(UsageLimitTargetMetric.DESCRIPTION_COUNT);
|
||||||
PlanEntity descriptionPlan = this.queryFactory.query(PlanQuery.class).disableTracking().ids(planId).isActive(IsActive.Active).first();
|
PlanEntity descriptionPlan = this.queryFactory.query(PlanQuery.class).disableTracking().ids(planId).isActive(IsActive.Active).first();
|
||||||
|
|
||||||
if (!descriptionPlan.getAccessType().equals(PlanAccessType.Public)) this.authorizationService.authorizeAtLeastOneForce(List.of(this.authorizationContentResolver.descriptionAffiliation(descriptionId)), Permission.CloneDescription);
|
if (descriptionPlan.getAccessType() != null && !descriptionPlan.getAccessType().equals(PlanAccessType.Public)) this.authorizationService.authorizeAtLeastOneForce(List.of(this.authorizationContentResolver.descriptionAffiliation(descriptionId)), Permission.CloneDescription);
|
||||||
else this.authorizationService.authorizeAtLeastOneForce(List.of(this.authorizationContentResolver.descriptionAffiliation(descriptionId)), Permission.PublicCloneDescription);
|
else this.authorizationService.authorizeAtLeastOneForce(List.of(this.authorizationContentResolver.descriptionAffiliation(descriptionId)), Permission.PublicCloneDescription);
|
||||||
|
|
||||||
DescriptionEntity existing = this.queryFactory.query(DescriptionQuery.class).disableTracking().ids(descriptionId).isActive(IsActive.Active).first();
|
DescriptionEntity existing = this.queryFactory.query(DescriptionQuery.class).disableTracking().ids(descriptionId).isActive(IsActive.Active).first();
|
||||||
|
@ -699,7 +699,7 @@ public class PlanServiceImpl implements PlanService {
|
||||||
if (!this.conventionService.isValidGuid(model.getId()) || existingPlanEntity == null)
|
if (!this.conventionService.isValidGuid(model.getId()) || existingPlanEntity == null)
|
||||||
throw new MyNotFoundException(this.messageSource.getMessage("General_ItemNotFound", new Object[]{model.getId(), Plan.class.getSimpleName()}, LocaleContextHolder.getLocale()));
|
throw new MyNotFoundException(this.messageSource.getMessage("General_ItemNotFound", new Object[]{model.getId(), Plan.class.getSimpleName()}, LocaleContextHolder.getLocale()));
|
||||||
|
|
||||||
if (!existingPlanEntity.getAccessType().equals(PlanAccessType.Public)) this.authorizationService.authorizeAtLeastOneForce(List.of(this.authorizationContentResolver.planAffiliation( model.getId())), Permission.ClonePlan);
|
if (existingPlanEntity.getAccessType() != null && !existingPlanEntity.getAccessType().equals(PlanAccessType.Public)) this.authorizationService.authorizeAtLeastOneForce(List.of(this.authorizationContentResolver.planAffiliation( model.getId())), Permission.ClonePlan);
|
||||||
else this.authorizationService.authorizeAtLeastOneForce(List.of(this.authorizationContentResolver.planAffiliation( model.getId())), Permission.PublicClonePlan);
|
else this.authorizationService.authorizeAtLeastOneForce(List.of(this.authorizationContentResolver.planAffiliation( model.getId())), Permission.PublicClonePlan);
|
||||||
|
|
||||||
PlanEntity newPlan = new PlanEntity();
|
PlanEntity newPlan = new PlanEntity();
|
||||||
|
|
|
@ -42,7 +42,7 @@ export class PlanCloneDialogEditorModel implements ClonePlanPersist {
|
||||||
const baseValidationArray: Validation[] = new Array<Validation>();
|
const baseValidationArray: Validation[] = new Array<Validation>();
|
||||||
baseValidationArray.push({ key: 'id', validators: [BackendErrorValidator(this.validationErrorModel, 'id')] });
|
baseValidationArray.push({ key: 'id', validators: [BackendErrorValidator(this.validationErrorModel, 'id')] });
|
||||||
baseValidationArray.push({ key: 'label', validators: [Validators.required, BackendErrorValidator(this.validationErrorModel, 'label')] });
|
baseValidationArray.push({ key: 'label', validators: [Validators.required, BackendErrorValidator(this.validationErrorModel, 'label')] });
|
||||||
baseValidationArray.push({ key: 'description', validators: [Validators.required, BackendErrorValidator(this.validationErrorModel, 'description')] });
|
baseValidationArray.push({ key: 'description', validators: [BackendErrorValidator(this.validationErrorModel, 'description')] });
|
||||||
baseValidationArray.push({ key: 'descriptions', validators: [BackendErrorValidator(this.validationErrorModel, 'descriptions')] });
|
baseValidationArray.push({ key: 'descriptions', validators: [BackendErrorValidator(this.validationErrorModel, 'descriptions')] });
|
||||||
baseContext.validation = baseValidationArray;
|
baseContext.validation = baseValidationArray;
|
||||||
return baseContext;
|
return baseContext;
|
||||||
|
|
|
@ -76,7 +76,7 @@ export class PlanNewVersionDialogEditorModel implements NewVersionPlanPersist {
|
||||||
const baseValidationArray: Validation[] = new Array<Validation>();
|
const baseValidationArray: Validation[] = new Array<Validation>();
|
||||||
baseValidationArray.push({ key: 'id', validators: [BackendErrorValidator(this.validationErrorModel, 'id')] });
|
baseValidationArray.push({ key: 'id', validators: [BackendErrorValidator(this.validationErrorModel, 'id')] });
|
||||||
baseValidationArray.push({ key: 'label', validators: [Validators.required, BackendErrorValidator(this.validationErrorModel, 'label')] });
|
baseValidationArray.push({ key: 'label', validators: [Validators.required, BackendErrorValidator(this.validationErrorModel, 'label')] });
|
||||||
baseValidationArray.push({ key: 'description', validators: [Validators.required, BackendErrorValidator(this.validationErrorModel, 'description')] });
|
baseValidationArray.push({ key: 'description', validators: [BackendErrorValidator(this.validationErrorModel, 'description')] });
|
||||||
baseValidationArray.push({ key: 'blueprintId', validators: [Validators.required, BackendErrorValidator(this.validationErrorModel, 'blueprintId')] });
|
baseValidationArray.push({ key: 'blueprintId', validators: [Validators.required, BackendErrorValidator(this.validationErrorModel, 'blueprintId')] });
|
||||||
baseValidationArray.push({ key: 'descriptions', validators: [BackendErrorValidator(this.validationErrorModel, 'descriptions')] });
|
baseValidationArray.push({ key: 'descriptions', validators: [BackendErrorValidator(this.validationErrorModel, 'descriptions')] });
|
||||||
baseValidationArray.push({ key: 'hash', validators: [] });
|
baseValidationArray.push({ key: 'hash', validators: [] });
|
||||||
|
|
Loading…
Reference in New Issue