fix: build warnings

This commit is contained in:
LAKHAN BAHETI 2024-02-23 18:30:56 +05:30
parent 7143c98b2e
commit 41c11f70d9
24 changed files with 56 additions and 54 deletions

View File

@ -9,7 +9,6 @@ import { ILinkDetails, UserAuth } from "@plane/types";
// hooks
import useToast from "hooks/use-toast";
import { observer } from "mobx-react";
import { useMeasure } from "@nivo/core";
import { useMember } from "hooks/store";
type Props = {

View File

@ -116,7 +116,7 @@ export const CycleIssuesHeader: React.FC = observer(() => {
})
);
},
[workspaceSlug, projectId, cycleId, updateFilters]
[workspaceSlug, projectId, cycleId, updateFilters, captureEvent, router.asPath]
);
const handleFiltersUpdate = useCallback(
@ -149,7 +149,7 @@ export const CycleIssuesHeader: React.FC = observer(() => {
})
);
},
[workspaceSlug, projectId, cycleId, issueFilters, updateFilters]
[workspaceSlug, projectId, cycleId, issueFilters, updateFilters, captureIssuesFilterEvent, router.asPath]
);
const handleDisplayFilters = useCallback(
@ -169,7 +169,7 @@ export const CycleIssuesHeader: React.FC = observer(() => {
})
);
},
[workspaceSlug, projectId, cycleId, updateFilters, issueFilters]
[workspaceSlug, projectId, cycleId, updateFilters, issueFilters, captureIssuesDisplayFilterEvent, router.asPath]
);
const handleDisplayProperties = useCallback(
@ -187,7 +187,7 @@ export const CycleIssuesHeader: React.FC = observer(() => {
})
);
},
[workspaceSlug, projectId, cycleId, updateFilters, issueFilters]
[workspaceSlug, projectId, cycleId, updateFilters, issueFilters, captureIssuesDisplayFilterEvent, router.asPath]
);
// derived values

View File

@ -21,11 +21,9 @@ import { EUserWorkspaceRoles } from "constants/workspace";
import {
DP_APPLIED,
DP_REMOVED,
elementFromPath,
FILTER_APPLIED,
FILTER_REMOVED,
FILTER_SEARCHED,
LAYOUT_CHANGED,
LP_UPDATED,
} from "constants/event-tracker";
@ -56,7 +54,7 @@ export const GlobalIssuesHeader: React.FC<Props> = observer((props) => {
const {
workspace: { workspaceMemberIds },
} = useMember();
const { captureIssuesFilterEvent, captureEvent, captureIssuesDisplayFilterEvent } = useEventTracker();
const { captureIssuesFilterEvent, captureIssuesDisplayFilterEvent } = useEventTracker();
const issueFilters = globalViewId ? filters[globalViewId.toString()] : undefined;
@ -97,7 +95,7 @@ export const GlobalIssuesHeader: React.FC<Props> = observer((props) => {
});
});
},
[workspaceSlug, issueFilters, updateFilters, globalViewId]
[workspaceSlug, issueFilters, updateFilters, globalViewId, captureIssuesFilterEvent, router.asPath]
);
const handleDisplayFilters = useCallback(
@ -122,7 +120,7 @@ export const GlobalIssuesHeader: React.FC<Props> = observer((props) => {
})
);
},
[workspaceSlug, updateFilters, globalViewId, issueFilters]
[workspaceSlug, updateFilters, globalViewId, issueFilters, captureIssuesDisplayFilterEvent, router.asPath]
);
const handleDisplayProperties = useCallback(
@ -146,7 +144,7 @@ export const GlobalIssuesHeader: React.FC<Props> = observer((props) => {
})
);
},
[workspaceSlug, updateFilters, globalViewId, issueFilters]
[workspaceSlug, updateFilters, globalViewId, issueFilters, captureIssuesDisplayFilterEvent, router.asPath]
);
const isAuthorizedUser = !!currentWorkspaceRole && currentWorkspaceRole >= EUserWorkspaceRoles.MEMBER;

View File

@ -21,7 +21,7 @@ import { ProjectAnalyticsModal } from "components/analytics";
import { SidebarHamburgerToggle } from "components/core/sidebar/sidebar-menu-hamburger-toggle";
import { BreadcrumbLink } from "components/common";
// ui
import { Breadcrumbs, Button, CustomMenu, DiceIcon, LayersIcon } from "@plane/ui";
import { Breadcrumbs, Button, CustomMenu, DiceIcon } from "@plane/ui";
// icons
import { ArrowRight, PanelRight, Plus } from "lucide-react";
// helpers
@ -119,7 +119,7 @@ export const ModuleIssuesHeader: React.FC = observer(() => {
})
);
},
[workspaceSlug, projectId, moduleId, updateFilters]
[workspaceSlug, projectId, moduleId, updateFilters, captureEvent, router.asPath]
);
const handleFiltersUpdate = useCallback(
@ -152,7 +152,7 @@ export const ModuleIssuesHeader: React.FC = observer(() => {
});
});
},
[workspaceSlug, projectId, moduleId, issueFilters, updateFilters]
[workspaceSlug, projectId, moduleId, issueFilters, updateFilters, captureIssuesFilterEvent, router.asPath]
);
const handleDisplayFilters = useCallback(
@ -172,7 +172,7 @@ export const ModuleIssuesHeader: React.FC = observer(() => {
})
);
},
[workspaceSlug, projectId, moduleId, updateFilters, issueFilters]
[workspaceSlug, projectId, moduleId, updateFilters, issueFilters, captureIssuesDisplayFilterEvent, router.asPath]
);
const handleDisplayProperties = useCallback(
@ -190,7 +190,7 @@ export const ModuleIssuesHeader: React.FC = observer(() => {
})
);
},
[workspaceSlug, projectId, moduleId, updateFilters, issueFilters]
[workspaceSlug, projectId, moduleId, updateFilters, issueFilters, captureIssuesDisplayFilterEvent, router.asPath]
);
// derived values

View File

@ -96,7 +96,7 @@ export const ProjectIssuesHeader: React.FC = observer(() => {
})
);
},
[workspaceSlug, projectId, issueFilters, updateFilters]
[workspaceSlug, projectId, issueFilters, updateFilters, captureIssuesFilterEvent, router.asPath]
);
const handleLayoutChange = useCallback(
@ -110,7 +110,7 @@ export const ProjectIssuesHeader: React.FC = observer(() => {
})
);
},
[workspaceSlug, projectId, updateFilters]
[workspaceSlug, projectId, updateFilters, captureEvent, router.asPath]
);
const handleDisplayFilters = useCallback(
@ -129,7 +129,7 @@ export const ProjectIssuesHeader: React.FC = observer(() => {
})
);
},
[workspaceSlug, projectId, updateFilters, issueFilters]
[workspaceSlug, projectId, updateFilters, issueFilters, captureIssuesDisplayFilterEvent, router.asPath]
);
const handleDisplayProperties = useCallback(
@ -147,7 +147,7 @@ export const ProjectIssuesHeader: React.FC = observer(() => {
});
});
},
[workspaceSlug, projectId, updateFilters, issueFilters]
[workspaceSlug, projectId, updateFilters, issueFilters, captureIssuesDisplayFilterEvent, router.asPath]
);
const deployUrl = process.env.NEXT_PUBLIC_DEPLOY_URL;

View File

@ -81,7 +81,7 @@ export const ProjectViewIssuesHeader: React.FC = observer(() => {
})
);
},
[workspaceSlug, projectId, viewId, updateFilters]
[workspaceSlug, projectId, viewId, updateFilters, captureEvent, router.asPath]
);
const handleFiltersUpdate = useCallback(
@ -114,7 +114,7 @@ export const ProjectViewIssuesHeader: React.FC = observer(() => {
});
});
},
[workspaceSlug, projectId, viewId, issueFilters, updateFilters]
[workspaceSlug, projectId, viewId, issueFilters, updateFilters, captureIssuesFilterEvent, router.asPath]
);
const handleDisplayFilters = useCallback(
@ -133,7 +133,7 @@ export const ProjectViewIssuesHeader: React.FC = observer(() => {
})
);
},
[workspaceSlug, projectId, viewId, updateFilters, issueFilters]
[workspaceSlug, projectId, viewId, updateFilters, issueFilters, captureIssuesDisplayFilterEvent, router.asPath]
);
const handleDisplayProperties = useCallback(
@ -151,7 +151,7 @@ export const ProjectViewIssuesHeader: React.FC = observer(() => {
})
);
},
[workspaceSlug, projectId, viewId, updateFilters, issueFilters]
[workspaceSlug, projectId, viewId, updateFilters, issueFilters, captureIssuesDisplayFilterEvent, router.asPath]
);
const viewDetails = viewId ? getViewById(viewId.toString()) : null;

View File

@ -91,7 +91,7 @@ export const IssueAttachmentRoot: FC<TIssueAttachmentRoot> = (props) => {
}
},
}),
[workspaceSlug, projectId, issueId, createAttachment, removeAttachment, setToastAlert]
[workspaceSlug, projectId, issueId, createAttachment, removeAttachment, setToastAlert, captureIssueEvent]
);
return (

View File

@ -115,7 +115,7 @@ export const InboxIssueDetailRoot: FC<TInboxIssueDetailRoot> = (props) => {
}
},
}),
[inboxId, fetchInboxIssueById, updateInboxIssue, removeInboxIssue, setToastAlert]
[inboxId, fetchInboxIssueById, updateInboxIssue, removeInboxIssue, setToastAlert, captureIssueEvent, router.asPath]
);
useSWR(

View File

@ -132,9 +132,8 @@ export const IssueDetailRoot: FC<TIssueDetailRoot> = observer((props) => {
},
remove: async (workspaceSlug: string, projectId: string, issueId: string) => {
try {
let response;
if (is_archived) response = await removeArchivedIssue(workspaceSlug, projectId, issueId);
else response = await removeIssue(workspaceSlug, projectId, issueId);
if (is_archived) await removeArchivedIssue(workspaceSlug, projectId, issueId);
else await removeIssue(workspaceSlug, projectId, issueId);
setToastAlert({
title: "Issue deleted successfully",
type: "success",
@ -328,6 +327,8 @@ export const IssueDetailRoot: FC<TIssueDetailRoot> = observer((props) => {
removeIssueFromModule,
removeModulesFromIssue,
setToastAlert,
captureIssueEvent,
router.asPath,
]
);

View File

@ -3,7 +3,7 @@ import { observer } from "mobx-react-lite";
import { PlusIcon } from "lucide-react";
import { useTheme } from "next-themes";
// hooks
import { useApplication, useEventTracker, useIssueDetail, useIssues, useUser } from "hooks/store";
import { useApplication, useEventTracker, useIssues, useUser } from "hooks/store";
import useToast from "hooks/use-toast";
// components
import { ExistingIssuesListModal } from "components/core";
@ -43,7 +43,6 @@ export const CycleEmptyState: React.FC<Props> = observer((props) => {
const { resolvedTheme } = useTheme();
// store hooks
const { issues } = useIssues(EIssuesStoreType.CYCLE);
const { updateIssue, fetchIssue } = useIssueDetail();
const {
commandPalette: { toggleCreateIssueModal },
} = useApplication();

View File

@ -42,7 +42,7 @@ export const FilterSelection: React.FC<Props> = observer((props) => {
useEffect(() => {
if (debouncedValue && onSearchCapture) onSearchCapture();
}, [debouncedValue]);
}, [debouncedValue, onSearchCapture]);
return (
<div className="flex h-full w-full flex-col overflow-hidden">

View File

@ -44,7 +44,7 @@ const KanbanIssueDetailsBlock: React.FC<IssueDetailsBlockProps> = observer((prop
// hooks
const { getProjectById } = useProject();
const {
router: { workspaceSlug, projectId },
router: { workspaceSlug },
} = useApplication();
const { setPeekIssue } = useIssueDetail();

View File

@ -3,7 +3,7 @@ import { useRouter } from "next/router";
// components
import { CustomMenu } from "@plane/ui";
import { ExistingIssuesListModal } from "components/core";
import { CreateUpdateIssueModal, CreateUpdateDraftIssueModal } from "components/issues";
import { CreateUpdateIssueModal } from "components/issues";
// lucide icons
import { Minimize2, Maximize2, Circle, Plus } from "lucide-react";
// hooks

View File

@ -24,7 +24,7 @@ export const IssueBlock: React.FC<IssueBlockProps> = observer((props: IssueBlock
const { issuesMap, issueId, handleIssues, quickActions, displayProperties, canEditProperties } = props;
// hooks
const {
router: { workspaceSlug, projectId },
router: { workspaceSlug },
} = useApplication();
const { getProjectById } = useProject();
const { peekIssue, setPeekIssue } = useIssueDetail();

View File

@ -2,7 +2,7 @@ import { useRouter } from "next/router";
// lucide icons
import { CircleDashed, Plus } from "lucide-react";
// components
import { CreateUpdateIssueModal, CreateUpdateDraftIssueModal } from "components/issues";
import { CreateUpdateIssueModal } from "components/issues";
import { ExistingIssuesListModal } from "components/core";
import { CustomMenu } from "@plane/ui";
// mobx

View File

@ -3,7 +3,7 @@ import { useRouter } from "next/router";
import { observer } from "mobx-react-lite";
import { Dialog, Transition } from "@headlessui/react";
// hooks
import { useApplication, useEventTracker, useCycle, useIssues, useModule, useProject, useWorkspace } from "hooks/store";
import { useApplication, useEventTracker, useCycle, useIssues, useModule, useProject } from "hooks/store";
import useToast from "hooks/use-toast";
import useLocalStorage from "hooks/use-local-storage";
// components
@ -44,7 +44,6 @@ export const CreateUpdateIssueModal: React.FC<IssuesModalProps> = observer((prop
const {
router: { workspaceSlug, projectId, cycleId, moduleId, viewId: projectViewId },
} = useApplication();
const { currentWorkspace } = useWorkspace();
const { workspaceProjectIds } = useProject();
const { fetchCycleDetails } = useCycle();
const { fetchModuleDetails } = useModule();

View File

@ -85,7 +85,7 @@ export const IssuePeekOverview: FC<IIssuePeekOverview> = observer((props) => {
showToast: boolean = true
) => {
try {
const response = await updateIssue(workspaceSlug, projectId, issueId, data);
await updateIssue(workspaceSlug, projectId, issueId, data);
if (showToast)
setToastAlert({
title: "Issue updated successfully",
@ -116,9 +116,8 @@ export const IssuePeekOverview: FC<IIssuePeekOverview> = observer((props) => {
},
remove: async (workspaceSlug: string, projectId: string, issueId: string) => {
try {
let response;
if (is_archived) response = await removeArchivedIssue(workspaceSlug, projectId, issueId);
else response = await removeIssue(workspaceSlug, projectId, issueId);
if (is_archived) await removeArchivedIssue(workspaceSlug, projectId, issueId);
else await removeIssue(workspaceSlug, projectId, issueId);
setToastAlert({
title: "Issue deleted successfully",
type: "success",

View File

@ -273,7 +273,17 @@ export const SubIssuesRoot: FC<ISubIssuesRoot> = observer((props) => {
}
},
}),
[fetchSubIssues, createSubIssues, updateSubIssue, removeSubIssue, deleteSubIssue, setToastAlert, setSubIssueHelpers]
[
fetchSubIssues,
createSubIssues,
updateSubIssue,
removeSubIssue,
deleteSubIssue,
setToastAlert,
setSubIssueHelpers,
captureIssueEvent,
router.asPath,
]
);
const issue = getIssueById(parentIssueId);

View File

@ -4,7 +4,7 @@ import { Controller, useForm } from "react-hook-form";
import { Dialog, Transition } from "@headlessui/react";
import { AlertTriangle } from "lucide-react";
// hooks
import { useEventTracker, useProject, useWorkspace } from "hooks/store";
import { useEventTracker, useProject } from "hooks/store";
import useToast from "hooks/use-toast";
// ui
import { Button, Input } from "@plane/ui";
@ -28,7 +28,6 @@ export const DeleteProjectModal: React.FC<DeleteProjectModal> = (props) => {
const { isOpen, project, onClose } = props;
// store hooks
const { captureProjectEvent } = useEventTracker();
const { currentWorkspace } = useWorkspace();
const { deleteProject } = useProject();
// router
const router = useRouter();

View File

@ -5,16 +5,14 @@ import { useForm, Controller, useFieldArray } from "react-hook-form";
import { Dialog, Transition } from "@headlessui/react";
import { ChevronDown, Plus, X } from "lucide-react";
// hooks
import { useEventTracker, useMember, useUser, useWorkspace } from "hooks/store";
import { useEventTracker, useMember, useUser } from "hooks/store";
import useToast from "hooks/use-toast";
// ui
import { Avatar, Button, CustomSelect, CustomSearchSelect } from "@plane/ui";
// helpers
import { getUserRole } from "helpers/user.helper";
// constants
import { ROLE } from "constants/workspace";
import { EUserProjectRoles } from "constants/project";
import { PROJECT_MEMBER_ADDED } from "constants/event-tracker";
import { ROLE } from "constants/workspace";
type Props = {
isOpen: boolean;

View File

@ -4,7 +4,7 @@ import { observer } from "mobx-react-lite";
import { ContrastIcon, FileText, Inbox, Layers } from "lucide-react";
import { DiceIcon, ToggleSwitch } from "@plane/ui";
// hooks
import { useEventTracker, useProject, useUser, useWorkspace } from "hooks/store";
import { useEventTracker, useProject, useUser } from "hooks/store";
import useToast from "hooks/use-toast";
// types
import { IProject } from "@plane/types";

View File

@ -83,7 +83,7 @@ export const ProjectSidebarListItem: React.FC<Props> = observer((props) => {
// store hooks
const { theme: themeStore } = useApplication();
const { setTrackElement } = useEventTracker();
const { currentProjectDetails, addProjectToFavorites, removeProjectFromFavorites, getProjectById } = useProject();
const { addProjectToFavorites, removeProjectFromFavorites, getProjectById } = useProject();
const { getInboxesByProjectId, getInboxById } = useInbox();
// states
const [leaveProjectModalOpen, setLeaveProjectModal] = useState(false);
@ -145,7 +145,7 @@ export const ProjectSidebarListItem: React.FC<Props> = observer((props) => {
if (window.innerWidth < 768) {
themeStore.toggleMobileSidebar();
}
setTrackElement('Project sidebar');
setTrackElement("Project sidebar");
};
useOutsideClickDetector(actionSectionRef, () => setIsMenuActive(false));

View File

@ -8,7 +8,7 @@ import { mutate } from "swr";
import { Check, ChevronDown, CircleUserRound, LogOut, Mails, PlusSquare, Settings, UserCircle2 } from "lucide-react";
import { usePopper } from "react-popper";
// hooks
import { useApplication, useEventTracker, useUser, useWorkspace } from "hooks/store";
import { useApplication, useUser, useWorkspace } from "hooks/store";
// hooks
import useToast from "hooks/use-toast";
// ui

View File

@ -54,7 +54,7 @@ const PostHogProvider: FC<IPosthogWrapper> = (props) => {
posthog?.identify(user.email);
posthog?.group(GROUP_WORKSPACE, currentWorkspaceId);
}
}, [currentWorkspaceId, user]);
}, [currentWorkspaceId, lastWorkspaceId, user]);
useEffect(() => {
// Track page views