Skip to content

Commit

Permalink
Showing 4 changed files with 37 additions and 19 deletions.
31 changes: 22 additions & 9 deletions ui/src/app/home/consortium/add-consortium-member.component.html
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ <h2 class="mb-30 wide-text font-size-24">Organization details</h2>

<h3 class="mb-20 font-size-16 font-weight-bold">Name & email domain</h3>
<div class="form-group mb-20">
<label
<label for="orgName"
class="wide-text font-size-12 font-weight-bold"
[ngClass]="{
'text-danger': editForm.get('orgName')?.invalid && editForm.get('orgName')?.touched && editForm.get('orgName')?.dirty
@@ -36,6 +36,7 @@ <h3 class="mb-20 font-size-16 font-weight-bold">Name & email domain</h3>
type="text"
class="form-control wide-text-25 org-name-input-field"
name="orgName"
id="orgName"
formControlName="orgName"
(input)="editForm.get('orgName')?.markAsUntouched()"
[ngClass]="{
@@ -62,7 +63,7 @@ <h3 class="mb-20 font-size-16 font-weight-bold">Name & email domain</h3>
</div>
</div>
<div class="form-group mb-30">
<label
<label for="emailDomain"
[ngClass]="{ 'text-danger': editForm.get('emailDomain')?.invalid && editForm.get('emailDomain')?.touched }"
class="wide-text font-size-12 font-weight-bold"
>Email domain</label
@@ -71,6 +72,7 @@ <h3 class="mb-20 font-size-16 font-weight-bold">Name & email domain</h3>
type="text"
class="form-control wide-text-25"
name="emailDomain"
id="emailDomain"
formControlName="emailDomain"
(input)="editForm.get('emailDomain')?.markAsUntouched()"
[ngClass]="{
@@ -94,7 +96,7 @@ <h3 class="mb-20 font-size-16 font-weight-bold">Name & email domain</h3>

