mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
Fix: rendering issue in kanban swimlanes when the cycle or module is not assigned to an issue (#3899)
This commit is contained in:
parent
bc02e56e3c
commit
7a8aef4599
@ -62,35 +62,35 @@ export class IssueHelperStore implements TIssueHelperStore {
|
|||||||
issues: TIssueMap,
|
issues: TIssueMap,
|
||||||
isCalendarIssues: boolean = false
|
isCalendarIssues: boolean = false
|
||||||
) => {
|
) => {
|
||||||
const _issues: { [group_id: string]: string[] } = {};
|
const currentIssues: { [group_id: string]: string[] } = {};
|
||||||
if (!groupBy) return _issues;
|
if (!groupBy) return currentIssues;
|
||||||
|
|
||||||
this.issueDisplayFiltersDefaultData(groupBy).forEach((group) => {
|
this.issueDisplayFiltersDefaultData(groupBy).forEach((group) => {
|
||||||
_issues[group] = [];
|
currentIssues[group] = [];
|
||||||
});
|
});
|
||||||
|
|
||||||
const projectIssues = this.issuesSortWithOrderBy(issues, orderBy);
|
const projectIssues = this.issuesSortWithOrderBy(issues, orderBy);
|
||||||
|
|
||||||
for (const issue in projectIssues) {
|
for (const issue in projectIssues) {
|
||||||
const _issue = projectIssues[issue];
|
const currentIssue = projectIssues[issue];
|
||||||
let groupArray = [];
|
let groupArray = [];
|
||||||
|
|
||||||
if (groupBy === "state_detail.group") {
|
if (groupBy === "state_detail.group") {
|
||||||
// if groupBy state_detail.group is coming from the project level the we are using stateDetails from root store else we are looping through the stateMap
|
// if groupBy state_detail.group is coming from the project level the we are using stateDetails from root store else we are looping through the stateMap
|
||||||
const state_group = (this.rootStore?.stateMap || {})?.[_issue?.state_id]?.group || "None";
|
const state_group = (this.rootStore?.stateMap || {})?.[currentIssue?.state_id]?.group || "None";
|
||||||
groupArray = [state_group];
|
groupArray = [state_group];
|
||||||
} else {
|
} else {
|
||||||
const groupValue = get(_issue, ISSUE_FILTER_DEFAULT_DATA[groupBy]);
|
const groupValue = get(currentIssue, ISSUE_FILTER_DEFAULT_DATA[groupBy]);
|
||||||
groupArray = groupValue !== undefined ? this.getGroupArray(groupValue, isCalendarIssues) : [];
|
groupArray = groupValue !== undefined ? this.getGroupArray(groupValue, isCalendarIssues) : ["None"];
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const group of groupArray) {
|
for (const group of groupArray) {
|
||||||
if (group && _issues[group]) _issues[group].push(_issue.id);
|
if (group && currentIssues[group]) currentIssues[group].push(currentIssue.id);
|
||||||
else if (group) _issues[group] = [_issue.id];
|
else if (group) currentIssues[group] = [currentIssue.id];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return _issues;
|
return currentIssues;
|
||||||
};
|
};
|
||||||
|
|
||||||
subGroupedIssues = (
|
subGroupedIssues = (
|
||||||
@ -99,45 +99,47 @@ export class IssueHelperStore implements TIssueHelperStore {
|
|||||||
orderBy: TIssueOrderByOptions,
|
orderBy: TIssueOrderByOptions,
|
||||||
issues: TIssueMap
|
issues: TIssueMap
|
||||||
) => {
|
) => {
|
||||||
const _issues: { [sub_group_id: string]: { [group_id: string]: string[] } } = {};
|
const currentIssues: { [sub_group_id: string]: { [group_id: string]: string[] } } = {};
|
||||||
if (!subGroupBy || !groupBy) return _issues;
|
if (!subGroupBy || !groupBy) return currentIssues;
|
||||||
|
|
||||||
this.issueDisplayFiltersDefaultData(subGroupBy).forEach((sub_group: any) => {
|
this.issueDisplayFiltersDefaultData(subGroupBy).forEach((sub_group) => {
|
||||||
const groupByIssues: { [group_id: string]: string[] } = {};
|
const groupByIssues: { [group_id: string]: string[] } = {};
|
||||||
this.issueDisplayFiltersDefaultData(groupBy).forEach((group) => {
|
this.issueDisplayFiltersDefaultData(groupBy).forEach((group) => {
|
||||||
groupByIssues[group] = [];
|
groupByIssues[group] = [];
|
||||||
});
|
});
|
||||||
_issues[sub_group] = groupByIssues;
|
currentIssues[sub_group] = groupByIssues;
|
||||||
});
|
});
|
||||||
|
|
||||||
const projectIssues = this.issuesSortWithOrderBy(issues, orderBy);
|
const projectIssues = this.issuesSortWithOrderBy(issues, orderBy);
|
||||||
|
|
||||||
for (const issue in projectIssues) {
|
for (const issue in projectIssues) {
|
||||||
const _issue = projectIssues[issue];
|
const currentIssue = projectIssues[issue];
|
||||||
let subGroupArray = [];
|
let subGroupArray = [];
|
||||||
let groupArray = [];
|
let groupArray = [];
|
||||||
if (subGroupBy === "state_detail.group" || groupBy === "state_detail.group") {
|
if (subGroupBy === "state_detail.group" || groupBy === "state_detail.group") {
|
||||||
const state_group = (this.rootStore?.stateMap || {})?.[_issue?.state_id]?.group || "None";
|
const state_group = (this.rootStore?.stateMap || {})?.[currentIssue?.state_id]?.group || "None";
|
||||||
|
|
||||||
subGroupArray = [state_group];
|
subGroupArray = [state_group];
|
||||||
groupArray = [state_group];
|
groupArray = [state_group];
|
||||||
} else {
|
} else {
|
||||||
const subGroupValue = get(_issue, ISSUE_FILTER_DEFAULT_DATA[subGroupBy]);
|
const subGroupValue = get(currentIssue, ISSUE_FILTER_DEFAULT_DATA[subGroupBy]);
|
||||||
const groupValue = get(_issue, ISSUE_FILTER_DEFAULT_DATA[groupBy]);
|
const groupValue = get(currentIssue, ISSUE_FILTER_DEFAULT_DATA[groupBy]);
|
||||||
subGroupArray = subGroupValue != undefined ? this.getGroupArray(subGroupValue) : [];
|
|
||||||
groupArray = groupValue != undefined ? this.getGroupArray(groupValue) : [];
|
subGroupArray = subGroupValue != undefined ? this.getGroupArray(subGroupValue) : ["None"];
|
||||||
|
groupArray = groupValue != undefined ? this.getGroupArray(groupValue) : ["None"];
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const subGroup of subGroupArray) {
|
for (const subGroup of subGroupArray) {
|
||||||
for (const group of groupArray) {
|
for (const group of groupArray) {
|
||||||
if (subGroup && group && _issues?.[subGroup]?.[group]) _issues[subGroup][group].push(_issue.id);
|
if (subGroup && group && currentIssues?.[subGroup]?.[group])
|
||||||
else if (subGroup && group && _issues[subGroup]) _issues[subGroup][group] = [_issue.id];
|
currentIssues[subGroup][group].push(currentIssue.id);
|
||||||
else if (subGroup && group) _issues[subGroup] = { [group]: [_issue.id] };
|
else if (subGroup && group && currentIssues[subGroup]) currentIssues[subGroup][group] = [currentIssue.id];
|
||||||
|
else if (subGroup && group) currentIssues[subGroup] = { [group]: [currentIssue.id] };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return _issues;
|
return currentIssues;
|
||||||
};
|
};
|
||||||
|
|
||||||
unGroupedIssues = (orderBy: TIssueOrderByOptions, issues: TIssueMap) =>
|
unGroupedIssues = (orderBy: TIssueOrderByOptions, issues: TIssueMap) =>
|
||||||
@ -215,8 +217,8 @@ export class IssueHelperStore implements TIssueHelperStore {
|
|||||||
const moduleMap = this.rootStore?.moduleMap;
|
const moduleMap = this.rootStore?.moduleMap;
|
||||||
if (!moduleMap) break;
|
if (!moduleMap) break;
|
||||||
for (const dataId of dataIdsArray) {
|
for (const dataId of dataIdsArray) {
|
||||||
const _module = moduleMap[dataId];
|
const currentModule = moduleMap[dataId];
|
||||||
if (_module && _module.name) dataValues.push(_module.name.toLocaleLowerCase());
|
if (currentModule && currentModule.name) dataValues.push(currentModule.name.toLocaleLowerCase());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "cycle_id":
|
case "cycle_id":
|
||||||
@ -388,7 +390,7 @@ export class IssueHelperStore implements TIssueHelperStore {
|
|||||||
getGroupArray(value: boolean | number | string | string[] | null, isDate: boolean = false): string[] {
|
getGroupArray(value: boolean | number | string | string[] | null, isDate: boolean = false): string[] {
|
||||||
if (!value || value === null || value === undefined) return ["None"];
|
if (!value || value === null || value === undefined) return ["None"];
|
||||||
if (Array.isArray(value))
|
if (Array.isArray(value))
|
||||||
if (value.length) return value;
|
if (value && value.length) return value;
|
||||||
else return ["None"];
|
else return ["None"];
|
||||||
else if (typeof value === "boolean") return [value ? "True" : "False"];
|
else if (typeof value === "boolean") return [value ? "True" : "False"];
|
||||||
else if (typeof value === "number") return [value.toString()];
|
else if (typeof value === "number") return [value.toString()];
|
||||||
|
Loading…
Reference in New Issue
Block a user