Skip to content

Conversation

priya-tik
Copy link
Contributor

This PR fixes an issue where tooltipParams were ignored when rendering the tooltip in BaseButton.
Previously, placeholders like {{filterName}} in translations were not being replaced even when tooltipParams was provided.

image
Copy link
Contributor

Use docker or podman to test this pull request locally.

Run test server using develop.opencast.org as backend:

podman run --rm -it -p 127.0.0.1:3000:3000 ghcr.io/opencast/opencast-admin-interface:pr-1402 

Specify a different backend like stable.opencast.org:

podman run --rm -it -p 127.0.0.1:3000:3000 -e PROXY_TARGET=https://stable.opencast.org ghcr.io/opencast/opencast-admin-interface:pr-1402 

It may take a few seconds for the interface to spin up.
It will then be available at http://127.0.0.1:3000.
For more options you can pass on to the proxy, take a look at the README.md.

Copy link
Member

@Arnei Arnei left a comment

Choose a reason for hiding this comment

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

Can confirm that this fixes the issue, thanks for that! Since the bug is already occurring in r/17.x, could you rebase your branch onto r/17.x and point the PR against it instead of develop? (Since very recently we now have the same versioning in the admin interface as we have in Opencast. r/17.x is the oldest and we forward merge our versions, so if it goes into r/17.x it will go into all versions.)

<Tooltip title={tooltipParams ? t(tooltipText) : t(tooltipText, tooltipParams)}>
{buttonComponent}
<Tooltip title={tooltipParams ? t(tooltipText, tooltipParams) : t(tooltipText)}>
{buttonComponent}
Copy link
Member

Choose a reason for hiding this comment

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

This looks like an accidental removal to me?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This wasn’t accidental. I updated the expression to tooltipParams ? t(tooltipText, tooltipParams) : t(tooltipText) because the previous version caused an error. The change ensures that tooltipParams are passed to t() only when they exist, otherwise it falls back to the plain translation string.

Copy link
Member

Choose a reason for hiding this comment

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

I see know that the line I marked did not all make clear what I wanted to refer to. I am very sorry for the confusion, of course updating the expression as you did makes perfect sense. I was only referring to the removal of the tab character ^^`.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok got it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
2 participants