Browse Source

standalone applied to reset password, personal settings and change password

pull/22816/head
erdemcaygor 1 year ago
parent
commit
93cf586a7c
  1. 17
      npm/ng-packs/packages/account/src/lib/account.module.ts
  2. 7
      npm/ng-packs/packages/account/src/lib/components/change-password/change-password.component.ts
  3. 2
      npm/ng-packs/packages/account/src/lib/components/manage-profile/manage-profile.component.ts
  4. 7
      npm/ng-packs/packages/account/src/lib/components/personal-settings/personal-settings-half-row.component.ts
  5. 14
      npm/ng-packs/packages/account/src/lib/components/personal-settings/personal-settings.component.ts
  6. 2
      npm/ng-packs/packages/account/src/lib/components/reset-password/reset-password.component.ts

17
npm/ng-packs/packages/account/src/lib/account.module.ts

@ -4,31 +4,18 @@ import { ModuleWithProviders, NgModule, NgModuleFactory } from '@angular/core';
import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
import { NgxValidateCoreModule } from '@ngx-validate/core'; import { NgxValidateCoreModule } from '@ngx-validate/core';
import { AccountRoutingModule } from './account-routing.module'; import { AccountRoutingModule } from './account-routing.module';
import { ChangePasswordComponent } from './components/change-password/change-password.component';
import { ManageProfileComponent } from './components/manage-profile/manage-profile.component';
import { PersonalSettingsComponent } from './components/personal-settings/personal-settings.component';
import { AccountConfigOptions } from './models/config-options'; import { AccountConfigOptions } from './models/config-options';
import { ACCOUNT_CONFIG_OPTIONS } from './tokens/config-options.token'; import { ACCOUNT_CONFIG_OPTIONS } from './tokens/config-options.token';
import { accountConfigOptionsFactory } from './utils/factory-utils'; import { accountConfigOptionsFactory } from './utils/factory-utils';
import { AuthenticationFlowGuard } from './guards/authentication-flow.guard'; import { AuthenticationFlowGuard } from './guards/authentication-flow.guard';
import { ResetPasswordComponent } from './components/reset-password/reset-password.component';
import { RE_LOGIN_CONFIRMATION_TOKEN } from './tokens'; import { RE_LOGIN_CONFIRMATION_TOKEN } from './tokens';
import { ACCOUNT_EDIT_FORM_PROP_CONTRIBUTORS } from './tokens/extensions.token'; import { ACCOUNT_EDIT_FORM_PROP_CONTRIBUTORS } from './tokens/extensions.token';
import { AccountExtensionsGuard } from './guards/extensions.guard'; import { AccountExtensionsGuard } from './guards/extensions.guard';
import { PersonalSettingsHalfRowComponent } from './components/personal-settings/personal-settings-half-row.component';
import { ExtensibleModule } from '@abp/ng.components/extensible'; import { ExtensibleModule } from '@abp/ng.components/extensible';
const declarations = [
ChangePasswordComponent,
ManageProfileComponent,
PersonalSettingsComponent,
ResetPasswordComponent,
PersonalSettingsHalfRowComponent,
];
@NgModule({ @NgModule({
declarations: [...declarations], declarations: [],
imports: [ imports: [
CoreModule, CoreModule,
AccountRoutingModule, AccountRoutingModule,
@ -37,7 +24,7 @@ const declarations = [
NgxValidateCoreModule, NgxValidateCoreModule,
ExtensibleModule, ExtensibleModule,
], ],
exports: [...declarations], exports: [],
}) })
export class AccountModule { export class AccountModule {
static forChild(options = {} as AccountConfigOptions): ModuleWithProviders<AccountModule> { static forChild(options = {} as AccountConfigOptions): ModuleWithProviders<AccountModule> {

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

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

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

@ -6,7 +6,6 @@ import { eAccountComponents } from '../../enums/components';
import { ManageProfileStateService } from '../../services/manage-profile.state.service'; import { ManageProfileStateService } from '../../services/manage-profile.state.service';
@Component({ @Component({
standalone: false,
selector: 'abp-manage-profile', selector: 'abp-manage-profile',
templateUrl: './manage-profile.component.html', templateUrl: './manage-profile.component.html',
animations: [trigger('fadeIn', [transition(':enter', useAnimation(fadeIn))])], animations: [trigger('fadeIn', [transition(':enter', useAnimation(fadeIn))])],
@ -17,6 +16,7 @@ import { ManageProfileStateService } from '../../services/manage-profile.state.s
} }
`, `,
], ],
imports: [CoreModule, ThemeSharedModule, CommonModule, ReactiveFormsModule],
}) })
export class ManageProfileComponent implements OnInit { export class ManageProfileComponent implements OnInit {
selectedTab = 0; selectedTab = 0;

7
npm/ng-packs/packages/account/src/lib/components/personal-settings/personal-settings-half-row.component.ts

@ -4,10 +4,12 @@ import {
FormProp, FormProp,
EXTENSIBLE_FORM_VIEW_PROVIDER, EXTENSIBLE_FORM_VIEW_PROVIDER,
} from '@abp/ng.components/extensible'; } from '@abp/ng.components/extensible';
import { UntypedFormGroup } from '@angular/forms'; import { ReactiveFormsModule, UntypedFormGroup } from '@angular/forms';
import { CommonModule } from '@angular/common';
import { CoreModule } from '@abp/ng.core';
import { ThemeSharedModule } from '@abp/ng.theme.shared';
@Component({ @Component({
standalone: false,
selector: 'abp-personal-settings-half-row', selector: 'abp-personal-settings-half-row',
template: ` <div class="w-50 d-inline"> template: ` <div class="w-50 d-inline">
<label [attr.for]="name" class="form-label">{{ displayName | abpLocalization }} </label> <label [attr.for]="name" class="form-label">{{ displayName | abpLocalization }} </label>
@ -21,6 +23,7 @@ import { UntypedFormGroup } from '@angular/forms';
</div>`, </div>`,
styles: [], styles: [],
viewProviders: [EXTENSIBLE_FORM_VIEW_PROVIDER], viewProviders: [EXTENSIBLE_FORM_VIEW_PROVIDER],
imports: [CommonModule, ReactiveFormsModule, CoreModule, ThemeSharedModule],
}) })
export class PersonalSettingsHalfRowComponent { export class PersonalSettingsHalfRowComponent {
public displayName: string; public displayName: string;

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

@ -1,11 +1,16 @@
import { ProfileDto, ProfileService } from '@abp/ng.account.core/proxy'; import { ProfileDto, ProfileService } from '@abp/ng.account.core/proxy';
import { Confirmation, ConfirmationService, ToasterService } from '@abp/ng.theme.shared'; import {
Confirmation,
ConfirmationService,
ThemeSharedModule,
ToasterService,
} from '@abp/ng.theme.shared';
import { Component, inject, Injector, OnInit } from '@angular/core'; import { Component, inject, Injector, OnInit } from '@angular/core';
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms'; import { ReactiveFormsModule, UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
import { finalize, filter } from 'rxjs/operators'; import { finalize, filter } from 'rxjs/operators';
import { Account } from '../../models/account'; import { Account } from '../../models/account';
import { ManageProfileStateService } from '../../services/manage-profile.state.service'; import { ManageProfileStateService } from '../../services/manage-profile.state.service';
import { AuthService, ConfigStateService } from '@abp/ng.core'; import { AuthService, ConfigStateService, CoreModule } from '@abp/ng.core';
import { RE_LOGIN_CONFIRMATION_TOKEN } from '../../tokens'; import { RE_LOGIN_CONFIRMATION_TOKEN } from '../../tokens';
import { import {
EXTENSIONS_IDENTIFIER, EXTENSIONS_IDENTIFIER,
@ -13,9 +18,9 @@ import {
generateFormFromProps, generateFormFromProps,
} from '@abp/ng.components/extensible'; } from '@abp/ng.components/extensible';
import { eAccountComponents } from '../../enums'; import { eAccountComponents } from '../../enums';
import { CommonModule } from '@angular/common';
@Component({ @Component({
standalone: false,
selector: 'abp-personal-settings-form', selector: 'abp-personal-settings-form',
templateUrl: './personal-settings.component.html', templateUrl: './personal-settings.component.html',
exportAs: 'abpPersonalSettingsForm', exportAs: 'abpPersonalSettingsForm',
@ -25,6 +30,7 @@ import { eAccountComponents } from '../../enums';
useValue: eAccountComponents.PersonalSettings, useValue: eAccountComponents.PersonalSettings,
}, },
], ],
imports: [CommonModule, ReactiveFormsModule, CoreModule, ThemeSharedModule],
}) })
export class PersonalSettingsComponent export class PersonalSettingsComponent
implements implements

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

@ -9,9 +9,9 @@ import { finalize } from 'rxjs/operators';
const PASSWORD_FIELDS = ['password', 'confirmPassword']; const PASSWORD_FIELDS = ['password', 'confirmPassword'];
@Component({ @Component({
standalone: false,
selector: 'abp-reset-password', selector: 'abp-reset-password',
templateUrl: './reset-password.component.html', templateUrl: './reset-password.component.html',
imports: [CoreModule, ThemeSharedModule, ReactiveFormsModule, CommonModule],
}) })
export class ResetPasswordComponent implements OnInit { export class ResetPasswordComponent implements OnInit {
form!: UntypedFormGroup; form!: UntypedFormGroup;

Loading…
Cancel
Save