[ACS-8113] UX bug - Checkbox selections checked state should be Hyland blue not green- edit summary (#3908)

This commit is contained in:
jacekpluta
2024-07-04 08:26:47 +02:00
committed by GitHub
parent b0c1f537df
commit 457ddb2e39
18 changed files with 191 additions and 12 deletions

View File

@@ -1,6 +1,9 @@
<aca-page-layout>
<div class="aca-page-layout-header">
<h1 class="aca-page-title">{{ 'APP.BROWSE.SHARED.TITLE' | translate }}</h1>
<h1 class="aca-page-title">
{{ (selectedRowItemsCount < 1 ? 'APP.BROWSE.SHARED.TITLE' : 'APP.HEADER.SELECTED') | translate: { count: selectedRowItemsCount } }}
</h1>
<aca-toolbar [items]="actions"></aca-toolbar>
</div>
@@ -17,6 +20,7 @@
[imageResolver]="imageResolver"
[sortingMode]="'client'"
[isResizingEnabled]="true"
(selectedItemsCountChanged)="onSelectedItemsCountChanged($event)"
[blurOnResize]="false"
(node-dblclick)="handleNodeClick($event)"
(name-click)="handleNodeClick($event)"

View File

@@ -26,15 +26,28 @@ import { TestBed, ComponentFixture } from '@angular/core/testing';
import { CustomResourcesService } from '@alfresco/adf-content-services';
import { SharedFilesComponent } from './shared-files.component';
import { AppTestingModule } from '../../testing/app-testing.module';
import { Router } from '@angular/router';
import { BehaviorSubject, of, Subject } from 'rxjs';
import { By } from '@angular/platform-browser';
import { SharedLinkPaging } from '@alfresco/js-api';
import { AppService } from '@alfresco/aca-shared';
import { getTitleElementText } from '../../testing/test-utils';
import { ActivatedRoute, Router } from '@angular/router';
describe('SharedFilesComponent', () => {
let fixture: ComponentFixture<SharedFilesComponent>;
let page: SharedLinkPaging;
let component: SharedFilesComponent;
const routerMock = {
routerState: { root: '' },
url: 'shared-files'
};
const route = {
snapshot: {
data: {
sortingPreferenceKey: ''
}
}
};
const appServiceMock = {
appNavNarMode$: new BehaviorSubject('collapsed'),
@@ -45,11 +58,10 @@ describe('SharedFilesComponent', () => {
TestBed.configureTestingModule({
imports: [AppTestingModule, SharedFilesComponent],
providers: [
{ provide: ActivatedRoute, useValue: route },
{
provide: Router,
useValue: {
url: 'shared-files'
}
useValue: routerMock
},
{
provide: AppService,
@@ -68,6 +80,16 @@ describe('SharedFilesComponent', () => {
const customResourcesService = TestBed.inject(CustomResourcesService);
spyOn(customResourcesService, 'loadSharedLinks').and.returnValue(of(page));
fixture = TestBed.createComponent(SharedFilesComponent);
component = fixture.componentInstance;
});
it('should set title based on selectedRowItemsCount', () => {
fixture.detectChanges();
expect(getTitleElementText(fixture)).toBe('APP.BROWSE.SHARED.TITLE');
component.selectedRowItemsCount = 5;
fixture.detectChanges();
expect(getTitleElementText(fixture)).toBe('APP.HEADER.SELECTED');
});
// TODO: needs better testing strategy