Skip to content

Commit

Permalink
#734: [Create workshop] - error If or - char in the address
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrii Chornyi committed Jan 14, 2022
1 parent ce1fd8f commit 155d60e
Show file tree
Hide file tree
Showing 6 changed files with 9,596 additions and 9,335 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,6 @@ testem.log
# System Files
.DS_Store
Thumbs.db

package-lock.json
yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<ng-container *ngIf = "type === 'minDigitsLength' && minLength && invalid; then notEnoughDigits"></ng-container>
<ng-container *ngIf = "type === 'minCharachtersLengthFOP' && minLength && invalid; then notEnoughCharactersFOP"></ng-container>
<ng-container *ngIf = "type === 'validTextField' && forbiddenCharacter && invalid; then incorrectTextField"></ng-container>
<ng-container *ngIf = "type === 'validAddressField' && forbiddenCharacter && invalid; then incorrectAddressField"></ng-container>
<ng-container *ngIf = "type === 'validBuildingNumberField' && forbiddenCharacter && invalid; then incorrectBuildingNumberField"></ng-container>

<ng-template #requiredInput>
Expand Down Expand Up @@ -36,6 +37,12 @@
</small>
</ng-template>

<ng-template #incorrectAddressField>
<small appValidationMessageStyling>
"Перевірте введені данні. <br> Використовуйте будь ласка тільки кирилицю, цифри та символи ( ' - )"
</small>
</ng-template>

<ng-template #incorrectBuildingNumberField>
<small appValidationMessageStyling>
"Перевірте введені данні. <br> Використовуйте будь ласка тільки кирилицю, цифри та символи ( ' - / , . )"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
[isEmptyCheck]="AddressFormGroup.get('street').errors?.required"
[invalid]="AddressFormGroup.get('street').invalid && AddressFormGroup.get('street').touched">
</app-validation-hint-for-input>
<app-validation-hint-for-input type="validTextField"
<app-validation-hint-for-input type="validAddressField"
[invalid]="AddressFormGroup.get('street').invalid && AddressFormGroup.get('street').touched"
[forbiddenCharacter]="AddressFormGroup.get('street').errors?.pattern?.requiredPattern">
</app-validation-hint-for-input>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class CreateAddressComponent implements OnInit {
constructor(
private formBuilder: FormBuilder) {
this.AddressFormGroup = this.formBuilder.group({
street: new FormControl('', [Validators.required, Validators.pattern(TEXT_REGEX)]),
street: new FormControl('', [Validators.required, Validators.pattern(TEXT_WITH_DIGITS_REGEX)]),
buildingNumber: new FormControl('', [Validators.required, Validators.pattern(TEXT_WITH_DIGITS_REGEX)]),
city: new FormControl('', [Validators.required, Validators.pattern(TEXT_REGEX)]),
latitude: new FormControl(''),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export class CreateWorkshopComponent extends CreateFormComponent implements OnIn
}

/**
* This method receives a from from create-address child component and assigns to the Address FormGroup
* This method receives a form from create-address child component and assigns to the Address FormGroup
* @param FormGroup form
*/
onReceiveAddressFormGroup(form: FormGroup): void {
Expand All @@ -106,7 +106,7 @@ export class CreateWorkshopComponent extends CreateFormComponent implements OnIn
}

/**
* This method receives a from from create-about child component and assigns to the About FormGroup
* This method receives a from form create-about child component and assigns to the About FormGroup
* @param FormGroup form
*/
onReceiveAboutFormGroup(form: FormGroup): void {
Expand Down
Loading

0 comments on commit 155d60e

Please sign in to comment.