Commit graph

1249 commits

Author SHA1 Message Date
Yohan Boniface
125aa72785 Make choropleth mode work with lines 2023-10-10 21:16:01 +02:00
Yohan Boniface
7b68c52a15 Allow to select choropleth property from a list instead of gessing it 2023-10-10 21:16:01 +02:00
Yohan Boniface
6c502c54b4 Better defaults for choropleth layer 2023-10-10 21:16:01 +02:00
Yohan Boniface
451eb8c0bf Naive Choropleth legend, WIP 2023-10-10 21:16:01 +02:00
Yohan Boniface
7a0dbd014a There is one more limit than the number of steps
Limits are steps boundaries, and first limit is always the lower value,
and latest limit always the bigger.
2023-10-10 21:16:01 +02:00
Yohan Boniface
bf116e8d93 Use brewer palettes for choropleth colors
cf https://gka.github.io/chroma.js/#chroma-brewer
2023-10-10 21:16:01 +02:00
Yohan Boniface
5d350a7cc9 Control property used in choropleth 2023-10-10 21:16:01 +02:00
Yohan Boniface
8e12e6cf24 POC of a choropleth layer 2023-10-10 21:16:01 +02:00
Yohan Boniface
31ea8d1a83
Merge pull request #1362 from umap-project/hide-datalayer-in-caption
Allow to hide a datalayer from the caption list
2023-10-10 21:06:09 +02:00
Joachim Schleicher
9ef09512db highlight: increase fillOpacity for polygons
sqrt gives larger increase for low opacities like 0.2
while preserving some (tiny) shine-through for large values like 0.8
and is limited to the desired range of (0,1]
2023-10-10 10:47:36 +02:00
Joachim Schleicher
836c17f2e8 fire events from Popup Panel
to also highlight path and markers when using the side panel.
Therefore we duplicate the event code from the base class.
2023-10-10 10:29:20 +02:00
Joachim Schleicher
3594bc2605 highlight markers
add .umap-icon-active class for currently selected marker icon.
CSS styles override the marker styles to display
* in the foreground
* with full opacity
* with larger sizes where possible (ball and circle)
2023-10-10 10:29:20 +02:00
Yohan Boniface
da01977414 Fix permissions tests 2023-10-09 18:30:44 +02:00
Yohan Boniface
547485e50f Allow to hide a datalayer from the caption list 2023-10-06 22:26:31 +02:00
Yohan Boniface
de6c9f3b84 Make sure we don't use DataLayer.settings by reference 2023-10-06 22:25:56 +02:00
Joachim Schleicher
7696203159 highlight selected path
when opening a popup increase opacity and weight.
In maps with multiple lines one can see much easier, where the line
starts and ends.
2023-10-05 21:18:05 +02:00
Yohan Boniface
5bfa2fce38 Patch HeatLayer for better rendering
Patch comes from https://github.com/Leaflet/Leaflet.heat/pull/78

We'll remove it when this PR get merged and released.
2023-10-05 18:15:59 +02:00
Yohan Boniface
ca7257658c Make that Range inherit from FloatInput
Otherwise we store a string
2023-10-05 18:15:21 +02:00
Yohan Boniface
3e54310c8d Add Range input for heatmap radius 2023-10-05 17:36:07 +02:00
Yohan Boniface
a5c7214533 Add back helpText on Range input 2023-10-05 17:32:27 +02:00
Yohan Boniface
20cdc837af Use toFixed instead of toPrecision in Range input
toPrecision returns an exponential notation for example for:
 const x = 100
 x.toPrecision(2)
2023-10-05 15:14:28 +02:00
Yohan Boniface
34122b1549
Remove unused CSS class .third
Co-authored-by: Joachim Schleicher <joachimsl@gmx.de>
2023-10-04 09:36:55 +02:00
Joachim Schleicher
79a1ea232a switch to grid layout for multiple choice buttons
to allow multi-line texts in translations
2023-10-04 09:19:09 +02:00
Yohan Boniface
495dd6444f Finally add Map.create_at field
This field should have been added at the beginning, but this is
like planting trees, isn't it ?
2023-09-27 11:01:50 +02:00
Yohan Boniface
ff27cdd04a Hide attribution on small screen and add a small ? to display it
fix #844
2023-09-27 10:30:57 +02:00
Yohan Boniface
f73308e99d 1.8.2 2023-09-27 07:21:06 +02:00
Yohan Boniface
677fd3d982
Merge pull request #1336 from umap-project/shared-edit-url
Redirect to canonical when URL contains the ?edit parameter
2023-09-27 07:17:29 +02:00
Yohan Boniface
013d2fd5ee Always remove ?edit from URL, so users do not share it by mistake 2023-09-27 07:13:30 +02:00
Yohan Boniface
50591e1ac5 i18n 2023-09-27 06:48:00 +02:00
Joachim Schleicher
ccda9aca3f Fix #1308
The star indicating a dirty map uses more than 5px (depending on font-size).
So the additional star switched from showing the map name to
ellipses-overflow in px-implementation.
1ch is the with of the digit '0'.
2023-09-26 20:57:58 +02:00
Yohan Boniface
cae52c905a
Merge pull request #1346 from umap-project/short-url-none
Make sure SHORT_SITE_URL is defined to expose Map.short_url
2023-09-26 15:52:51 +02:00
David Larlet
af3518ad08
Apply Black to settings files 2023-09-26 09:40:41 -04:00
Yohan Boniface
44910f5410 Do no try to fit data bounds if bounds are not valid
This may happen if:
- the map as some layers containing data, but set as not browsable
- any other layer is empty
2023-09-26 10:49:01 +02:00
Yohan Boniface
c1698545bd Make sure SHORT_SITE_URL is defined to expose Map.short_url 2023-09-26 10:34:50 +02:00
Yohan Boniface
649f21a0d5
Merge pull request #1339 from umap-project/browse-in-bbox
Allow to restrict data browser items to current map view
2023-09-26 08:16:22 +02:00
Yohan Boniface
af78d1e348
Merge pull request #1343 from umap-project/popup-large-width
Set an explicit width to popup large container
2023-09-25 22:00:15 +02:00
Yohan Boniface
a37c6005ce Set an explicit width to popup large container
Until now, the width was computed on the fly by Leaflet, based
on the popup content, but this leads to a bunch of issue on
image/iframe width.

cf https://forum.openstreetmap.fr/t/bugs-divers-relevees-sur-une-umap-absent-sur-une-autre/17254/8
2023-09-25 18:30:58 +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
1597cd731e Data browser: add back placeholder 2023-09-25 14:35:27 +02:00
Yohan Boniface
0ad6e425b5 Refactor data browser
- move a dedicated class (function was becoming big)
- user FormBuilder instead of custom form elements
2023-09-25 13:42:14 +02:00
Yohan Boniface
e0e7fc5844 Better way to set DataLayer.geojson content during tests 2023-09-25 13:40:01 +02:00
Yohan Boniface
9cf2bf1578 Allow to restrict browser items to current map view 2023-09-25 13:33:58 +02:00
Yohan Boniface
ff89125c80 Redirect to canonical URL when people share the ?edit link 2023-09-23 20:48:45 +02:00
David Larlet
98e57c150c
1.8.1 2023-09-22 14:55:46 -04:00
Yohan Boniface
dcbec3534c Fix datalayer's data duplicated at first save 2023-09-22 20:48:08 +02:00
Yohan Boniface
17104bfcbd Consume editMode from query string the proper way 2023-09-22 20:21:49 +02:00
David Larlet
18b43458e0
Merge pull request #1332 from umap-project/editmode-for-old-maps
Do not try to set editMode on _umap_options for old maps
2023-09-22 13:50:27 -04:00
Yohan Boniface
d67a17eca3 Do not try to set editMode on _umap_options for old maps 2023-09-22 19:03:01 +02:00
Yohan Boniface
27f3e08bc1 Fix anonymous maps displayed by mistake in user dashboard 2023-09-22 19:00:42 +02:00
David Larlet
500577a201
1.8.0 2023-09-22 12:29:58 -04:00
Yohan Boniface
76debf318b i18n 2023-09-22 18:28:41 +02:00
Yohan Boniface
2c7b6153b4 i18n 2023-09-22 18:27:41 +02:00
David Larlet
2563357c02
Merge pull request #1321 from umap-project/1318-restrict-zoom-options
Restrict possible min/max zoom values
2023-09-22 12:12:56 -04:00
David Larlet
f6dbb7d45b
Correct url type for background url templates 2023-09-22 12:10:53 -04:00
David Larlet
aed9e898e9
Restrict possible min/max zoom values
Fix #1318
2023-09-22 12:00:15 -04: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
157146dc04 Do not make map name and share status label clickable unless user can edit 2023-09-22 17:32:19 +02:00
Yohan Boniface
a04acb828d Update Map.can_edit docstring 2023-09-22 17:32:19 +02:00
Yohan Boniface
f05bdb2ac3 Use datalayer.isDataReadOnly in feature.isReadOnly 2023-09-22 17:32:19 +02:00
Yohan Boniface
a9b9a7e955 Tests: reuse name var 2023-09-22 17:32:19 +02:00
Yohan Boniface
dfd04c33b0 Fix typo in tests 2023-09-22 17:32:19 +02:00
Yohan Boniface
e13f3ac235 Add DataLayer.isDataReadonly
In some places we need to know if a given datalayer can accept new
features, or not, whether because being readonly or being remote
2023-09-22 17:32:19 +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
6ba8166f86 Reset DataLayer.edit_status migration 2023-09-22 17:32:19 +02:00
Yohan Boniface
4e54a93ee0 Add DataLayer.INHERIT edit status option 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
3dc4efe7b1 Remove data migration for edit_status 2023-09-22 17:32:19 +02:00
Yohan Boniface
360b6415cb Make OWNER mode the default edit_status for anonymous owned maps 2023-09-22 17:32:19 +02:00
Yohan Boniface
5f5196a52d Make sure to select only editable layers for attachin to features 2023-09-22 17:32:19 +02:00
Yohan Boniface
0afb0bff82 Include layer name in translation 2023-09-22 17:32:19 +02:00
Yohan Boniface
36befefbc6 Fix permissions related frontend tests 2023-09-22 17:32:19 +02:00
Yohan Boniface
84e3aa7121 Add default value for DataLayer.options.editMode 2023-09-22 17:32:19 +02:00
Yohan Boniface
6b269125d4 Make sure only owner see the delete map button 2023-09-22 17:32:19 +02:00
David Larlet
ddada8fb2b Remove the hasDirty concept
And only save the map in case of an `advanced` `editMode`.
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
de7c693c7b Remove console.log 2023-09-22 17:30:08 +02:00
Yohan Boniface
2d1d9281d9 Add SQL migration to populate DataLayer.edit_status from Map.edit_status 2023-09-22 17:30:08 +02:00
Yohan Boniface
af44b3a0a6 Add playwright test for editor's permissions form 2023-09-22 17:30:07 +02:00
Yohan Boniface
a15aa3566a Add playwright tests for anonymous map 2023-09-22 17:30:07 +02:00
Yohan Boniface
d902546da4 Add map update playwright tests 2023-09-22 17:30:07 +02:00
Yohan Boniface
168cc01c2e Do not try to access self.object in MapCreate 2023-09-22 17:30:07 +02:00
Yohan Boniface
42eb0e6ded Add more tests for datalayer permissions 2023-09-22 17:30:06 +02:00
Yohan Boniface
d6d55e619a Fix existing permissions related tests 2023-09-22 17:26:57 +02:00
Yohan Boniface
e52b40807a Expose correct edit statuses in anonymous mode 2023-09-22 17:26:57 +02:00
Yohan Boniface
e06da18f1e Fix helptext not displayed in anonymous permissions panel 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
35d7a5c550 Remove unused icon in 16.svg 2023-09-22 17:26:57 +02:00
Yohan Boniface
9189262855 Do not try to save map itself unless it has been modified 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
70a1a1d584 Move copyToClipboard to L.Util 2023-09-22 17:26:57 +02:00
Yohan Boniface
76239ef55c Make DataLayer.isReadOnly explicit and true by default 2023-09-22 17:26:56 +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
de907dcb50 Do not expose readonly datalayers for features 2023-09-22 17:25:55 +02:00
Yohan Boniface
89ab029cab WIP: move edit_status from Map to DataLayer 2023-09-22 17:25:55 +02:00
Yohan Boniface
73d19e849f Refactor share_status check in datalayers views 2023-09-22 17:24:01 +02:00
Yohan Boniface
9bcc18b790
Merge pull request #1329 from umap-project/prune-gz
Prune old .gz when saving a datalayer
2023-09-22 17:14:31 +02:00
Yohan Boniface
b6b9943264 Prune old .gz when saving a datalayer
We'll not consume them.

fix #1317
2023-09-21 19:12:07 +02:00
Yohan Boniface
5b7fec5f9b
Merge pull request #1314 from openbrian/docker-compose-app-depends-on-db
Replace wait_for_database with depends_on and healthcheck.
2023-09-21 10:11:56 +02:00
Brian DeRocher
6720f76d85 Set the map option. No need for setting boolean from query string.
Only add the owner property if the feature flag (map.options.featuresHaveOwner) is enabled.

Default to features do NOT have owners.
2023-09-20 13:16:52 -04:00
Brian DeRocher
77b56623ed Remove field from map settings form. 2023-09-20 13:07:12 -04:00
Brian DeRocher
6c58bf367d Use camelcase and fix typo. 2023-09-20 13:03:36 -04:00
Brian DeRocher
e25fb5d04f Add FeaturesHaveOwners map option.
WIP
2023-09-20 12:48:32 -04:00
Brian DeRocher
e76c147b65 owner is no longer a form field. 2023-09-20 10:53:27 -04:00
Brian DeRocher
35e37c2d4b Add translation for "owner". 2023-09-20 10:52:13 -04:00
Brian DeRocher
e2b789e575 Do not use the form for the owner property.
Only add the owner property to defaultProperties, if there is a user.  In other words the user can use the map without logging in.
2023-09-20 10:51:01 -04:00
Brian DeRocher
204db34282 Replace bash based waiting with python based django-probes. 2023-09-20 09:45:26 -04:00
Yohan Boniface
f6730a9829
Update umap/views.py
Co-authored-by: David Larlet <3556+davidbgk@users.noreply.github.com>
2023-09-20 15:17:29 +02:00
Yohan Boniface
43e5391c49 Fix map displayed more than once in user dashboard when multiple editors
fix #1325
2023-09-20 11:30:05 +02:00
Brian DeRocher
9c89c50560 Set a default property for features that the owner is the current user.
https://github.com/umap-project/umap/issues/430
2023-09-19 19:13:14 -04:00
Yohan Boniface
038a1a3c4d
Merge pull request #1315 from umap-project/dot-in-property
Remove dot in property name
2023-09-19 07:35:10 +02:00
Yohan Boniface
9120d54be7 Fix table editor not closing anymore from fullwidth
(From f3b5c82767)
2023-09-18 13:02:19 +02:00
Yohan Boniface
647d8910c0 Remove dot in property name
Otherwise it will break when trying to access it in FormBuilder
2023-09-18 12:21:06 +02:00
Yohan Boniface
417dde04b0 1.7.3 2023-09-18 11:19:59 +02:00
Yohan Boniface
9f47b0fc55 i18n 2023-09-18 11:19:40 +02:00
Yohan Boniface
0a83c42724
Merge pull request #1313 from jschleic/feature-1312
Add outlinkTarget to default interactionProperties
2023-09-15 12:15:47 +02:00
Yohan Boniface
13d398318d Tests: fix toggle edit panel check
We do not remove the panel content anymore
2023-09-15 12:11:13 +02:00
Joachim Schleicher
db31aa119e Add outlinkTarget to default interactionProperties
Fix #1312
2023-09-14 10:36:23 +02:00
David Larlet
f535993201
Add a powered by uMap footer
Fix #1304
2023-09-08 17:17:11 -04:00
David Larlet
2152ca3d1a
Merge pull request #1069 from umap-project/playwright-integration-tests
Setup to create integration tests with Playwright
2023-09-08 11:24:35 -04:00
Yohan Boniface
aa1b04b3ad
Merge pull request #1298 from umap-project/fix-remotelayer-with-zoom-onload
Try to fix remote datalayer not sending dataloaded
2023-09-08 16:02:37 +02:00
Yohan Boniface
aca473692a
Merge pull request #1303 from umap-project/icons-quick-changes
Enhance icon selector form
2023-09-08 16:01:25 +02:00
Yohan Boniface
4857d7c29c Use css width for img custom width
The width attribute is the intrinsic width of the image, and thus
it will not overwrite the default CSS

