-
Notifications
You must be signed in to change notification settings - Fork 17
fix(PM-1373, PM-1375, PM-1376, PM-1383, PM-1380, PM-1378): demo feedbacks implementation #1116
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 4 commits
cd48385
0393ba4
2001031
ce59d56
389903d
d67e59e
9b6c7bc
cca9941
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 |
---|---|---|
|
@@ -28,6 +28,7 @@ import { textFormatDateLocaleShortString } from '~/libs/shared' | |
|
||
import { CopilotApplication } from '../../models/CopilotApplication' | ||
import { | ||
cancelCopilotOpportunity, | ||
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 function |
||
copilotBaseUrl, | ||
CopilotOpportunityResponse, | ||
useCopilotApplications, | ||
|
@@ -119,11 +120,25 @@ const CopilotOpportunityDetails: FC<{}> = () => { | |
) | ||
} | ||
|
||
async function cancelCopilotOpportunityHandler(): Promise<void> { | ||
if (opportunityId) { | ||
await cancelCopilotOpportunity(opportunityId) | ||
mutate(`${copilotBaseUrl}/copilots/opportunity/${opportunityId}/applications`) | ||
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 |
||
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,10 @@ 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 +174,97 @@ const CopilotOpportunityDetails: FC<{}> = () => { | |
{isValidating && !showNotFound && ( | ||
<LoadingSpinner /> | ||
) } | ||
<h1 className={styles.header}> | ||
{opportunity?.projectName} | ||
</h1> | ||
<div className={styles.infoRow}> | ||
<div className={styles.infoColumn}> | ||
<IconOutline.ClipboardCheckIcon className={styles.icon} /> | ||
<div className={styles.infoText}> | ||
<span className={styles.infoHeading}>Status</span> | ||
<span className={styles.infoValue}>{opportunity?.status}</span> | ||
<div className={styles.wrapper}> | ||
<h1 className={styles.header}> | ||
{opportunity?.projectName} | ||
</h1> | ||
<div className={styles.infoRow}> | ||
<div className={styles.infoColumn}> | ||
<IconOutline.ClipboardCheckIcon className={styles.icon} /> | ||
<div className={styles.infoText}> | ||
<span className={styles.infoHeading}>Status</span> | ||
<span className={styles.infoValue}>{opportunity?.status}</span> | ||
</div> | ||
</div> | ||
</div> | ||
<div className={styles.infoColumn}> | ||
<IconOutline.PlayIcon className={styles.icon} /> | ||
<div className={styles.infoText}> | ||
<span className={styles.infoHeading}>Start Date</span> | ||
<span className={styles.infoValue}> | ||
{moment(opportunity?.startDate) | ||
.format('MMM D, YYYY')} | ||
|
||
</span> | ||
<div className={styles.infoColumn}> | ||
<IconOutline.PlayIcon className={styles.icon} /> | ||
<div className={styles.infoText}> | ||
<span className={styles.infoHeading}>Start Date</span> | ||
<span className={styles.infoValue}> | ||
{moment(opportunity?.startDate) | ||
.format('MMM D, YYYY')} | ||
|
||
</span> | ||
</div> | ||
</div> | ||
</div> | ||
<div className={styles.infoColumn}> | ||
<IconOutline.CalendarIcon className={styles.icon} /> | ||
<div className={styles.infoText}> | ||
<span className={styles.infoHeading}>Duration</span> | ||
<span className={styles.infoValue}> | ||
{opportunity?.numWeeks} | ||
{' '} | ||
weeks | ||
</span> | ||
<div className={styles.infoColumn}> | ||
<IconOutline.CalendarIcon className={styles.icon} /> | ||
<div className={styles.infoText}> | ||
<span className={styles.infoHeading}>Duration</span> | ||
<span className={styles.infoValue}> | ||
{opportunity?.numWeeks} | ||
{' '} | ||
weeks | ||
</span> | ||
</div> | ||
</div> | ||
</div> | ||
<div className={styles.infoColumn}> | ||
<IconOutline.ClockIcon className={styles.icon} /> | ||
<div className={styles.infoText}> | ||
<span className={styles.infoHeading}>Hours</span> | ||
<span className={styles.infoValue}> | ||
{opportunity?.numHoursPerWeek} | ||
{' '} | ||
hours/week | ||
</span> | ||
<div className={styles.infoColumn}> | ||
<IconOutline.ClockIcon className={styles.icon} /> | ||
<div className={styles.infoText}> | ||
<span className={styles.infoHeading}>Hours</span> | ||
<span className={styles.infoValue}> | ||
{opportunity?.numHoursPerWeek} | ||
{' '} | ||
hours/week | ||
</span> | ||
</div> | ||
</div> | ||
</div> | ||
<div className={styles.infoColumn}> | ||
<IconOutline.CogIcon className={styles.icon} /> | ||
<div className={styles.infoText}> | ||
<span className={styles.infoHeading}>Type</span> | ||
<span className={styles.infoValue}>{opportunity?.type}</span> | ||
<div className={styles.infoColumn}> | ||
<IconOutline.CogIcon className={styles.icon} /> | ||
<div className={styles.infoText}> | ||
<span className={styles.infoHeading}>Type</span> | ||
<span className={styles.infoValue}>{opportunity?.type}</span> | ||
</div> | ||
</div> | ||
</div> | ||
<div className={styles.infoColumn}> | ||
<IconOutline.GlobeAltIcon className={styles.icon} /> | ||
<div className={styles.infoText}> | ||
<span className={styles.infoHeading}>Working Hours</span> | ||
<span className={styles.infoValue}>{opportunity?.tzRestrictions}</span> | ||
<div className={styles.infoColumn}> | ||
<IconOutline.GlobeAltIcon className={styles.icon} /> | ||
<div className={styles.infoText}> | ||
<span className={styles.infoHeading}>Working Hours</span> | ||
<span className={styles.infoValue}>{opportunity?.tzRestrictions}</span> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
{ | ||
initialized && ( | ||
<TabsNavbar | ||
defaultActive={activeTab} | ||
onChange={handleTabChange} | ||
tabs={getCopilotDetailsTabsConfig(isAdminOrPM)} | ||
{ | ||
initialized && ( | ||
<TabsNavbar | ||
defaultActive={activeTab} | ||
onChange={handleTabChange} | ||
tabs={getCopilotDetailsTabsConfig(isAdminOrPM)} | ||
/> | ||
) | ||
} | ||
{activeTab === CopilotDetailsTabViews.details && <OpportunityDetails opportunity={opportunity} />} | ||
{activeTab === CopilotDetailsTabViews.applications && isAdminOrPM && opportunity && ( | ||
<CopilotApplications | ||
copilotApplications={copilotApplications} | ||
opportunity={opportunity} | ||
members={members} | ||
/> | ||
) | ||
} | ||
{activeTab === CopilotDetailsTabViews.details && <OpportunityDetails opportunity={opportunity} />} | ||
{activeTab === CopilotDetailsTabViews.applications && isAdminOrPM && opportunity && ( | ||
<CopilotApplications | ||
copilotApplications={copilotApplications} | ||
opportunity={opportunity} | ||
members={members} | ||
/> | ||
)} | ||
)} | ||
|
||
{ | ||
showApplyOpportunityModal | ||
&& opportunity && ( | ||
<ApplyOpportunityModal | ||
copilotOpportunityId={opportunity?.id} | ||
onClose={onCloseApplyModal} | ||
projectName={opportunity?.projectName} | ||
onApplied={onApplied} | ||
/> | ||
) | ||
} | ||
</div> | ||
|
||
{ | ||
showApplyOpportunityModal | ||
&& opportunity && ( | ||
<ApplyOpportunityModal | ||
copilotOpportunityId={opportunity?.id} | ||
onClose={onCloseApplyModal} | ||
projectName={opportunity?.projectName} | ||
onApplied={onApplied} | ||
/> | ||
) | ||
} | ||
</ContentLayout> | ||
) | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
@import '@libs/ui/styles/includes'; | ||
|
||
.wrapper { | ||
min-height: 800px; | ||
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. Consider using a more flexible unit for |
||
} | ||
|
||
.header { | ||
display: flex; | ||
align-items: center; | ||
|
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 input field name has been changed from 'Notes' to 'Reason'. Ensure that this change is reflected consistently throughout the codebase, including any form handling logic or validation that may rely on the field name.