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

Default sorting of flags ect to not be created time stamp #3413

Open
1 task done
alucarddelta opened this issue Aug 28, 2024 · 5 comments
Open
1 task done

Default sorting of flags ect to not be created time stamp #3413

alucarddelta opened this issue Aug 28, 2024 · 5 comments
Labels
enhancement Created by Linear-GitHub Sync

Comments

@alucarddelta
Copy link

Problem

Is it possible to change the default sorting of the flag table to be something other than the created timestamp.

When trying to view a bunch of flags, it is much easier to look for a key/name in alphabetical order.

Ideal Solution

Have a config option under the UI section for default sort order, Allowing config values of:

  • key
  • name
  • type
  • created

eg

 ui:
     table_sorting:
          flag: key
          segments: name

Search

  • I searched for other open and closed issues before opening this

Additional Context

No response

@alucarddelta alucarddelta added the enhancement Created by Linear-GitHub Sync label Aug 28, 2024
@markphelps
Copy link
Collaborator

Great idea @alucarddelta ! What if we saved the latest sort field/direction in local storage? That would prevent the need for setting it in config

@alucarddelta
Copy link
Author

Great idea @alucarddelta ! What if we saved the latest sort field/direction in local storage? That would prevent the need for setting it in config

That also works :)

@markphelps
Copy link
Collaborator

@alucarddelta I prototyped a fix here where instead of using local storage I just save the sorting state for the table to Redux

see: #3415

This means that if you close the browser it will clear the preferred saved sorting field/direction.. but it will no longer lose the sorting field/direction if you remain in the app and click around to different pages.

In this gif, I first show the current behavior, that whenever you click away from the flags table it resets the sorting state

Then I switch to the new behavior that uses Redux to store the flag table state, which keeps it persisted between pages.

Would this solve your issue?

2024-08-28 19 48 24

@alucarddelta
Copy link
Author

alucarddelta commented Aug 29, 2024

That will def be helpful!... This solution would work well when setting up new applications/namespace with lots of back and forth setting up flags, rules, ect. I am slightly concerned when accessing Flipt UI infrequently between sessions to make minor changes and toggling flags manually. But that shouldn't be a massive issue and can be dealt with.

As part of this FR/Idea, I did have a thought last night came from one of our internal tools... Rather than using storage to set default sort, we chose to uses URL query parameters to store table options. This includes things like pagination, limits, search filters, and Sort Order. Is this something that would be useful in your mind?

eg.
/foo?FoosFilter-limit=100&FoosFilter-%5B%5DorderBy=foo_name

@markphelps
Copy link
Collaborator

That will def be helpful!... This solution would work well when setting up new applications/namespace with lots of back and forth setting up flags, rules, ect. I am slightly concerned when accessing Flipt UI infrequently between sessions to make minor changes and toggling flags manually. But that shouldn't be a massive issue and can be dealt with.

As part of this FR/Idea, I did have a thought last night came from one of our internal tools... Rather than using storage to set default sort, we chose to uses URL query parameters to store table options. This includes things like pagination, limits, search filters, and Sort Order. Is this something that would be useful in your mind?

eg. /foo?FoosFilter-limit=100&FoosFilter-%5B%5DorderBy=foo_name

I think we could support that as well. The UI is a Single Page Application (SPA) but we can get query params from the URL and still make the JS handle pagination/sorting/etc. I will see if we can support this easily

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Created by Linear-GitHub Sync
Projects
Status: No status
Development

No branches or pull requests

2 participants