Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Role access table #1593
Role access table #1593
Changes from 14 commits
bda99f1
cb14a31
2c7ff86
f72669d
011e94a
2903d4f
7a37877
befc447
4c045d7
50b838d
72fdb4a
cc00681
56713ec
0de3e8c
df75d96
025d292
b41490e
eb3f03b
93324ea
6a85c7d
413baf0
741342e
5a7c851
5e9eaf5
02c451d
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Remove duplicate Button import and clarify component usage.
There are two imports for the
Button
component from different packages:@egovernments/digit-ui-components
@egovernments/digit-ui-react-components
This could lead to confusion and potential bugs. Please remove one of the imports and ensure that the correct
Button
component is used throughout the file.Apply this diff to resolve the issue:
Choose the appropriate import based on which
Button
component you intend to use in the component.📝 Committable suggestion
🧰 Tools
🪛 Biome
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.
add t
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.
Incorrect usage of the 'select' prop in 'Dropdown' component
In the
Dropdown
component within theHierarchy
column, theselect
prop is expected to be a function that handles selection changes. However, it is currently being assigned an object, which may cause unexpected behavior.Apply this diff to correct the usage:
Since the dropdown is disabled (
disable={true}
), theselect
prop may not be necessary and can be omitted.📝 Committable suggestion
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.
🛠️ Refactor suggestion
Use 'find' instead of 'filter' when checking for a single item
When determining if a user is already assigned, using
find
is more efficient thanfilter
when you only need to locate a single item.Apply this diff to optimize the code:
This change simplifies the logic and improves performance by avoiding unnecessary iterations.
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.
🧹 Nitpick (assertive)
Remove unnecessary semicolon after 'if' block
There is an unnecessary semicolon after the
if
block checkingisHrmsLoading
. This semicolon can be removed to adhere to proper syntax.Apply this diff to remove the semicolon:
📝 Committable suggestion
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.
🧹 Nitpick (assertive)
Approve function signature update with documentation suggestion.
The addition of
setData
andnationalRoles
props enhances the component's functionality, aligning with the PR objectives. This change improves data management and potentially supports role-based access control.Consider adding JSDoc comments to document these new props, their types, and their purpose. For example:
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.
🧹 Nitpick (assertive)
Approve data management enhancement with suggestion.
The addition of
setData(data);
improves data management by allowing external storage of fetched data. This change aligns well with the newsetData
prop and enhances the component's flexibility.Consider adding a null check before calling
setData
to prevent potential errors:This ensures that
setData
is defined and is a function before calling it, making the code more robust.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.
🧹 Nitpick (assertive)
Approve addition of category prop with documentation suggestion.
The addition of the
category
prop to theDataTable
component enhances its flexibility and aligns with the role-based functionality improvements.To improve maintainability, consider adding a comment or updating the component's documentation to explain how the
category
prop affects theDataTable
's behavior or appearance. This will help future developers understand the purpose and impact of this prop.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.
Update PopUp children to address React best practices.
The addition of
category
andnationalRoles
props toRoleTableComposer
enhances its functionality. However, there are two React-related issues to address:Please update the
PopUp
component as follows:This change resolves both the children prop issue and the missing key warning.
📝 Committable suggestion
🧰 Tools
🪛 Biome