Skip to content

Conversation

@EnsiyehE
Copy link
Contributor

@EnsiyehE EnsiyehE commented Sep 5, 2025

Hello all,

I have achieved to fix the missing current chosen value access policy role to the drop down options , but due to fix size and some other issues i have not been able to change the focus to the current selected value , so this PR only solves part of the the issue mentioned in #1405

please review and let me know about my issues

thank you for your time
best regards
Ensiyeh

@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2025

Hi @EnsiyehE
Thank you for contributing to the Opencast Admin UI.
We noticed that you have not yet filed an Individual Contributor License Agreement. Doing that (once) helps us to ensure that Opencast stays free for all. If you make your contribution on behalf of an institution, you might also want to file a Corporate Contributor License Agreement (giving you as individual contributor a bit more security as well). It can take a while for this bot to find out about new filings, so if you just filed one or both of the above do not worry about this message!
Please let us know if you have any questions regarding the CLA.

@EnsiyehE EnsiyehE changed the title fix the missing current chosen value inside the role drop down fix the missing current chosen value inside the Access- policy -role drop down Sep 5, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2025

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

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

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.

@pascalseeland pascalseeland added the type:bug Something isn't working label Sep 9, 2025
@github-actions
Copy link
Contributor

This pull request has conflicts ☹
Please resolve those so we can review the pull request.
Thanks.

@github-actions
Copy link
Contributor

This pull request has conflicts ☹
Please resolve those so we can review the pull request.
Thanks.

@gregorydlogan
Copy link
Member

Either this isn't working for me, or I'm completely missing what changed.

@EnsiyehE
Copy link
Contributor Author

Hello Greg,

To explain briefly: if you go to the Series tab, then open Series Details and the Access Policy tab, each dropdown previously did not include the currently chosen value from the input field among its options. I have now fixed that part. However, in the original issue, it was also requested that the dropdown should focus on that selected value, which I believe by default always focuses on the first option and i could only reach to bring back the previously chosen value inside the options

Thank you for the feedback

bests
Ensiyeh

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.

Selected roles now appear in the dropdown of their select field, as such this PR achieves what it intends to do.

This breaks the "Users" and "Roles" split in the ACL tab that is active when user role sanitization is disabled. It should not break that.


// @ts-expect-error: React-Select typing does not account for the typing of option it itself requires
components: { MenuList },
filterOption: createFilter({ ignoreAccents: false }), // To improve performance on filtering
Copy link
Member

Choose a reason for hiding this comment

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

I'm curious, did you test if this actually performance on filtering and if so, by how much?

Comment on lines +216 to +222
isOptionSelected: (option, _selectValue) => {
const typedOption = option as DropDownOption;
if (isAclDropDown) {
return false;
}
return typedOption.value === value;
},
Copy link
Member

Choose a reason for hiding this comment

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

So from what I understand, what this does is that if the Dropdown is defined as an AclDropdown, there is never an option selected. I don't understand why we wouldwant that, what is this supposed to achieve?

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.

4 participants