[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
This commit is contained in:
AleksanderSklorz
2026-03-16 11:31:33 +01:00
committed by GitHub
parent 6c5a205d3e
commit a865372819
3 changed files with 116 additions and 12 deletions
@@ -1,16 +1,27 @@
<div>
<article *ngIf="licenseEntries">
<header>{{ 'ABOUT.LICENSE.TITLE' | translate }}</header>
@if (licenseEntries) {
<article>
<h2 data-automation-id="adf-about-repository-info-header-license"
class="adf-about-repository-info-header">
{{ 'ABOUT.LICENSE.TITLE' | translate }}
</h2>
<adf-about-license-list [data]="licenseEntries" />
</article>
<article *ngIf="statusEntries">
<header>{{ 'ABOUT.STATUS.TITLE' | translate }}</header>
}
@if (statusEntries) {
<article>
<h2 data-automation-id="adf-about-repository-info-header-status"
class="adf-about-repository-info-header">
{{ 'ABOUT.STATUS.TITLE' | translate }}
</h2>
<adf-about-status-list [data]="statusEntries" />
</article>
<article *ngIf="data?.modules">
<header>{{ 'ABOUT.MODULES.TITLE' | translate }}</header>
}
@if (data?.modules) {
<article>
<h2 data-automation-id="adf-about-repository-info-header-modules"
class="adf-about-repository-info-header">
{{ 'ABOUT.MODULES.TITLE' | translate }}
</h2>
<adf-about-module-list [data]="data.modules" />
</article>
</div>
}
@@ -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;
}
}
@@ -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<AboutRepositoryInfoComponent>;
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);
});
});
});