Skip to content

Add options for default column order #2504

@theolundqvist

Description

@theolundqvist

New Feature / Enhancement Checklist

  • I am not disclosing a vulnerability.
    I am not just asking a question.
    I have searched through existing issues.

Current Limitation

With many columns we often want to see ex username and email before other less relevant fields. Currently the four system columns appear first and then the rest of the fields have a random? order.

Feature / Enhancement Description

Forcing the columns to be in the same order that is specified in the columnPreference field. All non-mentioned columns can come in a random order in the end.

  apps: [
    {
      columnPreference: {
        "_User": [
             { name: "objectId" } // first column
             { name: "username" } // second column
         ]
      }
    },
  ],

Example Use Case

All dashboard users store their own ordering in localStorage, but I don't want everyone to need to create their own order for 10ths of classes. It would be good to provide a sensible and customised default for all users.

Alternatives / Workarounds

None which I am aware of.

3rd Party References

Activity

parse-github-assistant

parse-github-assistant commented on Oct 2, 2023

@parse-github-assistant

Thanks for opening this issue!

  • 🎉 We are excited about your ideas for improvement!
theolundqvist

theolundqvist commented on Oct 2, 2023

@theolundqvist
Author

Addition:
I would also want to be able to provide a default ordering for the classes. Maybe even separate them into groups with a horizontal line such as it is done with the system classes.

added
type:featureNew feature or improvement of existing feature
on Oct 2, 2023
mtrezza

mtrezza commented on Oct 2, 2023

@mtrezza
Member

The auto-sort sorts the rest of the fields alphabetically, not randomly, that's what it's supposed to do anyway.

Did you check whether columnPreference already supports predefined column sorting? It may not be documented in the README but the feature may exist in code.

theolundqvist

theolundqvist commented on Oct 3, 2023

@theolundqvist
Author

I did do some digging but I could try again.

This is what the columns in one of my classes look like in a fresh browser
image
The first four fields are always in the same order and the custom fields does not seem to be in alphabetical order.

Doing this does not affect the order.

columnPreference: {
  "Progress": [{name: "chapter"}, {name: "user"}, {name: "progress"}]
}

It seems to me that this should work based on the code here: ColumnPreference.js:100

First it adds the columns in localstorage, then objectId, then the defaultPrefs and lastly all the others in a convenient order since there is no sorting going on from what I can tell.

Actually..., Safari was probably not as clean as I thought. I opened they dashboard in a new icognito window and this is the result:
image

So it does work.

But there is still a minor problem here. Even if I never added any clientside custom ordering to the Progress class the dashboard saves the order in my localstorage and applies it with priority the next time I open the dashboard. Meaning that server side ordering changes won't affect the client if they ever opened the dashboard before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:featureNew feature or improvement of existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @mtrezza@theolundqvist

        Issue actions

          Add options for default column order · Issue #2504 · parse-community/parse-dashboard