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
Adding date and time to test queue and new test plan dropdown #397
Conversation
client/utils/dateInterval.js
Outdated
} | ||
|
||
return `${intervalNumber} ${intervalUnit} ago`; | ||
}; |
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.
Nicely done!
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.
agreed with @alflennik that this is really slick! However, Matt prefers that we use absolute dates instead of relative times, always (I mentioned that GitHub uses this approach, but he felt consistency and no relative times was clearer). Can we change the output to always be the formatted date string?
Also, can we add the time in order to disambiguate between two commits on the same day?
What do you think of something like this?
`${startDate.toLocaleString('default', { month: 'short' })} ${startDate.getDate()}, ${startDate.getFullYear()} ${startDate.toLocaleTimeString()}`
client/utils/dateInterval.test.js
Outdated
const dateIntervalString = calculateDateInterval(startDate, endDate); | ||
expect(dateIntervalString).toBe('Jan 1, 2022'); | ||
}); | ||
}); |
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.
Great job with the tests too 👍
207974e
to
539587b
Compare
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.
@evmiguel this PR is awesome!
I received some feedback from Matt in a 1:1 last night that changes the requirements slightly. Sorry for the churn!
client/utils/dateInterval.js
Outdated
} | ||
|
||
return `${intervalNumber} ${intervalUnit} ago`; | ||
}; |
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.
agreed with @alflennik that this is really slick! However, Matt prefers that we use absolute dates instead of relative times, always (I mentioned that GitHub uses this approach, but he felt consistency and no relative times was clearer). Can we change the output to always be the formatted date string?
Also, can we add the time in order to disambiguate between two commits on the same day?
What do you think of something like this?
`${startDate.toLocaleString('default', { month: 'short' })} ${startDate.getDate()}, ${startDate.getFullYear()} ${startDate.toLocaleTimeString()}`
@@ -114,25 +115,44 @@ const TestQueueRow = ({ | |||
}; | |||
|
|||
const renderAssignedUserToTestPlan = () => { | |||
const gitShaDateDifference = ( |
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.
Matt felt strongly that the Test Queue rows should just show the date, not the Git SHA... Can we remove the Git SHA here, (but keep it where it appears in the NewTestPlanReportModal picker)?
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.
If it is just the date displayed then what would be a delineation if there are two tests published the same day?
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.
Yep, had the same thought--see sibling comment about adding time to date string...
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.
+1 on adding time in addition to absolute date format. SHAs don't really mean anything whereas time solves the delineation issue brought up by Rich and does mean something for the user.
Just to throw more variables in to the mix, I think including the word "revised" will help both sighted and unsighted users understand the contextual meaning of the date. We could put Visually, I think we should bump up the font size of the test plan link to |
@alflennik would it still be revised if it was an initial test? Maybe the use of Published would fit all situations. |
@richnoah here's what that looks like. I also threw in a more specific date assuming that's what we go with. I think published is good, maybe it's better than revised haha. I like it. Note... I forgot the space between @s3ththompson do you think this is something Matt would sign off on? |
server/resources/commands.json
Outdated
{ | ||
"id": "TWO", | ||
"text": "2" | ||
}, | ||
{ | ||
"id": "T_THEN_DOWN", | ||
"text": "T followed by Down Arrow" |
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.
Do you know why these changes are here? We don't necessarily need to get rid of them, but I'm just sort of curious what's going on here...?
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.
I took this out. Sneaky file!
new Date(item.updatedAt), | ||
new Date() | ||
)}{' '} | ||
({item.gitSha.substring(0, 5)}) |
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.
Typically the shortened git shas are seven characters, not five, I think.
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.
Assuming we keep the shas at all. Seems like we've decided to drop them.
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.
@s3ththompson are we keeping the SHAs?
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.
Sorry for not being clearer... Matt's feedback was to remove SHAs from the TestQueueRows, but keep them in the NewTestPlanReportModal:
- TestQueueRows:
Nov 18, 2021 at 1:31pm
- NewTestPlanReportModal:
Nov 18, 2021 at 1:31pm (sha1234)
orNov 18, 2021 at 1:31pm "Create tests for APG design pattern example: Main Landmark" (sha1234)
Matt expressed that if we could add commit messages to the modal that would be even better, but I think we should do whatever is easier here since this is a temporary fix.
I like the use of the label "Published". should we consider other labels like "Last modified"? @alflennik good job on the styling. I agree with your font-treatment suggestions |
c6a2607
to
0b08083
Compare
@s3ththompson @alflennik @richnoah @isaacdurazo - Here's what I did:
|
8a78f68
to
67aed2f
Compare
67aed2f
to
06fc951
Compare
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.
I did make one note about the capitalization, but I think it's optional. This looks great, and good job rolling with the punches.
… message to test plan version picker
06fc951
to
713f852
Compare
Confirmed the PM is now pm, nice. |
In this PR, I did not include weeks or months as a unit of time. The only units I included were days and hours, mostly because when I started to add weeks and months, the calculations were not precise enough. In this implementation, if the number of days passes 30 days, the date as a string will be used instead; this approach is just like GitHub. See how React commits look like
This PR adds the days and git SHAs to the Test Plan rows. It also adds the days and git SHAs to the version picker in the Add Test Plan picker.