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

Fixes #37228 - Replace Ansible/Roles page with React component #696

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

Conversation

Thorben-D
Copy link
Contributor

@Thorben-D Thorben-D commented Mar 6, 2024

Feature #37228

The new component acts as a drop-in replacement for the previously used erb-table.

This is required by #707

centos8-katello-devel-stable example com_ansible_ansible_roles_order=name+asc

@nofaralfasi nofaralfasi self-assigned this Mar 21, 2024
@Thorben-D Thorben-D force-pushed the feature/37228_ansible_roles_page_react branch from db8bddf to 21c7da7 Compare March 21, 2024 10:29
@sbernhard
Copy link
Contributor

What is blocking us from using this change? Possibly at the start of a new release cycle?

@nofaralfasi
Copy link
Contributor

What is blocking us from using this change? Possibly at the start of a new release cycle?

I'll review it ASAP.

@nofaralfasi
Copy link
Contributor

The functionality works well. However, the page is loading much slower than before. I’m wondering if it’s an issue on my side or if the new code is causing the app to load slower.

@Thorben-D
Copy link
Contributor Author

@nofaralfasi
Unfortunately, this is a side-effect of React rendering the component on the client-side. I am unsure when exactly react-rails renders components, but it feels pretty late (c.f. /new/hosts). Rendering server-side would help in this regard, but that does not work when window or document are used.

@sbernhard
Copy link
Contributor

Of course, the site load would be pretty fast but rendering the page takes longer as its done in the browser itself.
Should it have a spinner as this was done in Katello/Content-views for example?

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

In Foreman we have the TableIndexPage component which is intended for these index pages. Have you considered using that and if so, why was it insufficient?

Copy link
Member

@MariaAga MariaAga left a comment

Choose a reason for hiding this comment

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

+1 to Ewouds question, the js loading is slower between ruby and js, but faster between full React pages.
Can this be a full react page? it will need to be added in webpack/routes/routes.js, config/routes.rb

@@ -1,47 +1,19 @@
<%= webpacked_plugins_js_for :foreman_ansible %>
<%= webpacked_plugins_css_for :foreman_ansible %>
Copy link
Member

Choose a reason for hiding this comment

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

webpacked_plugins_css_for is deprecated, plugin css is already loaded.'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it would be best if #715 could be merged, so I can rebase this branch.

@Thorben-D
Copy link
Contributor Author

Thorben-D commented May 17, 2024

Sorry for the delay, I was occupied otherwise.
Thank you for your feedback. I would actually prefer a full React page as-well! I chose this approach to keep the changes as low-profile as possible, but I am happy to move it to a full page.
Regarding TableIndexPage, I'm afraid, I couldn't get it to work... Do you have an example where this was used outside of foreman? (The page not the hooks!)

@Thorben-D
Copy link
Contributor Author

Thanks, that's what I was looking for.
I checked out the component and the biggest issue I see with it is the way the action buttons are handled.
The old page allows the selection of a smart proxy to import roles from through a dropdown button.
While ActionButtons does provide a dropdown, it is toggled by a "kebab" toggle and not a component with text on it.

@Thorben-D
Copy link
Contributor Author

^^Nevermind, I just noticed the customToolbarItems prop...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants