Create a preview mode for publishing survey data
1 unresolved thread
1 unresolved thread
- The compendium frontend now has a preview flag that can be activated by visiting any data page with a ?preview query parameter. This works with the usePreview hook that uses the previewContext
- This preview flag is passed along to the backend (again as ?preview ) in all api calls in the new useData hook
- We have a new preview_year table that contains the years that should only be visible in preview mode
- This table is used in the new get_data helper function that is called from all the routes
- The preview_year table is managed from the survey management page, that now has a 'preview' and a 'publish' button (there's a corresponding new endpoint for the preview button)
- To keep track of whether the survey is in preview there's a new 'preview' survey status. The 'checked' response status is removed because it isnt used
Edited by Remco Tukker
Merge request reports
Activity
added 1 commit
- f8eb1c09 - dont change state while rendering and allow activating preview from all pages
added 1 commit
- 2de28227 - easy way to exclude some data when not previewing
added 30 commits
-
a7cb30f0...c5f0b195 - 28 commits from branch
develop
- daa4a911 - Merge branch 'develop' into feature/COMP-258_publishing
- 2932cdd4 - use a table to determine what years are previews
-
a7cb30f0...c5f0b195 - 28 commits from branch
56 59 data, 57 60 str(response.status_code))) 58 61 return response 62 63 64 def get_data(table_class): 65 select_statement = select(table_class).join(NREN).order_by(NREN.name.asc(), table_class.year.desc()) 66 preview = request.args.get('preview') is not None mentioned in commit 1e47b8ce
Please register or sign in to reply