@@ -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} )
95103export 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