closes: [#6253](https://github.com/hasura/graphql-engine/issues/6253)
Description:
[rikinsk] removed the option to select _ne from the dropdown while ensuring existing permissions with _ne are still rendered properly
Test:
- [ ] the `_ne` operator is not showed as an option while creating a permission rule
- [ ] if a permission rule already has `_ne` in it, the permission builder renders it properly
Effected component:
- [x] Console
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/265
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
Co-authored-by: Vijay Prasanna <11921040+vijayprasanna13@users.noreply.github.com>
GitOrigin-RevId: 8c07425aefc5bc0897831e36f429c31c4c87fd2d
## Description 🔖
Adding root field level section for permissions for select and subscriptions.
One can choose specific root permissions per role that can be enabled or disabled. This is done on a role basis.
By default the permissions does not exist. When this is the case, all permission are enabled per default.
Once a permission has been tampered with, the permissions work as expected by the ui.
## Related Issues 👾
Jira issue: https://hasurahq.atlassian.net/browse/CON-259
## Solution and Design 🎨
Feature showcase video recording: https://app.iterspace.com/recording/6faa1c87-fd17-450b-ac57-3a788bfcc6e4
The solution is made in our legacy part of the Data -> Permissions-tab. The section is going to be migrated in a short future.
### Steps to test
- go to Data tab -> any table -> Permissions tab
- create and edit roles by playing around with the new "Root fields permissions" section
## Known issues
The vertical alignment of the "Don't ask me again" is not the expected one.
It is due to the current `Checkbox` component that includes a label and an error message div, that is not needed in this use case.
As discussed with @nicoinch I could refactor the current `Checkbox` component into a `FormCheckbox` component, make a new atom component `Checkbox` with the input and right label only, and use it inside the `FormCheckbox`.
This will be done on another card ([CON-415](https://hasurahq.atlassian.net/browse/CON-415))
![image](https://user-images.githubusercontent.com/59067245/181784002-19b07ff2-5eb4-4867-92d8-4d2e51afbeb3.png)
### Typescript & State management
- [x] Migrate modified JS files to TS
### Pro console
- [x] Pro console build has been verified. If this check is not relevant, please remove this line.
## Changelog ✍️
- [x] `CHANGELOG.md` is updated with user-facing content relevant to this PR. If no changelog is required, then add the `no-changelog-required` label.
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4873
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
Co-authored-by: Luca Restagno <59067245+lucarestagno@users.noreply.github.com>
GitOrigin-RevId: 51aa05af3c4de4dea957e7a12aaf4108e797d3ba
Use this docker-compose file while running the connect DB cypress test
<details>
<summary>Docker-compose file</summary>
```yaml
version: '3.6'
services:
postgres:
image: postgres:12
restart: unless-stopped
ports:
- '5432:5432'
volumes:
- db_meta:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: postgrespassword
postgres12:
image: postgres:12
restart: unless-stopped
ports:
- '4432:5432'
volumes:
- db_pg12_data:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: postgrespassword
msserver:
image: 'mcr.microsoft.com/mssql/server:2019-latest'
ports:
- '1435:1435'
restart: unless-stopped
environment:
SA_PASSWORD: 'testPassword123'
ACCEPT_EULA: 'Y'
graphql-engine:
image: hasura/graphql-engine:v2.8.1
ports:
- '8080:8080'
depends_on:
- 'postgres'
restart: unless-stopped
environment:
HASURA_GRAPHQL_DATABASE_URL: postgres://postgres:postgrespassword@postgres:5432/postgres
TEST_MSSQL_DATABASE_URL: DRIVER={ODBC Driver 17 for SQL Server};SERVER=msserver;Uid=SA;Pwd=testPassword123
## enable the console served by server
HASURA_GRAPHQL_ENABLE_CONSOLE: 'true' # set to "false" to disable console
## enable debugging mode. It is recommended to disable this in production
## HASURA_GRAPHQL_CONSOLE_ASSETS_DIR: /srv/console-assets
HASURA_GRAPHQL_DEV_MODE: 'true'
HASURA_GRAPHQL_ENABLED_LOG_TYPES: startup, http-log, webhook-log, websocket-log, query-log
## uncomment next line to set an admin secret
# HASURA_GRAPHQL_ADMIN_SECRET: myadminsecretkey
HASURA_GRAPHQL_ENABLE_REMOTE_SCHEMA_PERMISSIONS: 'true'
HASURA_GRAPHQL_EXPERIMENTAL_FEATURES: naming_convention
volumes:
db_pg12_data:
db_meta:
# Connect to second PG using env var DB2
# Connect to metadata PG using HASURA_GRAPHQL_METADATA_DATABASE_URL
# Connect to mssql server using connection string (not env)
# DRIVER={ODBC Driver 17 for SQL Server};SERVER=msserver;Uid=SA;Pwd=testPassword123
# PG 12 : postgres://postgres:postgrespassword@postgres12:5432/postgres
```
</details>
1. Here is the [Video](https://www.loom.com/share/bfe8b4da59ae48dca3fc9877b440c360) of the running connect db e2e test
2. We write test only for connect Postgres DB not for mssql because mssql container doesn't work on CI and on M1 laptops. Moreover, the value provided was low because we tested the same path Postgres (this was team agreement)
3. We installed @testing-library/cypress to leverage the same helper functions (we used `findByText` and `findByPlaceholderText`)
4. We used `withIn` to target a section on a page and find an element inside
5. We used a procedural approach and we added `cy.log` to improve the debugging of the test.
6. We created new helper function to test notifications -
`cy.expectSuccessNotification()`
`cy.expectSuccessNotificationWithTitle(title: string)`
`cy.expectSuccessNotificationWithMessage(message: string)`
`cy.expectErrorNotification()`
`cy.expectErrorNotificationWithTitle(title: string)`
`cy.expectErrorNotificationWithMessage(message: string)`
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4960
Co-authored-by: Luca Restagno <59067245+lucarestagno@users.noreply.github.com>
Co-authored-by: Brandon Simmons <210815+jberryman@users.noreply.github.com>
Co-authored-by: Samir Talwar <47582+SamirTalwar@users.noreply.github.com>
Co-authored-by: Divi <32202683+imperfect-fourth@users.noreply.github.com>
Co-authored-by: Karthikeyan Chinnakonda <15602904+codingkarthik@users.noreply.github.com>
Co-authored-by: Erik Magnusson <32518962+ejkkan@users.noreply.github.com>
Co-authored-by: Vishnu Bharathi <4211715+scriptnull@users.noreply.github.com>
Co-authored-by: Jesse Hallett <9622+hallettj@users.noreply.github.com>
Co-authored-by: Abby Sassel <3883855+sassela@users.noreply.github.com>
Co-authored-by: David Overton <7734777+dmoverton@users.noreply.github.com>
Co-authored-by: Daniel Chambers <1214352+daniel-chambers@users.noreply.github.com>
Co-authored-by: Lyndon Maydwell <92299+sordina@users.noreply.github.com>
Co-authored-by: paritosh-08 <85472423+paritosh-08@users.noreply.github.com>
Co-authored-by: Gil Mizrahi <8547573+soupi@users.noreply.github.com>
Co-authored-by: Benoit Ranque <25712958+BenoitRanque@users.noreply.github.com>
Co-authored-by: Daniel Harvey <4729125+danieljharvey@users.noreply.github.com>
Co-authored-by: Tom Harding <6302310+i-am-tom@users.noreply.github.com>
Co-authored-by: Solomon <24038+solomon-b@users.noreply.github.com>
Co-authored-by: Antoine Leblanc <1618949+nicuveo@users.noreply.github.com>
Co-authored-by: Evie Ciobanu <1017953+eviefp@users.noreply.github.com>
Co-authored-by: Vijay Prasanna <11921040+vijayprasanna13@users.noreply.github.com>
Co-authored-by: Naveen Naidu <30195193+Naveenaidu@users.noreply.github.com>
Co-authored-by: Abhijeet Khangarot <26903230+abhi40308@users.noreply.github.com>
Co-authored-by: Rob Dominguez <24390149+robertjdominguez@users.noreply.github.com>
Co-authored-by: Puru Gupta <32328846+purugupta99@users.noreply.github.com>
Co-authored-by: Daniele Cammareri <5709409+dancamma@users.noreply.github.com>
Co-authored-by: Marion Schleifer <5722022+marionschleifer@users.noreply.github.com>
GitOrigin-RevId: a50879ee790d3409c0b97c87a0e3d2b793c9ff37