This adds two now storage classes, `UmapFileSystem` and `UmapS3`.
The first class now handle the current storage behaviour (which was in
the DataLayer class), and the second one the S3 support.
Todo:
- [x] unit tests for the S3 class
- [x] understand how to deal with gzip in S3
- [x] clone
fix#2290
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

- when the map in in draft mode, the "Save" button on the frontend says
"Save draft", so to make the state clear

- now the visibility of the map is immediately visible on the top bar
(while before this was only displayed after first save)

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
Broken since
20b2290d00
Since started as a simple fix, but:
- I first thought my previous fix of the failing test
`test_import_umap_from_textarea` was not a real fix, so I changed a bit
the way we mock tiles URL in tests, but at the end the test was failing
for good reasons
- since 20b2290d00 the reset of tilelayer
was not called anymore after importing a umap file, so I first made a
quick fix for this
- then I decided to refactor a bit more render and propagate, so
`importRaw` would pass the exact imported properties (instead of trying
to blindly target with some properties), and to remove a call to
`propagate`, which at the end should disappear in favor of `render` with
better targeting
Bumps [django](https://github.com/django/django) from 5.1.3 to 5.1.4.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="2d4add11fd"><code>2d4add1</code></a>
[5.1.x] Bumped version for 5.1.4 release.</li>
<li><a
href="6943d61818"><code>6943d61</code></a>
[5.1.x] Fixed CVE-2024-53908 -- Prevented SQL injections in direct
HasKeyLook...</li>
<li><a
href="bbc74a7f7e"><code>bbc74a7</code></a>
[5.1.x] Fixed CVE-2024-53907 -- Mitigated potential DoS in
strip_tags().</li>
<li><a
href="5b4d949d7c"><code>5b4d949</code></a>
[5.1.x] Removed question marks from headings in
docs/topics/db/fixtures.txt.</li>
<li><a
href="6e3e7353e0"><code>6e3e735</code></a>
[5.1.x] Fixed <a
href="https://redirect.github.com/django/django/issues/35950">#35950</a>
-- Restored refreshing of relations when fields deferred.</li>
<li><a
href="ee2698dcca"><code>ee2698d</code></a>
[5.1.x] Removed reference to "removing older versions of
Django" in tutorial.</li>
<li><a
href="bed70e2c00"><code>bed70e2</code></a>
[5.1.x] Upgraded to Python 3.12, Ubuntu 24.04, and enabled
fail_on_warning fo...</li>
<li><a
href="5f82a5e4c7"><code>5f82a5e</code></a>
[5.1.x] Added stub release notes and release date for 5.1.4, 5.0.10, and
4.2.17.</li>
<li><a
href="4b262408aa"><code>4b26240</code></a>
[5.1.x] Fixed <a
href="https://redirect.github.com/django/django/issues/35942">#35942</a>
-- Fixed createsuperuser crash on Python 3.13+ when user...</li>
<li><a
href="08ac8c1b44"><code>08ac8c1</code></a>
[5.1.x] Updated maintainers of Django Debug Toolbar to Django
Commons.</li>
<li>Additional commits viewable in <a
href="https://github.com/django/django/compare/5.1.3...5.1.4">compare
view</a></li>
</ul>
</details>
<br />
[](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/umap-project/umap/network/alerts).
</details>