diff --git a/CHANGELOG.md b/CHANGELOG.md index fd6d92886..1a41d76ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines. +### [5.7.20-rc.0](https://github.com/ironSource/fusion-ui/compare/v5.7.19...v5.7.20-rc.0) (2023-09-28) + + +### Bug Fixes + +* **isct-59:** fixed table component preselected rows ([77a2fdd](https://github.com/ironSource/fusion-ui/commit/77a2fdde095d42413f71818e714136f4ed542881)) + ### [5.7.19](https://github.com/ironSource/fusion-ui/compare/v5.7.18...v5.7.19) (2023-09-05) ### [5.7.18](https://github.com/ironSource/fusion-ui/compare/v5.7.17...v5.7.18) (2023-09-05) diff --git a/package.json b/package.json index 42bdeacf3..3246709d6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fusion-ui", - "version": "5.7.19", + "version": "5.7.20-rc.0", "description": "UI library created by ironSource", "license": "MIT", "repository": { diff --git a/projects/fusion-ui/components/table/v3/stories/table.component.stories.ts b/projects/fusion-ui/components/table/v3/stories/table.component.stories.ts index 28a22ad33..b49aad4f1 100644 --- a/projects/fusion-ui/components/table/v3/stories/table.component.stories.ts +++ b/projects/fusion-ui/components/table/v3/stories/table.component.stories.ts @@ -20,7 +20,9 @@ import { TABLE_STICKY_COLUMNS_CONFIG, TABLE_SUBHEADER_COLUMNS_CONFIG, ROWS_READONLY_ROW_DATA, - TABLE_TOGGLE_EDIT_COLUMNS_CONFIG + TABLE_TOGGLE_EDIT_COLUMNS_CONFIG, + TABLE_CHECKBOX_COLUMNS_CONFIG, + ROWS_CHECKBOX_DATA } from './table.mock-data'; import {ApiService} from '@ironsource/fusion-ui'; @@ -1800,6 +1802,8 @@ export const InfinityScroll = { render: TableInfinityScrollTemplate, args: { + columns: TABLE_CHECKBOX_COLUMNS_CONFIG, + rows: ROWS_CHECKBOX_DATA, options: { ...TABLE_DEFAULT_OPTIONS, pagination: { diff --git a/projects/fusion-ui/components/table/v3/stories/table.mock-data.ts b/projects/fusion-ui/components/table/v3/stories/table.mock-data.ts index 8283ef616..b432edfc5 100644 --- a/projects/fusion-ui/components/table/v3/stories/table.mock-data.ts +++ b/projects/fusion-ui/components/table/v3/stories/table.mock-data.ts @@ -39,7 +39,7 @@ export const TABLE_SORTING_COLUMNS_CONFIG: TableColumn[] = [ {key: 'website', title: 'Website'} ]; export const TABLE_CHECKBOX_COLUMNS_CONFIG: TableColumn[] = [ - {key: 'selected', type: TableColumnTypeEnum.Checkbox, width: '32px'}, + {key: 'checkbox', type: TableColumnTypeEnum.Checkbox, width: '32px'}, ...TABLE_DEFAULT_COLUMNS_CONFIG ]; export const TABLE_TOGGLE_COLUMNS_CONFIG: TableColumn[] = [ @@ -393,8 +393,8 @@ export const ROWS_TOTALS_DATA = [ }, ...ROWS_DEFAULT_DATA ]; -export const ROWS_CHECKBOX_DATA = ROWS_DEFAULT_DATA.map(row => { - return {selected: false, ...row}; +export const ROWS_CHECKBOX_DATA = ROWS_DEFAULT_DATA.map((row, idx) => { + return {checkbox: idx == 3, ...row}; }); export const ROWS_TOGGLE_DATA = ROWS_DEFAULT_DATA.map(row => { return {live: true, ...row}; diff --git a/projects/fusion-ui/components/table/v3/stories/table.story-holder.component/table.story-holder.component.component.ts b/projects/fusion-ui/components/table/v3/stories/table.story-holder.component/table.story-holder.component.component.ts index 902bbe778..35f10af39 100644 --- a/projects/fusion-ui/components/table/v3/stories/table.story-holder.component/table.story-holder.component.component.ts +++ b/projects/fusion-ui/components/table/v3/stories/table.story-holder.component/table.story-holder.component.component.ts @@ -123,6 +123,7 @@ export class TableStoryHolderComponent implements OnInit, OnDestroy { const newRows = Array.from({length: 20}, (_, i) => { const id = i + shownLength + 1; return { + checkbox: false, id: id, name: id + ' name', username: id + ' UserName', diff --git a/projects/fusion-ui/components/table/v3/table.component.ts b/projects/fusion-ui/components/table/v3/table.component.ts index 2f735c03d..3b711e7b6 100644 --- a/projects/fusion-ui/components/table/v3/table.component.ts +++ b/projects/fusion-ui/components/table/v3/table.component.ts @@ -247,7 +247,9 @@ export class TableComponent implements OnInit, OnDestroy { public tableService: TableService, private uniqueService: UniqueIdService, private cdr: ChangeDetectorRef - ) {} + ) { + this.tableService.clearSelectedRows(); + } ngOnInit() { this.searchFormControl = new FormControl(this.options?.searchOptions?.initalValue || ''); @@ -267,7 +269,6 @@ export class TableComponent implements OnInit, OnDestroy { this.noDataSubMessage = this.options.noDataSubMessage || ''; this.hideHeaderOnEmpty = !isNullOrUndefined(this.options.hideHeaderOnEmpty) ? this.options.hideHeaderOnEmpty : false; this.isAllRowsSelectable = typeof this.options.isAllRowsSelectable === 'undefined' ? true : this.options.isAllRowsSelectable; - this.tableService.clearSelectedRows(); this.scrollListeners(); this.configIconNames = CONFIG_TABLE_BY_UI_STYLE[`style_v2`]; this.wrapperClasses = this.getWrapperClasses(); diff --git a/projects/fusion-ui/package.json b/projects/fusion-ui/package.json index e4db84c8e..692357dfb 100644 --- a/projects/fusion-ui/package.json +++ b/projects/fusion-ui/package.json @@ -1,6 +1,6 @@ { "name": "@ironsource/fusion-ui", - "version": "5.7.19", + "version": "5.7.20-rc.0", "dependencies": { "chart.js": "^3.5.1", "@floating-ui/dom": "^1.0.9",