Skip to content

Commit

Permalink
labels - unlabeled filter selection now shows unlabeled rows
Browse files Browse the repository at this point in the history
  • Loading branch information
manishiwa committed Jul 21, 2024
1 parent a83bd17 commit 321155a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/(labels)/labels/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ export default function Search() {
</div>
</div>
<div
className={`absolute rounded-t-[22px] md:rounded-b-[22px] bg-[#151A19] left-0 right-0 bottom-[calc(100%-22px)] md:bottom-auto md:top-[calc(100%-22px)] shadow-[0px_0px_50px_0px_#000000] transition-all duration-300 ${isOpen ? "max-h-[600px]" : "max-h-0"
className={`absolute rounded-t-[22px] md:rounded-t-none md:rounded-b-[22px] bg-[#151A19] left-0 right-0 bottom-[calc(100%-22px)] md:bottom-auto md:top-[calc(100%-22px)] shadow-[0px_0px_50px_0px_#000000] transition-all duration-300 ${isOpen ? "max-h-[600px]" : "max-h-0"
} overflow-hidden overflow-y-auto lg:overflow-y-hidden scrollbar-thin scrollbar-thumb-forest-700 scrollbar-track-transparent`}
>
<div className="flex flex-col-reverse md:flex-col pl-[12px] pr-[25px] pb-[35px] pt-[15px] md:pb-[15px] md:pt-[35px] gap-y-[10px] text-[10px]">
Expand Down
14 changes: 11 additions & 3 deletions app/(labels)/labels/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -361,12 +361,20 @@ export default function LabelsPage() {
...labelsFilters.subcategory,
];

let isUnlabeledSelected = labelsFilters.category.includes("unlabeled");

let all_usage_categories = [...new Set(both)];

if (all_usage_categories.length > 0) {
rows = rows.filter((label) =>
all_usage_categories.includes(label.usage_category),
);
if (isUnlabeledSelected) {
rows = rows.filter((label) =>
all_usage_categories.includes(label.usage_category) || label.usage_category === null,
);
} else {
rows = rows.filter((label) =>
all_usage_categories.includes(label.usage_category),
);
}
}

if (labelsFilters.owner_project.length > 0) {
Expand Down

0 comments on commit 321155a

Please sign in to comment.