Skip to content
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

Merged
merged 2 commits into from Jan 13, 2022

Conversation

evmiguel
Copy link
Contributor

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.

Screen Shot 2022-01-12 at 12 37 00 PM

Screen Shot 2022-01-12 at 12 37 42 PM

}

return `${intervalNumber} ${intervalUnit} ago`;
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Nicely done!

Copy link
Member

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()}`

const dateIntervalString = calculateDateInterval(startDate, endDate);
expect(dateIntervalString).toBe('Jan 1, 2022');
});
});
Copy link
Contributor

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 👍

Copy link
Member

@s3ththompson s3ththompson left a 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!

}

return `${intervalNumber} ${intervalUnit} ago`;
};
Copy link
Member

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 = (
Copy link
Member

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)?

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?

Copy link
Member

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...

Copy link
Member

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.

@alflennik
Copy link
Contributor

Test queue table with the word revision under the test plan

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 (commit d1abe0) in parentheses following the text, if we decide it is needed.

Visually, I think we should bump up the font size of the test plan link to 1.1rem and lower the font size of the revision text to 0.9rem, and make it italic, as pictured.

@richnoah
Copy link

@alflennik would it still be revised if it was an initial test? Maybe the use of Published would fit all situations.

@alflennik
Copy link
Contributor

alflennik commented Jan 12, 2022

Test queue test plan showing the word published and a more exact date

@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 1:31 and pm.

@s3ththompson do you think this is something Matt would sign off on?

{
"id": "TWO",
"text": "2"
},
{
"id": "T_THEN_DOWN",
"text": "T followed by Down Arrow"
Copy link
Contributor

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...?

Copy link
Contributor Author

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)})
Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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?

Copy link
Member

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) or
    • Nov 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.

@isaacdurazo
Copy link
Member

isaacdurazo commented Jan 12, 2022

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

@evmiguel
Copy link
Contributor Author

evmiguel commented Jan 12, 2022

@s3ththompson @alflennik @richnoah @isaacdurazo - Here's what I did:

  • Absolute date in TestQueueRow
  • Absolute date, git commit message, and git SHA in NewTestPlanReportModal
  • Styling suggested by @alflennik
  • Use of "Published" or "Revised"

Screen Shot 2022-01-13 at 1 58 25 PM

Screen Shot 2022-01-13 at 10 26 33 AM

@evmiguel evmiguel force-pushed the testplan-with-time branch 2 times, most recently from 8a78f68 to 67aed2f Compare January 12, 2022 21:43
Copy link
Contributor

@alflennik alflennik left a 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.

@alflennik
Copy link
Contributor

Confirmed the PM is now pm, nice.

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.

None yet

5 participants