Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(platform): fdp-table sorting visible columns state get lost #12429

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

khotcholava
Copy link
Contributor

closes (#12397)[https://github.com//issues/12397]

Description

Ensures the sort order of visible columns is maintained within the customization visible columns dialog of the fdp-table component. This fix prevents the columns from reverting to their original order when the dialog is reopened.

closes (#12397)[#12397]

## Description
Ensures the sort order of visible columns is maintained within the customization visible columns dialog of the fdp-table component. This fix prevents the columns from reverting to their original order when the dialog is reopened.
@khotcholava khotcholava self-assigned this Sep 16, 2024
Copy link

github-actions bot commented Sep 16, 2024

Visit the preview URL for this PR (updated for commit 56570af):

https://fundamental-ngx-gh--pr12429-fix-fdp-table-fdp-t-t924fonh.web.app

(expires Sat, 21 Sep 2024 09:35:41 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 41b993ee8e451bd7c6770b342ce142dc886eacff

Copy link

netlify bot commented Sep 16, 2024

Deploy Preview for fundamental-ngx ready!

Name Link
🔨 Latest commit 56570af
🔍 Latest deploy log https://app.netlify.com/sites/fundamental-ngx/deploys/66ea9d6062544300089e7aa5
😎 Deploy Preview https://deploy-preview-12429--fundamental-ngx.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@droshev droshev added this to the Sprint 138 - September 2024 milestone Sep 16, 2024
@droshev droshev requested a review from a team September 16, 2024 19:29
@@ -329,11 +320,11 @@ export class P13ColumnsDialogComponent implements Resettable, OnInit, OnDestroy
.pipe(debounceTime(20))
.subscribe(([showAll, searchQuery]) => {
this._filteredColumns = this._selectableColumns
.sort((a, b) => a.order - b.order)
Copy link
Contributor

@dpavlenishvili dpavlenishvili Sep 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think instead of sort it here you can sort it inside _initiateColumns method, with that way you can reduce manipulation on array.

closes (#12397)[#12397]

## Description
Refactor column filtering logic in P13ColumnsDialogComponent
## Description
Moved soring in column initialization method
closes (#12397)#12397]

## Description
Moved soring in column initialization method
…-visible-columns-state-get-lost' into fix(fdp-table)-fdp-table-sorting-visible-columns-state-get-lost
@droshev droshev requested review from a team and mikerodonnell89 September 18, 2024 13:20
@droshev droshev added the table label Sep 18, 2024
Copy link
Member

@mikerodonnell89 mikerodonnell89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just need to remove a console.log but looks good

@@ -292,25 +294,18 @@ export class P13ColumnsDialogComponent implements Resettable, OnInit, OnDestroy
*/
private _initiateColumns(visibleColumnKeys: string[]): void {
const visibleColumnIndexMap = new Map(visibleColumnKeys.map((key, index) => [key, index]));
console.log(this.availableColumns);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well, just pull this console log out before merging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants