Fixes #39516 - Wrap up content credential migration and cleanup angular#11797
Fixes #39516 - Wrap up content credential migration and cleanup angular#11797sjha4 wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (37)
💤 Files with no reviewable changes (26)
🚧 Files skipped from review as they are similar to previous changes (10)
📝 WalkthroughWalkthroughContent Credentials move from the labs URL namespace to React-backed routes. Legacy Angular controllers, views, tests, menu registration, and page registration are removed, while React navigation and deletion handling are updated. ChangesContent Credentials migration
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant ContentCredentialsDetails
participant Redux
participant ReactRouter
ContentCredentialsDetails->>Redux: dispatch deleteContentCredential
Redux->>ReactRouter: invoke navigation callback
ReactRouter->>ContentCredentialsDetails: navigate to /content_credentials
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
webpack/containers/Application/config.jsError: Cannot read config file: /webpack/.eslintrc.js webpack/scenes/ContentCredentials/ContentCredentialsPage.jsError: Cannot read config file: /webpack/.eslintrc.js webpack/scenes/ContentCredentials/Create/CreateContentCredentialForm.jsError: Cannot read config file: /webpack/.eslintrc.js
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
webpack/scenes/ContentCredentials/Details/ContentCredentialsDetails.js (1)
67-72: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRemove dead
isMountedRefcode.
isMountedRef(line 52) and its cleanupuseEffect(lines 63–65) are now dead code —isMountedRef.currentis no longer read after replacing the asyncapi.deletecall with the synchronousdispatch(deleteContentCredential(...)). TheuseRefimport would also become unused after removal.♻️ Proposed cleanup
- const isMountedRef = useRef(true); const dispatch = useDispatch();- useEffect(() => () => { - isMountedRef.current = false; - }, []); - const handleDelete = () => {🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@webpack/scenes/ContentCredentials/Details/ContentCredentialsDetails.js` around lines 67 - 72, Remove the unused isMountedRef declaration and its cleanup useEffect from ContentCredentialsDetails, then remove the useRef import if it is no longer referenced. Keep handleDelete’s synchronous dispatch and navigation behavior unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@webpack/scenes/ContentCredentials/Details/ContentCredentialsDetails.js`:
- Around line 67-72: Remove the unused isMountedRef declaration and its cleanup
useEffect from ContentCredentialsDetails, then remove the useRef import if it is
no longer referenced. Keep handleDelete’s synchronous dispatch and navigation
behavior unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 5f4aaf79-6177-4d30-a616-a2e6bbfaf42b
📒 Files selected for processing (35)
config/routes.rbengines/bastion_katello/app/assets/javascripts/bastion_katello/bastion_katello.jsengines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/content-credentials.controller.jsengines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/content-credentials.routes.jsengines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/content-type.filter.jsengines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-acs.controller.jsengines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-details-info.controller.jsengines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-details.controller.jsengines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-products.controller.jsengines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-repositories.controller.jsengines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/views/content-credential-acs.htmlengines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/views/content-credential-details.htmlengines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/views/content-credential-info.htmlengines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/views/content-credential-products.htmlengines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/views/content-credential-repositories.htmlengines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/new/new-content-credential.controller.jsengines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/new/views/new-content-credential.htmlengines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/views/content-credentials.htmlengines/bastion_katello/lib/bastion_katello/engine.rbengines/bastion_katello/test/content-credentials/content-credentials.factory.test.jsengines/bastion_katello/test/content-credentials/details/content-credential-acs.controller.test.jsengines/bastion_katello/test/content-credentials/details/content-credential-details-info.controller.test.jsengines/bastion_katello/test/content-credentials/details/content-credential-details.controller.test.jsengines/bastion_katello/test/content-credentials/details/content-credential-products.controller.test.jsengines/bastion_katello/test/content-credentials/details/content-credential-repositorires.controller.test.jsengines/bastion_katello/test/content-credentials/new/new-content-credential-controller.test.jslib/katello/plugin.rbwebpack/containers/Application/config.jswebpack/scenes/ContentCredentials/ContentCredentialsPage.jswebpack/scenes/ContentCredentials/Create/CreateContentCredentialForm.jswebpack/scenes/ContentCredentials/Create/__tests__/CreateContentCredentialModal.test.jswebpack/scenes/ContentCredentials/Delete/DeleteContentCredentialModal.jswebpack/scenes/ContentCredentials/Delete/__tests__/DeleteContentCredentialModal.test.jswebpack/scenes/ContentCredentials/Details/ContentCredentialsDetails.jswebpack/scenes/ContentCredentials/Details/__tests__/ContentCredentialsDetails.test.js
💤 Files with no reviewable changes (25)
- engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/views/content-credential-repositories.html
- engines/bastion_katello/test/content-credentials/details/content-credential-details-info.controller.test.js
- engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/views/content-credential-details.html
- engines/bastion_katello/test/content-credentials/content-credentials.factory.test.js
- engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/views/content-credentials.html
- engines/bastion_katello/test/content-credentials/details/content-credential-products.controller.test.js
- engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/content-credentials.controller.js
- engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-details-info.controller.js
- engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/views/content-credential-info.html
- engines/bastion_katello/test/content-credentials/details/content-credential-details.controller.test.js
- engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/new/views/new-content-credential.html
- engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/views/content-credential-products.html
- engines/bastion_katello/lib/bastion_katello/engine.rb
- engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-products.controller.js
- engines/bastion_katello/test/content-credentials/details/content-credential-repositorires.controller.test.js
- engines/bastion_katello/test/content-credentials/new/new-content-credential-controller.test.js
- engines/bastion_katello/test/content-credentials/details/content-credential-acs.controller.test.js
- engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/views/content-credential-acs.html
- engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/new/new-content-credential.controller.js
- engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/content-credentials.routes.js
- engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-details.controller.js
- lib/katello/plugin.rb
- engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-repositories.controller.js
- engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/content-type.filter.js
- engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-acs.controller.js
ianballou
left a comment
There was a problem hiding this comment.
I'm seeing some old CC page references in https://github.com/katello/katello/blob/2915610b4cd8edb8f0a62e89f6a53aef65fe58d1/engines/bastion_katello/app/assets/javascripts/bastion_katello/katello-features.run.js
Working well! The new page is loaded up.
What do you think about fixing the create button in this PR?
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
webpack/scenes/ContentCredentials/Details/__tests__/ContentCredentialsDetails.test.js (1)
230-261: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winThe failure test asserts modal closure that the component does not perform.
On delete failure,
handleDeleteonly provides a success callback; the modal remains open because itsdeletingstate is not reset. Restore the failure-toast assertion, or add an explicit failure callback that closes the modal before asserting dismissal.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@webpack/scenes/ContentCredentials/Details/__tests__/ContentCredentialsDetails.test.js` around lines 230 - 261, Update the “closes modal when delete fails” test and the associated handleDelete flow in ContentCredentialsDetails to match the intended failure behavior: either restore the failure-toast assertion without expecting dismissal, or add an explicit failure callback that resets deleting state and closes the modal before asserting it is gone. Keep the delete-failure response and existing success behavior intact.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In
`@webpack/scenes/ContentCredentials/Details/__tests__/ContentCredentialsDetails.test.js`:
- Around line 230-261: Update the “closes modal when delete fails” test and the
associated handleDelete flow in ContentCredentialsDetails to match the intended
failure behavior: either restore the failure-toast assertion without expecting
dismissal, or add an explicit failure callback that resets deleting state and
closes the modal before asserting it is gone. Keep the delete-failure response
and existing success behavior intact.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 8be49fa3-5744-48d6-b0e6-842896bbf059
📒 Files selected for processing (35)
config/routes.rbengines/bastion_katello/app/assets/javascripts/bastion_katello/bastion_katello.jsengines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/content-credentials.controller.jsengines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/content-credentials.routes.jsengines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/content-type.filter.jsengines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-acs.controller.jsengines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-details-info.controller.jsengines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-details.controller.jsengines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-products.controller.jsengines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-repositories.controller.jsengines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/views/content-credential-acs.htmlengines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/views/content-credential-details.htmlengines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/views/content-credential-info.htmlengines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/views/content-credential-products.htmlengines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/views/content-credential-repositories.htmlengines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/new/new-content-credential.controller.jsengines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/new/views/new-content-credential.htmlengines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/views/content-credentials.htmlengines/bastion_katello/lib/bastion_katello/engine.rbengines/bastion_katello/test/content-credentials/content-credentials.factory.test.jsengines/bastion_katello/test/content-credentials/details/content-credential-acs.controller.test.jsengines/bastion_katello/test/content-credentials/details/content-credential-details-info.controller.test.jsengines/bastion_katello/test/content-credentials/details/content-credential-details.controller.test.jsengines/bastion_katello/test/content-credentials/details/content-credential-products.controller.test.jsengines/bastion_katello/test/content-credentials/details/content-credential-repositorires.controller.test.jsengines/bastion_katello/test/content-credentials/new/new-content-credential-controller.test.jslib/katello/plugin.rbwebpack/containers/Application/config.jswebpack/scenes/ContentCredentials/ContentCredentialsPage.jswebpack/scenes/ContentCredentials/Create/CreateContentCredentialForm.jswebpack/scenes/ContentCredentials/Create/__tests__/CreateContentCredentialModal.test.jswebpack/scenes/ContentCredentials/Delete/DeleteContentCredentialModal.jswebpack/scenes/ContentCredentials/Delete/__tests__/DeleteContentCredentialModal.test.jswebpack/scenes/ContentCredentials/Details/ContentCredentialsDetails.jswebpack/scenes/ContentCredentials/Details/__tests__/ContentCredentialsDetails.test.js
💤 Files with no reviewable changes (25)
- engines/bastion_katello/test/content-credentials/content-credentials.factory.test.js
- engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/new/new-content-credential.controller.js
- engines/bastion_katello/test/content-credentials/details/content-credential-repositorires.controller.test.js
- engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/views/content-credential-repositories.html
- engines/bastion_katello/test/content-credentials/details/content-credential-details-info.controller.test.js
- engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-details-info.controller.js
- engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/content-type.filter.js
- engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-products.controller.js
- engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/views/content-credentials.html
- engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-details.controller.js
- engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/new/views/new-content-credential.html
- engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/views/content-credential-details.html
- engines/bastion_katello/lib/bastion_katello/engine.rb
- engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/views/content-credential-acs.html
- engines/bastion_katello/test/content-credentials/new/new-content-credential-controller.test.js
- engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/content-credentials.controller.js
- engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-repositories.controller.js
- engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/views/content-credential-info.html
- engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/content-credentials.routes.js
- engines/bastion_katello/test/content-credentials/details/content-credential-products.controller.test.js
- lib/katello/plugin.rb
- engines/bastion_katello/test/content-credentials/details/content-credential-details.controller.test.js
- engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/views/content-credential-products.html
- engines/bastion_katello/test/content-credentials/details/content-credential-acs.controller.test.js
- engines/bastion_katello/app/assets/javascripts/bastion_katello/content-credentials/details/content-credential-acs.controller.js
🚧 Files skipped from review as they are similar to previous changes (8)
- config/routes.rb
- webpack/containers/Application/config.js
- webpack/scenes/ContentCredentials/Create/CreateContentCredentialForm.js
- webpack/scenes/ContentCredentials/Create/tests/CreateContentCredentialModal.test.js
- webpack/scenes/ContentCredentials/Delete/tests/DeleteContentCredentialModal.test.js
- webpack/scenes/ContentCredentials/Delete/DeleteContentCredentialModal.js
- webpack/scenes/ContentCredentials/ContentCredentialsPage.js
- webpack/scenes/ContentCredentials/Details/ContentCredentialsDetails.js

What are the changes introduced in this pull request?
Considerations taken when implementing this change?
Can not delete Content credential factory yet since it is used in Product and repository pages.
Reviewed the current state of Content Credentials to make sure everything is proper and all new pages are feature complete so menu can be safely redirect to new page.
What are the testing steps for this pull request?
Navigate to Content> Content Credentials
Make sure you can see the table as well as perform all actions on the page + details page.
Summary by CodeRabbit
/content_credentials, including matching detail pages and a non-labs/URL scheme across navigation./content_credentialsafter successful actions.labs/-prefixed UI is no longer exposed.