Browse Source

refactor: manage profile

pull/1974/head
mehmet-erim 7 years ago
parent
commit
cc9d98135c
  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
  6. 7
      npm/publish.ps1

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 <label for="phone-number">{{ 'AbpIdentity::DisplayName:PhoneNumber' | abpLocalization }}</label
><input type="text" id="phone-number" class="form-control" formControlName="phoneNumber" /> ><input type="text" id="phone-number" class="form-control" formControlName="phoneNumber" />
</div> </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 {{ 'AbpIdentity::Save' | abpLocalization }}</abp-button
> >
</form> </form>

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

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

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

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

9
npm/package.json

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

7
npm/publish.ps1

@ -1,4 +1,7 @@
& lerna publish --no-push & cd ng-packs\scripts
cd ng-packs\scripts
& npm install & npm install
& npm run build
& cd ../../
& yarn lerna publish --no-push
& cd ng-packs\scripts
& npm run sync & npm run sync
Loading…
Cancel
Save