[GSoC] Finalized First Patch

From: Yosry Muhammad <yosrym93(at)gmail(dot)com>
To: pgadmin-hackers(at)postgresql(dot)org, Dave Page <dpage(at)pgadmin(dot)org>
Subject: [GSoC] Finalized First Patch
Date: 2019-07-01 19:19:36
Message-ID: CAFSMqn8yLA329GFHSm0Bn4cEqvd+kVoYpCAB5mRDbVF6NNaxxA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Dear all,

This is a final version of the patch I have been working on since the
beginning of the GSoC project with tests and documentation.

This patch includes:

Features:
- Implementeing the first version detecting updatable resultsets. Saving
edited data works the same way as View Data mode (with small changes). A
resultset is updatable if:
- All columns belong to the same table.
- All primary keys are selected.
- No duplicate columns.

- Adding the new Save Data icon and its shortcut in preferences. The old
Save icon is used exclusively for Saving files now.
- Integrating saving data changes into the ongoing transaction (if any).
The user is notified that they need to commit the changes if auto-commit is
off.
- A failed save of data changes rolls back the data changes only, does not
rollback previous queries in the same transaction.
- Alerting the user when Execute/Explain is clicked with unsaved changes in
the grid.
- Modified/New cells are now highlighted.
- Alerting the user when exiting with uncommited transactions.
- Re-implementing the on tab close event of the query tool as multiple
dialogs may be required for: unsaved data changes, unsaved file changes &
uncommited transactions (they can all be enabled/disabled in preferences).
- Hiding queries generated by pgAdmin from query history (until they are
substituted by a mogrified version and have a checkbox added to
enable/disable them).

Bug fixes:
- Fixed a bug where exit on save would exit even if the save was not
successful.
- Fixed a bug where alertify confirm dialogs had midword break wrapping.

Tests:
- Python tests:
- test_is_query_resultset_updatable: Tests that updatable resultsets
are detected correctly.
- test_save_changed_data: Tests that additions, deletions & updates are
performed correctly on updatable resultsets.
- Feature tests:
- query_tool_journey_test (existing - extended): Test that when the
query resultset is updatable the user can modify cells and add new rows
(and vice versa).
- Updated other feature tests to match the new icon.
- JS tests:
- Updated call_render_after_poll_specs.js &
keyboard_shortcuts_specs.js to test updates in related parts of the code.

I could not add JS tests to test that the new Save Data button is enabled
when the user edits a cell as I cannot mimic the actions of editing the
grid. However, the new button is now used in View/Edit data feature tests
and it works correctly.
I also could not add JS tests to check that when the resultset is updatable
the grid should be editable as the current code in sqleditor.js is not
testable and it will required a lot of refactoring of this file, but again,
this is covered by feature tests.

Documentation:
- Updated editgrid.rst, query_tool.rst, query_tool_shortcuts.rst,
preferences.rst & keyboard_shortcuts.rst to match the new changes.
- Updated the following screenshots: query_output_data.png, query_tool.png
& query_toolbar.png

The patch passes all tests performed by "make check" command.

Please review, looking forward to any comments or feedback.

Thanks !

--
*Yosry Muhammad Yosry*

Computer Engineering student,
The Faculty of Engineering,
Cairo University (2021).
Class representative of CMP 2021.
https://www.linkedin.com/in/yosrym93/

Attachment Content-Type Size
query_tool_automatic_mode_switch_v1.5.patch text/x-patch 148.1 KB

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Fahar Abbas 2019-07-02 05:25:36 Re: pgAdmin4 v4.10 candidate builds
Previous Message Yosry Muhammad 2019-07-01 14:36:43 Re: [GSoC] Help with Jasmine Tests