spreadsheetimporter / ui5-cc-spreadsheetimporter

A UI5 Component to integrate a Spreadsheet Upload for UI5 Apps.
https://spreadsheet-importer.com/
Apache License 2.0
78 stars 15 forks source link

[Bug]: Forced refresh is not applicable for ODataV4 #589

Closed thecoldstone closed 3 weeks ago

thecoldstone commented 2 months ago

OData Version

OData V4

Draft

Yes

Scenario

Fiori Elements/ObjectPage

Environment

NVim

UI5 Spreadsheet Component

v1_1_1

What happened?

Component is trying to refresh context for the page but fails due to the fact that ODataV4 does not support force refresh.

Relevant log output

//Function below which causes error due to wrong passed parameter
ODataBinding.prototype.refresh = function (sGroupId) {
        if (typeof sGroupId === "boolean") {
            throw new Error("Unsupported parameter bForceUpdate");
        }
        this.requestRefresh(sGroupId).catch(this.oModel.getReporter());
};

Spreadsheet Component Init

export async function openSpreadsheetImportDialog(this: ExtensionAPI) {
    const view = this.getRouting().getView();
    const controller = view.getController() as BaseController;
    view.setBusyIndicatorDelay(0);
    view.setBusy(true);
    const spreadsheetImport = (await controller.getAppComponent().createComponent({
        usage: "spreadsheetImporter",
        async: true,
        componentData: {
            context: this,
            activateDraft: true,
            fieldMatchType: "label"
        }
    })) as Component;

    spreadsheetImport.openSpreadsheetUploadDialog();
    view.setBusy(false);
}

Manifest

No response

marianfoo commented 2 months ago

@thecoldstone thank you for your bug report. Might take a while till i can have a look at it. as a workaround you can refresh it yourself when the request is complete: https://docs.spreadsheet-importer.com/pages/Events/#event-when-the-request-is-completed

marianfoo commented 1 month ago

@thecoldstone does #596 help? please check

marianfoo commented 1 month ago

Hi @thecoldstone can you please check the fix if that would work for you?