-
Notifications
You must be signed in to change notification settings - Fork 15
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
feat: Content updates to Candidate Review page #1186
Merged
Merged
Changes from 14 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
e1217eb
Add version string to candidate test plan run
stalgiag 997ff46
Link to 'test-review' for test plan version on CandidateTestPlanRun
stalgiag 7efaeb3
Update snapshot
stalgiag b2b5a38
Add At Version name to Candidate Review heading
stalgiag f4b5570
Add Run History to /candidate-test-plan/
stalgiag 3ef251f
Update snapshots
stalgiag 5d207c6
Merge branch 'development' into tpvs-candidate-review-page
stalgiag 215c62e
Update snapshots
stalgiag 2f31ab1
Revert incorrect snapshot update
stalgiag 32ad7bb
Component for Run History
stalgiag f22112d
Update snapshot
stalgiag 0e54f9c
Merge branch 'development' into tpvs-candidate-review-page
stalgiag c221484
Merge branch 'development' into tpvs-candidate-review-page
stalgiag 4f229f1
Use dates object
stalgiag 6caa980
Merge branch 'development' into tpvs-candidate-review-page
stalgiag b43f9f5
Use proptypes
stalgiag 1ef3d9d
Update snapshots
stalgiag File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import React, { useMemo } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
import styled from '@emotion/styled'; | ||
import { dates } from 'shared'; | ||
|
||
const RunListItem = styled.li` | ||
margin-bottom: 0.5rem; | ||
`; | ||
|
||
const RunHistory = ({ testPlanReports, testId }) => { | ||
if (!testPlanReports || testPlanReports.length === 0) { | ||
return null; | ||
} | ||
|
||
const lines = useMemo(() => { | ||
const l = []; | ||
for (const testPlanReport of testPlanReports) { | ||
const { draftTestPlanRuns, at, browser } = testPlanReport; | ||
for (const draftTestPlanRun of draftTestPlanRuns) { | ||
const { testResults, tester } = draftTestPlanRun; | ||
const testResult = testResults.find(item => item.test.id === testId); | ||
if (testResult?.completedAt) { | ||
l.push( | ||
<RunListItem | ||
key={`${testResult.atVersion.id}-${testResult.browserVersion.id}-${testResult.test.id}-${tester.username}`} | ||
> | ||
Tested with{' '} | ||
<b> | ||
{at.name} {testResult.atVersion.name} | ||
</b>{' '} | ||
and{' '} | ||
<b> | ||
{browser.name} {testResult.browserVersion.name} | ||
</b>{' '} | ||
by{' '} | ||
<b> | ||
<a href={`https://github.com/${tester.username}`}> | ||
{tester.username} | ||
</a> | ||
</b>{' '} | ||
on{' '} | ||
{dates.convertDateToString( | ||
testResult.completedAt, | ||
'MMMM DD, YYYY' | ||
)} | ||
. | ||
</RunListItem> | ||
); | ||
} | ||
} | ||
} | ||
return l; | ||
}, [testPlanReports, testId]); | ||
|
||
if (lines.length === 0) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<ul | ||
style={{ | ||
marginBottom: '0' | ||
}} | ||
> | ||
{lines} | ||
</ul> | ||
); | ||
}; | ||
|
||
// TODO: Add prop types when the proptypes definitions are merged | ||
RunHistory.propTypes = { | ||
testPlanReports: PropTypes.arrayOf(PropTypes.object), | ||
testId: PropTypes.string | ||
}; | ||
|
||
export default RunHistory; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Note to ourselves to also bring this to the TestRun page as well!