fix: formatting files

This commit is contained in:
sriram veeraghanta 2024-03-06 20:50:38 +05:30
parent 1fa47a6c04
commit bce69bcbe1
35 changed files with 113 additions and 114 deletions

View File

@ -71,7 +71,11 @@ export const setToast = (props: SetToastProps) => {
e.stopPropagation();
e.preventDefault();
}}
className={cn("w-[350px] h-[67.3px] rounded-lg border shadow-sm p-2", backgroundColorClassName, borderColorClassName)}
className={cn(
"w-[350px] h-[67.3px] rounded-lg border shadow-sm p-2",
backgroundColorClassName,
borderColorClassName
)}
>
<div className="w-full h-full flex items-center justify-center px-4 py-2">
{icon && <div className="flex items-center justify-center">{icon}</div>}

View File

@ -205,9 +205,7 @@ export const CycleIssuesHeader: React.FC = observer(() => {
className="ml-1.5 flex-shrink-0"
placement="bottom-start"
>
{currentProjectCycleIds?.map((cycleId) => (
<CycleDropdownOption key={cycleId} cycleId={cycleId} />
))}
{currentProjectCycleIds?.map((cycleId) => <CycleDropdownOption key={cycleId} cycleId={cycleId} />)}
</CustomMenu>
}
/>

View File

@ -206,9 +206,7 @@ export const ModuleIssuesHeader: React.FC = observer(() => {
className="ml-1.5 flex-shrink-0"
placement="bottom-start"
>
{projectModuleIds?.map((moduleId) => (
<ModuleDropdownOption key={moduleId} moduleId={moduleId} />
))}
{projectModuleIds?.map((moduleId) => <ModuleDropdownOption key={moduleId} moduleId={moduleId} />)}
</CustomMenu>
}
/>

View File

@ -31,13 +31,7 @@ interface IBaseCalendarRoot {
}
export const BaseCalendarRoot = observer((props: IBaseCalendarRoot) => {
const {
QuickActions,
storeType,
addIssuesToView,
viewId,
isCompletedCycle = false,
} = props;
const { QuickActions, storeType, addIssuesToView, viewId, isCompletedCycle = false } = props;
// router
const router = useRouter();

View File

@ -5,7 +5,15 @@ import { observer } from "mobx-react-lite";
import { Spinner } from "@plane/ui";
import { CalendarHeader, CalendarWeekDays, CalendarWeekHeader } from "components/issues";
// types
import { IIssueDisplayFilterOptions, IIssueDisplayProperties, IIssueFilterOptions, TGroupedIssues, TIssue, TIssueKanbanFilters, TIssueMap } from "@plane/types";
import {
IIssueDisplayFilterOptions,
IIssueDisplayProperties,
IIssueFilterOptions,
TGroupedIssues,
TIssue,
TIssueKanbanFilters,
TIssueMap,
} from "@plane/types";
import { ICalendarWeek } from "./types";
// constants
import { EIssueFilterType, EIssuesStoreType } from "constants/issue";

View File

@ -9,7 +9,13 @@ import { Popover, Transition } from "@headlessui/react";
import { Check, ChevronUp } from "lucide-react";
import { ToggleSwitch } from "@plane/ui";
// types
import { IIssueDisplayFilterOptions, IIssueDisplayProperties, IIssueFilterOptions, TCalendarLayouts, TIssueKanbanFilters } from "@plane/types";
import {
IIssueDisplayFilterOptions,
IIssueDisplayProperties,
IIssueFilterOptions,
TCalendarLayouts,
TIssueKanbanFilters,
} from "@plane/types";
// constants
import { CALENDAR_LAYOUTS } from "constants/calendar";
import { EIssueFilterType } from "constants/issue";

View File

@ -12,9 +12,9 @@ import { useIssues } from "hooks/store";
export const ModuleCalendarLayout: React.FC = observer(() => {
const router = useRouter();
const { workspaceSlug, projectId, moduleId } = router.query ;
const { workspaceSlug, projectId, moduleId } = router.query;
const {issues} = useIssues(EIssuesStoreType.MODULE)
const { issues } = useIssues(EIssuesStoreType.MODULE);
if (!moduleId) return null;

View File

@ -5,4 +5,4 @@ import { EIssuesStoreType } from "constants/issue";
// components
import { BaseGanttRoot } from "./base-gantt-root";
export const GanttLayout: React.FC = observer(() =>( <BaseGanttRoot storeType={EIssuesStoreType.PROJECT} />));
export const GanttLayout: React.FC = observer(() => <BaseGanttRoot storeType={EIssuesStoreType.PROJECT} />);

View File

@ -198,13 +198,9 @@ export const BaseKanBanRoot: React.FC<IBaseKanBanLayout> = observer((props: IBas
let kanbanFilters = issuesFilter?.issueFilters?.kanbanFilters?.[toggle] || [];
if (kanbanFilters.includes(value)) kanbanFilters = kanbanFilters.filter((_value) => _value != value);
else kanbanFilters.push(value);
updateFilters(
projectId.toString(),
EIssueFilterType.KANBAN_FILTERS,
{
updateFilters(projectId.toString(), EIssueFilterType.KANBAN_FILTERS, {
[toggle]: kanbanFilters,
}
);
});
}
};

View File

@ -12,7 +12,7 @@ import { BaseKanBanRoot } from "../base-kanban-root";
export const ProfileIssuesKanBanLayout: React.FC = observer(() => {
const {
membership: { currentWorkspaceAllProjectsRole },
} = useUser();
} = useUser();
const canEditPropertiesBasedOnProject = (projectId: string) => {
const currentProjectRole = currentWorkspaceAllProjectsRole && currentWorkspaceAllProjectsRole[projectId];

View File

@ -5,7 +5,7 @@ import { EIssuesStoreType } from "constants/issue";
import { EUserProjectRoles } from "constants/project";
import { useIssues, useUser } from "hooks/store";
import { TIssue } from "@plane/types"
import { TIssue } from "@plane/types";
// components
import { List } from "./default";
import { IQuickActionProps } from "./list-view-types";

View File

@ -57,13 +57,13 @@ export const BaseSpreadsheetRoot = observer((props: IBaseSpreadsheetRoot) => {
const handleDisplayFiltersUpdate = useCallback(
(updatedDisplayFilter: Partial<IIssueDisplayFilterOptions>) => {
if ( !projectId) return;
if (!projectId) return;
updateFilters(projectId.toString(), EIssueFilterType.DISPLAY_FILTERS, {
...updatedDisplayFilter,
});
},
[ projectId, updateFilters]
[projectId, updateFilters]
);
const renderQuickActions = useCallback(

View File

@ -770,4 +770,3 @@ export const IssueFormRoot: FC<IssueFormProps> = observer((props) => {
</>
);
});

View File

@ -142,9 +142,8 @@ export const SendProjectInvitationModal: React.FC<Props> = observer((props) => {
if (!memberDetails?.member) return;
return {
value: `${memberDetails?.member.id}`,
query: `${memberDetails?.member.first_name} ${
memberDetails?.member.last_name
} ${memberDetails?.member.display_name.toLowerCase()}`,
query: `${memberDetails?.member.first_name} ${memberDetails?.member
.last_name} ${memberDetails?.member.display_name.toLowerCase()}`,
content: (
<div className="flex w-full items-center gap-2">
<div className="flex-shrink-0 pt-0.5">

View File

@ -41,13 +41,16 @@ export const groupReactions: (reactions: any[], key: string) => { [key: string]:
reactions: any,
key: string
) => {
const groupedReactions = reactions.reduce((acc: any, reaction: any) => {
const groupedReactions = reactions.reduce(
(acc: any, reaction: any) => {
if (!acc[reaction[key]]) {
acc[reaction[key]] = [];
}
acc[reaction[key]].push(reaction);
return acc;
}, {} as { [key: string]: any[] });
},
{} as { [key: string]: any[] }
);
return groupedReactions;
};

View File

@ -172,11 +172,7 @@ export const renderIssueBlocksStructure = (blocks: TIssue[]): IGanttBlock[] =>
target_date: block.target_date ? new Date(block.target_date) : null,
}));
export function getChangedIssuefields(
formData: Partial<TIssue>,
dirtyFields: { [key: string]: boolean | undefined }
) {
export function getChangedIssuefields(formData: Partial<TIssue>, dirtyFields: { [key: string]: boolean | undefined }) {
const changedFields: Partial<TIssue> = {};
const dirtyFieldKeys = Object.keys(dirtyFields) as (keyof TIssue)[];
@ -187,4 +183,4 @@ export const renderIssueBlocksStructure = (blocks: TIssue[]): IGanttBlock[] =>
}
return changedFields;
}
}

View File

@ -21,9 +21,7 @@ export const ProfileSettingsLayout: FC<IProfileSettingsLayout> = (props) => {
<ProfileLayoutSidebar />
<main className="relative flex h-full w-full flex-col overflow-hidden bg-custom-background-100">
{header}
<div className="h-full w-full overflow-x-hidden overflow-y-scroll">
{children}
</div>
<div className="h-full w-full overflow-x-hidden overflow-y-scroll">{children}</div>
</main>
</div>
</UserAuthWrapper>

View File

@ -69,9 +69,10 @@ const ArchivedIssueDetailsPage: NextPageWithLayout = observer(() => {
title: "Success",
message:
issue &&
`${getProjectById(issue.project_id)?.identifier}-${
issue?.sequence_id
} is restored successfully under the project ${getProjectById(issue.project_id)?.name}`,
`${getProjectById(issue.project_id)
?.identifier}-${issue?.sequence_id} is restored successfully under the project ${getProjectById(
issue.project_id
)?.name}`,
});
router.push(`/${workspaceSlug}/projects/${projectId}/issues/${archivedIssueId}`);
})

View File

@ -127,9 +127,8 @@ export class WorkspaceMemberStore implements IWorkspaceMemberStore {
const searchedWorkspaceMemberIds = workspaceMemberIds?.filter((userId) => {
const memberDetails = this.getWorkspaceMemberDetails(userId);
if (!memberDetails) return false;
const memberSearchQuery = `${memberDetails.member.first_name} ${memberDetails.member.last_name} ${
memberDetails.member?.display_name
} ${memberDetails.member.email ?? ""}`;
const memberSearchQuery = `${memberDetails.member.first_name} ${memberDetails.member.last_name} ${memberDetails
.member?.display_name} ${memberDetails.member.email ?? ""}`;
return memberSearchQuery.toLowerCase()?.includes(searchQuery.toLowerCase());
});
return searchedWorkspaceMemberIds;