mattcasters opened a new pull request, #9051:
URL: https://github.com/apache/hop/pull/9051

   Saved SQL editors in the Database perspective were restored there on startup 
and also opened again in the File Explorer. `Database SQL` is not a registered 
file type, so the last-open-files list treated the `.sql` extension as an 
explorer file.
   
   Those editors are now restored only by the Database perspective. A copy 
already stored under the File Explorer is skipped and dropped the next time the 
open-files list is saved.
   
   Opening a file follows the active perspective:
   
   - A `.sql` file opened while the Database perspective is active opens as a 
SQL editor there. The editor uses the connection selected in the tree, then the 
connection of the active editor, then the only connection in the project. With 
several connections and nothing selected, Hop asks which one to use.
   - A `.sql` file opened while the File Explorer is active still opens in the 
File Explorer.
   - Any other file type opened while the Database perspective is active still 
opens in the File Explorer.
   
   fixes #9050
   
   ## Tests
   
   Checked in Hop GUI:
   
   - Open a SQL file while the Database perspective is active. It opens in the 
Database perspective.
   - Open a SQL file while the File Explorer is active. It opens in the File 
Explorer.
   - Open other file types while the Database perspective is active. They open 
in the File Explorer.
   
   Unit tests, run with `tools/with-isolated-display.sh ./mvnw -pl ui 
-Dtest=HopGuiAuditDelegateStatePropertiesTest,DatabaseSqlTabMemoryTest,DatabaseSqlFileOpenTest,HopGuiFileDelegateSqlOpenTest
 -Dsurefire.failIfNoSpecifiedTests=false test`:
   
   - `HopGuiAuditDelegateStatePropertiesTest` (3): a database SQL editor is not 
written into the open-files list, and a saved SQL filename is not reopened in 
the File Explorer.
   - `DatabaseSqlTabMemoryTest` (7): saved SQL filenames are kept and untitled 
buffers are not.
   - `DatabaseSqlFileOpenTest` (2): only a `.sql` extension counts, and the 
connection is the selected one, then the active editor, then the only 
connection.
   - `HopGuiFileDelegateSqlOpenTest` (1): a SQL file stays in the Database 
perspective only while that perspective is active.
   
   ------------------------
   
   Thank you for your contribution! Follow this checklist to help us 
incorporate your contribution quickly and easily:
   - [ ] Run `mvn clean install apache-rat:check` to make sure basic checks 
pass. A more thorough check will be performed on your pull request 
automatically.
   - [x] If you have a group of commits related to the same change, please 
squash your commits into one and force push your branch using `git rebase -i`.
   - [ ] Mention the appropriate issue in your description (for example: 
`addresses #123`), if applicable.
   
   To make clear that you license your contribution under the [Apache License 
Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   you have to acknowledge this by using the following check-box.
   
   - [x] I hereby declare this contribution to be licensed under the [Apache 
License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   - [ ] In any other case, please file an [Apache Individual Contributor 
License Agreement](https://www.apache.org/licenses/icla.pdf).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to