mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-26 17:24:56 +00:00
[ACS-7242] Resizing columns with panel opened on the right, e.g. nfo Drawer creates empty columns space when panel is closed. (#9446)
This commit is contained in:
parent
69de85ad06
commit
c3459c40cc
@ -39,7 +39,7 @@
|
|||||||
'adf-datatable__cursor--pointer': !isResizing,
|
'adf-datatable__cursor--pointer': !isResizing,
|
||||||
'adf-datatable__header--sorted-asc': isColumnSorted(col, 'asc'),
|
'adf-datatable__header--sorted-asc': isColumnSorted(col, 'asc'),
|
||||||
'adf-datatable__header--sorted-desc': isColumnSorted(col, 'desc')}"
|
'adf-datatable__header--sorted-desc': isColumnSorted(col, 'desc')}"
|
||||||
[ngStyle]="(col.width) && {'flex': getFlexValue(col)}"
|
[ngStyle]="(col.width) && !lastColumn && {'flex': getFlexValue(col)}"
|
||||||
[attr.aria-label]="col.title | translate"
|
[attr.aria-label]="col.title | translate"
|
||||||
(click)="onColumnHeaderClick(col, $event)"
|
(click)="onColumnHeaderClick(col, $event)"
|
||||||
(keyup.enter)="onColumnHeaderClick(col, $event)"
|
(keyup.enter)="onColumnHeaderClick(col, $event)"
|
||||||
@ -103,7 +103,7 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
*ngIf="isResizingEnabled && col.resizable"
|
*ngIf="isResizingEnabled && col.resizable && !lastColumn"
|
||||||
[ngClass]="hoveredHeaderColumnIndex === columnIndex && !isResizing || resizingColumnIndex === columnIndex ? 'adf-datatable__resize-handle-visible' : 'adf-datatable__resize-handle-hidden'"
|
[ngClass]="hoveredHeaderColumnIndex === columnIndex && !isResizing || resizingColumnIndex === columnIndex ? 'adf-datatable__resize-handle-visible' : 'adf-datatable__resize-handle-hidden'"
|
||||||
adf-resize-handle
|
adf-resize-handle
|
||||||
(click)="$event.stopPropagation()"
|
(click)="$event.stopPropagation()"
|
||||||
@ -216,7 +216,7 @@
|
|||||||
[adf-context-menu]="getContextMenuActions(row, col)"
|
[adf-context-menu]="getContextMenuActions(row, col)"
|
||||||
[adf-context-menu-enabled]="contextMenu"
|
[adf-context-menu-enabled]="contextMenu"
|
||||||
adf-drop-zone dropTarget="cell" [dropColumn]="col" [dropRow]="row"
|
adf-drop-zone dropTarget="cell" [dropColumn]="col" [dropRow]="row"
|
||||||
[ngStyle]="(col.width) && {'flex': getFlexValue(col)}">
|
[ngStyle]="(col.width) && !lastColumn && {'flex': getFlexValue(col)}">
|
||||||
<div *ngIf="!col.template" class="adf-datatable-cell-container">
|
<div *ngIf="!col.template" class="adf-datatable-cell-container">
|
||||||
<ng-container [ngSwitch]="data.getColumnType(row, col)">
|
<ng-container [ngSwitch]="data.getColumnType(row, col)">
|
||||||
<div *ngSwitchCase="'image'" class="adf-cell-value">
|
<div *ngSwitchCase="'image'" class="adf-cell-value">
|
||||||
|
@ -1738,20 +1738,20 @@ describe('Column Resizing', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should display resize handle for each column by default', () => {
|
it('should display resize handle for each column, but not for the last one, by default', () => {
|
||||||
dataTable.isResizingEnabled = true;
|
dataTable.isResizingEnabled = true;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
|
|
||||||
expect(getResizeHandlersCount()).toBe(2);
|
expect(getResizeHandlersCount()).toBe(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should NOT display resize handle for the column when the column has resizable param set to false', () => {
|
it('should NOT display resize handle for the column when the column has resizable param set to false and column is not the last one', () => {
|
||||||
dataTable.isResizingEnabled = true;
|
dataTable.isResizingEnabled = true;
|
||||||
dataTableSchema[0].resizable = false;
|
dataTableSchema[0].resizable = false;
|
||||||
dataTable.data = new ObjectDataTableAdapter([...data], [...dataTableSchema]);
|
dataTable.data = new ObjectDataTableAdapter([...data], [...dataTableSchema]);
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
|
|
||||||
expect(getResizeHandlersCount()).toBe(1);
|
expect(getResizeHandlersCount()).toBe(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should display resize handle when the feature is Enabled [isResizingEnabled=true]', () => {
|
it('should display resize handle when the feature is Enabled [isResizingEnabled=true]', () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user