Skip to content

Commit c0b6abc

Browse files
refactor: minor store level changes (#6500)
1 parent 2f2e662 commit c0b6abc

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

web/core/hooks/use-issue-layout-store.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const IssuesStoreContext = createContext<EIssuesStoreType | undefined>(un
77

88
export const useIssueStoreType = () => {
99
const storeType = useContext(IssuesStoreContext);
10-
const { globalViewId, viewId, projectId, cycleId, moduleId, userId, epicId, teamId } = useParams();
10+
const { globalViewId, viewId, projectId, cycleId, moduleId, userId, epicId, teamspaceId } = useParams();
1111

1212
// If store type exists in context, use that store type
1313
if (storeType) return storeType;
@@ -27,9 +27,9 @@ export const useIssueStoreType = () => {
2727

2828
if (projectId) return EIssuesStoreType.PROJECT;
2929

30-
if (teamId) return EIssuesStoreType.TEAM;
30+
if (teamspaceId) return EIssuesStoreType.TEAM;
3131

32-
if (teamId && viewId) return EIssuesStoreType.TEAM_VIEW;
32+
if (teamspaceId && viewId) return EIssuesStoreType.TEAM_VIEW;
3333

3434
return EIssuesStoreType.PROJECT;
3535
};

web/core/store/issue/root.store.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import {
1515
// root store
1616
import { RootStore } from "@/plane-web/store/root.store";
1717
import { IWorkspaceMembership } from "@/store/member/workspace-member.store";
18-
import { IStateStore, StateStore } from "../state.store";
1918
// issues data store
2019
import { IArchivedIssuesFilter, ArchivedIssuesFilter, IArchivedIssues, ArchivedIssues } from "./archived";
2120
import { ICycleIssuesFilter, CycleIssuesFilter, ICycleIssues, CycleIssues } from "./cycle";
@@ -44,7 +43,7 @@ import {
4443
export interface IIssueRootStore {
4544
currentUserId: string | undefined;
4645
workspaceSlug: string | undefined;
47-
teamId: string | undefined;
46+
teamspaceId: string | undefined;
4847
projectId: string | undefined;
4948
cycleId: string | undefined;
5049
moduleId: string | undefined;
@@ -112,7 +111,7 @@ export interface IIssueRootStore {
112111
export class IssueRootStore implements IIssueRootStore {
113112
currentUserId: string | undefined = undefined;
114113
workspaceSlug: string | undefined = undefined;
115-
teamId: string | undefined = undefined;
114+
teamspaceId: string | undefined = undefined;
116115
projectId: string | undefined = undefined;
117116
cycleId: string | undefined = undefined;
118117
moduleId: string | undefined = undefined;
@@ -179,7 +178,7 @@ export class IssueRootStore implements IIssueRootStore {
179178
constructor(rootStore: RootStore, serviceType: TIssueServiceType = EIssueServiceType.ISSUES) {
180179
makeObservable(this, {
181180
workspaceSlug: observable.ref,
182-
teamId: observable.ref,
181+
teamspaceId: observable.ref,
183182
projectId: observable.ref,
184183
cycleId: observable.ref,
185184
moduleId: observable.ref,
@@ -203,7 +202,7 @@ export class IssueRootStore implements IIssueRootStore {
203202
autorun(() => {
204203
if (rootStore?.user?.data?.id) this.currentUserId = rootStore?.user?.data?.id;
205204
if (this.workspaceSlug !== rootStore.router.workspaceSlug) this.workspaceSlug = rootStore.router.workspaceSlug;
206-
if (this.teamId !== rootStore.router.teamId) this.teamId = rootStore.router.teamId;
205+
if (this.teamspaceId !== rootStore.router.teamspaceId) this.teamspaceId = rootStore.router.teamspaceId;
207206
if (this.projectId !== rootStore.router.projectId) this.projectId = rootStore.router.projectId;
208207
if (this.cycleId !== rootStore.router.cycleId) this.cycleId = rootStore.router.cycleId;
209208
if (this.moduleId !== rootStore.router.moduleId) this.moduleId = rootStore.router.moduleId;

web/core/store/router.store.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export interface IRouterStore {
99
setQuery: (query: ParsedUrlQuery) => void;
1010
// computed
1111
workspaceSlug: string | undefined;
12-
teamId: string | undefined;
12+
teamspaceId: string | undefined;
1313
projectId: string | undefined;
1414
cycleId: string | undefined;
1515
moduleId: string | undefined;
@@ -36,7 +36,7 @@ export class RouterStore implements IRouterStore {
3636
setQuery: action.bound,
3737
//computed
3838
workspaceSlug: computed,
39-
teamId: computed,
39+
teamspaceId: computed,
4040
projectId: computed,
4141
cycleId: computed,
4242
moduleId: computed,
@@ -71,11 +71,11 @@ export class RouterStore implements IRouterStore {
7171
}
7272

7373
/**
74-
* Returns the team id from the query
74+
* Returns the teamspace id from the query
7575
* @returns string|undefined
7676
*/
77-
get teamId() {
78-
return this.query?.teamId?.toString();
77+
get teamspaceId() {
78+
return this.query?.teamspaceId?.toString();
7979
}
8080

8181
/**

0 commit comments

Comments
 (0)