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

Add new modals based on #406 #415

Merged
merged 13 commits into from
May 3, 2022
Merged

Add new modals based on #406 #415

merged 13 commits into from
May 3, 2022

Conversation

howard-e
Copy link
Contributor

@howard-e howard-e commented Apr 13, 2022

This adds 3 new modals based on #406.

  • 'Assistive Technology and Browser Details Modal' as AtAndBrowserDetailsModal, along with logic to account for described scenarios.
  • 'Warning Modal' and 'Danger Modal' as BasicThemedModal, where a theme ('warning' or 'danger'), content and possible actions may be passed as props.
  • 'New AT Version Modal' and 'Edit an Existing AT Version Modal' as UpdateVersionModal.

See usage examples below:

<AtAndBrowserDetailsModal
    show={isShowing}
    isAdmin={false}
    atName="NVDA" // passed from Test Queue
    atVersion="2022.3.5" // passed from Test Queue
    atVersions={['2022.3.5', '2022.3.7', '2023.23.5']}
    browserName="Chrome" // passed from Test Queue
    browserVersion="97.0.4758"
    browserVersions={[
        '96.0.4758',
        '97.0.4758',
        '98.0.4758',
        '100.0.4896'
    ]}
    patternName="Checkbox" // required if isAdmin=true
    testerName="alflennik" // required if isAdmin=true
    handleAction={handleAction} // expects func(updatedAtVersion, updatedBrowserVersion) but to be discussed
    handleClose={handleClose}
/>

<BasicThemedModal
    show={isShowing}
    theme="warning" // or danger
    title="Your AT version is different than the one used to record this result"
    dialogClassName="modal-50w"
    content={
        <>
            You are currently running <b>NVDA 2022.2</b>, but
            are editing a test result that was submitted with{' '}
            <b>NVDA 2021.4</b>.
            <br />
            <br />
            Do you want to update the AT version used to record
            this test result?
        </>
    } // possible content to be templated and passed when required
    actionButtons={[
        {
            text: 'Update AT Version',
            action: handleUpdateAtVersion
        },
        {
            text: 'Continue without changes',
            action: handleContinue
        }
    ]}
    handleClose={handleClose}
/>

<UpdateVersionModal
    show={isShowing}
    title="Edit NVDA Version 2022"
    actionType="edit" // default is add
    handleAction={handleAction} // expects func(actionType, { updatedVersionText, updatedDateAvailabilityText }) but to be discussed
    handleClose={handleClose}
/>

@howard-e howard-e requested review from evmiguel and alflennik April 13, 2022 13:48
<Form.Label>
Approximate date of availability
</Form.Label>
<Form.Control
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This input should be masked to a date format (DD-MM-YYYY?)

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 to this

{uaMajor === '0' && (
<Form.Group className="at-browser-details-full-column">
<Form.Label>Enter Browser Version</Form.Label>
<Form.Control
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This version string input could be masked (x.y.z-additional.identifiers?)

Copy link
Contributor

@evmiguel evmiguel left a comment

Choose a reason for hiding this comment

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

Great job on all three modals and on updating the BasicModal. The usage examples demonstrate clean APIs for these components. The AtAndBrowserDetailsModal, especially, is clean, easy to read, and well implemented. Looking forward to seeing these components in the wild!

<Form.Label>
Approximate date of availability
</Form.Label>
<Form.Control
Copy link
Contributor

Choose a reason for hiding this comment

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

+1 to this

@howard-e howard-e merged commit 71337cd into main May 3, 2022
@howard-e howard-e deleted the add-new-modals branch May 3, 2022 13:42
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.

3 participants