mirror of
https://github.com/makeplane/plane
synced 2025-08-07 19:59:33 +00:00
Compare commits
9 Commits
feat-bread
...
fix/add-ex
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
78e221f340 | ||
|
|
2ab1c50010 | ||
|
|
c216bb6c33 | ||
|
|
1aed308053 | ||
|
|
25bd32c09c | ||
|
|
21dbf6c6de | ||
|
|
d84eb9b1ab | ||
|
|
323c414de9 | ||
|
|
a194d9826d |
@@ -413,20 +413,9 @@ class ProjectViewSet(BaseViewSet):
|
||||
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)
|
||||
|
||||
@@ -8,7 +8,7 @@ import { PlusIcon } from "lucide-react";
|
||||
// types
|
||||
import { ISearchIssueResponse, TIssue } from "@plane/types";
|
||||
// ui
|
||||
import { TOAST_TYPE, setToast, CustomMenu } from "@plane/ui";
|
||||
import { CustomMenu, setPromiseToast } from "@plane/ui";
|
||||
// components
|
||||
import { ExistingIssuesListModal } from "@/components/core";
|
||||
import { QuickAddIssueRoot } from "@/components/issues";
|
||||
@@ -45,22 +45,21 @@ export const CalendarQuickAddIssueActions: FC<TCalendarQuickAddIssueActions> = o
|
||||
if (!workspaceSlug || !projectId) return;
|
||||
|
||||
const issueIds = data.map((i) => i.id);
|
||||
const updatePromise = Promise.all(
|
||||
data.map((issue) => updateIssue(workspaceSlug.toString(), projectId.toString(), issue.id, prePopulatedData ?? {}))
|
||||
).then(() => addIssuesToView?.(issueIds));
|
||||
|
||||
try {
|
||||
// To handle all updates in parallel
|
||||
await Promise.all(
|
||||
data.map((issue) =>
|
||||
updateIssue(workspaceSlug.toString(), projectId.toString(), issue.id, prePopulatedData ?? {})
|
||||
)
|
||||
);
|
||||
await addIssuesToView?.(issueIds);
|
||||
} catch (error) {
|
||||
setToast({
|
||||
type: TOAST_TYPE.ERROR,
|
||||
setPromiseToast(updatePromise, {
|
||||
loading: `Adding ${issueIds.length > 1 ? "issues" : "issue"} to cycle...`,
|
||||
success: {
|
||||
title: "Success!",
|
||||
message: () => `${issueIds.length > 1 ? "Issues" : "Issue"} added to cycle successfully.`,
|
||||
},
|
||||
error: {
|
||||
title: "Error!",
|
||||
message: "Something went wrong. Please try again.",
|
||||
});
|
||||
}
|
||||
message: (err) => err?.message || "Something went wrong. Please try again.",
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const handleNewIssue = () => {
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user