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

@ -10,6 +10,7 @@ import stateService from "services/state.service";
import { issueViewContext } from "contexts/issue-view.context";
// helpers
import { groupBy, orderArrayBy } from "helpers/array.helper";
import { getStatesList } from "helpers/state.helper";
// types
import { IIssue, IState } from "types";
// fetch-keys
@ -35,12 +36,13 @@ const useIssueView = (projectIssues: IIssue[]) => {
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 ?? {});
let groupedByIssues: {
[key: string]: IIssue[];

View file

@ -8,6 +8,7 @@ import userService from "services/user.service";
import useUser from "hooks/use-user";
// helpers
import { groupBy } from "helpers/array.helper";
import { getStatesList } from "helpers/state.helper";
// types
import { Properties, NestedKeyOf, IIssue } from "types";
// fetch-keys
@ -36,12 +37,13 @@ const useMyIssuesProperties = (issues?: IIssue[]) => {
const { user } = useUser();
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 ?? {});
useEffect(() => {
if (!user) return;