mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
Merge pull request #861 from makeplane/develop
promote: patches from develop to stage-release
This commit is contained in:
commit
3ed937378f
@ -45,7 +45,7 @@ export const DeleteImportModal: React.FC<Props> = ({ isOpen, handleClose, data }
|
|||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
IntegrationService.deleteImporterService(workspaceSlug as string, data.id)
|
IntegrationService.deleteImporterService(workspaceSlug as string, data.service, data.id)
|
||||||
.catch(() =>
|
.catch(() =>
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
type: "error",
|
type: "error",
|
||||||
@ -53,7 +53,10 @@ export const DeleteImportModal: React.FC<Props> = ({ isOpen, handleClose, data }
|
|||||||
message: "Something went wrong. Please try again.",
|
message: "Something went wrong. Please try again.",
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
.finally(() => setDeleteLoading(false));
|
.finally(() => {
|
||||||
|
setDeleteLoading(false);
|
||||||
|
handleClose();
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!data) return <></>;
|
if (!data) return <></>;
|
||||||
|
@ -34,7 +34,7 @@ export const ProjectMemberProvider: React.FC<Props> = (props) => {
|
|||||||
const { workspaceSlug, projectId } = router.query;
|
const { workspaceSlug, projectId } = router.query;
|
||||||
|
|
||||||
const { data: memberDetails, error } = useSWR(
|
const { data: memberDetails, error } = useSWR(
|
||||||
workspaceSlug && projectId ? USER_PROJECT_VIEW(workspaceSlug.toString()) : null,
|
workspaceSlug && projectId ? USER_PROJECT_VIEW(projectId.toString()) : null,
|
||||||
workspaceSlug && projectId
|
workspaceSlug && projectId
|
||||||
? () => projectService.projectMemberMe(workspaceSlug.toString(), projectId.toString())
|
? () => projectService.projectMemberMe(workspaceSlug.toString(), projectId.toString())
|
||||||
: null,
|
: null,
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
import { useEffect } from "react";
|
|
||||||
|
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
|
|
||||||
import useSWR from "swr";
|
import useSWR from "swr";
|
||||||
@ -24,14 +22,6 @@ const useProjectDetails = () => {
|
|||||||
: null
|
: null
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (projectDetailsError?.status === 404) {
|
|
||||||
router.push("/404");
|
|
||||||
} else if (projectDetailsError) {
|
|
||||||
router.push("/error");
|
|
||||||
}
|
|
||||||
}, [projectDetailsError, router]);
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
projectDetails,
|
projectDetails,
|
||||||
projectDetailsError,
|
projectDetailsError,
|
||||||
|
@ -21,7 +21,6 @@ import { PrimaryButton, Spinner } from "components/ui";
|
|||||||
// icons
|
// icons
|
||||||
import { LayerDiagonalIcon } from "components/icons";
|
import { LayerDiagonalIcon } from "components/icons";
|
||||||
|
|
||||||
|
|
||||||
type Meta = {
|
type Meta = {
|
||||||
title?: string | null;
|
title?: string | null;
|
||||||
description?: string | null;
|
description?: string | null;
|
||||||
@ -61,9 +60,7 @@ const ProjectAuthorizationWrapped: React.FC<Props> = ({
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { workspaceSlug, projectId } = router.query;
|
const { workspaceSlug, projectId } = router.query;
|
||||||
|
|
||||||
const {
|
const { issueView } = useIssuesView();
|
||||||
issueView,
|
|
||||||
} = useIssuesView();
|
|
||||||
|
|
||||||
const { loading, error, memberRole: memberType } = useProjectMyMembership();
|
const { loading, error, memberRole: memberType } = useProjectMyMembership();
|
||||||
|
|
||||||
@ -97,22 +94,6 @@ const ProjectAuthorizationWrapped: React.FC<Props> = ({
|
|||||||
</PrimaryButton>
|
</PrimaryButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
) : error?.status === 401 || error?.status === 403 ? (
|
|
||||||
<JoinProject />
|
|
||||||
) : error?.status === 404 ? (
|
|
||||||
<div className="container h-screen grid place-items-center">
|
|
||||||
<div className="text-center space-y-4">
|
|
||||||
<p className="text-2xl font-semibold">No such project exist. Create one?</p>
|
|
||||||
<PrimaryButton
|
|
||||||
onClick={() => {
|
|
||||||
const e = new KeyboardEvent("keydown", { key: "p" });
|
|
||||||
document.dispatchEvent(e);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Create project
|
|
||||||
</PrimaryButton>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
) : settingsLayout && (memberType?.isGuest || memberType?.isViewer) ? (
|
) : settingsLayout && (memberType?.isGuest || memberType?.isViewer) ? (
|
||||||
<NotAuthorizedView
|
<NotAuthorizedView
|
||||||
actionButton={
|
actionButton={
|
||||||
|
@ -43,8 +43,12 @@ class IntegrationService extends APIService {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async deleteImporterService(workspaceSlug: string, importerId: string): Promise<any> {
|
async deleteImporterService(
|
||||||
return this.delete(`/api/workspaces/${workspaceSlug}/importers/${importerId}/`)
|
workspaceSlug: string,
|
||||||
|
service: string,
|
||||||
|
importerId: string
|
||||||
|
): Promise<any> {
|
||||||
|
return this.delete(`/api/workspaces/${workspaceSlug}/importers/${service}/${importerId}/`)
|
||||||
.then((res) => res?.data)
|
.then((res) => res?.data)
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
throw error?.response?.data;
|
throw error?.response?.data;
|
||||||
|
Loading…
Reference in New Issue
Block a user