Compare commits
7
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1ecd68e4a0 | ||
|
|
cc49a2ca4f | ||
|
|
ee53ee33d0 | ||
|
|
99f9337f35 | ||
|
|
1458c758a3 | ||
|
|
2d9988f584 | ||
|
|
27fa439c8d |
@@ -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,
|
||||
|
||||
@@ -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",
|
||||
]
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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]
|
||||
);
|
||||
|
||||
|
||||
@@ -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://')
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
export {};
|
||||
@@ -1 +1,2 @@
|
||||
export * from "./ai.service";
|
||||
export * from "./core";
|
||||
export * from "./extended";
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
export {};
|
||||
@@ -1,2 +1,3 @@
|
||||
export * from "./auth.service";
|
||||
export * from "./sites-auth.service";
|
||||
export * from "./admin";
|
||||
export * from "./sites";
|
||||
export * from "./web";
|
||||
|
||||
+4
-8
@@ -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;
|
||||
});
|
||||
@@ -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;
|
||||
};
|
||||
-18
@@ -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 @@
|
||||
export * from "./instance.service";
|
||||
export * from "./core";
|
||||
|
||||
@@ -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>;
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user