-
Notifications
You must be signed in to change notification settings - Fork 10
feat(client): when adding members to an engine by name or email displayed already added #1211
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
…ayed already added
@CodiumAI-Agent /describe |
@CodiumAI-Agent /review |
@CodiumAI-Agent /improve |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 4f6416e
Previous suggestionsSuggestions up to commit 56347d8
|
@@ -31,6 +31,7 @@ import { useAPI, useDebounceValue, useRootStore, useSettings } from '@/hooks'; | |||
import { MembersAddOverlayUser } from './MembersAddOverlayUser'; | |||
import { SETTINGS_ROLE } from './settings.types'; | |||
import { permissionPriorityMapper } from '@/utility/general'; | |||
import { has } from 'mobx'; |
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 not being used
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.
Okay, I've removed it.
), | ||
]); | ||
const all = [...(noCred?.data || []), ...(cred?.members || [])]; | ||
const unique = Array.from( |
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.
the items are always going to be unique so we don't need it
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've removed it, kindly review it once.
return () => { | ||
cancelled = true; | ||
}; | ||
// eslint-disable-next-line |
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.
why do we need to disable this?
// eslint-disable-next-line | ||
}, [open, debouncedSearch, offset, adminMode, id, type]); | ||
// Fetch and combine members for engine types | ||
useEffect(() => { |
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.
Instead of adding 2 useEffects, you can check whether the type is app or not. If the type is app, then the API calls need to go to getProjectUsersNoCredentials and getProjectUsers. If the type is not app, then the API calls need to go to getEngineUsersNoCredentials and getEngineUsers. The rest of the code is the same.
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.
Okay, I've made the required changes, kindly review it.
@@ -348,7 +422,7 @@ export const MembersAddOverlay = (props: MembersAddOverlayProps) => { | |||
success = true; | |||
|
|||
// refresh the members | |||
getMembers.refresh(); | |||
// getMembers.refresh(); |
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 unused code
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.
Okay, I've removed the unused code.
…MemberToEngineDisplayAlreadyAdded
…hub.com/SEMOSS/semoss-ui into AddingMemberToEngineDisplayAlreadyAdded
@CodiumAI-Agent /update_changelog |
Changelog updates: 🔄 2025-06-10 *Added
|
Description
In the Add members modal, if a user tries to add someone based name or email that already has access to the system then it display user with statement 'Already Added'.
Changes Made
In the add members modal Engine of Function and App, when someone search for the users unknowingly that the user have already been added by someone else and want to add them, then it will display user with statement 'Already Added' and the already added user are disabled to add.
How to Test
For Function
For App