Commit graph

160 commits

Author SHA1 Message Date
Yohan Boniface
1db2455d51 chore: replace settings.FROM_EMAIL by settings.DEFAULT_FROM_EMAIL
DEFAULT_FROM_EMAIL is a Django standard setting
2024-02-16 11:49:38 +01:00
David Larlet
c86e01ffd0
Merge pull request #1601 from umap-project/oembed-quote
fix: encode the whole url parameter for OEmbed
2024-02-13 08:29:19 -05:00
Yohan Boniface
e1ae60a4ff chore: remove duplicate "map updated" message
It is already handled by the front-end, and as it also handle the
"map created" message (including anonymous link form), I arbitrated
to keep all front-end side
2024-02-13 12:15:35 +01:00
David Larlet
cf319ca53e
fix: only query OEmbed map on id and fallback to 404 2024-02-12 21:14:21 -05:00
David Larlet
9426570b6e
fix: encode the whole url parameter for OEmbed
See https://github.com/umap-project/umap/pull/1526#issuecomment-1937040472
2024-02-12 15:58:16 -05:00
David Larlet
afdc732204
Merge pull request #1430 from umap-project/download-all-from-dashboard
Ability to clone, delete and download all maps from user’s dashboard
2024-02-08 09:51:01 -05:00
David Larlet
1acadc746a
fix: use the regular delete view instead of ajax 2024-02-07 17:38:39 -05:00
David Larlet
8a6e992b9c
Ability to clone a map and overall UI improvements 2024-02-07 12:32:00 -05:00
David Larlet
5d69d3c22f
Provide a link to delete maps from user’s dashboard 2024-02-07 12:32:00 -05:00
David Larlet
46cf432eb4
Paginate user’s maps combined downloads 2024-02-07 12:32:00 -05:00
David Larlet
5476cbee0f
Ability to download all maps from user’s dashboard 2024-02-07 12:32:00 -05:00
Yohan Boniface
c334f7554e feat: add experimental "map preview"
This is the same as "map new", but it is not in edit mode. This
allow to click on the elements and see the popups instead of editing
it when using a `dataUrl` query string.
This way of using uMap is not documented, but it's used by some
partners (Deveco recently, data.gouv.fr historicaly).

In the same time, this PR adds two things:
- possibility to pass data direclty in querystring (instead of an URL):
  in the case of Deveco, they have pages where only point is shown (for
  each company)
- possibility to pass style options directly from query string: may
  allow for example to control the `popupTemplate`, eg. to use a table
  one that will display all properties of the clicked feature

Note: dataUrl and such also works in normal "map new" view. There are
two use cases around those parameters, from external sites:
- see this data on uMap (should point on map preview)
- create a map with those data (should point on map new)
2024-02-07 13:57:20 +01:00
Yohan Boniface
da7d09527b chore: catch error when using Request, and make remote URL working again
I decided to remove the check `is_ajax` from `validate_url` to simplify
and edge case, and because I think it was more or less useless.
Basically, when getting remote data, we have two cases:
- direct call to the remote URL
- proxy through our `ajax_proxy` system (to work around CORS limitations)

In the first case, we cannot set the `X-Requested-With` header, otherwise
preflight step will fail, and in the second case, until now, we needed
to set this header for this `is_ajax` check to pass. So keeping this check
would mean adapting the behaviour of the Request/ServerRequest class in
a non elegant way. So let's make it simple…
2024-02-05 07:22:53 +01:00
Yohan Boniface
ab966722f9 wip: rework request error flow 2024-02-05 07:22:53 +01:00
Yohan Boniface
8b2778116d wip: make the getMore button work again with new Request 2024-02-05 07:22:53 +01:00
Yohan Boniface
074fc1bc18
Merge pull request #1552 from umap-project/preconnect-tilelayer
feat: set preconnect link for tilelayer
2024-01-29 18:26:24 +01:00
Yohan Boniface
dd57794ca6
Merge pull request #1562 from umap-project/svg-default-icon
feat: use svg for default icon (circle)
2024-01-29 18:05:45 +01:00
Yohan Boniface
caeb9d5b44
Merge pull request #1531 from umap-project/home-highlighted
Introduce UMAP_HOME_FEED to control which maps are shown on the home page
2024-01-29 12:48:24 +01:00
Yohan Boniface
256d6c631c feat: use svg for default icon (circle)
fix #1560
2024-01-29 12:24:16 +01:00
Yohan Boniface
d4e253190f feat: set preconnect link for tilelayer 2024-01-22 18:14:41 +01:00
Yohan Boniface
5a6f1c1bcc chore: remove unused import 2024-01-17 22:27:05 +01:00
Yohan Boniface
9f377da1b2 Introduce UMAP_HOME_FEED to control which maps are shown on the home page
For now we have only three modes:
- latest, which is the default and shows the last updated maps
- highlighted, which shows only the map that have been starred by a least
  one staff member
