-
Notifications
You must be signed in to change notification settings - Fork 15
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
added new features to setting page #408
base: master
Are you sure you want to change the base?
added new features to setting page #408
Conversation
WalkthroughThe pull request introduces enhancements to the team management interface in the Changes
Suggested labels
Suggested reviewers
Possibly related PRs
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 1
🧹 Nitpick comments (4)
Clients/src/presentation/pages/SettingsPage/Team/index.tsx (4)
60-61
: Explain usage rationale or rename for clarity
While the state variablesopen
andmemberToDelete
are self-explanatory, consider renamingopen
to something more descriptive likeisDeleteDialogOpen
for improved clarity and maintainability.
150-153
: Separation of concerns
handleDeleteClick
sets dialog visibility and the selected member state, but consider aligning naming conventions:openDeleteDialog(memberId)
might better convey the intent.
328-380
: Dialog styling
Using inline styling within Material-UI’s Dialog is acceptable. However, this might become unwieldy if additional dialogs share styling. Consider extracting to a shared theme or custom theme override for consistency.
440-446
: Revisit “Save All” logic
This block is commented out, which may be intentional. If the save logic is needed later, consider creating another PR or referencing a TODO to track revisiting this code.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
Clients/src/presentation/pages/SettingsPage/Team/index.tsx
(8 hunks)Clients/src/presentation/vw-v2-components/Dialogs/DualButtonModal/index.tsx
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- Clients/src/presentation/vw-v2-components/Dialogs/DualButtonModal/index.tsx
🔇 Additional comments (5)
Clients/src/presentation/pages/SettingsPage/Team/index.tsx (5)
94-97
: Potential side effect handling
InhandleClose
, resetting bothopen
andmemberToDelete
is straightforward. However, if future logic depends on partial cleanup (e.g., partial resets if certain conditions fail), factor out the reset logic. Otherwise, this is good for now.
99-106
: Confirm success/failure withinconfirmDelete
Currently, if an API call or server request is needed for deletion, there's no error handling or success/failure feedback. Ensure that the local state changes reflect a successful operation. Consider implementing an async call to the backend and showing notifications on success or failure.
296-301
: Styling border
Removing the border from the notched outline is consistent with the design. Verify default focus states for accessibility; lacking a visual focus indicator could harm usability for keyboard navigation.
304-306
: Validation check
Ensure roles are restricted to known constants. If theroles
array changes or user input is untrusted, consider an additional check on the assigned value.
311-319
: Icon alignment
The trashbin icon usage is straightforward. If the icon were to change or scale for different screen sizes, ensure consistent alignment with text or neighboring elements.
count={dashboardValues.vendors.length} | ||
page={page} | ||
onPageChange={handleChangePage} | ||
rowsPerPage={rowsPerPage} | ||
rowsPerPageOptions={[5, 10, 15, 25]} | ||
onRowsPerPageChange={handleChangeRowsPerPage} | ||
ActionsComponent={(props) => <TablePaginationActions {...props} />} | ||
labelRowsPerPage="Rows per page" | ||
labelDisplayedRows={({ page, count }) => | ||
`Page ${page + 1} of ${Math.max( | ||
0, | ||
Math.ceil(count / rowsPerPage) | ||
)}` | ||
} | ||
slotProps={{ | ||
select: { | ||
MenuProps: { | ||
keepMounted: true, | ||
PaperProps: { | ||
className: "pagination-dropdown", | ||
sx: { | ||
mt: 0, | ||
mb: theme.spacing(2), | ||
}, | ||
}, | ||
transformOrigin: { vertical: "bottom", horizontal: "left" }, | ||
anchorOrigin: { vertical: "top", horizontal: "left" }, | ||
sx: { mt: theme.spacing(-2) }, | ||
}, | ||
transformOrigin: { vertical: "bottom", horizontal: "left" }, | ||
anchorOrigin: { vertical: "top", horizontal: "left" }, | ||
sx: { mt: theme.spacing(-2) }, | ||
}, | ||
inputProps: { id: "pagination-dropdown" }, | ||
IconComponent: SelectorVertical, | ||
sx: { | ||
ml: theme.spacing(4), | ||
mr: theme.spacing(12), | ||
minWidth: theme.spacing(20), | ||
textAlign: "left", | ||
"&.Mui-focused > div": { | ||
backgroundColor: theme.palette.background.main, | ||
inputProps: { id: "pagination-dropdown" }, | ||
IconComponent: SelectorVertical, | ||
sx: { | ||
ml: theme.spacing(4), | ||
mr: theme.spacing(12), | ||
minWidth: theme.spacing(20), | ||
textAlign: "left", | ||
"&.Mui-focused > div": { | ||
backgroundColor: theme.palette.background.main, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}} | ||
sx={{ | ||
mt: theme.spacing(6), | ||
color: theme.palette.text.secondary, | ||
"& .MuiSelect-icon": { | ||
width: "24px", | ||
height: "fit-content", | ||
}, | ||
"& .MuiSelect-select": { | ||
width: theme.spacing(10), | ||
borderRadius: theme.shape.borderRadius, | ||
border: `1px solid ${theme.palette.border.light}`, | ||
padding: theme.spacing(4), | ||
}, | ||
}} | ||
/> | ||
}} | ||
sx={{ | ||
mt: theme.spacing(6), | ||
color: theme.palette.text.secondary, | ||
"& .MuiSelect-icon": { | ||
width: "24px", | ||
height: "fit-content", | ||
}, | ||
"& .MuiSelect-select": { | ||
width: theme.spacing(10), | ||
border: `1px solid ${theme.palette.border.light}`, | ||
padding: theme.spacing(4), | ||
}, | ||
}} | ||
/> |
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.
Pagination count mismatch
Line 382 references count={dashboardValues.vendors.length}
, while the table data is local (filteredMembers
). Verify that the pagination logic (page count & displayed rows) aligns with the team member data rather than vendor data.
- count={dashboardValues.vendors.length}
+ count={filteredMembers.length}
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
count={dashboardValues.vendors.length} | |
page={page} | |
onPageChange={handleChangePage} | |
rowsPerPage={rowsPerPage} | |
rowsPerPageOptions={[5, 10, 15, 25]} | |
onRowsPerPageChange={handleChangeRowsPerPage} | |
ActionsComponent={(props) => <TablePaginationActions {...props} />} | |
labelRowsPerPage="Rows per page" | |
labelDisplayedRows={({ page, count }) => | |
`Page ${page + 1} of ${Math.max( | |
0, | |
Math.ceil(count / rowsPerPage) | |
)}` | |
} | |
slotProps={{ | |
select: { | |
MenuProps: { | |
keepMounted: true, | |
PaperProps: { | |
className: "pagination-dropdown", | |
sx: { | |
mt: 0, | |
mb: theme.spacing(2), | |
}, | |
}, | |
transformOrigin: { vertical: "bottom", horizontal: "left" }, | |
anchorOrigin: { vertical: "top", horizontal: "left" }, | |
sx: { mt: theme.spacing(-2) }, | |
}, | |
transformOrigin: { vertical: "bottom", horizontal: "left" }, | |
anchorOrigin: { vertical: "top", horizontal: "left" }, | |
sx: { mt: theme.spacing(-2) }, | |
}, | |
inputProps: { id: "pagination-dropdown" }, | |
IconComponent: SelectorVertical, | |
sx: { | |
ml: theme.spacing(4), | |
mr: theme.spacing(12), | |
minWidth: theme.spacing(20), | |
textAlign: "left", | |
"&.Mui-focused > div": { | |
backgroundColor: theme.palette.background.main, | |
inputProps: { id: "pagination-dropdown" }, | |
IconComponent: SelectorVertical, | |
sx: { | |
ml: theme.spacing(4), | |
mr: theme.spacing(12), | |
minWidth: theme.spacing(20), | |
textAlign: "left", | |
"&.Mui-focused > div": { | |
backgroundColor: theme.palette.background.main, | |
}, | |
}, | |
}, | |
}, | |
}} | |
sx={{ | |
mt: theme.spacing(6), | |
color: theme.palette.text.secondary, | |
"& .MuiSelect-icon": { | |
width: "24px", | |
height: "fit-content", | |
}, | |
"& .MuiSelect-select": { | |
width: theme.spacing(10), | |
borderRadius: theme.shape.borderRadius, | |
border: `1px solid ${theme.palette.border.light}`, | |
padding: theme.spacing(4), | |
}, | |
}} | |
/> | |
}} | |
sx={{ | |
mt: theme.spacing(6), | |
color: theme.palette.text.secondary, | |
"& .MuiSelect-icon": { | |
width: "24px", | |
height: "fit-content", | |
}, | |
"& .MuiSelect-select": { | |
width: theme.spacing(10), | |
border: `1px solid ${theme.palette.border.light}`, | |
padding: theme.spacing(4), | |
}, | |
}} | |
/> | |
count={filteredMembers.length} | |
page={page} | |
onPageChange={handleChangePage} | |
rowsPerPage={rowsPerPage} | |
rowsPerPageOptions={[5, 10, 15, 25]} | |
onRowsPerPageChange={handleChangeRowsPerPage} | |
ActionsComponent={(props) => <TablePaginationActions {...props} />} | |
labelRowsPerPage="Rows per page" | |
labelDisplayedRows={({ page, count }) => | |
`Page ${page + 1} of ${Math.max( | |
0, | |
Math.ceil(count / rowsPerPage) | |
)}` | |
} | |
slotProps={{ | |
select: { | |
MenuProps: { | |
keepMounted: true, | |
PaperProps: { | |
className: "pagination-dropdown", | |
sx: { | |
mt: 0, | |
mb: theme.spacing(2), | |
}, | |
}, | |
transformOrigin: { vertical: "bottom", horizontal: "left" }, | |
anchorOrigin: { vertical: "top", horizontal: "left" }, | |
sx: { mt: theme.spacing(-2) }, | |
}, | |
inputProps: { id: "pagination-dropdown" }, | |
IconComponent: SelectorVertical, | |
sx: { | |
ml: theme.spacing(4), | |
mr: theme.spacing(12), | |
minWidth: theme.spacing(20), | |
textAlign: "left", | |
"&.Mui-focused > div": { | |
backgroundColor: theme.palette.background.main, | |
}, | |
}, | |
}, | |
}} | |
sx={{ | |
mt: theme.spacing(6), | |
color: theme.palette.text.secondary, | |
"& .MuiSelect-icon": { | |
width: "24px", | |
height: "fit-content", | |
}, | |
"& .MuiSelect-select": { | |
width: theme.spacing(10), | |
border: `1px solid ${theme.palette.border.light}`, | |
padding: theme.spacing(4), | |
}, | |
}} | |
/> |
Hi @gorkemcetin, |
@melpsh @gorkemcetin |
@melpsh you can use the modal we have for this and we're good to go! |
Please clarify what modal do you want me to use exactly? |
Can you please check this one? I "think" it was this popup Mo added recently.
|
@gorkem-bwl Let's not import that component for now. Thank you for the code @melpsh. What do you think @gorkem-bwl ? |
Describe your changes
1- removed the redundant save button
2- removed the organization name for now
3- removed the select outlined
5- added the modal for deleting each member on the table
Issue 401
Please ensure all items are checked off before requesting a review:
Summary by CodeRabbit
New Features
Style
Select
component styling for role selectionBug Fixes