1212 * See the License for the specific language governing permissions and limitations under
1313 * the License.
1414 */
15- import { Box , Button , Grid } from "@material-ui/core" ;
15+ import { Grid } from "@material-ui/core" ;
1616import React , { FunctionComponent , useMemo } from "react" ;
17- import { useTranslation } from "react-i18next" ;
1817import { useOutletContext , useSearchParams } from "react-router-dom" ;
1918import { Chart } from "../../components/anomalies-view/chart/chart.component" ;
2019import { TimeRangeQueryStringKey } from "../../components/time-range/time-range-provider/time-range-provider.interfaces" ;
@@ -30,7 +29,6 @@ export const AnomaliesViewValidatePage: FunctionComponent = () => {
3029 const { anomaly, alertInsight } =
3130 useOutletContext < AnomalyViewContainerPageOutletContext > ( ) ;
3231 const [ searchParams , setSearchParams ] = useSearchParams ( ) ;
33- const { t } = useTranslation ( ) ;
3432
3533 // Array of strings in ISO-8601 format
3634 const additionalCharts : string [ ] = useMemo ( ( ) => {
@@ -56,24 +54,6 @@ export const AnomaliesViewValidatePage: FunctionComponent = () => {
5654 return [ Number ( start ) , Number ( end ) ] ;
5755 } , [ searchParams ] ) ;
5856
59- const handleAddChartClick = ( ) : void => {
60- const newState = [ ...additionalCharts ] ;
61-
62- // Use the last previous period as the new previous period
63- if ( newState . length > 0 ) {
64- newState . push ( newState [ newState . length - 1 ] ) ;
65- } else {
66- // Default to no offset from the start and end
67- newState . push ( "P1W" ) ;
68- }
69-
70- searchParams . set (
71- ADDITIONAL_CHARTS_QUERY_PARAM_KEY ,
72- JSON . stringify ( newState )
73- ) ;
74- setSearchParams ( searchParams ) ;
75- } ;
76-
7757 const handleDeleteChartClick = ( idx : number ) : void => {
7858 const removedElement = [ ...additionalCharts ] ;
7959
@@ -158,19 +138,6 @@ export const AnomaliesViewValidatePage: FunctionComponent = () => {
158138 </ Grid >
159139 ) ;
160140 } ) }
161- < Grid item xs = { 12 } >
162- < Box textAlign = "right" >
163- < Button
164- color = "primary"
165- data-testid = "add-previous-period"
166- style = { { backgroundColor : "#FFF" } }
167- variant = "outlined"
168- onClick = { handleAddChartClick }
169- >
170- { t ( "label.add-previous-period-to-compare" ) }
171- </ Button >
172- </ Box >
173- </ Grid >
174141 </ Grid >
175142 </ Grid >
176143 ) ;
0 commit comments