freeipa-webui icon indicating copy to clipboard operation
freeipa-webui copied to clipboard

[UI] Pass the adding method directly to the 'AddUser' component

Open carma12 opened this issue 1 year ago • 1 comments

The AddUser component receives the following props:

export interface PropsToAddUser {
  show: boolean;
  from: "active-users" | "stage-users" | "preserved-users";
  handleModalToggle: () => void;
}

But these props can be enhanced. For example, the from prop is used only when a specific user is about to be added. And, depending on that, a different 'add' function is used (addActiveUser, addStageUser, or addPreservedUser).

if (props.from === "active-users") {
  dispatch(addActiveUser(userData));
} else if (props.from === "stage-users") {
  dispatch(addStageUser(userData));
} else if (props.from === "preserved-users") {
  dispatch(addPreservedUser(userData));
}

RFE: Instead of passing the from string to determine which 'add' operation to take, it would be better to pass the 'add' function directly to the AddUser component.

carma12 avatar May 04 '23 09:05 carma12

This issue has not received any attention in 120 days.

github-actions[bot] avatar Dec 11 '23 12:12 github-actions[bot]