diff --git a/docs/accessibility.md b/docs/accessibility.md index f2ba2ec386d..774283b8b78 100644 --- a/docs/accessibility.md +++ b/docs/accessibility.md @@ -54,7 +54,7 @@ For example: ``` -Known reactstrap components that accept the `color` prop and work with custom Treeherder colors: `Badge`, `Button`, `Card`, `DropdownToggle`, `FormText`, `NavBar`, `Progress`, `Spinner`. +Known reactstrap components that accept the `color` prop and work with custom Treeherder colors: `Badge`, `Button`, `Card`, `Dropdown.Toggle`, `FormText`, `NavBar`, `Progress`, `Spinner`. In case you need to add more custom colors, please add on [treeherder-custom-styles.css](https://github.com/mozilla/treeherder/blob/master/ui/css/treeherder-custom-styles.css#L348) style sheet. @@ -102,7 +102,7 @@ If your case is more specific, please check [this guide](https://css-tricks.com/ ## Interactive elements -When creating elements that have event listeners, prefer any component of the reactstrap interactive elements. Examples are: `Button`, `Input`, `DropdownToggle`. You can also choose a HTML `` element. +When creating elements that have event listeners, prefer any component of the reactstrap interactive elements. Examples are: `Button`, `Input`, `Dropdown.Toggle`. You can also choose a HTML `` element. If you need to insert an event listener in a non-interactive element, such as a `span`, add also an `aria-role` of `button`, `link`, `checkbox`, or whatever seems closer to the functionality of the element. @@ -116,10 +116,10 @@ If you need to insert an event listener in a non-interactive element, such as a There is a special case when you are creating a dropdown menu. First of all, try to follow [reactstrap structure](https://reactstrap.github.io/components/dropdowns/). -Lastly, insert an additional tag `prop` to `DropdownItem` component. +Lastly, insert an additional tag `prop` to `Dropdown.Item` component. ```jsx - Menu Item + Menu Item ``` ## Forms, inputs and buttons diff --git a/package.json b/package.json index 90397a9c9b1..9c68f116534 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "prop-types": "15.8.1", "query-string": "7.0.1", "react": "18.3.1", + "react-bootstrap": "2.10.10", "react-dates": "21.8.0", "react-dom": "18.3.1", "react-helmet": "6.1.0", @@ -55,7 +56,6 @@ "react-split-pane": "0.1.92", "react-table-6": "6.11.0", "react-tabs": "6.1.0", - "reactstrap": "8.10.1", "redoc": "2.4.0", "redux": "4.2.1", "redux-debounce": "1.0.1", diff --git a/ui/infra-compare/InfraCompareTable.jsx b/ui/infra-compare/InfraCompareTable.jsx index e738572aa53..94121165301 100644 --- a/ui/infra-compare/InfraCompareTable.jsx +++ b/ui/infra-compare/InfraCompareTable.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Table } from 'reactstrap'; +import { Table } from 'react-bootstrap'; import PropTypes from 'prop-types'; import { getJobsUrl } from '../helpers/url'; diff --git a/ui/infra-compare/InfraCompareTableControls.jsx b/ui/infra-compare/InfraCompareTableControls.jsx index 0a04e6bc2f8..aab81f9decd 100644 --- a/ui/infra-compare/InfraCompareTableControls.jsx +++ b/ui/infra-compare/InfraCompareTableControls.jsx @@ -1,6 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { Container, CustomInput, Label } from 'reactstrap'; +import { Container, Form } from 'react-bootstrap'; import FilterControls from '../shared/FilterControls'; @@ -110,11 +110,11 @@ export default class CompareTableControls extends React.Component { updateFilter={this.updateFilter} updateFilterText={this.updateFilterText} /> - - + Filter percentage: {filterPercent}% + + + {suite} - - {originalValue} - - + {originalJobs.size > 0 ? ( + Array.from(originalJobs).map(([jobName, durations]) => ( +

+ {jobName}: {durations.join(', ')} +

+ )) + ) : ( +

No jobs to show

+ )} +
+ Go to treeherder Job View + + + } + delay={{ show: 0, hide: 0 }} > - {originalJobs.size > 0 ? ( - Array.from(originalJobs).map(([jobName, durations]) => ( -

- {jobName}: {durations.join(', ')} -

- )) - ) : ( -

No jobs to show

- )} - - Go to treeherder Job View - - + + {originalValue} + + {originalValue < newValue && <} {originalValue > newValue && >} - + {newJobs.size > 0 ? ( + Array.from(newJobs).map(([jobName, duration]) => ( +

+ {jobName}: {duration.join(', ')} +

+ )) + ) : ( +

No jobs to show

+ )} + + Go to treeherder Job View + + + } + delay={{ show: 0, hide: 0 }} > - {newValue} -
+ + {newValue} + + - - {newJobs.size > 0 ? ( - Array.from(newJobs).map(([jobName, duration]) => ( -

- {jobName}: {duration.join(', ')} -

- )) - ) : ( -

No jobs to show

- )} - - Go to treeherder Job View - -
{originalFailures} {originalFailures < newFailures && <} diff --git a/ui/infra-compare/InfraCompareTableView.jsx b/ui/infra-compare/InfraCompareTableView.jsx index bfb9b6358ca..c409c7526f5 100644 --- a/ui/infra-compare/InfraCompareTableView.jsx +++ b/ui/infra-compare/InfraCompareTableView.jsx @@ -1,6 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { Col, Row, Container, Alert } from 'reactstrap'; +import { Col, Row, Container, Alert } from 'react-bootstrap'; import ErrorMessages from '../shared/ErrorMessages'; import { genericErrorMessage, errorMessageClass } from '../helpers/constants'; @@ -211,7 +211,7 @@ export default class InfraCompareTableView extends React.Component { {jobsNotDisplayed && jobsNotDisplayed.length > 0 && ( - + { - this.setState((prevState) => ({ dropdownOpen: !prevState.dropdownOpen })); - }; - updateDateRange = (dateRange) => { this.setState({ dateRange }); if (dateRange === 'custom range') { @@ -42,7 +37,7 @@ export default class DateOptions extends React.Component { render() { const { updateState } = this.props; - const { dropdownOpen, dateRange } = this.state; + const { dateRange } = this.state; const dateOptions = [ 'last 7 days', 'last 30 days', @@ -52,18 +47,13 @@ export default class DateOptions extends React.Component { return (
- - date range + - + {dateRange === 'custom range' && ( )} diff --git a/ui/intermittent-failures/DateRangePicker.jsx b/ui/intermittent-failures/DateRangePicker.jsx index 44824d97631..4c6ba12f371 100644 --- a/ui/intermittent-failures/DateRangePicker.jsx +++ b/ui/intermittent-failures/DateRangePicker.jsx @@ -5,7 +5,7 @@ import { DateRangePickerPhrases } from 'react-dates/lib/defaultPhrases'; import { DateRangePicker as DatePickerAirbnb } from 'react-dates'; import moment from 'moment'; import PropTypes from 'prop-types'; -import { Button } from 'reactstrap'; +import { Button } from 'react-bootstrap'; import { ISODate } from './helpers'; @@ -91,7 +91,7 @@ export default class DateRangePicker extends React.Component { isOutsideRange={(day) => moment().diff(day) < 0} phrases={defaultPhrases} /> -
diff --git a/ui/intermittent-failures/Graph.jsx b/ui/intermittent-failures/Graph.jsx index d66f3012c2b..5838e432404 100644 --- a/ui/intermittent-failures/Graph.jsx +++ b/ui/intermittent-failures/Graph.jsx @@ -1,7 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { VictoryChart, VictoryLine, VictoryLegend } from 'victory'; -import { Col } from 'reactstrap'; +import { Col } from 'react-bootstrap'; const Graph = ({ graphData, title, legendData }) => (