- None, which does not show any map
2024-01-16 12:31:50 +01:00
David Larlet
df76ffd80e
feat: Create an oEmbed endpoint for maps
Fix #162
2024-01-11 15:08:10 -05:00
David Larlet
c4e55d82cb
Fix imports 2023-12-27 13:43:47 -05:00
David Larlet
7484e52142
Improve maps’ pagination for the dashboard 2023-12-27 13:26:31 -05:00
David Larlet
8d11815625
Move _urls_for_js to utils.py (circular imports) 2023-12-27 11:41:08 -05:00
Alexis Métaireau
f37ed700f6 [feat] add a simple conflict resolution mecanism.
The server tries to merge conflicting saves of
the same layer.

What it does:

- use the `If-Unmodified-Since` header to check
  if changes happened to the stored data ;
- Compare the incoming version with its reference version
  to get a diff.
- Reapply the diff on top of the latest version.
- If the merge is not possible, return a
  "422 Conflict" HTTP response.
- If the merge worked, return the merged document,
  to be updated by the client.
2023-11-29 13:04:24 +01:00
Alexis Métaireau
72b0bc44ad [chore] remove python2 imports 2023-11-24 23:31:18 +01:00
Alexis Métaireau
35dc1acb07 [fix] Use timezone aware datetimes 2023-11-24 23:31:18 +01:00
Yohan Boniface
160c4ae420 Do not exclude DEMO and SHOWCASE maps anymore from home
Those maps can be excluded by setting their share_status=OPEN

cf #1414
2023-11-21 10:15:31 +01:00
Yohan Boniface
9af5375dbf Fix heavy request for getting user maps
This was creating a huge INNER JOIN, and is replaced
by a UNION

cf https://explain.dalibo.com/plan/91af244fg9d1ec21

Also remove the conditional queryset, as now "my maps"
is serverd by the dashboard page, so we can only serve
public maps on this URL.
2023-11-18 20:09:19 +01:00
David Larlet
13ca7e3e5d
Add tests for favicon-related views 2023-11-15 14:13:33 -05:00
Yohan Boniface
be0cefd02a
Merge pull request #1396 from umap-project/backup-api
Full map download endpoint
2023-11-15 15:39:36 +01:00
David Larlet
6f73038f92
Redirect favicon.ico and dynamic webmanifest 2023-11-14 22:50:25 -05:00
David Larlet
915d6b6db4
Set a default favicon 2023-11-14 17:32:40 -05:00
David Larlet
97fa8c2754
Allow the ?download option in URL 2023-11-14 13:26:52 -05:00
David Larlet
0be42d39cb
Full map download endpoint 2023-11-14 12:07:17 -05:00
Yohan Boniface
c1698545bd Make sure SHORT_SITE_URL is defined to expose Map.short_url 2023-09-26 10:34:50 +02:00
David Larlet
27e8fd0cac
Merge pull request #1324 from openbrian/add-username-to-features
Add username to features
2023-09-25 11:08:32 -04:00
Yohan Boniface
27f3e08bc1 Fix anonymous maps displayed by mistake in user dashboard 2023-09-22 19:00:42 +02:00
Yohan Boniface
c36ea1e4b8 Fix error when trying to change map owner
This bug has been introduced with this change:

8b4842ff21

That was not the correct fix, and this one should be the proper one.

We don't want to edit the permissions reference until we do save, otherwise user
cannot save as it is already no more the owner.

So:
- change permissions.options
- save
- commit those changes to map.options.permissions
- use only those values to check for isOwner and isAnonymousMap
2023-09-22 17:34:44 +02:00
Yohan Boniface
5ffd1a1b10 Expose DataLayer.edit_status separately to the front
They now differ from the Map.edit_status ones
2023-09-22 17:32:19 +02:00
Yohan Boniface
3cbd6cca40 Add back Map.edit_status
Revert "Fix existing permissions related tests"

This reverts commit 36d7d87301c54a1a40bc6bbc164120768b258fae.

WIP
2023-09-22 17:32:19 +02:00
Yohan Boniface
24e4aed8d3 Rename allowEdit in editMode 2023-09-22 17:32:17 +02:00
Yohan Boniface
168cc01c2e Do not try to access self.object in MapCreate 2023-09-22 17:30:07 +02:00
Yohan Boniface
e52b40807a Expose correct edit statuses in anonymous mode 2023-09-22 17:26:57 +02:00
Yohan Boniface
1cefd4e851 Hide create/delete datalayers button + map settings to users without rights 2023-09-22 17:26:57 +02:00
Yohan Boniface
ee9acf3427 Fix map check in DataLayerUpdate view 2023-09-22 17:26:57 +02:00
Yohan Boniface
3d2e62c858 Do not use Map.edit_status anymore
But keep it for now, for data migration, and just in case
2023-09-22 17:26:55 +02:00
Yohan Boniface
89ab029cab WIP: move edit_status from Map to DataLayer 2023-09-22 17:25:55 +02:00