uploads: Improve abstraction of upload.js by removing object exports.

The `upload_objects_by_message_edit_row` map object was being exported
to handle the uploads during the editing of a message. To improve the
abstraction, we move the logic being used to access
`upload_objects_by_message_edit_row` and itself into `upload.js`.

Similarly, the `compose_upload_object` constant which was being exported
to handle the cancelling of compose uploads. This commit removes this
export and instead defines a new method `compose_upload_cancel` to
handle the same.
This commit is contained in:
Sayam Samal
2024-02-16 04:55:31 +05:30
committed by Tim Abbott
parent 65be62e4cb
commit a7e7176aae
4 changed files with 45 additions and 31 deletions

View File

@@ -508,10 +508,8 @@ test_ui("initialize", ({override}) => {
realm.max_file_upload_size_mib = 512;
let uppy_cancel_all_called = false;
override(upload, "compose_upload_object", {
cancelAll() {
uppy_cancel_all_called = true;
},
override(upload, "compose_upload_cancel", () => {
uppy_cancel_all_called = true;
});
override(upload, "feature_check", noop);