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

This commit is contained in:
jacekpluta
2024-06-30 23:11:29 +02:00
committed by GitHub
parent 3cc571ee32
commit a48611eb92
14 changed files with 168 additions and 64 deletions

View File

@@ -57,7 +57,7 @@
</a>
<div *ngSwitchDefault class="adf-breadcrumb-item-current" aria-current="location">
{{ item.name | translate }}
{{ (selectedRowItemsCount < 1 ? item.name : 'BREADCRUMB.HEADER.SELECTED') | translate: { count: selectedRowItemsCount } }}
</div>
<mat-icon class="adf-breadcrumb-item-chevron" *ngIf="!last">

View File

@@ -33,6 +33,9 @@ describe('Breadcrumb', () => {
});
let documentListComponent: DocumentListComponent;
const getBreadcrumbActionText = (): string =>
fixture.debugElement.nativeElement.querySelector('.adf-breadcrumb-item-current').textContent.trim();
beforeEach(() => {
TestBed.configureTestingModule({
imports: [ContentTestingModule],
@@ -300,4 +303,26 @@ describe('Breadcrumb', () => {
expect(component.route[3].id).toBe('test-id');
expect(component.route[3].name).toBe('test-name');
});
it('should set title based on selectedRowItemsCount', () => {
component.transform = (transformNode) => {
transformNode.id = 'test-id';
transformNode.name = 'test-name';
return transformNode;
};
component.folderNode = {
path: { elements: [{ id: 'element-1-id', name: 'element-1-name' }] }
} as Node;
component.ngOnChanges();
fixture.detectChanges();
expect(getBreadcrumbActionText()).toEqual('test-name');
component.selectedRowItemsCount = 2;
fixture.detectChanges();
expect(getBreadcrumbActionText()).toEqual('BREADCRUMB.HEADER.SELECTED');
});
});

View File

@@ -72,6 +72,10 @@ export class BreadcrumbComponent implements OnInit, OnChanges, OnDestroy {
@Input()
maxItems: number;
/** Number of table rows that are currently selected. */
@Input()
selectedRowItemsCount = 0;
previousNodes: PathElement[];
lastNodes: PathElement[];

View File

@@ -22,6 +22,7 @@
(executeRowAction)="onExecuteRowAction($event)"
(columnsWidthChanged)="onColumnsWidthChange($event)"
(columnOrderChanged)="onColumnOrderChange($event)"
(selectedItemsCountChanged)="onSelectedItemsCountChanged($event)"
(rowClick)="onNodeClick($event.value?.node)"
(rowDblClick)="onNodeDblClick($event.value?.node)"
(row-select)="onNodeSelect($any($event).detail)"

View File

@@ -1468,6 +1468,12 @@ describe('DocumentList', () => {
expect(documentList.reload).not.toHaveBeenCalled();
});
it('should emit custom date range on date picker closed', () => {
const selectedItemsCountChangedSpy = spyOn(documentList.selectedItemsCountChanged, 'emit');
documentList.onSelectedItemsCountChanged(1);
expect(selectedItemsCountChangedSpy).toHaveBeenCalledWith(1);
});
it('should add includeFields in the server request when present', () => {
documentList.includeFields = ['test-include'];
documentList.currentFolderId = 'fake-id';

View File

@@ -388,6 +388,10 @@ export class DocumentListComponent extends DataTableSchema implements OnInit, On
@Output()
columnsOrderChanged = new EventEmitter<string[] | undefined>();
/** Emitted when the selected row items count in the table changed. */
@Output()
selectedItemsCountChanged = new EventEmitter<number | undefined>();
@ViewChild('dataTable', { static: true })
dataTable: DataTableComponent;
@@ -832,6 +836,10 @@ export class DocumentListComponent extends DataTableSchema implements OnInit, On
this.columnsWidthChanged.emit(this.columnsWidths);
}
onSelectedItemsCountChanged(count: number) {
this.selectedItemsCountChanged.emit(count);
}
onNodeClick(nodeEntry: NodeEntry) {
const domEvent = new CustomEvent('node-click', {
detail: {

View File

@@ -662,6 +662,9 @@
"ARIA-LABEL": {
"BREADCRUMB": "Breadcrumb",
"DROPDOWN": "Dropdown"
},
"HEADER": {
"SELECTED": "Selected ({{ count }})"
}
},
"NAME_COLUMN_LINK": {