View Reports in UI#5
Conversation
Signed-off-by: Yuyutsu Rai <Yuyutsu.Rai@ons.gov.uk>
gibbardsteve
left a comment
There was a problem hiding this comment.
@Yuyuutsu the reports are written to the output bucket. I think this PR is repurposing BUCKET_NAME (which is the staging bucket for uploads) for that. I believe we will need a new env var OUTPUT_BUCKET_NAME for reading the reports as we can't use the same env var for the two different things.
gibbardsteve
left a comment
There was a problem hiding this comment.
Hi - the view reports doesn't work because it is still looking at the staging bucket. It will look like it does work if you still have the same named *.md files in the staging storage.
| @ui_blueprint.before_app_request | ||
| def enforce_login() -> ResponseReturnValue | None: | ||
| """Ensure unauthenticated users are redirected to the sign-in page.""" | ||
| if current_app.debug: |
There was a problem hiding this comment.
I don't think we want to add this.
There was a problem hiding this comment.
Oops forgot to remove this when pushing up. Removed!
gibbardsteve
left a comment
There was a problem hiding this comment.
You also need to add markdown as a project dependency in pyproject.toml otherwise it fails in cloudrun
Summary
Allow users to view reports generated by the theme finder report generator.
Why
Users need a simple way to access previously generated reports from the UI. This avoids requiring them to request access to, or manually browse, the GCP bucket where past reports are stored.
Changes
view reportHow to Test
Set these env values:
The bucket has some example Markdowns that were generated by the report generator
Run the Application and check if the reports are rendered
You can also generate a report and see if the UI renderes the new reports
Check the View Reports tab is only visible when the user haslogged in.