Commit graph

991 commits

Author SHA1 Message Date
Yohan Boniface
76ed5b9c4f Move docker utils under a dedicated folder 2023-06-05 12:26:50 +02:00
Yohan Boniface
b749b734c7 Use python 3.11 in docker 2023-06-05 12:17:45 +02:00
Yohan Boniface
e322358b51 Add .dockerignore 2023-06-05 12:03:54 +02:00
Yohan Boniface
24d4a5d488 Remove requirements-docker.txt 2023-06-05 12:03:42 +02:00
Yohan Boniface
cf071eda85 Remove mocha-phantomjs for now, as it sometimes break Docker build 2023-06-05 11:49:36 +02:00
Yohan Boniface
96ca298a28 Remove unused code 2023-06-05 11:49:21 +02:00
Yohan Boniface
40f694f460 Make Docker happy with Makefile syntax 2023-06-05 11:48:46 +02:00
Yohan Boniface
5e201b44fb Use django-environ to make part of the settings available throught env vars 2023-06-05 11:48:21 +02:00
Yohan Boniface
309db975af
Merge branch 'master' into master 2023-06-02 17:34:49 +02:00
Yohan Boniface
3722eacb08 Remove django-leaflet-storage and leaflet.storage from README
Those have been integrated into uMap itself since 1.0
2023-06-02 16:49:50 +02:00
Yohan Boniface
7713281f8c 1.3.0 2023-05-31 10:36:01 +02:00
Yohan Boniface
b61b5a48a3 Fix wrong assignement to const 2023-05-31 10:22:37 +02:00
Yohan Boniface
2c451a2941 i18n 2023-05-31 09:57:02 +02:00
Yohan Boniface
71293d3d8b changelog 2023-05-31 09:35:00 +02:00
Yohan Boniface
945042a65f i18n 2023-05-31 09:14:32 +02:00
Yohan Boniface
1cd75c5ccb
Merge pull request #1113 from umap-project/420-zoom-set
Better zoom set/modified wording
2023-05-31 09:09:38 +02:00
David Larlet
0b76ebb259
Apply black to models.py 2023-05-30 20:41:32 -04:00
David Larlet
2c2bd10e27
Better zoom set/modified wording
Fix #420, hopefully the fuzzy translations will be updated!
2023-05-30 18:29:57 -04:00
David Larlet
b6628a3015
Merge pull request #1112 from umap-project/1095-read-only-banner
Banner + no create buttons when in read only mode
2023-05-30 18:25:33 -04:00
David Larlet
3f28c04241
Banner + no create buttons when in read only mode
Fix #1095
2023-05-30 16:17:12 -04:00
David Larlet
0cd1cf4ffc
Merge pull request #1094 from umap-project/use-dompurify
Use DOMPurify to escape malicious input from user
2023-05-30 15:49:29 -04:00
David Larlet
51c22e93ce
Merge pull request #1111 from umap-project/lebab-template
Apply Lebab for template conversions
2023-05-30 15:46:34 -04:00
David Larlet
0a75998f11
Apply Lebab for template conversions 2023-05-30 14:53:53 -04:00
David Larlet
4a3c845eca
Handle iframes and target attribute with dompurify 2023-05-30 14:23:06 -04:00
David Larlet
fa3d653944
Update the test template to add the purify depency 2023-05-30 14:23:05 -04:00
David Larlet
3122286c8e
Use DOMPurify in escapeHTML() for a global impact 2023-05-30 14:22:04 -04:00
David Larlet
fd3f854a9c
Use DOMPurify to escape malicious input from user 2023-05-30 14:22:04 -04:00
David Larlet
4f5674073f
Merge pull request #1098 from umap-project/lebab-let-const
Apply Lebab for let/const conversions
2023-05-30 14:19:27 -04:00
David Larlet
8d6185c476
Manual review of Lebab for let/const conversions 2023-05-30 14:16:10 -04:00
David Larlet
56ce9ae22c
Apply Lebab for let/const conversions
As far as I understand, it default to `let` in these cases because the tool cannot figure out if a `const` is possible. It has to be checked manually:

```
./node_modules/lebab/bin/index.js --replace "umap/static/umap/js/*.js" --transform let
umap/static/umap/js/umap.xhr.js:
228:  warning  Unable to transform var  (let)
umap/static/umap/js/umap.ui.js:
83:  warning  Unable to transform var  (let)
umap/static/umap/js/umap.slideshow.js:
15:  warning  Unable to transform var  (let)
83:  warning  Unable to transform var  (let)
umap/static/umap/js/umap.popup.js:
100:  warning  Unable to transform var  (let)
umap/static/umap/js/umap.permissions.js:
14:  warning  Unable to transform var  (let)
umap/static/umap/js/umap.layer.js:
195:  warning  Unable to transform var  (let)
436:  warning  Unable to transform var  (let)
568:  warning  Unable to transform var  (let)
584:  warning  Unable to transform var  (let)
989:  warning  Unable to transform var  (let)
1088:  warning  Unable to transform var  (let)
1098:  warning  Unable to transform var  (let)
umap/static/umap/js/umap.js:
124:  warning  Unable to transform var  (let)
223:  warning  Unable to transform var  (let)
343:  warning  Unable to transform var  (let)
376:  warning  Unable to transform var  (let)
406:  warning  Unable to transform var  (let)
849:  warning  Unable to transform var  (let)
732:  warning  Unable to transform var  (let)
948:  warning  Unable to transform var  (let)
959:  warning  Unable to transform var  (let)
878:  warning  Unable to transform var  (let)
1085:  warning  Unable to transform var  (let)
umap/static/umap/js/umap.icon.js:
145:  warning  Unable to transform var  (let)
184:  warning  Unable to transform var  (let)
umap/static/umap/js/umap.forms.js:
453:  warning  Unable to transform var  (let)
umap/static/umap/js/umap.features.js:
15:  warning  Unable to transform var  (let)
101:  warning  Unable to transform var  (let)
143:  warning  Unable to transform var  (let)
373:  warning  Unable to transform var  (let)
429:  warning  Unable to transform var  (let)
890:  warning  Unable to transform var  (let)
949:  warning  Unable to transform var  (let)
umap/static/umap/js/umap.core.js:
149:  warning  Unable to transform var  (let)
175:  warning  Unable to transform var  (let)
umap/static/umap/js/umap.controls.js:
665:  warning  Unable to transform var  (let)
876:  warning  Unable to transform var  (let)
1249:  warning  Unable to transform var  (let)
```
2023-05-30 14:16:09 -04:00
Yohan Boniface
99b2bfb811 i18n 2023-05-30 17:52:33 +02:00
Yohan Boniface
7c2b7ac309 Simplify exlude of folder when running make messages 2023-05-30 17:52:32 +02:00
David Larlet
c42a08b3bc
Merge pull request #1110 from umap-project/add-editinosm-icon
Add missing edit-in-osm icon
2023-05-30 11:49:04 -04:00
Yohan Boniface
eaef600a97 Add missing edit-in-osm icon
fix #1096
2023-05-30 15:58:29 +02:00
Yohan Boniface
bd769091a7
Merge pull request #1109 from umap-project/direct-link
Also expose direct map URL in the export panel
2023-05-30 14:50:45 +02:00
Yohan Boniface
c52e093db8 Also expose direct map URL in the export panel
cf #699
2023-05-30 11:04:10 +02:00
Yohan Boniface
2f79078141
Merge pull request #1108 from umap-project/fix-js-tests
Fix JS tests
2023-05-30 08:46:38 +02:00
Yohan Boniface
50091ec0fa Redirect to "user_maps" at login end when window.opener is not accessibile
This is the case for Twitter.
We'll try to refactor the process later, but let's make it "acceptable"
for now.

cf #1097
2023-05-30 08:42:23 +02:00
Yohan Boniface
18232bcad0 Rename class to match switching to Twitter OAuth V2 2023-05-30 08:42:23 +02:00
Yohan Boniface
7b65820b73 HOT fix: add message in login_popup_end.html to work around Twitter issues
In case of logging through Twitter, we don't have access to
window.opener, so we cannot close the window and tell uMap to
finish the login process.
2023-05-30 08:42:23 +02:00
Yohan Boniface
a462a58ae0 Remove SOCIAL_AUTH_PIPELINE from settings/base.py
We are using the default, so not need to define them on our
side.
2023-05-30 08:42:23 +02:00
Yohan Boniface
9ca5ba974b Auth: mark id as protected, otherwise social-core try to create
new account at each login:

```
  File "/srv/umap/venv/lib/python3.10/site-packages/social_core/backends/base.py", line 83, in pipeline
    out = self.run_pipeline(pipeline, pipeline_index, *args, **kwargs)
  File "/srv/umap/venv/lib/python3.10/site-packages/social_core/backends/base.py", line 113, in run_pipeline
    result = func(*args, **out) or {}
  File "/srv/umap/venv/lib/python3.10/site-packages/social_core/pipeline/user.py", line 122, in user_details
    strategy.storage.user.changed(user)
  File "/srv/umap/venv/lib/python3.10/site-packages/social_django/storage.py", line 16, in changed
    user.save()
django.db.utils.IntegrityError: duplicate key value violates unique constraint "auth_user_username_key"
DETAIL:  Key (username)=(xxxxx) already exists.
```
2023-05-30 08:42:23 +02:00
David Larlet
23053a26fc Correct tests fixtures for options permissions 2023-05-26 14:12:08 -04:00
David Larlet
c5b19728f0 Fix sinon’s fakeServer’s URLs with /?date param
Since this commit 97e2df0a8d tests were broken because the URL has an extra date parameter to update the cache for datalayers. With the new regexp, we match these new URLs with the fakeServer from sinon.

Also update sinon to v15.
2023-05-26 13:39:58 -04:00
David Larlet
06a354730b Apply PrettierJS to tests files
Command: `make pretty filepath="umap/static/umap/test/*"`
2023-05-26 13:25:21 -04:00
David Larlet
7f85684d52
Merge pull request #1100 from umap-project/stats-view
Add a very basic `/stats/` JSON view
2023-05-23 13:05:11 -04:00
David Larlet
6f72df82b7 Improve stats view testing with another user 2023-05-23 12:09:10 -04:00
David Larlet
deb0ab09d3 Add one hour cache to the stats view 2023-05-23 11:51:54 -04:00
David Larlet
9d752ea306 Add a very basic /stats/ JSON view
Will be useful to feed munin for instance.
2023-05-22 17:47:04 -04:00
Yohan Boniface
b41a8cd39a
Merge pull request #1099 from umap-project/1090-followup
Follow up on #1090 for overlay’s opacity
2023-05-22 23:14:15 +02:00