From a3c16e313af4796dc85c2e8dc5203a6d2df1871b Mon Sep 17 00:00:00 2001 From: Hentry Martin Date: Wed, 18 Jun 2025 21:17:10 +0530 Subject: [PATCH 01/10] fix: show types propertly in opportunity details page --- .../copilot-opportunity-details/index.tsx | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/apps/copilots/src/pages/copilot-opportunity-details/index.tsx b/src/apps/copilots/src/pages/copilot-opportunity-details/index.tsx index 7b1dbacf3..1826eadda 100644 --- a/src/apps/copilots/src/pages/copilot-opportunity-details/index.tsx +++ b/src/apps/copilots/src/pages/copilot-opportunity-details/index.tsx @@ -35,6 +35,7 @@ import { } from '../../services/copilot-opportunities' import { FormattedMembers, useMembers } from '../../services/members' import { copilotRoutesMap } from '../../copilots.routes' +import { ProjectType } from '../../constants' import { ApplyOpportunityModal } from './apply-opportunity-modal' import { @@ -127,6 +128,21 @@ const CopilotOpportunityDetails: FC<{}> = () => { const application = copilotApplications && copilotApplications[0] const isAlreadyMemberOfTheProject = profile && opportunity?.members?.includes(profile.userId) + const getOpportunityType = (type: string): ProjectType => { + switch (type) { + case 'ai': + return ProjectType.ai + case 'datascience': + return ProjectType.datascience + case 'dev': + return ProjectType.developement + case 'design': + return ProjectType.design + default: + return ProjectType.qa + } + } + return ( = () => {
Type - {opportunity?.type} + + {opportunity?.type && getOpportunityType(opportunity?.type)} +
From a6c733a31e5f941ac1c4690ff0ca8922ba2018d4 Mon Sep 17 00:00:00 2001 From: Hentry Martin Date: Thu, 19 Jun 2025 09:53:38 +0530 Subject: [PATCH 02/10] remove members from copilot response and use boolean --- src/apps/copilots/src/models/CopilotOpportunity.ts | 2 +- .../copilots/src/pages/copilot-opportunity-details/index.tsx | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/apps/copilots/src/models/CopilotOpportunity.ts b/src/apps/copilots/src/models/CopilotOpportunity.ts index 891dfffbb..b53545377 100644 --- a/src/apps/copilots/src/models/CopilotOpportunity.ts +++ b/src/apps/copilots/src/models/CopilotOpportunity.ts @@ -22,5 +22,5 @@ export interface CopilotOpportunity { startDate: Date, tzRestrictions: 'yes' | 'no', createdAt: Date, - members: Array, + canApplyAsCopilot: boolean, } diff --git a/src/apps/copilots/src/pages/copilot-opportunity-details/index.tsx b/src/apps/copilots/src/pages/copilot-opportunity-details/index.tsx index 7b1dbacf3..b3d5707eb 100644 --- a/src/apps/copilots/src/pages/copilot-opportunity-details/index.tsx +++ b/src/apps/copilots/src/pages/copilot-opportunity-details/index.tsx @@ -125,7 +125,6 @@ const CopilotOpportunityDetails: FC<{}> = () => { } const application = copilotApplications && copilotApplications[0] - const isAlreadyMemberOfTheProject = profile && opportunity?.members?.includes(profile.userId) return ( = () => { && copilotApplications && copilotApplications.length === 0 && opportunity?.status === 'active' - && !isAlreadyMemberOfTheProject ? applyCopilotOpportunityButton : undefined + && opportunity?.canApplyAsCopilot ? applyCopilotOpportunityButton : undefined } infoComponent={(isCopilot && !(copilotApplications && copilotApplications.length === 0 From cd4838587d8e88a0ac37509440dc90f71ba72c2e Mon Sep 17 00:00:00 2001 From: Hentry Martin Date: Thu, 19 Jun 2025 18:56:22 +0530 Subject: [PATCH 03/10] fix: demo feedbacks implementation --- .../ApplyOpportunityModal.tsx | 16 ++-- .../pages/copilot-opportunity-list/index.tsx | 5 ++ .../src/pages/copilot-request-form/index.tsx | 76 ------------------- 3 files changed, 11 insertions(+), 86 deletions(-) diff --git a/src/apps/copilots/src/pages/copilot-opportunity-details/apply-opportunity-modal/ApplyOpportunityModal.tsx b/src/apps/copilots/src/pages/copilot-opportunity-details/apply-opportunity-modal/ApplyOpportunityModal.tsx index ed355f305..8b69d9cb5 100644 --- a/src/apps/copilots/src/pages/copilot-opportunity-details/apply-opportunity-modal/ApplyOpportunityModal.tsx +++ b/src/apps/copilots/src/pages/copilot-opportunity-details/apply-opportunity-modal/ApplyOpportunityModal.tsx @@ -44,8 +44,8 @@ const ApplyOpportunityModal: FC = props => { size='lg' title={ success - ? `Your Application for ${props.projectName} Has Been Received!` - : `Confirm Your Copilot Application for ${props.projectName}` + ? `Your Application Has Been Received!` + : `Confirm Your Copilot Application` } buttons={ !success ? ( @@ -62,21 +62,17 @@ const ApplyOpportunityModal: FC = props => {
{ success - ? `We appreciate the time and effort you've taken to apply - for this exciting opportunity. Our team is committed - to providing a seamless and efficient process to ensure a - great experience for all copilots. We will review your application - within short time.` + ? `Thank you for taking the time to apply for this exciting opportunity. We truly value your interest and effort. Your application will be reviewed promptly.` : `We're excited to see your interest in joining our team as a copilot - for the ${props.projectName} project! Before we proceed, we want to + for the "${props.projectName}" project! Before we proceed, we want to ensure that you have carefully reviewed the project requirements and - are committed to meeting them.` + are committed to meeting them. Please write below the reason(s) why you believe you're a good fit for this project (e.g., previous experience, availability, etc.).` }
{ !success && ( [] = [ propertyName: 'startDate', type: 'date', }, + { + label: 'Duration(Weeks)', + propertyName: 'numWeeks', + type: 'text', + }, { label: 'Complexity', propertyName: 'complexity', diff --git a/src/apps/copilots/src/pages/copilot-request-form/index.tsx b/src/apps/copilots/src/pages/copilot-request-form/index.tsx index 79aa395ee..8fec31503 100644 --- a/src/apps/copilots/src/pages/copilot-request-form/index.tsx +++ b/src/apps/copilots/src/pages/copilot-request-form/index.tsx @@ -20,7 +20,6 @@ const CopilotRequestForm: FC<{}> = () => { const [formValues, setFormValues] = useState({}) const [isFormChanged, setIsFormChanged] = useState(false) const [formErrors, setFormErrors] = useState({}) - const [existingCopilot, setExistingCopilot] = useState('') const [paymentType, setPaymentType] = useState('') const projectTypes = ProjectTypes ? ProjectTypes.map(project => ({ @@ -29,16 +28,6 @@ const CopilotRequestForm: FC<{}> = () => { })) : [] - function exisitingCopilotToggle(t: 'yes'|'no'): void { - setExistingCopilot(t) - setFormErrors((prevFormErrors: any) => { - const updatedErrors = { ...prevFormErrors } - delete updatedErrors.existingCopilot - return updatedErrors - }) - setIsFormChanged(true) - } - function togglePaymentType(t: 'standard'|'other'): void { setFormValues((prevFormValues: any) => ({ ...prevFormValues, @@ -141,12 +130,6 @@ const CopilotRequestForm: FC<{}> = () => { const fieldValidations: { condition: boolean; key: string; message: string }[] = [ { condition: !formValues.projectId, key: 'projectId', message: 'Project is required' }, - { condition: !existingCopilot, key: 'existingCopilot', message: 'Selection is required' }, - { - condition: existingCopilot === 'yes' && !formValues.copilotUsername, - key: 'copilotUsername', - message: 'Username is required', - }, { condition: !formValues.complexity, key: 'complexity', message: 'Selection is required' }, { condition: !formValues.requiresCommunication, @@ -220,7 +203,6 @@ const CopilotRequestForm: FC<{}> = () => { toast.success('Copilot request sent successfully') setFormValues({ complexity: '', - copilotUsername: '', numHoursPerWeek: '', numWeeks: '', otherPaymentType: '', @@ -234,7 +216,6 @@ const CopilotRequestForm: FC<{}> = () => { }) setIsFormChanged(false) setFormErrors({}) - setExistingCopilot('') setPaymentType('') }) .catch(e => { @@ -288,63 +269,6 @@ const CopilotRequestForm: FC<{}> = () => { dirty error={formErrors.projectId} /> -

- Are you already working with a copilot that you'd love to work with on this project - as well? -

- -
- - -
- { - existingCopilot === 'yes' - && ( -
-

- Great! What is the username of the copilot you'd like to work with again? -

- - -
- ) - } - {formErrors.existingCopilot && ( -

- - {formErrors.existingCopilot} -

- )} - {formValues.existingCopilot === 'yes' && !formValues.copilotUsername && ( -

- - {formErrors.existingCopilot} -

- )}

What type of project are you working on?

Date: Thu, 19 Jun 2025 19:00:51 +0530 Subject: [PATCH 04/10] fix: lint --- .../ApplyOpportunityModal.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/apps/copilots/src/pages/copilot-opportunity-details/apply-opportunity-modal/ApplyOpportunityModal.tsx b/src/apps/copilots/src/pages/copilot-opportunity-details/apply-opportunity-modal/ApplyOpportunityModal.tsx index 8b69d9cb5..27acf2830 100644 --- a/src/apps/copilots/src/pages/copilot-opportunity-details/apply-opportunity-modal/ApplyOpportunityModal.tsx +++ b/src/apps/copilots/src/pages/copilot-opportunity-details/apply-opportunity-modal/ApplyOpportunityModal.tsx @@ -44,8 +44,8 @@ const ApplyOpportunityModal: FC = props => { size='lg' title={ success - ? `Your Application Has Been Received!` - : `Confirm Your Copilot Application` + ? 'Your Application Has Been Received!' + : 'Confirm Your Copilot Application' } buttons={ !success ? ( @@ -62,11 +62,15 @@ const ApplyOpportunityModal: FC = props => {
{ success - ? `Thank you for taking the time to apply for this exciting opportunity. We truly value your interest and effort. Your application will be reviewed promptly.` + ? `Thank you for taking the time to apply for this exciting opportunity. + We truly value your interest and effort. + Your application will be reviewed promptly.` : `We're excited to see your interest in joining our team as a copilot for the "${props.projectName}" project! Before we proceed, we want to ensure that you have carefully reviewed the project requirements and - are committed to meeting them. Please write below the reason(s) why you believe you're a good fit for this project (e.g., previous experience, availability, etc.).` + are committed to meeting them. Please write below the reason(s) + why you believe you're a good fit for this project + (e.g., previous experience, availability, etc.).` }
{ From 200103116050f5eb44717a5e717252c6caed1982 Mon Sep 17 00:00:00 2001 From: Hentry Martin Date: Thu, 19 Jun 2025 21:18:08 +0530 Subject: [PATCH 05/10] feat: added cancel opportunity button and some design changes --- .../copilot-opportunity-details/index.tsx | 177 ++++++++++-------- .../styles.module.scss | 4 + .../CopilotApplicationAction.tsx | 2 +- .../OpportunityDetails.tsx | 6 +- .../src/services/copilot-opportunities.ts | 15 +- 5 files changed, 118 insertions(+), 86 deletions(-) diff --git a/src/apps/copilots/src/pages/copilot-opportunity-details/index.tsx b/src/apps/copilots/src/pages/copilot-opportunity-details/index.tsx index b3d5707eb..45327a5bd 100644 --- a/src/apps/copilots/src/pages/copilot-opportunity-details/index.tsx +++ b/src/apps/copilots/src/pages/copilot-opportunity-details/index.tsx @@ -28,6 +28,7 @@ import { textFormatDateLocaleShortString } from '~/libs/shared' import { CopilotApplication } from '../../models/CopilotApplication' import { + cancelCopilotOpportunity, copilotBaseUrl, CopilotOpportunityResponse, useCopilotApplications, @@ -119,11 +120,25 @@ const CopilotOpportunityDetails: FC<{}> = () => { ) } + async function cancelCopilotOpportunityHandler() { + if (opportunityId) { + await cancelCopilotOpportunity(opportunityId) + mutate(`${copilotBaseUrl}/copilots/opportunity/${opportunityId}/applications`) + mutate(`${copilotBaseUrl}/copilots/opportunity/${opportunityId}`) + } + + } + const applyCopilotOpportunityButton: ButtonProps = { label: 'Apply as Copilot', onClick: () => setShowApplyOpportunityModal(true), } + const cancelCopilotOpportunityButton: ButtonProps = { + label: 'Cancel opportunity', + onClick: cancelCopilotOpportunityHandler, + } + const application = copilotApplications && copilotApplications[0] return ( @@ -136,6 +151,7 @@ const CopilotOpportunityDetails: FC<{}> = () => { && opportunity?.status === 'active' && opportunity?.canApplyAsCopilot ? applyCopilotOpportunityButton : undefined } + secondaryButtonConfig={opportunity?.status === 'active' && isAdminOrPM ? cancelCopilotOpportunityButton : undefined} infoComponent={(isCopilot && !(copilotApplications && copilotApplications.length === 0 ) && opportunity?.status === 'active' && !!application) && ( @@ -155,94 +171,97 @@ const CopilotOpportunityDetails: FC<{}> = () => { {isValidating && !showNotFound && ( ) } -

- {opportunity?.projectName} -

-
-
- -
- Status - {opportunity?.status} +
+

+ {opportunity?.projectName} +

+
+
+ +
+ Status + {opportunity?.status} +
-
-
- -
- Start Date - - {moment(opportunity?.startDate) - .format('MMM D, YYYY')} - - +
+ +
+ Start Date + + {moment(opportunity?.startDate) + .format('MMM D, YYYY')} + + +
-
-
- -
- Duration - - {opportunity?.numWeeks} - {' '} - weeks - +
+ +
+ Duration + + {opportunity?.numWeeks} + {' '} + weeks + +
-
-
- -
- Hours - - {opportunity?.numHoursPerWeek} - {' '} - hours/week - +
+ +
+ Hours + + {opportunity?.numHoursPerWeek} + {' '} + hours/week + +
-
-
- -
- Type - {opportunity?.type} +
+ +
+ Type + {opportunity?.type} +
-
-
- -
- Working Hours - {opportunity?.tzRestrictions} +
+ +
+ Working Hours + {opportunity?.tzRestrictions} +
-
- { - initialized && ( - + ) + } + {activeTab === CopilotDetailsTabViews.details && } + {activeTab === CopilotDetailsTabViews.applications && isAdminOrPM && opportunity && ( + - ) - } - {activeTab === CopilotDetailsTabViews.details && } - {activeTab === CopilotDetailsTabViews.applications && isAdminOrPM && opportunity && ( - - )} + )} - { - showApplyOpportunityModal - && opportunity && ( - - ) - } + { + showApplyOpportunityModal + && opportunity && ( + + ) + } +
+ ) } diff --git a/src/apps/copilots/src/pages/copilot-opportunity-details/styles.module.scss b/src/apps/copilots/src/pages/copilot-opportunity-details/styles.module.scss index 8bb4b5162..9844231ae 100644 --- a/src/apps/copilots/src/pages/copilot-opportunity-details/styles.module.scss +++ b/src/apps/copilots/src/pages/copilot-opportunity-details/styles.module.scss @@ -1,5 +1,9 @@ @import '@libs/ui/styles/includes'; +.wrapper { + min-height: 800px; +} + .header { display: flex; align-items: center; diff --git a/src/apps/copilots/src/pages/copilot-opportunity-details/tabs/copilot-applications/CopilotApplicationAction.tsx b/src/apps/copilots/src/pages/copilot-opportunity-details/tabs/copilot-applications/CopilotApplicationAction.tsx index 836678036..56c8b035d 100644 --- a/src/apps/copilots/src/pages/copilot-opportunity-details/tabs/copilot-applications/CopilotApplicationAction.tsx +++ b/src/apps/copilots/src/pages/copilot-opportunity-details/tabs/copilot-applications/CopilotApplicationAction.tsx @@ -15,7 +15,7 @@ const CopilotApplicationAction = ( ): JSX.Element => { const { opportunityId }: {opportunityId?: string} = useParams<{ opportunityId?: string }>() const isInvited = useMemo( - () => allCopilotApplications.findIndex(item => item.status === CopilotApplicationStatus.INVITED) > -1, + () => allCopilotApplications && allCopilotApplications.findIndex(item => item.status === CopilotApplicationStatus.INVITED) > -1, [allCopilotApplications], ) const onClick = useCallback(async () => { diff --git a/src/apps/copilots/src/pages/copilot-opportunity-details/tabs/opportunity-details/OpportunityDetails.tsx b/src/apps/copilots/src/pages/copilot-opportunity-details/tabs/opportunity-details/OpportunityDetails.tsx index 847dbc6c9..e6051035e 100644 --- a/src/apps/copilots/src/pages/copilot-opportunity-details/tabs/opportunity-details/OpportunityDetails.tsx +++ b/src/apps/copilots/src/pages/copilot-opportunity-details/tabs/opportunity-details/OpportunityDetails.tsx @@ -11,11 +11,7 @@ const OpportunityDetails: FC<{

Required skills

- {props.opportunity?.skills.map((skill: any) => ( -
- {skill.name} -
- ))} + {props.opportunity?.skills.map(item => item.name).join(",")}

Description

diff --git a/src/apps/copilots/src/services/copilot-opportunities.ts b/src/apps/copilots/src/services/copilot-opportunities.ts index 771a16cb6..61cebb6d7 100644 --- a/src/apps/copilots/src/services/copilot-opportunities.ts +++ b/src/apps/copilots/src/services/copilot-opportunities.ts @@ -2,7 +2,7 @@ import useSWR, { SWRResponse } from 'swr' import useSWRInfinite, { SWRInfiniteResponse } from 'swr/infinite' import { EnvironmentConfig } from '~/config' -import { xhrGetAsync, xhrPostAsync } from '~/libs/core' +import { xhrDeleteAsync, xhrGetAsync, xhrPostAsync } from '~/libs/core' import { buildUrl } from '~/libs/shared/lib/utils/url' import { CopilotOpportunity } from '../models/CopilotOpportunity' @@ -120,6 +120,19 @@ export const assignCopilotOpportunity = async ( return xhrPostAsync(url, { applicationId: applicationId.toString() }, {}) } +/** + * cancel copilot opportunity + * @param opportunityId + * @returns + */ +export const cancelCopilotOpportunity = async ( + opportunityId: string, +): Promise<{applicationId: number}> => { + const url = `${copilotBaseUrl}/copilots/opportunity/${opportunityId}/cancel` + + return xhrDeleteAsync(url) +} + /** * Custom hook to fetch copilot applications by opportunity id. * From ce59d563a4df69e94519cb4efec2d11b8ed3d6cb Mon Sep 17 00:00:00 2001 From: Hentry Martin Date: Thu, 19 Jun 2025 21:25:24 +0530 Subject: [PATCH 06/10] fix: lint --- .../src/pages/copilot-opportunity-details/index.tsx | 9 ++++++--- .../copilot-applications/CopilotApplicationAction.tsx | 3 ++- .../tabs/opportunity-details/OpportunityDetails.tsx | 3 ++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/apps/copilots/src/pages/copilot-opportunity-details/index.tsx b/src/apps/copilots/src/pages/copilot-opportunity-details/index.tsx index 45327a5bd..f56a8a4e0 100644 --- a/src/apps/copilots/src/pages/copilot-opportunity-details/index.tsx +++ b/src/apps/copilots/src/pages/copilot-opportunity-details/index.tsx @@ -120,7 +120,7 @@ const CopilotOpportunityDetails: FC<{}> = () => { ) } - async function cancelCopilotOpportunityHandler() { + async function cancelCopilotOpportunityHandler(): Promise { if (opportunityId) { await cancelCopilotOpportunity(opportunityId) mutate(`${copilotBaseUrl}/copilots/opportunity/${opportunityId}/applications`) @@ -151,7 +151,10 @@ const CopilotOpportunityDetails: FC<{}> = () => { && opportunity?.status === 'active' && opportunity?.canApplyAsCopilot ? applyCopilotOpportunityButton : undefined } - secondaryButtonConfig={opportunity?.status === 'active' && isAdminOrPM ? cancelCopilotOpportunityButton : undefined} + secondaryButtonConfig={ + opportunity?.status === 'active' + && isAdminOrPM ? cancelCopilotOpportunityButton : undefined + } infoComponent={(isCopilot && !(copilotApplications && copilotApplications.length === 0 ) && opportunity?.status === 'active' && !!application) && ( @@ -261,7 +264,7 @@ const CopilotOpportunityDetails: FC<{}> = () => { ) }

- + ) } diff --git a/src/apps/copilots/src/pages/copilot-opportunity-details/tabs/copilot-applications/CopilotApplicationAction.tsx b/src/apps/copilots/src/pages/copilot-opportunity-details/tabs/copilot-applications/CopilotApplicationAction.tsx index 56c8b035d..bcf228fc5 100644 --- a/src/apps/copilots/src/pages/copilot-opportunity-details/tabs/copilot-applications/CopilotApplicationAction.tsx +++ b/src/apps/copilots/src/pages/copilot-opportunity-details/tabs/copilot-applications/CopilotApplicationAction.tsx @@ -15,7 +15,8 @@ const CopilotApplicationAction = ( ): JSX.Element => { const { opportunityId }: {opportunityId?: string} = useParams<{ opportunityId?: string }>() const isInvited = useMemo( - () => allCopilotApplications && allCopilotApplications.findIndex(item => item.status === CopilotApplicationStatus.INVITED) > -1, + () => allCopilotApplications + && allCopilotApplications.findIndex(item => item.status === CopilotApplicationStatus.INVITED) > -1, [allCopilotApplications], ) const onClick = useCallback(async () => { diff --git a/src/apps/copilots/src/pages/copilot-opportunity-details/tabs/opportunity-details/OpportunityDetails.tsx b/src/apps/copilots/src/pages/copilot-opportunity-details/tabs/opportunity-details/OpportunityDetails.tsx index e6051035e..8cd3afd44 100644 --- a/src/apps/copilots/src/pages/copilot-opportunity-details/tabs/opportunity-details/OpportunityDetails.tsx +++ b/src/apps/copilots/src/pages/copilot-opportunity-details/tabs/opportunity-details/OpportunityDetails.tsx @@ -11,7 +11,8 @@ const OpportunityDetails: FC<{

Required skills

- {props.opportunity?.skills.map(item => item.name).join(",")} + {props.opportunity?.skills.map(item => item.name) + .join(',')}

Description

From d67e59e3056cd144b57308454bdbd872615829e9 Mon Sep 17 00:00:00 2001 From: Hentry Martin Date: Thu, 19 Jun 2025 21:33:19 +0530 Subject: [PATCH 07/10] fix: lint --- .../copilots/src/pages/copilot-opportunity-details/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apps/copilots/src/pages/copilot-opportunity-details/index.tsx b/src/apps/copilots/src/pages/copilot-opportunity-details/index.tsx index 7da42ff9a..cd86b3196 100644 --- a/src/apps/copilots/src/pages/copilot-opportunity-details/index.tsx +++ b/src/apps/copilots/src/pages/copilot-opportunity-details/index.tsx @@ -242,7 +242,7 @@ const CopilotOpportunityDetails: FC<{}> = () => { - {opportunity?.type && getOpportunityType(opportunity?.type)} + {opportunity?.type && getOpportunityType(opportunity?.type)}

From 9b6c7bc7b70552b81a11761942ed31f181b9b1ed Mon Sep 17 00:00:00 2001 From: Hentry Martin Date: Thu, 19 Jun 2025 23:56:53 +0530 Subject: [PATCH 08/10] fix: refetch opportunity details on canceling opportunity --- .../src/pages/copilot-opportunity-details/index.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/apps/copilots/src/pages/copilot-opportunity-details/index.tsx b/src/apps/copilots/src/pages/copilot-opportunity-details/index.tsx index cd86b3196..a2a02a70c 100644 --- a/src/apps/copilots/src/pages/copilot-opportunity-details/index.tsx +++ b/src/apps/copilots/src/pages/copilot-opportunity-details/index.tsx @@ -48,6 +48,7 @@ import { import { OpportunityDetails } from './tabs/opportunity-details' import { CopilotApplications } from './tabs/copilot-applications' import styles from './styles.module.scss' +import { toast } from 'react-toastify' const CopilotOpportunityDetails: FC<{}> = () => { const { opportunityId }: {opportunityId?: string} = useParams<{ opportunityId?: string }>() @@ -105,7 +106,7 @@ const CopilotOpportunityDetails: FC<{}> = () => { const onApplied: () => void = useCallback(() => { mutate(`${copilotBaseUrl}/copilots/opportunity/${opportunityId}/applications`) - mutate(`${copilotBaseUrl}/copilots/opportunity/${opportunityId}`) + mutate(`${copilotBaseUrl}/copilot/opportunity/${opportunityId}`) }, []) const onCloseApplyModal: () => void = useCallback(() => { @@ -125,7 +126,8 @@ const CopilotOpportunityDetails: FC<{}> = () => { if (opportunityId) { await cancelCopilotOpportunity(opportunityId) mutate(`${copilotBaseUrl}/copilots/opportunity/${opportunityId}/applications`) - mutate(`${copilotBaseUrl}/copilots/opportunity/${opportunityId}`) + mutate(`${copilotBaseUrl}/copilot/opportunity/${opportunityId}`) + toast.success("Canceled copilot opportunity successfully") } } From cca9941f2b523b4c958f69be48f29db1e7ac1aba Mon Sep 17 00:00:00 2001 From: Hentry Martin Date: Fri, 20 Jun 2025 00:11:14 +0530 Subject: [PATCH 09/10] fix: refetch opportunity details on canceling opportunity --- .../copilots/src/pages/copilot-opportunity-details/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/apps/copilots/src/pages/copilot-opportunity-details/index.tsx b/src/apps/copilots/src/pages/copilot-opportunity-details/index.tsx index a2a02a70c..538feb3a8 100644 --- a/src/apps/copilots/src/pages/copilot-opportunity-details/index.tsx +++ b/src/apps/copilots/src/pages/copilot-opportunity-details/index.tsx @@ -12,6 +12,7 @@ import { } from 'react' import { useLocation, useNavigate, useParams } from 'react-router-dom' import { mutate } from 'swr' +import { toast } from 'react-toastify' import moment from 'moment' import { @@ -48,7 +49,6 @@ import { import { OpportunityDetails } from './tabs/opportunity-details' import { CopilotApplications } from './tabs/copilot-applications' import styles from './styles.module.scss' -import { toast } from 'react-toastify' const CopilotOpportunityDetails: FC<{}> = () => { const { opportunityId }: {opportunityId?: string} = useParams<{ opportunityId?: string }>() @@ -127,7 +127,7 @@ const CopilotOpportunityDetails: FC<{}> = () => { await cancelCopilotOpportunity(opportunityId) mutate(`${copilotBaseUrl}/copilots/opportunity/${opportunityId}/applications`) mutate(`${copilotBaseUrl}/copilot/opportunity/${opportunityId}`) - toast.success("Canceled copilot opportunity successfully") + toast.success('Canceled copilot opportunity successfully') } } From 871976b6146bdd5aa33fb478c5b56d0323fc324b Mon Sep 17 00:00:00 2001 From: Hentry Martin Date: Fri, 20 Jun 2025 18:51:37 +0530 Subject: [PATCH 10/10] fix: sorting for duration --- src/apps/copilots/src/pages/copilot-opportunity-list/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apps/copilots/src/pages/copilot-opportunity-list/index.tsx b/src/apps/copilots/src/pages/copilot-opportunity-list/index.tsx index 8e37b687a..9c9bf4d3e 100644 --- a/src/apps/copilots/src/pages/copilot-opportunity-list/index.tsx +++ b/src/apps/copilots/src/pages/copilot-opportunity-list/index.tsx @@ -87,7 +87,7 @@ const tableColumns: TableColumn[] = [ { label: 'Duration(Weeks)', propertyName: 'numWeeks', - type: 'text', + type: 'number', }, { label: 'Complexity',