clean-up: removed labels in the filters and handled redirection issue from peek overview and ui changes (#3002)

This commit is contained in:
guru_sainath 2023-12-06 16:27:33 +05:30 committed by sriram veeraghanta
parent 97bc153ef9
commit a56e7b17f1
8 changed files with 56 additions and 38 deletions

View File

@ -18,17 +18,25 @@ export const IssueKanBanBlock = observer(({ issue }: { issue: IIssue }) => {
// router
const router = useRouter();
const { workspace_slug, project_slug, board } = router.query;
const { workspace_slug, project_slug, board, priorities, states, labels } = router.query as {
workspace_slug: string;
project_slug: string;
board: string;
priorities: string;
states: string;
labels: string;
};
const handleBlockClick = () => {
issueDetailStore.setPeekId(issue.id);
const params: any = { board: board, peekId: issue.id };
if (states && states.length > 0) params.states = states;
if (priorities && priorities.length > 0) params.priorities = priorities;
if (labels && labels.length > 0) params.labels = labels;
router.push(
{
pathname: `/${workspace_slug?.toString()}/${project_slug}`,
query: {
board: board?.toString(),
peekId: issue.id,
},
pathname: `/${workspace_slug}/${project_slug}`,
query: { ...params },
},
undefined,
{ shallow: true }

View File

@ -19,17 +19,25 @@ export const IssueListBlock: FC<{ issue: IIssue }> = observer((props) => {
const { project: projectStore, issueDetails: issueDetailStore }: RootStore = useMobxStore();
// router
const router = useRouter();
const { workspace_slug, project_slug, board } = router.query;
const { workspace_slug, project_slug, board, priorities, states, labels } = router.query as {
workspace_slug: string;
project_slug: string;
board: string;
priorities: string;
states: string;
labels: string;
};
const handleBlockClick = () => {
issueDetailStore.setPeekId(issue.id);
const params: any = { board: board, peekId: issue.id };
if (states && states.length > 0) params.states = states;
if (priorities && priorities.length > 0) params.priorities = priorities;
if (labels && labels.length > 0) params.labels = labels;
router.push(
{
pathname: `/${workspace_slug?.toString()}/${project_slug}`,
query: {
board: board?.toString(),
peekId: issue.id,
},
pathname: `/${workspace_slug}/${project_slug}`,
query: { ...params },
},
undefined,
{ shallow: true }

View File

@ -40,13 +40,13 @@ export const AppliedFiltersList: React.FC<Props> = (props) => {
<AppliedPriorityFilters handleRemove={(val) => handleRemoveFilter("priority", val)} values={value} />
)}
{filterKey === "labels" && labels && (
{/* {filterKey === "labels" && labels && (
<AppliedLabelsFilters
handleRemove={(val) => handleRemoveFilter("labels", val)}
labels={labels}
values={value}
/>
)}
)} */}
{filterKey === "state" && states && (
<AppliedStateFilters

View File

@ -31,14 +31,7 @@ export const FiltersDropdown: React.FC<Props> = (props) => {
return (
<>
<Popover.Button as={React.Fragment}>
<Button
ref={setReferenceElement}
variant="neutral-primary"
size="sm"
appendIcon={
<ChevronUp className={`transition-all ${open ? "" : "rotate-180"}`} size={14} strokeWidth={2} />
}
>
<Button ref={setReferenceElement} variant="neutral-primary" size="sm">
<div className={`${open ? "text-custom-text-100" : "text-custom-text-200"}`}>
<span>{title}</span>
</div>

View File

@ -62,7 +62,7 @@ export const IssueFiltersDropdown: FC = observer(() => {
);
return (
<div className="w-full h-full flex flex-col z-50">
<div className="w-full h-full flex flex-col z-10">
<FiltersDropdown title="Filters" placement="bottom-end">
<FilterSelection
filters={issueFilters?.filters ?? {}}

View File

@ -70,7 +70,7 @@ export const FilterSelection: React.FC<Props> = observer((props) => {
)}
{/* labels */}
{isFilterEnabled("labels") && (
{/* {isFilterEnabled("labels") && (
<div className="py-2">
<FilterLabels
appliedFilters={filters.labels ?? null}
@ -79,7 +79,7 @@ export const FilterSelection: React.FC<Props> = observer((props) => {
searchQuery={filtersSearchQuery}
/>
</div>
)}
)} */}
</div>
</div>
);

View File

@ -39,9 +39,10 @@ const IssueNavbar = observer(() => {
}: RootStore = useMobxStore();
// router
const router = useRouter();
const { workspace_slug, project_slug, board, states, priorities, labels } = router.query as {
const { workspace_slug, project_slug, board, peekId, states, priorities, labels } = router.query as {
workspace_slug: string;
project_slug: string;
peekId: string;
board: string;
states: string;
priorities: string;
@ -84,6 +85,7 @@ const IssueNavbar = observer(() => {
if (currentBoard) {
if (projectStore?.activeBoard === null || projectStore?.activeBoard !== currentBoard) {
let params: any = { board: currentBoard };
if (peekId && peekId.length > 0) params = { ...params, peekId: peekId };
if (priorities && priorities.length > 0) params = { ...params, priorities: priorities };
if (states && states.length > 0) params = { ...params, states: states };
if (labels && labels.length > 0) params = { ...params, labels: labels };

View File

@ -19,7 +19,15 @@ export const IssuePeekOverview: React.FC<Props> = observer(() => {
const [isModalPeekOpen, setIsModalPeekOpen] = useState(false);
// router
const router = useRouter();
const { workspace_slug, project_slug, peekId, board } = router.query;
const { workspace_slug, project_slug, peekId, board, priorities, states, labels } = router.query as {
workspace_slug: string;
project_slug: string;
peekId: string;
board: string;
priorities: string;
states: string;
labels: string;
};
// store
const { issueDetails: issueDetailStore, issue: issueStore } = useMobxStore();
const issueDetails = issueDetailStore.peekId && peekId ? issueDetailStore.details[peekId.toString()] : undefined;
@ -34,16 +42,15 @@ export const IssuePeekOverview: React.FC<Props> = observer(() => {
const handleClose = () => {
issueDetailStore.setPeekId(null);
router.replace(
{
pathname: `/${workspace_slug?.toString()}/${project_slug}`,
query: {
board,
},
},
undefined,
{ shallow: true }
);
const params: any = { board: board };
if (states && states.length > 0) params.states = states;
if (priorities && priorities.length > 0) params.priorities = priorities;
if (labels && labels.length > 0) params.labels = labels;
router.replace({ pathname: `/${workspace_slug?.toString()}/${project_slug}`, query: { ...params } }, undefined, {
shallow: true,
});
};
useEffect(() => {
@ -91,7 +98,7 @@ export const IssuePeekOverview: React.FC<Props> = observer(() => {
leaveFrom="opacity-100"
leaveTo="opacity-0"
>
<div className="fixed inset-0 bg-custom-backdrop bg-opacity-50 transition-opacity" />
<div className="fixed inset-0 bg-custom-backdrop bg-opacity-50 transition-opacity z-20" />
</Transition.Child>
<Transition.Child
as={React.Fragment}