Skip to content

Commit 5c2dc3b

Browse files
committed
fix(ui): TE-2643 remove previous period compare btn
1 parent 8b7d79c commit 5c2dc3b

File tree

3 files changed

+2
-45
lines changed

3 files changed

+2
-45
lines changed

thirdeye-ui/e2e/pages/anomaly-view.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,7 @@ export class AnomalyViewPage extends BasePage {
195195
async checkConfirmAnomalyActions() {
196196
await expect(
197197
this.page.getByTestId("feedback-collector-text")
198-
).toHaveText(
199-
"Confirm anomalyCompare with previous time period to confirm this is an anomaly"
200-
);
198+
).toHaveText("Confirm anomaly");
201199
await expect(this.page.getByTestId("not-an-anomaly")).toHaveText(
202200
"No, this is not an anomaly"
203201
);
@@ -207,8 +205,5 @@ export class AnomalyViewPage extends BasePage {
207205
await expect(this.page.getByTestId("investigate-anomaly")).toHaveText(
208206
"Investigate Anomaly"
209207
);
210-
await expect(this.page.getByTestId("add-previous-period")).toHaveText(
211-
"Add previous period to compare"
212-
);
213208
}
214209
}

thirdeye-ui/src/app/components/anomalies-view/feedback-collector/feedback-collector.component.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,6 @@ export const FeedbackCollector: FunctionComponent<FeedbackCollectorProps> = ({
5252
<Typography variant="h4">
5353
{t("label.confirm-anomaly")}
5454
</Typography>
55-
<Typography variant="body1">
56-
{t(
57-
"message.compare-with-previous-time-period-to-confirm-this"
58-
)}
59-
</Typography>
6055
</Grid>
6156
<Grid
6257
item

thirdeye-ui/src/app/pages/anomalies-view-page/anomalies-view-validate-page.component.tsx

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@
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";
1616
import React, { FunctionComponent, useMemo } from "react";
17-
import { useTranslation } from "react-i18next";
1817
import { useOutletContext, useSearchParams } from "react-router-dom";
1918
import { Chart } from "../../components/anomalies-view/chart/chart.component";
2019
import { 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

Comments
 (0)