spreadsheetimporter / ui5-cc-spreadsheetimporter

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

[Bug]: Download and Continue Anyway button present during Upload Failure #491

Closed mainakaich closed 4 months ago

mainakaich commented 5 months ago

OData Version

OData V4

Draft

Yes

Scenario

Fiori Elements

Environment

BTP ABAP

UI5 Spreadsheet Component

cc.spreadsheetimporter.v0_31_5

What happened?

The buttons 'Download' and 'Continue Anyway' are available during upload failure as shown here. But that doesn't give good user experience because -

  1. User won't be downloading anything at this point. Therefore, it will be great if the button is hidden/removed here.
  2. Continue Anyway looks ambiguous. During file selection, when validation check occurs in the UI level, that time 'Continue Anyway' makes more sense where user still wants to upload despite of errors. But here, nothing happens even if user clicks here. Therefore, it will be great if the button is hidden/removed here. image

Relevant log output

NA

Spreadsheet Component Init

"actions": {
                                        "spreadSheetController": {
                                            "press": "zssarticle.ext.spreadSheetController.spreadSheetController.uploadExcel",
                                            "visible": true,
                                            "enabled": true,
                                            "requiresSelection": false,
                                            "text": "Upload"
                                        }

Manifest

"componentUsages": {
            "spreadsheetImporter": {
                "name": "cc.spreadsheetimporter.v0_31_5"
            }
        },
        "resourceRoots": {
            "cc.spreadsheetimporter.v0_31_4": "./thirdparty/customControl/spreadsheetImporter/v0_31_5"
        },
marianfoo commented 5 months ago
  1. User won't be downloading anything at this point. Therefore, it will be great if the button is hidden/removed here.

What do you mean with User won't be downloading anything at this point. The download button is for downloading the errors as excel file. Would you simply like the option that this button does not appear anyway?

  1. Continue Anyway looks ambiguous. During file selection, when validation check occurs in the UI level, that time 'Continue Anyway' makes more sense where user still wants to upload despite of errors. But here, nothing happens even if user clicks here. Therefore, it will be great if the button is hidden/removed here.

You can hide this button with the strict option.
If the user presses close the error dialog will close and the selected file will dissapear. If the user presses "Continue Anyway" will close the error dialog and the user will able to upload the data to the backend. I´m sorry but i don´t get your point with "nothing happens". Can you please try to explain your point further.

mainakaich commented 5 months ago
  1. User won't be downloading anything at this point. Therefore, it will be great if the button is hidden/removed here.

What do you mean with User won't be downloading anything at this point. The download button is for downloading the errors as excel file. Would you simply like the option that this button does not appear anyway?

Mainak - Sorry, I understood the purpose of download at this point. I downloaded the error in excel file. It contains the row number column. But I didn't understand how to fill this. Can you please suggest how to fill the row number so that it is available in the downloaded excel file.

  1. Continue Anyway looks ambiguous. During file selection, when validation check occurs in the UI level, that time 'Continue Anyway' makes more sense where user still wants to upload despite of errors. But here, nothing happens even if user clicks here. Therefore, it will be great if the button is hidden/removed here.

You can hide this button with the strict option. If the user presses close the error dialog will close and the selected file will dissapear. If the user presses "Continue Anyway" will close the error dialog and the user will able to upload the data to the backend. I´m sorry but i don´t get your point with "nothing happens". Can you please try to explain your point further.

Mainak - I am referring the 'Continue Anyway' in the perspective of upload(point 2 mentioned below). As I can see there are 2 possibilities when you are showing this dialog.

  1. When user just select the file and then the validation check happens against the records in the UI. If any error occurs, the errors are displayed in the dialog. Here 'Continue Anyway' makes sense where user still wants to proceed despite validation error.
  2. When user clicks on the upload button, then the records are sent to backend and if errors occurred in the backend, they are displayed in the dialog. Here 'Continue Anyway' makes no sense for me as user can't continue anything here. All he can do is to close the dialog. Therefore I was suggesting to remove/hide this button when error occurs during upload.
marianfoo commented 5 months ago
  1. User won't be downloading anything at this point. Therefore, it will be great if the button is hidden/removed here.

What do you mean with User won't be downloading anything at this point. The download button is for downloading the errors as excel file. Would you simply like the option that this button does not appear anyway?

Mainak - Sorry, I understood the purpose of download at this point. I downloaded the error in excel file. It contains the row number column. But I didn't understand how to fill this. Can you please suggest how to fill the row number so that it is available in the downloaded excel file.

Here is a example how add the row number: https://docs.spreadsheet-importer.com/pages/Events/#example

I just tested it and it worked

marianfoo commented 5 months ago

Mainak - I am referring the 'Continue Anyway' in the perspective of upload(point 2 mentioned below). As I can see there are 2 possibilities when you are showing this dialog.

  1. When user just select the file and then the validation check happens against the records in the UI. If any error occurs, the errors are displayed in the dialog. Here 'Continue Anyway' makes sense where user still wants to proceed despite validation error.
  2. When user clicks on the upload button, then the records are sent to backend and if errors occurred in the backend, they are displayed in the dialog. Here 'Continue Anyway' makes no sense for me as user can't continue anything here. All he can do is to close the dialog. Therefore I was suggesting to remove/hide this button when error occurs during upload.

You´re right, in your case this does not make sense.
In that case the button should be hidden. I´ll fix that.

mainakaich commented 5 months ago
  1. User won't be downloading anything at this point. Therefore, it will be great if the button is hidden/removed here.

What do you mean with User won't be downloading anything at this point. The download button is for downloading the errors as excel file. Would you simply like the option that this button does not appear anyway?

Mainak - Sorry, I understood the purpose of download at this point. I downloaded the error in excel file. It contains the row number column. But I didn't understand how to fill this. Can you please suggest how to fill the row number so that it is available in the downloaded excel file.

Here is a example how add the row number: https://docs.spreadsheet-importer.com/pages/Events/#example

I just tested it and it worked

Dear @marianfoo, thanks so much for sharing the example at https://docs.spreadsheet-importer.com/pages/Events/#example. But how to fill the row number in the error excel sheet when the errors are coming from backend during upload action. I am not very sure is that technically possible or not. Please suggest.

marianfoo commented 5 months ago

i dont know your specific use case, but you can create a property for the excel row in your data model and send it to the backend and create the backend error with the excel row. If the error is coming to the app you can then create the errors including the excel row. You know what i mean?

marianfoo commented 5 months ago

Mainak - I am referring the 'Continue Anyway' in the perspective of upload(point 2 mentioned below). As I can see there are 2 possibilities when you are showing this dialog.

  1. When user just select the file and then the validation check happens against the records in the UI. If any error occurs, the errors are displayed in the dialog. Here 'Continue Anyway' makes sense where user still wants to proceed despite validation error.
  2. When user clicks on the upload button, then the records are sent to backend and if errors occurred in the backend, they are displayed in the dialog. Here 'Continue Anyway' makes no sense for me as user can't continue anything here. All he can do is to close the dialog. Therefore I was suggesting to remove/hide this button when error occurs during upload.

You´re right, in your case this does not make sense. In that case the button should be hidden. I´ll fix that.

Fixed with version 0.31.6 please check

marianfoo commented 5 months ago

Was is able to help you?

mainakaich commented 4 months ago

Hi @marianfoo

Now the continue anyway is not coming during error. But in case of success, the dialog box shows "Upload Error" which is misleading. Can you please change the caption to "Processing Output" to make it generic or dynamically change it "Upload Success" or "Upload Error" depending on the backend response. (Remember here we are sending the backend calls with standalone : true in spreadsheet importer configuration).

image

marianfoo commented 4 months ago

Changed that yesterday :) https://docs.spreadsheet-importer.com/pages/Configuration/#i18nmodel

