fix: removed unused packages and upgraded to next 14 (#2944)

* fix: upgrading next package and removed unused deps

* chore: unused variable removed

* chore: next image icon fix

* chore: unused component removed

* chore: next image icon fix

* chore: replace use-debounce with lodash debounce

* chore: unused component removed

* resolved: fixed issue with next link component

* fix: updates in next config

* fix: updating types pages

---------

Co-authored-by: Anmol Singh Bhatia <anmolsinghbhatia@plane.so>
This commit is contained in:
sriram veeraghanta 2023-11-29 20:32:10 +05:30
parent 804313413b
commit ee30eb0590
137 changed files with 469 additions and 1524 deletions

View file

@ -14,8 +14,6 @@ import { Button, CustomSelect, Input } from "@plane/ui";
import { IWorkspace } from "types";
// constants
import { ORGANIZATION_SIZE, RESTRICTED_URLS } from "constants/workspace";
// events
import { trackEvent } from "helpers/event-tracker.helper";
type Props = {
onSubmit?: (res: IWorkspace) => Promise<void>;

View file

@ -29,7 +29,10 @@ export const DeleteWorkspaceModal: React.FC<Props> = observer((props) => {
const router = useRouter();
const { workspace: workspaceStore, trackEvent: { postHogEventTracker } } = useMobxStore();
const {
workspace: workspaceStore,
trackEvent: { postHogEventTracker },
} = useMobxStore();
const { setToastAlert } = useToast();
@ -60,37 +63,26 @@ export const DeleteWorkspaceModal: React.FC<Props> = observer((props) => {
.then((res) => {
handleClose();
router.push("/");
const payload = {
slug: data.slug
};
postHogEventTracker(
'WORKSPACE_DELETE',
{
res,
state: "SUCCESS"
}
);
postHogEventTracker("WORKSPACE_DELETE", {
res,
state: "SUCCESS",
});
setToastAlert({
type: "success",
title: "Success!",
message: "Workspace deleted successfully.",
});
})
.catch(() =>
{
.catch(() => {
setToastAlert({
type: "error",
title: "Error!",
message: "Something went wrong. Please try again later.",
})
postHogEventTracker(
'WORKSPACE_DELETE',
{
state: "FAILED"
}
);
}
);
});
postHogEventTracker("WORKSPACE_DELETE", {
state: "FAILED",
});
});
};
return (

View file

@ -124,16 +124,13 @@ export const WorkspaceHelpSection: React.FC<WorkspaceHelpSectionProps> = observe
{helpOptions.map(({ name, Icon, href, onClick }) => {
if (href)
return (
<Link href={href} key={name}>
<a
target="_blank"
className="flex items-center gap-x-2 rounded px-2 py-1 text-xs hover:bg-custom-background-80"
>
<Link href={href} key={name} target="_blank">
<span className="flex items-center gap-x-2 rounded px-2 py-1 text-xs hover:bg-custom-background-80">
<div className="grid place-items-center flex-shrink-0">
<Icon className="text-custom-text-200 h-3.5 w-3.5" size={14} />
</div>
<span className="text-xs">{name}</span>
</a>
</span>
</Link>
);
else

View file

@ -55,7 +55,7 @@ export const IssuesList: React.FC<Props> = ({ issues, type }) => {
return (
<Link href={`/${workspaceSlug}/projects/${issue.project_id}/issues/${issue.id}`} key={issue.id}>
<a>
<span>
<div className="grid grid-cols-4 gap-2 px-3 py-2">
<h5
className={`flex cursor-default items-center gap-2 ${
@ -70,7 +70,7 @@ export const IssuesList: React.FC<Props> = ({ issues, type }) => {
{renderShortDateWithYearFormat(new Date(date?.toString() ?? ""))}
</h5>
</div>
</a>
</span>
</Link>
);
})

View file

@ -138,27 +138,27 @@ export const WorkspaceMembersListItem: FC<Props> = observer((props) => {
<div className="flex items-center gap-x-4 gap-y-2">
{member.avatar && member.avatar !== "" ? (
<Link href={`/${workspaceSlug}/profile/${member.memberId}`}>
<a className="relative flex h-10 w-10 items-center justify-center rounded p-4 capitalize text-white">
<span className="relative flex h-10 w-10 items-center justify-center rounded p-4 capitalize text-white">
<img
src={member.avatar}
className="absolute top-0 left-0 h-full w-full object-cover rounded"
alt={member.display_name || member.email}
/>
</a>
</span>
</Link>
) : (
<Link href={`/${workspaceSlug}/profile/${member.memberId}`}>
<a className="relative flex h-10 w-10 items-center justify-center rounded p-4 capitalize bg-gray-700 text-white">
<span className="relative flex h-10 w-10 items-center justify-center rounded p-4 capitalize bg-gray-700 text-white">
{(member.email ?? member.display_name ?? "?")[0]}
</a>
</span>
</Link>
)}
<div>
{member.member ? (
<Link href={`/${workspaceSlug}/profile/${member.memberId}`}>
<a className="text-sm font-medium">
<span className="text-sm font-medium">
{member.first_name} {member.last_name}
</a>
</span>
</Link>
) : (
<h4 className="text-sm cursor-default">{member.display_name || member.email}</h4>

View file

@ -281,10 +281,10 @@ export const WorkspaceSidebarDropdown = observer(() => {
{profileLinks(workspaceSlug?.toString() ?? "", currentUser?.id ?? "").map((link, index) => (
<Menu.Item key={index} as="button" type="button">
<Link href={link.link}>
<a className="flex w-full items-center gap-2 rounded px-2 py-1 hover:bg-custom-sidebar-background-80">
<span className="flex w-full items-center gap-2 rounded px-2 py-1 hover:bg-custom-sidebar-background-80">
<link.icon className="h-4 w-4 stroke-[1.5]" />
{link.name}
</a>
</span>
</Link>
</Menu.Item>
))}
@ -304,9 +304,9 @@ export const WorkspaceSidebarDropdown = observer(() => {
<div className="p-2 pb-0">
<Menu.Item as="button" type="button" className="w-full">
<Link href="/god-mode">
<a className="flex w-full items-center justify-center rounded px-2 py-1 text-sm font-medium text-custom-primary-100 hover:text-custom-primary-200 bg-custom-primary-100/20 hover:bg-custom-primary-100/30">
<span className="flex w-full items-center justify-center rounded px-2 py-1 text-sm font-medium text-custom-primary-100 hover:text-custom-primary-200 bg-custom-primary-100/20 hover:bg-custom-primary-100/30">
Enter God Mode
</a>
</span>
</Link>
</Menu.Item>
</div>

View file

@ -46,7 +46,7 @@ export const WorkspaceSidebarMenu = observer(() => {
return (
<Link key={index} href={link.href}>
<a className="block w-full">
<span className="block w-full">
<Tooltip
tooltipContent={link.name}
position="right"
@ -64,7 +64,7 @@ export const WorkspaceSidebarMenu = observer(() => {
{!themeStore?.sidebarCollapsed && link.name}
</div>
</Tooltip>
</a>
</span>
</Link>
);
})}

View file

@ -18,7 +18,7 @@ export const GlobalDefaultViewListItem: React.FC<Props> = observer((props) => {
return (
<div className="group hover:bg-custom-background-90 border-b border-custom-border-200">
<Link href={`/${workspaceSlug}/workspace-views/${view.key}`}>
<a className="flex items-center justify-between relative rounded px-5 py-4 w-full">
<span className="flex items-center justify-between relative rounded px-5 py-4 w-full">
<div className="flex items-center justify-between w-full">
<div className="flex items-center gap-4">
<div className="grid place-items-center h-10 w-10 rounded bg-custom-background-90 group-hover:bg-custom-background-100">
@ -29,7 +29,7 @@ export const GlobalDefaultViewListItem: React.FC<Props> = observer((props) => {
</div>
</div>
</div>
</a>
</span>
</Link>
</div>
);

View file

@ -42,7 +42,7 @@ export const GlobalViewsHeader: React.FC = observer(() => {
<div className="group flex items-center px-4 w-full overflow-x-scroll relative border-b border-custom-border-200">
{DEFAULT_GLOBAL_VIEWS_LIST.map((tab) => (
<Link key={tab.key} href={`/${workspaceSlug}/workspace-views/${tab.key}`}>
<a
<span
className={`border-b-2 min-w-min p-3 text-sm font-medium outline-none whitespace-nowrap flex-shrink-0 ${
isTabSelected(tab.key)
? "border-custom-primary-100 text-custom-primary-100"
@ -50,13 +50,13 @@ export const GlobalViewsHeader: React.FC = observer(() => {
}`}
>
{tab.label}
</a>
</span>
</Link>
))}
{globalViewsStore.globalViewsList?.map((view) => (
<Link key={view.id} href={`/${workspaceSlug}/workspace-views/${view.id}`}>
<a
<span
id={`global-view-${view.id}`}
className={`border-b-2 p-3 text-sm font-medium outline-none whitespace-nowrap flex-shrink-0 ${
view.id === globalViewId
@ -65,7 +65,7 @@ export const GlobalViewsHeader: React.FC = observer(() => {
}`}
>
{view.name}
</a>
</span>
</Link>
))}

View file

@ -32,7 +32,7 @@ export const GlobalViewListItem: React.FC<Props> = observer((props) => {
<DeleteGlobalViewModal data={view} isOpen={deleteViewModal} onClose={() => setDeleteViewModal(false)} />
<div className="group hover:bg-custom-background-90 border-b border-custom-border-200">
<Link href={`/${workspaceSlug}/workspace-views/${view.id}`}>
<a className="flex items-center justify-between relative rounded p-4 w-full">
<span className="flex items-center justify-between relative rounded p-4 w-full">
<div className="flex items-center justify-between w-full">
<div className="flex items-center gap-4">
<div className="grid place-items-center h-10 w-10 rounded bg-custom-background-90 group-hover:bg-custom-background-100">
@ -77,7 +77,7 @@ export const GlobalViewListItem: React.FC<Props> = observer((props) => {
</div>
</div>
</div>
</a>
</span>
</Link>
</div>
</>