Merge branch 'preview' of github.com:makeplane/plane into preview
This commit is contained in:
commit
bf1c326b44
9 changed files with 37 additions and 32 deletions
|
|
@ -22,7 +22,7 @@ export const WorkspaceListItem = observer(({ workspaceId }: TWorkspaceListItemPr
|
||||||
return (
|
return (
|
||||||
<Link
|
<Link
|
||||||
key={workspaceId}
|
key={workspaceId}
|
||||||
href={encodeURI(WEB_BASE_URL + "/" + workspace.slug)}
|
href={`${WEB_BASE_URL}/${encodeURIComponent(workspace.slug)}`}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
className="group flex items-center justify-between p-4 gap-2.5 truncate border border-custom-border-200/70 hover:border-custom-border-200 hover:bg-custom-background-90 rounded-md"
|
className="group flex items-center justify-between p-4 gap-2.5 truncate border border-custom-border-200/70 hover:border-custom-border-200 hover:bg-custom-background-90 rounded-md"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,8 @@ export class WorkspaceService extends APIService {
|
||||||
* @returns Promise<any>
|
* @returns Promise<any>
|
||||||
*/
|
*/
|
||||||
async workspaceSlugCheck(slug: string): Promise<any> {
|
async workspaceSlugCheck(slug: string): Promise<any> {
|
||||||
return this.get(`/api/instances/workspace-slug-check/?slug=${slug}`)
|
const params = new URLSearchParams({ slug });
|
||||||
|
return this.get(`/api/instances/workspace-slug-check/?${params.toString()}`)
|
||||||
.then((response) => response?.data)
|
.then((response) => response?.data)
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
throw error?.response?.data;
|
throw error?.response?.data;
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ export interface IWorkspaceStore {
|
||||||
// computed
|
// computed
|
||||||
workspaceIds: string[];
|
workspaceIds: string[];
|
||||||
// helper actions
|
// helper actions
|
||||||
hydrate: (data: any) => void;
|
hydrate: (data: Record<string, IWorkspace>) => void;
|
||||||
getWorkspaceById: (workspaceId: string) => IWorkspace | undefined;
|
getWorkspaceById: (workspaceId: string) => IWorkspace | undefined;
|
||||||
// fetch actions
|
// fetch actions
|
||||||
fetchWorkspaces: () => Promise<IWorkspace[]>;
|
fetchWorkspaces: () => Promise<IWorkspace[]>;
|
||||||
|
|
@ -59,9 +59,9 @@ export class WorkspaceStore implements IWorkspaceStore {
|
||||||
// helper actions
|
// helper actions
|
||||||
/**
|
/**
|
||||||
* @description Hydrates the workspaces
|
* @description Hydrates the workspaces
|
||||||
* @param data - any
|
* @param data - Record<string, IWorkspace>
|
||||||
*/
|
*/
|
||||||
hydrate = (data: any) => {
|
hydrate = (data: Record<string, IWorkspace>) => {
|
||||||
if (data) this.workspaces = data;
|
if (data) this.workspaces = data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,9 @@ class WorkspaceSerializer(BaseSerializer):
|
||||||
# Check if the slug is restricted
|
# Check if the slug is restricted
|
||||||
if value in RESTRICTED_WORKSPACE_SLUGS:
|
if value in RESTRICTED_WORKSPACE_SLUGS:
|
||||||
raise serializers.ValidationError("Slug is not valid")
|
raise serializers.ValidationError("Slug is not valid")
|
||||||
|
# Check uniqueness case-insensitively
|
||||||
|
if Workspace.objects.filter(slug__iexact=value).exists():
|
||||||
|
raise serializers.ValidationError("Slug is already in use")
|
||||||
return value
|
return value
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ class InstanceWorkSpaceAvailabilityCheckEndpoint(BaseAPIView):
|
||||||
)
|
)
|
||||||
|
|
||||||
workspace = (
|
workspace = (
|
||||||
Workspace.objects.filter(slug=slug).exists()
|
Workspace.objects.filter(slug__iexact=slug).exists()
|
||||||
or slug in RESTRICTED_WORKSPACE_SLUGS
|
or slug in RESTRICTED_WORKSPACE_SLUGS
|
||||||
)
|
)
|
||||||
return Response({"status": not workspace}, status=status.HTTP_200_OK)
|
return Response({"status": not workspace}, status=status.HTTP_200_OK)
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,14 @@ import * as React from "react";
|
||||||
import { ISvgIcons } from "./type";
|
import { ISvgIcons } from "./type";
|
||||||
|
|
||||||
export const WorkspaceIcon: React.FC<ISvgIcons> = ({ className }) => (
|
export const WorkspaceIcon: React.FC<ISvgIcons> = ({ className }) => (
|
||||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" className={className}>
|
<svg
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="none"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
className={className}
|
||||||
|
role="img"
|
||||||
|
aria-label="Workspace icon"
|
||||||
|
>
|
||||||
<path
|
<path
|
||||||
fillRule="evenodd"
|
fillRule="evenodd"
|
||||||
clipRule="evenodd"
|
clipRule="evenodd"
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,4 @@ export const filterActivityOnSelectedFilters = (
|
||||||
): TIssueActivityComment[] =>
|
): TIssueActivityComment[] =>
|
||||||
activity.filter((activity) => filter.includes(activity.activity_type as TActivityFilters));
|
activity.filter((activity) => filter.includes(activity.activity_type as TActivityFilters));
|
||||||
|
|
||||||
// boolean to decide if the local db cache is enabled
|
|
||||||
export const ENABLE_LOCAL_DB_CACHE = false;
|
|
||||||
|
|
||||||
export const ENABLE_ISSUE_DEPENDENCIES = false;
|
export const ENABLE_ISSUE_DEPENDENCIES = false;
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@ import { usePlatformOS } from "@/hooks/use-platform-os";
|
||||||
// plane web components
|
// plane web components
|
||||||
import { PlaneVersionNumber } from "@/plane-web/components/global";
|
import { PlaneVersionNumber } from "@/plane-web/components/global";
|
||||||
import { WorkspaceEditionBadge } from "@/plane-web/components/workspace";
|
import { WorkspaceEditionBadge } from "@/plane-web/components/workspace";
|
||||||
import { ENABLE_LOCAL_DB_CACHE } from "@/plane-web/constants/issues";
|
|
||||||
|
|
||||||
export interface WorkspaceHelpSectionProps {
|
export interface WorkspaceHelpSectionProps {
|
||||||
setSidebarActive?: React.Dispatch<React.SetStateAction<boolean>>;
|
setSidebarActive?: React.Dispatch<React.SetStateAction<boolean>>;
|
||||||
|
|
@ -111,7 +110,6 @@ export const SidebarHelpSection: React.FC<WorkspaceHelpSectionProps> = observer(
|
||||||
</a>
|
</a>
|
||||||
</CustomMenu.MenuItem>
|
</CustomMenu.MenuItem>
|
||||||
<div className="my-1 border-t border-custom-border-200" />
|
<div className="my-1 border-t border-custom-border-200" />
|
||||||
{ENABLE_LOCAL_DB_CACHE && (
|
|
||||||
<CustomMenu.MenuItem>
|
<CustomMenu.MenuItem>
|
||||||
<div
|
<div
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
|
|
@ -127,7 +125,6 @@ export const SidebarHelpSection: React.FC<WorkspaceHelpSectionProps> = observer(
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</CustomMenu.MenuItem>
|
</CustomMenu.MenuItem>
|
||||||
)}
|
|
||||||
<CustomMenu.MenuItem>
|
<CustomMenu.MenuItem>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
|
|
@ -173,7 +170,8 @@ export const SidebarHelpSection: React.FC<WorkspaceHelpSectionProps> = observer(
|
||||||
<Tooltip tooltipContent={`${isCollapsed ? "Expand" : "Hide"}`} isMobile={isMobile}>
|
<Tooltip tooltipContent={`${isCollapsed ? "Expand" : "Hide"}`} isMobile={isMobile}>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className={`grid place-items-center rounded-md p-1 text-custom-text-200 outline-none hover:bg-custom-background-90 hover:text-custom-text-100 ${isCollapsed ? "w-full" : ""
|
className={`grid place-items-center rounded-md p-1 text-custom-text-200 outline-none hover:bg-custom-background-90 hover:text-custom-text-100 ${
|
||||||
|
isCollapsed ? "w-full" : ""
|
||||||
}`}
|
}`}
|
||||||
onClick={() => toggleSidebar()}
|
onClick={() => toggleSidebar()}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@ import { TUserPermissions } from "@plane/types/src/enums";
|
||||||
import { API_BASE_URL } from "@/helpers/common.helper";
|
import { API_BASE_URL } from "@/helpers/common.helper";
|
||||||
// local
|
// local
|
||||||
import { persistence } from "@/local-db/storage.sqlite";
|
import { persistence } from "@/local-db/storage.sqlite";
|
||||||
import { ENABLE_LOCAL_DB_CACHE } from "@/plane-web/constants/issues";
|
|
||||||
import { EUserPermissions } from "@/plane-web/constants/user-permissions";
|
import { EUserPermissions } from "@/plane-web/constants/user-permissions";
|
||||||
// services
|
// services
|
||||||
import { AuthService } from "@/services/auth.service";
|
import { AuthService } from "@/services/auth.service";
|
||||||
|
|
@ -278,6 +277,6 @@ export class UserStore implements IUserStore {
|
||||||
}
|
}
|
||||||
|
|
||||||
get localDBEnabled() {
|
get localDBEnabled() {
|
||||||
return ENABLE_LOCAL_DB_CACHE && this.userSettings.canUseLocalDB;
|
return this.userSettings.canUseLocalDB;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue