Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WEB-2588] fix: guests should be able to access filters in their own views #5774

Draft
wants to merge 4 commits into
base: preview
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import {
useProject,
useProjectState,
useProjectView,
useUser,
useUserPermissions,
} from "@/hooks/store";
import { EUserPermissions, EUserPermissionsLevel } from "@/plane-web/constants/user-permissions";
Expand All @@ -48,6 +49,7 @@ export const ProjectViewIssuesHeader: React.FC = observer(() => {
const { setTrackElement } = useEventTracker();
const { toggleCreateIssueModal } = useCommandPalette();
const { allowPermissions } = useUserPermissions();
const { data : currentUser } = useUser();

const { currentProjectDetails, loader } = useProject();
const { projectViewIds, getViewById } = useProjectView();
Expand Down Expand Up @@ -134,6 +136,8 @@ export const ProjectViewIssuesHeader: React.FC = observer(() => {
[EUserPermissions.ADMIN, EUserPermissions.MEMBER],
EUserPermissionsLevel.PROJECT
);
// guests can use filters in their own views
const canUserUseFilters = canUserCreateIssue || currentUser?.id===viewDetails?.created_by
const publishLink = getPublishViewLink(viewDetails?.anchor);

return (
Expand Down Expand Up @@ -251,7 +255,7 @@ export const ProjectViewIssuesHeader: React.FC = observer(() => {
<FiltersDropdown
title="Filters"
placement="bottom-end"
disabled={!canUserCreateIssue}
disabled={!canUserUseFilters}
isFiltersApplied={isIssueFilterActive(issueFilters)}
>
<FilterSelection
Expand Down
Loading