Skip to content

Conversation

@jessegarcia1
Copy link
Contributor

@jessegarcia1 jessegarcia1 commented Apr 2, 2025

Changes

added RR timeline

Screenshots

Screenshot 2025-04-30 at 8 02 07 PM Screenshot 2025-04-30 at 8 02 15 PM Screenshot 2025-04-30 at 8 02 29 PM

Checklist

It can be helpful to check the Checks and Files changed tabs.
Please review the contributor guide and reach out to your Tech Lead if anything is unclear.
Please request reviewers and ping on slack only after you've gone through this whole checklist.

  • All commits are tagged with the ticket number
  • No linting errors / newline at end of file warnings
  • All code follows repository-configured prettier formatting
  • No merge conflicts
  • All checks passing
  • Screenshots of UI changes (see Screenshots section)
  • Remove any non-applicable sections of this template
  • Assign the PR to yourself
  • No yarn.lock changes (unless dependencies have changed)
  • Request reviewers & ping on Slack
  • PR is linked to the ticket (fill in the closes line below)

Closes #3333

@jessegarcia1 jessegarcia1 self-assigned this Apr 2, 2025
@jessegarcia1 jessegarcia1 force-pushed the #3333-create-RRtimeline branch from 8fd7056 to 07a57e3 Compare April 3, 2025 01:32
@dreifusjack dreifusjack changed the title #3333 create r rtimeline #3333 create reimbursement request timeline Apr 3, 2025
@dreifusjack dreifusjack self-requested a review April 4, 2025 00:13
);
};

const EventSection: React.FC<EventSectionProps> = ({ event, isLast }) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can also render the connector line in the ReimbursementRequestTimeline component itself (tracking events.index), that way, you don't have to pass isLast to the EventSection.

Copy link
Contributor

@dreifusjack dreifusjack left a comment

Choose a reason for hiding this comment

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

This looks great so far! If you look at the mock the top event on the timeline should have a dashed line leading to it. Also for dates there will be a time associated with the date as well, so you might want to test that out in your mock data and play around with font sizes

@wavehassman wavehassman marked this pull request as draft April 18, 2025 22:58
reimbursementRequestId: string;
}

interface EventSectionProps {
Copy link
Contributor

@dreifusjack dreifusjack Apr 29, 2025

Choose a reason for hiding this comment

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

I would rename both this component and FirstSection to be a little more specific. Something like CommentsSection and CreateNewCommentSection

Copy link
Member

Choose a reason for hiding this comment

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

Unresolving this to rename the props interfaces

Copy link
Contributor

@dreifusjack dreifusjack left a comment

Choose a reason for hiding this comment

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

Great work! I added some commits to fix some things up. I think TimelineCommentModal and CommentModal should be merged into the same component since TimelineCommentModal is essentially just a wrapper

@wavehassman wavehassman marked this pull request as ready for review May 1, 2025 17:11
export const useCreateReimbursementRequestComment = (reimbursementRequestId: string) => {
const queryClient = useQueryClient();
return useMutation<ReimbursementRequestComment, Error, ReimbursementRequestCommentPayload>(
['reimbursement-requests', 'create'],
Copy link
Member

Choose a reason for hiding this comment

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

add comment

Copy link
Contributor

Choose a reason for hiding this comment

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

This needs to be 'reimbursement-requests', or the timeline doesn't update when a user creates a new one, because we are getting the comments from a single reimbursement request.

comment: yup
.string()
.required('Comment is required')
.test('comment exists', 'Comment field cannot be empty', (value) => {
Copy link
Member

Choose a reason for hiding this comment

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

I believe this test and the next one are redundant -- should be covered by .required

mode: 'onChange'
});

const handleConfirm = async (data: { comment: string; reimbursementRequestId: string }) => {
Copy link
Member

Choose a reason for hiding this comment

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

nit: you should be able to remove data: here, and then the values will be destructured (no need for data.[whatever]

reimbursementRequestId: string;
}

interface EventSectionProps {
Copy link
Member

Choose a reason for hiding this comment

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

Unresolving this to rename the props interfaces


const CommentsSection: React.FC<EventSectionProps> = ({ comment, isLast }) => {
const commentTime = new Date(comment.dateCreated).toLocaleTimeString();
const newCommentTime = commentTime.slice(0, -6) + commentTime.slice(-3);
Copy link
Member

Choose a reason for hiding this comment

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

add a quick comment explaining this. also, would honesly prefer you use let here and. just reassign commentTime

Copy link
Member

@walker-sean walker-sean left a comment

Choose a reason for hiding this comment

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

Nice work with the previously requested changes! Main concern right now: the timeline should have it's own section with spacing and a header like the mocks, also would be nice to have some margin below it

setTimelineCommentModalShow(true);
}}
>
<Typography fontWeight={'regular'}>Send a Follow-Up Message!</Typography>
Copy link
Member

Choose a reason for hiding this comment

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

Make this a link so that the cursor will change over it

<Stack direction="column" alignItems="center" spacing={0.5}>
<CreateNewCommentSection reimbursementRequestId={reimbursementRequestId} comments={comments} />
{comments.map((comment, index) => (
<CommentsSection comment={comment} isLast={comments.length - 1 === index} key={index} />
Copy link
Member

@walker-sean walker-sean May 3, 2025

Choose a reason for hiding this comment

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

"Comment" is a little bit of a misnomer when I think about it. This is really for activity tracking. One such activity could be a follow-up comment. If it is a follow up, it should say "____ followed up: ____"

@walker-sean walker-sean merged commit 461f809 into feature/finance-redesign May 4, 2025
4 checks passed
@walker-sean walker-sean deleted the #3333-create-RRtimeline branch May 4, 2025 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants