Skip to content

Commit

Permalink
fix: lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
markuczy committed Nov 6, 2024
1 parent c7bcee0 commit 866d5ed
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import {
AfterViewInit,
Component,
ElementRef,
EventEmitter,
Input,
OnInit,
Expand Down Expand Up @@ -77,9 +75,9 @@ export class FilterViewComponent implements OnInit {
columnFilterDataRows$: Observable<FilterViewRowDisplayData[]> | undefined

@Input() displayMode: FilterViewDisplayMode = 'button'
@Input() selectDisplayedChips: (filters: Filter[], columns: DataTableColumn[]) => Filter[] = (filters, columns) =>
@Input() selectDisplayedChips: (filters: Filter[], columns: DataTableColumn[]) => Filter[] = (filters) =>
limit(filters, 3, { reverse: true })
@Input() chipStyleClass: string = ''
@Input() chipStyleClass = ''
@Input() tableStyle: { [klass: string]: any } = { 'max-height': '50vh' }
@Input() panelStyle: { [klass: string]: any } = { 'max-width': '90%' }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1183,7 +1183,6 @@ describe('InteractiveDataViewComponent', () => {
describe('Filter view ', () => {
let dataTable: DataTableHarness | null
let tableHeaders: TableHeaderColumnHarness[]
let tableRows: TableRowHarness[]

let filterViewHarness: FilterViewHarness

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ import { DataViewComponent } from '../data-view/data-view.component'
import { InteractiveDataViewComponent } from './interactive-data-view.component'
import { SlotService } from '@onecx/angular-remote-components'
import { of } from 'rxjs'
import { ColumnFilterData, Filter, FilterType } from '../../model/filter.model'
import { Filter, FilterType } from '../../model/filter.model'
import { FilterViewComponent } from '../filter-view/filter-view.component'
import { DataTableColumn } from '../../model/data-table-column.model'
import { FocusTrapModule } from 'primeng/focustrap'

type InteractiveDataViewInputTypes = Pick<
Expand Down Expand Up @@ -66,7 +65,7 @@ const InteractiveDataViewComponentSBConfig: Meta<InteractiveDataViewComponent> =
{
provide: SlotService,
useValue: {
isSomeComponentDefinedForSlot(slotName: string) {
isSomeComponentDefinedForSlot() {
return of(false)
},
},
Expand Down Expand Up @@ -553,7 +552,7 @@ export const WithFilterViewCustomChipSelection = {
...defaultComponentArgs,
disableFilterView: false,
filterViewDisplayMode: 'chips',
selectDisplayedChips: (filters: Filter[], columns: DataTableColumn[]) => {
selectDisplayedChips: (filters: Filter[]) => {
return filters.slice(0, 2).reverse()
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import { DataLayoutSelectionComponentState } from '../data-layout-selection/data
import { DataListGridSortingComponentState } from '../data-list-grid-sorting/data-list-grid-sorting.component'
import { Row, Sort } from '../data-table/data-table.component'
import { DataViewComponent, DataViewComponentState, RowListGridData } from '../data-view/data-view.component'
import { Filter, ColumnFilterData } from '../../model/filter.model'
import { Filter } from '../../model/filter.model'
import { limit } from '../../utils/filter.utils'
import { FilterViewComponentState, FilterViewDisplayMode } from '../filter-view/filter-view.component'

Expand Down Expand Up @@ -122,10 +122,10 @@ export class InteractiveDataViewComponent implements OnInit, AfterContentInit {
@Input() tablePaginator = true
@Input() disableFilterView = true
@Input() filterViewDisplayMode: FilterViewDisplayMode = 'button'
@Input() filterViewChipStyleClass: string = ''
@Input() filterViewChipStyleClass = ''
@Input() filterViewTableStyle: { [klass: string]: any } = { 'max-height': '50vh' }
@Input() filterViewPanelStyle: { [klass: string]: any } = { 'max-width': '90%' }
@Input() selectDisplayedChips: (filters: Filter[], columns: DataTableColumn[]) => Filter[] = (filters, columns) =>
@Input() selectDisplayedChips: (filters: Filter[], columns: DataTableColumn[]) => Filter[] = (filters) =>
limit(filters, 3, { reverse: true })
@Input() page = 0
@Input() selectedRows: Row[] = []
Expand Down
7 changes: 0 additions & 7 deletions libs/angular-accelerator/src/lib/model/filter.model.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
import { DataTableColumn } from './data-table-column.model'

export interface ColumnFilterDataSelectOptions {
reverse: boolean
}

export interface ColumnFilterData {
column: DataTableColumn
filter: Filter
}

export type Filter = { columnId: string; value: unknown; filterType?: FilterType }

export enum FilterType {
Expand Down
2 changes: 1 addition & 1 deletion libs/angular-accelerator/src/lib/utils/filter.utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ColumnFilterData, ColumnFilterDataSelectOptions, Filter } from '../model/filter.model'
import { ColumnFilterDataSelectOptions, Filter } from '../model/filter.model'

export function limit(columnFilterData: Filter[], amount: number, options: ColumnFilterDataSelectOptions): Filter[] {
return options.reverse
Expand Down
2 changes: 1 addition & 1 deletion libs/angular-testing/src/lib/harnesses/span.harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class SpanHarness extends ComponentHarness {
)
}

async getId(id: string): Promise<string | null> {
async getId(): Promise<string | null> {
return await (await this.host()).getAttribute('id')
}

Expand Down

0 comments on commit 866d5ed

Please sign in to comment.