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 bulk deleting roles without permissions close #4178 #4195

Merged
merged 3 commits into from Mar 26, 2020

Conversation

sobrinho
Copy link
Contributor

@sobrinho sobrinho commented Mar 25, 2020

Description

Roles without any permissions can't be bulk deleted and throws an error as described in #4178.

Changelog

  • CHANGELOG.md is updated with user-facing content relevant to this PR.

Affected components

  • Server
  • Console
  • CLI
  • Docs
  • Community Content
  • Build System
  • Tests
  • Other (list it)

Related Issues

#4178

Solution and Design

Do not render the checkbox for roles without any permission. That way, the user can't select it.

Steps to test and verify

Try to mark and bulk delete a role without any permissions configured in a table, watch the inspector before doing it.

Limitations, known bugs & workarounds

N/A

Server checklist

N/A

Catalog upgrade

Does this PR change Hasura Catalog version?

  • No
  • Yes
    • Updated docs with SQL for downgrading the catalog

Metadata

Does this PR add a new Metadata feature?

  • No
  • Yes
    • Does run_sql auto manages the new metadata through schema diffing?
      • Yes
      • Not required
    • Does run_sql auto manages the definitions of metadata on renaming?
      • Yes
      • Not required
    • Does export_metadata/replace_metadata supports the new metadata added?
      • Yes
      • Not required

GraphQL

  • No new GraphQL schema is generated
  • New GraphQL schema is being generated:
    • New types and typenames are correlated

Breaking changes

  • No Breaking changes

  • There are breaking changes:

    1. Metadata API

      Existing query types:

      • Modify args payload which is not backward compatible
      • Behavioural change of the API
      • Change in response JSON schema
      • Change in error code
    2. GraphQL API

      Schema Generation:

      • Change in any NamedType
      • Change in table field names

      Schema Resolve:-

      • Change in treatment of null value for any input fields
    3. Logging

      • Log JSON schema has changed
      • Log type names have changed

@hasura-bot
Copy link
Contributor

Beep boop! 🤖

Hey @sobrinho, thanks for your PR!

One of my human friends will review this PR and get back to you as soon as possible.

Stay awesome! 😎

@hasura-bot
Copy link
Contributor

Review app for commit a551c02 deployed to Heroku: https://hge-ci-pull-4195.herokuapp.com
Docker image for server: hasura/graphql-engine:pull4195-a551c024

Copy link
Contributor

@marionschleifer marionschleifer left a comment

Choose a reason for hiding this comment

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

Changelog approved.

Copy link
Member

@rikinsk rikinsk left a comment

Choose a reason for hiding this comment

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

In place of completely hiding the bulk select checkbox if no permissions exist, it would be better to simply disable the check box and changing its title to "No permissions exist" to make it clear why it cannot be selected. Adding a new key called disableCheckbox along with the showCheckbox key should help achieve this

@sobrinho
Copy link
Contributor Author

Alright, I will do it.

@netlify
Copy link

netlify bot commented Mar 26, 2020

Deploy preview for hasura-docs ready!

Built with commit 9183a19

https://deploy-preview-4195--hasura-docs.netlify.com

@sobrinho
Copy link
Contributor Author

@rikinsk done!

@hasura-bot
Copy link
Contributor

Review app for commit c485d6d deployed to Heroku: https://hge-ci-pull-4195.herokuapp.com
Docker image for server: hasura/graphql-engine:pull4195-c485d6d6

@beerose
Copy link
Contributor

beerose commented Mar 26, 2020

In v.1.1.0 we were showing a checkbox for a new role without permissions, which resulted in error described in #4178. But in this PR #3889 we added showCheckbox which conditionally renders checkbox.
What is the example scenario in which I can see a disabled checkbox with No permissions exist title?

@rikinsk
Copy link
Member

rikinsk commented Mar 26, 2020

@beerose If you have a role used in one table but not used in another table

@beerose
Copy link
Contributor

beerose commented Mar 26, 2020

Thank you! Approving.

@netlify
Copy link

netlify bot commented Mar 26, 2020

Deploy preview for hasura-docs ready!

Built with commit cb5d94a

https://deploy-preview-4195--hasura-docs.netlify.com

@hasura-bot
Copy link
Contributor

Review app for commit cb5d94a deployed to Heroku: https://hge-ci-pull-4195.herokuapp.com
Docker image for server: hasura/graphql-engine:pull4195-cb5d94a5

@hasura-bot
Copy link
Contributor

Review app for commit c466844 deployed to Heroku: https://hge-ci-pull-4195.herokuapp.com
Docker image for server: hasura/graphql-engine:pull4195-c4668443

@rikinsk rikinsk merged commit b53533c into hasura:master Mar 26, 2020
@hasura-bot
Copy link
Contributor

Review app https://hge-ci-pull-4195.herokuapp.com is deleted

@hasura-bot
Copy link
Contributor

Beep boop! 🤖

GIF

Awesome work @sobrinho! All of us at Hasura ❤️ what you did.

Thanks again 🤗

anurag pushed a commit to anurag/graphql-engine that referenced this pull request Mar 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants