From a865372819858d62b75373fe49c42deaf3aeb37a Mon Sep 17 00:00:00 2001 From: AleksanderSklorz <115619721+AleksanderSklorz@users.noreply.github.com> Date: Mon, 16 Mar 2026 11:31:33 +0100 Subject: [PATCH] [ACS-10267] Announce titles for repository info as headings (#11728) * [ACS-10267] Announce titles for repository info as headings * [ACS-10267] Addressed copilot comments * [ACS-10267] Addressed copilot comments --- .../about-repository-info.component.html | 31 ++++--- .../about-repository-info.component.scss | 12 ++- .../about-repository-info.component.spec.ts | 85 +++++++++++++++++++ 3 files changed, 116 insertions(+), 12 deletions(-) create mode 100644 lib/core/src/lib/about/about-repository-info/about-repository-info.component.spec.ts diff --git a/lib/core/src/lib/about/about-repository-info/about-repository-info.component.html b/lib/core/src/lib/about/about-repository-info/about-repository-info.component.html index 11f2842d7d..a0fea05cd3 100644 --- a/lib/core/src/lib/about/about-repository-info/about-repository-info.component.html +++ b/lib/core/src/lib/about/about-repository-info/about-repository-info.component.html @@ -1,16 +1,27 @@ -
-
-
{{ 'ABOUT.LICENSE.TITLE' | translate }}
+@if (licenseEntries) { +
+

+ {{ 'ABOUT.LICENSE.TITLE' | translate }} +

- -
-
{{ 'ABOUT.STATUS.TITLE' | translate }}
+} +@if (statusEntries) { +
+

+ {{ 'ABOUT.STATUS.TITLE' | translate }} +

- -
-
{{ 'ABOUT.MODULES.TITLE' | translate }}
+} +@if (data?.modules) { +
+

+ {{ 'ABOUT.MODULES.TITLE' | translate }} +

-
+} diff --git a/lib/core/src/lib/about/about-repository-info/about-repository-info.component.scss b/lib/core/src/lib/about/about-repository-info/about-repository-info.component.scss index 75ce278e6c..d50b799cbb 100644 --- a/lib/core/src/lib/about/about-repository-info/about-repository-info.component.scss +++ b/lib/core/src/lib/about/about-repository-info/about-repository-info.component.scss @@ -1,3 +1,11 @@ -article { - margin-top: 16px; +adf-about-repository-info { + article { + margin-top: 16px; + } + + .adf-about-repository-info-header { + font-size: 14px; + margin: 0; + font-weight: 500; + } } diff --git a/lib/core/src/lib/about/about-repository-info/about-repository-info.component.spec.ts b/lib/core/src/lib/about/about-repository-info/about-repository-info.component.spec.ts new file mode 100644 index 0000000000..b7db6e7528 --- /dev/null +++ b/lib/core/src/lib/about/about-repository-info/about-repository-info.component.spec.ts @@ -0,0 +1,85 @@ +/*! + * @license + * Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { AboutRepositoryInfoComponent, RepositoryInfo, UnitTestingUtils } from '@alfresco/adf-core'; + +describe('AboutRepositoryInfoComponent', () => { + let component: AboutRepositoryInfoComponent; + let fixture: ComponentFixture; + let unitTestingUtils: UnitTestingUtils; + + const headerTag = 'H2'; + + beforeEach(() => { + TestBed.configureTestingModule({ + imports: [AboutRepositoryInfoComponent] + }); + fixture = TestBed.createComponent(AboutRepositoryInfoComponent); + component = fixture.componentInstance; + unitTestingUtils = new UnitTestingUtils(fixture.debugElement); + }); + + describe('License', () => { + it('should render license header', () => { + component.data = { + status: {}, + license: { + holder: 'Some holder' + } + } as RepositoryInfo; + + fixture.detectChanges(); + const licenseHeader = unitTestingUtils.getByDataAutomationId('adf-about-repository-info-header-license').nativeElement; + expect(licenseHeader.innerText).toBe('ABOUT.LICENSE.TITLE'); + expect(licenseHeader.tagName).toBe(headerTag); + }); + }); + + describe('Status', () => { + it('should render status header', () => { + component.data = { + status: { + isReadOnly: true + } + } as RepositoryInfo; + + fixture.detectChanges(); + const statusHeader = unitTestingUtils.getByDataAutomationId('adf-about-repository-info-header-status').nativeElement; + expect(statusHeader.innerText).toBe('ABOUT.STATUS.TITLE'); + expect(statusHeader.tagName).toBe(headerTag); + }); + }); + + describe('Modules', () => { + it('should render modules header', () => { + component.data = { + status: {}, + modules: [ + { + title: 'Module 1' + } + ] + } as RepositoryInfo; + + fixture.detectChanges(); + const modulesHeader = unitTestingUtils.getByDataAutomationId('adf-about-repository-info-header-modules').nativeElement; + expect(modulesHeader.innerText).toBe('ABOUT.MODULES.TITLE'); + expect(modulesHeader.tagName).toBe(headerTag); + }); + }); +});