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

Admin UI: fixed corner case where a non-orderable default could be selected #2972

Merged
merged 1 commit into from May 14, 2020

Conversation

Vultraz
Copy link
Contributor

@Vultraz Vultraz commented May 14, 2020

@ra-external came across a bug revealed by the move to sortBy in the admin ui. If a list has only non-orderable fields (such as a list with only a File) field, you won't be able to access it since a graphql validation error will be thrown. This was due to blind selection of the first default field for sorting regardless of whether it was actually orderable or not. This was hidden due to the lack of validation with orderBy, but now cropped up.

This might be better done server-side when defaultSort is set. Thoughts? Thought I might do that separately. This is really just a hotfix.

@changeset-bot
Copy link

changeset-bot bot commented May 14, 2020

🦋 Changeset is good to go

Latest commit: 7643ee9

We got this.

This PR includes changesets to release 1 package
Name Type
@keystonejs/app-admin-ui Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

@MadeByMike MadeByMike left a comment

Choose a reason for hiding this comment

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

Good catch

@MadeByMike MadeByMike merged commit 8e36602 into keystonejs:master May 14, 2020
@github-actions github-actions bot mentioned this pull request May 14, 2020
@Vultraz Vultraz deleted the admin-ui-fix-sort-default branch May 14, 2020 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants