feat: label grouping, fix: new states response (#254)

This commit is contained in:
Aaryan Khandelwal 2023-02-08 18:51:03 +05:30 committed by GitHub
parent c978632938
commit 166520dfda
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 539 additions and 303 deletions

View file

@ -4,13 +4,16 @@ import { useRouter } from "next/router";
import useSWR from "swr";
// react-hook-form
import { Control, Controller } from "react-hook-form";
// services
import { Squares2X2Icon } from "@heroicons/react/24/outline";
import stateService from "services/state.service";
// ui
import { Spinner, CustomSelect } from "components/ui";
// icons
import { Squares2X2Icon } from "@heroicons/react/24/outline";
// helpers
import { getStatesList } from "helpers/state.helper";
// types
import { IIssue, UserAuth } from "types";
// constants
@ -26,12 +29,13 @@ export const SidebarStateSelect: React.FC<Props> = ({ control, submitChanges, us
const router = useRouter();
const { workspaceSlug, projectId } = router.query;
const { data: states } = useSWR(
const { data: stateGroups } = useSWR(
workspaceSlug && projectId ? STATE_LIST(projectId as string) : null,
workspaceSlug && projectId
? () => stateService.getStates(workspaceSlug as string, projectId as string)
: null
);
const states = getStatesList(stateGroups ?? {});
const isNotAllowed = userAuth.isGuest || userAuth.isViewer;