Compare commits

..
Author SHA1 Message Date
sriramveeraghanta 1ecd68e4a0 feat: implementing zod schema in services pacakges 2025-08-01 12:45:40 +05:30
Akshat JainandGitHub cc49a2ca4f [INFRA-219] fix: update Dockerfile and docker-compose for proxy service (#7523)
* fix: update Dockerfile and docker-compose for version v0.28.0 and improve curl commands in install script

* fix: update docker-compose to use 'stable' tag for all services

* fix: improve curl command options in install script for better reliability
2025-07-31 13:27:34 +05:30
sriram veeraghantaGitHubCopilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
ee53ee33d0 Potential fix for code scanning alert no. 631: Incomplete URL scheme check (#7514)
* Potential fix for code scanning alert no. 631: Incomplete URL scheme check

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* fix: ignore warning in this file

---------

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-07-31 13:23:59 +05:30
sriram veeraghantaandGitHub 99f9337f35 fix: enable email notification by default for new users (#7521) 2025-07-31 13:02:41 +05:30
sriram veeraghantaandGitHub 1458c758a3 fix: adding proxy command in compose file #7518
fix: adding proxy command in compose file
2025-07-30 21:01:34 +05:30
sriramveeraghanta 2d9988f584 fix: adding proxy command 2025-07-30 21:00:16 +05:30
SangeethaandGitHub 27fa439c8d [WEB-4602] fix: 500 error on draft wi labels update #7515 2025-07-30 20:18:48 +05:30
28 changed files with 133 additions and 107 deletions
+1 -1
View File
@@ -260,7 +260,7 @@ class DraftIssueCreateSerializer(BaseSerializer):
DraftIssueLabel.objects.bulk_create(
[
DraftIssueLabel(
label=label,
label_id=label,
draft_issue=instance,
workspace_id=workspace_id,
project_id=project_id,
+5 -5
View File
@@ -276,9 +276,9 @@ def create_user_notification(sender, instance, created, **kwargs):
UserNotificationPreference.objects.create(
user=instance,
property_change=False,
state_change=False,
comment=False,
mention=False,
issue_completed=False,
property_change=True,
state_change=True,
comment=True,
mention=True,
issue_completed=True,
)
@@ -1,15 +1,18 @@
# Module imports
from plane.license.models import Instance
from plane.app.serializers import BaseSerializer
from plane.app.serializers import UserAdminLiteSerializer
class InstanceSerializer(BaseSerializer):
primary_owner_details = UserAdminLiteSerializer(
source="primary_owner", read_only=True
)
class Meta:
model = Instance
fields = "__all__"
read_only_fields = ["id", "email", "last_checked_at", "is_setup_done"]
exclude = [
"created_by",
"deleted_at",
"created_at",
"last_checked_at",
"updated_at",
"updated_by",
]
+1 -1
View File
@@ -5,7 +5,7 @@ RUN xcaddy build \
--with github.com/caddy-dns/digitalocean@04bde2867106aa1b44c2f9da41a285fa02e629c5 \
--with github.com/mholt/caddy-l4@4d3c80e89c5f80438a3e048a410d5543ff5fb9f4
FROM caddy:2.10.0-builder-alpine
FROM caddy:2.10.0-alpine
RUN apk add --no-cache nss-tools bash curl
@@ -5,4 +5,3 @@ export * from "./issue-type-activity";
export * from "./parent-select-root";
export * from "./issue-creator";
export * from "./additional-activity-root";
export * from "./page";
@@ -1,8 +0,0 @@
"use client";
import { FC } from "react";
import { observer } from "mobx-react";
export type TIssuePageActivity = { activityId: string; showIssue?: boolean; ends?: "top" | "bottom" | undefined };
export const IssuePageActivity: FC<TIssuePageActivity> = observer(() => <></>);
@@ -1,3 +1,2 @@
export * from "./notification-card/root";
export * from "./list-root";
export * from "./notification-card/content";
@@ -1,19 +0,0 @@
import { replaceUnderscoreIfSnakeCase } from "@plane/utils";
export const renderAdditionalAction = (notificationField: string, verb: string | undefined) => {
const baseAction = !["comment", "archived_at"].includes(notificationField) ? verb : "";
return `${baseAction} ${replaceUnderscoreIfSnakeCase(notificationField)}`;
};
export const renderAdditionalValue = (
notificationField: string | undefined,
newValue: string | undefined,
oldValue: string | undefined
) => newValue;
export const shouldShowConnector = (notificationField: string | undefined) =>
!["comment", "archived_at", "None", "assignees", "labels", "start_date", "target_date", "parent"].includes(
notificationField || ""
);
export const shouldRender = (notificationField: string | undefined, verb: string | undefined) => verb !== "deleted";
@@ -5,11 +5,7 @@ import { getValidKeysFromObject } from "@plane/utils";
// hooks
import { useIssueDetail } from "@/hooks/store";
// plane web components
import {
IssueTypeActivity,
AdditionalActivityRoot,
IssuePageActivity,
} from "@/plane-web/components/issues/issue-details";
import { IssueTypeActivity, AdditionalActivityRoot } from "@/plane-web/components/issues/issue-details";
import { useTimeLineRelationOptions } from "@/plane-web/components/relations";
// local components
import {
@@ -93,8 +89,6 @@ export const IssueActivityItem: FC<TIssueActivityItem> = observer((props) => {
return <IssueInboxActivity {...componentDefaultProps} />;
case "type":
return <IssueTypeActivity {...componentDefaultProps} />;
case "page":
return <IssuePageActivity {...componentDefaultProps} />;
default:
return <AdditionalActivityRoot {...componentDefaultProps} field={activityField} />;
}
@@ -1,5 +1,4 @@
import { FC } from "react";
import { TNotification } from "@plane/types";
import {
convertMinutesToHoursMinutesString,
@@ -10,12 +9,6 @@ import {
} from "@plane/utils";
// components
import { LiteTextEditor } from "@/components/editor/lite-text";
import {
renderAdditionalAction,
renderAdditionalValue,
shouldShowConnector,
shouldRender,
} from "@/plane-web/components/workspace-notifications";
export const NotificationContent: FC<{
notification: TNotification;
@@ -64,7 +57,8 @@ export const NotificationContent: FC<{
}
if (notificationField === "None") return null;
return renderAdditionalAction(notificationField, verb);
const baseAction = !["comment", "archived_at"].includes(notificationField) ? verb : "";
return `${baseAction} ${replaceUnderscoreIfSnakeCase(notificationField)}`;
};
const renderValue = () => {
@@ -81,16 +75,27 @@ export const NotificationContent: FC<{
return newValue !== ""
? convertMinutesToHoursMinutesString(Number(newValue))
: convertMinutesToHoursMinutesString(Number(oldValue));
return renderAdditionalValue(notificationField, newValue, oldValue);
return newValue;
};
const shouldShowConnector = ![
"comment",
"archived_at",
"None",
"assignees",
"labels",
"start_date",
"target_date",
"parent",
].includes(notificationField || "");
return (
<>
{renderTriggerName()}
<span className="text-custom-text-300">{renderAction()} </span>
{shouldRender(notificationField, verb) && (
{verb !== "deleted" && (
<>
{shouldShowConnector(notificationField) && <span className="text-custom-text-300">to </span>}
{shouldShowConnector && <span className="text-custom-text-300">to </span>}
<span className="text-custom-text-100 font-medium">{renderValue()}</span>
{notificationField === "comment" && renderCommentBox && (
<div className="scale-75 origin-left">
@@ -113,6 +113,7 @@ export const AppProgressBar = React.memo(
useEffect(() => {
if (progressDoneTimer) clearTimeout(progressDoneTimer);
// eslint-disable-next-line react-hooks/exhaustive-deps
progressDoneTimer = setTimeout(() => {
NProgress.done();
}, stopDelay);
@@ -141,6 +142,7 @@ export const AppProgressBar = React.memo(
}, stopDelay);
};
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const handleAnchorClick: any = (event: MouseEvent) => {
// Skip preventDefault
if (event.defaultPrevented) return;
@@ -182,7 +184,9 @@ export const AppProgressBar = React.memo(
!href.startsWith("tel:") &&
!href.startsWith("mailto:") &&
!href.startsWith("blob:") &&
!href.startsWith("javascript:");
!href.startsWith("javascript:") &&
!href.startsWith("data:") &&
!href.startsWith("vbscript:");
return !isNProgressDisabled && isNotTelOrMailto && getAnchorProperty(anchor, "target") !== "_blank";
});
@@ -211,6 +215,7 @@ export const AppProgressBar = React.memo(
elementsWithAttachedHandlers.current = [];
window.history.pushState = originalWindowHistoryPushState;
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
return styles;
@@ -250,6 +255,7 @@ export function useRouter() {
if (startPosition && startPosition > 0) NProgress.set(startPosition);
NProgress.start();
},
// eslint-disable-next-line react-hooks/exhaustive-deps
[router]
);
@@ -267,6 +273,7 @@ export function useRouter() {
startProgress(NProgressOptions?.startPosition);
},
// eslint-disable-next-line react-hooks/exhaustive-deps
[router]
);
@@ -275,6 +282,7 @@ export function useRouter() {
progress(href, options, NProgressOptions);
return router.push(href, options);
},
// eslint-disable-next-line react-hooks/exhaustive-deps
[router, startProgress]
);
@@ -283,6 +291,7 @@ export function useRouter() {
progress(href, options, NProgressOptions);
return router.replace(href, options);
},
// eslint-disable-next-line react-hooks/exhaustive-deps
[router, startProgress]
);
@@ -294,6 +303,7 @@ export function useRouter() {
return router.back();
},
// eslint-disable-next-line react-hooks/exhaustive-deps
[router]
);
@@ -4,4 +4,3 @@ export * from "./issue-type-switcher";
export * from "./issue-type-activity";
export * from "./parent-select-root";
export * from "./issue-creator";
export * from "./page";
@@ -1 +0,0 @@
export * from "ce/components/issues/issue-details/page";
+5 -5
View File
@@ -57,7 +57,7 @@ function spinner() {
function checkLatestRelease(){
echo "Checking for the latest release..." >&2
local latest_release=$(curl -s https://api.github.com/repos/$GH_REPO/releases/latest | grep -o '"tag_name": "[^"]*"' | sed 's/"tag_name": "//;s/"//g')
local latest_release=$(curl -sSL https://api.github.com/repos/$GH_REPO/releases/latest | grep -o '"tag_name": "[^"]*"' | sed 's/"tag_name": "//;s/"//g')
if [ -z "$latest_release" ]; then
echo "Failed to check for the latest release. Exiting..." >&2
exit 1
@@ -247,7 +247,7 @@ function download() {
mv $PLANE_INSTALL_DIR/docker-compose.yaml $PLANE_INSTALL_DIR/archive/$TS.docker-compose.yaml
fi
RESPONSE=$(curl -H 'Cache-Control: no-cache, no-store' -s -w "HTTPSTATUS:%{http_code}" "$RELEASE_DOWNLOAD_URL/$APP_RELEASE/docker-compose.yml?$(date +%s)")
RESPONSE=$(curl -sSL -H 'Cache-Control: no-cache, no-store' -w "HTTPSTATUS:%{http_code}" "$RELEASE_DOWNLOAD_URL/$APP_RELEASE/docker-compose.yml?$(date +%s)")
BODY=$(echo "$RESPONSE" | sed -e 's/HTTPSTATUS\:.*//g')
STATUS=$(echo "$RESPONSE" | tr -d '\n' | sed -e 's/.*HTTPSTATUS://')
@@ -255,7 +255,7 @@ function download() {
echo "$BODY" > $PLANE_INSTALL_DIR/docker-compose.yaml
else
# Fallback to download from the raw github url
RESPONSE=$(curl -H 'Cache-Control: no-cache, no-store' -s -w "HTTPSTATUS:%{http_code}" "$FALLBACK_DOWNLOAD_URL/docker-compose.yml?$(date +%s)")
RESPONSE=$(curl -sSL -H 'Cache-Control: no-cache, no-store' -w "HTTPSTATUS:%{http_code}" "$FALLBACK_DOWNLOAD_URL/docker-compose.yml?$(date +%s)")
BODY=$(echo "$RESPONSE" | sed -e 's/HTTPSTATUS\:.*//g')
STATUS=$(echo "$RESPONSE" | tr -d '\n' | sed -e 's/.*HTTPSTATUS://')
@@ -269,7 +269,7 @@ function download() {
fi
fi
RESPONSE=$(curl -H 'Cache-Control: no-cache, no-store' -s -w "HTTPSTATUS:%{http_code}" "$RELEASE_DOWNLOAD_URL/$APP_RELEASE/variables.env?$(date +%s)")
RESPONSE=$(curl -sSL -H 'Cache-Control: no-cache, no-store' -w "HTTPSTATUS:%{http_code}" "$RELEASE_DOWNLOAD_URL/$APP_RELEASE/variables.env?$(date +%s)")
BODY=$(echo "$RESPONSE" | sed -e 's/HTTPSTATUS\:.*//g')
STATUS=$(echo "$RESPONSE" | tr -d '\n' | sed -e 's/.*HTTPSTATUS://')
@@ -277,7 +277,7 @@ function download() {
echo "$BODY" > $PLANE_INSTALL_DIR/variables-upgrade.env
else
# Fallback to download from the raw github url
RESPONSE=$(curl -H 'Cache-Control: no-cache, no-store' -s -w "HTTPSTATUS:%{http_code}" "$FALLBACK_DOWNLOAD_URL/variables.env?$(date +%s)")
RESPONSE=$(curl -sSL -H 'Cache-Control: no-cache, no-store' -w "HTTPSTATUS:%{http_code}" "$FALLBACK_DOWNLOAD_URL/variables.env?$(date +%s)")
BODY=$(echo "$RESPONSE" | sed -e 's/HTTPSTATUS\:.*//g')
STATUS=$(echo "$RESPONSE" | tr -d '\n' | sed -e 's/.*HTTPSTATUS://')
+1
View File
@@ -0,0 +1 @@
export {};
+2 -1
View File
@@ -1 +1,2 @@
export * from "./ai.service";
export * from "./core";
export * from "./extended";
+1
View File
@@ -0,0 +1 @@
export {};
+3 -2
View File
@@ -1,2 +1,3 @@
export * from "./auth.service";
export * from "./sites-auth.service";
export * from "./admin";
export * from "./sites";
export * from "./web";
@@ -1,8 +1,8 @@
import { API_BASE_URL } from "@plane/constants";
// types
import { IEmailCheckData, IEmailCheckResponse } from "@plane/types";
// services
import { APIService } from "../api.service";
// types
import { EmailCheckResponseSchema, TEmailCheckResponse, TEmailCheckData } from "./types";
/**
* Service class for handling authentication-related operations for Plane space application
@@ -11,10 +11,6 @@ import { APIService } from "../api.service";
* @remarks This service is only available for plane sites
*/
export class SitesAuthService extends APIService {
/**
* Creates an instance of SitesAuthService
* Initializes with the base API URL
*/
constructor(BASE_URL?: string) {
super(BASE_URL || API_BASE_URL);
}
@@ -25,9 +21,9 @@ export class SitesAuthService extends APIService {
* @returns {Promise<IEmailCheckResponse>} Response indicating email status
* @throws {Error} Throws response data if the request fails
*/
async emailCheck(data: IEmailCheckData): Promise<IEmailCheckResponse> {
async emailCheck(data: TEmailCheckData): Promise<TEmailCheckResponse> {
return this.post("/auth/spaces/email-check/", data, { headers: {} })
.then((response) => response?.data)
.then((response) => EmailCheckResponseSchema.parse(response?.data))
.catch((error) => {
throw error?.response?.data;
});
+14
View File
@@ -0,0 +1,14 @@
import * as z from "zod";
export const EmailCheckResponseSchema = z.object({
email: z.string().email(),
status: z.enum(["MAGIC_CODE", "CREDENTIAL"]),
existing: z.boolean(),
is_password_autoset: z.boolean(),
});
export type TEmailCheckResponse = z.infer<typeof EmailCheckResponseSchema>;
export type TEmailCheckData = {
email: string;
};
@@ -6,7 +6,6 @@ import type {
IInstanceAdmin,
IInstanceConfiguration,
IInstanceInfo,
TPage,
} from "@plane/types";
// api service
import { APIService } from "../api.service";
@@ -17,10 +16,6 @@ import { APIService } from "../api.service";
* @extends {APIService}
*/
export class InstanceService extends APIService {
/**
* Creates an instance of InstanceService
* Initializes the service with the base API URL
*/
constructor() {
super(API_BASE_URL);
}
@@ -39,19 +34,6 @@ export class InstanceService extends APIService {
});
}
/**
* Fetches the changelog for the current instance
* @returns {Promise<TPage>} Promise resolving to the changelog page data
* @throws {Error} If the API request fails
*/
async changelog(): Promise<TPage> {
return this.get("/api/instances/changelog/")
.then((response) => response.data)
.catch((error) => {
throw error?.response?.data;
});
}
/**
* Fetches the list of instance admins
* @returns {Promise<IInstanceAdmin[]>} Promise resolving to an array of instance admins
+1 -1
View File
@@ -1 +1 @@
export * from "./instance.service";
export * from "./core";
+57
View File
@@ -0,0 +1,57 @@
import * as z from "zod";
export const InstanceSchema = z.object({
id: z.string(),
created_at: z.string(),
updated_at: z.string(),
instance_name: z.string().optional(),
whitelist_emails: z.string().optional(),
instance_id: z.string().optional(),
current_version: z.string().optional(),
latest_version: z.string().optional(),
last_checked_at: z.string().optional(),
namespace: z.string().optional(),
is_telemetry_enabled: z.boolean(),
is_support_required: z.boolean(),
is_activated: z.boolean(),
is_setup_done: z.boolean(),
is_signup_screen_visited: z.boolean(),
user_count: z.number().optional(),
is_verified: z.boolean(),
workspaces_exist: z.boolean(),
});
export type TInstance = z.infer<typeof InstanceSchema>;
export const InstanceConfigSchema = z.object({
enable_signup: z.boolean(),
is_workspace_creation_disabled: z.boolean(),
is_google_enabled: z.boolean(),
is_github_enabled: z.boolean(),
is_gitlab_enabled: z.boolean(),
is_magic_login_enabled: z.boolean(),
is_email_password_enabled: z.boolean(),
github_app_name: z.string().optional(),
slack_client_id: z.string().optional(),
posthog_api_key: z.string().optional(),
posthog_host: z.string().optional(),
has_unsplash_configured: z.boolean(),
has_llm_configured: z.boolean(),
file_size_limit: z.number().optional(),
is_smtp_configured: z.boolean(),
app_base_url: z.string().optional(),
space_base_url: z.string().optional(),
admin_base_url: z.string().optional(),
is_intercom_enabled: z.boolean(),
intercom_app_id: z.string().optional(),
instance_changelog_url: z.string().optional(),
});
export type TInstanceConfig = z.infer<typeof InstanceConfigSchema>;
export const InstanceResponseSchema = z.object({
instance: InstanceSchema,
config: InstanceConfigSchema,
});
export type TInstanceResponse = z.infer<typeof InstanceResponseSchema>;
-8
View File
@@ -1,8 +0,0 @@
import { API_BASE_URL } from "@plane/constants";
import { APIService } from "./api.service";
export abstract class LiveService extends APIService {
constructor(BASE_URL?: string) {
super(BASE_URL || API_BASE_URL);
}
}
+1 -1
View File
@@ -27,4 +27,4 @@ export type TProjectBaseActivity<K extends string = string, V extends string = s
project: string;
};
export type TBaseActivityVerbs = "created" | "updated" | "deleted" | "added";
export type TBaseActivityVerbs = "created" | "updated" | "deleted";
@@ -28,7 +28,7 @@ export type TNotificationData = {
actor: string | undefined;
field: string | undefined;
issue_comment: string | undefined;
verb: "created" | "updated" | "deleted" | "added";
verb: "created" | "updated" | "deleted";
new_value: string | undefined;
old_value: string | undefined;
};