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

[Feat] Add rename and delete of Location and Mapset in Datacatalog #710

Closed
wenzeslaus opened this issue Jun 16, 2020 · 2 comments · Fixed by #771
Closed

[Feat] Add rename and delete of Location and Mapset in Datacatalog #710

wenzeslaus opened this issue Jun 16, 2020 · 2 comments · Fixed by #771
Labels
enhancement New feature or request gsoc Reserved for Google Summer of Code student(s) GUI wxGUI related

Comments

@wenzeslaus
Copy link
Member

Is your feature request related to a problem? Please describe.

Although GRASS database (aka grassdata) is not meant to be modified by hand, locations and mapsets can only be renamed and deleted in the Startup windows, not once user starts GRASS GIS.

Describe the solution you'd like

Add Rename and Delete actions to the context menu of Location and Mapset tree items in the Datacatalog (Data tab) which is the natural place for this management.

Ideal state

Deleting a current mapset or location needs to be disabled.

Renaming current mapset or location needs to be handled in a special way. Now you can switch to a different mapset or even different location and mapset, so there is no reason why rename cannot be implemented for the current mapset or location. A naive implementation is something like a rename followed by calling the current mechanism for switching.

Additionally, user should be warned that there should be no modules or scripts running in the current mapset if it is being renamed. That applied to all the other operations, but with different wording. On unix (i.e., non-Windows), the mapset in use will be locked, i.e., there should be a check if the mapset is locked and we should honor the lock, i.e., not allow rename or delete when lock is present since that indicates another GRASS session running in that mapset. It might be a good idea to include something like "You are in a danger zone" as a first line of the delete and rename dialogs.

Rename and delete of other mapsets and of locations (including the current location) should be available only when editing of other mapsets is allowed (e.g. by "unlocking" them in the toolbar; not to be confused with the (current) mapset locking) to keep the current "no changes outside of the current mapset (by default)" paradigm. However, since changes are the main point of this functionality, the allowing of edits could be done in the delete/rename dialog, i.e., it would have an extra question/info and a button/toggle for allowing of edits. For example, "hey, you can delete/rename only when editing of other mapsets is allowed" with (toggle) buttons "[allow only for this operation] [allow now and for all following operations]" (the second being equivalent of the current "lock/unlock" button in the toolbar).

Initial implementation

This can be implemented in phases. For example, in the first phase, both deleting and renaming of current mapset can be disabled and deleting and renaming other mapsets and other locations can be made available after clinking the allow button. The additional checks and messages can be just the same as what is in the current Startup window (i.e., just reuse whatever is there now).

Additional context

Current items (7.8) in the context menu of Mapset:

  • Paste
  • Switch mapset

Location does not have any associated actions.

This is a migrated Trac ticket 3577.

@wenzeslaus wenzeslaus added enhancement New feature or request GUI wxGUI related gsoc Reserved for Google Summer of Code student(s) labels Jun 16, 2020
@ninsbl
Copy link
Member

ninsbl commented Jun 16, 2020

Please note, that renaming mapsets can break STDS, as maps are registered alongside mapsets they belong to in the temporal database. I assume a similar issue exists for imagery groups where maps from other mapsets can be registered. So, when addressing this issue I see two possible solutions:

  1. Issue a warning of what can happen
  2. Search for STDS (t.list) and imagery groups (g.list) in (readable) mapsets and issue a warning, if the problem in fact occurs and throw an Error if affected STDS or imagery groups cannot be modified, modify them otherwise...

@wenzeslaus
Copy link
Member Author

@ninsbl Since this is an existing issue already present in the GUI, specifically in the Startup window, I would suggest to just solve it separately. You can migrate Trac ticket 2363 to GitHub if you want.

@wenzeslaus wenzeslaus added this to To do in New GUI Startup via automation Jul 1, 2020
@petrasovaa petrasovaa linked a pull request Jul 6, 2020 that will close this issue
@petrasovaa petrasovaa moved this from To do to In progress in New GUI Startup Jul 11, 2020
New GUI Startup automation moved this from In progress to Done Jul 14, 2020
wenzeslaus added a commit that referenced this issue Jul 14, 2020
…tacatalog (#771)

Deleting and renaming is disabled for current mapset or location. Deleting is not possible. Renaming creates invalid (intermediate) state which g.mapset can't deal with if the renamed mapset is the current one.

General functions for create, rename, and delete mapset or location in guiutils that uses function from utils. Created LocationDialog and edited MapsetDialog.

Closes #710.

Co-authored-by: Anna Petrasova <kratochanna@gmail.com>
Co-authored-by: Vaclav Petras <wenzeslaus@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request gsoc Reserved for Google Summer of Code student(s) GUI wxGUI related
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants