feat: label grouping, fix: new states response (#254)
This commit is contained in:
parent
c978632938
commit
166520dfda
17 changed files with 539 additions and 303 deletions
|
|
@ -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[];
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue