Skip to content

Commit

Permalink
[ACS-7381] merging conflicts and improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
tamaragruszka committed May 6, 2024
1 parent 6a43789 commit 41de378
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,25 @@ import { MatMenuTrigger } from '@angular/material/menu';
import { TranslateModule } from '@ngx-translate/core';
import { Subject } from 'rxjs';
import { debounceTime, takeUntil } from 'rxjs/operators';
import { PipeModule } from '../../../pipes';
import { FilterStringPipe } from '../../../pipes';
import { DataColumn } from '../../data/data-column.model';

@Component({
selector: 'adf-datatable-column-selector',
standalone: true,
templateUrl: './columns-selector.component.html',
styleUrls: ['./columns-selector.component.scss'],
imports: [MatButtonModule, TranslateModule, MatIconModule, MatDividerModule, ReactiveFormsModule, PipeModule, MatCheckboxModule, NgIf, NgForOf],
imports: [
MatButtonModule,
TranslateModule,
MatIconModule,
MatDividerModule,
ReactiveFormsModule,
MatCheckboxModule,
NgIf,
NgForOf,
FilterStringPipe
],
encapsulation: ViewEncapsulation.None
})
export class ColumnsSelectorComponent implements OnInit, OnDestroy {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
[class.adf-datatable--empty--header-visible]="isEmpty() && isHeaderVisible()">
<thead *ngIf="isHeaderVisible()"
class="adf-datatable-header"
role="rowgroup"
[ngClass]="{ 'adf-sr-only': !isHeaderVisible() }">
<adf-datatable-row cdkDropList
cdkDropListOrientation="horizontal"
Expand All @@ -17,14 +16,12 @@

<!-- Actions (left) -->
<th *ngIf="actions && actionsPosition === 'left'"
role="columnheader"
class="adf-actions-column adf-datatable-cell-header">
<span class="adf-sr-only">{{ 'ADF-DATATABLE.ACCESSIBILITY.ACTIONS' | translate }}</span>
</th>

<!-- Columns -->
<th *ngIf="multiselect"
role="columnheader"
class="adf-datatable-cell-header adf-datatable-checkbox">
<mat-checkbox [indeterminate]="isSelectAllIndeterminate"
[checked]="isSelectAllChecked"
Expand All @@ -51,7 +48,6 @@
(keyup.enter)="onColumnHeaderClick(col, $event)"
[attr.tabindex]="isHeaderVisible() ? 0 : null"
[attr.aria-sort]="col.sortable ? (getAriaSort(col) | translate) : null"
role="columnheader"
cdkDrag
cdkDragLockAxis="x"
[cdkDragPreviewClass]="'adf-drag-preview'"
Expand Down Expand Up @@ -127,7 +123,6 @@

<!-- Header actions (right) -->
<th *ngIf="(actions && actionsPosition === 'right') || (mainActionTemplate && showMainDatatableActions)"
role="columnheader"
class="adf-actions-column adf-datatable-actions-menu adf-datatable-cell-header adf-datatable__actions-cell">
<ng-container *ngIf="mainActionTemplate">
<button data-automation-id="adf-datatable-main-menu-button"
Expand All @@ -151,7 +146,6 @@
</thead>

<tbody class="adf-datatable-body"
role="rowgroup"
[ngClass]="{ 'adf-blur-datatable-body': blurOnResize && (isDraggingHeaderColumn || isResizing) }">
<ng-container *ngIf="!loading && !noPermission">
<adf-datatable-row *ngFor="let row of data.getRows(); let idx = index"
Expand All @@ -166,7 +160,7 @@
[attr.data-automation-id]="'datatable-row-' + idx"
(contextmenu)="markRowAsContextMenuSource(row)">
<!-- Actions (left) -->
<div *ngIf="actions && actionsPosition === 'left'" role="gridcell" class="adf-datatable-cell">
<td *ngIf="actions && actionsPosition === 'left'" class="adf-datatable-cell">
<button mat-icon-button [matMenuTriggerFor]="menu" #actionsMenuTrigger="matMenuTrigger"
[ngClass]="getHideActionsWithoutHoverClass(actionsMenuTrigger)"
[title]="'ADF-DATATABLE.CONTENT-ACTIONS.TOOLTIP' | translate"
Expand All @@ -183,7 +177,7 @@
<span>{{ action.title | translate }}</span>
</button>
</mat-menu>
</div>
</td>

<label *ngIf="multiselect"
[for]="'select-file-' + idx"
Expand All @@ -196,10 +190,9 @@
{{ 'ADF-DATATABLE.ACCESSIBILITY.SELECT_FILE' | translate }}
</mat-checkbox>
</label>
<div *ngFor="
<td *ngFor="
let col of (data.getColumns() | filterOutEvery:'isHidden':true),
let lastColumn = last;"
role="cell"
class="adf-datatable-cell adf-datatable-cell--{{ col.type || 'text' }} {{ col.cssClass }} adf-datatable-cell-data"
[attr.title]="col.title | translate"
[attr.data-automation-id]="getAutomationValue(row)"
Expand Down Expand Up @@ -354,12 +347,11 @@
</ng-container>
</div>
</div>
</div>
</td>

<!-- Row actions (right) -->
<div *ngIf="(actions && actionsPosition === 'right') ||
<td *ngIf="(actions && actionsPosition === 'right') ||
(mainActionTemplate && showMainDatatableActions)"
role="cell"
class="adf-datatable-cell adf-datatable__actions-cell adf-datatable-center-actions-column-ie adf-datatable-actions-menu">

<ng-container *ngIf="(actions && actionsPosition === 'right')">
Expand All @@ -385,35 +377,34 @@
</button>
</mat-menu>
</ng-container>
</div>
</td>
</adf-datatable-row>
<div *ngIf="isEmpty()" role="row" class="adf-datatable-row">
<div class="adf-no-content-container adf-datatable-cell" role="cell">
<tr *ngIf="isEmpty()" class="adf-datatable-row">
<td class="adf-no-content-container adf-datatable-cell">
<ng-template *ngIf="noContentTemplate"
ngFor [ngForOf]="[data]"
[ngForTemplate]="noContentTemplate">
</ng-template>
<ng-content select="adf-empty-list"></ng-content>
</div>
</div>
</td>
</tr>
</ng-container>
<tr *ngIf="!loading && noPermission"
role="row"
class="adf-datatable-row adf-no-permission__row">
<div class="adf-no-permission__cell adf-no-content-container adf-datatable-cell">
<td class="adf-no-permission__cell adf-no-content-container adf-datatable-cell">
<ng-template *ngIf="noPermissionTemplate"
ngFor [ngForOf]="[data]"
[ngForTemplate]="noPermissionTemplate">
</ng-template>
</div>
</td>
</tr>
<div *ngIf="loading" class="adf-datatable-row" role="row">
<div class="adf-no-content-container adf-datatable-cell" role="cell">
<tr *ngIf="loading" class="adf-datatable-row">
<td class="adf-no-content-container adf-datatable-cell">
<ng-template *ngIf="loadingTemplate"
ngFor [ngForOf]="[data]"
[ngForTemplate]="loadingTemplate">
</ng-template>
</div>
</div>
</td>
</tr>
</tbody>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ import { DataTableComponent, ShowHeaderMode } from './datatable.component';

@Component({
selector: 'adf-custom-column-template-component',
template: `<ng-template #tmplRef></ng-template>`
template: ` <ng-template #tmplRef></ng-template>`
})
class CustomColumnTemplateComponent {
@ViewChild('tmplRef', { static: true }) templateRef: TemplateRef<any>;
}

@Component({
selector: 'adf-custom-column-header-component',
template: `<ng-template #tmplRef> CUSTOM HEADER</ng-template>`
template: ` <ng-template #tmplRef> CUSTOM HEADER</ng-template>`
})
class CustomColumnHeaderComponent {
@ViewChild('tmplRef', { static: true }) templateRef: TemplateRef<any>;
Expand Down Expand Up @@ -986,7 +986,7 @@ describe('DataTable', () => {
const column = {} as DataColumn;

const row: any = {
getValue: () => 'http://www.google.com'
getValue: () => 'https://www.google.com'
};

expect(dataTable.isIconValue(row, column)).toBeFalsy();
Expand All @@ -1006,7 +1006,7 @@ describe('DataTable', () => {
const column = {} as DataColumn;

const row: any = {
getValue: () => 'http://www.google.com'
getValue: () => 'https://www.google.com'
};

expect(dataTable.asIconValue(row, column)).toBe(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,15 @@ import { Observable, Observer, Subscription } from 'rxjs';
import { buffer, debounceTime, filter, map, share } from 'rxjs/operators';
import { ContextMenuModule } from '../../../context-menu';
import { DirectiveModule } from '../../../directives';
import { IconModule } from '../../../icon';
import { FileTypePipe, FilterOutArrayObjectsByPropPipe, LocalizedDatePipe, PipeModule } from '../../../pipes';
import { IconComponent } from '../../../icon';
import { FileTypePipe, FilterOutArrayObjectsByPropPipe, LocalizedDatePipe } from '../../../pipes';
import { DataColumnListComponent } from '../../data-column';
import { DataColumn } from '../../data/data-column.model';
import { DataRowEvent } from '../../data/data-row-event.model';
import { DataRow } from '../../data/data-row.model';
import { DataSorting } from '../../data/data-sorting.model';
import { DataTableAdapter } from '../../data/datatable-adapter';
import { ObjectDataColumn } from '../../data/object-datacolumn.model';

import { ObjectDataRow } from '../../data/object-datarow.model';
import { ObjectDataTableAdapter } from '../../data/object-datatable-adapter';
import { DropZoneDirective } from '../../directives/drop-zone.directive';
Expand Down Expand Up @@ -102,11 +101,9 @@ export enum ShowHeaderMode {
DataTableRowComponent,
TranslateModule,
MatCheckboxModule,
PipeModule,
ResizableModule,
DropZoneDirective,
MatTooltipModule,
IconModule,
MatMenuModule,
MatIconModule,
MatButtonModule,
Expand All @@ -125,7 +122,8 @@ export enum ShowHeaderMode {
NumberCellComponent,
LocalizedDatePipe,
FilterOutArrayObjectsByPropPipe,
FileTypePipe
FileTypePipe,
IconComponent
],
host: { class: 'adf-datatable' }
})
Expand Down

0 comments on commit 41de378

Please sign in to comment.