Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ const tableColumns: TableColumn<CopilotOpportunity>[] = [
label: 'Payment',
propertyName: 'paymentType',
renderer: (copilotOpportunity: CopilotOpportunity) => (
<div>
<div className={styles.payment}>
{copilotOpportunity.paymentType === 'standard'
? copilotOpportunity.paymentType : copilotOpportunity.otherPaymentType}
? copilotOpportunity.paymentType : copilotOpportunity.otherPaymentType.slice(0, 8)}

Choose a reason for hiding this comment

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

Consider handling cases where otherPaymentType might be null or undefined to avoid potential runtime errors when calling slice(0, 8).

</div>
),
type: 'element',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,8 @@
.type {
white-space: nowrap;
}

.payment {
white-space: nowrap;
}

5 changes: 5 additions & 0 deletions src/apps/copilots/src/pages/copilot-request-form/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,11 @@ const CopilotRequestForm: FC<{}> = () => {
key: 'otherPaymentType',
message: 'Field cannot be left empty',
},
{
condition: formValues.otherPaymentType.trim().length > 8,
key: 'otherPaymentType',
message: 'Field only allows 8 characters',
},
]

fieldValidations.forEach(
Expand Down