-
Notifications
You must be signed in to change notification settings - Fork 659
CONSOLE-4683: Refactor group action factory #15404
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
Conversation
@jhadvig: This pull request references CONSOLE-4683 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.20.0" version, but no target version was set. In response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
/retest |
09cc65e
to
fc868d3
Compare
frontend/public/components/group.tsx
Outdated
|
||
return ( | ||
<DetailsPage | ||
{...props} | ||
kind={referenceForModel(GroupModel)} | ||
menuActions={[getImpersonateAction(startImpersonate, navigate), ...menuActions]} | ||
customActionMenu={customActionMenu} |
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.
This works perfectly fine, but we have just started applying different pattern here:
customActionMenu={customActionMenu} | |
customActionMenu={(obj: K8sResourceKind) => ( | |
<LazyActionMenu context={{ [referenceForModel(GroupModel)]: obj }} /> | |
)} |
you gotta update i18n @jhadvig |
frontend/public/components/group.tsx
Outdated
}; | ||
|
||
const menuActions = [addUsers, ...Kebab.factory.common]; | ||
// i18next removed; using useTranslation() |
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.
couple of undeleted comments?
cbfdac2
to
0dab15e
Compare
frontend/packages/console-app/src/actions/hooks/useGroupActions.ts
Outdated
Show resolved
Hide resolved
frontend/packages/console-app/src/actions/hooks/useGroupActions.ts
Outdated
Show resolved
Hide resolved
frontend/packages/console-app/src/actions/hooks/useGroupActions.ts
Outdated
Show resolved
Hide resolved
frontend/packages/console-app/src/actions/hooks/useGroupActions.ts
Outdated
Show resolved
Hide resolved
frontend/packages/console-app/src/components/modals/add-group-users-modal.tsx
Outdated
Show resolved
Hide resolved
frontend/packages/console-app/src/components/modals/add-group-users-modal.tsx
Outdated
Show resolved
Hide resolved
frontend/public/components/group.tsx
Outdated
onConfirm: () => { | ||
const value = (group.users || []).filter((u: string) => u !== user); | ||
return k8sPatchResource({ | ||
model: (GroupModel as unknown) as any, |
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.
model: (GroupModel as unknown) as any, | |
model: GroupModel, |
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.
just couple of minor nits, otherwise this is in a good shape.
const startImpersonate = React.useCallback( | ||
(kind: string, name: string) => dispatch(UIActions.startImpersonate(kind, name)), | ||
[dispatch], | ||
); | ||
|
||
const factory = React.useMemo( |
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.
we should move away from react namespace imports in new code per https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#removing-unused-react-imports
const startImpersonate = React.useCallback( | |
(kind: string, name: string) => dispatch(UIActions.startImpersonate(kind, name)), | |
[dispatch], | |
); | |
const factory = React.useMemo( | |
const startImpersonate = useCallback( | |
(kind: string, name: string) => dispatch(UIActions.startImpersonate(kind, name)), | |
[dispatch], | |
); | |
const factory = useMemo( |
const [inProgress, setInProgress] = React.useState<boolean>(false); | ||
const [errorMessage, setErrorMessage] = React.useState<string>(''); | ||
|
||
const onSubmit: React.MouseEventHandler<HTMLButtonElement> = async (e) => { |
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.
const onSubmit: React.MouseEventHandler<HTMLButtonElement> = async (e) => { | |
const onSubmit: MouseEventHandler<HTMLButtonElement> = async (e) => { |
7218076
to
31d3935
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jhadvig, Mylanos The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/label acknowledge-critical-fixes-only Tech debt /label docs-approved |
/retest |
@jhadvig: all tests passed! Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
/verified |
@jhadvig: The In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
/verified later |
@jhadvig: The In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
/verified later @yapei |
@jhadvig: This PR has been marked to be verified later by In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
No description provided.