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

Adds the service logo to column header and while schema building #6156

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

ayushrai206
Copy link
Member

Fixes #4824

Changes proposed in this pull request:

  • The last pull request had some unsolved problems so I created this one that does the job.
  • I am not deleting the last pull request because it has some discussions going on.

@github-actions github-actions bot added the reconciliation API design when changing the reconciliation API is required to improve a workflow label Nov 14, 2023
Copy link
Sponsor Member

@wetneb wetneb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep discussing the security aspects in the original PR (#6152), but I noticed that the formatting has got worse in this PR.

@wetneb
Copy link
Sponsor Member

wetneb commented Nov 15, 2023

The failing test looks unrelated to this PR, so I have opened an issue about it: #6158

Copy link
Sponsor Member

@wetneb wetneb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned in #6152, we need to validate the image URL by checking that passing it to new URL(…) does not raise an exception.

extensions/wikibase/module/scripts/schema-alignment.js Outdated Show resolved Hide resolved
extensions/wikibase/module/scripts/schema-alignment.js Outdated Show resolved Hide resolved
}
}
catch {
console.log("The URL is not valid");
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those logging statements could be more useful with a more explicit error message. When you are looking at the code here, it is clear that this logging statement refers to a recon service URL, but imagine what happens when just seeing this message in the console, in the middle of other unrelated statements: the current error message does not give a lot of information, as we have no idea which URL is referred to.

Once the try { } catch { } block is part of the new function suggested above, this logging statement will be about the validity of the logo URL, hence we could instead have something like console.warn("Invalid logo URL supplied by service "+serviceUrl) or something like that.

Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like this problem is still there, no? Or do you see it resolved in another way?

@wetneb wetneb self-assigned this Dec 18, 2023
@wetneb wetneb removed their assignment Feb 13, 2024
@wetneb
Copy link
Sponsor Member

wetneb commented Feb 28, 2024

@ayushrai206 if I remember correctly this PR isn't ready for merging yet, right? Or are you waiting for a review?

@ayushrai206
Copy link
Member Author

@ayushrai206 if I remember correctly this PR isn't ready for merging yet, right? Or are you waiting for a review?

Can you please review this one?

@wetneb wetneb self-assigned this Feb 29, 2024
Copy link
Sponsor Member

@wetneb wetneb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried it out like this:

  • Reconcile a column to the test recon service
  • The logo appears in the column header - amazing!
  • In the Wikibase extension, start a new Wikidata schema
  • The initialization of that UI does not complete - less amazing :-D

The console shows:

The URL is not valid 53 project-bundle.js:46590:13
Invalid logo URL supplied by service null 2 project-bundle.js:56864:13
Uncaught ReferenceError: serviceLogo is not defined
    _createDraggableColumn http://127.0.0.1:3333/project-bundle.js:57275
    updateColumns http://127.0.0.1:3333/project-bundle.js:57082
    _rerenderTabs http://127.0.0.1:3333/project-bundle.js:57023
    setUpTabs http://127.0.0.1:3333/project-bundle.js:56938
    launch http://127.0.0.1:3333/project-bundle.js:57157
    click http://127.0.0.1:3333/project-bundle.js:55972
    createMenuItem http://127.0.0.1:3333/project-bundle.js:38411
    dispatch http://127.0.0.1:3333/project-bundle.js:5147
    handle http://127.0.0.1:3333/project-bundle.js:4951

input.hide();
input.val("");
var columnDiv = $('<div></div>').appendTo(inputContainer);
column.appendTo(columnDiv);
//columnDiv.append(img);
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commented out code can probably be removed, no?

var cell = $("<div></div>").addClass('wbs-draggable-column').text(name);
if(logo) {
var img =$("<img>");
if(serviceLogo) {
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This if block is probably redundant with the outer one, and seems to refer to an undeclared variable.

}
}
catch {
console.log("The URL is not valid");
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like this problem is still there, no? Or do you see it resolved in another way?

@wetneb wetneb removed their assignment Mar 3, 2024
@wetneb
Copy link
Sponsor Member

wetneb commented Apr 2, 2024

@ayushrai206 are you still working on this? I think we are really super close to something mergeable here. The three problems above should be fairly easy to solve :)

@ayushrai206
Copy link
Member Author

ayushrai206 commented Apr 2, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reconciliation API design when changing the reconciliation API is required to improve a workflow
Development

Successfully merging this pull request may close these issues.

Better display of which reconciliation service a specific column is reconciled against
2 participants