Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
813679d
refactor: type safety in tabs
JayashTripathy Aug 19, 2025
3e571d4
refactor: improve type definitions for TabListItem and TabItem
JayashTripathy Aug 20, 2025
c0fb812
refacator: improved types of tabs and migrated some components to use…
JayashTripathy Aug 20, 2025
4f06139
refactor: migrate components to use propel/tabs for improved tab func…
JayashTripathy Aug 20, 2025
0c645a7
refactor: cleanup
JayashTripathy Aug 20, 2025
5de96ee
refactor: update image upload instructions for clarity
JayashTripathy Aug 20, 2025
cf7a35a
refactor: expose Tabs components for better modularity
JayashTripathy Aug 21, 2025
35f91c3
refactor: enhance type safety for tab change handlers across components
JayashTripathy Aug 21, 2025
8bf02b2
refactor: cleanup
JayashTripathy Aug 21, 2025
52e91b1
Merge remote-tracking branch 'origin/preview' into refactor-propel-tabs
JayashTripathy Sep 16, 2025
8844a10
refactor: cleanup
JayashTripathy Sep 16, 2025
cbd6e09
refactor: cleanup
JayashTripathy Sep 16, 2025
2036239
refactor: update image picker popover for improved tab handling and s…
JayashTripathy Sep 17, 2025
8da44ba
refactor: enhance image picker popover search functionality and add a…
JayashTripathy Sep 17, 2025
0cfc605
refactor: improve image picker popover layout and enhance file upload…
JayashTripathy Sep 17, 2025
96ee0f7
refactor: enhance image picker popover layout and improve loading beh…
JayashTripathy Sep 17, 2025
a8ece6e
refactor: added removed loader in active cycle
JayashTripathy Sep 18, 2025
ca336ae
Merge branch 'preview' of https://github.com/makeplane/plane into ref…
JayashTripathy Sep 23, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import { useRouter } from "next/navigation";
// plane package imports
import { EUserPermissions, EUserPermissionsLevel, PROJECT_TRACKER_ELEMENTS } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { type TabItem, Tabs } from "@plane/ui";
import { Tabs } from "@plane/propel/tabs";
import { TAnalyticsTabsBase } from "@plane/types";
// components
import AnalyticsFilterActions from "@/components/analytics/analytics-filter-actions";
import { PageHead } from "@/components/core/page-title";
Expand Down Expand Up @@ -59,40 +60,37 @@ const AnalyticsPage = observer((props: Props) => {
? t(`workspace_analytics.page_label`, { workspace: currentWorkspace?.name })
: undefined;
const ANALYTICS_TABS = useMemo(() => getAnalyticsTabs(t), [t]);
const tabs: TabItem[] = useMemo(
() =>
ANALYTICS_TABS.map((tab) => ({
key: tab.key,
label: tab.label,
content: <tab.content />,
onClick: () => {
router.push(`/${currentWorkspace?.slug}/analytics/${tab.key}`);
},
disabled: tab.isDisabled,
})),
[ANALYTICS_TABS, router, currentWorkspace?.slug]
);
const defaultTab = tabId || ANALYTICS_TABS[0].key;
const defaultTab = (tabId as TAnalyticsTabsBase) || ANALYTICS_TABS[0].key;

const handleTabChange = (value: TAnalyticsTabsBase) => {
router.push(`/${currentWorkspace?.slug}/analytics/${value}`);
};

return (
<>
<PageHead title={pageTitle} />
{workspaceProjectIds && (
<>
{workspaceProjectIds.length > 0 || loader === "init-loader" ? (
<div className="flex h-full overflow-hidden bg-custom-background-100 justify-between items-center ">
<Tabs
tabs={tabs}
storageKey={`analytics-page-${currentWorkspace?.id}`}
defaultTab={defaultTab}
size="md"
tabListContainerClassName="px-6 py-2 border-b border-custom-border-200 flex items-center justify-between"
tabListClassName="my-2 w-auto"
tabClassName="px-3"
tabPanelClassName="h-full overflow-hidden overflow-y-auto px-2"
storeInLocalStorage={false}
actions={<AnalyticsFilterActions />}
/>
<div className="flex h-full overflow-hidden bg-custom-background-100 justify-between items-center">
<Tabs value={defaultTab} onValueChange={handleTabChange} className="flex flex-col w-full h-full">
<div className="px-6 py-2 border-b border-custom-border-200 flex items-center justify-between">
<Tabs.List className="my-2 w-auto">
{ANALYTICS_TABS.map((tab) => (
<Tabs.Trigger key={tab.key} value={tab.key} size="md" className="px-3" disabled={tab.isDisabled}>
{tab.label}
</Tabs.Trigger>
))}
</Tabs.List>
<AnalyticsFilterActions />
</div>

{ANALYTICS_TABS.map((tab) => (
<Tabs.Content key={tab.key} value={tab.key} className="h-full overflow-hidden overflow-y-auto px-2">
<tab.content />
</Tabs.Content>
))}
</Tabs>
</div>
) : (
<DetailedEmptyState
Expand Down
15 changes: 6 additions & 9 deletions apps/web/core/components/analytics/work-items/modal/content.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { useEffect, useState } from "react";
import { observer } from "mobx-react";
import { Tab } from "@headlessui/react";
// plane package imports
import { ICycle, IModule, IProject } from "@plane/types";
import { Spinner } from "@plane/ui";
Expand Down Expand Up @@ -69,13 +68,11 @@ export const WorkItemsModalMainContent: React.FC<Props> = observer((props) => {
);

return (
<Tab.Group as={React.Fragment}>
<div className="flex flex-col gap-14 overflow-y-auto p-6">
<TotalInsights analyticsType="work-items" peekView={!fullScreen} />
<CreatedVsResolved />
<CustomizedInsights peekView={!fullScreen} isEpic={isEpic} />
<WorkItemsInsightTable />
</div>
</Tab.Group>
<div className="flex flex-col gap-14 overflow-y-auto p-6">
<TotalInsights analyticsType="work-items" peekView={!fullScreen} />
<CreatedVsResolved />
<CustomizedInsights peekView={!fullScreen} isEpic={isEpic} />
<WorkItemsInsightTable />
</div>
);
});
Loading