Skip to content

Commit

Permalink
[ACS-7242] Resizing columns with panel opened on the right, e.g. nfo …
Browse files Browse the repository at this point in the history
…Drawer creates empty columns space when panel is closed. (#9446)
  • Loading branch information
jacekpluta committed Mar 18, 2024
1 parent 69de85a commit c3459c4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
'adf-datatable__cursor--pointer': !isResizing,
'adf-datatable__header--sorted-asc': isColumnSorted(col, 'asc'),
'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"
(click)="onColumnHeaderClick(col, $event)"
(keyup.enter)="onColumnHeaderClick(col, $event)"
Expand Down Expand Up @@ -103,7 +103,7 @@
</span>
</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'"
adf-resize-handle
(click)="$event.stopPropagation()"
Expand Down Expand Up @@ -216,7 +216,7 @@
[adf-context-menu]="getContextMenuActions(row, col)"
[adf-context-menu-enabled]="contextMenu"
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">
<ng-container [ngSwitch]="data.getColumnType(row, col)">
<div *ngSwitchCase="'image'" class="adf-cell-value">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
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;
dataTableSchema[0].resizable = false;
dataTable.data = new ObjectDataTableAdapter([...data], [...dataTableSchema]);
fixture.detectChanges();

expect(getResizeHandlersCount()).toBe(1);
expect(getResizeHandlersCount()).toBe(0);
});

it('should display resize handle when the feature is Enabled [isResizingEnabled=true]', () => {
Expand Down

0 comments on commit c3459c4

Please sign in to comment.