From 59237a22d5749ac8206aea3558d05b23a975f382 Mon Sep 17 00:00:00 2001
From: AleksanderSklorz <115619721+AleksanderSklorz@users.noreply.github.com>
Date: Tue, 7 Oct 2025 08:05:43 +0200
Subject: [PATCH] [ACS-10214] Fixed navigation for go to personal files button
on profile page (#4828)
---
projects/aca-content/assets/i18n/en.json | 3 ++-
.../view-profile/view-profile.component.html | 9 ++++++++-
.../view-profile/view-profile.component.scss | 13 ++++++++-----
.../view-profile/view-profile.component.spec.ts | 15 +++++++++++++++
4 files changed, 33 insertions(+), 7 deletions(-)
diff --git a/projects/aca-content/assets/i18n/en.json b/projects/aca-content/assets/i18n/en.json
index a618e3c1f..c5353b36c 100644
--- a/projects/aca-content/assets/i18n/en.json
+++ b/projects/aca-content/assets/i18n/en.json
@@ -64,7 +64,8 @@
"NAME": "Name",
"ADDRESS": "Address",
"POSTCODE": "Postcode",
- "INVALID_INPUT": "Invalid Input"
+ "INVALID_INPUT": "Invalid Input",
+ "GO_TO_PERSONAL_FILES_BUTTON_LABEL": "Go to Personal Files"
},
"LOCKED_BY": "Locked by: ",
"PREVIEW": {
diff --git a/projects/aca-content/src/lib/components/view-profile/view-profile.component.html b/projects/aca-content/src/lib/components/view-profile/view-profile.component.html
index be56c42a2..66b0c7705 100644
--- a/projects/aca-content/src/lib/components/view-profile/view-profile.component.html
+++ b/projects/aca-content/src/lib/components/view-profile/view-profile.component.html
@@ -5,7 +5,14 @@
title="{{'APP.TOOLTIPS.EXPAND_NAVIGATION' | translate}}">
menu
- arrow_back
+
{{'APP.EDIT_PROFILE.MY_PROFILE' | translate}}
diff --git a/projects/aca-content/src/lib/components/view-profile/view-profile.component.scss b/projects/aca-content/src/lib/components/view-profile/view-profile.component.scss
index ed9a04f47..119e535e1 100644
--- a/projects/aca-content/src/lib/components/view-profile/view-profile.component.scss
+++ b/projects/aca-content/src/lib/components/view-profile/view-profile.component.scss
@@ -20,6 +20,14 @@ app-view-profile {
align-items: center;
height: 32px;
padding: 0 24px;
+
+ .app-profile-icon {
+ margin-right: 1rem;
+ cursor: pointer;
+ width: 24px;
+ height: 24px;
+ padding: 0;
+ }
}
.app-profile {
@@ -34,11 +42,6 @@ app-view-profile {
border-radius: 1rem;
}
- .app-profile-icon {
- margin-right: 1rem;
- cursor: pointer;
- }
-
.app-profile-general-icon {
cursor: pointer;
}
diff --git a/projects/aca-content/src/lib/components/view-profile/view-profile.component.spec.ts b/projects/aca-content/src/lib/components/view-profile/view-profile.component.spec.ts
index 609f8b485..981231514 100644
--- a/projects/aca-content/src/lib/components/view-profile/view-profile.component.spec.ts
+++ b/projects/aca-content/src/lib/components/view-profile/view-profile.component.spec.ts
@@ -29,11 +29,17 @@ import { By } from '@angular/platform-browser';
import { Router } from '@angular/router';
import { BehaviorSubject, Subject } from 'rxjs';
import { AppService } from '@alfresco/aca-shared';
+import { UnitTestingUtils } from '@alfresco/adf-core';
+import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
+import { HarnessLoader } from '@angular/cdk/testing';
describe('ViewProfileComponent', () => {
let fixture: ComponentFixture;
let component: ViewProfileComponent;
let router: Router;
+ let unitTestingUtils: UnitTestingUtils;
+ let loader: HarnessLoader;
+
const appServiceMock = {
toggleAppNavBar$: new Subject(),
appNavNarMode$: new BehaviorSubject<'collapsed' | 'expanded'>('expanded')
@@ -53,6 +59,8 @@ describe('ViewProfileComponent', () => {
fixture = TestBed.createComponent(ViewProfileComponent);
component = fixture.componentInstance;
router = TestBed.inject(Router);
+ loader = TestbedHarnessEnvironment.loader(fixture);
+ unitTestingUtils = new UnitTestingUtils(fixture.debugElement, loader);
router.initialNavigation();
});
@@ -194,4 +202,11 @@ describe('ViewProfileComponent', () => {
expect(component.toggleContactButtons).toHaveBeenCalledTimes(2);
});
+
+ it('should navigate to personal files when go to personal files button is clicked', async () => {
+ spyOn(router, 'navigate');
+ await unitTestingUtils.clickMatButtonByCSS('.app-profile-icon');
+
+ expect(router.navigate).toHaveBeenCalledWith(['/personal-files'], { replaceUrl: true });
+ });
});