See the title here: https://github.com/spreadsheetimporter/ui5-cc-spreadsheetimporter/blob/bf9d9b2bbd7421132f2691d7a9eca494d1912cbb/packages/ui5-cc-spreadsheetimporter/src/i18n/i18n_en.properties#L27

mainakaich commented 4 months ago

Hello @marianfoo

Thanks so much for the solution offered. But I wanted to highlight one more problem here. In the same dialog box, even though the backend is replying with HTTP response 200, I think from the spreadsheet-importer the message is coming like - "Error occurred in Row 1". I am sharing the screenshot and custom controller JS file spreadSheetController.js.txt for your reference. image

Starting from line 236 in attached custom controller program where we are showing messages in case backend returns HTTP 200.

"success": function (oData, response) { const success = { title: "All the records were uploaded successfully", group: true, row: 1, ui5type: "Success" }; errorArray.push(success); event.getSource().addArrayToMessages(errorArray); resolve(); this._view.getModel().refresh(); //Refresh the list }.bind(this), // callback function for success

marianfoo commented 4 months ago

If you want to show a success message to the user you can do it like that:

const success = {
  title: "All the records were uploaded successfully",
  group: false,
  ui5type: "Success"
};

image

marianfoo commented 4 months ago

does this help with your case?

mainakaich commented 4 months ago

Hello @marianfoo,

Thanks so much. This works now, I can close the issue. Just one question - what group : false means here? What is the purpose of group here.

marianfoo commented 4 months ago

It's for grouping the same error that occurs for several rows.
Generic messages like yours don't need grouping because there are not for a specific row.

marianfoo commented 4 months ago

Thanks for reporting your issues!