这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@Varun-Choudhary
Copy link
Contributor

@Varun-Choudhary Varun-Choudhary commented Aug 18, 2020

closes #4973

Description

This PR improves the representation of remote relationship mapping on console UI.

Affected components

  • Console

It's gone from being like this :

image

to something like this:

image

@netlify
Copy link

netlify bot commented Aug 18, 2020

Deploy preview for hasura-docs ready!

Built with commit f176df7

https://deploy-preview-5612--hasura-docs.netlify.app

@hasura-bot
Copy link
Contributor

Review app for commit fed811a deployed to Heroku: https://hge-ci-pull-5612.herokuapp.com
Docker image for server: hasura/graphql-engine:pull5612-fed811a5

@Varun-Choudhary Varun-Choudhary changed the title mapping of remote relationships Console: Insert 'relationMap' function to improve the representation of remote relationship mapping on console UI Aug 18, 2020
@hasura-bot
Copy link
Contributor

Review app for commit 9ace4f5 deployed to Heroku: https://hge-ci-pull-5612.herokuapp.com
Docker image for server: hasura/graphql-engine:pull5612-9ace4f52

Copy link
Contributor

@kolharsam kolharsam left a comment

Choose a reason for hiding this comment

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

Code wise it looks good! 👍

const parseRelationship = parseRemoteRelationship(relationship);
const relationMap = () => {
const fields = parseRelationship.remoteFields.map(field => field.name);
return ['', ...fields].join(' →');
Copy link
Contributor

Choose a reason for hiding this comment

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

We should probably add more spacing here. The deeper the nesting, the more congested it might look. See image below for context.

image

{`- ${relationship.table_name}${
relationship.definition.remote_schema
} . ${Object.keys(relationship.definition.remote_field)}`}
} ${relationMap()}`}
Copy link
Contributor

Choose a reason for hiding this comment

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

Another problem I saw was this: @beerose or @rikinsk either of you could suggest the workaround here.
I think it's a very rare case and only a good to have.

image

@kolharsam kolharsam removed their assignment Aug 28, 2020
@kolharsam kolharsam changed the title Console: Insert 'relationMap' function to improve the representation of remote relationship mapping on console UI console: improve UI for nested remote schema relationships Aug 28, 2020
@kolharsam kolharsam changed the title console: improve UI for nested remote schema relationships console: improve UI for nested remote relationships Aug 28, 2020
@hasura-bot
Copy link
Contributor

Review app for commit 68309ec deployed to Heroku: https://hge-ci-pull-5612.herokuapp.com
Docker image for server: hasura/graphql-engine:pull5612-68309ecd

@beerose beerose assigned Varun-Choudhary and unassigned beerose Aug 31, 2020
@beerose beerose assigned beerose and unassigned Varun-Choudhary Sep 22, 2020
@beerose beerose assigned rikinsk and unassigned beerose Sep 29, 2020
Copy link
Contributor

@beerose beerose left a comment

Choose a reason for hiding this comment

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

It looks like the issue was solved, but I have one comment about the UI.

We need something like:
from_column ➡ remote_schema . _field . more_nested_field . even_more_nested_filed . final_field,
so you'd need to use . instead of arrows (except for the first one that is pointing from database column to some remote schema.)

@Varun-Choudhary Varun-Choudhary force-pushed the FullTreeMappingOfNestedRemoteRelationships branch from 68309ec to f176df7 Compare October 5, 2020 07:08
@netlify
Copy link

netlify bot commented Oct 5, 2020

Deploy preview for hasura-docs ready!

Built with commit 8c55a65

https://deploy-preview-5612--hasura-docs.netlify.app

@beerose beerose assigned Varun-Choudhary and unassigned rikinsk Oct 5, 2020
Copy link
Contributor

@beerose beerose left a comment

Choose a reason for hiding this comment

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

Console changes

@beerose beerose assigned beerose and unassigned Varun-Choudhary Oct 7, 2020
@beerose beerose changed the title console: improve UI for nested remote relationships console: improve UI for nested remote relationships (close #4973) Oct 7, 2020
@kodiakhq kodiakhq bot merged commit 2717c38 into hasura:master Oct 7, 2020
beerose pushed a commit to beerose/graphql-engine that referenced this pull request Nov 10, 2020
@beerose beerose mentioned this pull request Nov 10, 2020
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

console: remote relationship doesn't show the full tree in mapping

6 participants