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: introduce Map.share_status=DRAFT and DELETED #2357

Merged
merged 6 commits into from
Dec 10, 2024
Merged

Conversation

yohanboniface
Copy link
Member

@yohanboniface yohanboniface commented Dec 10, 2024

This PR introduce two new share_status: DRAFT and DELETED.

So all status are now:

    (DRAFT, _("Draft (private)")),
    (PUBLIC, _("Everyone (public)")),
    (OPEN, _("Anyone with link")),
    (PRIVATE, _("Editors and team only")),
    (BLOCKED, _("Blocked")),
    (DELETED, _("Deleted")),

Here are the impact of such introduction, on the draft side:

  • by default maps are now create in draft status, and they are not visible from others than owner (or collaborators if any); this can be changed for a given instance with the setting UMAP_DEFAULT_SHARE_STATUS
  • now even anonymous owned maps have a share status, given one of the goals is to make a better distinction between maps ready to be shared and other, this also apply to maps without logged in owners
    image
  • when the map in in draft mode, the "Save" button on the frontend says "Save draft", so to make the state clear
    image
  • now the visibility of the map is immediately visible on the top bar (while before this was only displayed after first save)
    image

Note: add the end DRAFT and PRIVATE are very similar, but I made the choice to keep the two, so one can still distinguish their draft maps from their ready map they want to keep private.

On the delete side:

  • when deleting a map, it's now set as share_status=DELETED, which act as a sort of trash; so it become easier to recover a map, with it's full datalayers, etc. (the only thing which will not be restored is the previous share_status, which should be draft again after a restore; the restore function itself is not implemented)
  • there is a new command empty_trash which delete for real maps in DELETED status and with last_modified > 30 days (by default, can be changed with a command line argument)
  • deleted maps disappear from all views: home, search, dashboard…
  • in the future, we could create a new view "My Trash", where one could see their deleted map not yet deleted for real (and that should be the opportunity to also add the restore function, which for now can be done by simply changing the share_status from the shell or the admin)
  • all the purgatory related code has been removed

fix #2207

This also:
- adds a `umap empty_trash` command
- remove the previous purgatory concept
@yohanboniface yohanboniface marked this pull request as ready for review December 10, 2024 16:15
Copy link
Contributor

@davidbgk davidbgk left a comment

Choose a reason for hiding this comment

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

Looks great!

yohanboniface and others added 2 commits December 10, 2024 17:31
Co-authored-by: David Larlet <3556+davidbgk@users.noreply.github.com>
@yohanboniface yohanboniface merged commit 73e7f60 into master Dec 10, 2024
4 checks passed
@yohanboniface yohanboniface deleted the draft-status branch December 10, 2024 16:48
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.

Add a Draft status
2 participants