Browse Source

refactoring

pull/22829/head
erdemcaygor 1 year ago
parent
commit
e9c7e7623f
  1. 7
      npm/ng-packs/packages/account/src/lib/components/change-password/change-password.component.ts
  2. 2
      npm/ng-packs/packages/account/src/lib/components/forgot-password/forgot-password.component.html
  3. 15
      npm/ng-packs/packages/account/src/lib/components/forgot-password/forgot-password.component.ts
  4. 15
      npm/ng-packs/packages/account/src/lib/components/login/login.component.ts
  5. 16
      npm/ng-packs/packages/account/src/lib/components/manage-profile/manage-profile.component.ts
  6. 16
      npm/ng-packs/packages/account/src/lib/components/personal-settings/personal-settings.component.ts
  7. 15
      npm/ng-packs/packages/account/src/lib/components/register/register.component.ts
  8. 17
      npm/ng-packs/packages/account/src/lib/components/reset-password/reset-password.component.ts
  9. 4
      npm/ng-packs/packages/core/src/lib/localization.module.ts

7
npm/ng-packs/packages/account/src/lib/components/change-password/change-password.component.ts

@ -1,5 +1,5 @@
import { ProfileService } from '@abp/ng.account.core/proxy';
import { getPasswordValidators, ThemeSharedModule, ToasterService } from '@abp/ng.theme.shared';
import { ButtonComponent, getPasswordValidators, ToasterService } from '@abp/ng.theme.shared';
import { Component, Injector, OnInit } from '@angular/core';
import {
ReactiveFormsModule,
@ -12,8 +12,7 @@ import { comparePasswords, Validation } from '@ngx-validate/core';
import { finalize } from 'rxjs/operators';
import { Account } from '../../models/account';
import { ManageProfileStateService } from '../../services/manage-profile.state.service';
import { CoreModule } from '@abp/ng.core';
import { CommonModule } from '@angular/common';
import { LocalizationPipe } from '@abp/ng.core';
const { required } = Validators;
@ -23,7 +22,7 @@ const PASSWORD_FIELDS = ['newPassword', 'repeatNewPassword'];
selector: 'abp-change-password-form',
templateUrl: './change-password.component.html',
exportAs: 'abpChangePasswordForm',
imports: [CommonModule, ReactiveFormsModule, CoreModule, ThemeSharedModule],
imports: [ReactiveFormsModule, LocalizationPipe, ButtonComponent, NgxValidateCoreModule],
})
export class ChangePasswordComponent
implements OnInit, Account.ChangePasswordComponentInputs, Account.ChangePasswordComponentOutputs

2
npm/ng-packs/packages/account/src/lib/components/forgot-password/forgot-password.component.html

@ -1,7 +1,7 @@
<h4>{{ 'AbpAccount::ForgotPassword' | abpLocalization }}</h4>
@if (!isEmailSent) {
<form [formGroup]="form" (ngSubmit)="onSubmit()" validateOnSubmit>
<form [formGroup]="form" (ngSubmit)="onSubmit()" [validateOnSubmit]="true">
<p>{{ 'AbpAccount::SendPasswordResetLink_Information' | abpLocalization }}</p>
<div class="mb-3 form-group">
<label for="input-email-address" class="form-label">{{

15
npm/ng-packs/packages/account/src/lib/components/forgot-password/forgot-password.component.ts

@ -7,14 +7,21 @@ import {
Validators,
} from '@angular/forms';
import { finalize } from 'rxjs/operators';
import { CoreModule } from '@abp/ng.core';
import { ThemeSharedModule } from '@abp/ng.theme.shared';
import { CommonModule } from '@angular/common';
import { LocalizationPipe } from '@abp/ng.core';
import { ButtonComponent } from '@abp/ng.theme.shared';
import { RouterModule } from '@angular/router';
import { NgxValidateCoreModule } from '@ngx-validate/core';
@Component({
selector: 'abp-forgot-password',
templateUrl: 'forgot-password.component.html',
imports: [CommonModule, ReactiveFormsModule, CoreModule, ThemeSharedModule],
imports: [
ReactiveFormsModule,
RouterModule,
LocalizationPipe,
ButtonComponent,
NgxValidateCoreModule,
],
})
export class ForgotPasswordComponent {
form: UntypedFormGroup;

15
npm/ng-packs/packages/account/src/lib/components/login/login.component.ts

@ -1,5 +1,5 @@
import { AuthService, ConfigStateService, CoreModule } from '@abp/ng.core';
import { ThemeSharedModule, ToasterService } from '@abp/ng.theme.shared';
import { AuthService, ConfigStateService, LocalizationPipe } from '@abp/ng.core';
import { ButtonComponent, ToasterService } from '@abp/ng.theme.shared';
import { Component, Injector, OnInit, inject } from '@angular/core';
import {
ReactiveFormsModule,
@ -11,14 +11,21 @@ import { throwError } from 'rxjs';
import { catchError, finalize } from 'rxjs/operators';
import { eAccountComponents } from '../../enums/components';
import { getRedirectUrl } from '../../utils/auth-utils';
import { CommonModule } from '@angular/common';
import { NgxValidateCoreModule } from '@ngx-validate/core';
import { RouterModule } from '@angular/router';
const { maxLength, required } = Validators;
@Component({
selector: 'abp-login',
templateUrl: './login.component.html',
imports: [CommonModule, ReactiveFormsModule, CoreModule, ThemeSharedModule],
imports: [
ReactiveFormsModule,
RouterModule,
LocalizationPipe,
ButtonComponent,
NgxValidateCoreModule,
],
})
export class LoginComponent implements OnInit {
protected injector = inject(Injector);

16
npm/ng-packs/packages/account/src/lib/components/manage-profile/manage-profile.component.ts

@ -1,12 +1,14 @@
import { ProfileService } from '@abp/ng.account.core/proxy';
import { fadeIn, ThemeSharedModule } from '@abp/ng.theme.shared';
import { fadeIn, LoadingDirective } from '@abp/ng.theme.shared';
import { transition, trigger, useAnimation } from '@angular/animations';
import { Component, OnInit } from '@angular/core';
import { eAccountComponents } from '../../enums/components';
import { ManageProfileStateService } from '../../services/manage-profile.state.service';
import { CommonModule } from '@angular/common';
import { ReactiveFormsModule } from '@angular/forms';
import { CoreModule } from '@abp/ng.core';
import { LocalizationPipe, ReplaceableTemplateDirective } from '@abp/ng.core';
import { PersonalSettingsComponent } from '../personal-settings/personal-settings.component';
import { ChangePasswordComponent } from '../change-password/change-password.component';
@Component({
selector: 'abp-manage-profile',
@ -20,7 +22,15 @@ import { CoreModule } from '@abp/ng.core';
}
`,
],
imports: [CommonModule, ReactiveFormsModule, CoreModule, ThemeSharedModule],
imports: [
CommonModule,
ReactiveFormsModule,
PersonalSettingsComponent,
ChangePasswordComponent,
LocalizationPipe,
ReplaceableTemplateDirective,
LoadingDirective,
],
})
export class ManageProfileComponent implements OnInit {
selectedTab = 0;

16
npm/ng-packs/packages/account/src/lib/components/personal-settings/personal-settings.component.ts

@ -1,8 +1,8 @@
import { ProfileDto, ProfileService } from '@abp/ng.account.core/proxy';
import {
ButtonComponent,
Confirmation,
ConfirmationService,
ThemeSharedModule,
ToasterService,
} from '@abp/ng.theme.shared';
import { Component, inject, Injector, OnInit } from '@angular/core';
@ -10,16 +10,16 @@ import { ReactiveFormsModule, UntypedFormBuilder, UntypedFormGroup } from '@angu
import { finalize, filter } from 'rxjs/operators';
import { Account } from '../../models/account';
import { ManageProfileStateService } from '../../services/manage-profile.state.service';
import { AuthService, ConfigStateService, CoreModule } from '@abp/ng.core';
import { AuthService, ConfigStateService, LocalizationPipe } from '@abp/ng.core';
import { RE_LOGIN_CONFIRMATION_TOKEN } from '../../tokens';
import {
ExtensibleModule,
ExtensibleFormComponent,
EXTENSIONS_IDENTIFIER,
FormPropData,
generateFormFromProps,
} from '@abp/ng.components/extensible';
import { eAccountComponents } from '../../enums';
import { CommonModule } from '@angular/common';
import { NgxValidateCoreModule } from '@ngx-validate/core';
@Component({
selector: 'abp-personal-settings-form',
@ -31,7 +31,13 @@ import { CommonModule } from '@angular/common';
useValue: eAccountComponents.PersonalSettings,
},
],
imports: [CommonModule, ReactiveFormsModule, CoreModule, ThemeSharedModule, ExtensibleModule],
imports: [
ReactiveFormsModule,
ExtensibleFormComponent,
NgxValidateCoreModule,
ButtonComponent,
LocalizationPipe,
],
})
export class PersonalSettingsComponent
implements

15
npm/ng-packs/packages/account/src/lib/components/register/register.component.ts

@ -1,6 +1,6 @@
import { AccountService, RegisterDto } from '@abp/ng.account.core/proxy';
import { AuthService, ConfigStateService, CoreModule } from '@abp/ng.core';
import { getPasswordValidators, ThemeSharedModule, ToasterService } from '@abp/ng.theme.shared';
import { AuthService, ConfigStateService, LocalizationPipe } from '@abp/ng.core';
import { ButtonComponent, getPasswordValidators, ToasterService } from '@abp/ng.theme.shared';
import { Component, Injector, OnInit } from '@angular/core';
import {
ReactiveFormsModule,
@ -12,14 +12,21 @@ import { throwError } from 'rxjs';
import { catchError, finalize, switchMap } from 'rxjs/operators';
import { eAccountComponents } from '../../enums/components';
import { getRedirectUrl } from '../../utils/auth-utils';
import { CommonModule } from '@angular/common';
import { NgxValidateCoreModule } from '@ngx-validate/core';
import { RouterModule } from '@angular/router';
const { maxLength, required, email } = Validators;
@Component({
selector: 'abp-register',
templateUrl: './register.component.html',
imports: [CommonModule, ReactiveFormsModule, CoreModule, ThemeSharedModule],
imports: [
ReactiveFormsModule,
RouterModule,
NgxValidateCoreModule,
LocalizationPipe,
ButtonComponent,
],
})
export class RegisterComponent implements OnInit {
form!: UntypedFormGroup;

17
npm/ng-packs/packages/account/src/lib/components/reset-password/reset-password.component.ts

@ -1,5 +1,5 @@
import { AccountService } from '@abp/ng.account.core/proxy';
import { getPasswordValidators, ThemeSharedModule } from '@abp/ng.theme.shared';
import { ButtonComponent, getPasswordValidators } from '@abp/ng.theme.shared';
import { Component, Injector, OnInit } from '@angular/core';
import {
ReactiveFormsModule,
@ -7,18 +7,23 @@ import {
UntypedFormGroup,
Validators,
} from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { comparePasswords, Validation } from '@ngx-validate/core';
import { ActivatedRoute, Router, RouterModule } from '@angular/router';
import { comparePasswords, NgxValidateCoreModule, Validation } from '@ngx-validate/core';
import { finalize } from 'rxjs/operators';
import { CommonModule } from '@angular/common';
import { CoreModule } from '@abp/ng.core';
import { LocalizationPipe } from '@abp/ng.core';
const PASSWORD_FIELDS = ['password', 'confirmPassword'];
@Component({
selector: 'abp-reset-password',
templateUrl: './reset-password.component.html',
imports: [CommonModule, ReactiveFormsModule, CoreModule, ThemeSharedModule],
imports: [
ReactiveFormsModule,
RouterModule,
NgxValidateCoreModule,
LocalizationPipe,
ButtonComponent,
],
})
export class ResetPasswordComponent implements OnInit {
form!: UntypedFormGroup;

4
npm/ng-packs/packages/core/src/lib/localization.module.ts

@ -3,8 +3,8 @@ import { LocalizationPipe } from './pipes/localization.pipe';
import { LazyLocalizationPipe } from './pipes';
/**
* @deprecated Use `LocalizationPipe` directly as a standalone pipe.
* This module is no longer necessary for using the `LocalizationPipe`.
* @deprecated Use `LocalizationPipe` and `LazyLocalizationPipe` directly as a standalone pipe.
* This module is no longer necessary for using the `LocalizationPipe` and `LazyLocalizationPipe` pipes.
*/
@NgModule({

Loading…
Cancel
Save