-
Notifications
You must be signed in to change notification settings - Fork 21
Replace KeytabTable with KeytabTableWithFilter #809
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there - I've reviewed your changes - here's some feedback:
- The repeated transformation of host prop values into table entries (usersList, userGroupsList, etc.) could be memoized or abstracted into a custom hook to avoid unnecessary recomputation on each render.
- The addEntries and removeEntries callbacks share nearly identical logic—consider refactoring them into a shared helper or hook to reduce duplication and improve readability.
- Moving static constants like allowMethod, disallowMethod, and the toTableEntries function outside the component body would prevent them from being recreated on every render.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The repeated transformation of host prop values into table entries (usersList, userGroupsList, etc.) could be memoized or abstracted into a custom hook to avoid unnecessary recomputation on each render.
- The addEntries and removeEntries callbacks share nearly identical logic—consider refactoring them into a shared helper or hook to reduce duplication and improve readability.
- Moving static constants like allowMethod, disallowMethod, and the toTableEntries function outside the component body would prevent them from being recreated on every render.
## Individual Comments
### Comment 1
<location> `src/components/HostsSections/AllowedCreateKeytab.tsx:23` </location>
<code_context>
const AllowedCreateKeytab = (props: PropsToAllowCreateKeytab) => {
const [activeTabKey, setActiveTabKey] = React.useState<string | number>(0);
+ const [modalSpinning, setModalSpinning] = React.useState<boolean>(false);
+ const [executeUpdate] = useUpdateKeyTabMutation({});
+
</code_context>
<issue_to_address>
Consider handling errors in async RPC calls to avoid silent failures.
addEntries and removeEntries only reset the spinner and refresh on success, but do not handle errors from executeUpdate. If the RPC call fails, the spinner may remain active and the user will not be notified. Please add error handling to reset the spinner and inform the user of failures.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
13588e3 to
9c41068
Compare
duzda
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, apart from the notes, I'd add Refs: #763 to the commit message.
3e8a98d to
7979450
Compare
duzda
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
f9b2946 to
e4decf3
Compare
The goal is to replace all KeytabTables with KeytabTableWithFilter Refs: freeipa#763 Signed-off-by: Veronika Miticka <[email protected]>
e4decf3 to
3cff2c5
Compare
|
Bug introduced: adding host, it shouldnt who server.ipa.demo in the modal. Waiting for integration tests with this pr |
|
This PR has not received any attention in 60 days. |
|
Removed the |
|
This PR has not received any attention in 60 days. |

The goal is to replace all KeytabTables with KeytabTableWithFilter
Refs: #763
Summary by Sourcery
Replace the legacy KeytabTable with the new KeytabTableWithFilter in the AllowedCreateKeytab component, wiring up filtered entry lists and RPC mutations with loading state for add/remove operations
Enhancements: