From bedfd1509ed31ea346bb48fcf2da0265feb548bb Mon Sep 17 00:00:00 2001 From: sharma01ketan Date: Tue, 8 Oct 2024 18:10:44 +0530 Subject: [PATCH 1/3] change the required permissions --- .../(detail)/[projectId]/views/(detail)/[viewId]/header.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/views/(detail)/[viewId]/header.tsx b/web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/views/(detail)/[viewId]/header.tsx index 71f2d8df425..3d092f25301 100644 --- a/web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/views/(detail)/[viewId]/header.tsx +++ b/web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/views/(detail)/[viewId]/header.tsx @@ -34,6 +34,7 @@ import { useProject, useProjectState, useProjectView, + useUser, useUserPermissions, } from "@/hooks/store"; import { EUserPermissions, EUserPermissionsLevel } from "@/plane-web/constants/user-permissions"; @@ -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(); @@ -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 ( @@ -251,7 +255,7 @@ export const ProjectViewIssuesHeader: React.FC = observer(() => { Date: Fri, 11 Oct 2024 17:43:31 +0530 Subject: [PATCH 2/3] Revert "chore: only admin can changed the project settings (#5766)" This reverts commit 39eabc28b5d6d5a770a99f00b94421e7d45f5f93. --- apiserver/plane/app/views/project/base.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/apiserver/plane/app/views/project/base.py b/apiserver/plane/app/views/project/base.py index f5ddb224587..6a9afb65237 100644 --- a/apiserver/plane/app/views/project/base.py +++ b/apiserver/plane/app/views/project/base.py @@ -413,20 +413,9 @@ def create(self, request, slug): status=status.HTTP_410_GONE, ) + @allow_permission([ROLE.ADMIN]) def partial_update(self, request, slug, pk=None): try: - if not ProjectMember.objects.filter( - member=request.user, - workspace__slug=slug, - project_id=pk, - role=20, - is_active=True, - ).exists(): - return Response( - {"error": "You don't have the required permissions."}, - status=status.HTTP_403_FORBIDDEN, - ) - workspace = Workspace.objects.get(slug=slug) project = Project.objects.get(pk=pk) From d52c2642f5592bfb448553e73003aee1a644d2d4 Mon Sep 17 00:00:00 2001 From: sharma01ketan Date: Fri, 11 Oct 2024 17:43:38 +0530 Subject: [PATCH 3/3] Revert "[WEB-2605] fix: update URL regex pattern to allow complex links. (#5767)" This reverts commit 328b6961a26f8a0a40e630b6f9c4e0070928a32a. --- web/helpers/string.helper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/helpers/string.helper.ts b/web/helpers/string.helper.ts index e4b4dc6651e..1182feeb0a7 100644 --- a/web/helpers/string.helper.ts +++ b/web/helpers/string.helper.ts @@ -270,7 +270,7 @@ export const isCommentEmpty = (comment: string | undefined): boolean => { export const checkURLValidity = (url: string): boolean => { if (!url) return false; // regex to match valid URLs (with or without http/https) - const urlPattern = /^(https?:\/\/)?([\w.-]+\.[a-z]{2,6})(\/[\w\-.~:/?#[\]@!$&'()*+,;=%]*)?$/i; + const urlPattern = /^(https?:\/\/)?([\da-z.-]+)\.([a-z]{2,6})(\/[\w.-]*)*\/?(\?[=&\w.-]*)?$/i; // test if the URL matches the pattern return urlPattern.test(url); };