-
Notifications
You must be signed in to change notification settings - Fork 21
[PROD] - Payment Status UI fixes & logs #1358
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
32440d7
cdd9899
ebdef7a
7234ac0
a384094
f520962
1690c77
bc604b3
79d77e3
e74a2c7
e12cfd9
242084d
51d2188
674c4ed
dab66df
321fbb2
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 |
|---|---|---|
|
|
@@ -10,6 +10,13 @@ | |
| width: 100%; | ||
| border-collapse: collapse; | ||
|
|
||
| &.reviewsTable { | ||
| tr:last-child { | ||
| td { | ||
| border-bottom: none; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| &.reviewsTable thead tr th { | ||
| border-top: 1px solid #A8A8A8; | ||
|
|
@@ -25,7 +32,7 @@ | |
| } | ||
|
|
||
| .scoreCol { | ||
| text-align: right; | ||
| text-align: left; | ||
|
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. [ |
||
| } | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -128,6 +128,7 @@ | |
| } | ||
|
|
||
| .aiReviewerRow { | ||
| padding-bottom: 0; | ||
| @include ltelg { | ||
| tr:has(&) { | ||
| td:first-child { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,11 +40,10 @@ const AiFeedback: FC<AiFeedbackProps> = props => { | |
| await createFeedbackComment(workflowId as string, workflowRun?.id as string, feedback?.id, { | ||
| content, | ||
| }) | ||
| await mutate(` | ||
| ${EnvironmentConfig.API.V6}/workflows/${workflowId}/runs/${workflowRun?.id}/items?[${workflowRun?.status}] | ||
| `) | ||
| // eslint-disable-next-line max-len | ||
| await mutate(`${EnvironmentConfig.API.V6}/workflows/${workflowId}/runs/${workflowRun?.id}/items?[${workflowRun?.status}]`) | ||
| setShowReply(false) | ||
| }, [workflowId, workflowRun?.id, feedback?.id]) | ||
| }, [workflowId, workflowRun?.id, workflowRun?.status, feedback?.id]) | ||
|
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. [ |
||
|
|
||
| if (!aiFeedbackItems?.length || !feedback) { | ||
| return <></> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,19 +36,17 @@ export const AiFeedbackComment: FC<AiFeedbackCommentProps> = props => { | |
| content, | ||
| parentId: comment.id, | ||
| }) | ||
| await mutate(` | ||
| ${EnvironmentConfig.API.V6}/workflows/${workflowId}/runs/${workflowRun?.id}/items?[${workflowRun?.status}] | ||
| `) | ||
| // eslint-disable-next-line max-len | ||
| await mutate(`${EnvironmentConfig.API.V6}/workflows/${workflowId}/runs/${workflowRun?.id}/items?[${workflowRun?.status}]`) | ||
|
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. [ |
||
| setShowReply(false) | ||
| }, [workflowId, workflowRun?.id, props.feedback?.id]) | ||
|
|
||
| const onEditReply = useCallback(async (content: string, comment: AiFeedbackCommentType) => { | ||
| await updateRunItemComment(workflowId as string, workflowRun?.id as string, props.feedback?.id, comment.id, { | ||
| content, | ||
| }) | ||
| await mutate(` | ||
| ${EnvironmentConfig.API.V6}/workflows/${workflowId}/runs/${workflowRun?.id}/items?[${workflowRun?.status}] | ||
| `) | ||
| // eslint-disable-next-line max-len | ||
| await mutate(`${EnvironmentConfig.API.V6}/workflows/${workflowId}/runs/${workflowRun?.id}/items?[${workflowRun?.status}]`) | ||
|
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. [ |
||
| setEditMode(false) | ||
| }, [workflowId, workflowRun?.id, props.feedback?.id]) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,32 +41,30 @@ export const useReviewForm = ({ | |
| }, [isDirty, onFormChange]) | ||
|
|
||
| useEffect(() => { | ||
| if (reviewItems?.length) { | ||
| const newFormData = { | ||
| reviews: reviewItems.map( | ||
| (reviewItem, reviewItemIndex) => ({ | ||
| comments: 'reviewItemComments' in reviewItem ? reviewItem.reviewItemComments?.map( | ||
| (commentItem, commentIndex) => ({ | ||
| content: commentItem.content ?? '', | ||
| id: commentItem.id, | ||
| index: commentIndex, | ||
| type: commentItem.type ?? '', | ||
| }), | ||
| ) : [], | ||
| id: reviewItem.id, | ||
| index: reviewItemIndex, | ||
| initialAnswer: ( | ||
| ('finalAnswer' in reviewItem && reviewItem.finalAnswer) | ||
| || ('initialAnswer' in reviewItem && reviewItem.initialAnswer) | ||
| || ('questionScore' in reviewItem && reviewItem.questionScore) | ||
| || undefined | ||
| ) as string, | ||
| scorecardQuestionId: reviewItem.scorecardQuestionId, | ||
| }), | ||
| ), | ||
| } | ||
| reset(newFormData) | ||
| const newFormData = { | ||
|
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. [ |
||
| reviews: (reviewItems ?? []).map( | ||
| (reviewItem, reviewItemIndex) => ({ | ||
| comments: 'reviewItemComments' in reviewItem ? reviewItem.reviewItemComments?.map( | ||
| (commentItem, commentIndex) => ({ | ||
| content: commentItem.content ?? '', | ||
| id: commentItem.id, | ||
| index: commentIndex, | ||
| type: commentItem.type ?? '', | ||
| }), | ||
| ) : [], | ||
| id: reviewItem.id, | ||
| index: reviewItemIndex, | ||
| initialAnswer: ( | ||
| ('finalAnswer' in reviewItem && reviewItem.finalAnswer) | ||
| || ('initialAnswer' in reviewItem && reviewItem.initialAnswer) | ||
| || ('questionScore' in reviewItem && reviewItem.questionScore) | ||
| || undefined | ||
| ) as string, | ||
| scorecardQuestionId: reviewItem.scorecardQuestionId, | ||
| }), | ||
| ), | ||
| } | ||
| reset(newFormData) | ||
| }, [reviewItems, reset]) | ||
|
|
||
| const touchedAllFields = useCallback(() => { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,6 +36,9 @@ const AiReviewViewer: FC = () => { | |
| challengeInfo, | ||
| }: ChallengeDetailContextModel = useChallengeDetailsContext() | ||
| const navigate = useAppNavigate() | ||
| const workflowRunIsFailed = [ | ||
|
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. [💡 |
||
| AiWorkflowRunStatusEnum.FAILURE, | ||
| ].includes(workflowRun?.status as AiWorkflowRunStatusEnum) | ||
|
|
||
| const tabItems: SelectOption[] = [ | ||
| { | ||
|
|
@@ -56,7 +59,7 @@ const AiReviewViewer: FC = () => { | |
| label: 'Scorecard', | ||
| value: 'scorecard', | ||
| }, | ||
| { label: `Attachments (${totalCount ?? 0})`, value: 'attachments' }, | ||
| { label: `Attachments${workflowRunIsFailed ? '' : ` (${totalCount ?? 0})`}`, value: 'attachments' }, | ||
| ] | ||
| const isFailedRun = useMemo(() => ( | ||
| workflowRun && [ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -217,7 +217,7 @@ const ListView: FC<ListViewProps> = (props: ListViewProps) => { | |
| if (updateObj.paymentStatus !== undefined) { | ||
| if (updateObj.paymentStatus === 'Owed') { | ||
| paymentStatus = 'OWED' | ||
| } else if (updateObj.paymentStatus === 'On Hold') { | ||
| } else if (updateObj.paymentStatus === 'On Hold (Admin)') { | ||
| paymentStatus = 'ON_HOLD_ADMIN' | ||
| } else if (updateObj.paymentStatus === 'Cancel') { | ||
| paymentStatus = 'CANCELLED' | ||
|
|
@@ -267,24 +267,14 @@ const ListView: FC<ListViewProps> = (props: ListViewProps) => { | |
| }, [fetchWinnings]) | ||
|
|
||
| const onPaymentEditCallback = useCallback((payment: Winning) => { | ||
| let status = payment.status | ||
| if (status === 'On Hold (Admin)') { | ||
| status = 'On Hold' | ||
| } else if (['On Hold (Member)', 'On Hold (Tax Form)', 'On Hold (Payment Provider)'].indexOf(status) !== -1) { | ||
| status = 'Owed' | ||
| } | ||
|
|
||
| setConfirmFlow({ | ||
|
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. [ |
||
| action: 'Save', | ||
| callback: async () => { | ||
| updatePayment(payment.id) | ||
| }, | ||
| content: ( | ||
| <PaymentEditForm | ||
| payment={{ | ||
| ...payment, | ||
| status, | ||
| }} | ||
| payment={payment} | ||
| canSave={setIsConfirmFormValid} | ||
| onValueUpdated={handleValueUpdated} | ||
| /> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -179,9 +179,16 @@ const PaymentEdit: React.FC<PaymentEditFormProps> = (props: PaymentEditFormProps | |
|
|
||
| const options = useCallback(() => { | ||
| if (props.payment.status.toUpperCase() !== 'PAID') { | ||
| const isMemberHold = [ | ||
| 'On Hold (Member)', | ||
| 'On Hold (Tax Form)', | ||
| 'On Hold (Payment Provider)', | ||
| ].includes(props.payment.status) | ||
|
|
||
| return [ | ||
|
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. [ |
||
| ...(isMemberHold ? [{ label: props.payment.status, value: props.payment.status }] : []), | ||
| { label: 'Owed', value: 'Owed' }, | ||
| { label: 'On Hold', value: 'On Hold' }, | ||
| { label: 'On Hold (Admin)', value: 'On Hold (Admin)' }, | ||
| { label: 'Cancel', value: 'Cancel' }, | ||
| ] | ||
| } | ||
|
|
||
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.
[💡
maintainability]The nested
&.reviewsTableselector is redundant since it is already within the.reviewsTableblock. Consider removing the nested selector to simplify the code.