SJRK-401: Decouple call to resetUploadState function

Metadata

Source
SJRK-401
Type
Improvement
Priority
Major
Status
Open
Resolution
N/A
Assignee
N/A
Reporter
Gregor Moss
Created
2020-10-20T21:10:21.245-0400
Updated
2020-10-21T08:50:05.353-0400
Versions
N/A
Fixed Versions
N/A
Component
N/A

Description

The call to singleFileUploader.resetUploadState() by the storyEditor on block removal is too tightly coupled with the singleFileUploader grade. Reconfigure this section of the code to be less "aware" of the way the uploader tracks its state.

// If it's a media block, reset its uploadState before removing
if (managedComponent.singleFileUploader) {
    managedComponent.singleFileUploader.resetUploadState();
}

Comments

  • Justin Obara commented 2020-10-21T08:50:05.353-0400

    It would be preferable to not call managedComponent.singleFileUploader.resetUploadState() directly as noted in the description. A better option would be to have resetUploadState functionality triggered by the onDestroy method of the related component. However there is currently an issue in the framework that prevents this (see: FLUID-6558). This has also been further discussed in comments of SJRK-400