Skip to content

Commit

Permalink
fix(ui): TE-2216 Reverted to old URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
harshilvelotio committed Sep 18, 2024
1 parent a287cab commit 00a3d6f
Show file tree
Hide file tree
Showing 9 changed files with 117 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const NavigateAlertCreationFlowsDropdown: FunctionComponent = () => {
{
matcher: (path: string) =>
path.includes(AppRouteRelative.ALERTS_UPDATE_SIMPLE),
navLink: `${AppRouteRelative.ALERTS_UPDATE_SIMPLE}/${AppRouteRelative.ALERTS_CREATE_EASY_ALERT}`,
navLink: `${AppRouteRelative.ALERTS_CREATE_NEW_USER}/${AppRouteRelative.WELCOME_CREATE_ALERT_TUNE_ALERT}`,
text: t("label.simple"),
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@

import { Icon } from "@iconify/react";
import { Box, Button, Drawer, Typography } from "@material-ui/core";
import { toNumber } from "lodash";
import React, { FunctionComponent, useEffect, useMemo, useState } from "react";
import React, { FunctionComponent, useMemo, useState } from "react";
import { useTranslation } from "react-i18next";
import { SearchInputV1 } from "../../platform/components";
import { ColorV1 } from "../../platform/utils/material-ui/color.util";
import { useGetDataset } from "../../rest/datasets/datasets.actions";
import { ColumnsDrawerProps } from "./columns-drawer.interfaces";
import { useColumnsDrawerStyles } from "./columns-drawer.styles";
import { CopyButtonV2 } from "../copy-button-v2/copy-button-v2.component";
Expand All @@ -30,27 +28,22 @@ import { CopyButtonV2 } from "../copy-button-v2/copy-button-v2.component";
* to maintain isOpen state
*/
export const ColumnsDrawer: FunctionComponent<ColumnsDrawerProps> = ({
datasetId,
selectedDataset,
isOpen,
onClose,
}) => {
const classes = useColumnsDrawerStyles();
const { t } = useTranslation();
const { dataset, getDataset } = useGetDataset();
const [searchQuery, setSearchQuery] = useState("");

const filteredDimensions = useMemo(
() =>
dataset?.dimensions.filter((dimension) =>
dimension.toLowerCase().includes(searchQuery.toLowerCase())
selectedDataset?.metrics.filter((dimension) =>
dimension.name.toLowerCase().includes(searchQuery.toLowerCase())
) || [],
[dataset, searchQuery]
[selectedDataset, searchQuery]
);

useEffect(() => {
getDataset(toNumber(datasetId));
}, [datasetId]);

return (
<>
<Drawer
Expand Down Expand Up @@ -103,12 +96,14 @@ export const ColumnsDrawer: FunctionComponent<ColumnsDrawerProps> = ({
className={classes.listItem}
display="flex"
justifyContent="space-between"
key={dimension}
key={dimension.id}
>
<Typography variant="body2">
{dimension}
{dimension.name}
</Typography>
<CopyButtonV2 content={dimension} />
<CopyButtonV2
content={dimension.name}
/>
</Box>
))}
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@
* the License.
*/

import { DatasetInfo } from "../../utils/datasources/datasources.util";

export interface ColumnsDrawerProps {
isOpen: boolean;
datasetId?: number;
onClose: () => void;
selectedDataset: DatasetInfo | null;
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { Link as RouterLink } from "react-router-dom";
import { SkeletonV1 } from "../../../platform/components";
import {
getAlertsAllPath,
getAlertsEasyCreatePath,
getAlertsCreatePath,
} from "../../../utils/routes/routes.util";
import IconLink from "../../icon-link/icon-link.component";
import { NoDataIndicator } from "../../no-data-indicator/no-data-indicator.component";
Expand Down Expand Up @@ -82,7 +82,7 @@ export const ActiveAlertsCountV2: FunctionComponent<ActiveAlertsCountProps> = ({
label={t("label.create-entity", {
entity: t("label.alert"),
})}
route={getAlertsEasyCreatePath()}
route={getAlertsCreatePath()}
/>
</Grid>
</Grid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,8 @@ export const AlertsAllPage: FunctionComponent = () => {
type={DropdownButtonTypeV1.Regular}
onClick={(id) => {
if (id === "easyAlert") {
setCreateId(id as string);
navigate(getAlertsCreatePath());
// setCreateId(id as string);
}
}}
>
Expand Down
Loading

0 comments on commit 00a3d6f

Please sign in to comment.