Skip to content

Commit 592a172

Browse files
committed
fix draft project button for program project
1 parent 12b69a5 commit 592a172

2 files changed

Lines changed: 31 additions & 7 deletions

File tree

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
<!-- @format -->
22

3-
<mat-progress-bar *ngIf="isLoading$ | async" class="loader" mode="query"></mat-progress-bar>
3+
<mat-progress-bar
4+
[style.display]="(isLoading$ | async) ? 'block' : 'none'"
5+
class="loader"
6+
mode="query"
7+
>
8+
</mat-progress-bar>
49
<router-outlet></router-outlet>

projects/social_platform/src/app/office/projects/edit/edit.component.ts

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,14 @@ import { ProjectAssign } from "../models/project-assign.model";
9191
ProjectAdditionalStepComponent,
9292
ProjectPartnerResourcesStepComponent,
9393
],
94+
providers: [
95+
ProjectFormService,
96+
ProjectVacancyService,
97+
ProjectAdditionalService,
98+
ProjectGoalService,
99+
ProjectPartnerService,
100+
ProjectResourceService,
101+
],
94102
})
95103
export class ProjectEditComponent implements OnInit, AfterViewInit, OnDestroy {
96104
constructor(
@@ -401,6 +409,8 @@ export class ProjectEditComponent implements OnInit, AfterViewInit, OnDestroy {
401409
* Отправка формы проекта
402410
*/
403411
submitProjectForm(): void {
412+
const isDraft = this.projectForm.get("draft")?.value === true;
413+
404414
this.projectFormService.achievements.controls.forEach(achievementForm => {
405415
achievementForm.markAllAsTouched();
406416
});
@@ -412,12 +422,21 @@ export class ProjectEditComponent implements OnInit, AfterViewInit, OnDestroy {
412422
this.projectVacancyService.submitVacancy(projectId);
413423
}
414424

415-
if (
416-
!this.validationService.getFormValidation(this.projectForm) ||
417-
!this.validationService.getFormValidation(this.additionalForm) ||
418-
!this.validationService.getFormValidation(this.vacancyForm)
419-
) {
420-
return;
425+
if (isDraft) {
426+
if (
427+
!this.validationService.getFormValidation(this.projectForm) ||
428+
!this.validationService.getFormValidation(this.vacancyForm)
429+
) {
430+
return;
431+
}
432+
} else {
433+
if (
434+
!this.validationService.getFormValidation(this.projectForm) ||
435+
!this.validationService.getFormValidation(this.additionalForm) ||
436+
!this.validationService.getFormValidation(this.vacancyForm)
437+
) {
438+
return;
439+
}
421440
}
422441

423442
this.setProjFormIsSubmitting(true);

0 commit comments

Comments
 (0)