Merge branch 'preview' of github.com:makeplane/plane-ee into uat

This commit is contained in:
sriram veeraghanta
2024-08-08 13:51:33 +05:30
10 changed files with 56 additions and 41 deletions

View File

@@ -19,6 +19,7 @@ AWS_S3_BUCKET_NAME="uploads"
FILE_SIZE_LIMIT=5242880
# GPT settings
SILO_BASE_URL=
OPENAI_API_BASE="https://api.openai.com/v1" # deprecated
OPENAI_API_KEY="sk-" # deprecated
GPT_ENGINE="gpt-3.5-turbo" # deprecated
@@ -32,4 +33,4 @@ USE_MINIO=1
# Nginx Configuration
NGINX_PORT=80
MONGO_DB_URL="mongodb://plane-mongodb:27017/"
MONGO_DB_URL="mongodb://plane-mongodb:27017/"

View File

@@ -50,6 +50,7 @@ GUNICORN_WORKERS=2
ADMIN_BASE_URL=
SPACE_BASE_URL=
APP_BASE_URL=
SILO_BASE_URL=
# Hard delete files after days
HARD_DELETE_AFTER_DAYS=
HARD_DELETE_AFTER_DAYS=

View File

@@ -374,6 +374,12 @@ class PageViewSet(BaseViewSet):
entity_identifier=pk,
entity_type="page",
).delete()
# Delete the deploy board
DeployBoard.objects.get(
entity_name="page",
entity_identifier=pk,
workspace__slug=slug,
).delete()
return Response(status=status.HTTP_204_NO_CONTENT)

View File

@@ -456,6 +456,16 @@ class ProjectViewSet(BaseViewSet):
status=status.HTTP_410_GONE,
)
def destroy(self, request, slug, pk):
project = Project.objects.get(pk=pk)
project.delete()
DeployBoard.objects.get(
entity_name="project",
entity_identifier=pk,
workspace__slug=slug,
).delete()
return Response(status=status.HTTP_204_NO_CONTENT)
class ProjectArchiveUnarchiveEndpoint(BaseAPIView):

View File

@@ -460,6 +460,13 @@ class IssueViewViewSet(BaseViewSet):
entity_identifier=pk,
entity_type="view",
).delete()
# Delete the view from the deploy board
DeployBoard.objects.filter(
entity_name="view",
entity_identifier=pk,
project_id=project_id,
workspace__slug=slug,
).delete()
else:
return Response(
{"error": "Only admin or owner can delete the view"},

View File

@@ -29,6 +29,7 @@ from plane.authentication.adapter.error import (
AuthenticationException,
AUTHENTICATION_ERROR_CODES,
)
from plane.authentication.rate_limit import AuthenticationThrottle
class MagicGenerateEndpoint(APIView):
@@ -37,6 +38,10 @@ class MagicGenerateEndpoint(APIView):
AllowAny,
]
throttle_classes = [
AuthenticationThrottle,
]
def post(self, request):
# Check if instance is configured
instance = Instance.objects.first()

View File

@@ -336,6 +336,12 @@ class WorkspacePageViewSet(BaseViewSet):
)
page.delete()
# Delete the deploy board
DeployBoard.objects.get(
entity_name="page",
entity_identifier=pk,
workspace__slug=slug,
).delete()
return Response(status=status.HTTP_204_NO_CONTENT)

View File

@@ -72,6 +72,7 @@ class InstanceEndpoint(BaseAPIView):
OPENAI_API_KEY,
IS_INTERCOM_ENABLED,
INTERCOM_APP_ID,
SILO_BASE_URL,
) = get_configuration_value(
[
{
@@ -147,6 +148,10 @@ class InstanceEndpoint(BaseAPIView):
"key": "INTERCOM_APP_ID",
"default": os.environ.get("INTERCOM_APP_ID", ""),
},
{
"key": "SILO_BASE_URL",
"default": os.environ.get("SILO_BASE_URL", ""),
},
]
)
@@ -199,6 +204,7 @@ class InstanceEndpoint(BaseAPIView):
data["feature_flag_server_base_url"] = (
settings.FEATURE_FLAG_SERVER_BASE_URL
)
data["silo_base_url"] = SILO_BASE_URL
instance_data = serializer.data
instance_data["workspaces_exist"] = Workspace.objects.count() >= 1

View File

@@ -5,24 +5,19 @@ import { Loader, Plus } from "lucide-react";
// helpers
import { cn } from "@/helpers/common.helper";
type TIssueWorklogPropertyButton = { content?: string; placeHolder?: string; disabled?: boolean; isLoading?: boolean };
type TIssueWorklogPropertyButton = { content?: string; isLoading?: boolean };
export const IssueWorklogPropertyButton: FC<TIssueWorklogPropertyButton> = (props) => {
const { content, placeHolder, disabled, isLoading } = props;
const { content, isLoading } = props;
return (
<div
className={cn("flex justify-between items-center text-sm cursor-pointer p-2 rounded transition-all", {
"bg-custom-background-90 cursor-not-allowed": disabled,
"group hover:bg-custom-background-80": !disabled,
})}
>
<div className="flex justify-between items-center text-sm p-2 rounded transition-all bg-custom-background-90 cursor-not-allowed w-full">
<div
className={cn({
"text-custom-text-400": !content,
"text-custom-text-300": !content,
})}
>
{(content || "").length > 0 ? content : placeHolder ? placeHolder : "Add time tracking"}
{(content || "").length > 0 ? content : "0h 0m"}
</div>
{isLoading ? (
<div className="transition-all flex-shrink-0 w-4 h-4 flex justify-center items-center text-custom-text-400 animate-spin">

View File

@@ -1,17 +1,15 @@
"use client";
import { FC, useRef } from "react";
import { FC } from "react";
import { observer } from "mobx-react";
import useSWR from "swr";
import { Timer } from "lucide-react";
import { Popover } from "@plane/ui";
// helpers
import { cn } from "@/helpers/common.helper";
import { convertMinutesToHoursMinutesString } from "@/helpers/date-time.helper";
// hooks
import { useIssueDetail } from "@/hooks/store";
// plane web components
import { IssueWorklogPropertyButton, WorklogCreate } from "@/plane-web/components/issues/worklog";
import { IssueWorklogPropertyButton } from "@/plane-web/components/issues/worklog";
// plane web hooks
import { useWorkspaceWorklogs } from "@/plane-web/hooks/store";
@@ -23,13 +21,11 @@ type TIssueWorklogProperty = {
};
export const IssueWorklogProperty: FC<TIssueWorklogProperty> = observer((props) => {
const { workspaceSlug, projectId, issueId, disabled: propertyDisabled = false } = props;
const { workspaceSlug, projectId, issueId } = props;
// hooks
const { issueWorklogTotalMinutes, isWorklogsEnabledByProjectId, getIssueWorklogTotalMinutes } =
useWorkspaceWorklogs();
const { peekIssue } = useIssueDetail();
// ref
const popoverButtonRef = useRef<HTMLButtonElement | null>(null);
// fetching current issue total worklog count
const { isLoading } = useSWR(
@@ -44,7 +40,6 @@ export const IssueWorklogProperty: FC<TIssueWorklogProperty> = observer((props)
// derived values
const isPeekOverview = peekIssue ? true : false;
const totalMinutes = issueId && issueWorklogTotalMinutes[issueId] ? issueWorklogTotalMinutes[issueId] : 0;
const disabled = propertyDisabled || isLoading;
if (!isWorklogsEnabledByProjectId(projectId)) return <></>;
return (
@@ -56,27 +51,10 @@ export const IssueWorklogProperty: FC<TIssueWorklogProperty> = observer((props)
<span>Tracked time</span>
</div>
<div className="relative h-full min-h-8 w-full flex-grow flex items-center">
<Popover
popoverButtonRef={popoverButtonRef}
disabled={disabled}
buttonClassName={cn("w-full outline-none", { "cursor-not-allowed": disabled })}
button={
<IssueWorklogPropertyButton
content={convertMinutesToHoursMinutesString(totalMinutes).trim()}
disabled={disabled}
isLoading={isLoading}
/>
}
popperPosition="bottom-start"
panelClassName="w-72 my-1 rounded border-[0.5px] border-custom-border-300 bg-custom-background-100 p-3 text-xs shadow-custom-shadow-rg focus:outline-none"
>
<WorklogCreate
workspaceSlug={workspaceSlug}
projectId={projectId}
issueId={issueId}
handleClose={() => popoverButtonRef.current?.click()}
/>
</Popover>
<IssueWorklogPropertyButton
content={convertMinutesToHoursMinutesString(totalMinutes).trim()}
isLoading={isLoading}
/>
</div>
</div>
);