Reduce duplicate code - button like anchor#1063
Conversation
|
Use Run test server using develop.opencast.org as backend: Specify a different backend like stable.opencast.org: It may take a few seconds for the interface to spin up. |
|
This pull request is deployed at test.admin-interface.opencast.org/1063/2025-03-20_10-33-11/ . |
|
This pull request has conflicts ☹ |
We have many buttons using the "button-like-anchor" class. This patch introduces a button component for these buttons, with built-in tooltip and access check to better support common code combinations for those buttons. In and of itself not a particularly impressive component, but the underlying goal here is to push the app more towards using common basic components.
5bb6f34 to
844dd74
Compare
|
This pull request has conflicts ☹ |
|
This pull request has conflicts ☹ |
|
This pull request has conflicts ☹ |
|
This pull request has conflicts ☹ |
|
This pull request has conflicts ☹ |
|
This pull request has conflicts ☹ |
|
This pull request has conflicts ☹ |
Due to updating React we now need an explicit import.
ferishili
left a comment
There was a problem hiding this comment.
Thanks @Arnei
I have provided some inline suggestions, which could be replaced easily!
However, in some places I could still find the old button-like-anchor like:
- https://github.com/opencast/opencast-admin-interface/blob/c0b6d17f667adf8314c894ffa87dbf7b448490c3/src/components/shared/IconButton.tsx#L31 This could be totally replaced, right?
- https://github.com/opencast/opencast-admin-interface/blob/c0b6d17f667adf8314c894ffa87dbf7b448490c3/src/components/shared/modals/DetailsModal.tsx#L37
- https://github.com/opencast/opencast-admin-interface/blob/c0b6d17f667adf8314c894ffa87dbf7b448490c3/src/components/shared/modals/Modal.tsx#L73
Co-authored-by: FarbodZamani <53179227+ferishili@users.noreply.github.com>
Co-authored-by: FarbodZamani <53179227+ferishili@users.noreply.github.com>
Co-authored-by: FarbodZamani <53179227+ferishili@users.noreply.github.com>
Co-authored-by: FarbodZamani <53179227+ferishili@users.noreply.github.com>
Co-authored-by: FarbodZamani <53179227+ferishili@users.noreply.github.com>
Co-authored-by: FarbodZamani <53179227+ferishili@users.noreply.github.com>
Co-authored-by: FarbodZamani <53179227+ferishili@users.noreply.github.com>
Co-authored-by: FarbodZamani <53179227+ferishili@users.noreply.github.com>
Two more instances were we can replace raw button tags with buttonlikenachor.
|
Thanks for reviewing! Added your suggestions. The only thing I did not change was the occurence of |
|
This pull request has conflicts ☹ |
|
This pull request has conflicts ☹ |
We have many buttons using the "button-like-anchor" class. This patch introduces a button component for these buttons, with built-in tooltip and access check to better support common code combinations for those buttons. In and of itself not a particularly impressive component, but the underlying goal here is to push the app more towards using common basic components.
How to test this
Can be tested as usual.