Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions thirdeye-ui/e2e/pages/anomaly-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,7 @@ export class AnomalyViewPage extends BasePage {
async checkConfirmAnomalyActions() {
await expect(
this.page.getByTestId("feedback-collector-text")
).toHaveText(
"Confirm anomalyCompare with previous time period to confirm this is an anomaly"
);
).toHaveText("Confirm anomaly");
await expect(this.page.getByTestId("not-an-anomaly")).toHaveText(
"No, this is not an anomaly"
);
Expand All @@ -207,8 +205,5 @@ export class AnomalyViewPage extends BasePage {
await expect(this.page.getByTestId("investigate-anomaly")).toHaveText(
"Investigate Anomaly"
);
await expect(this.page.getByTestId("add-previous-period")).toHaveText(
"Add previous period to compare"
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,6 @@ export const FeedbackCollector: FunctionComponent<FeedbackCollectorProps> = ({
<Typography variant="h4">
{t("label.confirm-anomaly")}
</Typography>
<Typography variant="body1">
{t(
"message.compare-with-previous-time-period-to-confirm-this"
)}
</Typography>
</Grid>
<Grid
item
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
* See the License for the specific language governing permissions and limitations under
* the License.
*/
import { Box, Button, Grid } from "@material-ui/core";
import { Grid } from "@material-ui/core";
import React, { FunctionComponent, useMemo } from "react";
import { useTranslation } from "react-i18next";
import { useOutletContext, useSearchParams } from "react-router-dom";
import { Chart } from "../../components/anomalies-view/chart/chart.component";
import { TimeRangeQueryStringKey } from "../../components/time-range/time-range-provider/time-range-provider.interfaces";
Expand All @@ -30,7 +29,6 @@ export const AnomaliesViewValidatePage: FunctionComponent = () => {
const { anomaly, alertInsight } =
useOutletContext<AnomalyViewContainerPageOutletContext>();
const [searchParams, setSearchParams] = useSearchParams();
const { t } = useTranslation();

// Array of strings in ISO-8601 format
const additionalCharts: string[] = useMemo(() => {
Expand All @@ -56,24 +54,6 @@ export const AnomaliesViewValidatePage: FunctionComponent = () => {
return [Number(start), Number(end)];
}, [searchParams]);

const handleAddChartClick = (): void => {
const newState = [...additionalCharts];

// Use the last previous period as the new previous period
if (newState.length > 0) {
newState.push(newState[newState.length - 1]);
} else {
// Default to no offset from the start and end
newState.push("P1W");
}

searchParams.set(
ADDITIONAL_CHARTS_QUERY_PARAM_KEY,
JSON.stringify(newState)
);
setSearchParams(searchParams);
};

const handleDeleteChartClick = (idx: number): void => {
const removedElement = [...additionalCharts];

Expand Down Expand Up @@ -158,19 +138,6 @@ export const AnomaliesViewValidatePage: FunctionComponent = () => {
</Grid>
);
})}
<Grid item xs={12}>
<Box textAlign="right">
<Button
color="primary"
data-testid="add-previous-period"
style={{ backgroundColor: "#FFF" }}
variant="outlined"
onClick={handleAddChartClick}
>
{t("label.add-previous-period-to-compare")}
</Button>
</Box>
</Grid>
</Grid>
</Grid>
);
Expand Down
Loading