From 74618df5ce9605428dae2920e016a48469c33c41 Mon Sep 17 00:00:00 2001 From: crisnicandrei <62384997+crisnicandrei@users.noreply.github.com> Date: Tue, 13 Feb 2024 12:14:42 +0200 Subject: [PATCH 1/8] PER-8903 pass group instead of family Change all the instances of family to group. Now the frontend handles group archives, creating dispalying editing. This will work once the back-end is done. --- .../all-archives/all-archives.component.ts | 4 +- .../archive-switcher.component.ts | 6 +- .../my-archives-dialog.component.ts | 4 +- .../profile-edit/profile-edit.component.html | 6 +- .../public-settings.component.ts | 2 +- .../featured-archive.component.spec.ts | 2 +- .../featured-archive.component.ts | 2 +- .../pipes/archive-type-name.pipe.spec.ts | 2 +- .../gallery/pipes/archive-type-name.pipe.ts | 2 +- src/app/models/archive-vo.ts | 2 +- .../archive-type-select.component.ts | 4 +- .../onboarding/shared/onboarding-screen.ts | 6 +- .../new-archive-form.component.ts | 2 +- .../shared/services/api/archive.repo.spec.ts | 65 +++++++++++++------ 14 files changed, 67 insertions(+), 42 deletions(-) diff --git a/src/app/core/components/all-archives/all-archives.component.ts b/src/app/core/components/all-archives/all-archives.component.ts index 45007139d..ebed3264c 100644 --- a/src/app/core/components/all-archives/all-archives.component.ts +++ b/src/app/core/components/all-archives/all-archives.component.ts @@ -190,8 +190,8 @@ export class AllArchivesComponent implements OnInit, AfterViewInit, OnDestroy { value: 'type.archive.person' }, { - text: 'Family', - value: 'type.archive.family' + text: 'Group', + value: 'type.archive.group' }, { text: 'Organization', diff --git a/src/app/core/components/archive-switcher/archive-switcher.component.ts b/src/app/core/components/archive-switcher/archive-switcher.component.ts index ac293b01e..4d4c19a40 100644 --- a/src/app/core/components/archive-switcher/archive-switcher.component.ts +++ b/src/app/core/components/archive-switcher/archive-switcher.component.ts @@ -145,12 +145,12 @@ export class ArchiveSwitcherComponent implements OnInit, AfterViewInit { validators: [Validators.required], selectOptions: [ { - text: 'Person', - value: 'type.archive.person' + text: 'Group', + value: 'type.archive.group' }, { text: 'Family', - value: 'type.archive.family' + value: 'type.archive.group' }, { text: 'Organization', diff --git a/src/app/core/components/my-archives-dialog/my-archives-dialog.component.ts b/src/app/core/components/my-archives-dialog/my-archives-dialog.component.ts index f9f8782ab..ce7522f9a 100644 --- a/src/app/core/components/my-archives-dialog/my-archives-dialog.component.ts +++ b/src/app/core/components/my-archives-dialog/my-archives-dialog.component.ts @@ -26,8 +26,8 @@ const ARCHIVE_TYPES: { text: string, value: ArchiveType }[] = [ value: 'type.archive.person' }, { - text: 'Family', - value: 'type.archive.family' + text: 'Group', + value: 'type.archive.group' }, { text: 'Organization', diff --git a/src/app/core/components/profile-edit/profile-edit.component.html b/src/app/core/components/profile-edit/profile-edit.component.html index 347de1ef1..fc880ebfb 100644 --- a/src/app/core/components/profile-edit/profile-edit.component.html +++ b/src/app/core/components/profile-edit/profile-edit.component.html @@ -144,7 +144,7 @@
- + @@ -158,7 +158,7 @@
- + @@ -255,7 +255,7 @@ { } expectClassnameForArchiveType('type.archive.person', 'personal'); - expectClassnameForArchiveType('type.archive.family', 'group'); + expectClassnameForArchiveType('type.archive.group', 'group'); expectClassnameForArchiveType('type.archive.organization', 'organization'); expectClassnameForArchiveType('type.archive.nonprofit', 'organization'); }); diff --git a/src/app/gallery/components/featured-archive/featured-archive.component.ts b/src/app/gallery/components/featured-archive/featured-archive.component.ts index 7bc36bdb2..f65105f48 100644 --- a/src/app/gallery/components/featured-archive/featured-archive.component.ts +++ b/src/app/gallery/components/featured-archive/featured-archive.component.ts @@ -21,7 +21,7 @@ export class FeaturedArchiveComponent implements OnInit { const classes = ['featured-archive']; if (this.archive.type === 'type.archive.person') { classes.push('personal'); - } else if (this.archive.type === 'type.archive.family') { + } else if (this.archive.type === 'type.archive.group') { classes.push('group'); } else { classes.push('organization'); diff --git a/src/app/gallery/pipes/archive-type-name.pipe.spec.ts b/src/app/gallery/pipes/archive-type-name.pipe.spec.ts index f19328dc2..b7e31c099 100644 --- a/src/app/gallery/pipes/archive-type-name.pipe.spec.ts +++ b/src/app/gallery/pipes/archive-type-name.pipe.spec.ts @@ -16,7 +16,7 @@ describe('ArchiveTypeNamePipe', () => { } expectNameForType('type.archive.person', 'Personal Archive'); - expectNameForType('type.archive.family', 'Group Archive'); + expectNameForType('type.archive.group', 'Group Archive'); expectNameForType('type.archive.organization', 'Organizational Archive'); expectNameForType('type.archive.nonprofit', 'Organizational Archive'); }); diff --git a/src/app/gallery/pipes/archive-type-name.pipe.ts b/src/app/gallery/pipes/archive-type-name.pipe.ts index 2db176ddc..7187286d7 100644 --- a/src/app/gallery/pipes/archive-type-name.pipe.ts +++ b/src/app/gallery/pipes/archive-type-name.pipe.ts @@ -14,7 +14,7 @@ export class ArchiveTypeNamePipe implements PipeTransform { switch (type) { case 'type.archive.person': return 'Personal'; - case 'type.archive.family': + case 'type.archive.group': return 'Group'; case 'type.archive.organization': case 'type.archive.nonprofit': diff --git a/src/app/models/archive-vo.ts b/src/app/models/archive-vo.ts index f6878d138..5f118de03 100644 --- a/src/app/models/archive-vo.ts +++ b/src/app/models/archive-vo.ts @@ -7,7 +7,7 @@ import { ItemVO } from '.'; export type ArchiveType = | 'type.archive.person' - | 'type.archive.family' + | 'type.archive.group' | 'type.archive.organization' | 'type.archive.nonprofit'; diff --git a/src/app/onboarding/components/archive-type-select/archive-type-select.component.ts b/src/app/onboarding/components/archive-type-select/archive-type-select.component.ts index c4a629d29..406408f01 100644 --- a/src/app/onboarding/components/archive-type-select/archive-type-select.component.ts +++ b/src/app/onboarding/components/archive-type-select/archive-type-select.component.ts @@ -24,14 +24,14 @@ export class ArchiveTypeSelectComponent { icons = { 'type.archive.person': 'assets/svg/onboarding/archive-person.svg', - 'type.archive.family': 'assets/svg/onboarding/archive-group.svg', + 'type.archive.group': 'assets/svg/onboarding/archive-group.svg', 'type.archive.organization': 'assets/svg/onboarding/archive-organization.svg', }; altTexts = { 'type.archive.person': 'Person Archive', - 'type.archive.family': 'Family Archive', + 'type.archive.group': 'Group Archive', 'type.archive.organization': 'Organization Archive', }; diff --git a/src/app/onboarding/shared/onboarding-screen.ts b/src/app/onboarding/shared/onboarding-screen.ts index b76ed2a84..0f3d5874f 100644 --- a/src/app/onboarding/shared/onboarding-screen.ts +++ b/src/app/onboarding/shared/onboarding-screen.ts @@ -111,17 +111,17 @@ export const archiveOptions = [ type: OnboardingTypes.individual, }, { - value: 'type.archive.family', + value: 'type.archive.group', text: 'My family in the present', type: OnboardingTypes.family, }, { - value: 'type.archive.family', + value: 'type.archive.group', text: "My family's history", type: OnboardingTypes.famhist, }, { - value: 'type.archive.family', + value: 'type.archive.group', text: "A community I'm part of", type: OnboardingTypes.community, }, diff --git a/src/app/shared/components/new-archive-form/new-archive-form.component.ts b/src/app/shared/components/new-archive-form/new-archive-form.component.ts index 58ae24412..74cba8a9b 100644 --- a/src/app/shared/components/new-archive-form/new-archive-form.component.ts +++ b/src/app/shared/components/new-archive-form/new-archive-form.component.ts @@ -16,7 +16,7 @@ const ARCHIVE_TYPES: { text: string, value: ArchiveType }[] = [ }, { text: 'Group', - value: 'type.archive.family' + value: 'type.archive.group' }, { text: 'Organization', diff --git a/src/app/shared/services/api/archive.repo.spec.ts b/src/app/shared/services/api/archive.repo.spec.ts index 513ccb0e9..035ae38e9 100644 --- a/src/app/shared/services/api/archive.repo.spec.ts +++ b/src/app/shared/services/api/archive.repo.spec.ts @@ -1,11 +1,22 @@ import { TestBed, inject } from '@angular/core/testing'; -import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; +import { + HttpClientTestingModule, + HttpTestingController, +} from '@angular/common/http/testing'; import { environment } from '@root/environments/environment'; import { TEST_DATA, TEST_DATA_2 } from '@core/core.module.spec'; import { HttpService, Observable } from '@shared/services/http/http.service'; -import { ArchiveRepo, ArchiveResponse } from '@shared/services/api/archive.repo'; -import { SimpleVO, AccountPasswordVO, AccountVO, ArchiveVO } from '@root/app/models'; +import { + ArchiveRepo, + ArchiveResponse, +} from '@shared/services/api/archive.repo'; +import { + SimpleVO, + AccountPasswordVO, + AccountVO, + ArchiveVO, +} from '@root/app/models'; describe('ArchiveRepo', () => { let repo: ArchiveRepo; @@ -13,10 +24,8 @@ describe('ArchiveRepo', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [ - HttpClientTestingModule - ], - providers: [HttpService] + imports: [HttpClientTestingModule], + providers: [HttpService], }); repo = new ArchiveRepo(TestBed.get(HttpService)); @@ -30,10 +39,13 @@ describe('ArchiveRepo', () => { it('should get a single archive', () => { const expected = require('@root/test/responses/archive.get.single.success.json'); - repo.get([TEST_DATA.archive]) - .then((response) => { - expect(response.getArchiveVO().archiveId).toEqual(TEST_DATA.archive.archiveId); - expect(response.getArchiveVO().archiveNbr).toEqual(TEST_DATA.archive.archiveNbr); + repo.get([TEST_DATA.archive]).then((response) => { + expect(response.getArchiveVO().archiveId).toEqual( + TEST_DATA.archive.archiveId + ); + expect(response.getArchiveVO().archiveNbr).toEqual( + TEST_DATA.archive.archiveNbr + ); }); const req = httpMock.expectOne(`${environment.apiUrl}/archive/get`); @@ -43,8 +55,7 @@ describe('ArchiveRepo', () => { it('should get multiple archives', () => { const expected = require('@root/test/responses/archive.get.multiple.success.json'); - repo.get([TEST_DATA.archive, TEST_DATA_2.archive]) - .then((response) => { + repo.get([TEST_DATA.archive, TEST_DATA_2.archive]).then((response) => { const archives = response.getArchiveVOs(); expect(archives.length).toBe(2); @@ -62,15 +73,29 @@ describe('ArchiveRepo', () => { it('should get all archives for account', () => { const expected = require('@root/test/responses/archive.getAllArchive.success.json'); - repo.getAllArchives(new AccountVO(TEST_DATA.account)) - .then((response: ArchiveResponse) => { - const archives = response.getArchiveVOs(); - const count = expected.Results[0].data.length; + repo + .getAllArchives(new AccountVO(TEST_DATA.account)) + .then((response: ArchiveResponse) => { + const archives = response.getArchiveVOs(); + const count = expected.Results[0].data.length; + + expect(archives.length).toBe(count); + }); + + const req = httpMock.expectOne( + `${environment.apiUrl}/archive/getAllArchives` + ); + req.flush(expected); + }); - expect(archives.length).toBe(count); + it('should accept the archive type group', () => { + const archive = new ArchiveVO({ archiveId: 1, type: 'type.archive.group' }); + + repo.create(archive).then((response: ArchiveResponse) => { + expect(response.getArchiveVO().type).toEqual('type.archive.group'); }); - const req = httpMock.expectOne(`${environment.apiUrl}/archive/getAllArchives`); - req.flush(expected); + const req = httpMock.expectOne(`${environment.apiUrl}/archive/post`); + req.flush(archive); }); }); From 8cd9646662d60c035ded556e5d66264e9313e1be Mon Sep 17 00:00:00 2001 From: crisnicandrei <62384997+crisnicandrei@users.noreply.github.com> Date: Tue, 13 Feb 2024 14:59:58 +0200 Subject: [PATCH 2/8] Use a variable to pass linting check --- src/app/shared/services/api/archive.repo.spec.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/shared/services/api/archive.repo.spec.ts b/src/app/shared/services/api/archive.repo.spec.ts index 035ae38e9..d976e512a 100644 --- a/src/app/shared/services/api/archive.repo.spec.ts +++ b/src/app/shared/services/api/archive.repo.spec.ts @@ -92,7 +92,9 @@ describe('ArchiveRepo', () => { const archive = new ArchiveVO({ archiveId: 1, type: 'type.archive.group' }); repo.create(archive).then((response: ArchiveResponse) => { - expect(response.getArchiveVO().type).toEqual('type.archive.group'); + const type = response.getArchiveVO().type; + + expect(type).toEqual('type.archive.group'); }); const req = httpMock.expectOne(`${environment.apiUrl}/archive/post`); From 44889a9a3cc70c4004ecaff845fd14ba98a3b6b0 Mon Sep 17 00:00:00 2001 From: crisnicandrei <62384997+crisnicandrei@users.noreply.github.com> Date: Tue, 13 Feb 2024 15:07:12 +0200 Subject: [PATCH 3/8] fix linter --- src/app/shared/services/api/archive.repo.spec.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/shared/services/api/archive.repo.spec.ts b/src/app/shared/services/api/archive.repo.spec.ts index d976e512a..6c1d2da9b 100644 --- a/src/app/shared/services/api/archive.repo.spec.ts +++ b/src/app/shared/services/api/archive.repo.spec.ts @@ -43,6 +43,7 @@ describe('ArchiveRepo', () => { expect(response.getArchiveVO().archiveId).toEqual( TEST_DATA.archive.archiveId ); + expect(response.getArchiveVO().archiveNbr).toEqual( TEST_DATA.archive.archiveNbr ); From e280e65b24d19fb4f63ff7ebd4f8846444238868 Mon Sep 17 00:00:00 2001 From: crisnicandrei <62384997+crisnicandrei@users.noreply.github.com> Date: Tue, 13 Feb 2024 18:23:33 +0200 Subject: [PATCH 4/8] revert change from person family to person --- .../archive-switcher/archive-switcher.component.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/core/components/archive-switcher/archive-switcher.component.ts b/src/app/core/components/archive-switcher/archive-switcher.component.ts index 4d4c19a40..ee6bcbb32 100644 --- a/src/app/core/components/archive-switcher/archive-switcher.component.ts +++ b/src/app/core/components/archive-switcher/archive-switcher.component.ts @@ -145,11 +145,11 @@ export class ArchiveSwitcherComponent implements OnInit, AfterViewInit { validators: [Validators.required], selectOptions: [ { - text: 'Group', - value: 'type.archive.group' + text: 'Person', + value: 'type.archive.person' }, { - text: 'Family', + text: 'Group', value: 'type.archive.group' }, { From d369be595d8c1be1d2e0217a40582d17901a1341 Mon Sep 17 00:00:00 2001 From: crisnicandrei <62384997+crisnicandrei@users.noreply.github.com> Date: Mon, 26 Feb 2024 14:04:11 +0200 Subject: [PATCH 5/8] PER-8903-pass-group-instead-of-family Handle both family and group in the same way --- .../all-archives/all-archives.component.ts | 100 ++-- .../archive-switcher.component.ts | 111 ++-- .../my-archives-dialog.component.ts | 94 +++- .../profile-edit/profile-edit.component.html | 490 ++++++++++++------ .../public-settings.component.ts | 1 + .../featured-archive.component.spec.ts | 1 + .../featured-archive.component.ts | 5 +- .../pipes/archive-type-name.pipe.spec.ts | 1 + .../gallery/pipes/archive-type-name.pipe.ts | 1 + .../services/featured-archive.service.spec.ts | 2 +- src/app/models/archive-vo.ts | 2 + .../archive-type-select.component.ts | 2 + .../onboarding/shared/onboarding-screen.ts | 23 +- .../new-archive-form.component.ts | 6 +- 14 files changed, 588 insertions(+), 251 deletions(-) diff --git a/src/app/core/components/all-archives/all-archives.component.ts b/src/app/core/components/all-archives/all-archives.component.ts index ebed3264c..48445f9b5 100644 --- a/src/app/core/components/all-archives/all-archives.component.ts +++ b/src/app/core/components/all-archives/all-archives.component.ts @@ -1,4 +1,13 @@ -import { Component, OnInit, AfterViewInit, QueryList, ViewChildren, Optional, OnDestroy, ViewChild } from '@angular/core'; +import { + Component, + OnInit, + AfterViewInit, + QueryList, + ViewChildren, + Optional, + OnDestroy, + ViewChild, +} from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; import { Validators } from '@angular/forms'; @@ -6,7 +15,11 @@ import { remove, orderBy, partition } from 'lodash'; import { Deferred } from '@root/vendor/deferred'; import { AccountService } from '@shared/services/account/account.service'; -import { PromptService, PromptButton, PromptField } from '@shared/services/prompt/prompt.service'; +import { + PromptService, + PromptButton, + PromptField, +} from '@shared/services/prompt/prompt.service'; import { MessageService } from '@shared/services/message/message.service'; import { ArchiveVO, FolderVO } from '@root/app/models'; @@ -22,7 +35,7 @@ import { CdkPortal } from '@angular/cdk/portal'; @Component({ selector: 'pr-all-archives', templateUrl: './all-archives.component.html', - styleUrls: ['./all-archives.component.scss'] + styleUrls: ['./all-archives.component.scss'], }) export class AllArchivesComponent implements OnInit, AfterViewInit, OnDestroy { public currentArchive: ArchiveVO; @@ -42,28 +55,36 @@ export class AllArchivesComponent implements OnInit, AfterViewInit, OnDestroy { private router: Router, @Optional() private portalService: SidebarActionPortalService ) { - - this.data.setCurrentFolder(new FolderVO({ - displayName: 'Archives', - pathAsText: ['Archives'], - type: 'page' - })); + this.data.setCurrentFolder( + new FolderVO({ + displayName: 'Archives', + pathAsText: ['Archives'], + type: 'page', + }) + ); this.currentArchive = accountService.getArchive(); const archivesData = this.route.snapshot.data['archives'] || []; - const archives = orderBy(archivesData.map((archiveData) => { - return new ArchiveVO(archiveData); - }), 'fullName'); - const currentArchiveFetched = remove(archives, { archiveId: this.currentArchive.archiveId })[0] as ArchiveVO; + const archives = orderBy( + archivesData.map((archiveData) => { + return new ArchiveVO(archiveData); + }), + 'fullName' + ); + const currentArchiveFetched = remove(archives, { + archiveId: this.currentArchive.archiveId, + })[0] as ArchiveVO; this.currentArchive.update(currentArchiveFetched); this.accountService.setArchive(this.currentArchive); - [ this.pendingArchives, this.archives ] = partition(archives as ArchiveVO[], a => a.isPending()); + [this.pendingArchives, this.archives] = partition( + archives as ArchiveVO[], + (a) => a.isPending() + ); } - ngOnInit() { - } + ngOnInit() {} ngAfterViewInit() { if (this.portalService) { @@ -83,25 +104,33 @@ export class AllArchivesComponent implements OnInit, AfterViewInit, OnDestroy { const buttons: PromptButton[] = [ { buttonName: 'switch', - buttonText: archive.isPending() ? 'Accept and switch archive' : 'Switch archive' + buttonText: archive.isPending() + ? 'Accept and switch archive' + : 'Switch archive', }, { buttonName: 'cancel', buttonText: 'Cancel', - class: 'btn-secondary' - } + class: 'btn-secondary', + }, ]; let message = `Switch to The ${archive.fullName} Archive?`; if (archive.isPending()) { - message = `You have been invited to collaborate on the ${archive.fullName} archive. Accept ${this.prConstants.translate(archive.accessRole)} access and switch?`; + message = `You have been invited to collaborate on the ${ + archive.fullName + } archive. Accept ${this.prConstants.translate( + archive.accessRole + )} access and switch?`; } - this.prompt.promptButtons(buttons, message, deferred.promise) + this.prompt + .promptButtons(buttons, message, deferred.promise) .then((result) => { if (result === 'switch') { - let acceptIfNeeded: Promise = Promise.resolve(); + let acceptIfNeeded: Promise = + Promise.resolve(); if (archive.isPending()) { acceptIfNeeded = this.api.archive.accept(archive); @@ -160,9 +189,7 @@ export class AllArchivesComponent implements OnInit, AfterViewInit, OnDestroy { } } - async onRemoveClick(archive: ArchiveVO) { - - } + async onRemoveClick(archive: ArchiveVO) {} onCreateArchiveClick() { const deferred = new Deferred(); @@ -175,9 +202,9 @@ export class AllArchivesComponent implements OnInit, AfterViewInit, OnDestroy { autocapitalize: 'off', autocorrect: 'off', autocomplete: 'off', - spellcheck: 'off' + spellcheck: 'off', }, - validators: [Validators.required] + validators: [Validators.required], }, { fieldName: 'type', @@ -187,22 +214,27 @@ export class AllArchivesComponent implements OnInit, AfterViewInit, OnDestroy { selectOptions: [ { text: 'Person', - value: 'type.archive.person' + value: 'type.archive.person', + }, + { + text: 'Group', + value: 'type.archive.group', }, { text: 'Group', - value: 'type.archive.group' + value: 'type.archive.family', }, { text: 'Organization', - value: 'type.archive.organization' - } - ] + value: 'type.archive.organization', + }, + ], }, - RELATIONSHIP_FIELD + RELATIONSHIP_FIELD, ]; - this.prompt.prompt(fields, 'Create new archive', deferred.promise, 'Create archive') + this.prompt + .prompt(fields, 'Create new archive', deferred.promise, 'Create archive') .then((value) => { return this.api.archive.create(new ArchiveVO(value)); }) diff --git a/src/app/core/components/archive-switcher/archive-switcher.component.ts b/src/app/core/components/archive-switcher/archive-switcher.component.ts index ee6bcbb32..c1c3d20ba 100644 --- a/src/app/core/components/archive-switcher/archive-switcher.component.ts +++ b/src/app/core/components/archive-switcher/archive-switcher.component.ts @@ -1,4 +1,10 @@ -import { Component, OnInit, AfterViewInit, QueryList, ViewChildren } from '@angular/core'; +import { + Component, + OnInit, + AfterViewInit, + QueryList, + ViewChildren, +} from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; import { Validators } from '@angular/forms'; @@ -7,7 +13,11 @@ import { Deferred } from '@root/vendor/deferred'; import { gsap } from 'gsap'; import { AccountService } from '@shared/services/account/account.service'; -import { PromptService, PromptButton, PromptField } from '@shared/services/prompt/prompt.service'; +import { + PromptService, + PromptButton, + PromptField, +} from '@shared/services/prompt/prompt.service'; import { MessageService } from '@shared/services/message/message.service'; import { ArchiveVO, FolderVO } from '@root/app/models'; @@ -22,7 +32,7 @@ import { DataService } from '@shared/services/data/data.service'; @Component({ selector: 'pr-archive-switcher', templateUrl: './archive-switcher.component.html', - styleUrls: ['./archive-switcher.component.scss'] + styleUrls: ['./archive-switcher.component.scss'], }) export class ArchiveSwitcherComponent implements OnInit, AfterViewInit { public currentArchive: ArchiveVO; @@ -37,19 +47,25 @@ export class ArchiveSwitcherComponent implements OnInit, AfterViewInit { private message: MessageService, private router: Router ) { - - this.data.setCurrentFolder(new FolderVO({ - displayName: 'Archives', - pathAsText: ['Archives'], - type: 'page' - })); + this.data.setCurrentFolder( + new FolderVO({ + displayName: 'Archives', + pathAsText: ['Archives'], + type: 'page', + }) + ); this.currentArchive = accountService.getArchive(); const archivesData = this.route.snapshot.data['archives'] || []; - const archives = orderBy(archivesData.map((archiveData) => { - return new ArchiveVO(archiveData); - }), 'fullName'); - const currentArchiveFetched = remove(archives, { archiveId: this.currentArchive.archiveId })[0] as ArchiveVO; + const archives = orderBy( + archivesData.map((archiveData) => { + return new ArchiveVO(archiveData); + }), + 'fullName' + ); + const currentArchiveFetched = remove(archives, { + archiveId: this.currentArchive.archiveId, + })[0] as ArchiveVO; this.currentArchive.update(currentArchiveFetched); this.accountService.setArchive(this.currentArchive); @@ -57,22 +73,20 @@ export class ArchiveSwitcherComponent implements OnInit, AfterViewInit { this.archives = archives as ArchiveVO[]; } - ngOnInit() { - } + ngOnInit() {} ngAfterViewInit() { - const targetElems = document.querySelectorAll('.archive-list pr-archive-small'); - gsap.from( - targetElems, - { - duration: 0.75, - opacity: 0, - ease: 'Power4.easeOut', - stagger: { - amount: 0.5 - } - } - ); + const targetElems = document.querySelectorAll( + '.archive-list pr-archive-small' + ); + gsap.from(targetElems, { + duration: 0.75, + opacity: 0, + ease: 'Power4.easeOut', + stagger: { + amount: 0.5, + }, + }); } archiveClick(archive: ArchiveVO) { @@ -81,25 +95,33 @@ export class ArchiveSwitcherComponent implements OnInit, AfterViewInit { const buttons: PromptButton[] = [ { buttonName: 'switch', - buttonText: archive.isPending() ? 'Accept and switch archive' : 'Switch archive' + buttonText: archive.isPending() + ? 'Accept and switch archive' + : 'Switch archive', }, { buttonName: 'cancel', buttonText: 'Cancel', - class: 'btn-secondary' - } + class: 'btn-secondary', + }, ]; let message = `Switch to The ${archive.fullName} Archive?`; if (archive.isPending()) { - message = `You have been invited to collaborate on the ${archive.fullName} archive. Accept ${this.prConstants.translate(archive.accessRole)} access and switch?`; + message = `You have been invited to collaborate on the ${ + archive.fullName + } archive. Accept ${this.prConstants.translate( + archive.accessRole + )} access and switch?`; } - this.prompt.promptButtons(buttons, message, deferred.promise) + this.prompt + .promptButtons(buttons, message, deferred.promise) .then((result) => { if (result === 'switch') { - let acceptIfNeeded: Promise = Promise.resolve(); + let acceptIfNeeded: Promise = + Promise.resolve(); if (archive.isPending()) { acceptIfNeeded = this.api.archive.accept(archive); @@ -134,9 +156,9 @@ export class ArchiveSwitcherComponent implements OnInit, AfterViewInit { autocapitalize: 'off', autocorrect: 'off', autocomplete: 'off', - spellcheck: 'off' + spellcheck: 'off', }, - validators: [Validators.required] + validators: [Validators.required], }, { fieldName: 'type', @@ -146,22 +168,27 @@ export class ArchiveSwitcherComponent implements OnInit, AfterViewInit { selectOptions: [ { text: 'Person', - value: 'type.archive.person' + value: 'type.archive.person', + }, + { + text: 'Group', + value: 'type.archive.group', }, { text: 'Group', - value: 'type.archive.group' + value: 'type.archive.family', }, { text: 'Organization', - value: 'type.archive.organization' - } - ] + value: 'type.archive.organization', + }, + ], }, - RELATIONSHIP_FIELD + RELATIONSHIP_FIELD, ]; - this.prompt.prompt(fields, 'Create new archive', deferred.promise, 'Create archive') + this.prompt + .prompt(fields, 'Create new archive', deferred.promise, 'Create archive') .then((value) => { return this.api.archive.create(new ArchiveVO(value)); }) diff --git a/src/app/core/components/my-archives-dialog/my-archives-dialog.component.ts b/src/app/core/components/my-archives-dialog/my-archives-dialog.component.ts index ce7522f9a..2e7ddddcf 100644 --- a/src/app/core/components/my-archives-dialog/my-archives-dialog.component.ts +++ b/src/app/core/components/my-archives-dialog/my-archives-dialog.component.ts @@ -1,5 +1,17 @@ -import { Component, OnInit, ViewChild, ElementRef, ViewChildren, QueryList, Inject } from '@angular/core'; -import { IsTabbedDialog, DialogRef, DIALOG_DATA } from '@root/app/dialog/dialog.module'; +import { + Component, + OnInit, + ViewChild, + ElementRef, + ViewChildren, + QueryList, + Inject, +} from '@angular/core'; +import { + IsTabbedDialog, + DialogRef, + DIALOG_DATA, +} from '@root/app/dialog/dialog.module'; import { ArchiveVO, AccountVO } from '@models'; import { AccountService } from '@shared/services/account/account.service'; import { Router } from '@angular/router'; @@ -9,8 +21,15 @@ import { ArchiveResponse } from '@shared/services/api/archive.repo'; import { MessageService } from '@shared/services/message/message.service'; import { ArchiveSmallComponent } from '@shared/components/archive-small/archive-small.component'; import { ArchiveType } from '@models/archive-vo'; -import { UntypedFormGroup, UntypedFormBuilder, Validators } from '@angular/forms'; -import { RELATION_OPTIONS, PromptService } from '@shared/services/prompt/prompt.service'; +import { + UntypedFormGroup, + UntypedFormBuilder, + Validators, +} from '@angular/forms'; +import { + RELATION_OPTIONS, + PromptService, +} from '@shared/services/prompt/prompt.service'; export type MyArchivesTab = 'switch' | 'new' | 'pending'; @@ -20,25 +39,29 @@ interface ArchiveFormData { relationType: string; } -const ARCHIVE_TYPES: { text: string, value: ArchiveType }[] = [ +const ARCHIVE_TYPES: { text: string; value: ArchiveType }[] = [ { text: 'Person', - value: 'type.archive.person' + value: 'type.archive.person', }, { text: 'Group', - value: 'type.archive.group' + value: 'type.archive.group', + }, + { + text: 'Group', + value: 'type.archive.family', }, { text: 'Organization', - value: 'type.archive.organization' + value: 'type.archive.organization', }, ]; @Component({ selector: 'pr-my-archives-dialog', templateUrl: './my-archives-dialog.component.html', - styleUrls: ['./my-archives-dialog.component.scss'] + styleUrls: ['./my-archives-dialog.component.scss'], }) export class MyArchivesDialogComponent implements OnInit, IsTabbedDialog { account: AccountVO; @@ -54,7 +77,8 @@ export class MyArchivesDialogComponent implements OnInit, IsTabbedDialog { activeTab: MyArchivesTab = 'switch'; @ViewChild('panel') panelElem: ElementRef; - @ViewChildren(ArchiveSmallComponent) archiveComponents: QueryList; + @ViewChildren(ArchiveSmallComponent) + archiveComponents: QueryList; constructor( private dialogRef: DialogRef, @@ -63,12 +87,12 @@ export class MyArchivesDialogComponent implements OnInit, IsTabbedDialog { private api: ApiService, private prompt: PromptService, private message: MessageService, - private fb: UntypedFormBuilder, + private fb: UntypedFormBuilder ) { this.newArchiveForm = this.fb.group({ fullName: ['', [Validators.required]], type: [ARCHIVE_TYPES[0].value, [Validators.required]], - relationType: [null] + relationType: [null], }); if (this.data && this.data.activeTab) { @@ -80,8 +104,10 @@ export class MyArchivesDialogComponent implements OnInit, IsTabbedDialog { this.account = this.accountService.getAccount(); this.currentArchive = this.accountService.getArchive(); [this.pendingArchives, this.archives] = partition( - orderBy(this.accountService.getArchives(), a => a.fullName.toLowerCase()), - { status: 'status.generic.pending'} + orderBy(this.accountService.getArchives(), (a) => + a.fullName.toLowerCase() + ), + { status: 'status.generic.pending' } ); } @@ -96,9 +122,14 @@ export class MyArchivesDialogComponent implements OnInit, IsTabbedDialog { scrollToArchive(archive: ArchiveVO) { setTimeout(() => { - const component = find(this.archiveComponents.toArray(), cmp => cmp.archive === archive); + const component = find( + this.archiveComponents.toArray(), + (cmp) => cmp.archive === archive + ); if (component) { - (component.element.nativeElement as HTMLElement).scrollIntoView({behavior: 'smooth'}); + (component.element.nativeElement as HTMLElement).scrollIntoView({ + behavior: 'smooth', + }); } }); } @@ -116,27 +147,41 @@ export class MyArchivesDialogComponent implements OnInit, IsTabbedDialog { } async onArchiveMakeDefaultClick(archive: ArchiveVO) { - if (archive.isPendingAction || archive.archiveId === this.account.defaultArchiveId) { + if ( + archive.isPendingAction || + archive.archiveId === this.account.defaultArchiveId + ) { return; } try { archive.isPendingAction = true; - const updateAccount = new AccountVO({defaultArchiveId: archive.archiveId}); + const updateAccount = new AccountVO({ + defaultArchiveId: archive.archiveId, + }); await this.accountService.updateAccount(updateAccount); } catch (err) { - this.message.showError('There was a problem changing the default archive.', false); + this.message.showError( + 'There was a problem changing the default archive.', + false + ); } finally { archive.isPendingAction = false; } } async onArchiveDeleteClick(archive: ArchiveVO) { - if (this.currentArchive.archiveId === archive.archiveId || archive.accessRole !== 'access.role.owner') { + if ( + this.currentArchive.archiveId === archive.archiveId || + archive.accessRole !== 'access.role.owner' + ) { return; } - if (archive.isPendingAction || archive.archiveId === this.account.defaultArchiveId) { + if ( + archive.isPendingAction || + archive.archiveId === this.account.defaultArchiveId + ) { return; } @@ -147,7 +192,7 @@ export class MyArchivesDialogComponent implements OnInit, IsTabbedDialog { 'Are you sure you want to permanently delete this archive?', null, 'btn-danger' - ); + ); } catch (err) { return; } @@ -156,7 +201,10 @@ export class MyArchivesDialogComponent implements OnInit, IsTabbedDialog { await this.api.archive.delete(archive); remove(this.archives, archive); } catch (err) { - this.message.showError('There was a problem deleting this archive.', false); + this.message.showError( + 'There was a problem deleting this archive.', + false + ); archive.isPendingAction = false; } } diff --git a/src/app/core/components/profile-edit/profile-edit.component.html b/src/app/core/components/profile-edit/profile-edit.component.html index fc880ebfb..41e03f01c 100644 --- a/src/app/core/components/profile-edit/profile-edit.component.html +++ b/src/app/core/components/profile-edit/profile-edit.component.html @@ -10,24 +10,32 @@
-
+ [class.active]="scrollNav.activeSectionId === 'about'" + > About This Archive
-
+ [class.active]="scrollNav.activeSectionId === 'info'" + > Person Information
-
+ [class.active]="scrollNav.activeSectionId === 'online'" + > Online Presence
-
+ [class.active]="scrollNav.activeSectionId === 'milestones'" + > Milestones
@@ -37,18 +45,26 @@
Profile Visibility
- + id="profile-public-toggle" + />
- + id="profile-private-toggle" + />
- View On Web - + >View On Web +
- Profile 0 complete + Profile 0 complete
-
+
- The more fields you fill out, the more likely others will be able to find you online. + The more fields you fill out, the more likely others will be able + to find you online.
-
-
+
+
-
- camera_alt Change Banner -
+
camera_alt Change Banner
-
+
-
- camera_alt Change Photo -
+
camera_alt Change Photo
-
- The name of this Archive is… -
+
The name of this Archive is…
The
- + (doneEditing)=" + onSaveProfileItem( + this.profileItems.basic[0], + 'string1', + $event, + true + ) + " + >
Archive
-
- What is this Archive for? -
+
What is this Archive for?
- -
-
- 280 character limit + (doneEditing)=" + onSaveProfileItem( + this.profileItems.blurb[0], + 'string1', + $event + ) + " + >
+
280 character limit
- Tell us about this {{this.archive.type | prConstants | titlecase}} + Tell us about this + {{ this.archive.type | prConstants | titlecase }}
- +
- {{this.archive.type | prConstants | titlecase}} Information + {{ this.archive.type | prConstants | titlecase }} Information
- - - + + + -
- - - + + + -
-
+
-
@@ -184,21 +288,36 @@
-
-
@@ -208,21 +327,38 @@
-
-
@@ -238,58 +374,104 @@
- - +
- - +
-
+
Milestones
- Milestones capture any significant event in the history of this archive, and are ordered from most recent to least recent. + Milestones capture any significant event in the history of this + archive, and are ordered from most recent to least recent.
-
+
-
-
@@ -297,46 +479,64 @@
-
-
- -
- 200 character limit -
+
200 character limit
-
- +
diff --git a/src/app/core/components/public-settings/public-settings.component.ts b/src/app/core/components/public-settings/public-settings.component.ts index 74e89c8a1..518481c76 100644 --- a/src/app/core/components/public-settings/public-settings.component.ts +++ b/src/app/core/components/public-settings/public-settings.component.ts @@ -25,6 +25,7 @@ export class PublicSettingsComponent implements OnInit { public archiveTypes: { value: string; name: string }[] = [ { value: 'type.archive.group', name: 'Group' }, + { value: 'type.archive.family', name: 'Group' }, { value: 'type.archive.organization', name: 'Organization', diff --git a/src/app/gallery/components/featured-archive/featured-archive.component.spec.ts b/src/app/gallery/components/featured-archive/featured-archive.component.spec.ts index ce6f68813..75428ffbd 100644 --- a/src/app/gallery/components/featured-archive/featured-archive.component.spec.ts +++ b/src/app/gallery/components/featured-archive/featured-archive.component.spec.ts @@ -59,6 +59,7 @@ describe('FeaturedArchiveComponent', () => { expectClassnameForArchiveType('type.archive.person', 'personal'); expectClassnameForArchiveType('type.archive.group', 'group'); + expectClassnameForArchiveType('type.archive.family', 'group'); expectClassnameForArchiveType('type.archive.organization', 'organization'); expectClassnameForArchiveType('type.archive.nonprofit', 'organization'); }); diff --git a/src/app/gallery/components/featured-archive/featured-archive.component.ts b/src/app/gallery/components/featured-archive/featured-archive.component.ts index f65105f48..1cb0c70bf 100644 --- a/src/app/gallery/components/featured-archive/featured-archive.component.ts +++ b/src/app/gallery/components/featured-archive/featured-archive.component.ts @@ -21,7 +21,10 @@ export class FeaturedArchiveComponent implements OnInit { const classes = ['featured-archive']; if (this.archive.type === 'type.archive.person') { classes.push('personal'); - } else if (this.archive.type === 'type.archive.group') { + } else if ( + this.archive.type === 'type.archive.group' || + this.archive.type === 'type.archive.family' + ) { classes.push('group'); } else { classes.push('organization'); diff --git a/src/app/gallery/pipes/archive-type-name.pipe.spec.ts b/src/app/gallery/pipes/archive-type-name.pipe.spec.ts index b7e31c099..601e0d354 100644 --- a/src/app/gallery/pipes/archive-type-name.pipe.spec.ts +++ b/src/app/gallery/pipes/archive-type-name.pipe.spec.ts @@ -17,6 +17,7 @@ describe('ArchiveTypeNamePipe', () => { expectNameForType('type.archive.person', 'Personal Archive'); expectNameForType('type.archive.group', 'Group Archive'); + expectNameForType('type.archive.family', 'Group Archive'); expectNameForType('type.archive.organization', 'Organizational Archive'); expectNameForType('type.archive.nonprofit', 'Organizational Archive'); }); diff --git a/src/app/gallery/pipes/archive-type-name.pipe.ts b/src/app/gallery/pipes/archive-type-name.pipe.ts index 7187286d7..c6c4ac3aa 100644 --- a/src/app/gallery/pipes/archive-type-name.pipe.ts +++ b/src/app/gallery/pipes/archive-type-name.pipe.ts @@ -15,6 +15,7 @@ export class ArchiveTypeNamePipe implements PipeTransform { case 'type.archive.person': return 'Personal'; case 'type.archive.group': + case 'type.archive.family': return 'Group'; case 'type.archive.organization': case 'type.archive.nonprofit': diff --git a/src/app/gallery/services/featured-archive.service.spec.ts b/src/app/gallery/services/featured-archive.service.spec.ts index 21833670e..8569da939 100644 --- a/src/app/gallery/services/featured-archive.service.spec.ts +++ b/src/app/gallery/services/featured-archive.service.spec.ts @@ -1,4 +1,4 @@ -/* @format */ + /* @format */ import { TestBed } from '@angular/core/testing'; import { HttpClientTestingModule, diff --git a/src/app/models/archive-vo.ts b/src/app/models/archive-vo.ts index 5f118de03..c03a27b4a 100644 --- a/src/app/models/archive-vo.ts +++ b/src/app/models/archive-vo.ts @@ -1,3 +1,4 @@ +/* @format */ import { BaseVO, DynamicListChild } from '@models/base-vo'; import { FolderVO } from '@models/folder-vo'; import { RecordVO } from '@models/record-vo'; @@ -8,6 +9,7 @@ import { ItemVO } from '.'; export type ArchiveType = | 'type.archive.person' | 'type.archive.group' + | 'type.archive.family' | 'type.archive.organization' | 'type.archive.nonprofit'; diff --git a/src/app/onboarding/components/archive-type-select/archive-type-select.component.ts b/src/app/onboarding/components/archive-type-select/archive-type-select.component.ts index 406408f01..60bc08799 100644 --- a/src/app/onboarding/components/archive-type-select/archive-type-select.component.ts +++ b/src/app/onboarding/components/archive-type-select/archive-type-select.component.ts @@ -25,6 +25,7 @@ export class ArchiveTypeSelectComponent { icons = { 'type.archive.person': 'assets/svg/onboarding/archive-person.svg', 'type.archive.group': 'assets/svg/onboarding/archive-group.svg', + 'type.archive.family': 'assets/svg/onboarding/archive-group.svg', 'type.archive.organization': 'assets/svg/onboarding/archive-organization.svg', }; @@ -32,6 +33,7 @@ export class ArchiveTypeSelectComponent { altTexts = { 'type.archive.person': 'Person Archive', 'type.archive.group': 'Group Archive', + 'type.archive.family': 'Group Archive', 'type.archive.organization': 'Organization Archive', }; diff --git a/src/app/onboarding/shared/onboarding-screen.ts b/src/app/onboarding/shared/onboarding-screen.ts index 0f3d5874f..cafbc35f2 100644 --- a/src/app/onboarding/shared/onboarding-screen.ts +++ b/src/app/onboarding/shared/onboarding-screen.ts @@ -110,18 +110,33 @@ export const archiveOptions = [ text: 'An individual', type: OnboardingTypes.individual, }, - { - value: 'type.archive.group', + // { + // value: 'type.archive.group', + // text: 'My family in the present', + // type: OnboardingTypes.family, + // }, + // { + // value: 'type.archive.group', + // text: "My family's history", + // type: OnboardingTypes.famhist, + // }, + // { + // value: 'type.archive.group', + // text: "A community I'm part of", + // type: OnboardingTypes.community, + // }, + { + value: 'type.archive.family', text: 'My family in the present', type: OnboardingTypes.family, }, { - value: 'type.archive.group', + value: 'type.archive.family', text: "My family's history", type: OnboardingTypes.famhist, }, { - value: 'type.archive.group', + value: 'type.archive.family', text: "A community I'm part of", type: OnboardingTypes.community, }, diff --git a/src/app/shared/components/new-archive-form/new-archive-form.component.ts b/src/app/shared/components/new-archive-form/new-archive-form.component.ts index 74cba8a9b..8a972a6f2 100644 --- a/src/app/shared/components/new-archive-form/new-archive-form.component.ts +++ b/src/app/shared/components/new-archive-form/new-archive-form.component.ts @@ -14,9 +14,13 @@ const ARCHIVE_TYPES: { text: string, value: ArchiveType }[] = [ text: 'Person', value: 'type.archive.person' }, + // { + // text: 'Group', + // value: 'type.archive.group' + // }, { text: 'Group', - value: 'type.archive.group' + value: 'type.archive.family' }, { text: 'Organization', From 6754ad3555c9ac1a0df89ff5e94248638f7ee4a7 Mon Sep 17 00:00:00 2001 From: crisnicandrei <62384997+crisnicandrei@users.noreply.github.com> Date: Mon, 26 Feb 2024 17:00:05 +0200 Subject: [PATCH 6/8] prettier --- src/app/gallery/services/featured-archive.service.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/gallery/services/featured-archive.service.spec.ts b/src/app/gallery/services/featured-archive.service.spec.ts index 8569da939..21833670e 100644 --- a/src/app/gallery/services/featured-archive.service.spec.ts +++ b/src/app/gallery/services/featured-archive.service.spec.ts @@ -1,4 +1,4 @@ - /* @format */ +/* @format */ import { TestBed } from '@angular/core/testing'; import { HttpClientTestingModule, From 1526890062610caa36f4622b11ef9919ca0fd821 Mon Sep 17 00:00:00 2001 From: crisnicandrei <62384997+crisnicandrei@users.noreply.github.com> Date: Thu, 29 Feb 2024 10:54:45 +0200 Subject: [PATCH 7/8] PER-8903 Removed duplicate group entry + changed from family to group when creating a new archive --- .../public-settings.component.ts | 1 - .../onboarding/shared/onboarding-screen.ts | 23 ++--------- .../new-archive-form.component.ts | 41 +++++++++++-------- 3 files changed, 27 insertions(+), 38 deletions(-) diff --git a/src/app/core/components/public-settings/public-settings.component.ts b/src/app/core/components/public-settings/public-settings.component.ts index 518481c76..74e89c8a1 100644 --- a/src/app/core/components/public-settings/public-settings.component.ts +++ b/src/app/core/components/public-settings/public-settings.component.ts @@ -25,7 +25,6 @@ export class PublicSettingsComponent implements OnInit { public archiveTypes: { value: string; name: string }[] = [ { value: 'type.archive.group', name: 'Group' }, - { value: 'type.archive.family', name: 'Group' }, { value: 'type.archive.organization', name: 'Organization', diff --git a/src/app/onboarding/shared/onboarding-screen.ts b/src/app/onboarding/shared/onboarding-screen.ts index cafbc35f2..0f3d5874f 100644 --- a/src/app/onboarding/shared/onboarding-screen.ts +++ b/src/app/onboarding/shared/onboarding-screen.ts @@ -110,33 +110,18 @@ export const archiveOptions = [ text: 'An individual', type: OnboardingTypes.individual, }, - // { - // value: 'type.archive.group', - // text: 'My family in the present', - // type: OnboardingTypes.family, - // }, - // { - // value: 'type.archive.group', - // text: "My family's history", - // type: OnboardingTypes.famhist, - // }, - // { - // value: 'type.archive.group', - // text: "A community I'm part of", - // type: OnboardingTypes.community, - // }, - { - value: 'type.archive.family', + { + value: 'type.archive.group', text: 'My family in the present', type: OnboardingTypes.family, }, { - value: 'type.archive.family', + value: 'type.archive.group', text: "My family's history", type: OnboardingTypes.famhist, }, { - value: 'type.archive.family', + value: 'type.archive.group', text: "A community I'm part of", type: OnboardingTypes.community, }, diff --git a/src/app/shared/components/new-archive-form/new-archive-form.component.ts b/src/app/shared/components/new-archive-form/new-archive-form.component.ts index 8a972a6f2..2d11877d1 100644 --- a/src/app/shared/components/new-archive-form/new-archive-form.component.ts +++ b/src/app/shared/components/new-archive-form/new-archive-form.component.ts @@ -1,4 +1,12 @@ -import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core'; +import { + Component, + ElementRef, + EventEmitter, + Input, + OnInit, + Output, + ViewChild, +} from '@angular/core'; import { ArchiveVO, ArchiveType } from '@models/archive-vo'; import { ApiService } from '@shared/services/api/api.service'; import { RELATION_OPTIONS } from '@shared/services/prompt/prompt.service'; @@ -9,29 +17,25 @@ export interface ArchiveFormData { relationType?: string; } -const ARCHIVE_TYPES: { text: string, value: ArchiveType }[] = [ +const ARCHIVE_TYPES: { text: string; value: ArchiveType }[] = [ { text: 'Person', - value: 'type.archive.person' + value: 'type.archive.person', }, - // { - // text: 'Group', - // value: 'type.archive.group' - // }, { text: 'Group', - value: 'type.archive.family' + value: 'type.archive.group', }, { text: 'Organization', - value: 'type.archive.organization' + value: 'type.archive.organization', }, ]; @Component({ selector: 'pr-new-archive-form', templateUrl: './new-archive-form.component.html', - styleUrls: ['./new-archive-form.component.scss'] + styleUrls: ['./new-archive-form.component.scss'], }) export class NewArchiveFormComponent implements OnInit { @Input() showRelations: boolean = false; @@ -43,9 +47,7 @@ export class NewArchiveFormComponent implements OnInit { public waiting: boolean = false; public formData: ArchiveFormData; - constructor( - private api: ApiService, - ) { + constructor(private api: ApiService) { this.formData = { fullName: '', type: null, @@ -53,11 +55,13 @@ export class NewArchiveFormComponent implements OnInit { }; } - ngOnInit(): void { - } + ngOnInit(): void {} public isFormValid() { - return this.fullNameRef?.nativeElement.validity.valid && this.formData.type !== null; + return ( + this.fullNameRef?.nativeElement.validity.valid && + this.formData.type !== null + ); } public async onSubmit() { @@ -66,7 +70,9 @@ export class NewArchiveFormComponent implements OnInit { } try { this.waiting = true; - const response = await this.api.archive.create(new ArchiveVO(this.formData)); + const response = await this.api.archive.create( + new ArchiveVO(this.formData) + ); const newArchive = response.getArchiveVO(); this.success.emit(newArchive); } catch (err) { @@ -75,5 +81,4 @@ export class NewArchiveFormComponent implements OnInit { this.waiting = false; } } - } From 4e36867c4da849aeea61331cc3a17fc2ffbd80d5 Mon Sep 17 00:00:00 2001 From: crisnicandrei <62384997+crisnicandrei@users.noreply.github.com> Date: Fri, 1 Mar 2024 10:12:52 +0200 Subject: [PATCH 8/8] PER-8903-pass-group-instead-of-family Make sure that all family archives are converted to group to display the dropdown correctly --- .../components/public-settings/public-settings.component.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app/core/components/public-settings/public-settings.component.ts b/src/app/core/components/public-settings/public-settings.component.ts index 74e89c8a1..f061682b9 100644 --- a/src/app/core/components/public-settings/public-settings.component.ts +++ b/src/app/core/components/public-settings/public-settings.component.ts @@ -41,7 +41,10 @@ export class PublicSettingsComponent implements OnInit { ngOnInit(): void { this.allowDownloadsToggle = +this.archive.allowPublicDownload; - this.archiveType = this.archive.type; + this.archiveType = + this.archive.type === 'type.archive.family' + ? 'type.archive.group' + : this.archive.type; } public async onAllowDownloadsChange() {