From bc82bf4ec2aa171e5495628ac34247f6cda30c55 Mon Sep 17 00:00:00 2001 From: patskal Date: Thu, 25 May 2023 12:29:33 +0300 Subject: [PATCH 1/3] Fixed referencing a property by undefined --- src/app/header/header.component.html | 25 ++++--------- .../sidenav-menu/sidenav-menu.component.html | 36 ++++++------------- 2 files changed, 17 insertions(+), 44 deletions(-) diff --git a/src/app/header/header.component.html b/src/app/header/header.component.html index 684426d5b6..d56d9bf2df 100644 --- a/src/app/header/header.component.html +++ b/src/app/header/header.component.html @@ -1,9 +1,7 @@
-
+
@@ -63,7 +60,7 @@

{{ headerSubtitle }}

- + @@ -88,9 +84,7 @@

{{ headerSubtitle }}

- + - + @@ -128,10 +120,7 @@

{{ headerSubtitle }}

{{ 'ENUM.NAV_BAR_NAME.PERSONAL_INFORMATION' | translate }}
- + diff --git a/src/app/shared/components/sidenav-menu/sidenav-menu.component.html b/src/app/shared/components/sidenav-menu/sidenav-menu.component.html index e5725428cc..60096a26b2 100644 --- a/src/app/shared/components/sidenav-menu/sidenav-menu.component.html +++ b/src/app/shared/components/sidenav-menu/sidenav-menu.component.html @@ -26,7 +26,7 @@
-
+
@@ -35,12 +35,7 @@
-
+
{{ 'ENUM.NAV_BAR_NAME.PERSONAL_INFORMATION' | translate @@ -48,30 +43,22 @@ {{ 'ENUM.NAV_BAR_NAME.INFORMATION_ABOUT' | translate }} {{ RoleLinks[user.role] | translate }} - {{ 'ENUM.NAV_BAR_NAME.MY_WORKSHOPS' | translate }} + {{ + 'ENUM.NAV_BAR_NAME.MY_WORKSHOPS' | translate + }} {{ 'ENUM.NAV_BAR_NAME.APPLICATIONS' | translate }} - {{ - 'ENUM.NAV_BAR_NAME.MESSAGES' | translate - }} + {{ 'ENUM.NAV_BAR_NAME.MESSAGES' | translate }} {{ 'ENUM.NAV_BAR_NAME.ADMINISTRATION' | translate }} - {{ 'ENUM.NAV_BAR_NAME.FAVORITE' | translate }} + {{ + 'ENUM.NAV_BAR_NAME.FAVORITE' | translate + }} {{ @@ -84,10 +71,7 @@ (click)="changeView()"> {{ 'ENUM.NAV_BAR_NAME.ADMINISTRATION' | translate }} - + {{ 'ENUM.NAV_BAR_NAME.ADMINISTRATION' | translate }} From f5687e48600bfa51624772a80b2ba50c52214891 Mon Sep 17 00:00:00 2001 From: patskal Date: Thu, 25 May 2023 13:19:50 +0300 Subject: [PATCH 2/3] Changed the connection logic of the images feature * The condition for connecting images feature has been changed: there is now a separate "images" flag for this instead of isRelease3 --- .../services/provider/provider.service.ts | 20 +++++---- .../user-workshop/user-workshop.service.ts | 14 +++--- src/app/shared/store/provider.actions.ts | 4 +- src/app/shared/store/provider.state.ts | 8 ++-- .../create-info-form.component.html | 2 +- .../create-info-form.component.ts | 18 +++++--- .../create-photo-form.component.html | 2 +- .../create-photo-form.component.ts | 2 +- .../create-provider.component.html | 15 ++----- .../create-provider.component.spec.ts | 17 ++++---- .../create-provider.component.ts | 43 +++++++++++-------- .../create-about-form.component.html | 41 ++++++------------ .../create-about-form.component.ts | 16 ++++--- .../create-description-form.component.html | 23 ++++------ .../create-description-form.component.ts | 10 +++-- .../create-teacher.component.html | 5 +-- .../create-teacher.component.spec.ts | 13 +++--- .../create-teacher.component.ts | 11 +++-- .../teacher-form/teacher-form.component.html | 32 +++++--------- .../teacher-form/teacher-form.component.ts | 6 +-- .../create-workshop.component.html | 19 +++----- .../create-workshop.component.spec.ts | 21 ++++----- .../create-form/create-form.component.ts | 22 +++++----- 23 files changed, 179 insertions(+), 185 deletions(-) diff --git a/src/app/shared/services/provider/provider.service.ts b/src/app/shared/services/provider/provider.service.ts index 8f4b0e4167..b931583327 100644 --- a/src/app/shared/services/provider/provider.service.ts +++ b/src/app/shared/services/provider/provider.service.ts @@ -1,11 +1,15 @@ -import { PaginationElement } from './../../models/paginationElement.model'; +import { Observable } from 'rxjs'; + import { HttpClient, HttpParams } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Store } from '@ngxs/store'; -import { Observable } from 'rxjs'; -import { BlockProviderData, LicenseStatusData, Provider, ProviderParameters, ProviderStatusUpdateData } from '../../models/provider.model'; -import { SearchResponse } from '../../models/search.model'; + import { DataItem } from '../../models/item.model'; +import { PaginationElement } from '../../models/paginationElement.model'; +import { + BlockProviderData, LicenseStatusData, Provider, ProviderParameters, ProviderStatusUpdateData +} from '../../models/provider.model'; +import { SearchResponse } from '../../models/search.model'; @Injectable({ providedIn: 'root' @@ -47,8 +51,8 @@ export class ProviderService { * This method create Provider * @param Provider */ - createProvider(provider: Provider, isRelease3: boolean): Observable { - return isRelease3 ? this.createProviderV2(provider) : this.createProviderV1(provider); + createProvider(provider: Provider, isImagesFeature: boolean): Observable { + return isImagesFeature ? this.createProviderV2(provider) : this.createProviderV1(provider); } createProviderV1(provider: Provider): Observable { @@ -71,8 +75,8 @@ export class ProviderService { * This method update Provider * @param Provider */ - updateProvider(provider: Provider, isRelease3: boolean): Observable { - return isRelease3 ? this.updateProviderV2(provider) : this.updateProviderV1(provider); + updateProvider(provider: Provider, isImagesFeature: boolean): Observable { + return isImagesFeature ? this.updateProviderV2(provider) : this.updateProviderV1(provider); } updateProviderV1(provider: Provider): Observable { diff --git a/src/app/shared/services/workshops/user-workshop/user-workshop.service.ts b/src/app/shared/services/workshops/user-workshop/user-workshop.service.ts index 32b9771c24..26ce836aba 100644 --- a/src/app/shared/services/workshops/user-workshop/user-workshop.service.ts +++ b/src/app/shared/services/workshops/user-workshop/user-workshop.service.ts @@ -10,14 +10,16 @@ import { FeaturesList } from '../../../models/featuresList.model'; import { TruncatedItem } from '../../../models/item.model'; import { PaginationElement } from '../../../models/paginationElement.model'; import { SearchResponse } from '../../../models/search.model'; -import { ProviderWorkshopCard, Workshop, WorkshopCard, WorkshopCardParameters, WorkshopStatus } from '../../../models/workshop.model'; +import { + ProviderWorkshopCard, Workshop, WorkshopCard, WorkshopCardParameters, WorkshopStatus +} from '../../../models/workshop.model'; import { MetaDataState } from '../../../store/meta-data.state'; @Injectable({ providedIn: 'root' }) export class UserWorkshopService { - private isRelease3: boolean; + private isImagesFeature: boolean; constructor(private http: HttpClient, private store: Store) {} @@ -78,8 +80,8 @@ export class UserWorkshopService { * @param workshop: Workshop */ public createWorkshop(workshop: Workshop): Observable { - this.isRelease3 = this.store.selectSnapshot(MetaDataState.featuresList).release3; - return this.isRelease3 ? this.createWorkshopV2(workshop) : this.createWorkshopV1(workshop); + this.isImagesFeature = this.store.selectSnapshot(MetaDataState.featuresList).images; + return this.isImagesFeature ? this.createWorkshopV2(workshop) : this.createWorkshopV1(workshop); } public createWorkshopV1(workshop: Workshop): Observable { @@ -96,8 +98,8 @@ export class UserWorkshopService { * @param workshop: Workshop */ public updateWorkshop(workshop: Workshop): Observable { - this.isRelease3 = this.store.selectSnapshot(MetaDataState.featuresList).release2; - return this.isRelease3 ? this.updateWorkshopV2(workshop) : this.updateWorkshopV1(workshop); + this.isImagesFeature = this.store.selectSnapshot(MetaDataState.featuresList).images; + return this.isImagesFeature ? this.updateWorkshopV2(workshop) : this.updateWorkshopV1(workshop); } public updateWorkshopV1(workshop: Workshop): Observable { diff --git a/src/app/shared/store/provider.actions.ts b/src/app/shared/store/provider.actions.ts index ab361acef6..f104ec999d 100644 --- a/src/app/shared/store/provider.actions.ts +++ b/src/app/shared/store/provider.actions.ts @@ -144,7 +144,7 @@ export class OnDeleteWorkshopFail { export class CreateProvider { static readonly type = '[provider] create Provider'; - constructor(public payload: Provider, public isRelease3: boolean) {} + constructor(public payload: Provider, public isImagesFeature: boolean) {} } export class OnCreateProviderFail { @@ -159,7 +159,7 @@ export class OnCreateProviderSuccess { export class UpdateProvider { static readonly type = '[provider] update Provider'; - constructor(public payload: Provider, public isRelease3: boolean) {} + constructor(public payload: Provider, public isImagesFeature: boolean) {} } export class OnUpdateProviderFail { diff --git a/src/app/shared/store/provider.state.ts b/src/app/shared/store/provider.state.ts index 45b1ab076f..41849c0ee9 100644 --- a/src/app/shared/store/provider.state.ts +++ b/src/app/shared/store/provider.state.ts @@ -382,9 +382,9 @@ export class ProviderState { @Action(CreateProvider) createProvider( { dispatch }: StateContext, - { payload, isRelease3 }: CreateProvider + { payload, isImagesFeature }: CreateProvider ): Observable> { - return this.providerService.createProvider(payload, isRelease3).pipe( + return this.providerService.createProvider(payload, isImagesFeature).pipe( tap((res: Provider) => dispatch(new OnCreateProviderSuccess(res))), catchError((error) => of(dispatch(new OnCreateProviderFail(error)))) ); @@ -414,9 +414,9 @@ export class ProviderState { @Action(UpdateProvider) updateProvider( { dispatch }: StateContext, - { payload, isRelease3 }: UpdateProvider + { payload, isImagesFeature }: UpdateProvider ): Observable> { - return this.providerService.updateProvider(payload, isRelease3).pipe( + return this.providerService.updateProvider(payload, isImagesFeature).pipe( tap(() => dispatch(new OnUpdateProviderSuccess())), catchError((error: HttpErrorResponse) => of(dispatch(new OnUpdateProviderFail(error)))) ); diff --git a/src/app/shell/personal-cabinet/provider/create-provider/create-info-form/create-info-form.component.html b/src/app/shell/personal-cabinet/provider/create-provider/create-info-form/create-info-form.component.html index 240d641ed1..9cdbc929a6 100644 --- a/src/app/shell/personal-cabinet/provider/create-provider/create-info-form/create-info-form.component.html +++ b/src/app/shell/personal-cabinet/provider/create-provider/create-info-form/create-info-form.component.html @@ -1,6 +1,6 @@
; @Input() public provider: Provider; - @Input() public isRelease3: boolean; + @Input() public isImagesFeature: boolean; @Output() public passInfoFormGroup = new EventEmitter(); diff --git a/src/app/shell/personal-cabinet/provider/create-provider/create-photo-form/create-photo-form.component.html b/src/app/shell/personal-cabinet/provider/create-provider/create-photo-form/create-photo-form.component.html index b4e819c9d1..03458f44f0 100644 --- a/src/app/shell/personal-cabinet/provider/create-provider/create-photo-form/create-photo-form.component.html +++ b/src/app/shell/personal-cabinet/provider/create-provider/create-photo-form/create-photo-form.component.html @@ -1,6 +1,6 @@

{{ 'TITLES.ABOUT_THE_PROVIDER_INFO' | translate }}

@@ -21,12 +21,7 @@

-

@@ -62,7 +57,7 @@

{{ 'TITLES.DESCRIPTION' | translate }}

@@ -85,9 +80,7 @@

mat-button type="submit" (click)="onSubmit()" - [disabled]=" - !isAgreed || !isNotRobot || PhotoFormGroup.invalid || ContactsFormGroup.invalid || InfoFormGroup.invalid - "> + [disabled]="!isAgreed || !isNotRobot || PhotoFormGroup.invalid || ContactsFormGroup.invalid || InfoFormGroup.invalid"> {{ 'BUTTONS.SAVE' | translate }}

diff --git a/src/app/shell/personal-cabinet/provider/create-provider/create-provider.component.spec.ts b/src/app/shell/personal-cabinet/provider/create-provider/create-provider.component.spec.ts index fc5c108071..5755dc7312 100644 --- a/src/app/shell/personal-cabinet/provider/create-provider/create-provider.component.spec.ts +++ b/src/app/shell/personal-cabinet/provider/create-provider/create-provider.component.spec.ts @@ -1,14 +1,15 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { CreateProviderComponent } from './create-provider.component'; import { Component, Input } from '@angular/core'; +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { FormBuilder, FormControl, ReactiveFormsModule } from '@angular/forms'; +import { MatCheckboxModule } from '@angular/material/checkbox'; +import { MatDialogModule } from '@angular/material/dialog'; import { MatStepperModule } from '@angular/material/stepper'; -import { RouterTestingModule } from '@angular/router/testing'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { RouterTestingModule } from '@angular/router/testing'; import { NgxsModule } from '@ngxs/store'; -import { MatCheckboxModule } from '@angular/material/checkbox'; -import { FormBuilder, FormControl, ReactiveFormsModule } from '@angular/forms'; -import { MatDialogModule } from '@angular/material/dialog'; + import { Provider } from '../../../../shared/models/provider.model'; +import { CreateProviderComponent } from './create-provider.component'; fdescribe('CreateProviderComponent', () => { let component: CreateProviderComponent; @@ -68,7 +69,7 @@ class MockCreateContactsFormComponent { class MockCreateInfoComponent { @Input() provider: Provider; @Input() InfoFormGroup; - @Input() isRelease3: boolean; + @Input() isImagesFeature: boolean; } @Component({ @@ -77,5 +78,5 @@ class MockCreateInfoComponent { }) class MockCreatePhotoFormComponent { @Input() provider: Provider; - @Input() isRelease3: boolean; + @Input() isImagesFeature: boolean; } diff --git a/src/app/shell/personal-cabinet/provider/create-provider/create-provider.component.ts b/src/app/shell/personal-cabinet/provider/create-provider/create-provider.component.ts index 2a7396e113..916dec6b5a 100644 --- a/src/app/shell/personal-cabinet/provider/create-provider/create-provider.component.ts +++ b/src/app/shell/personal-cabinet/provider/create-provider/create-provider.component.ts @@ -1,5 +1,20 @@ -import { ConfirmationModalWindowComponent } from '../../../../shared/components/confirmation-modal-window/confirmation-modal-window.component'; +import { takeUntil } from 'rxjs/operators'; + +import { STEPPER_GLOBAL_OPTIONS } from '@angular/cdk/stepper'; +import { + AfterViewChecked, AfterViewInit, ChangeDetectorRef, Component, OnDestroy, OnInit, ViewChild +} from '@angular/core'; +import { FormControl, FormGroup } from '@angular/forms'; +import { MatDialog } from '@angular/material/dialog'; +import { MatStepper } from '@angular/material/stepper'; +import { ActivatedRoute, Params, Router } from '@angular/router'; +import { Store } from '@ngxs/store'; + +import { + ConfirmationModalWindowComponent +} from '../../../../shared/components/confirmation-modal-window/confirmation-modal-window.component'; import { Constants } from '../../../../shared/constants/constants'; +import { NavBarName } from '../../../../shared/enum/enumUA/navigation-bar'; import { ModalConfirmationType } from '../../../../shared/enum/modal-confirmation'; import { CreateProviderSteps } from '../../../../shared/enum/provider'; import { Role } from '../../../../shared/enum/role'; @@ -7,23 +22,16 @@ import { Address } from '../../../../shared/models/address.model'; import { FeaturesList } from '../../../../shared/models/featuresList.model'; import { Provider } from '../../../../shared/models/provider.model'; import { User } from '../../../../shared/models/user.model'; -import { NavigationBarService } from '../../../../shared/services/navigation-bar/navigation-bar.service'; +import { + NavigationBarService +} from '../../../../shared/services/navigation-bar/navigation-bar.service'; import { MetaDataState } from '../../../../shared/store/meta-data.state'; import { AddNavPath } from '../../../../shared/store/navigation.actions'; +import { CreateProvider, UpdateProvider } from '../../../../shared/store/provider.actions'; +import { Logout } from '../../../../shared/store/registration.actions'; import { RegistrationState } from '../../../../shared/store/registration.state'; import { Util } from '../../../../shared/utils/utils'; -import { Logout } from './../../../../shared/store/registration.actions'; -import { STEPPER_GLOBAL_OPTIONS } from '@angular/cdk/stepper'; -import { AfterViewInit, Component, OnInit, ViewChild, OnDestroy, AfterViewChecked, ChangeDetectorRef } from '@angular/core'; -import { FormGroup, FormControl } from '@angular/forms'; -import { MatStepper } from '@angular/material/stepper'; -import { ActivatedRoute, Params, Router } from '@angular/router'; -import { Store } from '@ngxs/store'; -import { takeUntil } from 'rxjs/operators'; -import { NavBarName } from '../../../../shared/enum/enumUA/navigation-bar'; import { CreateFormComponent } from '../../shared-cabinet/create-form/create-form.component'; -import { MatDialog } from '@angular/material/dialog'; -import { CreateProvider, UpdateProvider } from '../../../../shared/store/provider.actions'; @Component({ selector: 'app-create-provider', @@ -49,6 +57,7 @@ export class CreateProviderComponent extends CreateFormComponent implements OnIn ContactsFormGroup: FormGroup = new FormGroup({}); RobotFormControl = new FormControl(false); AgreementFormControl = new FormControl(false); + isImagesFeature: boolean; @ViewChild('stepper') stepper: MatStepper; @@ -78,7 +87,7 @@ export class CreateProviderComponent extends CreateFormComponent implements OnIn }); } } - + ngAfterViewChecked(): void { this.changeDetector.detectChanges(); } @@ -113,7 +122,7 @@ export class CreateProviderComponent extends CreateFormComponent implements OnIn this.checkValidation(this.PhotoFormGroup); } else { const user: User = this.store.selectSnapshot(RegistrationState.user); - const isRelease3 = this.store.selectSnapshot(MetaDataState.featuresList).release3; + this.isImagesFeature = this.store.selectSnapshot(MetaDataState.featuresList).images; let legalAddress: Address; let actulaAdress: Address; let provider: Provider; @@ -124,12 +133,12 @@ export class CreateProviderComponent extends CreateFormComponent implements OnIn ? null : new Address(this.ActualAddressFormGroup.value, this.provider.actualAddress); provider = new Provider(this.InfoFormGroup.value, legalAddress, actulaAdress, this.PhotoFormGroup.value, user, this.provider); - this.store.dispatch(new UpdateProvider(provider, isRelease3)); + this.store.dispatch(new UpdateProvider(provider, this.isImagesFeature)); } else { legalAddress = new Address(this.LegalAddressFormGroup.value); actulaAdress = this.ActualAddressFormGroup.disabled ? null : new Address(this.ActualAddressFormGroup.value); provider = new Provider(this.InfoFormGroup.value, legalAddress, actulaAdress, this.PhotoFormGroup.value, user); - this.store.dispatch(new CreateProvider(provider, isRelease3)); + this.store.dispatch(new CreateProvider(provider, this.isImagesFeature)); } } } diff --git a/src/app/shell/personal-cabinet/provider/create-workshop/create-about-form/create-about-form.component.html b/src/app/shell/personal-cabinet/provider/create-workshop/create-about-form/create-about-form.component.html index 809c989d7a..3aaf37a560 100644 --- a/src/app/shell/personal-cabinet/provider/create-workshop/create-about-form/create-about-form.component.html +++ b/src/app/shell/personal-cabinet/provider/create-workshop/create-about-form/create-about-form.component.html @@ -4,13 +4,12 @@ + [imageIdsFormControl]="AboutFormGroup.get('coverImageId')"> @@ -19,8 +18,7 @@ + [maxCharachters]="validationConstants.INPUT_LENGTH_60"> @@ -36,15 +34,13 @@ appTrimValue ui-number-mask ui-hide-group-sep - maxlength="{{ validationConstants.PHONE_LENGTH }}" - /> + maxlength="{{ validationConstants.PHONE_LENGTH }}" />
+ [isPhoneNumber]="true"> @@ -60,8 +56,7 @@ + [maxCharachters]="validationConstants.INPUT_LENGTH_256"> @@ -71,8 +66,7 @@ + [maxCharachters]="validationConstants.INPUT_LENGTH_256"> @@ -82,8 +76,7 @@ + [maxCharachters]="validationConstants.INPUT_LENGTH_256">
@@ -105,8 +98,7 @@ [directiveFormControl]="AboutFormGroup.get('minAge')" [min]="validationConstants.AGE_MIN" [max]="AboutFormGroup.get('maxAge').value ? AboutFormGroup.get('maxAge').value - 1 : validationConstants.AGE_MAX" - autocomplete="none" - /> + autocomplete="none" />
@@ -126,8 +118,7 @@ [directiveFormControl]="AboutFormGroup.get('maxAge')" appMinMax [min]="AboutFormGroup.get('minAge').value ? AboutFormGroup.get('minAge').value + 1 : validationConstants.AGE_MIN" - autocomplete="none" - /> + autocomplete="none" />
@@ -152,8 +143,7 @@ type="number" [directiveFormControl]="priceControl" [min]="validationConstants.MIN_PRICE" - [max]="validationConstants.MAX_PRICE" - /> + [max]="validationConstants.MAX_PRICE" />
@@ -164,8 +154,7 @@ class="step-input" formControlName="payRate" name="payRate" - placeholder="{{ 'FORMS.PLACEHOLDERS.PAYMENT_TYPE' | translate }}" - > + placeholder="{{ 'FORMS.PLACEHOLDERS.PAYMENT_TYPE' | translate }}"> {{ PayRateTypeEnum[type.key] | translate }} @@ -206,13 +195,11 @@ type="number" [directiveFormControl]="availableSeatsControl" [min]="MIN_SEATS" - [max]="UNLIMITED_SEATS" - /> + [max]="UNLIMITED_SEATS" />
- - + diff --git a/src/app/shell/personal-cabinet/provider/create-workshop/create-about-form/create-about-form.component.ts b/src/app/shell/personal-cabinet/provider/create-workshop/create-about-form/create-about-form.component.ts index 1630274fc2..a7ed7480e6 100644 --- a/src/app/shell/personal-cabinet/provider/create-workshop/create-about-form/create-about-form.component.ts +++ b/src/app/shell/personal-cabinet/provider/create-workshop/create-about-form/create-about-form.component.ts @@ -1,9 +1,15 @@ -import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core'; -import { FormArray, FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; -import { Store } from '@ngxs/store'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; -import { Constants, CropperConfigurationConstants } from '../../../../../shared/constants/constants'; + +import { + ChangeDetectionStrategy, Component, EventEmitter, Input, OnDestroy, OnInit, Output +} from '@angular/core'; +import { FormArray, FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; +import { Store } from '@ngxs/store'; + +import { + Constants, CropperConfigurationConstants +} from '../../../../../shared/constants/constants'; import { ValidationConstants } from '../../../../../shared/constants/validation'; import { PayRateTypeEnum } from '../../../../../shared/enum/enumUA/workshop'; import { OwnershipTypes, ProviderWorkshopSameValues } from '../../../../../shared/enum/provider'; @@ -39,7 +45,7 @@ export class CreateAboutFormComponent implements OnInit, OnDestroy { @Input() workshop: Workshop; @Input() provider: Provider; - @Input() isRelease3: boolean; + @Input() isImagesFeature: boolean; @Output() PassAboutFormGroup = new EventEmitter(); AboutFormGroup: FormGroup; diff --git a/src/app/shell/personal-cabinet/provider/create-workshop/create-description-form/create-description-form.component.html b/src/app/shell/personal-cabinet/provider/create-workshop/create-description-form/create-description-form.component.html index 1d51a042b4..fd8c8e2565 100644 --- a/src/app/shell/personal-cabinet/provider/create-workshop/create-description-form/create-description-form.component.html +++ b/src/app/shell/personal-cabinet/provider/create-workshop/create-description-form/create-description-form.component.html @@ -1,12 +1,11 @@ + [imageIdsFormControl]="DescriptionFormGroup.get('imageIds')"> + (deleteForm)="onDeleteForm($event)"> @@ -40,21 +37,18 @@ placeholder="{{ 'FORMS.PLACEHOLDERS.SPECIAL_EQUIPMENT' | translate }}" formControlName="disabilityOptionsDesc" autocomplete="none" - appTrimValue - /> + appTrimValue /> + [maxCharachters]="validationConstants.INPUT_LENGTH_256"> + [provider]="provider">
@@ -83,8 +77,7 @@ (keyup.enter)="onKeyWordsInput()" [(ngModel)]="keyWord" autocomplete="none" - appTrimValue - /> + appTrimValue />
diff --git a/src/app/shell/personal-cabinet/provider/create-workshop/create-description-form/create-description-form.component.ts b/src/app/shell/personal-cabinet/provider/create-workshop/create-description-form/create-description-form.component.ts index 85fbd6106b..f1e3ab4042 100644 --- a/src/app/shell/personal-cabinet/provider/create-workshop/create-description-form/create-description-form.component.ts +++ b/src/app/shell/personal-cabinet/provider/create-workshop/create-description-form/create-description-form.component.ts @@ -1,7 +1,11 @@ -import { Component, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Output, ViewChild } from '@angular/core'; -import { FormArray, FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; + +import { + Component, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Output, ViewChild +} from '@angular/core'; +import { FormArray, FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; + import { CropperConfigurationConstants } from '../../../../../shared/constants/constants'; import { ValidationConstants } from '../../../../../shared/constants/validation'; import { Provider } from '../../../../../shared/models/provider.model'; @@ -26,7 +30,7 @@ export class CreateDescriptionFormComponent implements OnInit, OnDestroy { }; @Input() workshop: Workshop; - @Input() isRelease3: boolean; + @Input() isImagesFeature: boolean; @Input() provider: Provider; @Output() passDescriptionFormGroup = new EventEmitter(); diff --git a/src/app/shell/personal-cabinet/provider/create-workshop/create-teacher/create-teacher.component.html b/src/app/shell/personal-cabinet/provider/create-workshop/create-teacher/create-teacher.component.html index 3e3fdd4af0..f76f9aba57 100644 --- a/src/app/shell/personal-cabinet/provider/create-workshop/create-teacher/create-teacher.component.html +++ b/src/app/shell/personal-cabinet/provider/create-workshop/create-teacher/create-teacher.component.html @@ -7,9 +7,8 @@ [TeacherFormGroup]="form" [index]="TeacherFormArray.controls.indexOf(form)" [teacherAmount]="TeacherFormArray.controls.length" - [isRelease3]="isRelease3" - (deleteForm)="onDeleteForm($event)" - > + [isImagesFeature]="isImagesFeature" + (deleteForm)="onDeleteForm($event)">
diff --git a/src/app/shell/personal-cabinet/provider/create-workshop/create-teacher/create-teacher.component.spec.ts b/src/app/shell/personal-cabinet/provider/create-workshop/create-teacher/create-teacher.component.spec.ts index a5c416312e..851e07ed88 100644 --- a/src/app/shell/personal-cabinet/provider/create-workshop/create-teacher/create-teacher.component.spec.ts +++ b/src/app/shell/personal-cabinet/provider/create-workshop/create-teacher/create-teacher.component.spec.ts @@ -1,13 +1,14 @@ +import { Component, Input } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { CreateTeacherComponent } from './create-teacher.component'; -import { MatIconModule } from '@angular/material/icon'; -import { MatFormFieldModule } from '@angular/material/form-field'; import { FormGroup, ReactiveFormsModule } from '@angular/forms'; -import { Component, Input } from '@angular/core'; -import { MatGridListModule } from '@angular/material/grid-list'; import { MatDialogModule } from '@angular/material/dialog'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatGridListModule } from '@angular/material/grid-list'; +import { MatIconModule } from '@angular/material/icon'; import { TranslateModule } from '@ngx-translate/core'; +import { CreateTeacherComponent } from './create-teacher.component'; + describe('CreateTeacherComponent', () => { let component: CreateTeacherComponent; let fixture: ComponentFixture; @@ -38,7 +39,7 @@ class MockTeacherFormComponent { @Input() TeacherFormGroup: FormGroup; @Input() teacherAmount: number; @Input() index: number; - @Input() isRelease3: boolean; + @Input() isImagesFeature: boolean; } @Component({ diff --git a/src/app/shell/personal-cabinet/provider/create-workshop/create-teacher/create-teacher.component.ts b/src/app/shell/personal-cabinet/provider/create-workshop/create-teacher/create-teacher.component.ts index be5ffd89ed..896c30b7b1 100644 --- a/src/app/shell/personal-cabinet/provider/create-workshop/create-teacher/create-teacher.component.ts +++ b/src/app/shell/personal-cabinet/provider/create-workshop/create-teacher/create-teacher.component.ts @@ -1,7 +1,12 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; -import { AbstractControl, FormControl, Validators, FormArray, FormBuilder, FormGroup } from '@angular/forms'; +import { + AbstractControl, FormArray, FormBuilder, FormControl, FormGroup, Validators +} from '@angular/forms'; import { MatDialog } from '@angular/material/dialog'; -import { ConfirmationModalWindowComponent } from '../../../../../shared/components/confirmation-modal-window/confirmation-modal-window.component'; + +import { + ConfirmationModalWindowComponent +} from '../../../../../shared/components/confirmation-modal-window/confirmation-modal-window.component'; import { Constants } from '../../../../../shared/constants/constants'; import { NAME_REGEX } from '../../../../../shared/constants/regex-constants'; import { ValidationConstants } from '../../../../../shared/constants/validation'; @@ -17,7 +22,7 @@ export class CreateTeacherComponent implements OnInit { TeacherFormArray: FormArray = new FormArray([]); @Input() teachers: Teacher[]; - @Input() isRelease3: boolean; + @Input() isImagesFeature: boolean; @Output() passTeacherFormArray = new EventEmitter(); diff --git a/src/app/shell/personal-cabinet/provider/create-workshop/create-teacher/teacher-form/teacher-form.component.html b/src/app/shell/personal-cabinet/provider/create-workshop/create-teacher/teacher-form/teacher-form.component.html index f8adf21713..ce6676002c 100644 --- a/src/app/shell/personal-cabinet/provider/create-workshop/create-teacher/teacher-form/teacher-form.component.html +++ b/src/app/shell/personal-cabinet/provider/create-workshop/create-teacher/teacher-form/teacher-form.component.html @@ -3,16 +3,14 @@ fxLayout="column" fxLayoutAlign="center space-between" class="step" - [class.step-border]="(teacherAmount > 1) && (index !== teacherAmount - 1)" -> + [class.step-border]="teacherAmount > 1 && index !== teacherAmount - 1"> + [imageIdsFormControl]="TeacherFormGroup.get('coverImageId')"> @@ -22,8 +20,7 @@ + [maxCharachters]="validationConstants.INPUT_LENGTH_60"> @@ -33,8 +30,7 @@ + [maxCharachters]="validationConstants.INPUT_LENGTH_60"> @@ -44,8 +40,7 @@ + [maxCharachters]="validationConstants.INPUT_LENGTH_60"> @@ -63,16 +58,11 @@ matInput [matDatepicker]="picker" formControlName="dateOfBirth" - placeholder="{{ 'FORMS.PLACEHOLDERS.SHORT_DATE_FORMAT' | translate }}" - /> + placeholder="{{ 'FORMS.PLACEHOLDERS.SHORT_DATE_FORMAT' | translate }}" /> - - +
@@ -89,14 +79,12 @@ }}" formControlName="description" maxlength="{{ validationConstants.MAX_DESCRIPTION_LENGTH_300 }}" - appTrimValue - > + appTrimValue> + [maxCharachters]="validationConstants.MAX_DESCRIPTION_LENGTH_300">
diff --git a/src/app/shell/personal-cabinet/provider/create-workshop/create-teacher/teacher-form/teacher-form.component.ts b/src/app/shell/personal-cabinet/provider/create-workshop/create-teacher/teacher-form/teacher-form.component.ts index 282a8c7bfe..f048ac0770 100644 --- a/src/app/shell/personal-cabinet/provider/create-workshop/create-teacher/teacher-form/teacher-form.component.ts +++ b/src/app/shell/personal-cabinet/provider/create-workshop/create-teacher/teacher-form/teacher-form.component.ts @@ -1,6 +1,6 @@ -import { Component, Input } from '@angular/core'; +import { Component, EventEmitter, Input, Output } from '@angular/core'; import { FormGroup } from '@angular/forms'; -import { Output, EventEmitter } from '@angular/core'; + import { CropperConfigurationConstants } from '../../../../../../shared/constants/constants'; import { ValidationConstants } from '../../../../../../shared/constants/validation'; import { Util } from '../../../../../../shared/utils/utils'; @@ -29,7 +29,7 @@ export class TeacherFormComponent { @Input() index: number; @Input() TeacherFormGroup: FormGroup; @Input() teacherAmount: number; - @Input() isRelease3: boolean; + @Input() isImagesFeature: boolean; @Output() deleteForm = new EventEmitter(); diff --git a/src/app/shell/personal-cabinet/provider/create-workshop/create-workshop.component.html b/src/app/shell/personal-cabinet/provider/create-workshop/create-workshop.component.html index 5fa6c47a1c..4b2350a4f5 100644 --- a/src/app/shell/personal-cabinet/provider/create-workshop/create-workshop.component.html +++ b/src/app/shell/personal-cabinet/provider/create-workshop/create-workshop.component.html @@ -6,10 +6,7 @@

{{ (editMode ? 'FORMS.HEADERS.EDIT_WORKSHOP' : 'FORMS.HEADERS.NEW_WORKSHOP') | translate }}

- {{ - (editMode ? 'FORMS.HEADERS.EDIT_WORKSHOP_DESCRIPTION_PATH' : 'FORMS.HEADERS.NEW_WORKSHOP_DESCRIPTION_PATH') - | translate - }} + {{ (editMode ? 'FORMS.HEADERS.EDIT_WORKSHOP_DESCRIPTION_PATH' : 'FORMS.HEADERS.NEW_WORKSHOP_DESCRIPTION_PATH') | translate }} {{ 'FORMS.HEADERS.WORKSHOP_FORM_DESCRIPTION' | translate }}

@@ -23,7 +20,7 @@

fxLayout="row" fxLayoutAlign="center center" [workshop]="workshop" - [isRelease3]="isRelease3" + [isImagesFeature]="isImagesFeature" [provider]="provider" (PassAboutFormGroup)="onReceiveAboutFormGroup($event)"> @@ -37,9 +34,7 @@

- +

{{ 'TITLES.DESCRIPTION' | translate }}

@@ -48,7 +43,7 @@

fxLayoutAlign="center center" [workshop]="workshop" [provider]="provider" - [isRelease3]="isRelease3" + [isImagesFeature]="isImagesFeature" (passDescriptionFormGroup)="onReceiveDescriptionFormGroup($event)">