Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
307f95e
Updated file column to remove erroneous line
droberts-ctrlo Jul 21, 2025
214031d
Updated to allow for undef when creating field
droberts-ctrlo Jul 23, 2025
8f7f995
Updated filecheck for undef values
droberts-ctrlo Jul 23, 2025
3928142
Updated rename button to fix where it wasn't working on fields with e…
droberts-ctrlo Jul 23, 2025
c55f348
Updated options to allow for read-only options and updated filecheck
droberts-ctrlo Jul 25, 2025
42e24b4
Removed debug statement
droberts-ctrlo Jul 25, 2025
0d82cfb
Updated add-extension script, and upload control
droberts-ctrlo Jul 25, 2025
cdf7def
Added changes to files
droberts-ctrlo Jul 25, 2025
32a437d
Updated file check
droberts-ctrlo Jul 25, 2025
2f8e5c5
Updated filecheck
droberts-ctrlo Jul 25, 2025
f41243f
Updated user configurable hash to more sensible values
droberts-ctrlo Jul 28, 2025
c7a3220
Added better progress handling for multiple files
droberts-ctrlo Jul 28, 2025
c22f795
Revert "Added better progress handling for multiple files"
droberts-ctrlo Jul 29, 2025
52d15b4
Updated to remove file name check
droberts-ctrlo Jul 30, 2025
7d38d71
Fixed failing Jest test
droberts-ctrlo Jul 30, 2025
a7a1ede
Updated for use of \Q and \E in regex
droberts-ctrlo Jul 30, 2025
9826218
Updated filecheck to use actual files
droberts-ctrlo Jul 30, 2025
82b0eb9
Removed and modified comments
droberts-ctrlo Jul 30, 2025
50d03b8
Re-added size check to upload check, and comments to check_name
droberts-ctrlo Jul 30, 2025
5a188dc
Further changes to methods to better support filevals and uploads
droberts-ctrlo Jul 30, 2025
9f93c56
Fix for typo in Fileval file
droberts-ctrlo Jul 30, 2025
688519c
Fixed incorrect sub name in call
droberts-ctrlo Jul 30, 2025
cd95359
Updated errorhandler
droberts-ctrlo Jul 30, 2025
22ad5eb
Further error checks
droberts-ctrlo Jul 30, 2025
3de0eb1
Revert "Further error checks"
droberts-ctrlo Jul 30, 2025
64fdcf9
Revert "Updated errorhandler"
droberts-ctrlo Jul 30, 2025
19287b2
Merge branch 'upload-fix' into file-rename-fix
droberts-ctrlo Jul 30, 2025
d8cb21a
Reverted items showing as changes where not required
droberts-ctrlo Jul 31, 2025
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
8 changes: 7 additions & 1 deletion src/frontend/js/lib/util/upload/UploadControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ type XmlHttpRequestLike = {
readyState: number,
status: number,
responseText: string,
upload?: {
onprogress?: ((e: ProgressEvent) => void) | null
};
};

/**
Expand Down Expand Up @@ -71,7 +74,10 @@ class Uploader {
request.open(this.method, this.url.toString());
request.onabort = () => reject('aborted');
request.onerror = () => reject('error');
request.onprogress = (e: ProgressEvent) => this.onProgressCallback?.(e.loaded, e.total);
request.upload.onprogress = (e: ProgressEvent) => {
if(!e.lengthComputable) this.onProgressCallback?.(e.loaded, 0);
this.onProgressCallback?.(e.loaded, e.total);
}
request.onreadystatechange = () => {
if (request.readyState === 4) {
if (request.status === 200) {
Expand Down
3 changes: 3 additions & 0 deletions src/frontend/testing/globals.definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ export class MockXhr implements XmlHttpRequestLike {
readyState: number = 4;
status: number = 200;
responseText: string = JSON.stringify({error: 0});
upload = {
onprogress: jest.fn()
}
}

export interface ElementLike {
Expand Down
11 changes: 8 additions & 3 deletions views/edit.tt
Original file line number Diff line number Diff line change
Expand Up @@ -879,9 +879,11 @@
'<ul class="list__items fileupload__files">';
FOREACH file IN editvalue.files;
'<li class="list__item">';
'<div class="row">';
'<div class="col-auto align-content-center">';
'<span class="list__key">';
INCLUDE fields/sub/checkbox.tt
id = "file_checkbox_" _ col.id _ "_" _ file.id
id = "file-" _ file.id
name = field
label = "Include file."
value = file.id
Expand All @@ -895,10 +897,13 @@
'</span>';
'<span class="list__value">';
'Current file name: ';
'<a class="link link--plain" href="' _ url.page _ '/file/' _ file.id _'">';
'<a class="link link--plain" href="' _ url.page _ '/file/' _ file.id _'" id="current-'_ file.id _'">';
file.name | html;
'</a>.';
'</a>';
'<button data-field-id="' _ file.id _ '" class="rename btn btn-plain btn-small btn-sm py-0"></button>';
'</span>';
'</div>';
'</div>';
'</li>';
END;
'</li>';
Expand Down