chore: handled issues render data structure in project, cycle, module and project-view issues

This commit is contained in:
gurusainath 2023-10-28 18:03:06 +05:30
parent fc82d6fc23
commit af9aec6769
5 changed files with 19 additions and 10 deletions

View File

@ -258,7 +258,12 @@ export class CycleIssueStore implements ICycleIssueStore {
this.error = null; this.error = null;
const params = this.rootStore?.cycleIssueFilter?.appliedFilters; const params = this.rootStore?.cycleIssueFilter?.appliedFilters;
const issueResponse = await this.cycleService.getCycleIssuesWithParams(workspaceSlug, projectId, cycleId, params); const issueResponse: any = await this.cycleService.getCycleIssuesWithParams(
workspaceSlug,
projectId,
cycleId,
params
);
const issueType = this.getIssueType; const issueType = this.getIssueType;
if (issueType != null) { if (issueType != null) {
@ -266,7 +271,7 @@ export class CycleIssueStore implements ICycleIssueStore {
...this.issues, ...this.issues,
[cycleId]: { [cycleId]: {
...this.issues[cycleId], ...this.issues[cycleId],
[issueType]: issueResponse, [issueType]: issueResponse?.["data"],
}, },
}; };
runInAction(() => { runInAction(() => {

View File

@ -300,7 +300,7 @@ export class IssueStore implements IIssueStore {
this.rootStore.project.setProjectId(projectId); this.rootStore.project.setProjectId(projectId);
const params = this.rootStore?.issueFilter?.appliedFilters; const params = this.rootStore?.issueFilter?.appliedFilters;
const issueResponse = await this.issueService.getIssuesWithParams(workspaceSlug, projectId, params); const issueResponse: any = await this.issueService.getIssuesWithParams(workspaceSlug, projectId, params);
const issueType = this.getIssueType; const issueType = this.getIssueType;
if (issueType != null) { if (issueType != null) {
@ -308,7 +308,7 @@ export class IssueStore implements IIssueStore {
...this.issues, ...this.issues,
[projectId]: { [projectId]: {
...this.issues[projectId], ...this.issues[projectId],
[issueType]: issueResponse, [issueType]: issueResponse?.["data"],
}, },
}; };
runInAction(() => { runInAction(() => {

View File

@ -268,7 +268,7 @@ export class ModuleIssueStore implements IModuleIssueStore {
this.error = null; this.error = null;
const params = this.rootStore?.moduleFilter?.appliedFilters; const params = this.rootStore?.moduleFilter?.appliedFilters;
const issueResponse = await this.moduleService.getModuleIssuesWithParams( const issueResponse: any = await this.moduleService.getModuleIssuesWithParams(
workspaceSlug, workspaceSlug,
projectId, projectId,
moduleId, moduleId,
@ -281,7 +281,7 @@ export class ModuleIssueStore implements IModuleIssueStore {
...this.issues, ...this.issues,
[moduleId]: { [moduleId]: {
...this.issues[moduleId], ...this.issues[moduleId],
[issueType]: issueResponse, [issueType]: issueResponse?.["data"],
}, },
}; };
runInAction(() => { runInAction(() => {

View File

@ -307,7 +307,11 @@ export class ProjectViewIssuesStore implements IProjectViewIssuesStore {
if (displayFilters.layout === "calendar") filteredRouteParams.group_by = "target_date"; if (displayFilters.layout === "calendar") filteredRouteParams.group_by = "target_date";
if (displayFilters.layout === "gantt_chart") filteredRouteParams.start_target_date = true; if (displayFilters.layout === "gantt_chart") filteredRouteParams.start_target_date = true;
const response = await this.issueService.getIssuesWithParams(workspaceSlug, projectId, filteredRouteParams); const issueResponse: any = await this.issueService.getIssuesWithParams(
workspaceSlug,
projectId,
filteredRouteParams
);
const issueType = this.rootStore.issue.getIssueType; const issueType = this.rootStore.issue.getIssueType;
@ -316,7 +320,7 @@ export class ProjectViewIssuesStore implements IProjectViewIssuesStore {
...this.viewIssues, ...this.viewIssues,
[viewId]: { [viewId]: {
...this.viewIssues[viewId], ...this.viewIssues[viewId],
[issueType]: response, [issueType]: issueResponse?.["data"],
}, },
}; };

View File

@ -2755,7 +2755,7 @@
dependencies: dependencies:
"@types/react" "*" "@types/react" "*"
"@types/react-color@^3.0.6": "@types/react-color@^3.0.6", "@types/react-color@^3.0.9":
version "3.0.9" version "3.0.9"
resolved "https://registry.yarnpkg.com/@types/react-color/-/react-color-3.0.9.tgz#8dbb0d798f2979c3d7e2e26dd46321e80da950b4" resolved "https://registry.yarnpkg.com/@types/react-color/-/react-color-3.0.9.tgz#8dbb0d798f2979c3d7e2e26dd46321e80da950b4"
integrity sha512-Ojyc6jySSKvM6UYQrZxaYe0JZXtgHHXwR2q9H4MhcNCswFdeZH1owYZCvPtdHtMOfh7t8h1fY0Gd0nvU1JGDkQ== integrity sha512-Ojyc6jySSKvM6UYQrZxaYe0JZXtgHHXwR2q9H4MhcNCswFdeZH1owYZCvPtdHtMOfh7t8h1fY0Gd0nvU1JGDkQ==
@ -7393,7 +7393,7 @@ react-markdown@^8.0.7:
unist-util-visit "^4.0.0" unist-util-visit "^4.0.0"
vfile "^5.0.0" vfile "^5.0.0"
react-moveable@^0.54.1: react-moveable@^0.54.1, react-moveable@^0.54.2:
version "0.54.2" version "0.54.2"
resolved "https://registry.yarnpkg.com/react-moveable/-/react-moveable-0.54.2.tgz#87ce9af3499dc1c8218bce7e174b10264c1bbecf" resolved "https://registry.yarnpkg.com/react-moveable/-/react-moveable-0.54.2.tgz#87ce9af3499dc1c8218bce7e174b10264c1bbecf"
integrity sha512-NGaVLbn0i9pb3+BWSKGWFqI/Mgm4+WMeWHxXXQ4Qi1tHxWCXrUrbGvpxEpt69G/hR7dez+/m68ex+fabjnvcUg== integrity sha512-NGaVLbn0i9pb3+BWSKGWFqI/Mgm4+WMeWHxXXQ4Qi1tHxWCXrUrbGvpxEpt69G/hR7dez+/m68ex+fabjnvcUg==