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

[REVIEW]: heading component #9

Open
wants to merge 30 commits into
base: integration/tooltip-component
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
a95f912
console: refactor PageNotFound to function and heading component inte…
lastnamearya Mar 29, 2020
2267a34
console: refactor RunTimeError to functional and heading component in…
lastnamearya Mar 29, 2020
b548752
console: change ~ Heading component name to EditableHeading in Editab…
lastnamearya Mar 29, 2020
9a7a228
console: UIKit ~ add default fontWeight prop to heading component
lastnamearya Mar 29, 2020
d7a08d5
console: refactor CommonTabLayout to functional and heading component…
lastnamearya Mar 29, 2020
90d7c03
console: refactor Landing to functional and heading component integra…
lastnamearya Mar 29, 2020
f0079d2
console: refactor RemoteSchema to functional and heading component in…
lastnamearya Mar 29, 2020
251a016
console: integration ~ heading component for h2
lastnamearya Mar 29, 2020
7741fa5
console: remove heading_text, headerText class and add heading in rem…
lastnamearya Mar 29, 2020
65d13a0
console: integrate heading component for h5
lastnamearya Mar 29, 2020
9d94b8f
console: integrate heading component for h4
lastnamearya Mar 30, 2020
6591776
console: update UIKit ~ subHeading type add and integration for headi…
lastnamearya Mar 30, 2020
98dfb4d
console: remove subHeading type from HeadersEditor heading component
lastnamearya Mar 30, 2020
af754a2
console: integration heading component for subHeading class
lastnamearya Mar 30, 2020
22175be
console: integration heading component for subHeaderText class
lastnamearya Mar 30, 2020
a76eeed
Merge branch 'integration/tooltip-component' into integration/heading…
lastnamearya Apr 1, 2020
3c4339e
merge and fix ~ conflicts of integration/tooltip-component
lastnamearya Apr 4, 2020
c4f5de5
merge and fix ~ latest master changes through integration/tooltip-com…
lastnamearya Apr 4, 2020
93acd58
console: integrate heading component for ModifyView component
lastnamearya Apr 4, 2020
fac2723
console: UIKit ~ update black.text color in theme
lastnamearya Apr 5, 2020
4eed7a2
console: update color for main h1 headings
lastnamearya Apr 5, 2020
21b78e0
console: fix subHeading for remote schema
lastnamearya Apr 5, 2020
67cee2b
Merge branch 'integration/tooltip-component' into integration/heading…
lastnamearya Apr 5, 2020
8e71dbd
Merge branch 'integration/tooltip-component' into integration/heading…
lastnamearya Apr 5, 2020
6d5e87d
console: optimize and fix heading integration
lastnamearya Apr 5, 2020
d4abf61
fix ~ conflicts of merge branch - integration/tooltip-component
lastnamearya Apr 11, 2020
04d87c5
Merge branch 'integration/tooltip-component' into integration/heading…
lastnamearya Apr 12, 2020
6f928f1
fix ~ merge conflicts of integration/tooltip-component
lastnamearya Apr 21, 2020
ab911fb
console: remove not used css classes from main.scss
lastnamearya Apr 21, 2020
4e04185
fix ~ merge conflicts of integration/tooltip-component
lastnamearya Apr 29, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,8 @@ jobs:
- run:
name: test console
command: .circleci/test-console.sh
- store_artifacts:
path: /build/_console_output/server.log

# test server upgrade from last version to current build
test_server_upgrade:
Expand Down
4 changes: 2 additions & 2 deletions .circleci/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ send_pr_to_repo() {
git add .
git commit -m "update image version to ${LATEST_TAG}"
git push -q https://${GITHUB_TOKEN}@github.com/hasura/$1.git ${LATEST_TAG}
hub pull-request -F- <<<"Update image version to ${LATEST_TAG}" -r ${REVIEWERS} -a ${REVIEWERS}
hub pull-request -f -F- <<<"Update image version to ${LATEST_TAG}" -r ${REVIEWERS} -a ${REVIEWERS}
}

deploy_console() {
Expand Down Expand Up @@ -127,7 +127,7 @@ deploy_cli_ext() {
git add .
git commit -m "update cli-ext manifest to ${LATEST_TAG}"
git push -q https://${GITHUB_TOKEN}@github.com/hasura/cli-plugins-index.git cli-ext-${LATEST_TAG}
hub pull-request -F- <<<"Update cli-ext manifest to ${LATEST_TAG}" -r ${REVIEWERS} -a ${REVIEWERS}
hub pull-request -f -F- <<<"Update cli-ext manifest to ${LATEST_TAG}" -r ${REVIEWERS} -a ${REVIEWERS}

unset VERSION
unset DIST_PATH
Expand Down
4 changes: 2 additions & 2 deletions .circleci/test-cli-with-last-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ PID=$!
wait_for_port 8080

# test cli
HASURA_GRAPHQL_TEST_ENDPOINT="http://localhost:8080" TEST_TAGS="latest_release" make test
HASURA_GRAPHQL_TEST_ENDPOINT="http://localhost:8080" make test

# kill the running server
kill -s INT $PID
Expand All @@ -47,5 +47,5 @@ PID=$!
wait_for_port 8080

# test cli
HASURA_GRAPHQL_TEST_ENDPOINT="http://localhost:8080" HASURA_GRAPHQL_TEST_ADMIN_SECRET="abcd" TEST_TAGS="latest_release" make test
HASURA_GRAPHQL_TEST_ENDPOINT="http://localhost:8080" HASURA_GRAPHQL_TEST_ADMIN_SECRET="abcd" make test
kill -s INT $PID
2 changes: 1 addition & 1 deletion .circleci/test-cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ PID=$!
wait_for_port 8080

# test cli
HASURA_GRAPHQL_TEST_ENDPOINT="http://localhost:8080" TEST_TAGS="test_plugins" make test
HASURA_GRAPHQL_TEST_ENDPOINT="http://localhost:8080" make test
kill -s INT $PID

# start graphql-engine with admin secret
Expand Down
27 changes: 26 additions & 1 deletion .circleci/test-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,32 @@ unset HASURA_GRAPHQL_JWT_SECRET
echo -e "\n$(time_elapsed): <########## TEST GRAPHQL-ENGINE WITH ADMIN SECRET AND JWT (with claims_namespace_path) #####################################>\n"
TEST_TYPE="jwt-with-claims-namespace-path"

export HASURA_GRAPHQL_JWT_SECRET="$(jq -n --arg key "$(cat $OUTPUT_FOLDER/ssl/jwt_public.key)" '{ type: "RS512", key: $key , claims_namespace_path: "$.hasuraClaims"}')"
# hasura claims at one level of nesting
export HASURA_GRAPHQL_JWT_SECRET="$(jq -n --arg key "$(cat $OUTPUT_FOLDER/ssl/jwt_public.key)" '{ type: "RS512", key: $key , claims_namespace_path: "$.hasura_claims"}')"

run_hge_with_args serve
wait_for_port 8080

pytest -n 1 -vv --hge-urls "$HGE_URL" --pg-urls "$HASURA_GRAPHQL_DATABASE_URL" --hge-key="$HASURA_GRAPHQL_ADMIN_SECRET" --hge-jwt-key-file="$OUTPUT_FOLDER/ssl/jwt_private.key" --hge-jwt-conf="$HASURA_GRAPHQL_JWT_SECRET" test_jwt.py

kill_hge_servers

unset HASURA_GRAPHQL_JWT_SECRET

# hasura claims at two levels of nesting with claims_namespace_path containing special character
export HASURA_GRAPHQL_JWT_SECRET="$(jq -n --arg key "$(cat $OUTPUT_FOLDER/ssl/jwt_public.key)" '{ type: "RS512", key: $key , claims_namespace_path: "$.hasura['\''claims%'\'']"}')"

run_hge_with_args serve
wait_for_port 8080

pytest -n 1 -vv --hge-urls "$HGE_URL" --pg-urls "$HASURA_GRAPHQL_DATABASE_URL" --hge-key="$HASURA_GRAPHQL_ADMIN_SECRET" --hge-jwt-key-file="$OUTPUT_FOLDER/ssl/jwt_private.key" --hge-jwt-conf="$HASURA_GRAPHQL_JWT_SECRET" test_jwt.py

kill_hge_servers

unset HASURA_GRAPHQL_JWT_SECRET

# hasura claims at the root of the JWT token
export HASURA_GRAPHQL_JWT_SECRET="$(jq -n --arg key "$(cat $OUTPUT_FOLDER/ssl/jwt_public.key)" '{ type: "RS512", key: $key , claims_namespace_path: "$"}')"

run_hge_with_args serve
wait_for_port 8080
Expand Down
182 changes: 174 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,198 @@

## Next release

### Bug fixes and improvements

(Remove this and start adding entries)

## `v1.2.0-beta.5`

### server: backend only insert permissions

Introduces optional `backend_only` (default: `false`) configuration in insert permissions
(see [api reference](https://deploy-preview-4224--hasura-docs.netlify.com/graphql/manual/api-reference/schema-metadata-api/permission.html#insertpermission)).
If this is set to `true`, the insert mutation is accessible to the role only if the request
is accompanied by `x-hasura-use-backend-only-permissions` session variable whose value is set to `true` along with the `x-hasura-admin-secret` header.
Otherwise, the behavior of the permission remains unchanged.

This feature is highly useful in disabling `insert_table` mutation for a role from frontend clients while still being able to access it from a Action webhook handler (with the same role).

(rfc #4120) (#4224)

### server: debugging mode for non-admin roles

For any errors the server sends extra information in `extensions` field under `internal` key. Till now this was only
available for `admin` role requests. To enable this for other roles, start the server with `--dev-mode` flag or set `HASURA_GRAPHQL_DEV_MODE` env variable to `true`:

```bash
$ graphql-engine --database-url <database-url> serve --dev-mode
```

In case you want to disable `internal` field for `admin` role requests, set `--admin-internal-errors` option to `false` or or set `HASURA_GRAPHQL_ADMIN_INTERNAL_ERRORS` env variable to `false`

```bash
$ graphql-engine --database-url <database-url> serve --admin-internal-errors false
```

This feature come in handy during development when you may want to see detailed errors irrespective of roles.

**Improved internal errors for Actions**:

(This is a **breaking change** with previous 1.2.0-beta releases)

The `internal` field for action errors is improved with more debug information. It now includes `request`,
`response` and `error` fields instead of just `webhook_response` field.

Before:
```json
{
"errors": [
{
"extensions": {
"internal": {
"webhook_response": {
"age": 25,
"name": "Alice",
"id": "some-id"
}
},
"path": "$",
"code": "unexpected"
},
"message": "unexpected fields in webhook response: age"
}
]
}
```
After:
```json
{
"errors": [
{
"extensions": {
"internal": {
"error": "unexpected response",
"response": {
"status": 200,
"body": {
"age": 25,
"name": "Alice",
"id": "some-id"
},
"headers": [
{
"value": "application/json",
"name": "Content-Type"
},
{
"value": "abcd",
"name": "Set-Cookie"
}
]
},
"request": {
"body": {
"session_variables": {
"x-hasura-role": "admin"
},
"input": {
"arg": {
"age": 25,
"name": "Alice",
"id": "some-id"
}
},
"action": {
"name": "mirror"
}
},
"url": "http://127.0.0.1:5593/mirror-action",
"headers": []
}
},
"path": "$",
"code": "unexpected"
},
"message": "unexpected fields in webhook response: age"
}
]
}
```

### cli: add support for .env file

ENV vars can now be read from .env file present at the project root directory. A global flag, `--envfile`, is added so you can explicitly provide the .env filename, which defaults to `.env` filename if no flag is provided.

**Example**:

```
hasura console --envfile production.env
```
The above command will read ENV vars from `production.env` file present at the project root directory.

(close #4129) (#4454)

### console: allow setting post-update check in update permissions

Along with the check for filtering rows that can be updated, you can now set a post-update permission check that needs to be satisfied by the updated rows after the update is made.

<add-screenshot>

(close #4142) (#4313)

### console: support for Postgres [materialized views](https://www.postgresql.org/docs/current/rules-materializedviews.html)

Postgres materialized views are views that are persisted in a table-like form. They are now supported in the Hasura Console, in the same way as views. They will appear on the 'Schema' page, under the 'Data' tab, in the 'Untracked tables or views' section.

(close #91) (#4270)

### docs: map Postgres operators to corresponding Hasura operators

Map Postgres operators to corresponding Hasura operators at various places in docs and link to PG documentation for reference.
For example, see [here](https://hasura.io/docs/1.0/graphql/manual/api-reference/schema-metadata-api/syntax-defs.html#operator).

(#4502) (close #4056)

### Bug fixes and improvements

- server: add support for `_inc` on `real`, `double`, `numeric` and `money` (fix #3573)
- server: support special characters in JSON path query argument with bracket `[]` notation, e.g `obj['Hello World!']` (#3890) (#4482)
- server: add graphql-engine support for timestamps without timezones (fix #1217)
- server: support inserting unquoted bigint, and throw an error if value overflows the bounds of the integer type (fix #576) (fix #4368)
- console: change react ace editor theme to eclipse (close #4437)
- console: fix columns reordering for relationship tables in data browser (#4483)
- console: format row count in data browser for readablity (#4433)
- console: move pre-release notification tooltip msg to top (#4433)
- console: remove extra localPresets key present in migration files on permissions change (close #3976) (#4433)
- console: make nullable and unique labels for columns clickable in insert and modify (#4433)
- console: fix row delete for relationships in data browser (#4433)
- console: prevent trailing spaces while creating new role (close #3871) (#4497)
- docs: add API docs for using environment variables as webhook urls in event triggers
- server: fix recreating action's permissions (close #4377)
- docs: add reference docs for CLI (clsoe #4327) (#4408)

## `v1.2.0-beta.4`

### add query support in actions

(close #4032) (#4309)

### console: persist columns state in data browser
### console: persist page state in data browser across navigation

The order, collapsed state of columns and page size is now persisted across page navigation
The order, collapsed state of columns and rows limit is now persisted across page navigation

(close #3390) (#3753)

### Bug fixes and improvements

- cli: set_table_is_enum metadata type for squashing migrations (close #4394) (#4395)
- console: query support for actions (#4318)
- cli: query support for actions (#4318)
- cli: add retry_conf in event trigger for squashing migrations (close #4296) (#4324)
- cli: allow customization of server api paths (close #4016)
- cli: clean up migration files created during a failed migrate api (close #4312) (#4319)
- cli: add support for multiple versions of plugin (close #4105)
- cli: template assets path in console HTML for unversioned builds
- cli: set_table_is_enum metadata type for squashing migrations (close #4394) (#4395)
- console: query support for actions (#4318)
- console: recover from SDL parse in actions type definition editor (fix #4385) (#4389)
- console: allow customising graphql field names for columns of views (close #3689) (#4255)
- console: fix clone permission migrations (close #3985) (#4277)
Expand All @@ -32,9 +202,7 @@ The order, collapsed state of columns and page size is now persisted across page
- console: redirect to /:table/browse from /:table (close #4330) (#4374)
- console: surround string type column default value with quotes (close #4371) (#4423)
- console: add undefined check to fix error (close #4444) (#4445)
- console: change react ace editor theme to eclipse (close #4437)
- docs: add One-Click Render deployment guide (close #3683) (#4209)
- server: add support for `_inc` on `real`, `double`, `numeric` and `money` (fix #3573)
- server: reserved keywords in column references break parser (fix #3597) #3927
- server: fix postgres specific error message that exposed database type on invalid query parameters (#4294)
- server: manage inflight events when HGE instance is gracefully shutdown (close #3548)
Expand Down Expand Up @@ -77,7 +245,6 @@ A new CLI migrations image is introduced to account for the new migrations workf
(close #3969) (#4145)

### Bug fixes and improvements

- server: improve performance of replace_metadata tracking many tables (fix #3802)
- server: option to reload remote schemas in 'reload_metadata' API (fix #3792, #4117)
- server: fix various space leaks to avoid excessive memory consumption
Expand Down Expand Up @@ -160,5 +327,4 @@ Read more about it in the [docs](https://hasura.io/docs/1.0/graphql/manual/auth/

- server: check expression in update permissions (close #384) (rfc #3750) (#3804)
- console: show pre-release update notifications with opt out option (#3888)
- Allow special characters in JSON path query argument with bracket `[]` notation, e.g `obj['Hello World!']` (#3890)
- console: handle invalid keys in permission builder (close #3848) (#3863)
Loading