-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Data Management, Test Queue and Candidate Review Pages and Dat…
…abase Implementation to support #648 (#688) Changes added to primarily support #648, but also #518 and w3c/aria-at#950. This includes functional changes to the Data Management, the Test Queue and the Candidate Review pages. It also includes changes to the database structure, described in #632. * feature: updates functionality of Data Management page (#713) * feature: updates functionality of Test Queue page (#715) * feature: updates functionality of Candidate Review page (#715) * feature: include functionality to support the concept of required reports (#722) * feature: adds Test Plan Report Status dialog (#728) * enhancement: move Candidate Phase Start Date and Target Completion Date into dedicated columns on Candidate Review page (#730) * feature: adds Test Plan Version page (#747) * enhancement: explicitly support ‘DEPRECATED’ phase status for TestPlanVersions (#749) * feature: adds filter and sorting functionality by columns headers on Data Management page (#750) * bugfix: update semantic structure of cells with multiple list items on Data Management page (#752) * enhancement: include GitHub issues on Test Plan Version page (#753) * bugfix: revision of the required reports conditions for updating to CANDIDATE and RECOMMENDED phases (#764) * bugfix: removes superfluous header from Test Plan Report Status dialog (#766) * bugfix: update and revise sorts, headings and descriptions of elements on Test Plan Version page (#767) * bugfix: account for several other update phase scenarios that could prevent the update from happening if there is an older TestPlanVersion that exists with results (#771) * bugfix: update headings and revise deprecated dates shown on Test Plan Version page (#773) * enhancement: allow updating of GitHub issues being presented in the app to be more easily understood (#775) * bugfix: correct deprecatedAt date to be relative to when the ‘next’ TestPlanVersion was added (#780) * enhancement: update the text shown when deprecation occurs during a phase on Test Plan Version page (#781) * bugfix: fix inverted sort descriptions and pin sort of of Test Plan name columns on Data Management page (#790) --------- Co-authored-by: Erika Miguel <[email protected]> Co-authored-by: Paul Clue <[email protected]> Co-authored-by: alflennik <[email protected]> Co-authored-by: Stalgia Grigg <[email protected]> Co-authored-by: Howard Edwards <[email protected]>
- Loading branch information
1 parent
a4ca04f
commit 14563b0
Showing
173 changed files
with
15,698 additions
and
5,409 deletions.
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
92 changes: 92 additions & 0 deletions
92
client/components/AddTestToQueueWithConfirmation/index.jsx
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,92 @@ | ||
import React, { useRef, useState } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { Button } from 'react-bootstrap'; | ||
import BasicModal from '../common/BasicModal'; | ||
import { useMutation } from '@apollo/client'; | ||
import { ADD_TEST_QUEUE_MUTATION } from '../TestQueue/queries'; | ||
import { LoadingStatus, useTriggerLoad } from '../common/LoadingStatus'; | ||
|
||
function AddTestToQueueWithConfirmation({ | ||
testPlanVersion, | ||
browser, | ||
at, | ||
disabled = false, | ||
buttonText = 'Add to Test Queue', | ||
triggerUpdate = () => {} | ||
}) { | ||
const [showConfirmation, setShowConfirmation] = useState(false); | ||
const [addTestPlanReport] = useMutation(ADD_TEST_QUEUE_MUTATION); | ||
const { triggerLoad, loadingMessage } = useTriggerLoad(); | ||
const buttonRef = useRef(); | ||
|
||
const feedbackModalTitle = 'Successfully Added Test Plan'; | ||
|
||
const feedbackModalContent = ( | ||
<> | ||
Successfully added <b>{testPlanVersion?.title}</b> for{' '} | ||
<b> | ||
{at?.name} and {browser?.name} | ||
</b>{' '} | ||
to the Test Queue. | ||
</> | ||
); | ||
|
||
const addTestToQueue = async () => { | ||
await triggerLoad(async () => { | ||
await addTestPlanReport({ | ||
variables: { | ||
testPlanVersionId: testPlanVersion.id, | ||
atId: at.id, | ||
browserId: browser.id | ||
} | ||
}); | ||
}, 'Adding Test Plan to Test Queue'); | ||
setShowConfirmation(true); | ||
}; | ||
|
||
return ( | ||
<> | ||
<LoadingStatus message={loadingMessage}></LoadingStatus> | ||
<Button | ||
ref={buttonRef} | ||
disabled={disabled} | ||
variant="secondary" | ||
onClick={addTestToQueue} | ||
className="w-auto" | ||
data-testid="add-button" | ||
> | ||
{buttonText} | ||
</Button> | ||
<BasicModal | ||
show={showConfirmation} | ||
closeButton={false} | ||
title={feedbackModalTitle} | ||
content={feedbackModalContent} | ||
closeLabel="Ok" | ||
handleClose={async () => { | ||
await triggerUpdate(); | ||
setShowConfirmation(false); | ||
setTimeout(() => { | ||
if (buttonRef?.current) { | ||
buttonRef.current.focus(); | ||
} | ||
}, 0); | ||
}} | ||
/> | ||
</> | ||
); | ||
} | ||
|
||
AddTestToQueueWithConfirmation.propTypes = { | ||
testPlanVersion: PropTypes.object, | ||
browser: PropTypes.object, | ||
at: PropTypes.object, | ||
buttonRef: PropTypes.object, | ||
onFocus: PropTypes.func, | ||
onBlur: PropTypes.func, | ||
disabled: PropTypes.bool, | ||
buttonText: PropTypes.string, | ||
triggerUpdate: PropTypes.func | ||
}; | ||
|
||
export default AddTestToQueueWithConfirmation; |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.