Browse Source

refactor: manage profile

pull/1993/head
mehmet-erim 6 years ago
parent
commit
3f3af81d49
  1. 2
      npm/ng-packs/packages/account/src/lib/components/personal-settings/personal-settings.component.html
  2. 9
      npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.html
  3. 29
      npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.ts
  4. 2
      npm/ng-packs/packages/theme-shared/src/lib/components/button/button.component.ts
  5. 9
      npm/package.json

2
npm/ng-packs/packages/account/src/lib/components/personal-settings/personal-settings.component.html

@ -25,7 +25,7 @@
<label for="phone-number">{{ 'AbpIdentity::DisplayName:PhoneNumber' | abpLocalization }}</label
><input type="text" id="phone-number" class="form-control" formControlName="phoneNumber" />
</div>
<abp-button iconClass="fa fa-check" buttonClass="btn btn-primary color-white" (click)="submit()">
<abp-button buttonType="submit" iconClass="fa fa-check" buttonClass="btn btn-primary color-white">
{{ 'AbpIdentity::Save' | abpLocalization }}</abp-button
>
</form>

9
npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.html

@ -115,15 +115,10 @@
{{ (currentUser$ | async)?.userName }}
</a>
<div ngbDropdownMenu class="dropdown-menu dropdown-menu-right">
<a class="dropdown-item pointer" (click)="isOpenChangePassword = true">{{
'AbpUi::ChangePassword' | abpLocalization
<a class="dropdown-item pointer" routerLink="/account/manage-profile">{{
'AbpAccount::ManageYourProfile' | abpLocalization
}}</a>
<a class="dropdown-item pointer" (click)="isOpenProfile = true">{{ 'AbpUi::PersonalInfo' | abpLocalization }}</a>
<a class="dropdown-item pointer" (click)="logout()">{{ 'AbpUi::Logout' | abpLocalization }}</a>
</div>
</li>
<abp-change-password [(visible)]="isOpenChangePassword"></abp-change-password>
<abp-profile [(visible)]="isOpenProfile"></abp-profile>
</ng-template>

29
npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.ts

@ -6,7 +6,7 @@ import {
eLayoutType,
SetLanguage,
SessionState,
takeUntilDestroy
takeUntilDestroy,
} from '@abp/ng.core';
import {
AfterViewInit,
@ -16,7 +16,7 @@ import {
TemplateRef,
TrackByFunction,
ViewChild,
ViewChildren
ViewChildren,
} from '@angular/core';
import { NgbDropdown } from '@ng-bootstrap/ng-bootstrap';
import { Navigate, RouterState } from '@ngxs/router-plugin';
@ -32,7 +32,7 @@ import { LayoutState } from '../../states';
@Component({
selector: 'abp-layout-application',
templateUrl: './application-layout.component.html'
templateUrl: './application-layout.component.html',
})
export class ApplicationLayoutComponent implements AfterViewInit, OnDestroy {
// required for dynamic component
@ -59,10 +59,6 @@ export class ApplicationLayoutComponent implements AfterViewInit, OnDestroy {
@ViewChildren('navbarRootDropdown', { read: NgbDropdown })
navbarRootDropdowns: QueryList<NgbDropdown>;
isOpenChangePassword = false;
isOpenProfile = false;
isDropdownChildDynamic: boolean;
get visibleRoutes$(): Observable<ABP.FullRoute[]> {
@ -71,13 +67,16 @@ export class ApplicationLayoutComponent implements AfterViewInit, OnDestroy {
get defaultLanguage$(): Observable<string> {
return this.languages$.pipe(
map(languages => snq(() => languages.find(lang => lang.cultureName === this.selectedLangCulture).displayName), '')
map(
languages => snq(() => languages.find(lang => lang.cultureName === this.selectedLangCulture).displayName),
'',
),
);
}
get dropdownLanguages$(): Observable<ApplicationConfiguration.Language[]> {
return this.languages$.pipe(
map(languages => snq(() => languages.filter(lang => lang.cultureName !== this.selectedLangCulture)), [])
map(languages => snq(() => languages.filter(lang => lang.cultureName !== this.selectedLangCulture)), []),
);
}
@ -113,8 +112,8 @@ export class ApplicationLayoutComponent implements AfterViewInit, OnDestroy {
this.store.dispatch(
new AddNavigationElement([
{ element: this.languageRef, order: 4, name: 'LanguageRef' },
{ element: this.currentUserRef, order: 5, name: 'CurrentUserRef' }
])
{ element: this.currentUserRef, order: 5, name: 'CurrentUserRef' },
]),
);
}
@ -122,7 +121,7 @@ export class ApplicationLayoutComponent implements AfterViewInit, OnDestroy {
.pipe(
map(elements => elements.map(({ element }) => element)),
filter(elements => !compare(elements, this.rightPartElements)),
takeUntilDestroy(this)
takeUntilDestroy(this),
)
.subscribe(elements => {
setTimeout(() => (this.rightPartElements = elements), 0);
@ -133,7 +132,7 @@ export class ApplicationLayoutComponent implements AfterViewInit, OnDestroy {
fromEvent(window, 'resize')
.pipe(
takeUntilDestroy(this),
debounceTime(250)
debounceTime(250),
)
.subscribe(() => {
this.checkWindowWidth();
@ -150,8 +149,8 @@ export class ApplicationLayoutComponent implements AfterViewInit, OnDestroy {
this.oauthService.logOut();
this.store.dispatch(
new Navigate(['/'], null, {
state: { redirectUrl: this.store.selectSnapshot(RouterState).state.url }
})
state: { redirectUrl: this.store.selectSnapshot(RouterState).state.url },
}),
);
this.store.dispatch(new GetAppConfiguration());
}

2
npm/ng-packs/packages/theme-shared/src/lib/components/button/button.component.ts

@ -7,7 +7,7 @@ import { ABP } from '@abp/ng.core';
template: `
<button
#button
[attr.type]="type"
[attr.type]="buttonType || type"
[ngClass]="buttonClass"
[disabled]="loading || disabled"
(click)="click.emit($event)"

9
npm/package.json

@ -1,5 +1,8 @@
{
"devDependencies": {
"lerna": "^2.11.0"
}
"scripts": {
"lerna": "lerna"
},
"devDependencies": {
"lerna": "^2.11.0"
}
}

Loading…
Cancel
Save