[WEB-2610] fix: workspace redirection from admin app (#6122)
This commit is contained in:
parent
7725b200f7
commit
5aeedd1e5a
2 changed files with 5 additions and 4 deletions
|
|
@ -38,6 +38,8 @@ export const WorkspaceCreateForm = () => {
|
||||||
getValues,
|
getValues,
|
||||||
formState: { errors, isSubmitting, isValid },
|
formState: { errors, isSubmitting, isValid },
|
||||||
} = useForm<IWorkspace>({ defaultValues, mode: "onChange" });
|
} = useForm<IWorkspace>({ defaultValues, mode: "onChange" });
|
||||||
|
// derived values
|
||||||
|
const workspaceBaseURL = encodeURI(WEB_BASE_URL || window.location.origin + "/");
|
||||||
|
|
||||||
const handleCreateWorkspace = async (formData: IWorkspace) => {
|
const handleCreateWorkspace = async (formData: IWorkspace) => {
|
||||||
await workspaceService
|
await workspaceService
|
||||||
|
|
@ -124,7 +126,7 @@ export const WorkspaceCreateForm = () => {
|
||||||
<div className="flex flex-col gap-1">
|
<div className="flex flex-col gap-1">
|
||||||
<h4 className="text-sm text-custom-text-300">Set your workspace's URL</h4>
|
<h4 className="text-sm text-custom-text-300">Set your workspace's URL</h4>
|
||||||
<div className="flex gap-0.5 w-full items-center rounded-md border-[0.5px] border-custom-border-200 px-3">
|
<div className="flex gap-0.5 w-full items-center rounded-md border-[0.5px] border-custom-border-200 px-3">
|
||||||
<span className="whitespace-nowrap text-sm text-custom-text-200">{WEB_BASE_URL}/</span>
|
<span className="whitespace-nowrap text-sm text-custom-text-200">{workspaceBaseURL}</span>
|
||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
name="slug"
|
name="slug"
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
import { observer } from "mobx-react";
|
import { observer } from "mobx-react";
|
||||||
import Link from "next/link";
|
|
||||||
import { ExternalLink } from "lucide-react";
|
import { ExternalLink } from "lucide-react";
|
||||||
// helpers
|
// helpers
|
||||||
import { Tooltip } from "@plane/ui";
|
import { Tooltip } from "@plane/ui";
|
||||||
|
|
@ -20,7 +19,7 @@ export const WorkspaceListItem = observer(({ workspaceId }: TWorkspaceListItemPr
|
||||||
|
|
||||||
if (!workspace) return null;
|
if (!workspace) return null;
|
||||||
return (
|
return (
|
||||||
<Link
|
<a
|
||||||
key={workspaceId}
|
key={workspaceId}
|
||||||
href={`${WEB_BASE_URL}/${encodeURIComponent(workspace.slug)}`}
|
href={`${WEB_BASE_URL}/${encodeURIComponent(workspace.slug)}`}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
|
|
@ -77,6 +76,6 @@ export const WorkspaceListItem = observer(({ workspaceId }: TWorkspaceListItemPr
|
||||||
<div className="flex-shrink-0">
|
<div className="flex-shrink-0">
|
||||||
<ExternalLink size={14} className="text-custom-text-400 group-hover:text-custom-text-200" />
|
<ExternalLink size={14} className="text-custom-text-400 group-hover:text-custom-text-200" />
|
||||||
</div>
|
</div>
|
||||||
</Link>
|
</a>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue