Commit graph

3547 commits

Author SHA1 Message Date
C-Sophie
4cbb2e1491
Update 6-one-click-data-import.md
Add cadastre and specify that the cadastre is reserved for the instance uMap ANCT
2024-11-08 09:52:43 +01:00
C-Sophie
c53eae5878
Update 6-one-click-data-import.md
Add the cadastre
2024-11-06 18:44:26 +01:00
Yohan Boniface
256d4487e7
chore: introduce SaveManager class (#2240)
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
The last refactor of the save process
(0fdb70ce66) has introduced a bug: the
save flow was not more stopped when a layer fail to save. This ends with
a broken UI, as the map is not dirty anymore, so the save button is not
active anymore, while at least one layer still needs to be saved.

Save can fail in two scenarios:
  - there is a conflict (status 412)
  - the server is down or as an issue (eg. disk is full)

I tried a more modest scenario (listening for status in map.save and
recallign the map save after a conflict), but this ended with calling
map.save uselessly even more.

So I decided to try this refactor, which also totally remove the useless
map.save we were sending at each save until now.
2024-10-30 18:27:37 +01:00
Yohan Boniface
36efa9c4cc chore: use SAVEMANAGER as a module singleton 2024-10-30 17:14:35 +01:00
Yohan Boniface
488b5882e7 fixup: renaming 2024-10-30 09:43:31 +01:00
Yohan Boniface
7f65b1de57 chore: listen for later _trySave status 2024-10-30 09:42:06 +01:00
Yohan Boniface
7e2fee4f69
chore: bump ruff from 0.7.0 to 0.7.1 (#2242) 2024-10-28 18:31:57 +01:00
Yohan Boniface
2e4626b5df
chore: bump uwsgi from 2.0.27 to 2.0.28 (#2241)
Bumps [uwsgi](https://uwsgi-docs.readthedocs.io/en/latest/) from 2.0.27
to 2.0.28.


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=uwsgi&package-manager=pip&previous-version=2.0.27&new-version=2.0.28)](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)


</details>
2024-10-28 18:31:13 +01:00
dependabot[bot]
bd9693e8c5
chore: bump ruff from 0.7.0 to 0.7.1
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.7.0 to 0.7.1.
- [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.7.0...0.7.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-28 17:20:51 +00:00
dependabot[bot]
58deb4ffbd
chore: bump uwsgi from 2.0.27 to 2.0.28
Bumps [uwsgi](https://uwsgi-docs.readthedocs.io/en/latest/) from 2.0.27 to 2.0.28.

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-28 17:20:34 +00:00
Yohan Boniface
ed232e59b8 chore: introduce SaveManager class
The last refactor of the save process (0fdb70ce66)
has introduced a bug: the save flow was not more stopped when a layer fail to save.
This ends with a broken UI, as the map is not dirty anymore, so the save button
is not active anymore, while at least one layer still needs to be saved.

Save can fail in two scenarios:
  - there is a conflict (status 412)
  - the server is down or as an issue (eg. disk is full)

I tried a more modest scenario (listening for status in map.save and
recallign the map save after a conflict), but this ended with calling
map.save uselessly even more.

So I decided to try this refactor, which also totally remove the useless
map.save we were sending at each save until now.
2024-10-28 18:15:18 +01:00
Yohan Boniface
bcea419bfd 2.7.1 2024-10-25 15:44:52 +02:00
Yohan Boniface
a16f6d409c
fix: always unset editedFeature on editPanel close (#2237)
And only this panel.

This was creating a weird bug, steps to reproduce:

- create a marker
- shift-click on the marker to edit the layer (so without explicitly
closing the panel)
- try to type the layer name: the panel would close

This is also because currently the schema and render() are too dump, and
when any `name` is changed then the `data` reflow is called, while it
should not when editing the datalayer name.

We want to:
- have more targeted schema
- have more specific reflow in render

But that's for other PRs!
2024-10-25 15:40:47 +02:00
Yohan Boniface
b36c03a203 fix: prevent feature.edit to be called twice on polygon/line end edit
When finishing drawing a polygon/line, Leaflet.Editable will send
both `editable:drawing:end` and `editable:drawing:commit`. In normal
flow, we only need to listen to the later, and we only need to
listen for the former in the case of pressing escape while drawing.
2024-10-24 21:07:58 +02:00
Yohan Boniface
71b55e7759 fix: always unset editedFeature on editPanel close
And only this panel.

This was creating a weird bug, steps to reproduce:

- create a marker
- shift-click on the marker to edit the layer (so without explicitly
  closing the panel)
- try to type the layer name: the panel would close

This is also because currently the schema and render() are too
dump, and when any `name` is changed then the `data` reflow is
called, while it should not when editing the datalayer name.

We want to:
- have more targeted schema
- have more specific reflow in render

But that's for other PRs!
2024-10-24 19:22:46 +02:00
Yohan Boniface
023f48ee94
chore: use shutil.move instead of Path.rename to move to purgatory (#2236)
Otherwise it will fail if src and dest are not on the same FS.
2024-10-24 19:18:21 +02:00
Yohan Boniface
928ce8232c chore: better document UMAP_PURGATORY_ROOT 2024-10-24 18:28:44 +02:00
Yohan Boniface
bdf0bee156 2.7.0 2024-10-24 18:03:11 +02:00
Yohan Boniface
9fe96a98d1 i18n 2024-10-24 17:51:20 +02:00
Yohan Boniface
bda1984f44
chore: explicitely add geojson extension when downloading a layer (#2228)
This was added by the browser I think, but let's be explicit, just in
case.

cf
https://github.com/umap-project/umap/pull/2224#pullrequestreview-2382243375
2024-10-24 17:47:11 +02:00
Yohan Boniface
2dcd61a96d
Allow to run umap with asgi (#2209)
Follow up of #1701 

cf #2174
2024-10-24 17:46:33 +02:00
Yohan Boniface
455ddd455d
fix: do not try to create legend for non loaded classified layer (#2234)
fix #2232

A classified layer needs to have compiled the data to known its
classes/categories.

This commit review the way we build the legend: instead of creating with
the whole caption panel, we just set a container and we populate it
later. This opens the door for live changing the legend when editing the
layer.

But we have to clarify that "reactive" pattern at some point, as we have
some concurrent pattern laying around: the `render()`, which coupled
with the schema and this is nice, but for now it's a bit rough (changing
the whole UI each time); the `propagate` way, which is more specific,
but not coupled to the schema; the `dataChanged`; and the `onDataLoaded`
now, which is a bit different, as it's about the data being loaded, not
changed/modified, but for the DOM it may at the end be the same. Well,
food for thoughts…
2024-10-24 17:39:12 +02:00
Yohan Boniface
200e12e0d9 chore: apply Biome hints
Co-authored-by: Alexis Métaireau <alexis@notmyidea.org>
2024-10-24 12:39:22 +02:00
Yohan Boniface
3477be99b8 fix: do not try to create legend for non loaded classified layer
fix #2232

A classified layer needs to have compiled the data to known its
classes/categories.

This commit review the way we build the legend: instead of creating
with the whole caption panel, we just set a container and we populate
it later. This opens the door for live changing the legend when
editing the layer.

But we have to clarify that "reactive" pattern at some point, as we
have some concurrent pattern laying around: the `render()`, which
coupled with the schema and this is nice, but for now it's a bit rough
(changing the whole UI each time); the `propagate` way, which is
more specific, but not coupled to the schema; the `dataChanged`; and
the `onDataLoaded` now, which is a bit different, as it's about the
data being loaded, not changed/modified, but for the DOM it may at
the end be the same. Well, food for thoughts…
2024-10-23 18:56:26 +02:00
45f1221d00 Use fake timers on the HLC tests 2024-10-22 13:50:46 +02:00
8eae7990dd Add a fieldInSchema utility function.
Check that fields are present in the schema before calling render
2024-10-22 13:50:46 +02:00
4f0404149e feat(sync): Display the number of connected peers in the interface. 2024-10-22 13:50:46 +02:00
Yohan Boniface
c6c255e216 chore: use shutil.move instead of Path.rename to move to purgatory
Otherwise it will fail if src and dest are not on the same FS.
2024-10-22 12:14:04 +02:00
Yohan Boniface
85d65c5070
chore: bump ruff from 0.6.9 to 0.7.0 (#2230) 2024-10-22 08:28:13 +02:00
Yohan Boniface
e5d82ec645
chore: bump mkdocs-material from 9.5.40 to 9.5.42 (#2229) 2024-10-22 08:27:56 +02:00
Yohan Boniface
57e735d64d
chore: bump pillow from 10.4.0 to 11.0.0 (#2231) 2024-10-22 08:27:37 +02:00
dependabot[bot]
1f34fd3e41
chore: bump pillow from 10.4.0 to 11.0.0
Bumps [pillow](https://github.com/python-pillow/Pillow) from 10.4.0 to 11.0.0.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)
- [Commits](https://github.com/python-pillow/Pillow/compare/10.4.0...11.0.0)

---
updated-dependencies:
- dependency-name: pillow
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-21 17:41:15 +00:00
dependabot[bot]
b7fd805d3d
chore: bump ruff from 0.6.9 to 0.7.0
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.6.9 to 0.7.0.
- [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.6.9...0.7.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-21 17:41:05 +00:00
dependabot[bot]
1d88b84936
chore: bump mkdocs-material from 9.5.40 to 9.5.42
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.5.40 to 9.5.42.
- [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.40...9.5.42)

---
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-10-21 17:40:54 +00:00
Yohan Boniface
d2832be6d5
fix: always call propagate at end of save (#2226)
Otherwise the renderEditToolbar will reset name and all.

fix #2225
2024-10-21 16:40:01 +02:00
Yohan Boniface
e0e7e0961c chore: explicitely add geojson extension when downloading a layer
This was added by the browser I think, but let's be explicit, just
in case.
2024-10-21 16:38:08 +02:00
Yohan Boniface
a2af7171d9 chore: call render at end of save
All changes at some point should call render, and render should
become more subtle to update only the needed part according to
the actual changes
2024-10-21 16:25:07 +02:00
Yohan Boniface
0d5b488f93
chore: remove postsync in captionBar and let map.propagate do its job (#2227) 2024-10-21 16:23:58 +02:00
Yohan Boniface
132be80a48 chore: remove postsync in captionBar and let map.propagate do its job 2024-10-21 16:05:26 +02:00
Yohan Boniface
ae79daec7e fix: always call propagate at end of save
Otherwise the renderEditToolbar will reset name and all.

fix #2225
2024-10-21 15:41:30 +02:00
Yohan Boniface
e100809d24
fix: use correct icon for layer download advanced action (#2224)
Replace #2221
2024-10-21 12:15:05 +02:00
Yohan Boniface
13aa407e47 chore: install sync target on "make develop" 2024-10-21 11:59:58 +02:00
Yohan Boniface
c74971bc0e chore: move pydantic and websocket in sync dependencies target 2024-10-21 11:50:10 +02:00
Yohan Boniface
037b8e0fbd
feat: add importer for French cadastre (#2223)
![Screenshot From 2024-10-18
12-48-23](https://github.com/user-attachments/assets/26357638-cf57-4582-b44a-03bb698f6502)
2024-10-21 11:46:57 +02:00
Yohan Boniface
9520a99d11 feat: add importer for French cadastre 2024-10-21 11:28:15 +02:00
Yohan Boniface
7b88193d62
fix: fix dispeared icons from panel titles (#2222)
Before:


![image](https://github.com/user-attachments/assets/54a7de1e-790a-46a2-aa0c-0acb03286349)


After:


![image](https://github.com/user-attachments/assets/f57bb884-a748-4aa4-9153-707b201909fe)
2024-10-21 10:47:12 +02:00
Yohan Boniface
a1a4904f02 fix: use correct icon for layer download advanced action 2024-10-21 10:41:41 +02:00
Yohan Boniface
e0da3163ec fix: fix dispeared icons from panel titles 2024-10-18 12:08:28 +02:00
David Larlet
2642688764
Docker: version is obsolete. (#2220)
The top-level 'version' property is deprecated and can be omitted to
prevent warnings.
2024-10-16 22:41:47 -04:00
L
39cb9cbed0 version is obsolete.
The top-level 'version' property is deprecated.
2024-10-17 08:42:51 +10:00