cf https://forum.openstreetmap.fr/t/bugs-divers-relevees-sur-une-umap-absent-sur-une-autre/17254/5
2023-09-07 07:16:55 +02:00
Yohan Boniface
4009e759dc Prevent HTML blinking when loading icons list 2023-09-05 11:21:17 +02:00
Yohan Boniface
d72ae3fc34 Very minimal search input for icons list
fix #1302
2023-09-05 10:55:35 +02:00
Yohan Boniface
ce7575c5eb But back icon preview 2023-09-05 10:29:44 +02:00
Yohan Boniface
c5084c4332 Add toggle link to show/hide iconUrl raw input 2023-09-05 10:14:24 +02:00
Yohan Boniface
91e71eccda Change button look in icon form 2023-09-05 09:41:09 +02:00
Yohan Boniface
bfd36bc0e1 Do not reset icon list on icon choice
cf #1302
2023-09-05 09:38:07 +02:00
Yohan Boniface
c08e7c5527 Remove duplicate help text in icon advanced free field 2023-09-05 09:36:30 +02:00
Yohan Boniface
09d0891318 Change link color in dark mode 2023-09-05 09:36:05 +02:00
Yohan Boniface
3a5174c003 Fix tests with playwright
Basically:
- when using playwright, we use live_server
- live_server make django-pytest switch in "transactional db" mode
- when in this mode, it will reset all data of all tables in db
- we relied on data created during the migrations, so only available
  for first test run
2023-09-04 15:04:00 +02:00
Yohan Boniface
c35c6ee78c test: allow to run playwright tests directly with py.test cli 2023-09-04 15:00:51 +02:00
David Larlet
29547d0bd6 Add a test to verify marker creation at position 2023-09-04 11:03:31 +02:00
David Larlet
95bf685159 Setup to create integration tests with Playwright 2023-09-04 11:03:28 +02:00
Yohan Boniface
648fe65f14 WIP: try to fix remote datalayer not sending dataloaded
This occurs when the remote datalayer has a min or maxZoom defined,
and the map is loaded outside those zooms. In this case, when
calling fetchRemoteData, the fetch was never done, nor the final
call to fromGeoJSON, which would have sent the dataloaded event.
2023-09-01 20:31:34 +02:00
Yohan Boniface
dcb884f0d7 1.7.2 2023-09-01 17:35:24 +02:00
Yohan Boniface
33e1bb87ca i18n 2023-09-01 17:35:05 +02:00
Yohan Boniface
d4c0bc0854
Merge pull request #1292 from umap-project/panel-portrait
Better distinguish panel behaviour in portrait vs landscape modes
2023-09-01 17:28:58 +02:00
Yohan Boniface
1cd1094398
Merge pull request #1293 from umap-project/feature-name-focus
Put focus on name when opening feature edit panel
2023-09-01 17:26:10 +02:00
Yohan Boniface
078bff3f2b
Merge pull request #1294 from umap-project/help-button-icon
Restore help button icon
2023-09-01 17:24:42 +02:00
Yohan Boniface
6ce541e899
Merge pull request #1291 from umap-project/guess-mime-type-return
Avoid using a tuple as a content type when guessed
2023-09-01 17:24:03 +02:00
Yohan Boniface
cb13b4e04d
Merge pull request #1297 from umap-project/popup-large-img-min-width
Add back min-width for img in popup-large
2023-09-01 17:23:01 +02:00
Yohan Boniface
87f6b98a99 Add back min-width for img in popup-large 2023-09-01 17:21:43 +02:00
Yohan Boniface
d89d2287b9 Fix datalayers with min/maxZoom never sending dataloaded event 2023-09-01 17:02:23 +02:00
Yohan Boniface
1b60b46a3f Delete old options after consuming them 2023-09-01 17:00:51 +02:00
Yohan Boniface
562f516272 Minimap exports tests 2023-08-31 17:48:59 +02:00
Yohan Boniface
bf66036b7b Make sure we load all data before downloading it
fix #980
2023-08-31 16:36:34 +02:00
Yohan Boniface
d78f2e087e Restore help button icon
While changing the edit header help link, I've changed all help
buttons, which was not intended.
2023-08-31 15:24:21 +02:00
Yohan Boniface
3d32bf206b i18n 2023-08-31 12:07:33 +02:00
Yohan Boniface
96d6b45734 Put focus on name when opening feature edit panel
cf #243
2023-08-30 13:26:16 +02:00
Yohan Boniface
f3b5c82767 Better distinguish panel behaviour in portrait vs landscape modes
fix #870
2023-08-30 12:36:40 +02:00
Yohan Boniface
7ed6cfb2a4 Better position for disable icon 2023-08-30 11:35:52 +02:00
David Larlet
6cacc7122b
Avoid using a tuple as a content type when guessed
Only use the content type with mimetypes.guess_type
2023-08-29 15:24:58 -04:00
David Larlet
c122ecf5e4
Merge pull request #1287 from umap-project/edit-header-polish
Edit header polish: move "My Dashboard" and "Help" to the right, display asterisk in dirty mode
2023-08-29 13:14:30 -04:00
Yohan Boniface
4c8b4c66d0 Add border around minor button in edit toolbar 2023-08-29 18:14:36 +02:00
Yohan Boniface
2986e8cec9
Merge pull request #1288 from umap-project/clean-onbeforeunload
Remove custom message from onbeforeunload event
2023-08-29 17:52:11 +02:00
Yohan Boniface
51c1990681 Explicitly set DataLayer._dataloaded status, instead of guessing it
fix #438
2023-08-29 17:49:19 +02:00
Yohan Boniface
02eb69a280 Add a button to load remote data from configuration form
cf #438
2023-08-29 16:56:04 +02:00
Yohan Boniface
ed7181ba24 Remove custom message from onbeforeunload event
It's not supported anymore by browsers.
2023-08-29 16:36:04 +02:00
Yohan Boniface
38bed0a6cf Move "My Dashboard" and "Help" to the right of the edit toolbar 2023-08-29 13:57:00 +02:00
Yohan Boniface
fc42eb2573 Add a small asterisk near map title when it's dirty 2023-08-29 11:22:23 +02:00
Yohan Boniface
949f245c00 1.7.1 2023-08-28 18:00:58 +02:00
Yohan Boniface
bcdac413be ajax proxy: quote URL before passing it to Nginx 2023-08-28 18:00:40 +02:00
Yohan Boniface
8c9ee91b42 Add test for ajax-proxy internal redirect 2023-08-28 16:49:32 +02:00
Yohan Boniface
a4b0961163 1.7.0 2023-08-28 16:42:24 +02:00
Yohan Boniface
dbba8d2744
Merge pull request #1280 from umap-project/ajax-proxy-redirect
Use X-Accel-Redirect for serving ajax-proxy request
2023-08-28 16:37:19 +02:00
Yohan Boniface
6f3803cce3 1.6.1 2023-08-25 10:19:45 +02:00
Yohan Boniface
174e6ddc6b i18n 2023-08-25 10:18:22 +02:00
Yohan Boniface
1b769bf07c Change "My Maps" to "My Dashboard" in navigation 2023-08-25 10:11:04 +02:00
Yohan Boniface
77a13eb0f0
Merge pull request #1284 from umap-project/fix-minimap-changing-center-3
Remove default center to prevent multiple map initialisations
2023-08-25 10:07:23 +02:00
Yohan Boniface
bdbde7cfd2 Ensure default view when map as no data at load 2023-08-25 09:59:02 +02:00
Yohan Boniface
e636ced4c6 Set default center in case of location error at load 2023-08-24 21:24:02 +02:00
Yohan Boniface
9c16bbfe51 Remove default center to prevent multiple map initialisations
We want to init the map view once, in our initCenter method,
so we remove any center from the option, to prevent Leaflet
to init the map on this centers

fix #1277
2023-08-24 20:48:24 +02:00
Yohan Boniface
f12e87e727 Fix datalayers being shown on zoom even if displayOnLoad is false
fix #1276
2023-08-24 19:57:47 +02:00
Yohan Boniface
c4bdb04795 Use X-Accel-Redirect for serving ajax-proxy request
uMap allows to use remote URL as data sources, but those URLs
are not always CORS open, so this is why there is this "ajax-proxy"
feature, where the URL is passed to the backend.

Additionally, there is a caching feature, which duration is configurable
through frontend settings. Valid values are: disabled, 5 min, 1 hour,
1 day.

Initially, I wanted this to be totally handled by Nginx, but I never
found a wayt to set the proxy_cache_valid value from a query string.

Since then, at least in OSM France servers, the ajax-proxy is still
handled by a Django view, which then opens the remote URL and transfert
the data. This is not optimal. And I suppose this is what is causing
hicups on the OSM France servers lately.

This PR provides a mix option, where python deals with validating the
URL and parsing the TTL parameter, and then it passes the hand to
nginx which will serve the remote content.

So, roughtly:

- the client calls /ajax-proxy/?url=xxx&ttl=300
- python will validate the URL (not internal calls…)
- if UMAP_SENDFILE_HEADER is set, then the python returns an empty
  response with the path /proxy/http://url plus it will set the
  cache ttl through the header X-Accel-Expires
- this /proxy/ location is then handled by nginx
2023-08-24 13:41:34 +02:00
Brice Maron
cd29486b84 fix: correct changelog link 2023-08-23 08:31:15 +02:00
David Larlet
29a96e5fdc
Fix tests with the latest version of mocha 2023-08-22 12:29:13 -04:00
Yohan Boniface
994a73ef2d 1.6.0 2023-08-22 15:33:50 +02:00
Yohan Boniface
debe128bd7 i18n 2023-08-22 15:33:27 +02:00
Yohan Boniface
1e1d271064 Only call propagateShow at init if layer is visible
fix #1263

We were calling popagateShow at datalayer init, which then
add a listener to "loaded" event, and then do the propagate.
So when the layer is hidden at load, when dragging it in the
datalayers list, it will be loaded (because we need to save it
with its new position) and it will appears as shown whatever
its real status.
2023-08-22 10:20:46 +02:00
Yohan Boniface
08f1e3f61b i18n 2023-08-21 17:26:48 +02:00
Yohan Boniface
a997b5454b
Merge pull request #1268 from umap-project/search-bounds
When map has max bounds, use those bounds for limiting search
2023-08-21 17:20:30 +02:00
Yohan Boniface
8095c5721d
Merge pull request #1266 from umap-project/zoom-from-to-at-load
Store DataLayer's settings in DB
2023-08-21 17:18:48 +02:00
Yohan Boniface
085721e3de
Merge pull request #1270 from umap-project/protect-username
Protect back username field from being modified by social auth login
2023-08-21 17:18:09 +02:00
Yohan Boniface
90a272aabc
Merge pull request #1271 from umap-project/add-provider
Allow to add more than one OAuth provider
2023-08-21 17:17:45 +02:00
Yohan Boniface
a89e6622ed User profile page: only display providers if there are some
Someone uses uMap with classic auth username/password, and they
don't want those empty HTML elements
2023-08-21 17:16:34 +02:00
Yohan Boniface
7814702721 Lite styling of user profile form 2023-08-21 17:10:12 +02:00
Yohan Boniface
25b3a66351 Allow to add more than one OAuth provider 2023-08-21 17:08:57 +02:00
Yohan Boniface
15e9cf0b5f Protect back username field from being modified by social auth login 2023-08-21 17:05:01 +02:00
Yohan Boniface
2b471be171 Very lite "My Profile" page to allow changing username 2023-08-21 15:09:30 +02:00
Yohan Boniface
311809520c When map has max bounds, use those bounds for limiting search
fix #1264
2023-08-21 10:06:54 +02:00
Yohan Boniface
fb6b0f4d9b Tests: fix CSS selector 2023-08-21 08:27:47 +02:00
Yohan Boniface
9bbc901150 Make sure tilelayers exist before trying to create miniMap 2023-08-20 18:44:25 +02:00
Yohan Boniface
fa090b89df Store DataLayer's settings in DB
This allows to known the full datalayer behaviour without needing
to load all the data, including the zoom from and to (new settings),
but also the color for example.

This will help also understanding datalayers usage and making
stats.

But no data migration is provided, it's retrocompatible (data
migration in OSM FR servers would be huge, so let's see if it's
really needed).
2023-08-20 09:48:01 +02:00
Yohan Boniface
b5d0b50183 Catch timeout error in ajax proxy 2023-08-17 17:43:25 +02:00
Yohan Boniface
bb922d1418 Call DataLayer.show instead of manually adding layer to the map 2023-08-17 08:14:53 +02:00
Yohan Boniface
7452681b31 Rename forgotten DataLayer.openFilter to DataLayer.openFacet 2023-08-17 08:14:22 +02:00
Yohan Boniface
ea21857bd3 1.5.1 2023-08-15 23:09:42 +02:00
Yohan Boniface
99c0271285 Update edit header when map has been saved
We need to update the share status display at first save
2023-08-15 22:42:58 +02:00
Yohan Boniface
26b3b4b5c7 Do not try to display share status until map is created 2023-08-15 22:36:11 +02:00