forked from github/plane
Merge branch 'develop' of github.com:makeplane/plane into develop-deploy
This commit is contained in:
commit
417749c543
@ -372,8 +372,8 @@ module.exports = {
|
||||
96: "21.6rem",
|
||||
},
|
||||
backgroundImage: {
|
||||
"gradient-primary": "var( --gradient-onboarding-primary)",
|
||||
"gradient-secondary": "var( --gradient-onboarding-secondary)",
|
||||
"onboarding-gradient-primary": "var( --gradient-onboarding-primary)",
|
||||
"onboarding-gradient-secondary": "var( --gradient-onboarding-secondary)",
|
||||
},
|
||||
},
|
||||
fontFamily: {
|
||||
|
@ -12,6 +12,7 @@ import { AuthService } from "services/auth.service";
|
||||
import { Dialog, Transition } from "@headlessui/react";
|
||||
// icons
|
||||
import { AlertTriangle } from "lucide-react";
|
||||
import { UserService } from "services/user.service";
|
||||
|
||||
type Props = {
|
||||
isOpen: boolean;
|
||||
@ -19,6 +20,7 @@ type Props = {
|
||||
};
|
||||
|
||||
const authService = new AuthService();
|
||||
const userService = new UserService();
|
||||
|
||||
const DeleteAccountModal: React.FC<Props> = (props) => {
|
||||
const { isOpen, onClose } = props;
|
||||
@ -41,6 +43,28 @@ const DeleteAccountModal: React.FC<Props> = (props) => {
|
||||
);
|
||||
};
|
||||
|
||||
const handleDeleteAccount = async () => {
|
||||
setIsDeleteLoading(true);
|
||||
await userService
|
||||
.deleteAccount()
|
||||
.then(() => {
|
||||
setToastAlert({
|
||||
type: "success",
|
||||
title: "Success!",
|
||||
message: "Account deleted successfully.",
|
||||
});
|
||||
router.push("/");
|
||||
})
|
||||
.catch((err) =>
|
||||
setToastAlert({
|
||||
type: "error",
|
||||
title: "Error!",
|
||||
message: err?.data?.error,
|
||||
})
|
||||
);
|
||||
setIsDeleteLoading(false);
|
||||
};
|
||||
|
||||
const handleClose = () => {
|
||||
onClose();
|
||||
};
|
||||
@ -84,10 +108,10 @@ const DeleteAccountModal: React.FC<Props> = (props) => {
|
||||
</div>
|
||||
|
||||
<div className="mt-6 px-4">
|
||||
<p className="text-onboarding-text-300 font-normal text-base">
|
||||
<ul className="text-onboarding-text-300 list-disc font-normal text-base">
|
||||
<li>Delete this account if you have another and won’t use this account.</li>
|
||||
<li>Switch to another account if you’d like to come back to this account another time.</li>
|
||||
</p>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -95,7 +119,10 @@ const DeleteAccountModal: React.FC<Props> = (props) => {
|
||||
<span className="text-sm font-medium hover:cursor-pointer" onClick={handleSignOut}>
|
||||
Switch account
|
||||
</span>
|
||||
<button className="py-1.5 px-3 font-medium rounded-sm text-red-500 border border-red-500 text-sm ">
|
||||
<button
|
||||
className="py-1.5 px-3 font-medium rounded-sm text-red-500 border border-red-500 text-sm "
|
||||
onClick={handleDeleteAccount}
|
||||
>
|
||||
{isDeleteLoading ? "Deleting..." : "Delete account"}
|
||||
</button>
|
||||
</div>
|
||||
|
@ -84,7 +84,7 @@ const LabelPill = ({ labelId }: { labelId: string }) => {
|
||||
|
||||
return (
|
||||
<span
|
||||
className="h-1.5 w-1.5 rounded-full"
|
||||
className="h-1.5 w-1.5 rounded-full flex-shrink-0"
|
||||
style={{
|
||||
backgroundColor: labels?.find((l) => l.id === labelId)?.color ?? "#000000",
|
||||
}}
|
||||
@ -266,12 +266,12 @@ const activityDetails: {
|
||||
if (activity.verb === "created")
|
||||
return (
|
||||
<>
|
||||
added this issue to the cycle{" "}
|
||||
<span className="flex-shrink-0">added this issue to the cycle</span>
|
||||
<a
|
||||
href={`/${workspaceSlug}/projects/${activity.project}/cycles/${activity.new_identifier}`}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="w-full font-medium text-custom-text-100 inline-flex items-center gap-1 hover:underline"
|
||||
className="font-medium text-custom-text-100 inline-flex items-center truncate gap-1 hover:underline"
|
||||
>
|
||||
<span className="truncate">{activity.new_value}</span>
|
||||
<RocketIcon size={12} color="#6b7280" className="flex-shrink-0" />
|
||||
@ -281,12 +281,12 @@ const activityDetails: {
|
||||
else if (activity.verb === "updated")
|
||||
return (
|
||||
<>
|
||||
set the cycle to{" "}
|
||||
<span className="flex-shrink-0">set the cycle to </span>
|
||||
<a
|
||||
href={`/${workspaceSlug}/projects/${activity.project}/cycles/${activity.new_identifier}`}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="w-full font-medium text-custom-text-100 inline-flex items-center gap-1 hover:underline"
|
||||
className="font-medium text-custom-text-100 inline-flex items-center truncate gap-1 hover:underline"
|
||||
>
|
||||
<span className="truncate">{activity.new_value}</span>
|
||||
<RocketIcon size={12} color="#6b7280" className="flex-shrink-0" />
|
||||
@ -301,7 +301,7 @@ const activityDetails: {
|
||||
href={`/${workspaceSlug}/projects/${activity.project}/cycles/${activity.old_identifier}`}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="w-full font-medium text-custom-text-100 inline-flex items-center gap-1 hover:underline"
|
||||
className="font-medium text-custom-text-100 inline-flex items-center truncate gap-1 hover:underline"
|
||||
>
|
||||
<span className="truncate">{activity.old_value}</span>
|
||||
<RocketIcon size={12} color="#6b7280" className="flex-shrink-0" />
|
||||
@ -370,15 +370,15 @@ const activityDetails: {
|
||||
return (
|
||||
<>
|
||||
added a new label{" "}
|
||||
<span className="inline-flex items-center gap-2 rounded-full border border-custom-border-300 px-2 py-0.5 text-xs">
|
||||
<span className="flex truncate items-center gap-2 rounded-full border border-custom-border-300 px-2 py-0.5 text-xs">
|
||||
<LabelPill labelId={activity.new_identifier ?? ""} />
|
||||
<span className="font-medium text-custom-text-100">{activity.new_value}</span>
|
||||
<span className="font-medium flex-shrink truncate text-custom-text-100">{activity.new_value}</span>
|
||||
</span>
|
||||
{showIssue && (
|
||||
<>
|
||||
<span>
|
||||
{" "}
|
||||
to <IssueLink activity={activity} />
|
||||
</>
|
||||
</span>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
@ -386,15 +386,15 @@ const activityDetails: {
|
||||
return (
|
||||
<>
|
||||
removed the label{" "}
|
||||
<span className="inline-flex items-center gap-3 rounded-full border border-custom-border-300 px-2 py-0.5 text-xs">
|
||||
<span className="flex truncate items-center gap-2 rounded-full border border-custom-border-300 px-2 py-0.5 text-xs">
|
||||
<LabelPill labelId={activity.old_identifier ?? ""} />
|
||||
<span className="font-medium text-custom-text-100">{activity.old_value}</span>
|
||||
<span className="font-medium flex-shrink truncate text-custom-text-100">{activity.old_value}</span>
|
||||
</span>
|
||||
{showIssue && (
|
||||
<>
|
||||
<span>
|
||||
{" "}
|
||||
from <IssueLink activity={activity} />
|
||||
</>
|
||||
</span>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
@ -482,7 +482,7 @@ const activityDetails: {
|
||||
href={`/${workspaceSlug}/projects/${activity.project}/modules/${activity.new_identifier}`}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="w-full font-medium text-custom-text-100 inline-flex items-center gap-1 hover:underline"
|
||||
className="font-medium text-custom-text-100 inline-flex items-center truncate gap-1 hover:underline"
|
||||
>
|
||||
<span className="truncate">{activity.new_value}</span>
|
||||
<RocketIcon size={12} color="#6b7280" className="flex-shrink-0" />
|
||||
@ -497,7 +497,7 @@ const activityDetails: {
|
||||
href={`/${workspaceSlug}/projects/${activity.project}/modules/${activity.new_identifier}`}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="w-full font-medium text-custom-text-100 inline-flex items-center gap-1 hover:underline"
|
||||
className="font-medium text-custom-text-100 inline-flex items-center truncate gap-1 hover:underline"
|
||||
>
|
||||
<span className="truncate">{activity.new_value}</span>
|
||||
<RocketIcon size={12} color="#6b7280" className="flex-shrink-0" />
|
||||
@ -512,7 +512,7 @@ const activityDetails: {
|
||||
href={`/${workspaceSlug}/projects/${activity.project}/modules/${activity.old_identifier}`}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="w-full font-medium text-custom-text-100 inline-flex items-center gap-1 hover:underline"
|
||||
className="font-medium text-custom-text-100 inline-flex items-center truncate gap-1 hover:underline"
|
||||
>
|
||||
<span className="truncate">{activity.old_value}</span>
|
||||
<RocketIcon size={12} color="#6b7280" className="flex-shrink-0" />
|
||||
@ -525,7 +525,7 @@ const activityDetails: {
|
||||
name: {
|
||||
message: (activity, showIssue) => (
|
||||
<>
|
||||
set the name to {activity.new_value}
|
||||
<span className="truncate">set the name to {activity.new_value}</span>
|
||||
{showIssue && (
|
||||
<>
|
||||
{" "}
|
||||
|
@ -186,6 +186,7 @@ export const CreateUpdateLabelInline = observer(
|
||||
id="labelName"
|
||||
name="name"
|
||||
type="text"
|
||||
autofocus
|
||||
value={value}
|
||||
onChange={onChange}
|
||||
ref={ref}
|
||||
|
@ -18,6 +18,7 @@ import { ROLE } from "constants/workspace";
|
||||
import { IWorkspaceMemberInvitation } from "types";
|
||||
// icons
|
||||
import { CheckCircle2, Search } from "lucide-react";
|
||||
import { trackEvent } from "helpers/event-tracker.helper";
|
||||
|
||||
type Props = {
|
||||
handleNextStep: () => void;
|
||||
@ -32,7 +33,7 @@ const Invitations: React.FC<Props> = (props) => {
|
||||
|
||||
const {
|
||||
workspace: workspaceStore,
|
||||
user: { updateCurrentUser },
|
||||
user: { currentUser, updateCurrentUser },
|
||||
} = useMobxStore();
|
||||
|
||||
const {
|
||||
@ -63,7 +64,8 @@ const Invitations: React.FC<Props> = (props) => {
|
||||
|
||||
await workspaceService
|
||||
.joinWorkspaces({ invitations: invitationsRespond })
|
||||
.then(async () => {
|
||||
.then(async (res) => {
|
||||
trackEvent("WORKSPACE_USER_INVITE_ACCEPT", res);
|
||||
await mutateInvitations();
|
||||
await workspaceStore.fetchWorkspaces();
|
||||
await mutate(USER_WORKSPACES);
|
||||
@ -145,15 +147,15 @@ const Invitations: React.FC<Props> = (props) => {
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<EmptyInvitation />
|
||||
<EmptyInvitation email={currentUser!.email} />
|
||||
);
|
||||
};
|
||||
|
||||
const EmptyInvitation = () => (
|
||||
const EmptyInvitation = ({ email }: { email: string }) => (
|
||||
<div className="items-center md:w-4/5 bg-onboarding-background-300/30 my-16 border-onboarding-border-200 py-5 px-10 rounded border justify-center ">
|
||||
<p className="text-lg text-onboarding-text-300 text-center font-semibold">Is your Team already on Plane?</p>
|
||||
<p className="text-lg text-onboarding-text-300 text-center font-semibold">Is your team already on Plane?</p>
|
||||
<p className="text-sm text-onboarding-text-300 mt-6 text-center">
|
||||
We couldn’t find any existing workspaces for the email address bhavesh@caravel.ai
|
||||
We couldn’t find any existing workspaces for the email address {email}
|
||||
</p>
|
||||
<div
|
||||
className="bg-onboarding-background-200 mt-6 py-3 text-center hover:cursor-pointer text-custom-text-200 rounded-md text-sm font-medium border border-custom-border-200"
|
||||
|
@ -231,7 +231,7 @@ export const InviteMembers: React.FC<Props> = (props) => {
|
||||
return (
|
||||
<div className="flex py-14">
|
||||
<div
|
||||
className={`hidden lg:block w-1/4 p-3 ml-auto rounded bg-gradient-secondary border border-onboarding-border-100 border-opacity-10`}
|
||||
className={`hidden lg:block w-1/4 p-3 ml-auto rounded bg-onboarding-gradient-secondary border border-onboarding-border-100 border-opacity-10`}
|
||||
>
|
||||
<p className="text-base text-onboarding-text-400 font-semibold">Members</p>
|
||||
|
||||
|
@ -7,12 +7,9 @@ import DummySidebar from "components/account/sidebar";
|
||||
import OnboardingStepIndicator from "components/account/step-indicator";
|
||||
import { Workspace } from "./workspace";
|
||||
// types
|
||||
import { IWorkspaceMemberInvitation, TOnboardingSteps } from "types";
|
||||
// fetch-keys
|
||||
import { USER_WORKSPACES, USER_WORKSPACE_INVITATIONS } from "constants/fetch-keys";
|
||||
// constants
|
||||
import { ROLE } from "constants/workspace";
|
||||
import { trackEvent } from "helpers/event-tracker.helper";
|
||||
import { IWorkspace, TOnboardingSteps } from "types";
|
||||
// react-hook-form
|
||||
import { Controller, useForm } from "react-hook-form";
|
||||
|
||||
type Props = {
|
||||
finishOnboarding: () => Promise<void>;
|
||||
@ -38,81 +35,30 @@ export const JoinWorkspaces: React.FC<Props> = ({ stepChange, setTryDiffAccount
|
||||
|
||||
const handleNextStep = async () => {
|
||||
if (!user) return;
|
||||
|
||||
await stepChange({ workspace_join: true });
|
||||
|
||||
if (user.onboarding_step.workspace_create && user.onboarding_step.workspace_invite) await finishOnboarding();
|
||||
};
|
||||
|
||||
const submitInvitations = async () => {
|
||||
if (invitationsRespond.length <= 0) return;
|
||||
|
||||
setIsJoiningWorkspaces(true);
|
||||
|
||||
await workspaceService
|
||||
.joinWorkspaces({ invitations: invitationsRespond })
|
||||
.then(async (res) => {
|
||||
trackEvent(
|
||||
'WORKSPACE_USER_INVITE_ACCEPT',
|
||||
res
|
||||
)
|
||||
await mutateInvitations();
|
||||
await mutate(USER_WORKSPACES);
|
||||
await updateLastWorkspace();
|
||||
|
||||
await handleNextStep();
|
||||
})
|
||||
.finally(() => setIsJoiningWorkspaces(false));
|
||||
await stepChange({ workspace_join: true, workspace_create: true });
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="w-full space-y-7 sm:space-y-10">
|
||||
<h5 className="sm:text-lg">We see that someone has invited you to</h5>
|
||||
<h4 className="text-xl sm:text-2xl font-semibold">Join a workspace</h4>
|
||||
<div className="max-h-[37vh] overflow-y-auto md:w-3/5 space-y-4">
|
||||
{invitations &&
|
||||
invitations.map((invitation) => {
|
||||
const isSelected = invitationsRespond.includes(invitation.id);
|
||||
|
||||
return (
|
||||
<div
|
||||
key={invitation.id}
|
||||
className={`flex cursor-pointer items-center gap-2 border py-5 px-3.5 rounded ${isSelected ? "border-custom-primary-100" : "border-custom-border-200 hover:bg-custom-background-80"
|
||||
}`}
|
||||
onClick={() => handleInvitation(invitation, isSelected ? "withdraw" : "accepted")}
|
||||
>
|
||||
<div className="flex-shrink-0">
|
||||
<div className="grid place-items-center h-9 w-9 rounded">
|
||||
{invitation.workspace.logo && invitation.workspace.logo !== "" ? (
|
||||
<img
|
||||
src={invitation.workspace.logo}
|
||||
height="100%"
|
||||
width="100%"
|
||||
className="rounded"
|
||||
alt={invitation.workspace.name}
|
||||
/>
|
||||
) : (
|
||||
<span className="grid place-items-center h-9 w-9 py-1.5 px-3 rounded bg-gray-700 uppercase text-white">
|
||||
{invitation.workspace.name[0]}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<div className="min-w-0 flex-1">
|
||||
<div className="text-sm font-medium">{truncateText(invitation.workspace.name, 30)}</div>
|
||||
<p className="text-xs text-custom-text-200">{ROLE[invitation.role]}</p>
|
||||
</div>
|
||||
<span className={`flex-shrink-0 ${isSelected ? "text-custom-primary-100" : "text-custom-text-200"}`}>
|
||||
<CheckCircle className="h-5 w-5" />
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
<div className="flex h-full w-full">
|
||||
<div className="hidden lg:block w-3/12">
|
||||
<Controller
|
||||
control={control}
|
||||
name="name"
|
||||
render={({ field: { value } }) => (
|
||||
<DummySidebar
|
||||
watch={watch}
|
||||
setValue={setValue}
|
||||
control={control}
|
||||
showProject={false}
|
||||
workspaceName={value.length > 0 ? value : "New Workspace"}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="w-full lg:w-1/2 md:w-4/5 md:px-0 px-7 my-16 mx-auto">
|
||||
<div className="flex justify-between items-center">
|
||||
<p className="font-semibold text-onboarding-text-200 text-xl sm:text-2xl">What will your workspace </p>
|
||||
<p className="font-semibold text-onboarding-text-200 text-xl sm:text-2xl">What will your workspace be?</p>
|
||||
<OnboardingStepIndicator step={1} />
|
||||
</div>
|
||||
<Workspace
|
||||
|
@ -23,6 +23,7 @@ import { Camera, User2 } from "lucide-react";
|
||||
const defaultValues: Partial<IUser> = {
|
||||
first_name: "",
|
||||
avatar: "",
|
||||
use_case: undefined,
|
||||
};
|
||||
|
||||
type Props = {
|
||||
@ -59,6 +60,7 @@ export const UserDetails: React.FC<Props> = observer((props) => {
|
||||
...formData,
|
||||
first_name: formData.first_name.split(" ")[0],
|
||||
last_name: formData.first_name.split(" ")[1],
|
||||
use_case: formData.use_case,
|
||||
onboarding_step: {
|
||||
...user.onboarding_step,
|
||||
profile_complete: true,
|
||||
@ -91,7 +93,6 @@ export const UserDetails: React.FC<Props> = observer((props) => {
|
||||
handleDelete={() => {}}
|
||||
onSuccess={(url) => {
|
||||
setValue("avatar", url);
|
||||
// handleSubmit(onSubmit)();
|
||||
setIsImageUploadModalOpen(false);
|
||||
}}
|
||||
value={watch("avatar") !== "" ? watch("avatar") : undefined}
|
||||
@ -158,25 +159,31 @@ export const UserDetails: React.FC<Props> = observer((props) => {
|
||||
name="first_name"
|
||||
render={({ field: { value } }) => (
|
||||
<p className="font-medium text-onboarding-text-200 text-xl sm:text-2xl p-0">
|
||||
And how will you use Plane, {value} ?
|
||||
And how will you use Plane{value.length>0?", ":""}{value}?
|
||||
</p>
|
||||
)}
|
||||
/>
|
||||
|
||||
<p className="font-medium text-onboarding-text-300 text-sm my-3">Choose just one</p>
|
||||
|
||||
<div className="flex flex-wrap break-all overflow-auto">
|
||||
{useCases.map((useCase, index) => (
|
||||
<div
|
||||
className={`border mb-3 hover:cursor-pointer hover:bg-onboarding-background-300/30 flex-shrink-0 ${
|
||||
selectedUsecase === index ? "border-custom-primary-100" : "border-onboarding-border-100"
|
||||
} mr-3 rounded-sm p-3 text-sm font-medium`}
|
||||
onClick={() => setSelectedUsecase(index)}
|
||||
>
|
||||
{useCase}
|
||||
<Controller
|
||||
control={control}
|
||||
name="use_case"
|
||||
render={({ field: { value, onChange } }) => (
|
||||
<div className="flex flex-wrap break-all overflow-auto">
|
||||
{useCases.map((useCase) => (
|
||||
<div
|
||||
className={`border mb-3 hover:cursor-pointer hover:bg-onboarding-background-300/30 flex-shrink-0 ${
|
||||
value === useCase ? "border-custom-primary-100" : "border-onboarding-border-100"
|
||||
} mr-3 rounded-sm p-3 text-sm font-medium`}
|
||||
onClick={() => onChange(useCase)}
|
||||
>
|
||||
{useCase}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<Button variant="primary" type="submit" size="md" disabled={!isValid} loading={isSubmitting}>
|
||||
|
@ -184,7 +184,7 @@ export const SignInView = observer(() => {
|
||||
<Spinner />
|
||||
</div>
|
||||
) : (
|
||||
<div className={`bg-gradient-primary h-full overflow-y-auto`}>
|
||||
<div className={`bg-onboarding-gradient-primary h-full overflow-y-auto`}>
|
||||
<div className="sm:py-5 pl-8 pb-4 sm:pl-16 lg:pl-28 ">
|
||||
<div className="flex text-3xl items-center mt-16 font-semibold">
|
||||
<div className="h-[30px] w-[30px] mr-2">
|
||||
@ -196,7 +196,7 @@ export const SignInView = observer(() => {
|
||||
|
||||
<div className="md:w-2/3 sm:w-4/5 rounded-md mx-auto shadow-sm border border-custom-border-200">
|
||||
<div className={`p-4`}>
|
||||
<div className={`px-7 sm:px-0 bg-gradient-secondary h-full pt-32 pb-20 rounded-md`}>
|
||||
<div className={`px-7 sm:px-0 bg-onboarding-gradient-secondary h-full pt-32 pb-20 rounded-md`}>
|
||||
{!envConfig ? (
|
||||
<div className="pt-10 mx-auto flex justify-center">
|
||||
<div>
|
||||
|
@ -49,7 +49,9 @@ export const RecentPagesList: React.FC<TPagesListProps> = observer((props) => {
|
||||
|
||||
return (
|
||||
<div key={key} className="h-full overflow-hidden pb-9">
|
||||
<h2 className="text-xl font-semibold capitalize mb-2">{replaceUnderscoreIfSnakeCase(key)}</h2>
|
||||
<h2 className="text-xl font-semibold capitalize mb-2">
|
||||
{replaceUnderscoreIfSnakeCase(key)}
|
||||
</h2>
|
||||
<PagesView pages={pages[key as keyof RecentPagesResponse]} viewType={viewType} />
|
||||
</div>
|
||||
);
|
||||
|
@ -55,7 +55,7 @@ export interface ICreateProjectForm {
|
||||
description: string;
|
||||
emoji_and_icon: string;
|
||||
network: number;
|
||||
project_lead_member: IWorkspaceMember;
|
||||
project_lead_member: string;
|
||||
project_lead: string;
|
||||
cover_image: string;
|
||||
icon_prop: any;
|
||||
@ -126,7 +126,7 @@ export const CreateProjectModal: FC<Props> = observer((props) => {
|
||||
if (typeof formData.emoji_and_icon === "object") payload.icon_prop = formData.emoji_and_icon;
|
||||
else payload.emoji = formData.emoji_and_icon;
|
||||
|
||||
payload.project_lead = formData.project_lead_member?.member.id;
|
||||
payload.project_lead = formData.project_lead_member;
|
||||
|
||||
return projectStore
|
||||
.createProject(workspaceSlug.toString(), payload)
|
||||
@ -380,7 +380,7 @@ export const CreateProjectModal: FC<Props> = observer((props) => {
|
||||
control={control}
|
||||
render={({ field: { value, onChange } }) => (
|
||||
<WorkspaceMemberSelect
|
||||
value={value}
|
||||
value={workspaceMembers?.filter((member: IWorkspaceMember) => member.member.id ===value)[0]}
|
||||
onChange={onChange}
|
||||
options={workspaceMembers || []}
|
||||
placeholder="Select Lead"
|
||||
|
@ -11,7 +11,7 @@ import { IWorkspaceMember } from "types";
|
||||
|
||||
export interface IWorkspaceMemberSelect {
|
||||
value: IWorkspaceMember | undefined;
|
||||
onChange: (value: IWorkspaceMember) => void;
|
||||
onChange: (value: string) => void;
|
||||
options: IWorkspaceMember[];
|
||||
placeholder?: string;
|
||||
disabled?: boolean;
|
||||
@ -48,7 +48,7 @@ export const WorkspaceMemberSelect: FC<IWorkspaceMemberSelect> = (props) => {
|
||||
: options?.filter((option) => option.member.display_name.toLowerCase().includes(query.toLowerCase()));
|
||||
|
||||
const label = (
|
||||
<div className="flex items-center justify-between gap-2 w-full text-xs px-2.5 py-1.5 rounded border-[0.5px] border-custom-border-300">
|
||||
<div className="flex items-center justify-between gap-2 w-full text-xs text-custom-text-300 px-2.5 py-1.5 rounded border-[0.5px] border-custom-border-300">
|
||||
{value ? (
|
||||
<>
|
||||
<Avatar name={value?.member.display_name} src={value?.member.avatar} />
|
||||
@ -64,7 +64,13 @@ export const WorkspaceMemberSelect: FC<IWorkspaceMemberSelect> = (props) => {
|
||||
);
|
||||
|
||||
return (
|
||||
<Listbox as="div" className={`flex-shrink-0 text-left`} value={value} onChange={onChange} disabled={disabled}>
|
||||
<Listbox
|
||||
as="div"
|
||||
className={`flex-shrink-0 text-left`}
|
||||
value={value?.member.id}
|
||||
onChange={onChange}
|
||||
disabled={disabled}
|
||||
>
|
||||
<Listbox.Button as={React.Fragment}>
|
||||
<button
|
||||
ref={setReferenceElement}
|
||||
@ -99,20 +105,20 @@ export const WorkspaceMemberSelect: FC<IWorkspaceMemberSelect> = (props) => {
|
||||
{filteredOptions.map((workspaceMember: IWorkspaceMember) => (
|
||||
<Listbox.Option
|
||||
key={workspaceMember.id}
|
||||
value={workspaceMember}
|
||||
value={workspaceMember.member.id}
|
||||
className={({ active, selected }) =>
|
||||
`flex items-center justify-between gap-2 cursor-pointer select-none truncate rounded px-1 py-1.5 ${
|
||||
active && !selected ? "bg-custom-background-80" : ""
|
||||
} ${selected ? "text-custom-text-100" : "text-custom-text-200"}`
|
||||
}
|
||||
>
|
||||
{({ selected }) => (
|
||||
{() => (
|
||||
<>
|
||||
<div className="flex items-center gap-2">
|
||||
<Avatar name={workspaceMember?.member.display_name} src={workspaceMember?.member.avatar} />
|
||||
{workspaceMember.member.display_name}
|
||||
</div>
|
||||
{selected && <Check className="h-3.5 w-3.5" />}
|
||||
{value && value.member.id === workspaceMember.member.id && <Check className="h-3.5 w-3.5" />}
|
||||
</>
|
||||
)}
|
||||
</Listbox.Option>
|
||||
|
@ -154,7 +154,7 @@ const ProfileActivityPage: NextPageWithLayout = () => {
|
||||
</div>
|
||||
</div>
|
||||
<div className="min-w-0 flex-1 py-4 border-b border-custom-border-100">
|
||||
<div className="text-sm text-custom-text-200 break-words">
|
||||
<div className="text-sm text-custom-text-200 break-words flex gap-1">
|
||||
{activityItem.field === "archived_at" && activityItem.new_value !== "restore" ? (
|
||||
<span className="text-gray font-medium">Plane</span>
|
||||
) : activityItem.actor_detail.is_bot ? (
|
||||
@ -166,7 +166,12 @@ const ProfileActivityPage: NextPageWithLayout = () => {
|
||||
<a className="text-gray font-medium">{activityItem.actor_detail.display_name}</a>
|
||||
</Link>
|
||||
)}{" "}
|
||||
{message} <span className="whitespace-nowrap">{timeAgo(activityItem.created_at)}</span>
|
||||
<div className="flex gap-1 truncate">
|
||||
{message}{" "}
|
||||
<span className="whitespace-nowrap flex-shrink-0">
|
||||
{timeAgo(activityItem.created_at)}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
|
@ -108,7 +108,7 @@ const OnboardingPage: NextPageWithLayout = observer(() => {
|
||||
}}
|
||||
/>
|
||||
{user && step !== null ? (
|
||||
<div className={` bg-gradient-primary h-full overflow-y-auto`}>
|
||||
<div className={` bg-onboarding-gradient-primary h-full overflow-y-auto`}>
|
||||
<div className="sm:py-14 py-10 px-4 sm:px-7 md:px-14 lg:pl-28 lg:pr-24 flex items-center">
|
||||
<div className="w-full flex items-center justify-between font-semibold ">
|
||||
<div className="text-3xl flex items-center gap-x-1">
|
||||
@ -165,8 +165,8 @@ const OnboardingPage: NextPageWithLayout = observer(() => {
|
||||
</div>
|
||||
</div>
|
||||
<div className="w-full lg:w-4/5 xl:w-3/4 sm:w-4/5 rounded-md mx-auto shadow-sm border border-custom-border-200">
|
||||
<div className={`bg-gradient-primary p-4`}>
|
||||
<div className={`bg-gradient-secondary h-full rounded-md`}>
|
||||
<div className={`bg-onboarding-gradient-primary p-4`}>
|
||||
<div className={`bg-onboarding-gradient-secondary h-full rounded-md`}>
|
||||
{step === 1 ? (
|
||||
<JoinWorkspaces
|
||||
setTryDiffAccount={() => {
|
||||
|
@ -184,4 +184,13 @@ export class UserService extends APIService {
|
||||
throw error?.response?.data;
|
||||
});
|
||||
}
|
||||
|
||||
async deleteAccount(): Promise<void> {
|
||||
return this.delete("/api/users/me/")
|
||||
.then((response) => response?.data)
|
||||
.catch((error) => {
|
||||
throw error?.response;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ export class WorkspaceService extends APIService {
|
||||
}
|
||||
|
||||
async inviteWorkspace(workspaceSlug: string, data: IWorkspaceBulkInviteFormData): Promise<any> {
|
||||
return this.post(`/api/workspaces/${workspaceSlug}/invite/`, data)
|
||||
return this.post(`/api/workspaces/${workspaceSlug}/invitations/`, data)
|
||||
.then((response) => response?.data)
|
||||
.catch((error) => {
|
||||
throw error?.response?.data;
|
||||
|
1
web/types/users.d.ts
vendored
1
web/types/users.d.ts
vendored
@ -27,6 +27,7 @@ export interface IUser {
|
||||
user_timezone: string;
|
||||
username: string;
|
||||
theme: IUserTheme;
|
||||
use_case? :string;
|
||||
}
|
||||
|
||||
export interface IInstanceAdminStatus {
|
||||
|
Loading…
Reference in New Issue
Block a user