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

MIR-1409 Allow to customize badges/icons in search results #1084

Draft
wants to merge 3 commits into
base: 2023.06.x
Choose a base branch
from

Conversation

Possommi
Copy link
Contributor

@Possommi Possommi commented Nov 12, 2024

…on modules overwriting of (open) access icon
@Possommi Possommi requested a review from toKrause November 12, 2024 11:59
@Possommi Possommi changed the base branch from 2024.06.x to 2023.06.x November 12, 2024 12:00
@Possommi Possommi requested a review from kkrebs November 12, 2024 12:26
Copy link
Contributor

@toKrause toKrause left a comment

Choose a reason for hiding this comment

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

Ticket description is about making the icon configurable. If I understand this properly, someone who wishes to change the icon now has to override the new template file and recreate the whole content rendering the badges, coloring, title attribute and all, right?

I'm not sure that this is the right approach.

@Possommi
Copy link
Contributor Author

Ticket description is about making the icon configurable. If I understand this properly, someone who wishes to change the icon now has to override the new template file and recreate the whole content rendering the badges, coloring, title attribute and all, right?

I'm not sure that this is the right approach.

It it not about just the icon. In my application there are more states to consider, just on/off wordReadable it not enough. I do not want to fork the whole mir-response.xsl.

@toKrause
Copy link
Contributor

toKrause commented Nov 15, 2024

It it not about just the icon. In my application there are more states to consider, just on/off wordReadable it not enough. I do not want to fork the whole mir-response.xsl.

Please update the JIRA ticket description to better reflect the actual requirements.

That being said, I'm not sure that having a separate template for just one of the badges is a good approach. What if someone wants to customize another badge? Should every badge have its own stylesheet? Then, having the code that actually renders a badge copied into many stylesheets doesn't really seem to be a good idea. What about adding additional or removing existing badges? What about badges at different places like the landing pages of publications?

Imho, the badge system desperately requires a complete overhaul. I don't think, that the proposed changes move things in a fruitful direction.

Changes to the existing system should therefor, for now, be as small and targeted as possible.

If only the icons need to be configurable, I think, only the icons should be made configurable for now.

@Possommi
Copy link
Contributor Author

Possommi commented Nov 18, 2024

It it not about just the icon. In my application there are more states to consider, just on/off wordReadable it not enough. I do not want to fork the whole mir-response.xsl.

Please update the JIRA ticket description to better reflect the actual requirements.

That being said, I'm not sure that having a separate template for just one of the badges is a good approach. What if someone wants to customize another badge? Should every badge have its own stylesheet? Then, having the code that actually renders a badge copied into many stylesheets doesn't really seem to be a good idea. What about adding additional or removing existing badges? What about badges at different places like the landing pages of publications?

Imho, the badge system desperately requires a complete overhaul. I don't think, that the proposed changes move things in a fruitful direction.

Changes to the existing system should therefor, for now, be as small and targeted as possible.

If only the icons need to be configurable, I think, only the icons should be made configurable for now.

Updated the JIRA-Ticket. As I already mentioned, its not just the icon. At the moment the icon is rendered on just one solr field "worldReadableComplete". But in my application I check for other fields as well. I agree that subsequently every part of the hit rendering code should be customizable. But I do not like to do that now as I currently just need to evaluate other solr index data to display a proper icon. I really do not see any problem with providing an extra template/stylesheet rendering that part of the page.

The problem with MIR is that many stylesheets are huge af and there not much room for customization besides forking the whole stylesheet. The same goes for evaluating of access rights but that is another strory.

@toKrause
Copy link
Contributor

toKrause commented Nov 18, 2024

Code duplication and extremely specific features that cannot be reused are also problematic in MIR.

Maybe you could at least pull out the template for all existing badges into a separate stylesheet and split it into separate templates for the individual badges? That would allow to overwrite templates for individual badges using the xslInclude-mechanism.

Such a feature would at least be somewhat well-rounded.

@Possommi Possommi requested a review from toKrause November 25, 2024 10:06
@Possommi Possommi changed the title MIR-1409 Allow to customize icon indicating accessibility of publication MIR-1409 Allow to customize badges/icons in search results Nov 26, 2024
@Possommi Possommi changed the base branch from 2023.06.x to 2024.06.x December 2, 2024 11:34
@Possommi Possommi changed the base branch from 2024.06.x to 2023.06.x December 2, 2024 11:34
@golsch
Copy link
Member

golsch commented Dec 2, 2024

The basket should also be considered, or rather result and basket should use the same stylesheets. Currently the whole thing is inconsistent af. I am also working on this problem and have just seen the PR...

@toKrause
Copy link
Contributor

toKrause commented Dec 2, 2024

The badges shown in an object response page should also be harmonized with the badges in a search result page (and the basket listing). Also the use of tooltips, and mouseover effect like color changes and borders should be harmonized.

Also, the generated HTML should be the same, so that just on set of CSS rulles needs to be maintained.

Also, the selection and order of badges should be configurable.

All in all, there should be a much larger re-engineering of the whole badge mechanism. This is definitely on my list and I have some ideas, but so far I didn't have the time to do it. But, in the meantime, I think it is okay to allow a PR that just tinker around a bit, as long as the changes are somewhat useful.

In the now proposed solution, I don't like that the invocation of the templates for the various badges is hard coded in response-mirxsl`. The original proposal was a bit more flexible here, in that the whole badge rendering was moved to a separate stylesheet. I liked that better.

@toKrause toKrause marked this pull request as draft December 17, 2024 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants