From 88899237fdc12ce669c80cd50d5fdcbef8decfbb Mon Sep 17 00:00:00 2001 From: crisnicandrei <62384997+crisnicandrei@users.noreply.github.com> Date: Mon, 12 Aug 2024 13:58:36 +0300 Subject: [PATCH 1/9] changed font style --- .../create-new-archive/create-new-archive.component.scss | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/app/onboarding/components/create-new-archive/create-new-archive.component.scss b/src/app/onboarding/components/create-new-archive/create-new-archive.component.scss index bba190f7a..197ac42b5 100644 --- a/src/app/onboarding/components/create-new-archive/create-new-archive.component.scss +++ b/src/app/onboarding/components/create-new-archive/create-new-archive.component.scss @@ -238,6 +238,11 @@ h3 { color: white; font-family: 'UsualLight', sans-serif; } + + & > .heading-new-archive { + color: white; + font-family: 'UsualLight', sans-serif; + } } .create-new-archive { From 94c53f0c33face0b0bb1cdebf72fcf299e26a9cc Mon Sep 17 00:00:00 2001 From: crisnicandrei <62384997+crisnicandrei@users.noreply.github.com> Date: Mon, 12 Aug 2024 19:35:27 +0300 Subject: [PATCH 2/9] Design changes to the archive type select dialog --- .../create-new-archive.component.html | 2 +- .../create-new-archive.component.ts | 4 ++- .../archive-type-select-dialog.component.scss | 7 ++-- .../archive-type-select.component.scss | 4 ++- .../archive-type-select.component.ts | 12 +++++-- .../select-archive-type-screen.component.html | 2 +- .../select-archive-type-screen.component.ts | 36 +++++++++++-------- 7 files changed, 43 insertions(+), 24 deletions(-) diff --git a/src/app/onboarding/components/create-new-archive/create-new-archive.component.html b/src/app/onboarding/components/create-new-archive/create-new-archive.component.html index 7f189e1c3..e10947982 100644 --- a/src/app/onboarding/components/create-new-archive/create-new-archive.component.html +++ b/src/app/onboarding/components/create-new-archive/create-new-archive.component.html @@ -102,8 +102,8 @@

(); - public currentType: OnboardingTypes = OnboardingTypes.myself; + @Input() currentType: OnboardingTypes = OnboardingTypes.myself; public typeName: string; public typeDescription: string; public chevronDown = faChevronDown; @@ -25,6 +25,12 @@ export class GlamArchiveTypeSelectComponent { this.refreshArchiveTypeText(); } + ngOnInit(): void { + if (this.currentType) { + this.refreshArchiveTypeText(); + } + } + public onClick(): void { this.dialog .open(ArchiveTypeSelectDialogComponent, { diff --git a/src/app/onboarding/components/glam/select-archive-type-screen/select-archive-type-screen.component.html b/src/app/onboarding/components/glam/select-archive-type-screen/select-archive-type-screen.component.html index 7bf012464..04a65c3f4 100644 --- a/src/app/onboarding/components/glam/select-archive-type-screen/select-archive-type-screen.component.html +++ b/src/app/onboarding/components/glam/select-archive-type-screen/select-archive-type-screen.component.html @@ -2,7 +2,7 @@

With my first archive, I plan to capture and preserve material about…

- +
(); @Output() submitEmitter = new EventEmitter>(); - public navigate(screen) { - if (screen === 'start') { - this.navigationEmitter.emit(screen); - } else { - this.submitEmitter.emit({ - screen, - type: this.type, - tag: this.tag, - headerText: this.headerText, - }); + ngOnInit(): void { + if (this.tag) { + this.buttonText = generateElementText( + this.tag, + archiveOptionsWithArticle, + ); } } + public navigate(screen) { + this.submitEmitter.emit({ + screen, + type: this.type, + tag: this.tag, + headerText: this.headerText, + }); + console.log(screen); + } + public onValueChange(event: string): void { this.tag = event; this.type = archiveOptions.find((val) => val.type === event).value; + console.log(this.type); + console.log(event); this.selectedValue = `${this.type}+${event}`; this.buttonText = generateElementText(event, archiveOptionsWithArticle); this.headerText = generateElementText(event, archiveCreationHeaderText); From 7da8443533c72fa686515fd2e6f61be24fb44f20 Mon Sep 17 00:00:00 2001 From: crisnicandrei <62384997+crisnicandrei@users.noreply.github.com> Date: Mon, 12 Aug 2024 20:01:55 +0300 Subject: [PATCH 3/9] fix tests --- .../select-archive-type-screen.component.html | 5 ++++- .../select-archive-type-screen.component.spec.ts | 4 ++-- .../select-archive-type-screen.component.ts | 2 -- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/app/onboarding/components/glam/select-archive-type-screen/select-archive-type-screen.component.html b/src/app/onboarding/components/glam/select-archive-type-screen/select-archive-type-screen.component.html index 04a65c3f4..4dc716c6f 100644 --- a/src/app/onboarding/components/glam/select-archive-type-screen/select-archive-type-screen.component.html +++ b/src/app/onboarding/components/glam/select-archive-type-screen/select-archive-type-screen.component.html @@ -2,7 +2,10 @@

With my first archive, I plan to capture and preserve material about…

- +
{ const { instance } = await shallow.render(); expect(instance.selectedValue).toBe(''); - expect(instance.buttonText).toBe(''); + expect(instance.buttonText).toBe('a Personal'); expect(instance['headerText']).toBe(''); expect(instance['tag']).toBe(''); expect(instance['type']).toBe(''); @@ -31,7 +31,7 @@ describe('SelectArchiveTypeScreenComponent', () => { const { instance, outputs } = await shallow.render(); instance.navigate('start'); - expect(outputs.navigationEmitter.emit).toHaveBeenCalledWith('start'); + expect(outputs.submitEmitter.emit).toHaveBeenCalledWith('start'); }); it('should emit submit event when navigate is called with other screen', async () => { diff --git a/src/app/onboarding/components/glam/select-archive-type-screen/select-archive-type-screen.component.ts b/src/app/onboarding/components/glam/select-archive-type-screen/select-archive-type-screen.component.ts index 086ee2198..cfdd427dd 100644 --- a/src/app/onboarding/components/glam/select-archive-type-screen/select-archive-type-screen.component.ts +++ b/src/app/onboarding/components/glam/select-archive-type-screen/select-archive-type-screen.component.ts @@ -19,7 +19,6 @@ export class SelectArchiveTypeScreenComponent implements OnInit { @Input() tag: string = ''; public type: string = ''; - @Output() navigationEmitter = new EventEmitter(); @Output() submitEmitter = new EventEmitter>(); ngOnInit(): void { @@ -38,7 +37,6 @@ export class SelectArchiveTypeScreenComponent implements OnInit { tag: this.tag, headerText: this.headerText, }); - console.log(screen); } public onValueChange(event: string): void { From 307f32feb10fba2d4aca6cfc49e66c02c9cbf3d8 Mon Sep 17 00:00:00 2001 From: crisnicandrei <62384997+crisnicandrei@users.noreply.github.com> Date: Mon, 12 Aug 2024 20:10:13 +0300 Subject: [PATCH 4/9] linting --- .../create-new-archive/create-new-archive.component.ts | 2 -- .../select-archive-type-screen.component.spec.ts | 10 +++++++++- .../select-archive-type-screen.component.ts | 2 -- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/app/onboarding/components/create-new-archive/create-new-archive.component.ts b/src/app/onboarding/components/create-new-archive/create-new-archive.component.ts index 71ad918de..e7ac85f52 100644 --- a/src/app/onboarding/components/create-new-archive/create-new-archive.component.ts +++ b/src/app/onboarding/components/create-new-archive/create-new-archive.component.ts @@ -101,8 +101,6 @@ export class CreateNewArchiveComponent implements OnInit { } ngOnInit(): void { - console.log(this.archiveType); - console.log(this.archiveTypeTag); if (this.pendingArchive) { this.screen = 'goals'; this.progress.emit(1); diff --git a/src/app/onboarding/components/glam/select-archive-type-screen/select-archive-type-screen.component.spec.ts b/src/app/onboarding/components/glam/select-archive-type-screen/select-archive-type-screen.component.spec.ts index 20e29fc18..841ea4a50 100644 --- a/src/app/onboarding/components/glam/select-archive-type-screen/select-archive-type-screen.component.spec.ts +++ b/src/app/onboarding/components/glam/select-archive-type-screen/select-archive-type-screen.component.spec.ts @@ -29,9 +29,17 @@ describe('SelectArchiveTypeScreenComponent', () => { it('should emit navigation event when navigate is called with start', async () => { const { instance, outputs } = await shallow.render(); + instance['type'] = 'mockType'; + instance['tag'] = 'mockTag'; + instance['headerText'] = 'mockHeaderText'; instance.navigate('start'); - expect(outputs.submitEmitter.emit).toHaveBeenCalledWith('start'); + expect(outputs.submitEmitter.emit).toHaveBeenCalledWith({ + screen: 'start', + type: 'mockType', + tag: 'mockTag', + headerText: 'mockHeaderText', + }); }); it('should emit submit event when navigate is called with other screen', async () => { diff --git a/src/app/onboarding/components/glam/select-archive-type-screen/select-archive-type-screen.component.ts b/src/app/onboarding/components/glam/select-archive-type-screen/select-archive-type-screen.component.ts index cfdd427dd..ac6cd60a4 100644 --- a/src/app/onboarding/components/glam/select-archive-type-screen/select-archive-type-screen.component.ts +++ b/src/app/onboarding/components/glam/select-archive-type-screen/select-archive-type-screen.component.ts @@ -42,8 +42,6 @@ export class SelectArchiveTypeScreenComponent implements OnInit { public onValueChange(event: string): void { this.tag = event; this.type = archiveOptions.find((val) => val.type === event).value; - console.log(this.type); - console.log(event); this.selectedValue = `${this.type}+${event}`; this.buttonText = generateElementText(event, archiveOptionsWithArticle); this.headerText = generateElementText(event, archiveCreationHeaderText); From 92454c10b92be0808ec3499761880a1ca981f1ee Mon Sep 17 00:00:00 2001 From: crisnicandrei <62384997+crisnicandrei@users.noreply.github.com> Date: Wed, 14 Aug 2024 18:57:40 +0300 Subject: [PATCH 5/9] added tests --- .../archive-type-select-dialog.component.scss | 4 ++-- .../archive-type-select.component.scss | 2 +- ...lect-archive-type-screen.component.spec.ts | 24 +++++++++++++++++++ src/app/onboarding/utils/utils.ts | 2 +- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/src/app/onboarding/components/glam/archive-type-select-dialog/archive-type-select-dialog.component.scss b/src/app/onboarding/components/glam/archive-type-select-dialog/archive-type-select-dialog.component.scss index 573d36511..50f8f2a05 100644 --- a/src/app/onboarding/components/glam/archive-type-select-dialog/archive-type-select-dialog.component.scss +++ b/src/app/onboarding/components/glam/archive-type-select-dialog/archive-type-select-dialog.component.scss @@ -3,7 +3,7 @@ .archive-type-select-dialog { font-family: 'UsualRegular', sans-serif; background: #fff; - border-radius: 12px 12px 0px 0px; + border-radius: 12px; display: flex; width: auto; height: 80vh; @@ -32,7 +32,7 @@ align-items: center; flex-shrink: 0; align-self: stretch; - border-bottom: 1px solid #E7E8ED; + border-bottom: 1px solid #e7e8ed; .dialog-label { color: $darkBlue; diff --git a/src/app/onboarding/components/glam/archive-type-select/archive-type-select.component.scss b/src/app/onboarding/components/glam/archive-type-select/archive-type-select.component.scss index 54848eb19..3a4e86425 100644 --- a/src/app/onboarding/components/glam/archive-type-select/archive-type-select.component.scss +++ b/src/app/onboarding/components/glam/archive-type-select/archive-type-select.component.scss @@ -9,7 +9,7 @@ align-self: stretch; border-radius: 12px; - border: 1px solid rgba(255, 255, 255, 0.16); + border: none; background: linear-gradient(156deg, #8d0085 0%, #ff9400 100%); font-family: 'UsualRegular', sans-serif; diff --git a/src/app/onboarding/components/glam/select-archive-type-screen/select-archive-type-screen.component.spec.ts b/src/app/onboarding/components/glam/select-archive-type-screen/select-archive-type-screen.component.spec.ts index 841ea4a50..d33356f9a 100644 --- a/src/app/onboarding/components/glam/select-archive-type-screen/select-archive-type-screen.component.spec.ts +++ b/src/app/onboarding/components/glam/select-archive-type-screen/select-archive-type-screen.component.spec.ts @@ -80,4 +80,28 @@ describe('SelectArchiveTypeScreenComponent', () => { expect(instance.navigate).toHaveBeenCalledWith('name-archive'); }); + + it('should set buttonText correctly in ngOnInit if tag is defined', async () => { + const { instance } = await shallow.render({ + bind: { + tag: 'type:community', + }, + }); + + instance.ngOnInit(); + + expect(instance.buttonText).toBe('a Community'); + }); + + it('should not call generateElementText if tag is not defined', async () => { + const { instance, fixture } = await shallow.render(); + + instance.tag = ''; + + fixture.detectChanges(); + + instance.ngOnInit(); + + expect(instance.buttonText).toBe('a Personal'); // Default value + }); }); diff --git a/src/app/onboarding/utils/utils.ts b/src/app/onboarding/utils/utils.ts index 1f41b3018..36935ca42 100644 --- a/src/app/onboarding/utils/utils.ts +++ b/src/app/onboarding/utils/utils.ts @@ -2,5 +2,5 @@ export function generateElementText( type: string, options: Record[] ): string { - return options.find((val) => val.type === type).text; + return options.find((val) => val.type === type)?.text; } \ No newline at end of file From 965c5fcaf365b0c3a48340f3cebf4689858c11f7 Mon Sep 17 00:00:00 2001 From: crisnicandrei <62384997+crisnicandrei@users.noreply.github.com> Date: Wed, 14 Aug 2024 18:58:10 +0300 Subject: [PATCH 6/9] revert --- src/app/onboarding/utils/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/onboarding/utils/utils.ts b/src/app/onboarding/utils/utils.ts index 36935ca42..1f41b3018 100644 --- a/src/app/onboarding/utils/utils.ts +++ b/src/app/onboarding/utils/utils.ts @@ -2,5 +2,5 @@ export function generateElementText( type: string, options: Record[] ): string { - return options.find((val) => val.type === type)?.text; + return options.find((val) => val.type === type).text; } \ No newline at end of file From 0f5373a3aa18d7bac1e2a53574f9487a14a2cfc9 Mon Sep 17 00:00:00 2001 From: crisnicandrei <62384997+crisnicandrei@users.noreply.github.com> Date: Wed, 4 Sep 2024 11:52:10 +0300 Subject: [PATCH 7/9] Fixed the pragma Co-authored-by: Natalie Martin <9145247+meisekimiu@users.noreply.github.com> --- .../glam/archive-type-select/archive-type-select.component.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/onboarding/components/glam/archive-type-select/archive-type-select.component.scss b/src/app/onboarding/components/glam/archive-type-select/archive-type-select.component.scss index 3a4e86425..110f2527a 100644 --- a/src/app/onboarding/components/glam/archive-type-select/archive-type-select.component.scss +++ b/src/app/onboarding/components/glam/archive-type-select/archive-type-select.component.scss @@ -1,4 +1,4 @@ -/*N @format */ +/* @format */ .archive-type-select { cursor: pointer; width: 100%; From 23de8a1d9f6f05f1bb1d02fa087a370498527589 Mon Sep 17 00:00:00 2001 From: crisnicandrei <62384997+crisnicandrei@users.noreply.github.com> Date: Fri, 6 Sep 2024 15:00:35 +0300 Subject: [PATCH 8/9] design changes --- .../create-new-archive/create-new-archive.component.scss | 1 + .../glam/archive-type-select/archive-type-select.component.scss | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/onboarding/components/create-new-archive/create-new-archive.component.scss b/src/app/onboarding/components/create-new-archive/create-new-archive.component.scss index 197ac42b5..5d1c0cf92 100644 --- a/src/app/onboarding/components/create-new-archive/create-new-archive.component.scss +++ b/src/app/onboarding/components/create-new-archive/create-new-archive.component.scss @@ -240,6 +240,7 @@ h3 { } & > .heading-new-archive { + width: 60%; color: white; font-family: 'UsualLight', sans-serif; } diff --git a/src/app/onboarding/components/glam/archive-type-select/archive-type-select.component.scss b/src/app/onboarding/components/glam/archive-type-select/archive-type-select.component.scss index 110f2527a..91af3458e 100644 --- a/src/app/onboarding/components/glam/archive-type-select/archive-type-select.component.scss +++ b/src/app/onboarding/components/glam/archive-type-select/archive-type-select.component.scss @@ -28,7 +28,7 @@ .type-name { font-size: 18px; - font-weight: 600; + font-family: 'UsualExtraBold', sans-serif; line-height: 24px; } From e0592547fcdc6e757ec064a53a59eeee9ab1422d Mon Sep 17 00:00:00 2001 From: crisnicandrei <62384997+crisnicandrei@users.noreply.github.com> Date: Fri, 13 Sep 2024 16:55:53 +0300 Subject: [PATCH 9/9] changed fonts --- .../archive-type-select-dialog.component.scss | 2 ++ .../glam/archive-type-select/archive-type-select.component.scss | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/app/onboarding/components/glam/archive-type-select-dialog/archive-type-select-dialog.component.scss b/src/app/onboarding/components/glam/archive-type-select-dialog/archive-type-select-dialog.component.scss index 50f8f2a05..9dc7fc4cd 100644 --- a/src/app/onboarding/components/glam/archive-type-select-dialog/archive-type-select-dialog.component.scss +++ b/src/app/onboarding/components/glam/archive-type-select-dialog/archive-type-select-dialog.component.scss @@ -1,4 +1,5 @@ @import 'variables'; +@import 'fonts'; .archive-type-select-dialog { font-family: 'UsualRegular', sans-serif; @@ -76,6 +77,7 @@ color: $darkBlue; font-weight: 600; line-height: 24px; + font-family: 'UsualExtraBold', sans-serif; } .type-description { diff --git a/src/app/onboarding/components/glam/archive-type-select/archive-type-select.component.scss b/src/app/onboarding/components/glam/archive-type-select/archive-type-select.component.scss index 91af3458e..82f852d8e 100644 --- a/src/app/onboarding/components/glam/archive-type-select/archive-type-select.component.scss +++ b/src/app/onboarding/components/glam/archive-type-select/archive-type-select.component.scss @@ -1,4 +1,6 @@ /* @format */ +@import 'fonts'; + .archive-type-select { cursor: pointer; width: 100%;