forked from neekware/fullerstack
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
60 changed files
with
1,310 additions
and
288 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
apps/fullerstack/src/app/pages/user/profile-update.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<mat-toolbar class="fs-page-header" color="primary"> </mat-toolbar> | ||
<div class="fs-page-content"> | ||
<fullerstack-card | ||
class="fs-page-card" | ||
fxLayout="column" | ||
fxFlex.xs="100" | ||
fxFlex.sm="80" | ||
fxFlex.gt-sm="600px" | ||
[title]="title" | ||
[subtitle]="subtitle" | ||
[icon]="icon" | ||
[progress]="user.isLoading" | ||
> | ||
<fullerstack-user-profile-form (submit$)="update($event)" [profile]="user.profile"></fullerstack-user-profile-form> | ||
|
||
<mat-divider class="mt1"></mat-divider> | ||
|
||
<div class="mt2" fxLayout="row"> | ||
<span> | ||
[ | ||
<a routerLink="/auth/login" class="no-underline"> {{ 'COMMON.LOGIN' | translate }} </a> | ||
] | ||
</span> | ||
<div fxFlex></div> | ||
<span> | ||
[ | ||
<a routerLink="/recovery/password/reset" class="no-underline"> {{ 'COMMON.FORGOT_PASSWORD' | translate }} </a> | ||
] | ||
</span> | ||
</div> | ||
</fullerstack-card> | ||
</div> |
Empty file.
24 changes: 24 additions & 0 deletions
24
apps/fullerstack/src/app/pages/user/profile-update.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { ProfileUpdateComponent } from './profile-update.component'; | ||
|
||
xdescribe('ProfileUpdateComponent', () => { | ||
let component: ProfileUpdateComponent; | ||
let fixture: ComponentFixture<ProfileUpdateComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [ProfileUpdateComponent], | ||
}).compileComponents(); | ||
}); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(ProfileUpdateComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
35 changes: 35 additions & 0 deletions
35
apps/fullerstack/src/app/pages/user/profile-update.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { Component, OnDestroy } from '@angular/core'; | ||
import { AuthService } from '@fullerstack/ngx-auth'; | ||
import { ConfigService } from '@fullerstack/ngx-config'; | ||
import { UserSelfUpdateInput } from '@fullerstack/ngx-gql/schema'; | ||
import { _ } from '@fullerstack/ngx-i18n'; | ||
import { UserService } from '@fullerstack/ngx-user'; | ||
import { Subject } from 'rxjs'; | ||
import { takeUntil } from 'rxjs/operators'; | ||
|
||
@Component({ | ||
selector: 'fullerstack-user-profile-update', | ||
templateUrl: './profile-update.component.html', | ||
styleUrls: ['./profile-update.component.scss'], | ||
}) | ||
export class ProfileUpdateComponent implements OnDestroy { | ||
destroy$ = new Subject<boolean>(); | ||
title = _('COMMON.PROFILE'); | ||
subtitle = _('COMMON.PROFILE_UPDATE'); | ||
icon = 'account-edit-outline'; | ||
|
||
constructor( | ||
readonly config: ConfigService, | ||
readonly auth: AuthService, | ||
readonly user: UserService | ||
) {} | ||
|
||
update(data: UserSelfUpdateInput) { | ||
this.user.userSelfUpdate(data).pipe(takeUntil(this.destroy$)).subscribe(); | ||
} | ||
|
||
ngOnDestroy() { | ||
this.destroy$.next(true); | ||
this.destroy$.complete(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.