mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
[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:
@@ -1,16 +1,27 @@
|
|||||||
<div>
|
@if (licenseEntries) {
|
||||||
<article *ngIf="licenseEntries">
|
<article>
|
||||||
<header>{{ 'ABOUT.LICENSE.TITLE' | translate }}</header>
|
<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" />
|
<adf-about-license-list [data]="licenseEntries" />
|
||||||
</article>
|
</article>
|
||||||
|
}
|
||||||
<article *ngIf="statusEntries">
|
@if (statusEntries) {
|
||||||
<header>{{ 'ABOUT.STATUS.TITLE' | translate }}</header>
|
<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" />
|
<adf-about-status-list [data]="statusEntries" />
|
||||||
</article>
|
</article>
|
||||||
|
}
|
||||||
<article *ngIf="data?.modules">
|
@if (data?.modules) {
|
||||||
<header>{{ 'ABOUT.MODULES.TITLE' | translate }}</header>
|
<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" />
|
<adf-about-module-list [data]="data.modules" />
|
||||||
</article>
|
</article>
|
||||||
</div>
|
}
|
||||||
|
|||||||
@@ -1,3 +1,11 @@
|
|||||||
article {
|
adf-about-repository-info {
|
||||||
|
article {
|
||||||
margin-top: 16px;
|
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);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user