Skip to content

PM-590 Add start date #1047

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

Merged
merged 5 commits into from
Apr 25, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/apps/admin/src/lib/models/MobileTableColumn.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
import { TableColumn } from '~/libs/ui'

export interface MobileTableColumn<T> extends TableColumn<T> {
readonly mobileType?: 'label'
readonly mobileType?: 'label' | 'last-value'
}
5 changes: 3 additions & 2 deletions src/apps/copilots/src/copilots.routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,19 @@ export const childRoutes = [
route: '/',
},
{
authRequired: true,
element: <CopilotsRequests />,
id: 'CopilotRequests',
route: '/requests',
},
{
authRequired: true,
element: <CopilotsRequestForm />,
id: 'CopilotRequestForm',
route: '/requests/new',
},
{
authRequired: true,
element: <CopilotsRequests />,
id: 'CopilotRequestDetails',
route: '/requests/:requestId',
Expand All @@ -54,10 +57,8 @@ export const copilotRoutesMap = childRoutes.reduce((allRoutes, route) => (

export const copilotsRoutes: ReadonlyArray<PlatformRoute> = [
{
authRequired: true,
children: [
...childRoutes,

],
domain: AppSubdomain.copilots,
element: <CopilotsApp />,
Expand Down
12 changes: 12 additions & 0 deletions src/apps/copilots/src/pages/copilot-opportunity-details/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { FC, useEffect, useState } from 'react'
import { useNavigate, useParams } from 'react-router-dom'
import moment from 'moment'

import {
ContentLayout,
Expand Down Expand Up @@ -60,6 +61,17 @@ const CopilotOpportunityDetails: FC<{}> = () => {
<span className={styles.infoValue}>{opportunity?.status}</span>
</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)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a fallback or default value for opportunity?.startDate in case it is undefined or null to prevent potential runtime errors.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
@himaniraghav3 checked this - looks like moment will intialize with current datetime in case of undefined startDate.
We fine with that?

.format('MMM D, YYYY')}

</span>
</div>
</div>
<div className={styles.infoColumn}>
<IconOutline.CalendarIcon className={styles.icon} />
<div className={styles.infoText}>
Expand Down
2 changes: 1 addition & 1 deletion src/apps/copilots/src/services/copilot-opportunities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export type CopilotOpportunityResponse = SWRResponse<CopilotOpportunity, Copilot
* @returns {CopilotOpportunityResponse} - The response containing the copilot request data.
*/
export const useCopilotOpportunity = (opportunityId?: string): CopilotOpportunityResponse => {
const url = opportunityId ? buildUrl(`${baseUrl}/copilots/opportunities/${opportunityId}`) : undefined
const url = opportunityId ? buildUrl(`${baseUrl}/copilot/opportunity/${opportunityId}`) : undefined

const fetcher = (urlp: string): Promise<CopilotOpportunity> => xhrGetAsync<CopilotOpportunity>(urlp)
.then(copilotOpportunityFactory)
Expand Down