From 89f873b060ea469898f993b4e53b442aedaf1bf6 Mon Sep 17 00:00:00 2001 From: Fahri Gedik <53567152+fahrigedik@users.noreply.github.com> Date: Thu, 15 Jan 2026 13:01:31 +0300 Subject: [PATCH] Refactor profile and alert components for cleaner templates Simplified the HTML structure of manage-profile and page-alert-container components by reducing unnecessary markup and improving readability. Replaced Angular animation usage in manage-profile with a CSS-based fade-in effect for better maintainability. --- .../manage-profile.component.html | 78 ++++++++----------- .../manage-profile.component.ts | 20 +++-- .../page-alert-container.component.html | 36 +++------ 3 files changed, 58 insertions(+), 76 deletions(-) diff --git a/npm/ng-packs/packages/account/src/lib/components/manage-profile/manage-profile.component.html b/npm/ng-packs/packages/account/src/lib/components/manage-profile/manage-profile.component.html index ba58de211b..91167b0ede 100644 --- a/npm/ng-packs/packages/account/src/lib/components/manage-profile/manage-profile.component.html +++ b/npm/ng-packs/packages/account/src/lib/components/manage-profile/manage-profile.component.html @@ -5,61 +5,47 @@
@if (profile$ | async) { -
- @if (selectedTab === 0) { -
-
-

- {{ 'AbpIdentity::ChangePassword' | abpLocalization }} -
-

- + @if (selectedTab === 0) { +
+
+

+ {{ 'AbpIdentity::ChangePassword' | abpLocalization }} +
+

+ -
-
- } - @if (selectedTab === 1) { -
-
-

- {{ 'AbpIdentity::PersonalSettings' | abpLocalization }} -
-

- +
+
+ } + @if (selectedTab === 1) { +
+
+

+ {{ 'AbpIdentity::PersonalSettings' | abpLocalization }} +
+

+ -
-
- } + }"> +
+ } +
} - + \ No newline at end of file diff --git a/npm/ng-packs/packages/account/src/lib/components/manage-profile/manage-profile.component.ts b/npm/ng-packs/packages/account/src/lib/components/manage-profile/manage-profile.component.ts index 368818090d..5be91d34f7 100644 --- a/npm/ng-packs/packages/account/src/lib/components/manage-profile/manage-profile.component.ts +++ b/npm/ng-packs/packages/account/src/lib/components/manage-profile/manage-profile.component.ts @@ -1,6 +1,5 @@ import { ProfileService } from '@abp/ng.account.core/proxy'; -import { fadeIn, LoadingDirective } from '@abp/ng.theme.shared'; -import { transition, trigger, useAnimation } from '@angular/animations'; +import { LoadingDirective } from '@abp/ng.theme.shared'; import { Component, inject, OnInit } from '@angular/core'; import { eAccountComponents } from '../../enums/components'; import { ManageProfileStateService } from '../../services/manage-profile.state.service'; @@ -13,13 +12,24 @@ import { ChangePasswordComponent } from '../change-password/change-password.comp @Component({ selector: 'abp-manage-profile', templateUrl: './manage-profile.component.html', - animations: [trigger('fadeIn', [transition(':enter', useAnimation(fadeIn))])], styles: [ - //TODO: move static styles ` .min-h-400 { min-height: 400px; } + + .fade-in { + animation: fadeIn 350ms ease both; + } + + @keyframes fadeIn { + from { + opacity: 0; + } + to { + opacity: 1; + } + } `, ], imports: [ @@ -30,7 +40,7 @@ import { ChangePasswordComponent } from '../change-password/change-password.comp LocalizationPipe, ReplaceableTemplateDirective, LoadingDirective -], + ], }) export class ManageProfileComponent implements OnInit { protected profileService = inject(ProfileService); diff --git a/npm/ng-packs/packages/theme-basic/src/lib/components/page-alert-container/page-alert-container.component.html b/npm/ng-packs/packages/theme-basic/src/lib/components/page-alert-container/page-alert-container.component.html index a2bd76ebd8..daaa6c48ec 100644 --- a/npm/ng-packs/packages/theme-basic/src/lib/components/page-alert-container/page-alert-container.component.html +++ b/npm/ng-packs/packages/theme-basic/src/lib/components/page-alert-container/page-alert-container.component.html @@ -1,26 +1,12 @@ @for (alert of service.alerts$ | async; track i; let i = $index) { - -} + +} \ No newline at end of file