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

Show icons in Schema Editor, fix #955 #970

Merged
merged 2 commits into from
Jul 19, 2021
Merged

Conversation

hendi
Copy link
Collaborator

@hendi hendi commented Jul 12, 2021

This fixes #955 and adds some icons from the pgadmin4 project to the schema editor:

image

I originally added some code to order the DDL statements, e.g. first tables, then indices, then enums etc. But I removed that change since I usually have my DDL statements in an order that makes sense to me (regarding ordering, also have a look at #584). That's also why I changed the code to include comments as well. Thoughs?

@@ -287,17 +287,67 @@ renderObjectSelector statements activeObjectName = [hsx|
|]
where
contextMenuId = "context-menu-" <> tshow id
renderObject Comment {} id = mempty
Copy link
Member

Choose a reason for hiding this comment

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

Why have these empty statements been removed? The idea was that we hide all the statements that the user cannot interact with from the GUI

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

My train of thought was: icons look nice -> oh, we only show tables and enums -> let's show more (all) to see more pretty icons

Copy link
Member

Choose a reason for hiding this comment

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

I agree, but in big project's this really wastes a huge amount of screen space (I've tested it)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We could sort the entries by type (e.g. tables, types, indexes), add a sub-header and by default collapse everything except tables. That's also how pgadmin and dbeaver work.

(FWIW, I'm also fine with simply hiding everything except tables, types and indexes)

Copy link
Member

Choose a reason for hiding this comment

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

This is all too complicated for things that cannot be used from the Schema Designer. Let's keep the behaviour from master and hide everything which cannot be interacted with

Copy link
Member

@mpscholten mpscholten left a comment

Choose a reason for hiding this comment

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

Thanks :) Good job

@mpscholten mpscholten merged commit fcc7038 into master Jul 19, 2021
@mpscholten mpscholten deleted the schema-editor-icons branch July 19, 2021 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show icons to discern enums, tables etc.
2 participants