diff --git a/apps/app/components/core/board-view/all-boards.tsx b/apps/app/components/core/board-view/all-boards.tsx index 27aaace9b..4ee6175d2 100644 --- a/apps/app/components/core/board-view/all-boards.tsx +++ b/apps/app/components/core/board-view/all-boards.tsx @@ -2,8 +2,11 @@ import useProjectIssuesView from "hooks/use-issues-view"; // components import { SingleBoard } from "components/core/board-view/single-board"; +// helpers +import { addSpaceIfCamelCase } from "helpers/string.helper"; // types import { IIssue, IState, UserAuth } from "types"; +import { getStateGroupIcon } from "components/icons"; type Props = { type: "issue" | "cycle" | "module"; @@ -30,7 +33,11 @@ export const AllBoards: React.FC = ({ removeIssue, userAuth, }) => { - const { groupedByIssues, groupByProperty: selectedGroup, orderBy } = useProjectIssuesView(); + const { + groupedByIssues, + groupByProperty: selectedGroup, + showEmptyGroups, + } = useProjectIssuesView(); return ( <> @@ -40,6 +47,8 @@ export const AllBoards: React.FC = ({ const currentState = selectedGroup === "state" ? states?.find((s) => s.id === singleGroup) : null; + if (!showEmptyGroups && groupedByIssues[singleGroup].length === 0) return null; + return ( = ({ /> ); })} + {!showEmptyGroups && ( +
+

Hidden groups

+
+ {Object.keys(groupedByIssues).map((singleGroup, index) => { + const currentState = + selectedGroup === "state" ? states?.find((s) => s.id === singleGroup) : null; + + if (groupedByIssues[singleGroup].length === 0) + return ( +
+
+ {currentState && + getStateGroupIcon(currentState.group, "16", "16", currentState.color)} +

+ {selectedGroup === "state" + ? addSpaceIfCamelCase(currentState?.name ?? "") + : addSpaceIfCamelCase(singleGroup)} +

+
+ 0 +
+ ); + })} +
+
+ )} ) : null} diff --git a/apps/app/components/core/issues-view-filter.tsx b/apps/app/components/core/issues-view-filter.tsx index 4c2f8f7b7..a3e2af412 100644 --- a/apps/app/components/core/issues-view-filter.tsx +++ b/apps/app/components/core/issues-view-filter.tsx @@ -42,8 +42,10 @@ export const IssuesFilterView: React.FC = () => { setIssueViewToKanban, groupByProperty, setGroupByProperty, - setOrderBy, orderBy, + setOrderBy, + showEmptyGroups, + setShowEmptyGroups, filters, setFilters, resetFilterToDefault, @@ -203,9 +205,9 @@ export const IssuesFilterView: React.FC = () => { >
-
+
-

Group by

+

Group by

option.key === groupByProperty)?.name ?? @@ -226,7 +228,7 @@ export const IssuesFilterView: React.FC = () => {
-

Order by

+

Order by

option.key === orderBy)?.name ?? @@ -249,7 +251,7 @@ export const IssuesFilterView: React.FC = () => {
-

Issue type

+

Issue type

option.key === filters.type) @@ -271,17 +273,33 @@ export const IssuesFilterView: React.FC = () => { ))}
-
+
+

Show empty states

+
+
+