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,
|
||||
orderBy,
|
||||
filters,
|
||||
isNotEmpty,
|
||||
setFilters,
|
||||
params,
|
||||
} = useIssuesView();
|
||||
@ -580,7 +581,7 @@ export const IssuesView: React.FC<Props> = ({
|
||||
)}
|
||||
</StrictModeDroppable>
|
||||
{groupedByIssues ? (
|
||||
Object.keys(groupedByIssues).length > 0 ? (
|
||||
isNotEmpty ? (
|
||||
<>
|
||||
{issueView === "list" ? (
|
||||
<AllLists
|
||||
|
@ -110,7 +110,7 @@ const useIssuesView = () => {
|
||||
const statesList = getStatesList(states ?? {});
|
||||
const stateIds = statesList.map((state) => state.id);
|
||||
|
||||
let emptyStatesObject: { [key: string]: [] } = {};
|
||||
const emptyStatesObject: { [key: string]: [] } = {};
|
||||
for (let i = 0; i < stateIds.length; i++) {
|
||||
emptyStatesObject[stateIds[i]] = [];
|
||||
}
|
||||
@ -123,11 +123,16 @@ const useIssuesView = () => {
|
||||
const issuesToGroup = cycleIssues ?? moduleIssues ?? projectIssues;
|
||||
|
||||
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;
|
||||
}, [projectIssues, cycleIssues, moduleIssues]);
|
||||
|
||||
const isEmpty =
|
||||
Object.values(groupedByIssues ?? {}).every((group) => group.length === 0) ||
|
||||
Object.keys(groupedByIssues ?? {}).length === 0;
|
||||
|
||||
return {
|
||||
groupedByIssues,
|
||||
issueView,
|
||||
@ -140,6 +145,7 @@ const useIssuesView = () => {
|
||||
filters,
|
||||
setFilters,
|
||||
params,
|
||||
isNotEmpty: !isEmpty,
|
||||
resetFilterToDefault,
|
||||
setNewFilterDefaultView,
|
||||
setIssueViewToKanban,
|
||||
|
Loading…
Reference in New Issue
Block a user