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

BAU: Fix viewing files (no-script) #454

Merged
merged 3 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ export class ClientSideFileUploadField extends FormComponent {
...super.getViewModel(formData, errors),
dropzoneConfig: this.options.dropzoneConfig,
existingFiles: [], // this is populated afterwards.
pageAndForm: null, // this is also populated afterwards.
showNoScriptWarning: this.options.showNoScriptWarning || false,
totalOverallFilesize: this.options.totalOverallFilesize,
hideTitle: this.options.hideTitle || false,
Expand Down
1 change: 1 addition & 0 deletions runner/src/server/plugins/engine/components/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export type FreeTextFieldViewModel = {
export type ClientSideFileUploadFieldViewModel = {
dropzoneConfig: object;
existingFiles: S3Object[];
pageAndForm: string;
showNoScriptWarning?: boolean;
totalOverallFilesize?: number;
hideTitle?: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ export class PageControllerBase {
const pageAndForm = currentPath.includes("?")
? currentPath.split("?")[0]
: currentPath;
comp.model.pageAndForm = pageAndForm;
const folderPath = `${form_session_identifier}${pageAndForm}/${comp.model.id}`;
const files = await uploadService.listFilesInBucketFolder(
folderPath,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
<div class="dz-template govuk-table__row dz-success">
<div class="govuk-table__cell dz-table__cell">
<a class="govuk-link govuk-link--no-underline"
href="/s3/report-a-terrorist/yes-i-have-evidence/koE_ae/download-file?filename={{file.Key}}&form_session_identifier={{file.FormSessionId}}">
href="/s3{{component.model.pageAndForm}}/{{component.model.id}}/download-file?filename={{file.Key}}&form_session_identifier={{file.FormSessionId}}">
{{ file.Key }}
</a>
</div>
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION=0.1.229
VERSION=0.1.230
Loading