Skip to content

Commit

Permalink
fix: hygiene badge on CRM accordion and project item removed; was mis…
Browse files Browse the repository at this point in the history
…leading
  • Loading branch information
Carsten Koch committed Nov 29, 2024
1 parent a30c747 commit 0f4adb6
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
7 changes: 0 additions & 7 deletions components/projects/ProjectAccordionItem.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import { useAccountsContext } from "@/api/ContextAccounts";
import { Project, useProjectsContext } from "@/api/ContextProjects";
import useProjectTodos from "@/api/useProjectTodos";
import useCurrentUser from "@/api/useUser";
import { calcRevenueTwoYears, make2YearsRevenueText } from "@/helpers/projects";
import { addDays, format } from "date-fns";
import { flow, map, sum } from "lodash/fp";
import { ArrowRightCircle, Loader2 } from "lucide-react";
import { FC, useState } from "react";
import ActivityFormatBadge from "../activities/activity-format-badge";
import HygieneIssueBadge from "../crm/hygiene-issue-badge";
import { hasHygieneIssues } from "../crm/pipeline-hygiene";
import TaskBadge from "../task/TaskBadge";
import DefaultAccordionItem from "../ui-elements/accordion/DefaultAccordionItem";
import ProjectDetails from "../ui-elements/project-details/project-details";
Expand All @@ -34,7 +31,6 @@ const ProjectAccordionItem: FC<ProjectAccordionItemProps> = ({
const { saveProjectDates } = useProjectsContext();
const { getAccountNamesByIds } = useAccountsContext();
const { projectTodos } = useProjectTodos(project?.id);
const { user } = useCurrentUser();

const handlePushToNextDay = async () => {
if (!project) return;
Expand All @@ -57,9 +53,6 @@ const ProjectAccordionItem: FC<ProjectAccordionItemProps> = ({
link={`/projects/${project.id}`}
badge={
<>
{project.crmProjects.some(hasHygieneIssues(user)) && (
<HygieneIssueBadge />
)}
<TaskBadge hasOpenTasks={projectTodos && projectTodos.length > 0} />
{project.hasOldVersionedActivityFormat && <ActivityFormatBadge />}
</>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import useCrmProjects, { CrmProject } from "@/api/useCrmProjects";
import useCurrentUser from "@/api/useUser";
import HygieneIssueBadge from "@/components/crm/hygiene-issue-badge";
import { hasHygieneIssues } from "@/components/crm/pipeline-hygiene";
import { Accordion } from "@/components/ui/accordion";
import { useContextContext } from "@/contexts/ContextContext";
import { getRevenue2Years } from "@/helpers/projects";
Expand All @@ -23,7 +20,6 @@ const CrmProjectsList: FC<CrmProjectsListProps> = ({
}) => {
const { isWorkContext } = useContextContext();
const { createCrmProject } = useCrmProjects();
const { user } = useCurrentUser();

const onCrmProjectCreate = async ({
arr,
Expand Down Expand Up @@ -58,9 +54,6 @@ const CrmProjectsList: FC<CrmProjectsListProps> = ({
<DefaultAccordionItem
value="crmprojects"
triggerTitle="CRM Projects"
badge={
crmProjects.some(hasHygieneIssues(user)) && <HygieneIssueBadge />
}
isVisible={isVisible}
triggerSubTitle={
crmProjects && crmProjects.length > 0 && getRevenue2Years(crmProjects)
Expand Down

0 comments on commit 0f4adb6

Please sign in to comment.