Openrefine: Pressing "Enter" in the project name field at the preview stage should create the project

Created on 28 Aug 2020  路  6Comments  路  Source: OpenRefine/OpenRefine

When previewing an importer's results, there is a text field to enter the project name. When pressing Enter in this field, I would expect the project to be created (without having to click the "Create Project" button).

image

UI enhancement good first issue

Most helpful comment

I can tell you my method to find it:

  • Identify a bit of text in this part of the UI that should identify it across the entire codebase. There are not that many places where we can create projects, so the "Create Project" text on the button looks like a good candidate.
  • Search for this string in the repository. I do this with grep but you can do it with all sorts of other tools (your IDE, for instance): grep -R "Create Project" .
  • In the results, I see: ./main/webapp/modules/core/langs/translation-en.json: "core-buttons/create-project": "Create Project »", - that is the string you see in the screenshot! Unfortunately it is not input directly in the relevant JS/HTML code, but in a translation file instead. That is not a problem: we can keep searching using the translation identifier core-buttons/create-project.
  • Therefore I run grep -R "core-buttons/create-project" ., and I find: ./main/webapp/modules/core/scripts/index/default-importing-controller/parsing-panel.js: this._parsingPanelElmts.nextButton.html($.i18n('core-buttons/create-project'));. That is the Javascript file we are looking for!
  • From there, you can just open the javascript file and you will also find the mention of the HTML template that is used for this part of the UI.

With this technique you should be able to find your way in quite a lot of code bases, not just OpenRefine's.

All 6 comments

Agree. The current Enter key binding to the Update Preview button is not needed... since all the options on importer are bound to the Update Preview already, I think? Instead, hitting Enter key for the Create Project flow makes more sense.

Hey. I would like to work on this issue. Can someone please give me an abstract idea of where I can find the code relating to this issue?

I can tell you my method to find it:

  • Identify a bit of text in this part of the UI that should identify it across the entire codebase. There are not that many places where we can create projects, so the "Create Project" text on the button looks like a good candidate.
  • Search for this string in the repository. I do this with grep but you can do it with all sorts of other tools (your IDE, for instance): grep -R "Create Project" .
  • In the results, I see: ./main/webapp/modules/core/langs/translation-en.json: "core-buttons/create-project": "Create Project »", - that is the string you see in the screenshot! Unfortunately it is not input directly in the relevant JS/HTML code, but in a translation file instead. That is not a problem: we can keep searching using the translation identifier core-buttons/create-project.
  • Therefore I run grep -R "core-buttons/create-project" ., and I find: ./main/webapp/modules/core/scripts/index/default-importing-controller/parsing-panel.js: this._parsingPanelElmts.nextButton.html($.i18n('core-buttons/create-project'));. That is the Javascript file we are looking for!
  • From there, you can just open the javascript file and you will also find the mention of the HTML template that is used for this part of the UI.

With this technique you should be able to find your way in quite a lot of code bases, not just OpenRefine's.

Oh this is so helpful and smart trick. Thank You for explaining in such details.
I will be solving this issue now.

hi @wetneb , I am working on this issue, can you please assign me?

Hi @wetneb , can you please review the PR linked ?

Was this page helpful?
0 / 5 - 0 ratings