-
Notifications
You must be signed in to change notification settings - Fork 18
fix(PM-1610): Updated toast message and tooltip copy for directly accepting copilot #1178
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
import { useParams } from 'react-router-dom' | ||
import { toast } from 'react-toastify' | ||
import { mutate } from 'swr' | ||
import { useCallback, useMemo, useState } from 'react' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The removal of the |
||
|
||
import { assignCopilotOpportunity, copilotBaseUrl } from '~/apps/copilots/src/services/copilot-opportunities' | ||
import { assignCopilotOpportunity } from '~/apps/copilots/src/services/copilot-opportunities' | ||
import { CopilotApplication, CopilotApplicationStatus } from '~/apps/copilots/src/models/CopilotApplication' | ||
import { IconSolid, Tooltip } from '~/libs/ui' | ||
|
||
|
@@ -38,8 +37,8 @@ const CopilotApplicationAction = ( | |
if (opportunityId) { | ||
try { | ||
await assignCopilotOpportunity(opportunityId, copilotApplication.id) | ||
toast.success('Invited a copilot') | ||
mutate(`${copilotBaseUrl}/copilots/opportunity/${opportunityId}/applications`) | ||
toast.success('Accepted as copilot') | ||
copilotApplication.onApplied() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
} catch (e) { | ||
const error = e as Error | ||
toast.error(error.message) | ||
|
@@ -56,7 +55,7 @@ const CopilotApplicationAction = ( | |
|
||
await assignCopilotOpportunity(opportunityId, copilotApplication.id) | ||
toast.success('Accepted as copilot') | ||
mutate(`${copilotBaseUrl}/copilots/opportunity/${opportunityId}/applications`) | ||
copilotApplication.onApplied() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The line |
||
setShowAlreadyMemberModal(false) | ||
} catch (e) { | ||
const error = e as Error | ||
|
@@ -84,7 +83,7 @@ const CopilotApplicationAction = ( | |
!isInvited | ||
&& copilotApplication.status === CopilotApplicationStatus.PENDING | ||
&& copilotApplication.opportunityStatus === 'active' && ( | ||
<Tooltip content='Send Invitation'> | ||
<Tooltip content='Accept Application'> | ||
<IconSolid.UserAddIcon /> | ||
</Tooltip> | ||
) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,6 +77,7 @@ const CopilotApplications: FC<{ | |
copilotApplications?: CopilotApplication[] | ||
members?: FormattedMembers[] | ||
opportunity: CopilotOpportunity | ||
onApplied: () => void | ||
}> = props => { | ||
const getData = (): CopilotApplication[] => (props.copilotApplications ? props.copilotApplications.map(item => { | ||
const member = props.members && props.members.find(each => each.userId === item.userId) | ||
|
@@ -85,6 +86,7 @@ const CopilotApplications: FC<{ | |
activeProjects: member?.activeProjects || 0, | ||
fulfilment: member?.copilotFulfillment || 0, | ||
handle: member?.handle, | ||
onApplied: props.onApplied, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The addition of |
||
opportunityStatus: props.opportunity.status, | ||
pastProjects: member?.pastProjects || 0, | ||
projectName: props.opportunity.projectName, | ||
|
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 addition of the
onApplied
function property to theCopilotApplication
interface should include a description of its purpose and usage in the context of the application. Ensure that this function is implemented and utilized correctly wherever theCopilotApplication
interface is used.