Openrefine: Import project without file attachment

Created on 8 Mar 2020  路  15Comments  路  Source: OpenRefine/OpenRefine

Describe the bug
Try to import the project without a file attachment and the error will be shown.
To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Import project'
  2. Click on the 'import project button' without a file attachment.
  3. See error

If you attach a wrong file/file format and try to proceed you will see the same error.

Current Results
image

Expected behavior

There should be an alert and I should not be allowed to proceed without a file attachment
Similar to this :
image

Desktop (please complete the following information):

  • OS: [Linux, Ubuntu 18.04]
  • Browser Version: [Chrome Version 80.0.3987.132 (Official Build) (64-bit)]
  • JRE or JDK Version:[openjdk version "11.0.6" ]

OpenRefine (please complete the following information):

  • Version [OpenRefine Version 3.4-SNAPSHOT ]
bug error handling

All 15 comments

@AghaSaad04 Looking forward to your fix on this! :-) You can do it!

Sure @thadguidry, I will look into this

I want to do that

@chetan-v Great Chetan! Let us know if you need help.

@chetan-v Great Chetan! Let us know if you need help.

Yeah sure,if I need
Who will surely

Please give me some guidance @thadguidry @tfmorris

Please give some hint I read alot about this.
I tried but I failed to redirect

What is the specific problem you need help about? How are you planning to solve this problem and where exactly are you stuck?

Actually I just want to give a alert message when we do not choose any file and click import project button

Great! These are the steps you will need to follow to solve this issue:
https://github.com/OpenRefine/OpenRefine/wiki/Your-first-pull-request
At which of these stages are you stuck?

I am unable to find the root file in which I should change.
In (create project menu) has their JS file that check the condition and give alert
but in JS file of (import project menu) not have that condition to check and give alert.

I am confused about the type of Changes in Java or in JavaScript

This will be solved in the frontend, so Javascript. You are on the right track: imitating in the import project menu the check that is done in the create project menu sounds like a great approach! Can you give me a link to these two Javascript files?

In this file they check and give message

https://github.com/OpenRefine/OpenRefine/blob/306b541c699e7e87d5e08be1310575b85b15dbf0/main/webapp/modules/core/scripts/index/default-importing-sources/sources.js#L60

(main/webapp/modules/core/scripts/index/import-project-ui.js) I think they do their work perfectly

they only give data on screen they both are different to each other which is not a problem in (import project menu) all work is done by its backend. (ImportProjectCommand.java)
they contains
(doPost):-

https://github.com/OpenRefine/OpenRefine/blob/306b541c699e7e87d5e08be1310575b85b15dbf0/main/src/com/google/refine/commands/project/ImportProjectCommand.java#L64

function that give information or whatever to (respondWithErrorPage) and they dont contain the certain condition. I think the condition should be their.

(respondWithErrorPage):-

https://github.com/OpenRefine/OpenRefine/blob/306b541c699e7e87d5e08be1310575b85b15dbf0/main/src/com/google/refine/commands/HttpUtilities.java#L146

Checking for the presence of a file and alerting the user must be done before sending anything to the backend, so you should ignore all Java files for this issue. You are right that the check you should imitate is at
https://github.com/OpenRefine/OpenRefine/blob/306b541c699e7e87d5e08be1310575b85b15dbf0/main/webapp/modules/core/scripts/index/default-importing-sources/sources.js#L60-L62

How about just doing something similar in the JS file for the "import project" pane?

Closed by #2369.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kushthedude picture kushthedude  路  3Comments

wetneb picture wetneb  路  3Comments

ettorerizza picture ettorerizza  路  4Comments

lapoisse picture lapoisse  路  3Comments

dantexier picture dantexier  路  4Comments