[WEB-4363] regression: analytics tabs improvements #7260
This commit is contained in:
parent
79c2dfd293
commit
072f2e2cac
1 changed files with 5 additions and 4 deletions
|
|
@ -2,11 +2,11 @@
|
||||||
|
|
||||||
import { useMemo } from "react";
|
import { useMemo } from "react";
|
||||||
import { observer } from "mobx-react";
|
import { observer } from "mobx-react";
|
||||||
import { useRouter, useSearchParams } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
// plane package imports
|
// plane package imports
|
||||||
import { EUserPermissions, EUserPermissionsLevel } from "@plane/constants";
|
import { EUserPermissions, EUserPermissionsLevel } from "@plane/constants";
|
||||||
import { useTranslation } from "@plane/i18n";
|
import { useTranslation } from "@plane/i18n";
|
||||||
import { Tabs } from "@plane/ui";
|
import { type TabItem, Tabs } from "@plane/ui";
|
||||||
// components
|
// components
|
||||||
import AnalyticsFilterActions from "@/components/analytics/analytics-filter-actions";
|
import AnalyticsFilterActions from "@/components/analytics/analytics-filter-actions";
|
||||||
import { PageHead } from "@/components/core";
|
import { PageHead } from "@/components/core";
|
||||||
|
|
@ -19,6 +19,7 @@ import { getAnalyticsTabs } from "@/plane-web/components/analytics/tabs";
|
||||||
type Props = {
|
type Props = {
|
||||||
params: {
|
params: {
|
||||||
tabId: string;
|
tabId: string;
|
||||||
|
workspaceSlug: string;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -54,7 +55,7 @@ const AnalyticsPage = observer((props: Props) => {
|
||||||
? t(`workspace_analytics.page_label`, { workspace: currentWorkspace?.name })
|
? t(`workspace_analytics.page_label`, { workspace: currentWorkspace?.name })
|
||||||
: undefined;
|
: undefined;
|
||||||
const ANALYTICS_TABS = useMemo(() => getAnalyticsTabs(t), [t]);
|
const ANALYTICS_TABS = useMemo(() => getAnalyticsTabs(t), [t]);
|
||||||
const tabs = useMemo(
|
const tabs: TabItem[] = useMemo(
|
||||||
() =>
|
() =>
|
||||||
ANALYTICS_TABS.map((tab) => ({
|
ANALYTICS_TABS.map((tab) => ({
|
||||||
key: tab.key,
|
key: tab.key,
|
||||||
|
|
@ -63,7 +64,7 @@ const AnalyticsPage = observer((props: Props) => {
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
router.push(`/${currentWorkspace?.slug}/analytics/${tab.key}`);
|
router.push(`/${currentWorkspace?.slug}/analytics/${tab.key}`);
|
||||||
},
|
},
|
||||||
isDisabled: tab.isDisabled,
|
disabled: tab.isDisabled,
|
||||||
})),
|
})),
|
||||||
[ANALYTICS_TABS, router, currentWorkspace?.slug]
|
[ANALYTICS_TABS, router, currentWorkspace?.slug]
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue