Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import project without file attachment #2369

Closed
AghaSaad04 opened this issue Mar 8, 2020 · 15 comments · Fixed by #2979
Closed

Import project without file attachment #2369

AghaSaad04 opened this issue Mar 8, 2020 · 15 comments · Fixed by #2979
Labels
error handling Improving the ways errors are reported to users Type: Bug Issues related to software defects or unexpected behavior, which require resolution.
Milestone

Comments

@AghaSaad04
Copy link
Member

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 ]
@wetneb wetneb added Type: Bug Issues related to software defects or unexpected behavior, which require resolution. error handling Improving the ways errors are reported to users labels Mar 8, 2020
@thadguidry
Copy link
Member

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

@AghaSaad04
Copy link
Member Author

Sure @thadguidry, I will look into this

@chetan-v
Copy link
Contributor

chetan-v commented Jul 5, 2020

I want to do that

@thadguidry
Copy link
Member

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

@thadguidry thadguidry assigned thadguidry and chetan-v and unassigned thadguidry Jul 5, 2020
@chetan-v
Copy link
Contributor

chetan-v commented Jul 5, 2020

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

Yeah sure,if I need
Who will surely

@chetan-v
Copy link
Contributor

chetan-v commented Jul 6, 2020

Please give me some guidance @thadguidry @tfmorris

@chetan-v chetan-v removed their assignment Jul 7, 2020
@chetan-v
Copy link
Contributor

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

@wetneb
Copy link
Member

wetneb commented Jul 10, 2020

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

@chetan-v
Copy link
Contributor

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

@wetneb
Copy link
Member

wetneb commented Jul 10, 2020

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?

@chetan-v
Copy link
Contributor

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

@wetneb
Copy link
Member

wetneb commented Jul 10, 2020

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?

@chetan-v
Copy link
Contributor

In this file they check and give message

(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):-

public void doPost(HttpServletRequest request, HttpServletResponse response)

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

(respondWithErrorPage):-

static public void respondWithErrorPage(

@wetneb
Copy link
Member

wetneb commented Jul 10, 2020

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

this._elmts.nextButton.click(function(evt) {
if (self._elmts.fileInput[0].files.length === 0) {
window.alert($.i18n('core-index-import/warning-data-file'));

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

@wetneb
Copy link
Member

wetneb commented Jul 25, 2020

Closed by #2369.

@wetneb wetneb closed this as completed Jul 25, 2020
@wetneb wetneb added this to the 3.5 milestone Jul 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error handling Improving the ways errors are reported to users Type: Bug Issues related to software defects or unexpected behavior, which require resolution.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants