Commit graph

3717 commits

Author SHA1 Message Date
Yohan Boniface
ddfef9cbe7 2.8.0a1 2024-12-11 19:25:10 +01:00
Yohan Boniface
e372b6410e
chore: make S3 dependencies optional (#2359) 2024-12-11 19:23:39 +01:00
Yohan Boniface
dc93ec99e8 chore: add s3 dependencies to Docker install 2024-12-11 19:21:05 +01:00
Yohan Boniface
8b65674e0a chore: make S3 dependencies optional 2024-12-11 19:16:17 +01:00
Yohan Boniface
c25ee5e29c changelog 2024-12-11 18:44:32 +01:00
Yohan Boniface
8f9ee89d18 2.8.0a0 2024-12-11 18:40:35 +01:00
Yohan Boniface
5370c9311a i18n 2024-12-11 18:16:31 +01:00
Yohan Boniface
eebef3420a
feat: add elevation gain and loss in extended properties (#2343)
![image](https://github.com/user-attachments/assets/c6a330e2-b981-4603-aa29-e70885a6f4fe)
2024-12-11 17:56:15 +01:00
Yohan Boniface
80ff4ed899
feat: move labelKey field on the top datalayer form (#2350)
fix #2331
2024-12-11 17:49:24 +01:00
Yohan Boniface
c41bf9129d
feat: display wikipedia link in OSM popup template when possible (#2358)
![image](https://github.com/user-attachments/assets/b22fd52e-1dfc-48f5-9f9e-0db12bf87fbe)

(And move popup related CSS to a dedicated file.)

cf #661
2024-12-11 17:48:40 +01:00
Yohan Boniface
c45c235ffe
feat: support storing layer data in S3 like servers (#2304)
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
2024-12-11 17:46:19 +01:00
Yohan Boniface
c4ded4404e feat: display wikipedia link in OpenStreetMap popup template 2024-12-11 16:09:13 +01:00
Yohan Boniface
71389edca7 chore: move popup related CSS to a separate file 2024-12-11 16:08:29 +01:00
Yohan Boniface
8fb3c27445 fixup: properly read gzipped content from S3
We did not find a native way to do this from django-storages API.
2024-12-10 19:03:19 +01:00
Yohan Boniface
47524dacce chore: cache DataLayer._reference_version
Prevent to send a HEAD request head time to S3 (when using S3)
2024-12-10 19:03:19 +01:00
David Larlet
834970b725 chore: add command to migrate from fs to S3 2024-12-10 19:03:19 +01:00
David Larlet
14e74d15c1 chore: always gzip geojson in S3 storage 2024-12-10 19:03:19 +01:00
Yohan Boniface
1ac9a06195 chore: do not fail if S3 bucket does not handle versions
And mention the need of activating versioning in the doc.
2024-12-10 19:03:19 +01:00
Yohan Boniface
249367fd3a chore: install s3 dep for develop/CI 2024-12-10 19:03:19 +01:00
Yohan Boniface
81fa31f50b chore: add basic tests for S3 storage 2024-12-10 19:03:19 +01:00
Yohan Boniface
a04624c4c8 feat: support storing layer data in S3 like servers
fix #2290
2024-12-10 18:51:58 +01:00
Yohan Boniface
82b81706ab chore: add missing migration for new share_status values
Some checks are pending
Test & Docs / tests (postgresql, 3.10) (push) Waiting to run
Test & Docs / tests (postgresql, 3.12) (push) Waiting to run
Test & Docs / lint (push) Waiting to run
Test & Docs / docs (push) Waiting to run
2024-12-10 17:54:58 +01:00
Yohan Boniface
73e7f60cdf
feat: introduce Map.share_status=DRAFT and DELETED (#2357)
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](https://github.com/user-attachments/assets/41dae9fe-0ae6-4ada-ace3-dc782c6cf972)
- when the map in in draft mode, the "Save" button on the frontend says
"Save draft", so to make the state clear

![image](https://github.com/user-attachments/assets/ca2ffb79-17fa-4a1c-9e81-a759c2a415a1)
- now the visibility of the map is immediately visible on the top bar
(while before this was only displayed after first save)

![image](https://github.com/user-attachments/assets/3d9efa86-3fac-4150-b01e-b7f1ea79114b)

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
2024-12-10 17:48:08 +01:00
Yohan Boniface
c8e171eb91 chore: make both save buttons hidden by default 2024-12-10 17:40:40 +01:00
Yohan Boniface
88ed5af776
Update umap/management/commands/empty_trash.py
Co-authored-by: David Larlet <3556+davidbgk@users.noreply.github.com>
2024-12-10 17:31:08 +01:00
Yohan Boniface
c4c874c5c2 chore: delete all datalayers version on delete 2024-12-10 16:51:32 +01:00
Yohan Boniface
cc457e9634 chore: do not use datetime.UTC yet, which is py>=3.11 only 2024-12-10 16:37:38 +01:00
Yohan Boniface
29d243b3c5 feat: move map to trash on delete
This also:
- adds a `umap empty_trash` command
- remove the previous purgatory concept
2024-12-10 16:30:23 +01:00
Yohan Boniface
1aaea0beb9 feat: introduce Map.share_status=DRAFT and DELETED 2024-12-10 15:14:12 +01:00
Yohan Boniface
c15ecfc29f
fix(#2355): correctly reset Dialog’s returnValue (#2356)
Some checks are pending
Test & Docs / tests (postgresql, 3.10) (push) Waiting to run
Test & Docs / tests (postgresql, 3.12) (push) Waiting to run
Test & Docs / lint (push) Waiting to run
Test & Docs / docs (push) Waiting to run
Fixes #2355
2024-12-10 13:33:00 +01:00
Yohan Boniface
246aedaeb9
chore: bump pydantic from 2.10.2 to 2.10.3 (#2352)
Some checks are pending
Test & Docs / tests (postgresql, 3.10) (push) Waiting to run
Test & Docs / tests (postgresql, 3.12) (push) Waiting to run
Test & Docs / lint (push) Waiting to run
Test & Docs / docs (push) Waiting to run
2024-12-10 09:02:56 +01:00
Yohan Boniface
ec7c85db3a
chore: bump mkdocs-material from 9.5.47 to 9.5.48 (#2353) 2024-12-10 09:02:40 +01:00
Yohan Boniface
827fd39925
chore: bump ruff from 0.8.1 to 0.8.2 (#2354) 2024-12-10 09:02:23 +01:00
David Larlet
5b32e2ac03
fix(#2355): correctly reset Dialog’s returnValue
Fixes #2355
2024-12-09 18:16:41 -05:00
dependabot[bot]
d8e73121cf
chore: bump ruff from 0.8.1 to 0.8.2
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.8.1 to 0.8.2.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.8.1...0.8.2)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-09 17:29:29 +00:00
dependabot[bot]
43f3701a6f
chore: bump mkdocs-material from 9.5.47 to 9.5.48
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.5.47 to 9.5.48.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.5.47...9.5.48)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-09 17:29:12 +00:00
dependabot[bot]
c42bbf2b7b
chore: bump pydantic from 2.10.2 to 2.10.3
Bumps [pydantic](https://github.com/pydantic/pydantic) from 2.10.2 to 2.10.3.
- [Release notes](https://github.com/pydantic/pydantic/releases)
- [Changelog](https://github.com/pydantic/pydantic/blob/main/HISTORY.md)
- [Commits](https://github.com/pydantic/pydantic/compare/v2.10.2...v2.10.3)

---
updated-dependencies:
- dependency-name: pydantic
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-09 17:29:05 +00:00
Yohan Boniface
89acf8f0ec feat: add elevation gain and loss in extended properties 2024-12-09 13:14:34 +01:00
Yohan Boniface
d8abb28e35 feat: move labelKey field on the top datalayer form
fix #2331
2024-12-09 13:13:56 +01:00
Yohan Boniface
d0156bc7a6
fixup: make sure to redraw tile after a .umap import (#2347)
Some checks are pending
Test & Docs / tests (postgresql, 3.10) (push) Waiting to run
Test & Docs / tests (postgresql, 3.12) (push) Waiting to run
Test & Docs / lint (push) Waiting to run
Test & Docs / docs (push) Waiting to run
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
2024-12-09 13:12:56 +01:00
Yohan Boniface
a7b714c887
fix: disable for real dragging the map on mobile when scrollWheelZoom is false (#2344)
Some checks failed
Test & Docs / tests (postgresql, 3.10) (push) Has been cancelled
Test & Docs / tests (postgresql, 3.12) (push) Has been cancelled
Test & Docs / lint (push) Has been cancelled
Test & Docs / docs (push) Has been cancelled
Changing map options at this stage is too late.

cf #2340
2024-12-07 15:46:45 +01:00
Yohan Boniface
f3c95bd13d chore: refactor render and propagate to better target UI changes 2024-12-07 15:41:16 +01:00
Yohan Boniface
bf2ed185db fix: make sure to redraw tile after a .umap import
Broken since 20b2290d00
2024-12-07 13:02:04 +01:00
Yohan Boniface
4070da392a chore: catch all "tile*" URL in playwright 2024-12-07 13:01:41 +01:00
David Larlet
ec23f09e5b
chore: bump django from 5.1.3 to 5.1.4 (#2346)
Some checks are pending
Test & Docs / tests (postgresql, 3.10) (push) Waiting to run
Test & Docs / tests (postgresql, 3.12) (push) Waiting to run
Test & Docs / lint (push) Waiting to run
Test & Docs / docs (push) Waiting to run
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 &quot;removing older versions of
Django&quot; 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 />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=django&package-manager=pip&previous-version=5.1.3&new-version=5.1.4)](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>
2024-12-06 14:57:47 -05:00
dependabot[bot]
b10dadd453
chore: bump django from 5.1.3 to 5.1.4
Bumps [django](https://github.com/django/django) from 5.1.3 to 5.1.4.
- [Commits](https://github.com/django/django/compare/5.1.3...5.1.4)

---
updated-dependencies:
- dependency-name: django
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-06 18:38:34 +00:00
Yohan Boniface
42f74e1554 fix: disable for real dragging the map on mobile when scrollWheelZoom is false
Changing map options at this stage is too late.

cf #2340
2024-12-06 11:27:30 +01:00
Yohan Boniface
97ff26b6e8 fix: make that renderUI also recompute scrollWheelZoom
Some checks are pending
Test & Docs / tests (postgresql, 3.10) (push) Waiting to run
Test & Docs / tests (postgresql, 3.12) (push) Waiting to run
Test & Docs / lint (push) Waiting to run
Test & Docs / docs (push) Waiting to run
Otherwise it does not change the behaviour when changing the setting.
2024-12-05 18:39:40 +01:00
Yohan Boniface
b7649a5e47
fix: Avoid map-panning on mobile using two fingers navigation (#2340)
If scrollWheelZoom option is false we deactivate leaflet dragging
options only on mobile
2024-12-05 18:38:08 +01:00
Yohan Boniface
92431d3b83
fix: do not redraw tilelayers each time a map property is changed (#2342) 2024-12-05 18:32:47 +01:00