<h3 class="mb-20 font-size-16 font-weight-bold">Billing address</h3>
<div class="form-group mb-20">
<label
<label for="street"
class="wide-text font-size-12 font-weight-bold"
[ngClass]="{ 'text-danger': editForm.get('street')?.invalid && editForm.get('street')?.touched }"
>Street</label
@@ -103,6 +105,7 @@ <h3 class="mb-20 font-size-16 font-weight-bold">Billing address</h3>
type="text"
class="form-control wide-text-25"
name="street"
id="street"
formControlName="street"
(input)="editForm.get('street')?.markAsUntouched()"
[ngClass]="{
@@ -117,13 +120,14 @@ <h3 class="mb-20 font-size-16 font-weight-bold">Billing address</h3>
</div>
</div>
<div class="form-group mb-20">
<label class="wide-text font-size-12 font-weight-bold" [ngClass]="{ 'text-danger': editForm.get('city')?.invalid && editForm.get('city')?.touched }"
<label for="city" class="wide-text font-size-12 font-weight-bold" [ngClass]="{ 'text-danger': editForm.get('city')?.invalid && editForm.get('city')?.touched }"
>City</label
>
<input
type="text"
class="form-control wide-text-25"
name="city"
id="city"
formControlName="city"
(input)="editForm.get('city')?.markAsUntouched()"
[ngClass]="{
@@ -139,6 +143,7 @@ <h3 class="mb-20 font-size-16 font-weight-bold">Billing address</h3>
</div>
<div class="form-group mb-20" *ngIf="states">
<label
for="state"
class="wide-text font-size-12 font-weight-bold"
[ngClass]="{
'text-danger': editForm.get('state')?.invalid && editForm.get('state')?.touched
@@ -148,6 +153,7 @@ <h3 class="mb-20 font-size-16 font-weight-bold">Billing address</h3>
<select
class="form-control font-size-14 wide-text-25 w-75"
name="state"
id="state"
formControlName="state"
[ngClass]="{
'text-danger': editForm.get('state')?.invalid && editForm.get('state')?.dirty,
@@ -162,6 +168,7 @@ <h3 class="mb-20 font-size-16 font-weight-bold">Billing address</h3>
</div>
<div class="form-group mb-20">
<label
for="country"
class="wide-text font-size-12 font-weight-bold"
[ngClass]="{ 'text-danger': editForm.get('country')?.invalid && editForm.get('country')?.dirty }"
>Country <span class="font-size-12 font-weight-normal">(Required)</span></label
@@ -170,6 +177,7 @@ <h3 class="mb-20 font-size-16 font-weight-bold">Billing address</h3>
(change)="onCountryChange(editForm.get('country')?.value)"
class="form-control font-size-14 wide-text-25"
name="country"
id="country"
formControlName="country"
[ngClass]="{
'text-danger': editForm.get('country')?.invalid && editForm.get('country')?.dirty,
@@ -188,7 +196,7 @@ <h3 class="mb-20 font-size-16 font-weight-bold">Billing address</h3>
</div>
</div>
<div class="form-group mb-30">
<label
<label for="postcode"
class="wide-text font-size-12 font-weight-bold"
[ngClass]="{ 'text-danger': editForm.get('postcode')?.invalid && editForm.get('postcode')?.touched }"
>ZIP/Postcode</label
@@ -197,6 +205,7 @@ <h3 class="mb-20 font-size-16 font-weight-bold">Billing address</h3>
type="text"
class="form-control wide-text-25 postcode-input-field"
name="postcode"
id="postcode"
formControlName="postcode"
(input)="editForm.get('postcode')?.markAsUntouched()"
[ngClass]="{
@@ -328,7 +337,7 @@ <h2 class="mb-10 wide-text font-size-24 line-height-150">Main contact</h2>
<strong>Main relationship</strong> and <strong>Voting contact</strong> roles for this organization.
</div>
<div class="form-group mb-20">
<label
<label for="contactGivenName"
class="wide-text font-size-12 font-weight-bold"
[ngClass]="{
'text-danger':
@@ -341,6 +350,7 @@ <h2 class="mb-10 wide-text font-size-24 line-height-150">Main contact</h2>
type="text"
class="form-control wide-text-25"
name="contactGivenName"
id="contactGivenName"
formControlName="contactGivenName"
(input)="editForm.get('contactGivenName')?.markAsUntouched()"
[ngClass]="{
@@ -365,7 +375,7 @@ <h2 class="mb-10 wide-text font-size-24 line-height-150">Main contact</h2>
</div>
</div>
<div class="form-group mb-20">
<label
<label for="contactFamilyName"
class="wide-text font-size-12 font-weight-bold"
[ngClass]="{
'text-danger':
@@ -379,6 +389,7 @@ <h2 class="mb-10 wide-text font-size-24 line-height-150">Main contact</h2>
type="text"
class="form-control wide-text-25"
name="contactFamilyName"
id="contactFamilyName"
formControlName="contactFamilyName"
(input)="editForm.get('contactFamilyName')?.markAsUntouched()"
[ngClass]="{
@@ -405,7 +416,7 @@ <h2 class="mb-10 wide-text font-size-24 line-height-150">Main contact</h2>
</div>
</div>
<div class="form-group mb-20">
<label
<label for="contactJobTitle"
class="wide-text font-size-12 font-weight-bold"
[ngClass]="{ 'text-danger': editForm.get('contactJobTitle')?.invalid && editForm.get('contactJobTitle')?.touched }"
>Job title</label
@@ -414,6 +425,7 @@ <h2 class="mb-10 wide-text font-size-24 line-height-150">Main contact</h2>
type="text"
class="form-control wide-text-25"
name="contactJobTitle"
id="contactJobTitle"
formControlName="contactJobTitle"
(input)="editForm.get('contactJobTitle')?.markAsUntouched()"
[ngClass]="{
@@ -428,7 +440,7 @@ <h2 class="mb-10 wide-text font-size-24 line-height-150">Main contact</h2>
</div>
</div>
<div class="form-group mb-40">
<label
<label for="contactEmail"
[ngClass]="{
'text-danger':
editForm.get('contactEmail')?.invalid && editForm.get('contactEmail')?.dirty && editForm.get('contactEmail')?.touched
@@ -440,6 +452,7 @@ <h2 class="mb-10 wide-text font-size-24 line-height-150">Main contact</h2>
type="text"
class="form-control wide-text-25"
name="contactEmail"
id="contactEmail"
formControlName="contactEmail"
(input)="editForm.get('contactEmail')?.markAsUntouched()"
[ngClass]="{
4 changes: 2 additions & 2 deletions ui/src/app/home/consortium/add-consortium-member.component.ts
Original file line number Diff line number Diff line change
@@ -21,8 +21,8 @@ export class AddConsortiumMemberComponent implements OnInit {
countries: ISFCountry[] | undefined
states: ISFState[] | undefined
memberData: ISFMemberData | undefined | null
isSaving: boolean = false
invalidForm: boolean = false
isSaving = false
invalidForm = false
routeData: any
currentMonth: number | undefined
currentYear: number | undefined
16 changes: 10 additions & 6 deletions ui/src/app/home/contact/contact-update.component.html
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ <h1 class="mb-40 wide-text font-italic" *ngIf="!contactId">New contact</h1>
<h3 class="mb-20 wide-text">Contact details</h3>
<div class="form w-100">
<div class="form-group mb-20">
<label
<label for="name"
class="wide-text font-size-12 font-weight-bold mb-1"
[ngClass]="{ 'text-danger': editForm.get('name')?.invalid && editForm.get('name')?.dirty && editForm.get('name')?.touched }"
>Name <span class="font-weight-normal">(Required)</span></label
@@ -32,6 +32,7 @@ <h3 class="mb-20 wide-text">Contact details</h3>
type="text"
class="form-control"
name="name"
id="name"
formControlName="name"
(input)="editForm.get('name')?.markAsUntouched()"
[ngClass]="{
@@ -51,11 +52,12 @@ <h3 class="mb-20 wide-text">Contact details</h3>
</div>
</div>
<div class="form-group mb-20">
<label class="wide-text font-size-12 font-weight-bold mb-1" [ngClass]="{ 'text-danger': editForm.get('title')?.invalid }">Job title</label>
<label for="title" class="wide-text font-size-12 font-weight-bold mb-1" [ngClass]="{ 'text-danger': editForm.get('title')?.invalid }">Job title</label>
<input
type="text"
class="form-control"
name="title"
id="title"
formControlName="title"
[ngClass]="{ 'text-danger': editForm.get('title')?.invalid }"
/>
@@ -66,7 +68,7 @@ <h3 class="mb-20 wide-text">Contact details</h3>
</div>
</div>
<div class="form-group mb-20">
<label
<label for="email"
[ngClass]="{ 'text-danger': editForm.get('email')?.invalid && editForm.get('email')?.dirty && editForm.get('email')?.touched }"
class="wide-text font-size-12 font-weight-bold mb-1"
>Email address <span class="font-weight-normal">(Required)</span></label
@@ -75,6 +77,7 @@ <h3 class="mb-20 wide-text">Contact details</h3>
type="text"
class="form-control"
name="email"
id="email"
formControlName="email"
(input)="editForm.get('email')?.markAsUntouched()"
[ngClass]="{
@@ -101,13 +104,14 @@ <h3 class="mb-20 wide-text">Contact details</h3>
</div>
</div>
<div class="form-group mb-30">
<label class="wide-text font-size-12 font-weight-bold mb-1" [ngClass]="{ 'text-danger': editForm.get('phone')?.invalid && editForm.get('phone')?.dirty }"
<label for="phone" class="wide-text font-size-12 font-weight-bold mb-1" [ngClass]="{ 'text-danger': editForm.get('phone')?.invalid && editForm.get('phone')?.dirty }"
>Phone</label
>
<input
type="text"
class="form-control"
name="phone"
id="phone"
formControlName="phone"
[ngClass]="{ 'text-danger': editForm.get('phone')?.invalid && editForm.get('phone')?.dirty }"
/>
@@ -130,8 +134,8 @@ <h3 class="mb-16 mr-8">Roles <span class="font-size-12 font-weight-normal">(Requ
<div formArrayName="roles" class="border-0 mb-32">
<div *ngFor="let myOption of roles.controls; let i = index">
<div formGroupName="{{ i }}">
<input type="checkbox" class="role-checkbox" />
<label class="font-size-14 font-weight-normal mb-16"> {{ myOption.get('name')?.value }} </label>
<input [id]="myOption.get('name')" type="checkbox" class="role-checkbox" />
<label [for]="myOption.get('name')" class="font-size-14 font-weight-normal mb-16"> {{ myOption.get('name')?.value }} </label>
</div>
</div>
</div>
5 changes: 3 additions & 2 deletions ui/src/app/member/service/member.service.ts
Original file line number Diff line number Diff line change
@@ -156,15 +156,16 @@ export class MemberService {
this.memberData.next(memberData)
}

addConsortiumMember(consortiumMember: ISFNewConsortiumMember): Observable<Boolean> {
addConsortiumMember(consortiumMember: ISFNewConsortiumMember): Observable<boolean> {
return this.http
.post<ISFMemberContactUpdate>(`${this.resourceUrl}/members/add-consortium-member`, consortiumMember, {
observe: 'response',
})
.pipe(
map((res: HttpResponse<any>) => res.status === 200),
catchError((err) => {
return throwError(err)
console.log('error adding consortium member', err)
return of(false)
})
)
}

0 comments on commit 668a99b

Please sign in to comment.