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

Allow users to drag and drop fields from DB Schema dock to editor #1250

Merged
merged 2 commits into from Jan 1, 2018

Conversation

Projects
None yet
2 participants
@mgrojo
Copy link
Contributor

mgrojo commented Dec 3, 2017

This is the first attempt to provide the functionality described in #119.

Drag in the dock is enabled (it was only enabled in the Database Structure tab). Then the fields are enabled for dragging and finally the MIME data exported for the drag and drop is tailored for exporting only the escaped field identifier.

This may interfere to other uses of drag&drop in the Database Structure, so I open this pull request for discussion and refinement. I've reproduced a crash dropping a table between databases, I think it is not related with my changes, but I'll try to figure it out.

Possible improvements: there are two uses of drag&drop and users might be confused. Tables paste the SQL creation and population statements, and fields only the name. Maybe the Dock and the Database Structure should have their own different drag&drop behaviours? Dock for statement composition, sot it would only drop the names; and Database Structure, only for exporting full SQL statements (then in this tab the fields would be again not candidate for dragging).

Allow users to drag and drop fields from DB Schema dock to editor
This is the first attempt to provide the functionality described in #119.

Drag in the dock is enabled (it was only enabled in the Database Structure
tab). Then the fields are enabled for dragging and finally the MIME data
exported for the drag and drop is tailored for exporting only the escaped
field identifier.

This may interfere to other uses of drag&drop in the Database Structure.
@MKleusberg

This comment has been minimized.

Copy link
Member

MKleusberg commented Dec 22, 2017

I would be fine with merging this as it is now. You are right that it is kind of odd to have two different things happening here depending on the node you are dragging. But then again, it is probably copying exactly what you would expect for each node. So it should be fine.

I am not so sure about making this behave differently for the Structure tab and the Structure dock, however. At least I feel like that those two tree views just look and feel to similar to not do the same thing. So my point is that the Structure dock just looks like an exact copy of the Structure tab (and which it basically is), so it would be super confusing to have them behave differently in such a subtle way. So I would say that the way it is done in this PR is better, but that is just my opinion 😉

What do you think, @mgrojo?

Allow the user to drag individual items from the DB Schema dock
By allowing extended selections of individual items in the dock version,
we let users select what they want to drag and drop. When dragging a list
of items from the Name column, a list of escaped identifiers with commas is
exported, making easier the composition of SELECT and other statements.

In this way, every item name can be dropped, without loosing the ability
of exporting the SQL statement for the item. It will just depend on which
column is selected.

For the DB Structure tab, the original behaviour of single row selection
is maintained. In that case, only the SQL column is exported, as before.

See issue #119.
@mgrojo

This comment has been minimized.

Copy link
Contributor Author

mgrojo commented Dec 24, 2017

@MKleusberg I find the solution of my last commit more satisfying. Please, give it a look.

@MKleusberg

This comment has been minimized.

Copy link
Member

MKleusberg commented Dec 31, 2017

@mgrojo Cool, that looks like a good solution 😄 But I'll have a closer look tomorrow.

@MKleusberg

This comment has been minimized.

Copy link
Member

MKleusberg commented Jan 1, 2018

Yep, looks good 😃 And at least in my opinion it also feels right from a user perspective. So I think we can merge this 👍

@MKleusberg MKleusberg merged commit 106e57e into master Jan 1, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@MKleusberg MKleusberg deleted the drag_drop_fields_to_editor branch Jan 1, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment