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

Fix hiding tobira tab in series create modal #1122

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Arnei
Copy link
Member

@Arnei Arnei commented Feb 25, 2025

In the series create modal, we query ´/admin-ng/series/new/tobira/page` to check if Tobira is available. However, if the user does not have the role required for that endpoint (ROLE_UI_SERIES_DETAILS_TOBIRA_EDIT), the endpoint will return an error html page which we are not expecting, causing the ui to crash.
This fixes the problem by checking if the user has the required role to make the request to the endpoint. If the user does not have the role, the tobira tab is then not shown.

How to test this

Ideally test without but also with a configured Tobira, and with a user who has tobira roles and who does not have tobira roles.

In the series create modal, we query ´/admin-ng/series/new/tobira/page`
to check if Tobira is available. However, if the user does not have the
role required for that endpoint (ROLE_UI_SERIES_DETAILS_TOBIRA_EDIT),
the endpoint will return an error html page which we are not expecting,
causing the ui to crash.
This fixes the problem by checking if the user has the required role to
make the request to the endpoint. If the user does not have the role,
the tobira tab is then not shown.
@Arnei Arnei added the type:bug Something isn't working label Feb 25, 2025
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-1122

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-1122

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
Contributor

This pull request is deployed at test.admin-interface.opencast.org/1122/2025-02-25_15-34-35/ .
It might take a few minutes for it to become available.

Copy link
Contributor

@owi92 owi92 left a comment

Choose a reason for hiding this comment

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

Thank you. This works for the suggested test cases.

I wonder if we want or need to add a similar check to the series details modal, since that also allows editing and removing paths in Tobira (just tested, that is hidden anyway).
I think that should probably only hide the editing part though, and still show the direct link.

That might get a little tricky and doesn't need to be part of this PR, as that at least isn't causing any crashes.

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants