forked from github/plane
fix: kanban loading state (#514)
This commit is contained in:
parent
2f2caaaf6e
commit
765cfdbf7e
@ -96,6 +96,7 @@ export const IssuesView: React.FC<Props> = ({
|
|||||||
groupByProperty: selectedGroup,
|
groupByProperty: selectedGroup,
|
||||||
orderBy,
|
orderBy,
|
||||||
filters,
|
filters,
|
||||||
|
isNotEmpty,
|
||||||
setFilters,
|
setFilters,
|
||||||
params,
|
params,
|
||||||
} = useIssuesView();
|
} = useIssuesView();
|
||||||
@ -580,7 +581,7 @@ export const IssuesView: React.FC<Props> = ({
|
|||||||
)}
|
)}
|
||||||
</StrictModeDroppable>
|
</StrictModeDroppable>
|
||||||
{groupedByIssues ? (
|
{groupedByIssues ? (
|
||||||
Object.keys(groupedByIssues).length > 0 ? (
|
isNotEmpty ? (
|
||||||
<>
|
<>
|
||||||
{issueView === "list" ? (
|
{issueView === "list" ? (
|
||||||
<AllLists
|
<AllLists
|
||||||
|
@ -110,7 +110,7 @@ const useIssuesView = () => {
|
|||||||
const statesList = getStatesList(states ?? {});
|
const statesList = getStatesList(states ?? {});
|
||||||
const stateIds = statesList.map((state) => state.id);
|
const stateIds = statesList.map((state) => state.id);
|
||||||
|
|
||||||
let emptyStatesObject: { [key: string]: [] } = {};
|
const emptyStatesObject: { [key: string]: [] } = {};
|
||||||
for (let i = 0; i < stateIds.length; i++) {
|
for (let i = 0; i < stateIds.length; i++) {
|
||||||
emptyStatesObject[stateIds[i]] = [];
|
emptyStatesObject[stateIds[i]] = [];
|
||||||
}
|
}
|
||||||
@ -123,11 +123,16 @@ const useIssuesView = () => {
|
|||||||
const issuesToGroup = cycleIssues ?? moduleIssues ?? projectIssues;
|
const issuesToGroup = cycleIssues ?? moduleIssues ?? projectIssues;
|
||||||
|
|
||||||
if (Array.isArray(issuesToGroup)) return { allIssues: issuesToGroup };
|
if (Array.isArray(issuesToGroup)) return { allIssues: issuesToGroup };
|
||||||
if (groupByProperty === "state") return Object.assign(emptyStatesObject, issuesToGroup);
|
if (groupByProperty === "state")
|
||||||
|
return issuesToGroup ? Object.assign(emptyStatesObject, issuesToGroup) : undefined;
|
||||||
|
|
||||||
return issuesToGroup;
|
return issuesToGroup;
|
||||||
}, [projectIssues, cycleIssues, moduleIssues]);
|
}, [projectIssues, cycleIssues, moduleIssues]);
|
||||||
|
|
||||||
|
const isEmpty =
|
||||||
|
Object.values(groupedByIssues ?? {}).every((group) => group.length === 0) ||
|
||||||
|
Object.keys(groupedByIssues ?? {}).length === 0;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
groupedByIssues,
|
groupedByIssues,
|
||||||
issueView,
|
issueView,
|
||||||
@ -140,6 +145,7 @@ const useIssuesView = () => {
|
|||||||
filters,
|
filters,
|
||||||
setFilters,
|
setFilters,
|
||||||
params,
|
params,
|
||||||
|
isNotEmpty: !isEmpty,
|
||||||
resetFilterToDefault,
|
resetFilterToDefault,
|
||||||
setNewFilterDefaultView,
|
setNewFilterDefaultView,
|
||||||
setIssueViewToKanban,
|
setIssueViewToKanban,
|
||||||
|
Loading…
Reference in New Issue
Block a user