Skip to content

Commit

Permalink
Merge pull request #391 from softwaremagico/390-remove-some-mandatory…
Browse files Browse the repository at this point in the history
…-fields-on-club

Address, phone, web and email fields are not mandatory
  • Loading branch information
softwaremagico authored Apr 27, 2024
2 parents de6535c + 0994ee5 commit 8277d94
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ <h1 mat-dialog-title>{{title}}</h1>
</mat-form-field>
<mat-form-field *ngIf="actionName != 'Delete'">
<input [readonly]="!rbacService.isAllowed(RbacActivity.EDIT_CLUB)" formControlName="clubEmail" matInput
placeholder="{{'clubEmail' | translate}}"
required>
placeholder="{{'clubEmail' | translate}}">
</mat-form-field>
<mat-form-field *ngIf="actionName != 'Delete'">
<input [readonly]="!rbacService.isAllowed(RbacActivity.EDIT_CLUB)" formControlName="clubPhone" matInput
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,19 @@ export class ClubDialogBoxComponent extends RbacBasedComponent {
clubAddress: new UntypedFormControl({
value: this.club.address,
disabled: !rbacService.isAllowed(RbacActivity.EDIT_TOURNAMENT)
}, [Validators.required, Validators.minLength(4), Validators.maxLength(40)]),
}, [Validators.minLength(4), Validators.maxLength(40)]),
clubEmail: new UntypedFormControl({
value: this.club.email,
disabled: !rbacService.isAllowed(RbacActivity.EDIT_TOURNAMENT)
}, [Validators.required, Validators.email]),
}, [Validators.email]),
clubPhone: new UntypedFormControl({
value: this.club.phone,
disabled: !rbacService.isAllowed(RbacActivity.EDIT_TOURNAMENT)
}, [Validators.required, Validators.pattern("[- +()0-9]+"), Validators.minLength(4), Validators.maxLength(20)]),
}, [Validators.pattern("[- +()0-9]+"), Validators.minLength(4), Validators.maxLength(20)]),
clubWeb: new UntypedFormControl({
value: this.club.web,
disabled: !rbacService.isAllowed(RbacActivity.EDIT_TOURNAMENT)
}, [Validators.required, Validators.pattern('(https?://)?([\\da-z.-]+)\\.([a-z.]{2,6})[/\\w .-]*/?'), Validators.minLength(4), Validators.maxLength(75)]),
}, [Validators.pattern('(https?://)?([\\da-z.-]+)\\.([a-z.]{2,6})[/\\w .-]*/?'), Validators.minLength(4), Validators.maxLength(75)]),
});
}

Expand Down

0 comments on commit 8277d94

Please sign in to comment.