Skip to content

Commit ed63429

Browse files
authored
fix(sign-up): updated sign up (#515)
* fix(sign-up): updated sign up * fix(registry): added internet link
1 parent 190047d commit ed63429

File tree

9 files changed

+35
-0
lines changed

9 files changed

+35
-0
lines changed

src/app/features/auth/models/sign-up-form.model.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { FormControl } from '@angular/forms';
22

33
export interface SignUpForm {
44
fullName: FormControl<string>;
5+
givenName: FormControl<string>;
6+
familyName: FormControl<string>;
57
email1: FormControl<string>;
68
email2: FormControl<string>;
79
password: FormControl<string>;

src/app/features/auth/pages/sign-up/sign-up.component.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,22 @@ <h2 class="text-center">{{ 'auth.signUp.title' | translate }}</h2>
4141
></osf-text-input>
4242
</div>
4343

44+
<div class="flex flex-column">
45+
<osf-text-input
46+
[control]="signUpForm.controls['givenName']"
47+
[label]="'auth.signUp.form.givenName'"
48+
[maxLength]="inputLimits.fullName.maxLength"
49+
></osf-text-input>
50+
</div>
51+
52+
<div class="flex flex-column">
53+
<osf-text-input
54+
[control]="signUpForm.controls['familyName']"
55+
[label]="'auth.signUp.form.familyName'"
56+
[maxLength]="inputLimits.fullName.maxLength"
57+
></osf-text-input>
58+
</div>
59+
4460
<div class="flex flex-column">
4561
<osf-text-input
4662
[control]="signUpForm.controls['email1']"

src/app/features/auth/pages/sign-up/sign-up.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ export class SignUpComponent implements OnInit {
6464
initializeForm(): void {
6565
this.signUpForm = new FormGroup<SignUpForm>({
6666
fullName: new FormControl('', { nonNullable: true, validators: CustomValidators.requiredTrimmed() }),
67+
givenName: new FormControl('', { nonNullable: true, validators: CustomValidators.requiredTrimmed() }),
68+
familyName: new FormControl('', { nonNullable: true, validators: CustomValidators.requiredTrimmed() }),
6769
email1: new FormControl('', {
6870
nonNullable: true,
6971
validators: [CustomValidators.requiredTrimmed(), Validators.email],

src/app/features/registry/mappers/registry-overview.mapper.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export function MapRegistryOverview(data: RegistryOverviewJsonApiData): Registry
4242
hasMaterials: data.attributes.has_materials,
4343
hasPapers: data.attributes.has_papers,
4444
hasSupplements: data.attributes.has_supplements,
45+
iaUrl: data.attributes.ia_url,
4546
license: LicensesMapper.fromLicenseDataJsonApi(data.embeds?.license?.data),
4647
registrationSchemaLink: data.relationships.registration_schema.links.related.href,
4748
associatedProjectId: data.relationships?.registered_from?.data?.id,

src/app/features/registry/models/registry-overview.models.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export interface RegistryOverview {
6363
withdrawalJustification?: string;
6464
dateWithdrawn: string | null;
6565
rootParentId: string | null;
66+
iaUrl: string | null;
6667
}
6768

6869
export interface RegistrationOverviewModel extends RegistrationNodeModel {

src/app/shared/components/resource-metadata/resource-metadata.component.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,14 @@ <h3>{{ 'project.overview.metadata.license' | translate }}</h3>
9595
<div>{{ resource.license?.name ?? ('project.overview.metadata.noLicense' | translate) }}</div>
9696
</div>
9797

98+
@if (resource.iaUrl) {
99+
<div class="flex flex-column gap-2">
100+
<h3>{{ 'project.overview.metadata.internetArchiveLink' | translate }}</h3>
101+
102+
<div>{{ resource.iaUrl }}</div>
103+
</div>
104+
}
105+
98106
@if (!resource.isAnonymous) {
99107
<div class="flex flex-column gap-2">
100108
<h3>

src/app/shared/mappers/resource-overview.mappers.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,6 @@ export function MapRegistryOverview(
8585
affiliatedInstitutions: institutions,
8686
associatedProjectId: registry.associatedProjectId,
8787
isAnonymous,
88+
iaUrl: registry.iaUrl,
8889
};
8990
}

src/app/shared/models/resource-overview.model.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,5 @@ export interface ResourceOverview {
5757
viewOnlyLinksCount?: number;
5858
associatedProjectId?: string;
5959
isAnonymous?: boolean;
60+
iaUrl?: string | null;
6061
}

src/assets/i18n/en.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,8 @@
269269
"divider": "or",
270270
"form": {
271271
"fullName": "Full Name",
272+
"givenName": "Given Name",
273+
"familyName": "Family Name",
272274
"fullNamePlaceholder": "John Doe",
273275
"submit": "Sign Up",
274276
"terms": {
@@ -691,6 +693,7 @@
691693
"loading": "Loading metadata...",
692694
"cedarRecordCreatedSuccessfully": "CEDAR record created successfully",
693695
"failedToCreateCedarRecord": "Failed to create CEDAR record",
696+
"internetArchiveLink": "internet archive link",
694697
"placeholders": {
695698
"edit": "Edit description here",
696699
"add": "Add description here"

0 commit comments

Comments
 (0)