-
Notifications
You must be signed in to change notification settings - Fork 42
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
Create Users list details drawer #1687
Create Users list details drawer #1687
Conversation
1955935
to
f38e99d
Compare
4699af4
to
cc9aae7
Compare
/retest |
const { groups } = useSelector((state: RBACStore) => ({ | ||
groups: state.groupReducer?.groups?.data || [], | ||
})); |
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 { groups } = useSelector((state: RBACStore) => ({ | |
groups: state.groupReducer?.groups?.data || [], | |
})); | |
const groups = useSelector((state: RBACStore) => state.groupReducer?.groups?.data || []); |
const { roles } = useSelector((state: RBACStore) => ({ | ||
roles: state.roleReducer?.roles?.data || [], | ||
})); |
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 { roles } = useSelector((state: RBACStore) => ({ | |
roles: state.roleReducer?.roles?.data || [], | |
})); | |
const roles = useSelector((state: RBACStore) => state.roleReducer?.roles?.data || []); |
const fetchData = useCallback( | ||
(apiProps: { username: string }) => { | ||
const { username } = apiProps; | ||
dispatch(fetchRoles({ ...mappedProps({ username }), usesMetaInURL: true, system: false })); | ||
}, | ||
[dispatch] | ||
); | ||
|
||
useEffect(() => { | ||
fetchData({ | ||
username: userId, | ||
}); | ||
}, [fetchData, userId]); |
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 fetchData = useCallback( | |
(apiProps: { username: string }) => { | |
const { username } = apiProps; | |
dispatch(fetchRoles({ ...mappedProps({ username }), usesMetaInURL: true, system: false })); | |
}, | |
[dispatch] | |
); | |
useEffect(() => { | |
fetchData({ | |
username: userId, | |
}); | |
}, [fetchData, userId]); | |
const fetchData = useCallback(() => { | |
dispatch(fetchRoles({ ...mappedProps({ username: userId }), usesMetaInURL: true, system: false })); | |
}, [dispatch, userId]); | |
useEffect(() => { | |
fetchData(); | |
}, [fetchData]); |
const fetchData = useCallback( | ||
(apiProps: { username: string }) => { | ||
const { username } = apiProps; | ||
dispatch(fetchGroups({ ...mappedProps({ username }), usesMetaInURL: true, system: false })); | ||
}, | ||
[dispatch] | ||
); | ||
|
||
useEffect(() => { | ||
fetchData({ | ||
username: userId, | ||
}); | ||
}, [fetchData, userId]); |
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 fetchData = useCallback( | |
(apiProps: { username: string }) => { | |
const { username } = apiProps; | |
dispatch(fetchGroups({ ...mappedProps({ username }), usesMetaInURL: true, system: false })); | |
}, | |
[dispatch] | |
); | |
useEffect(() => { | |
fetchData({ | |
username: userId, | |
}); | |
}, [fetchData, userId]); | |
const fetchData = useCallback(() => { | |
dispatch(fetchGroups({ ...mappedProps({ username: userId }), usesMetaInURL: true, system: false })); | |
}, [dispatch, userId]); | |
useEffect(() => { | |
fetchData(); | |
}, [fetchData]); |
})); | ||
|
||
return ( | ||
<div className="pf-v5-u-pt-md"> |
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.
I made myself a note to add support for className in DataView element
<Text>{focusedUser?.email}</Text> | ||
</TextContent> | ||
<DrawerActions> | ||
<DrawerCloseButton onClick={() => onClose()} /> |
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.
<DrawerCloseButton onClick={() => onClose()} /> | |
<DrawerCloseButton onClick={onClose} /> |
/retest |
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.
It might be better to break this file into multiple ones to not have multiple components there
@CodyWMitchell this should help with the Konflux failure #1690 |
/retest |
c1f762e
to
7265d24
Compare
/retest |
1 similar comment
/retest |
props: { | ||
onClick: () => onFocusUser && onFocusUser(user), | ||
}, |
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 is probably not enough.
As mentioned in the DW extension's example isClickable
, onRowClick
and isRowSelected
should be passed
https://react-data-view-pr-data-view-14.surge.sh/extensions/data-view/events-context
Now, the drawer does not hide when you click the row again and the opened row is not focused when clicked. Also the cursor is not a pointer
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.
updated to use the events-context! 👍
Now the row hides when clicked again, cursor is a pointer, and clicking the actions/checkbox does not trigger the drawer to open. 🎉
Signed-off-by: red-hat-konflux <126015336+red-hat-konflux[bot]@users.noreply.github.com> Co-authored-by: red-hat-konflux[bot] <126015336+red-hat-konflux[bot]@users.noreply.github.com>
Signed-off-by: red-hat-konflux <126015336+red-hat-konflux[bot]@users.noreply.github.com> Co-authored-by: red-hat-konflux[bot] <126015336+red-hat-konflux[bot]@users.noreply.github.com>
25e1330
to
53ccf7a
Compare
Looks good! 🎉 |
Description
Create Users list details drawer
RHCLOUD-34258
Screenshots
Checklist ☑️