From 758e327ca0b31a41a234485baf7c8874d69eee33 Mon Sep 17 00:00:00 2001 From: andrej romanov <50377758+auumgn@users.noreply.github.com> Date: Thu, 25 Apr 2024 18:36:46 +0300 Subject: [PATCH] fix css and lint --- ui/src/app/app.component.ts | 4 +- ui/src/app/home/home.component.scss | 6 +- ui/src/app/home/home.route.ts | 2 +- .../member-info-edit.component.html | 101 ++++++++---------- .../member-info-edit.component.scss | 19 +++- .../member-info/member-info-edit.component.ts | 38 ++++++- ui/src/app/member/contact-update.component.ts | 4 +- ui/src/app/member/service/member.service.ts | 3 +- ...add-consortium-member-alert.component.html | 10 +- .../add-consortium-member-alert.component.ts | 2 +- ...ove-consortium-member-alert.component.html | 10 +- ...emove-consortium-member-alert.component.ts | 2 +- .../contact-update-alert.component.html | 10 +- ui/src/content/scss/global.scss | 12 +-- 14 files changed, 140 insertions(+), 83 deletions(-) diff --git a/ui/src/app/app.component.ts b/ui/src/app/app.component.ts index 2bdfdac24..926d932a7 100644 --- a/ui/src/app/app.component.ts +++ b/ui/src/app/app.component.ts @@ -6,6 +6,4 @@ import { HttpClient } from '@angular/common/http' templateUrl: './app.component.html', styleUrls: ['./app.component.scss'], }) -export class AppComponent { - constructor() {} -} +export class AppComponent {} diff --git a/ui/src/app/home/home.component.scss b/ui/src/app/home/home.component.scss index 759fef2d0..5a1ee4abc 100644 --- a/ui/src/app/home/home.component.scss +++ b/ui/src/app/home/home.component.scss @@ -1,7 +1,11 @@ -@import '~quill/dist/quill.snow.css'; :host { max-width: 1250px; display: block; margin: auto; height: 100%; } + +.home-container { + border: 2px solid #eeeeee; + border-radius: 5px 0px 0px 5px; +} diff --git a/ui/src/app/home/home.route.ts b/ui/src/app/home/home.route.ts index 93bb025da..69278315b 100644 --- a/ui/src/app/home/home.route.ts +++ b/ui/src/app/home/home.route.ts @@ -71,7 +71,7 @@ export const routes: Routes = [ authorities: ['ROLE_USER'], pageTitle: 'home.title.string', }, - canActivate: [AuthGuard, ManageMemberGuard], + canActivate: [ManageMemberGuard], }, { path: 'manage/:id/edit', diff --git a/ui/src/app/home/member-info/member-info-edit.component.html b/ui/src/app/home/member-info/member-info-edit.component.html index d922d3d08..1ace28c61 100644 --- a/ui/src/app/home/member-info/member-info-edit.component.html +++ b/ui/src/app/home/member-info/member-info-edit.component.html @@ -1,4 +1,4 @@ -
+
Back to @@ -84,14 +84,15 @@

Organization name

-

Billing address

+

Billing address

+ />
Billing address
+ />
Billing address
+
+ >Country
- + />
Public details
+ />
Public details
- Organization description + - +
Public details
-
+
+ /> Public details
-
+
+ /> Public details
- +
@@ -418,12 +409,12 @@

ID

Type


-
    +
    • -
      {{ orgId.value }}
      -
      {{ orgId.key }}
      +
      {{ orgId.id }}
      +
      {{ orgId.name }}
    • -
      +
diff --git a/ui/src/app/home/member-info/member-info-edit.component.scss b/ui/src/app/home/member-info/member-info-edit.component.scss index bc8539101..89e219ab3 100644 --- a/ui/src/app/home/member-info/member-info-edit.component.scss +++ b/ui/src/app/home/member-info/member-info-edit.component.scss @@ -13,6 +13,13 @@ small { line-height: 150%; } +label { + display: block; + margin-bottom: 0; + letter-spacing: 0.5px; + font-size: 12px; +} + button { font-size: 14px; } @@ -51,8 +58,9 @@ button { } .main-section { - label { + label > span { font-weight: bold; + display: block; margin-bottom: 4px; } flex: 1; @@ -128,3 +136,12 @@ option { :host ::ng-deep .ql-active .ql-stroke { stroke: global.$info !important; } + +.description { + line-break: anywhere; +} + +.home-container { + border: 2px solid #eeeeee; + border-radius: 5px 0px 0px 5px; +} diff --git a/ui/src/app/home/member-info/member-info-edit.component.ts b/ui/src/app/home/member-info/member-info-edit.component.ts index 71ef9c27e..84f535233 100644 --- a/ui/src/app/home/member-info/member-info-edit.component.ts +++ b/ui/src/app/home/member-info/member-info-edit.component.ts @@ -7,10 +7,11 @@ import { switchMap, take, takeUntil } from 'rxjs/operators' import { AccountService } from 'src/app/account' import { IAccount } from 'src/app/account/model/account.model' import { EMAIL_REGEXP, URL_REGEXP, ORCID_BASE_URL } from 'src/app/app.constants' -import { ISFAddress } from 'src/app/member/model/salesforce-address.model' +import { ISFAddress, SFAddress } from 'src/app/member/model/salesforce-address.model' import { ISFCountry } from 'src/app/member/model/salesforce-country.model' import { ISFState } from 'src/app/member/model/salesforce-country.model copy' -import { ISFMemberData } from 'src/app/member/model/salesforce-member-data.model' +import { SFMemberContact } from 'src/app/member/model/salesforce-member-contact.model' +import { ISFMemberData, SFConsortiumMemberData, SFMemberData } from 'src/app/member/model/salesforce-member-data.model' import { ISFMemberUpdate, SFMemberUpdate } from 'src/app/member/model/salesforce-member-update.model' import { MemberService } from 'src/app/member/service/member.service' @@ -26,7 +27,8 @@ export class MemberInfoEditComponent implements OnInit, OnDestroy { account: IAccount | undefined | null memberData: ISFMemberData | undefined | null objectKeys = Object.keys - orgIdsTransformed: KeyValue[] = [] + objectValues = Object.values + orgIdsTransformed: { id: string; name: string }[] = [] ORCID_BASE_URL = ORCID_BASE_URL isSaving = false @@ -88,7 +90,35 @@ export class MemberInfoEditComponent implements OnInit, OnDestroy { ) .subscribe((data) => { this.memberData = data - this.orgIdsTransformed = Object.entries(this.memberData?.orgIds || {}).map(([key, value]) => ({ key, value })) + this.memberData = new SFMemberData( + '123', + true, + '123', + true, + 'rara', + 'roro', + 'hehe.com', + 'Lithuania', + 'ruru', + 'riri', + 'rere', + 'hehe@mail.com', + '2022', + '2050', + '', + [new SFConsortiumMemberData('he', 'ho'), new SFConsortiumMemberData('hee', 'hoo')], + [ + new SFMemberContact('124', true, ['goob'], 'name', 'phone', 'email'), + new SFMemberContact('124', false, ['goob'], 'name', 'phone', 'email'), + ], + { ROR: ['123', '456'], GRID: ['1213', '1415'] }, + new SFAddress('street', 'United Kingdom', 'state', 'Lithuania', 'code', 'postalCode', 'city') + ) + + this.orgIdsTransformed = Object.entries(this.memberData?.orgIds || {}).flatMap(([name, ids]) => + ids.map((id: string) => ({ id, name })) + ) + this.validateUrl() if (data) { this.updateForm(data) diff --git a/ui/src/app/member/contact-update.component.ts b/ui/src/app/member/contact-update.component.ts index cc14ff7fb..3942c4d17 100644 --- a/ui/src/app/member/contact-update.component.ts +++ b/ui/src/app/member/contact-update.component.ts @@ -34,8 +34,8 @@ export class ContactUpdateComponent implements OnInit, OnDestroy { account: IAccount | undefined | null memberData: ISFMemberData | undefined | null contact: ISFMemberContact | undefined - isSaving: boolean = false - invalidForm: boolean = false + isSaving = false + invalidForm = false routeData: any editForm: FormGroup | undefined contactId: string | undefined diff --git a/ui/src/app/member/service/member.service.ts b/ui/src/app/member/service/member.service.ts index 3abfcc02e..4ed41eec6 100644 --- a/ui/src/app/member/service/member.service.ts +++ b/ui/src/app/member/service/member.service.ts @@ -276,7 +276,7 @@ export class MemberService { return of(null) } - updateContact(contact: ISFMemberContactUpdate, salesforceId: string): Observable { + updateContact(contact: ISFMemberContactUpdate, salesforceId: string): Observable { return this.http .post(`${this.resourceUrl}/members/${salesforceId}/contact-update`, contact, { observe: 'response', @@ -389,7 +389,6 @@ export class MemberService { } } return { - ...new SFMemberOrgIds(), ROR, GRID, Ringgold, diff --git a/ui/src/app/shared/alert/consortium-member/add-consortium-member-alert.component.html b/ui/src/app/shared/alert/consortium-member/add-consortium-member-alert.component.html index e75375f3f..61b18dc25 100644 --- a/ui/src/app/shared/alert/consortium-member/add-consortium-member-alert.component.html +++ b/ui/src/app/shared/alert/consortium-member/add-consortium-member-alert.component.html @@ -1,5 +1,11 @@