Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug/user service #2

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .husky/commit-msg

This file was deleted.

2 changes: 0 additions & 2 deletions .husky/pre-commit

This file was deleted.

12 changes: 0 additions & 12 deletions migration_progress.sh

This file was deleted.

82 changes: 0 additions & 82 deletions setup.sh

This file was deleted.

11 changes: 7 additions & 4 deletions src/app/api/models/user/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,13 @@ export class User extends Entity {
}

public get name(): string {
const fn = this.firstName.slice(0, 11);
const sn = this.lastName.slice(0, 11);
const nn = this.nickname && this.nickname.trim() ? ` (${this.nickname.trim().slice(0, 11)})` : '';
return `${fn} ${sn}${nn}`;
if (this.firstName){
const fn = this.firstName.slice(0, 11);
const sn = this.lastName.slice(0, 11);
const nn = this.nickname && this.nickname.trim() ? ` (${this.nickname.trim().slice(0, 11)})` : '';
return `${fn} ${sn}${nn}`;
}
return ``;
}

public matches(text: string): boolean {
Expand Down
22 changes: 12 additions & 10 deletions src/app/common/edit-profile-form/edit-profile-form.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@
<user-icon [size]="80" [user]="user" style="margin-right: 25px"></user-icon
></a>

<div fxLayout="column" fxLayoutAlign="space-around start">
<h1>{{ initialFirstName }}</h1>
Set up your {{ externalName.value }} profile
<div fxLayout="column" fxLayoutAlign="space-around start"> <!-- fixed heading -->
<h1>Set up your {{ externalName.value }} profile{{ initialFirstName }}</h1>

</div>
</div>

<!-- max length input changed -->
<div fxLayout="row" fxFlexFill>
<mat-form-field fxFlex="48" appearance="outline" fxFlexAlign="start">
<mat-label>First Name</mat-label>
<input matInput [(ngModel)]="user.firstName" name="first" required />
<input matInput [(ngModel)]="user.firstName" name="first" required maxlength="25" />
</mat-form-field>

<div fxFlex></div>

<!-- max length input changed -->
<mat-form-field fxFlex="48" appearance="outline" fxFlexAlign="end">
<mat-label>Second Name</mat-label>
<input matInput [(ngModel)]="user.lastName" name="last" required />
<input matInput [(ngModel)]="user.lastName" name="last" required maxlength="25"/>
</mat-form-field>
</div>

Expand All @@ -41,7 +41,7 @@ <h1>{{ initialFirstName }}</h1>
<div fxFlex="3"></div>
<mat-form-field fxFlexAlign="end" fxFlex appearance="outline">
<mat-label>Preferred Name</mat-label>
<input matInput [(ngModel)]="user.nickname" name="preferred_name" />
<input matInput [(ngModel)]="user.nickname" name="preferred_name" maxlength="25"/>
</mat-form-field>
</div>

Expand Down Expand Up @@ -86,9 +86,11 @@ <h1>{{ initialFirstName }}</h1>
</mat-checkbox>
</section>


<!-- fixed submit button, needs link to api -->
<div fxLayout="row" fxFlexFill style="padding-top: 12px">
<button [hidden]="mode === 'edit'" fxFlexAlign="start" type="button" mat-stroked-button (click)="signOut()">
Sign Out
<button [hidden]="mode === 'edit'" fxFlexAlign="start" type="button" mat-stroked-button (click)="submit()">
Submit
</button>
<div fxFlex></div>
<button
Expand Down