Commit Graph

784 Commits

Author SHA1 Message Date
Vijay Prasanna
193ab5de44 console: update current source and schema in redux after importing metadata
https://github.com/hasura/graphql-engine-mono/pull/1557

GitOrigin-RevId: 3bb34f64bb4762e73f967643675b291fb6530785
2021-06-23 13:01:13 +00:00
Varun Choudhary
c2dd51b6c7 console: pass correct table name when cloning permission
Closes: https://github.com/hasura/graphql-engine/issues/6969

Description:

To reproduce the issue please visit the issue link.
This is happening because the request payload is using the current table name while cloning permission. This PR change makes the payload use the correct table name.

- [ ] `CHANGELOG.md` is updated with user-facing content relevant to this PR. If no changelog is required, then add the `no-changelog-required` label.

### Affected components

- [x] Console
- [x] CLI

https://github.com/hasura/graphql-engine-mono/pull/1505

GitOrigin-RevId: bfd8a67ccb55261a1bf47a9ede18e3e1cf3bff2c
2021-06-22 18:23:04 +00:00
Abhijeet Khangarot
c0fde4d1d5 console: hide postgres system schemas by default
>

### Description
We want to hide postgres system schemas like `pg_toast` and `pg_temp` and their variations (ex. `pg_toast_temp_35`) from showing up in console.
>

### 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.

### Affected components

- [x] Console

### Related Issues
->
https://github.com/hasura/graphql-engine/issues/6954

### Solution and Design
>
We can achieve this by updating the `schemaListSql` query for postgres datasources to filter out postgres system schemas.

### Steps to test and verify
>

1. Add a postgres datasource containing some system schemas
2. The system schemas should not show up in console

https://github.com/hasura/graphql-engine-mono/pull/1499

Co-authored-by: Aleksandra Sikora <9019397+beerose@users.noreply.github.com>
GitOrigin-RevId: 6a179b9d5cd4d061ae9fda17bf3824321cf7e96e
2021-06-22 15:24:20 +00:00
Abhijeet Khangarot
9255fcf173 console: wrap table name in quotes in add comment sql
>
Adding a table with a capital letter and a comment was causing SQL error, this PR fixes that issue. (in postgres and citus dbs)

### Description
>

### 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.

### Affected components

- [x] Console

https://github.com/hasura/graphql-engine-mono/pull/1617

GitOrigin-RevId: b8e911206af7ce950b5432dab98723e52992b905
2021-06-22 14:45:24 +00:00
Sameer Kolhar
608e4fbb20 server, console, docs: add update_remote_schema API
https://github.com/hasura/graphql-engine-mono/pull/1546

GitOrigin-RevId: 142b0d0e0ffc35b2679c91c411868c45a8b8e221
2021-06-21 17:42:40 +00:00
Sooraj
03ecd0398b console: improve console with read-only database
https://github.com/hasura/graphql-engine-mono/pull/1619

GitOrigin-RevId: 26da5b0d1b48d2158642c7efb5f1e99933a37624
2021-06-21 15:17:24 +00:00
Ikechukwu Eze
6bb8df6a26 console: add citus support
### Description
Add console support for Citus DB

### Changelist
- [x] Add/Remove Citus Datasource
- [x] Track/Untrack tables
- [x] Create Relationships + Tracking suggested relationships
- [x] Permissions
- [x] Browse Rows (minimal)
- [x] Insert Row (using Mutations)
- [x] Filtering Shards and Partitions (partition details are not present in Modify tab, it should work once https://github.com/hasura/graphql-engine-mono/pull/1164 is merged)
- [x] Create Table
- [x] Fixes issue https://github.com/hasura/graphql-engine/issues/6926 for Citus.

### Known Issues
- Unable to create Functions from Raw SQL, server returns 400.
- Unable to run `ALTER` SQL commands, server returns 400.

### Screenshots

![Screenshot 2021-04-21 at 7 53 23 PM](https://user-images.githubusercontent.com/11921040/115569900-468b3d80-a2db-11eb-8374-e06d5d61b2e4.png)

### Setting up a Citus Source
- Link to [docker compose](https://github.com/citusdata/docker/blob/master/docker-compose.yml)
- Create an `.envfile` and add the following
```env
COORDINATOR_EXTERNAL_PORT=<port to expose citus master>
COMPOSE_PROJECT_NAME=test
```
- run `docker-compose --file docker-compose.yml --env-file .envfile up --scale worker=2 -d`. `worker` controls the number of citus worker nodes.
- Link to [sample data](http://docs.citusdata.com/en/v10.0/get_started/tutorial_multi_tenant.html#data-model-and-sample-data)

### Changelog
- [x] console: add citus support

https://github.com/hasura/graphql-engine-mono/pull/1184

Co-authored-by: Vijay Prasanna <11921040+vijayprasanna13@users.noreply.github.com>
GitOrigin-RevId: 2500a5d5f996a2904fe8b5c656d6f3f2db707db6
2021-06-21 06:47:18 +00:00
Vijay Prasanna
fdcdc14c01 console: add default selected reference option to create table's foreign key editor
https://github.com/hasura/graphql-engine-mono/pull/1472

GitOrigin-RevId: e44f6bc6d819d049edd042ecd1e4e951a45f4ab8
2021-06-18 09:53:51 +00:00
Sooraj
12045a827c console/fix: changing primary key removes the existing PK when failing to create PK
https://github.com/hasura/graphql-engine-mono/pull/1509

GitOrigin-RevId: b4fec58f399b21125dcacf8083b01148778f97b0
2021-06-17 16:04:02 +00:00
hasura-bot
bad2d4190d console: catch api error, fix console getting stuck on loading screen (close #5774)
GITHUB_PR_NUMBER: 5837
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/5837

https://github.com/hasura/graphql-engine-mono/pull/856

Co-authored-by: Abhijeet Khangarot <26903230+abhi40308@users.noreply.github.com>
GitOrigin-RevId: 2a878ea9de0b21cf998b7a49dbfc6d99c143168e
2021-06-17 11:03:24 +00:00
Abhijeet Khangarot
240738cf60 console: fix routes for hasura cloud console
https://github.com/hasura/graphql-engine-mono/pull/1560

GitOrigin-RevId: 83d1825ad7ee74fd7a941376925d7e26c788baf5
2021-06-17 09:34:13 +00:00
Nicolas Beaussart
ad2f48c534 console: add testing to core requestAction
https://github.com/hasura/graphql-engine-mono/pull/1563

GitOrigin-RevId: 1bbd107e81a9965d0be9d35c581ca261935bfc83
2021-06-15 05:43:48 +00:00
Sooraj
8e6a8ee8c5 console: merge duplicate unit test folders (#1561)
https://github.com/hasura/graphql-engine-mono/pull/1561

GitOrigin-RevId: 635a185e456c1860fb7e596a2247657135213391
2021-06-14 10:19:59 +00:00
Varun Choudhary
a7ef558b41 console: add modify functionality on columns, primary keys & unique keys to MS SQL Server tables
Modify page for mssql.
Column edit, add and delete
Pk add and delete
unique key add and delete

> Known Issues
> It is not because of this PR, but evident after implementing this changes.
> Table comments section is not only showing table comments but also anything that has `SYS.EXTENDED_PROPERTIES` with the table id, we may need to fix this by adding more conditions while fetching the table comments
> issue: https://github.com/hasura/graphql-engine-mono/issues/1486

Update
> Found a common issue while testing this PR, and it happens for PG tables too, so keeping it as a different issue
https://github.com/hasura/graphql-engine/issues/7018

GitOrigin-RevId: f7883a797ce8d25034824ae35668b1f830e59c70
2021-06-10 09:09:33 +00:00
Nicolas Beaussart
651d8ce190 console: upgrade redux and add redux toolkit
GitOrigin-RevId: 328e28f521f6e5fa20489aaeea2be1f1cc456d56
2021-06-10 07:20:23 +00:00
Abhijeet Khangarot
75f37f69d3 console: allow input object presets in remote schema permissions
GitOrigin-RevId: 6a535a5b9adb0a80d8f57682618aa7dd406236b0
2021-06-09 08:52:22 +00:00
Varun Choudhary
3f19e8a3a8 console: allow tracking of custom SQL functions having composite type (rowtype) input arguments
Closes: https://github.com/hasura/graphql-engine/issues/6858

Description:

Following two things are done:

1. Show compatible functions in the Untracked custom functions list (i.e. even those with ROWTYPE arg)
![Screenshot from 2021-05-11 16-13-21](https://user-images.githubusercontent.com/68095256/117803100-dd606f80-b273-11eb-8d02-1ea55b31863d.png)
2. When a function with ROWTYPE argument is tracked, a confirmatory dialogue box is shown. The text reads `This function can be added as a root field or a computed field inside a table` and the buttons reflect the options: `Add as root field`, `Add as computed field` (this will take the user to the Modify -> Add a computed field section of the first-row type argument)
![Screenshot from 2021-06-03 17-28-28](https://user-images.githubusercontent.com/68095256/120641377-28dff500-c491-11eb-80ea-cc60e6f37f23.png)

Affected Component:

- [x] Console

Co-authored-by: Vijay Prasanna <11921040+vijayprasanna13@users.noreply.github.com>
Co-authored-by: Abhijeet Khangarot <26903230+abhi40308@users.noreply.github.com>
GitOrigin-RevId: 089944aadba73f7a77e220a49489846ff1cb9540
2021-06-08 15:22:24 +00:00
Vijay Prasanna
75fb945019 console/big-query: fixes broken console (browse rows) when selecting relationships
GitOrigin-RevId: f6871bd3abd0c85ffc35cd5884efa4b1ab5a9068
2021-06-08 11:07:56 +00:00
Vijay Prasanna
bf629db930 console: fix result parsing error in raw sql page
### Description
The `statementTimeout` on RawSQL is not reset after changing a datasource. This causes an error when running SQL  and parsing the results for DBs that don't support statement timeout property on the console.

![timeout](https://user-images.githubusercontent.com/11921040/120473505-b6094800-c3c4-11eb-8b00-e43d9ebcb207.gif)

### Affected components
- [x] Console

### Steps to test and verify
- Open /data/manage
- Click on any SQL Server DB.
- Go to Raw SQL
- Run any query
- Verify correct result

GitOrigin-RevId: 8a0adaf308d14db17126953286173da7ef1afc1c
2021-06-07 10:54:37 +00:00
Abhijeet Khangarot
83e1f51d2c console: bug fix cannot read property unique_constraints of undefined
GitOrigin-RevId: a8eec2a8dd1ca16a453f9ec90b956032cf123398
2021-06-04 15:30:21 +00:00
Varun Choudhary
f3643f26ad console/mssql: support CRUD operations for foreign keys
adds foreign key functionality to mssql tables under Modify Tab.

Steps to test:
1. Connect an MSSQL data source.
2. Create a table
3. go to modify page
4. make sure the `Add foreign key `button is visible
5. click on `Add foreign key`, and try to add FK
6. after adding the FK, we will see the `edit` and `remove` button, try to edit and remove the FK

Co-authored-by: Vijay Prasanna <11921040+vijayprasanna13@users.noreply.github.com>
GitOrigin-RevId: 63be7c4ef909503ac05096a64c686b72f7c47307
2021-06-03 11:49:21 +00:00
hasura-bot
c1381d38e0 console: show error notification for table and cloumn names exceeding 63 characters and trim migration names exceeding 255 characters
GITHUB_PR_NUMBER: 5785
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/5785

Co-authored-by: Abhijeet Khangarot <26903230+abhi40308@users.noreply.github.com>
GitOrigin-RevId: b12a729cfb708ff0622805f247473cb16b44ae0a
2021-06-02 10:23:58 +00:00
Ikechukwu Eze
9b42a52637 console: allow renaming data source
Before: on edit source page, changing data source name was not allowed and the input disabled.
Now: data source name can be changed on edit source page.

Note:
- ~When only the data source name is changed, a  request is sent for renaming and another for updating data source even when other values of the data source configuration weren't changed.~
- This has been fixed and should be tested thus:
    - run `npm run jest`
    - on edit source UI, change only data source name and confirm that only `rename_source` request is being sent through network tab in dev tools
    - change any other fields but the source name, and confirm that only `add_source` with `replace_configuration: true` is sent.
    - change both source name and any other field in the form and confirm that both request are sent (in this order: rename request before add request) and export_metadata request only sent once after that.
    - Try with bigquery, mssql and postgres

Possible Refactor:
  - consider if `renameDataSource` and `addDataSource`, can be refactored or left as is

Co-authored-by: Aleksandra Sikora <9019397+beerose@users.noreply.github.com>
GitOrigin-RevId: cbb041ac8362fd94de5aa19bfa61c0cde8703459
2021-05-28 07:59:47 +00:00
Aleksandra Sikora
1b37008a0e console: fix connect db notes content
GitOrigin-RevId: 75cc16950d7be7ad5b52cf266c6c010cb54d53ec
2021-05-28 06:57:55 +00:00
Sooraj
c3d7a7634f console: add drop table functionality to ms sql server tables
GitOrigin-RevId: a79c864263ebdde4a9a7e1ce1354a3ac17be4098
2021-05-27 21:26:50 +00:00
Abhijeet Khangarot
9a68cb51c9 console: update connect database form with SSL certificates
GitOrigin-RevId: b8da60cbe1220c8f4f8ec180fd3967e326b7f3a8
2021-05-27 16:00:01 +00:00
Vijay Prasanna
1c79bb4b80 console: add create table view for mssql schemas
### Description
This PR adds `Create Table` view for MSSQL server schemas.

### Changelist
* [x] Add basic `create table` form view on navigating from Schema's create table action.
* [x] Hide frequently selected columns button.
* [x] Allow the user to manually add column types for now: convert `select` for columns to a `text` input .
* [x] Remove `Restrict` radio selection for foreign key constraints.
* [x] Add SQL query for Create table in MSSQL.
### Screenshot
![Screenshot 2021-03-09 at 5 22 03 PM](https://user-images.githubusercontent.com/11921040/110467030-82d45700-80fc-11eb-84af-dd228d84b135.png)

### 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.

### Modified components
 - Console

Co-authored-by: Aleksandra Sikora <9019397+beerose@users.noreply.github.com>
GitOrigin-RevId: a783b5940198ecf582d1cd6ad4d4224efabf59fc
2021-05-26 15:28:32 +00:00
Aleksandra Sikora
455b5a9fd6 console/mssql: add comment and check constraints to modify page
GitOrigin-RevId: 0fcc9741d031ec7a74efff5437e676ea7f744922
2021-05-26 14:27:42 +00:00
Vijay Prasanna
7dbee42f64 console: add regex to highlight item in data tab nav tree
Adding regex expression to test `view`, `table` and `function` routes.
Fixes no highlight issue when clicking on functions in the data tab navigation tree.

GitOrigin-RevId: f278998ec1c98c98e0bfc9cd72d63d673cd74012
2021-05-26 09:43:31 +00:00
Vijay Prasanna
3acfd35d4e console/bigquery: fix showing empty dataset name when the dataset is from a non-US region
Fixes [issue](https://github.com/hasura/graphql-engine/issues/6937)

### Description
The problem lies with the `schemaListSql` for Big Query.  Without a region qualifier prefixed, the SQL result contains datasets only US regions, as described in the [docs](https://cloud.google.com/bigquery/docs/information-schema-datasets).
```
If you do not specify a regional qualifier, metadata is retrieved from the us multi-region.
```

The alternative way is to get a list of all available publicly available regions (which is `us` and `europe` atm), for example for europe -
```
SELECT * FROM region-europe.INFORMATION_SCHEMA.SCHEMATA;
```
and then perform `UNION ALL` of the results. This is approached is ditched in favour of the reason that Big Query is read-only on Hasura and new datasets cannot be added from the console (other than by modifying the metadata), we can return the datasets available in the Big Query source's metadata as the possible values of datasets needed by the console to render the data nav tree, thereby avoiding an extra API call in the process.

GitOrigin-RevId: 8117d5698dcc4e7d932362b7cf2e7c8ef34d106a
2021-05-25 18:21:48 +00:00
Abhijeet Khangarot
d0a66e5172 console: add new connection params to connect database form
GitOrigin-RevId: 073d30e50a196e265cd8dfb7cfb3c9af00c3fc0e
2021-05-25 13:03:08 +00:00
Aleksandra Sikora
a5ce316a96 console/mssql: simplify sql query for fetching schemas list
GitOrigin-RevId: 0d70973991c61b8f06efe61032bcfbfe05a89ded
2021-05-25 09:36:24 +00:00
Anon Ray
53beef47ea server, console, docs: fix untrack_function metadata query bug
Co-authored-by: Sameer Kolhar <6604943+kolharsam@users.noreply.github.com>
GitOrigin-RevId: a68a6f8b5c5243372332bfec7d9cdcd3011c001f
2021-05-24 15:57:26 +00:00
Abhijeet Khangarot
82e2e382f1 console: rearrange connect database form and add prepared statements
GitOrigin-RevId: 2cb84e3feabc72875c6b3f5368b55fa893ba72a9
2021-05-24 15:09:55 +00:00
Vijay Prasanna
31465c5bba console/postgres: fix broken table view when clicking on inherited tables
### Description
- Fixes https://github.com/hasura/graphql-engine/issues/6926
- This is to resolve the issue where inherited tables get listed into the array that's used to filter off partitions.
- In the check, we compare if the partition's parent is a "partitioned table" or not before adding to the filter array.

### Steps to verify
- Create the following tables on a postgres db
```SQL
CREATE TABLE cities (
id SERIAL PRIMARY KEY,
name       text,
population real,
elevation  int     -- (in ft)
);

CREATE TABLE capitals (
state      char(2) UNIQUE NOT NULL
) INHERITS (cities);
```
- Navigate to the data tab, and click on the datasource > schema, and verify that both `cities` and `capitals` are present.
- Click on `capitals` and see if it loads properly.
- Create the following table and its partitions
```sql
CREATE TABLE measurement (
    city_id         int not null,
    logdate         date not null,
    peaktemp        int,
    unitsales       int
) PARTITION BY RANGE (logdate);

CREATE TABLE measurement_y2006m02 PARTITION OF measurement
    FOR VALUES FROM ('2006-02-01') TO ('2006-03-01');

CREATE TABLE measurement_y2006m03 PARTITION OF measurement
    FOR VALUES FROM ('2006-03-01') TO ('2006-04-01');
```
- Verify that the data tab nav does not show `measurement_y2006m02` and `measurement_y2006m03`

GitOrigin-RevId: 1cc988fff03f289e6ea36d0b1e9f8e54b8741be9
2021-05-24 11:56:28 +00:00
Ikechukwu Eze
f347d746f6 console: quote column name when updating the column
This fixes `column "column_name" named in key does not exist"`,
when changing editing a column to be unique in column editor. resolves [6734](https://github.com/hasura/graphql-engine/issues/6734)

GitOrigin-RevId: 5c8f9523d6c022245cd4c1bb5d0d4a3340c455cf
2021-05-24 10:13:12 +00:00
hasura-bot
e093399305 console: don't automatically set track this checkbox for commented sql
GITHUB_PR_NUMBER: 5815
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/5815

Co-authored-by: Abhijeet Khangarot <26903230+abhi40308@users.noreply.github.com>
GitOrigin-RevId: 7225d01eef40065a7b7ef617cd763988ef1e018d
2021-05-21 10:39:22 +00:00
Aleksandra Sikora
e7b4ad85c9 console: consistent naming for MS SQL Server, add (beta) for bigquery
GitOrigin-RevId: a1434cd32757c4a17b8619b2f03476350a002abc
2021-05-21 09:59:47 +00:00
Sooraj
e6b5b66edf console: add pagination on event logs & fix data mismatch on event logs table
GitOrigin-RevId: 5643a0357dd11963cde53a148911844e4c754510
2021-05-21 09:07:33 +00:00
Aleksandra Sikora
ad0ecc7363 console: filter out nonsupported databases
GitOrigin-RevId: 151cde9843310e069d81d1690666100bfa77c37f
2021-05-19 20:19:16 +00:00
Abhijeet Khangarot
95d1ab78e1 console: add one-to-one relationships support
Co-authored-by: Aleksandra Sikora <9019397+beerose@users.noreply.github.com>
GitOrigin-RevId: 6177c63a0e8ac86085441cbd4ad1aab179052434
2021-05-19 12:42:45 +00:00
Nithin
62423a66da console: update cron trigger tooltip
Co-authored-by: Aleksandra Sikora <9019397+beerose@users.noreply.github.com>
GitOrigin-RevId: 644447c39a553f72e471b6fcf3650e6c75686d89
2021-05-19 12:04:20 +00:00
Ikechukwu Eze
a7639145fe console: allow editing sources configuration
This adds the feature to edit data sources to the console

Co-authored-by: Aleksandra Sikora <9019397+beerose@users.noreply.github.com>
Co-authored-by: Rakesh Emmadi <12475069+rakeshkky@users.noreply.github.com>
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
Co-authored-by: Martin Mark <74692114+martin-hasura@users.noreply.github.com>
GitOrigin-RevId: 40f97a362620e9cebe97a2267cb9fb143c32af5d
2021-05-19 04:16:38 +00:00
Abhijeet Khangarot
8da98c00ba console: show db version in manage db page and remove from about page
GitOrigin-RevId: 482121bb4dd29d36b87f472ec14c966d04daab2c
2021-05-19 03:36:18 +00:00
Abhijeet Singh Khangarot
f24caef627 console: add union types to remote schema permissions
GitOrigin-RevId: a2a8311bfee98d1d1285fe869ed2a5963f84440d
2021-05-12 16:19:22 +00:00
Ikechukwu Eze
726c3e07b3 console: fix browse rows sections failing on a table with custom name
Fixes browse rows sections failing on a table with custom name and also not exposing a table with custom name to GraphQL API
Resolves [#6849](https://github.com/hasura/graphql-engine/issues/6849) and  also [#6647](https://github.com/hasura/graphql-engine/issues/6647)

GitOrigin-RevId: 00be15c766a457efd75e15801f91d9f793450131
2021-05-12 09:21:41 +00:00
Aleksandra Sikora
8c21ca5d21 console: revert improve data/relationships e2e tests
The changes turned out to be flaky — tests were failing from time to time, and blocking other PRs from being merged.

Reverts hasura/graphql-engine-mono#1037

GitOrigin-RevId: 97d95156e8d348f2e89ec33e06ffaac9bf75a2f9
2021-05-12 07:37:45 +00:00
Abhijeet Singh Khangarot
ad461d9285 console: hide bigquery from connect db form dropdown in cloud console
GitOrigin-RevId: e71b33ce2154e0584a773de49fa41c4e0c153d13
2021-05-10 23:19:35 +00:00
Aleksandra Sikora
c46b256fff console/mssql: fix fetching information about primary key and unique key columns
GitOrigin-RevId: b2796d12223c60374c553f580acc08a02df71a88
2021-05-07 14:07:28 +00:00
Ikechukwu Eze
d3887071af console: improve data/relationships e2e tests
This is the first step in making our cypress test faster.
Will clean the comments up in the coming days
Running time imporves from ~7mins to ~83secs

GitOrigin-RevId: d8d2b23c5a46789a3828dac1c6652034bd0bfc1c
2021-05-06 10:20:44 +00:00