-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Extract view/link URL for reconciled cells #1457 #5960
Extract view/link URL for reconciled cells #1457 #5960
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really great work, congratulations!
We will likely need to improve the GREL expression a little so that it works in all cases.
For Wikidata, the identifiers of entities are of the form Q3498
, so they can be directly inserted in the template and that gives a valid URL.
But some reconciliation services might use identifiers which include some characters which need to be escaped to make sure we get a valid URL.
The specification has a note about this:
To guarantee the correctness of the formed URI, clients MUST percent-encode component-delimiting reserved characters in the identifier, i.e. encode it as a URI component [RFC3986].
So we need to find a GREL function which can be used to do this encoding and then insert it at the right place in the expression to get the desired result.
main/webapp/modules/core/scripts/views/data-table/menu-reconcile.js
Outdated
Show resolved
Hide resolved
main/webapp/modules/core/scripts/views/data-table/menu-reconcile.js
Outdated
Show resolved
Hide resolved
main/webapp/modules/core/scripts/views/data-table/menu-reconcile.js
Outdated
Show resolved
Hide resolved
Your last commit 55010a6 is likely unintentional, no? The |
yes that was by mistake! |
55010a6
to
beacab1
Compare
Congratulations @ayushrai206, it's looking great. However it looks like you have added some files by mistake (see the "Files changed" tab of this PR). |
16f2988
to
9fa8bc1
Compare
...ess/e2e/project/grid/column/reconcile/actions/Add column_with_URLs_of_matched_entities.cy.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can now do some style polishing, see the comments below.
Also, the file Add column_with_URLs_of_matched_entities.cy.js
could be renamed to add_column_with_URLs_of_matched_entities.cy.js
(to avoid having a space in its filename, and to follow the naming convention of other files in that directory).
...ess/e2e/project/grid/column/reconcile/actions/Add column_with_URLs_of_matched_entities.cy.js
Outdated
Show resolved
Hide resolved
...ess/e2e/project/grid/column/reconcile/actions/Add column_with_URLs_of_matched_entities.cy.js
Outdated
Show resolved
Hide resolved
main/webapp/modules/core/scripts/views/data-table/menu-reconcile.js
Outdated
Show resolved
Hide resolved
main/webapp/modules/core/scripts/views/data-table/menu-reconcile.js
Outdated
Show resolved
Hide resolved
main/webapp/modules/core/scripts/views/data-table/menu-reconcile.js
Outdated
Show resolved
Hide resolved
main/webapp/modules/core/scripts/views/data-table/menu-reconcile.js
Outdated
Show resolved
Hide resolved
cc8e61d
to
a2b5419
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there! Just a couple of nitpicks about code style.
main/webapp/modules/core/scripts/views/data-table/menu-reconcile.js
Outdated
Show resolved
Hide resolved
...ess/e2e/project/grid/column/reconcile/actions/Add column_with_URLs_of_matched_entities.cy.js
Outdated
Show resolved
Hide resolved
main/webapp/modules/core/scripts/views/data-table/menu-reconcile.js
Outdated
Show resolved
Hide resolved
main/webapp/modules/core/scripts/views/data-table/menu-reconcile.js
Outdated
Show resolved
Hide resolved
main/webapp/modules/core/scripts/views/data-table/menu-reconcile.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good start! It looks like there are some issues with the overall structure of your code though.
main/webapp/modules/core/scripts/views/data-table/menu-reconcile.js
Outdated
Show resolved
Hide resolved
main/webapp/modules/core/scripts/views/data-table/menu-reconcile.js
Outdated
Show resolved
Hide resolved
main/webapp/modules/core/scripts/views/data-table/menu-reconcile.js
Outdated
Show resolved
Hide resolved
88c109d
to
b0b4c4d
Compare
…mmented out temporarily as they need few more changes to pass
Hey everyone, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Congratulations, it seems to work great!
It is a little difficult to review your code because you did not add any indentation. Could you indent it like the surrounding code, by using two spaces as indentation unit?
Also, the purpose of introducing this promptForColumn
was to avoid the duplication of code with the "Add entity identifiers column" operation. So we should make sure that operation also switches to using this new function you introduced. You might need to add another parameter to make it possible to set the title of the dialog (since the current dialog title mentions URLs, which will not be appropriate for the other operation).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, that's much better! It seems that by doing this refactoring you have changed the title of the dialog of the existing operation. Restoring the original title should help to get the Cypress test pass again. I would do that by adding a new argument to the promptForColumn
function, which would be the title to display in the dialog. This way, you would still be able to use the same promptForColumn
function in both operations, but display different titles to the user. This would let you keep the original dialog title for the existing operation and use an appropriate title (mentioning URLs) for the new operation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, the Cypress tests pass! Now perhaps you could re-enable the Cypress test for the new operation and we should be good to go :) I think the indentation can be improved still but I'm happy to do that at the end.
"add-column", | ||
{ | ||
baseColumnName: column.name, | ||
newColumnName: columnName, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indentation can still be improved here. You can look for other calls to Refine.postCoreProcess
for inspiration :)
Co-authored-by: Antonin Delpeuch <antonin@delpeuch.eu>
Co-authored-by: Antonin Delpeuch <antonin@delpeuch.eu>
Fixing the indentation of Refine.postCoreProcess
Changing the dialog name in the cypress tests
FIxes minor mistake in the cypress tests
Fixes the Cypress tests
Fixes #1457
Changes proposed in this pull request: