Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Biodivsports public detail view #3358

Closed

Conversation

lpofredc
Copy link
Contributor

Add a new public web view on sensitive areas.
URL provided in sensitive area api under "public_url" key.

Build with VueJS which will also be used to integrate Biodiv-sports widget generator https://biodivsports-widget.lpo-aura.org/

Already manage attachments (cf. PR #3348 )

MicrosoftTeams-image (1)

@camillemonchicourt
Copy link
Member

I don't understand, it adds a webpage for each sensitivearea in th Geotrek-admin API?

@lpofredc
Copy link
Contributor Author

It adds a public webpage (no auth required, cf. previous screenshot) for each published sensitive area that will describe sensitive areas (map, sensitive periods, descriptions, contacts, attachments, etc.) ex: https://biodiv-sports.fr/public/sensitiveareas/1296.

That page url is provided in SensitiveArea apis under public_url key and can be used by any client. This is an expected special need in the BiodivSports instance

image

@babastienne
Copy link
Member

@lpofredc could you try not to use VueJS as well as FontAwesome ? We try to reduce the number of dependencies on this project and those (especially Vue) are important librairies. It doesn't seems right to use VueJS if not to replace all views with it in Geotrek and create a better front-end.

It does seems that the use of external dependencies to create public views is not required in order to achieve the feature you're trying to add.

I'm open to discuss this subject with you if needed.

@lpofredc
Copy link
Contributor Author

Ok, I removed vueJS dependency to use django templates native features. I agree to not add so much dependecies.

A better queryset with select related and prefetch will be possible after PR #3348 merge.

It was also to prepare biodivsport widget generator integration that also use VueJS and to avoid coding reactivity features by using pure javascript or jQuery.

@submarcos
Copy link
Member

submarcos commented Dec 15, 2022

I suggest to add TemplateHTMLRenderer directly on SensitivityArea APIV2 viewset. If you call /api/v2/sensitivearea/1, you get the json, /api/v2/sensitivearea/1.html, you got HTML version. No need to add view or unauthenticated url in sensitivity app. Api is already unauthenticated and filter published data

@lpofredc
Copy link
Contributor Author

Ok, i moved this template view into api/v2 module with add a global map preview for root url (/api/v2/sensitivearea.html).

I suggest to add TemplateHTMLRenderer directly on SensitivityArea APIV2 viewset. If you call /api/v2/sensitivearea/1, you get the json, /api/v2/sensitivearea/1.html, you got HTML version. No need to add view or unauthenticated url in sensitivity app. Api is already unauthenticated and filter published data

@camillemonchicourt
Copy link
Member

I was not very familiar with the idea to have HTML pages in an API, but why not. Good for me if OK for Geotrek-admin maintainers, and good to have removed new dependencies such as VueJS.

@cypress
Copy link

cypress bot commented Feb 1, 2023

Passing run #5728 ↗︎

0 24 0 0 Flakiness 0

Details:

Merge 980c0ab into d72a2d3...
Project: Geotrek-admin Commit: afd177adca ℹ️
Status: Passed Duration: 05:08 💡
Started: Feb 1, 2023 1:10 PM Ended: Feb 1, 2023 1:15 PM

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

@codecov
Copy link

codecov bot commented Feb 1, 2023

Codecov Report

Base: 98.28% // Head: 98.22% // Decreases project coverage by -0.07% ⚠️

Coverage data is based on head (980c0ab) compared to base (7623070).
Patch coverage: 72.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3358      +/-   ##
==========================================
- Coverage   98.28%   98.22%   -0.07%     
==========================================
  Files         292      293       +1     
  Lines       21152    21200      +48     
==========================================
+ Hits        20789    20823      +34     
- Misses        363      377      +14     
Impacted Files Coverage Δ
geotrek/sensitivity/urls.py 90.90% <ø> (ø)
geotrek/sensitivity/models.py 99.42% <50.00%> (-0.58%) ⬇️
geotrek/sensitivity/views.py 94.11% <50.00%> (-4.29%) ⬇️
...rek/sensitivity/templatetags/sensitivity_extras.py 71.42% <71.42%> (ø)
geotrek/api/v2/views/sensitivity.py 94.23% <78.57%> (-5.77%) ⬇️
geotrek/api/v2/serializers.py 99.89% <100.00%> (+<0.01%) ⬆️
geotrek/sensitivity/serializers.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@lpofredc
Copy link
Contributor Author

lpofredc commented Feb 1, 2023

After discussion, will probably be replaced by a new dev using GeotrekCE/Geotrek-rando-widget

@lpofredc lpofredc closed this Feb 1, 2023
@camillemonchicourt
Copy link
Member

Voir l'article de présentation technique du widget - https://makina-corpus.com/application-web-mobile/creer-application-en-tant-que-composant-web-stencil

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants