Commit graph

3728 commits

Author SHA1 Message Date
Yohan Boniface
54aa687ba1 2.8.0a2 2024-12-13 09:33:24 +01:00
Yohan Boniface
8346459f28 i18n 2024-12-13 09:31:02 +01:00
Yohan Boniface
cd24bf0b3d
feat: refactor importer feedback (#2363)
We basically make the all import chain return the results as promise, so
the importer can act at the end of the process and:
- zoom only to the imported data (in case the layer already as some)
- display a counter of imported data when import is successfull
- display an alert when nothing has been imported

cf #564
2024-12-13 09:18:08 +01:00
Yohan Boniface
30b685ae43
chore: more logs in the ajax proxy validate url (#2362)
This should only be used in localhost, but there are a bunch of check
and it's often that we need to add print to understand why the URL does
not validate, which is usually an issue with the SITE_URL or this kind.
So let's make those print permanent.
2024-12-13 09:12:12 +01:00
Yohan Boniface
de921660c9 feat: refactor importer feedback
We basically make the all import chain return the results as promise, so
the importer can act at the end of the process and:
- zoom only to the imported data (in case the layer already as some)
- display a counter of imported data when import is successfull
- display an alert when nothing has been imported

cf #564
2024-12-12 21:52:54 +01:00
Yohan Boniface
8db974b96a chore: more logs in the ajax proxy validate url
This should only be used in localhost, but there are a bunch of
check and it's often that we need to add print to understand why
the URL does not validate, which is usually an issue with the SITE_URL
or this kind. So let's make those print permanent.
2024-12-12 21:06:09 +01:00
Yohan Boniface
dd89984e28
fix: make sure we set X-DataLayer-Version even when using X-Accel-Redirect (#2361)
Some checks are pending
Test & Docs / lint (push) Waiting to run
Test & Docs / docs (push) Waiting to run
Test & Docs / tests (postgresql, 3.10) (push) Waiting to run
Test & Docs / tests (postgresql, 3.12) (push) Waiting to run
2024-12-12 18:20:14 +01:00
Yohan Boniface
86c634db28 fix: make sure we set X-DataLayer-Version even when using X-Accel-Redirect 2024-12-12 18:19:02 +01:00
Yohan Boniface
a574db73e5
chore: review empty_trash command (#2360)
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
- do not try to print map.id after delete (it's None)
- rely on date instead of minutes/microseconds
2024-12-12 16:32:34 +01:00
Yohan Boniface
5d0b7dff4c chore: review empty_trash command
- do not try to print map.id after delete (it's None)
- rely on date instead of minutes/microseconds
2024-12-12 13:47:40 +01:00
Yohan Boniface
b40b4e6306 changelog
Some checks are pending
Test & Docs / lint (push) Waiting to run
Test & Docs / docs (push) Waiting to run
Test & Docs / tests (postgresql, 3.10) (push) Waiting to run
Test & Docs / tests (postgresql, 3.12) (push) Waiting to run
2024-12-11 20:01:26 +01:00
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