Skip to content

Commit

Permalink
Merge pull request #242 from ironSource/fix/isct-59-table-preselected…
Browse files Browse the repository at this point in the history
…-rows

Fix/isct 59 table preselected rows
  • Loading branch information
AndyKIron authored Sep 28, 2023
2 parents 8701043 + 8c243fd commit b921924
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 8 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -1800,6 +1802,8 @@ export const InfinityScroll = {
render: TableInfinityScrollTemplate,

args: {
columns: TABLE_CHECKBOX_COLUMNS_CONFIG,
rows: ROWS_CHECKBOX_DATA,
options: {
...TABLE_DEFAULT_OPTIONS,
pagination: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = [
Expand Down Expand Up @@ -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};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
5 changes: 3 additions & 2 deletions projects/fusion-ui/components/table/v3/table.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 || '');
Expand All @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion projects/fusion-ui/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit b921924

Please sign in to comment.