π₯π₯π₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.
TypeScript boardsbug-trackerdjangodockerganttissue-trackerjirajira-alternativekanbanlinearpostgresqlproduct-managementproject-managementproject-planningpythonreactredistypesciptvitework-management
[WEB-1686] fix: issues incorrect filters while switching between, projects, modules etc (#4904)
rahulrameshaadec4e1f2d5c
diff --git a/web/core/components/issues/issue-layouts/calendar/roots/project-view-root.tsx b/web/core/components/issues/issue-layouts/calendar/roots/project-view-root.tsxindex 9a26e88118..dc073fc9ed 100644--- a/web/core/components/issues/issue-layouts/calendar/roots/project-view-root.tsx+++ b/web/core/components/issues/issue-layouts/calendar/roots/project-view-root.tsx@@ -1,4 +1,5 @@import { observer } from "mobx-react";+import { useParams } from "next/navigation";// hooksimport { ProjectIssueQuickActions } from "@/components/issues";// components@@ -6,6 +7,8 @@ import { ProjectIssueQuickActions } from "@/components/issues";import { BaseCalendarRoot } from "../base-calendar-root";// constants-export const ProjectViewCalendarLayout: React.FC = observer(() => (- <BaseCalendarRoot QuickActions={ProjectIssueQuickActions} />-));+export const ProjectViewCalendarLayout: React.FC = observer(() => {+ const { viewId } = useParams();++ return <BaseCalendarRoot QuickActions={ProjectIssueQuickActions} viewId={viewId.toString()} />;+});diff --git a/web/core/components/issues/issue-layouts/kanban/kanban-group.tsx b/web/core/components/issues/issue-layouts/kanban/kanban-group.tsxindex 3fa00f0a3b..f46b959c4a 100644--- a/web/core/components/issues/issue-layouts/kanban/kanban-group.tsx+++ b/web/core/components/issues/issue-layouts/kanban/kanban-group.tsx@@ -91,7 +91,7 @@ export const KanbanGroup = observer((props: IKanbanGroup) => {loadMoreIssues(groupId, sub_group_id === "null"? undefined: sub_group_id)}, [loadMoreIssues, groupId, sub_group_id])- const isPaginating = !!getIssueLoader(groupId);+ const isPaginating = !!getIssueLoader(groupId, sub_group_id);useIntersectionObserver(containerRef,diff --git a/web/core/components/issues/issue-layouts/kanban/roots/project-view-root.tsx b/web/core/components/issues/issue-layouts/kanban/roots/project-view-root.tsxindex 585c68c28e..051351444d 100644--- a/web/core/components/issues/issue-layouts/kanban/roots/project-view-root.tsx+++ b/web/core/components/issues/issue-layouts/kanban/roots/project-view-root.tsx@@ -1,5 +1,6 @@import React from "react";import { observer } from "mobx-react";+import { useParams } from "next/navigation";// hooks// constant// types@@ -7,6 +8,8 @@ import { ProjectIssueQuickActions } from "../../quick-action-dropdowns";// componentsimport { BaseKanBanRoot } from "../base-kanban-root";-export const ProjectViewKanBanLayout: React.FC = observer(() => (- <BaseKanBanRoot QuickActions={ProjectIssueQuickActions} />-));+export const ProjectViewKanBanLayout: React.FC = observer(() => {+ const { viewId } = useParams();++ return <BaseKanBanRoot QuickActions={ProjectIssueQuickActions} viewId={viewId.toString()} />;+});diff --git a/web/core/components/issues/issue-layouts/list/roots/project-view-root.tsx b/web/core/components/issues/issue-layouts/list/roots/project-view-root.tsxindex 73e7fd6ab2..9f7a07331e 100644--- a/web/core/components/issues/issue-layouts/list/roots/project-view-root.tsx+++ b/web/core/components/issues/issue-layouts/list/roots/project-view-root.tsx@@ -1,5 +1,6 @@import React from "react";import { observer } from "mobx-react";+import { useParams } from "next/navigation";// store// constants// types@@ -7,4 +8,8 @@ import { ProjectIssueQuickActions } from "../../quick-action-dropdowns";// componentsimport { BaseListRoot } from "../base-list-root";-export const ProjectViewListLayout: React.FC = observer(() => <BaseListRoot QuickActions={ProjectIssueQuickActions} />);+export const ProjectViewListLayout: React.FC = observer(() => {+ const { viewId } = useParams();++ return <BaseListRoot QuickActions={ProjectIssueQuickActions} viewId={viewId.toString()} />;+});diff --git a/web/core/components/issues/issue-layouts/roots/project-view-layout-root.tsx b/web/core/components/issues/issue-layouts/roots/project-view-layout-root.tsxindex 11412632dd..768d457816 100644--- a/web/core/components/issues/issue-layouts/roots/project-view-layout-root.tsx+++ b/web/core/components/issues/issue-layouts/roots/project-view-layout-root.tsx@@ -19,7 +19,7 @@ import { useIssues } from "@/hooks/store";import { IssuesStoreContext } from "@/hooks/use-issue-layout-store";// types-const ProjectViewIssueLayout = (props: { activeLayout: EIssueLayoutTypes | undefined }) => {+const ProjectViewIssueLayout = (props: { activeLayout: EIssueLayoutTypes | undefined; viewId: string }) => {switch (props.activeLayout) {case EIssueLayoutTypes.LIST:return <ProjectViewListLayout />;@@ -61,7 +61,7 @@ export const ProjectViewLayoutRoot: React.FC = observer(() => {<div className="relative flex h-full w-full flex-col overflow-hidden"><ProjectViewAppliedFiltersRoot /><div className="relative h-full w-full overflow-auto">- <ProjectViewIssueLayout activeLayout={activeLayout} />+ <ProjectViewIssueLayout activeLayout={activeLayout} viewId={viewId.toString()} /></div>{/* peek overview */}diff --git a/web/core/components/issues/issue-layouts/spreadsheet/roots/project-view-root.tsx b/web/core/components/issues/issue-layouts/spreadsheet/roots/project-view-root.tsxindex ce7cebfbb6..78cf20bfb2 100644--- a/web/core/components/issues/issue-layouts/spreadsheet/roots/project-view-root.tsx+++ b/web/core/components/issues/issue-layouts/spreadsheet/roots/project-view-root.tsx@@ -1,5 +1,6 @@import React from "react";import { observer } from "mobx-react";+import { useParams } from "next/navigation";// mobx store// componentsimport { ProjectIssueQuickActions } from "../../quick-action-dropdowns";@@ -7,6 +8,8 @@ import { BaseSpreadsheetRoot } from "../base-spreadsheet-root";// types// constants-export const ProjectViewSpreadsheetLayout: React.FC = observer(() => (- <BaseSpreadsheetRoot QuickActions={ProjectIssueQuickActions} />-));+export const ProjectViewSpreadsheetLayout: React.FC = observer(() => {+ const { viewId } = useParams();++ return <BaseSpreadsheetRoot QuickActions={ProjectIssueQuickActions} viewId={viewId.toString()} />;+});diff --git a/web/core/hooks/use-issues-actions.tsx b/web/core/hooks/use-issues-actions.tsxindex 2ea3df51e0..482618697b 100644--- a/web/core/hooks/use-issues-actions.tsx+++ b/web/core/hooks/use-issues-actions.tsx@@ -459,16 +459,16 @@ const useProjectViewIssueActions = () => {const { issues, issuesFilter } = useIssues(EIssuesStoreType.PROJECT_VIEW);const fetchIssues = useCallback(- async (loadType: TLoader, options: IssuePaginationOptions) => {- if (!workspaceSlug || !projectId) return;- return issues.fetchIssues(workspaceSlug.toString(), projectId.toString(), loadType, options);+ async (loadType: TLoader, options: IssuePaginationOptions, viewId?: string) => {+ if (!workspaceSlug || !projectId || !viewId) return;+ return issues.fetchIssues(workspaceSlug.toString(), projectId.toString(), viewId, loadType, options);},[issues.fetchIssues, workspaceSlug, projectId]);const fetchNextIssues = useCallback(async (groupId?: string, subGroupId?: string) => {- if (!workspaceSlug || !projectId) return;- return issues.fetchNextIssues(workspaceSlug.toString(), projectId.toString(), groupId, subGroupId);+ if (!workspaceSlug || !projectId || !viewId) return;+ return issues.fetchNextIssues(workspaceSlug.toString(), projectId.toString(), viewId, groupId, subGroupId);},[issues.fetchIssues, workspaceSlug, projectId]);diff --git a/web/core/store/issue/archived/filter.store.ts b/web/core/store/issue/archived/filter.store.tsindex f48cf735ce..3f0a4fedc9 100644--- a/web/core/store/issue/archived/filter.store.ts+++ b/web/core/store/issue/archived/filter.store.ts@@ -28,6 +28,7 @@ export interface IArchivedIssuesFilter extends IBaseIssueFilterStore {//helper actionsgetFilterParams: (options: IssuePaginationOptions,+ projectId: string,cursor: string | undefined,groupId: string | undefined,subGroupId: string | undefined@@ -72,6 +73,17 @@ export class ArchivedIssuesFilter extends IssueFilterHelperStore implements IArcconst projectId = this.rootIssueStore.projectId;if (!projectId) return undefined;+ return this.getIssueFilters(projectId);+ }++ get appliedFilters() {+ const projectId = this.rootIssueStore.projectId;+ if (!projectId) return undefined;++ return this.getAppliedFilters(projectId);+ }++ getIssueFilters(projectId: string) {const displayFilters = this.filters[projectId] || undefined;if (isEmpty(displayFilters)) return undefined;@@ -80,8 +92,8 @@ export class ArchivedIssuesFilter extends IssueFilterHelperStore implements IArcreturn _filters;}- get appliedFilters() {- const userFilters = this.issueFilters;+ getAppliedFilters(projectId: string) {+ const userFilters = this.getIssueFilters(projectId);if (!userFilters) return undefined;const filteredParams = handleIssueQueryParamsByLayout(userFilters?.displayFilters?.layout, "issues");@@ -99,11 +111,12 @@ export class ArchivedIssuesFilter extends IssueFilterHelperStore implements IArcgetFilterParams = computedFn((options: IssuePaginationOptions,+ projectId: string,cursor: string | undefined,groupId: string | undefined,subGroupId: string | undefined) => {- const filterParams = this.appliedFilters;+ const filterParams = this.getAppliedFilters(projectId);const paginationParams = this.getPaginationParams(filterParams, options, cursor, groupId, subGroupId);return paginationParams;@@ -211,7 +224,9 @@ export class ArchivedIssuesFilter extends IssueFilterHelperStore implements IArc});});- this.rootIssueStore.archivedIssues.fetchIssuesWithExistingPagination(workspaceSlug, projectId, "mutation");+ if (this.getShouldReFetchIssues(updatedDisplayFilters)) {+ this.rootIssueStore.archivedIssues.fetchIssuesWithExistingPagination(workspaceSlug, projectId, "mutation");+ }this.handleIssuesLocalFilters.set(EIssuesStoreType.ARCHIVED, type, workspaceSlug, projectId, undefined, {display_filters: _filters.displayFilters,diff --git a/web/core/store/issue/archived/issue.store.ts b/web/core/store/issue/archived/issue.store.tsindex e4322d6657..1d3b691fb0 100644--- a/web/core/store/issue/archived/issue.store.ts+++ b/web/core/store/issue/archived/issue.store.ts@@ -94,7 +94,7 @@ export class ArchivedIssues extends BaseIssuesStore implements IArchivedIssues {this.clear(!isExistingPaginationOptions);// get params from pagination options- const params = this.issueFilterStore?.getFilterParams(options, undefined, undefined, undefined);+ const params = this.issueFilterStore?.getFilterParams(options, projectId, undefined, undefined, undefined);// call the fetch issues API with the paramsconst response = await this.issueArchiveService.getArchivedIssues(workspaceSlug, projectId, params, {signal: this.controller.signal,@@ -131,6 +131,7 @@ export class ArchivedIssues extends BaseIssuesStore implements IArchivedIssues {// get params from stored pagination optionsconst params = this.issueFilterStore?.getFilterParams(this.paginationOptions,+ projectId,this.getNextCursor(groupId, subGroupId),groupId,subGroupIddiff --git a/web/core/store/issue/cycle/filter.store.ts b/web/core/store/issue/cycle/filter.store.tsindex bacc256527..490393a43a 100644--- a/web/core/store/issue/cycle/filter.store.ts+++ b/web/core/store/issue/cycle/filter.store.ts@@ -28,6 +28,7 @@ export interface ICycleIssuesFilter extends IBaseIssueFilterStore {//helper actionsgetFilterParams: (options: IssuePaginationOptions,+ cycleId: string,cursor: string | undefined,groupId: string | undefined,subGroupId: string | undefined@@ -73,6 +74,17 @@ export class CycleIssuesFilter extends IssueFilterHelperStore implements ICycleIconst cycleId = this.rootIssueStore.cycleId;if (!cycleId) return undefined;+ return this.getIssueFilters(cycleId);+ }++ get appliedFilters() {+ const cycleId = this.rootIssueStore.cycleId;+ if (!cycleId) return undefined;++ return this.getAppliedFilters(cycleId);+ }++ getIssueFilters(cycleId: string) {const displayFilters = this.filters[cycleId] || undefined;if (isEmpty(displayFilters)) return undefined;@@ -81,8 +93,8 @@ export class CycleIssuesFilter extends IssueFilterHelperStore implements ICycleIreturn _filters;}- get appliedFilters() {- const userFilters = this.issueFilters;+ getAppliedFilters(cycleId: string) {+ const userFilters = this.getIssueFilters(cycleId);if (!userFilters) return undefined;const filteredParams = handleIssueQueryParamsByLayout(userFilters?.displayFilters?.layout, "issues");@@ -102,11 +114,12 @@ export class CycleIssuesFilter extends IssueFilterHelperStore implements ICycleIgetFilterParams = computedFn((options: IssuePaginationOptions,+ cycleId: string,cursor: string | undefined,groupId: string | undefined,subGroupId: string | undefined) => {- const filterParams = this.appliedFilters;+ const filterParams = this.getAppliedFilters(cycleId);const paginationParams = this.getPaginationParams(filterParams, options, cursor, groupId, subGroupId);return paginationParams;@@ -223,12 +236,14 @@ export class CycleIssuesFilter extends IssueFilterHelperStore implements ICycleI});});- this.rootIssueStore.cycleIssues.fetchIssuesWithExistingPagination(- workspaceSlug,- projectId,- "mutation",- cycleId- );+ if (this.getShouldReFetchIssues(updatedDisplayFilters)) {+ this.rootIssueStore.cycleIssues.fetchIssuesWithExistingPagination(+ workspaceSlug,+ projectId,+ "mutation",+ cycleId+ );+ }await this.issueFilterService.patchCycleIssueFilters(workspaceSlug, projectId, cycleId, {display_filters: _filters.displayFilters,diff --git a/web/core/store/issue/cycle/issue.store.ts b/web/core/store/issue/cycle/issue.store.tsindex 61d2cfe44d..a71337ea62 100644--- a/web/core/store/issue/cycle/issue.store.ts+++ b/web/core/store/issue/cycle/issue.store.ts@@ -161,7 +161,7 @@ export class CycleIssues extends BaseIssuesStore implements ICycleIssues {this.clear(!isExistingPaginationOptions);// get params from pagination options- const params = this.issueFilterStore?.getFilterParams(options, undefined, undefined, undefined);+ const params = this.issueFilterStore?.getFilterParams(options, cycleId, undefined, undefined, undefined);// call the fetch issues API with the paramsconst response = await this.cycleService.getCycleIssues(workspaceSlug, projectId, cycleId, params, {signal: this.controller.signal,@@ -205,6 +205,7 @@ export class CycleIssues extends BaseIssuesStore implements ICycleIssues {// get params from stored pagination optionsconst params = this.issueFilterStore?.getFilterParams(this.paginationOptions,+ cycleId,this.getNextCursor(groupId, subGroupId),groupId,subGroupIddiff --git a/web/core/store/issue/draft/filter.store.ts b/web/core/store/issue/draft/filter.store.tsindex ea503632d2..caec39b932 100644--- a/web/core/store/issue/draft/filter.store.ts+++ b/web/core/store/issue/draft/filter.store.ts@@ -28,6 +28,7 @@ export interface IDraftIssuesFilter extends IBaseIssueFilterStore {//helper actionsgetFilterParams: (options: IssuePaginationOptions,+ projectId: string,cursor: string | undefined,groupId: string | undefined,subGroupId: string | undefined@@ -72,6 +73,17 @@ export class DraftIssuesFilter extends IssueFilterHelperStore implements IDraftIconst projectId = this.rootIssueStore.projectId;if (!projectId) return undefined;+ return this.getIssueFilters(projectId);+ }++ get appliedFilters() {+ const projectId = this.rootIssueStore.projectId;+ if (!projectId) return undefined;++ return this.getAppliedFilters(projectId);+ }++ getIssueFilters(projectId: string) {const displayFilters = this.filters[projectId] || undefined;if (!projectId || isEmpty(displayFilters)) return undefined;@@ -80,8 +92,8 @@ export class DraftIssuesFilter extends IssueFilterHelperStore implements IDraftIreturn _filters;}- get appliedFilters() {- const userFilters = this.issueFilters;+ getAppliedFilters(projectId: string) {+ const userFilters = this.getIssueFilters(projectId);if (!userFilters) return undefined;const filteredParams = handleIssueQueryParamsByLayout(userFilters?.displayFilters?.layout, "issues");@@ -99,11 +111,12 @@ export class DraftIssuesFilter extends IssueFilterHelperStore implements IDraftIgetFilterParams = computedFn((options: IssuePaginationOptions,+ projectId: string,cursor: string | undefined,groupId: string | undefined,subGroupId: string | undefined) => {- const filterParams = this.appliedFilters;+ const filterParams = this.getAppliedFilters(projectId);const paginationParams = this.getPaginationParams(filterParams, options, cursor, groupId, subGroupId);return paginationParams;@@ -206,7 +219,9 @@ export class DraftIssuesFilter extends IssueFilterHelperStore implements IDraftI});});- this.rootIssueStore.draftIssues.fetchIssuesWithExistingPagination(workspaceSlug, projectId, "mutation");+ if (this.getShouldReFetchIssues(updatedDisplayFilters)) {+ this.rootIssueStore.draftIssues.fetchIssuesWithExistingPagination(workspaceSlug, projectId, "mutation");+ }this.handleIssuesLocalFilters.set(EIssuesStoreType.DRAFT, type, workspaceSlug, projectId, undefined, {display_filters: _filters.displayFilters,diff --git a/web/core/store/issue/draft/issue.store.ts b/web/core/store/issue/draft/issue.store.tsindex 5d4a6e88f0..b5a85e786f 100644--- a/web/core/store/issue/draft/issue.store.ts+++ b/web/core/store/issue/draft/issue.store.ts@@ -92,7 +92,7 @@ export class DraftIssues extends BaseIssuesStore implements IDraftIssues {this.clear(!isExistingPaginationOptions);// get params from pagination options- const params = this.issueFilterStore?.getFilterParams(options, undefined, undefined, undefined);+ const params = this.issueFilterStore?.getFilterParams(options, projectId, undefined, undefined, undefined);// call the fetch issues API with the paramsconst response = await this.issueDraftService.getDraftIssues(workspaceSlug, projectId, params, {signal: this.controller.signal,@@ -129,6 +129,7 @@ export class DraftIssues extends BaseIssuesStore implements IDraftIssues {// get params from stored pagination optionsconst params = this.issueFilterStore?.getFilterParams(this.paginationOptions,+ projectId,this.getNextCursor(groupId, subGroupId),groupId,subGroupIddiff --git a/web/core/store/issue/helpers/issue-filter-helper.store.ts b/web/core/store/issue/helpers/issue-filter-helper.store.tsindex 41d014d399..42eccc6a61 100644--- a/web/core/store/issue/helpers/issue-filter-helper.store.ts+++ b/web/core/store/issue/helpers/issue-filter-helper.store.ts@@ -290,7 +290,7 @@ export class IssueFilterHelperStore implements IIssueFilterHelperStore {* @param displayFilters* @returns*/- requiresServerUpdate = (displayFilters: IIssueDisplayFilterOptions) => {+ getShouldReFetchIssues = (displayFilters: IIssueDisplayFilterOptions) => {const NON_SERVER_DISPLAY_FILTERS = ["order_by", "sub_issue", "type"];const displayFilterKeys = Object.keys(displayFilters);diff --git a/web/core/store/issue/module/filter.store.ts b/web/core/store/issue/module/filter.store.tsindex 16aee2457d..1e02ba13ad 100644--- a/web/core/store/issue/module/filter.store.ts+++ b/web/core/store/issue/module/filter.store.ts@@ -28,6 +28,7 @@ export interface IModuleIssuesFilter extends IBaseIssueFilterStore {//helper actionsgetFilterParams: (options: IssuePaginationOptions,+ moduleId: string,cursor: string | undefined,groupId: string | undefined,subGroupId: string | undefined@@ -73,6 +74,17 @@ export class ModuleIssuesFilter extends IssueFilterHelperStore implements IModulconst moduleId = this.rootIssueStore.moduleId;if (!moduleId) return undefined;+ return this.getIssueFilters(moduleId);+ }++ get appliedFilters() {+ const moduleId = this.rootIssueStore.moduleId;+ if (!moduleId) return undefined;++ return this.getAppliedFilters(moduleId);+ }++ getIssueFilters(moduleId: string) {const displayFilters = this.filters[moduleId] || undefined;if (isEmpty(displayFilters)) return undefined;@@ -81,8 +93,8 @@ export class ModuleIssuesFilter extends IssueFilterHelperStore implements IModulreturn _filters;}- get appliedFilters() {- const userFilters = this.issueFilters;+ getAppliedFilters(moduleId: string) {+ const userFilters = this.getIssueFilters(moduleId);if (!userFilters) return undefined;const filteredParams = handleIssueQueryParamsByLayout(userFilters?.displayFilters?.layout, "issues");@@ -102,11 +114,12 @@ export class ModuleIssuesFilter extends IssueFilterHelperStore implements IModulgetFilterParams = computedFn((options: IssuePaginationOptions,+ moduleId: string,cursor: string | undefined,groupId: string | undefined,subGroupId: string | undefined) => {- const filterParams = this.appliedFilters;+ const filterParams = this.getAppliedFilters(moduleId);const paginationParams = this.getPaginationParams(filterParams, options, cursor, groupId, subGroupId);return paginationParams;@@ -222,12 +235,14 @@ export class ModuleIssuesFilter extends IssueFilterHelperStore implements IModul});});- this.rootIssueStore.moduleIssues.fetchIssuesWithExistingPagination(- workspaceSlug,- projectId,- "mutation",- moduleId- );+ if (this.getShouldReFetchIssues(updatedDisplayFilters)) {+ this.rootIssueStore.moduleIssues.fetchIssuesWithExistingPagination(+ workspaceSlug,+ projectId,+ "mutation",+ moduleId+ );+ }await this.issueFilterService.patchModuleIssueFilters(workspaceSlug, projectId, moduleId, {display_filters: _filters.displayFilters,diff --git a/web/core/store/issue/module/issue.store.ts b/web/core/store/issue/module/issue.store.tsindex b042e3c490..4f89f03663 100644--- a/web/core/store/issue/module/issue.store.ts+++ b/web/core/store/issue/module/issue.store.ts@@ -116,7 +116,7 @@ export class ModuleIssues extends BaseIssuesStore implements IModuleIssues {this.clear(!isExistingPaginationOptions);// get params from pagination options- const params = this.issueFilterStore?.getFilterParams(options, undefined, undefined, undefined);+ const params = this.issueFilterStore?.getFilterParams(options, moduleId, undefined, undefined, undefined);// call the fetch issues API with the paramsconst response = await this.moduleService.getModuleIssues(workspaceSlug, projectId, moduleId, params, {signal: this.controller.signal,@@ -160,6 +160,7 @@ export class ModuleIssues extends BaseIssuesStore implements IModuleIssues {// get params from stored pagination optionsconst params = this.issueFilterStore?.getFilterParams(this.paginationOptions,+ moduleId,this.getNextCursor(groupId, subGroupId),groupId,subGroupIddiff --git a/web/core/store/issue/profile/filter.store.ts b/web/core/store/issue/profile/filter.store.tsindex f13c3d2970..8e27a10816 100644--- a/web/core/store/issue/profile/filter.store.ts+++ b/web/core/store/issue/profile/filter.store.ts@@ -30,6 +30,7 @@ export interface IProfileIssuesFilter extends IBaseIssueFilterStore {//helper actionsgetFilterParams: (options: IssuePaginationOptions,+ userId: string,cursor: string | undefined,groupId: string | undefined,subGroupId: string | undefined@@ -77,6 +78,17 @@ export class ProfileIssuesFilter extends IssueFilterHelperStore implements IProfconst userId = this.rootIssueStore.userId;if (!userId) return undefined;+ return this.getIssueFilters(userId);+ }++ get appliedFilters() {+ const userId = this.rootIssueStore.userId;+ if (!userId) return undefined;++ return this.getAppliedFilters(userId);+ }++ getIssueFilters(userId: string) {const displayFilters = this.filters[userId] || undefined;if (isEmpty(displayFilters)) return undefined;@@ -85,8 +97,8 @@ export class ProfileIssuesFilter extends IssueFilterHelperStore implements IProfreturn _filters;}- get appliedFilters() {- const userFilters = this.issueFilters;+ getAppliedFilters(userId: string) {+ const userFilters = this.getIssueFilters(userId);if (!userFilters) return undefined;const filteredParams = handleIssueQueryParamsByLayout(userFilters?.displayFilters?.layout, "profile_issues");@@ -104,11 +116,12 @@ export class ProfileIssuesFilter extends IssueFilterHelperStore implements IProfgetFilterParams = computedFn((options: IssuePaginationOptions,+ userId: string,cursor: string | undefined,groupId: string | undefined,subGroupId: string | undefined) => {- const filterParams = this.appliedFilters;+ const filterParams = this.getAppliedFilters(userId);const paginationParams = this.getPaginationParams(filterParams, options, cursor, groupId, subGroupId);return paginationParams;diff --git a/web/core/store/issue/profile/issue.store.ts b/web/core/store/issue/profile/issue.store.tsindex 3bfd3dc0ea..a41d33088f 100644--- a/web/core/store/issue/profile/issue.store.ts+++ b/web/core/store/issue/profile/issue.store.ts@@ -119,7 +119,7 @@ export class ProfileIssues extends BaseIssuesStore implements IProfileIssues {this.setViewId(view);// get params from pagination options- let params = this.issueFilterStore?.getFilterParams(options, undefined, undefined, undefined);+ let params = this.issueFilterStore?.getFilterParams(options, userId, undefined, undefined, undefined);params = {...params,assignees: undefined,@@ -167,6 +167,7 @@ export class ProfileIssues extends BaseIssuesStore implements IProfileIssues {// get params from stored pagination optionslet params = this.issueFilterStore?.getFilterParams(this.paginationOptions,+ userId,this.getNextCursor(groupId, subGroupId),groupId,subGroupIddiff --git a/web/core/store/issue/project-views/filter.store.ts b/web/core/store/issue/project-views/filter.store.tsindex d8d95b7d62..40169e89cf 100644--- a/web/core/store/issue/project-views/filter.store.ts+++ b/web/core/store/issue/project-views/filter.store.ts@@ -28,6 +28,7 @@ export interface IProjectViewIssuesFilter extends IBaseIssueFilterStore {//helper actionsgetFilterParams: (options: IssuePaginationOptions,+ viewId: string,cursor: string | undefined,groupId: string | undefined,subGroupId: string | undefined@@ -73,6 +74,17 @@ export class ProjectViewIssuesFilter extends IssueFilterHelperStore implements Iconst viewId = this.rootIssueStore.viewId;if (!viewId) return undefined;+ return this.getIssueFilters(viewId);+ }++ get appliedFilters() {+ const viewId = this.rootIssueStore.viewId;+ if (!viewId) return undefined;++ return this.getAppliedFilters(viewId);+ }++ getIssueFilters(viewId: string) {const displayFilters = this.filters[viewId] || undefined;if (isEmpty(displayFilters)) return undefined;@@ -81,8 +93,8 @@ export class ProjectViewIssuesFilter extends IssueFilterHelperStore implements Ireturn _filters;}- get appliedFilters() {- const userFilters = this.issueFilters;+ getAppliedFilters(viewId: string) {+ const userFilters = this.getIssueFilters(viewId);if (!userFilters) return undefined;const filteredParams = handleIssueQueryParamsByLayout(userFilters?.displayFilters?.layout, "issues");@@ -100,11 +112,12 @@ export class ProjectViewIssuesFilter extends IssueFilterHelperStore implements IgetFilterParams = computedFn((options: IssuePaginationOptions,+ viewId: string,cursor: string | undefined,groupId: string | undefined,subGroupId: string | undefined) => {- const filterParams = this.appliedFilters;+ const filterParams = this.getAppliedFilters(viewId);const paginationParams = this.getPaginationParams(filterParams, options, cursor, groupId, subGroupId);return paginationParams;@@ -180,6 +193,7 @@ export class ProjectViewIssuesFilter extends IssueFilterHelperStore implements Ithis.rootIssueStore.projectViewIssues.fetchIssuesWithExistingPagination(workspaceSlug,projectId,+ viewId,isEmpty(filteredFilters) ? "init-loader" : "mutation");break;@@ -217,7 +231,14 @@ export class ProjectViewIssuesFilter extends IssueFilterHelperStore implements I});});- this.rootIssueStore.projectViewIssues.fetchIssuesWithExistingPagination(workspaceSlug, projectId, "mutation");+ if (this.getShouldReFetchIssues(updatedDisplayFilters)) {+ this.rootIssueStore.projectViewIssues.fetchIssuesWithExistingPagination(+ workspaceSlug,+ projectId,+ viewId,+ "mutation"+ );+ }await this.issueFilterService.patchView(workspaceSlug, projectId, viewId, {display_filters: _filters.displayFilters,diff --git a/web/core/store/issue/project-views/issue.store.ts b/web/core/store/issue/project-views/issue.store.tsindex 1d2d7f0c9f..2088d30c1e 100644--- a/web/core/store/issue/project-views/issue.store.ts+++ b/web/core/store/issue/project-views/issue.store.ts@@ -20,17 +20,20 @@ export interface IProjectViewIssues extends IBaseIssuesStore {fetchIssues: (workspaceSlug: string,projectId: string,+ viewId: string,loadType: TLoader,options: IssuePaginationOptions) => Promise<TIssuesResponse | undefined>;fetchIssuesWithExistingPagination: (workspaceSlug: string,projectId: string,+ viewId: string,loadType: TLoader) => Promise<TIssuesResponse | undefined>;fetchNextIssues: (workspaceSlug: string,projectId: string,+ viewId: string,groupId?: string,subGroupId?: string) => Promise<TIssuesResponse | undefined>;@@ -78,6 +81,7 @@ export class ProjectViewIssues extends BaseIssuesStore implements IProjectViewIsfetchIssues = async (workspaceSlug: string,projectId: string,+ viewId: string,loadType: TLoader,options: IssuePaginationOptions,isExistingPaginationOptions: boolean = false@@ -90,7 +94,7 @@ export class ProjectViewIssues extends BaseIssuesStore implements IProjectViewIsthis.clear(!isExistingPaginationOptions);// get params from pagination options- const params = this.issueFilterStore?.getFilterParams(options, undefined, undefined, undefined);+ const params = this.issueFilterStore?.getFilterParams(options, viewId, undefined, undefined, undefined);// call the fetch issues API with the paramsconst response = await this.issueService.getIssues(workspaceSlug, projectId, params, {signal: this.controller.signal,@@ -116,7 +120,13 @@ export class ProjectViewIssues extends BaseIssuesStore implements IProjectViewIs* @param subGroupId* @returns*/- fetchNextIssues = async (workspaceSlug: string, projectId: string, groupId?: string, subGroupId?: string) => {+ fetchNextIssues = async (+ workspaceSlug: string,+ projectId: string,+ viewId: string,+ groupId?: string,+ subGroupId?: string+ ) => {const cursorObject = this.getPaginationData(groupId, subGroupId);// if there are no pagination options and the next page results do not exist the returnif (!this.paginationOptions || (cursorObject && !cursorObject?.nextPageResults)) return;@@ -127,6 +137,7 @@ export class ProjectViewIssues extends BaseIssuesStore implements IProjectViewIs// get params from stored pagination optionsconst params = this.issueFilterStore?.getFilterParams(this.paginationOptions,+ viewId,this.getNextCursor(groupId, subGroupId),groupId,subGroupId@@ -152,9 +163,14 @@ export class ProjectViewIssues extends BaseIssuesStore implements IProjectViewIs* @param loadType* @returns*/- fetchIssuesWithExistingPagination = async (workspaceSlug: string, projectId: string, loadType: TLoader) => {+ fetchIssuesWithExistingPagination = async (+ workspaceSlug: string,+ projectId: string,+ viewId: string,+ loadType: TLoader+ ) => {if (!this.paginationOptions) return;- return await this.fetchIssues(workspaceSlug, projectId, loadType, this.paginationOptions, true);+ return await this.fetchIssues(workspaceSlug, projectId, viewId, loadType, this.paginationOptions, true);};archiveBulkIssues = this.bulkArchiveIssues;diff --git a/web/core/store/issue/project/filter.store.ts b/web/core/store/issue/project/filter.store.tsindex 6ea79fe1b3..a8e6110164 100644--- a/web/core/store/issue/project/filter.store.ts+++ b/web/core/store/issue/project/filter.store.ts@@ -28,6 +28,7 @@ export interface IProjectIssuesFilter extends IBaseIssueFilterStore {//helper actionsgetFilterParams: (options: IssuePaginationOptions,+ projectId: string,cursor: string | undefined,groupId: string | undefined,subGroupId: string | undefined@@ -70,18 +71,27 @@ export class ProjectIssuesFilter extends IssueFilterHelperStore implements IProjget issueFilters() {const projectId = this.rootIssueStore.projectId;- console.log("projectId", projectId);if (!projectId) return undefined;+ return this.getIssueFilters(projectId);+ }++ get appliedFilters() {+ const projectId = this.rootIssueStore.projectId;+ if (!projectId) return undefined;++ return this.getAppliedFilters(projectId);+ }++ getIssueFilters(projectId: string) {const displayFilters = this.filters[projectId] || undefined;- console.log("displayFilters", displayFilters);if (isEmpty(displayFilters)) return undefined;return this.computedIssueFilters(displayFilters);}- get appliedFilters() {- const userFilters = this.issueFilters;+ getAppliedFilters(projectId: string) {+ const userFilters = this.getIssueFilters(projectId);if (!userFilters) return undefined;const filteredParams = handleIssueQueryParamsByLayout(userFilters?.displayFilters?.layout, "issues");@@ -99,11 +109,12 @@ export class ProjectIssuesFilter extends IssueFilterHelperStore implements IProjgetFilterParams = computedFn((options: IssuePaginationOptions,+ projectId: string,cursor: string | undefined,groupId: string | undefined,subGroupId: string | undefined) => {- const filterParams = this.appliedFilters;+ const filterParams = this.getAppliedFilters(projectId);const paginationParams = this.getPaginationParams(filterParams, options, cursor, groupId, subGroupId);return paginationParams;}@@ -217,8 +228,9 @@ export class ProjectIssuesFilter extends IssueFilterHelperStore implements IProj});});- if (this.requiresServerUpdate(updatedDisplayFilters))+ if (this.getShouldReFetchIssues(updatedDisplayFilters)) {this.rootIssueStore.projectIssues.fetchIssuesWithExistingPagination(workspaceSlug, projectId, "mutation");+ }await this.issueFilterService.patchProjectIssueFilters(workspaceSlug, projectId, {display_filters: _filters.displayFilters,diff --git a/web/core/store/issue/project/issue.store.ts b/web/core/store/issue/project/issue.store.tsindex 27a6962535..413081716b 100644--- a/web/core/store/issue/project/issue.store.ts+++ b/web/core/store/issue/project/issue.store.ts@@ -93,7 +93,7 @@ export class ProjectIssues extends BaseIssuesStore implements IProjectIssues {this.clear(!isExistingPaginationOptions);// get params from pagination options- const params = this.issueFilterStore?.getFilterParams(options, undefined, undefined, undefined);+ const params = this.issueFilterStore?.getFilterParams(options, projectId, undefined, undefined, undefined);// call the fetch issues API with the paramsconst response = await this.issueService.getIssues(workspaceSlug, projectId, params, {signal: this.controller.signal,@@ -130,6 +130,7 @@ export class ProjectIssues extends BaseIssuesStore implements IProjectIssues {// get params from stored pagination optionsconst params = this.issueFilterStore?.getFilterParams(this.paginationOptions,+ projectId,this.getNextCursor(groupId, subGroupId),groupId,subGroupIddiff --git a/web/core/store/issue/workspace/filter.store.ts b/web/core/store/issue/workspace/filter.store.tsindex 1e05f5564f..9fc48a424b 100644--- a/web/core/store/issue/workspace/filter.store.ts+++ b/web/core/store/issue/workspace/filter.store.ts@@ -41,8 +41,8 @@ export interface IWorkspaceIssuesFilter extends IBaseIssueFilterStore {getIssueFilters: (viewId: string | undefined) => IIssueFilters | undefined;getAppliedFilters: (viewId: string) => Partial<Record<TIssueParams, string | boolean>> | undefined;getFilterParams: (- viewId: string,options: IssuePaginationOptions,+ viewId: string,cursor: string | undefined,groupId: string | undefined,subGroupId: string | undefined@@ -104,10 +104,20 @@ export class WorkspaceIssuesFilter extends IssueFilterHelperStore implements IWoreturn filteredRouteParams;};+ get issueFilters() {+ const viewId = this.rootIssueStore.globalViewId;+ return this.getIssueFilters(viewId);+ }++ get appliedFilters() {+ const viewId = this.rootIssueStore.globalViewId;+ return this.getAppliedFilters(viewId);+ }+getFilterParams = computedFn((- viewId: string,options: IssuePaginationOptions,+ viewId: string,cursor: string | undefined,groupId: string | undefined,subGroupId: string | undefined@@ -119,16 +129,6 @@ export class WorkspaceIssuesFilter extends IssueFilterHelperStore implements IWo});- get issueFilters() {- const viewId = this.rootIssueStore.globalViewId;- return this.getIssueFilters(viewId);- }-- get appliedFilters() {- const viewId = this.rootIssueStore.globalViewId;- return this.getAppliedFilters(viewId);- }-fetchFilters = async (workspaceSlug: string, viewId: TWorkspaceFilters) => {try {let filters: IIssueFilterOptions;diff --git a/web/core/store/issue/workspace/issue.store.ts b/web/core/store/issue/workspace/issue.store.tsindex 24415a9b7c..a3bf7a6cc3 100644--- a/web/core/store/issue/workspace/issue.store.ts+++ b/web/core/store/issue/workspace/issue.store.ts@@ -92,7 +92,7 @@ export class WorkspaceIssues extends BaseIssuesStore implements IWorkspaceIssuesthis.clear(!isExistingPaginationOptions);// get params from pagination options- const params = this.issueFilterStore?.getFilterParams(viewId, options, undefined, undefined, undefined);+ const params = this.issueFilterStore?.getFilterParams(options, viewId, undefined, undefined, undefined);// call the fetch issues API with the paramsconst response = await this.workspaceService.getViewIssues(workspaceSlug, params, {signal: this.controller.signal,@@ -128,8 +128,8 @@ export class WorkspaceIssues extends BaseIssuesStore implements IWorkspaceIssues// get params from stored pagination optionsconst params = this.issueFilterStore?.getFilterParams(- viewId,this.paginationOptions,+ viewId,this.getNextCursor(groupId, subGroupId),groupId,subGroupId