refactor: move web utils to packages (#7145)
* refactor: move web utils to packages * fix: build and lint errors * chore: update drag handle plugin * chore: update table cell type to fix build errors * fix: build errors * chore: sync few changes * fix: build errors * chore: minor fixes related to duplicate assets imports * fix: build errors * chore: minor changes
This commit is contained in:
parent
dffcc6dc10
commit
2014400bed
614 changed files with 1999 additions and 3030 deletions
|
|
@ -1,9 +1,8 @@
|
|||
import { observer } from "mobx-react";
|
||||
// plane imports
|
||||
import { useTranslation } from "@plane/i18n";
|
||||
import { cn } from "@plane/utils";
|
||||
// helpers
|
||||
import { getFileURL } from "@/helpers/file.helper";
|
||||
import { cn, getFileURL } from "@plane/utils";
|
||||
|
||||
|
||||
type Props = {
|
||||
logo: string | null | undefined;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import { IUser, IWorkspaceMember } from "@plane/types";
|
|||
import { CustomSelect, PopoverMenu, TOAST_TYPE, setToast } from "@plane/ui";
|
||||
// constants
|
||||
// helpers
|
||||
import { getFileURL } from "@/helpers/file.helper";
|
||||
import { getFileURL } from "@plane/utils";
|
||||
// hooks
|
||||
import { useMember, useUser, useUserPermissions } from "@/hooks/store";
|
||||
// plane web constants
|
||||
|
|
|
|||
|
|
@ -9,12 +9,11 @@ import { ORGANIZATION_SIZE, WORKSPACE_UPDATED, EUserPermissions, EUserPermission
|
|||
import { useTranslation } from "@plane/i18n";
|
||||
import { IWorkspace } from "@plane/types";
|
||||
import { Button, CustomSelect, Input, TOAST_TYPE, setToast } from "@plane/ui";
|
||||
import { copyUrlToClipboard } from "@plane/utils";
|
||||
import { copyUrlToClipboard, getFileURL } from "@plane/utils";
|
||||
// components
|
||||
import { LogoSpinner } from "@/components/common";
|
||||
import { WorkspaceImageUploadModal } from "@/components/core";
|
||||
// helpers
|
||||
import { getFileURL } from "@/helpers/file.helper";
|
||||
// hooks
|
||||
import { useEventTracker, useUserPermissions, useWorkspace } from "@/hooks/store";
|
||||
// plane web components
|
||||
|
|
|
|||
|
|
@ -8,9 +8,8 @@ import { Menu } from "@headlessui/react";
|
|||
import { EUserPermissions } from "@plane/constants";
|
||||
import { useTranslation } from "@plane/i18n";
|
||||
import { IWorkspace } from "@plane/types";
|
||||
import { cn, getFileURL } from "@plane/utils";
|
||||
import { cn, getFileURL, getUserRole } from "@plane/utils";
|
||||
// helpers
|
||||
import { getUserRole } from "@/helpers/user.helper";
|
||||
// plane web imports
|
||||
import { SubscriptionPill } from "@/plane-web/components/common/subscription";
|
||||
|
||||
|
|
|
|||
|
|
@ -10,13 +10,12 @@ import { ChevronDown, CirclePlus, LogOut, Mails, Settings } from "lucide-react";
|
|||
// ui
|
||||
import { Menu, Transition } from "@headlessui/react";
|
||||
// plane imports
|
||||
import { GOD_MODE_URL } from "@plane/constants";
|
||||
import { useTranslation } from "@plane/i18n";
|
||||
import { IWorkspace } from "@plane/types";
|
||||
import { Avatar, Loader, TOAST_TYPE, setToast } from "@plane/ui";
|
||||
import { orderWorkspacesList } from "@plane/utils";
|
||||
import { orderWorkspacesList, cn, getFileURL } from "@plane/utils";
|
||||
// helpers
|
||||
import { GOD_MODE_URL, cn } from "@/helpers/common.helper";
|
||||
import { getFileURL } from "@/helpers/file.helper";
|
||||
// hooks
|
||||
import { useAppTheme, useUser, useUserProfile, useWorkspace } from "@/hooks/store";
|
||||
// plane web helpers
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import { useTranslation } from "@plane/i18n";
|
|||
import { IFavorite, InstructionType } from "@plane/types";
|
||||
import { CustomMenu, Tooltip, DropIndicator, FavoriteFolderIcon, DragHandle } from "@plane/ui";
|
||||
// helpers
|
||||
import { cn } from "@/helpers/common.helper";
|
||||
import { cn } from "@plane/utils";
|
||||
// hooks
|
||||
import { useAppTheme } from "@/hooks/store";
|
||||
import { useFavorite } from "@/hooks/store/use-favorite";
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { observer } from "mobx-react";
|
|||
// ui
|
||||
import { DragHandle, Tooltip } from "@plane/ui";
|
||||
// helper
|
||||
import { cn } from "@/helpers/common.helper";
|
||||
import { cn } from "@plane/utils";
|
||||
// hooks
|
||||
import { usePlatformOS } from "@/hooks/use-platform-os";
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import { useTranslation } from "@plane/i18n";
|
|||
import { IFavorite } from "@plane/types";
|
||||
import { CustomMenu } from "@plane/ui";
|
||||
// helpers
|
||||
import { cn } from "@/helpers/common.helper";
|
||||
import { cn } from "@plane/utils";
|
||||
|
||||
type Props = {
|
||||
ref: React.MutableRefObject<HTMLDivElement | null>;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
"use client";
|
||||
import React, { FC } from "react";
|
||||
// helpers
|
||||
import { cn } from "@/helpers/common.helper";
|
||||
import { cn } from "@plane/utils";
|
||||
|
||||
type Props = {
|
||||
children: React.ReactNode;
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import { setToast, TOAST_TYPE, Tooltip } from "@plane/ui";
|
|||
// constants
|
||||
|
||||
// helpers
|
||||
import { cn } from "@/helpers/common.helper";
|
||||
import { cn } from "@plane/utils";
|
||||
// hooks
|
||||
import { useAppTheme } from "@/hooks/store";
|
||||
import { useFavorite } from "@/hooks/store/use-favorite";
|
||||
|
|
|
|||
|
|
@ -8,9 +8,9 @@ import { useTranslation } from "@plane/i18n";
|
|||
// ui
|
||||
import { CustomMenu, Tooltip, ToggleSwitch } from "@plane/ui";
|
||||
// components
|
||||
import { cn } from "@plane/utils";
|
||||
import { ProductUpdatesModal } from "@/components/global";
|
||||
// helpers
|
||||
import { cn } from "@/helpers/common.helper";
|
||||
// hooks
|
||||
import { useAppTheme, useCommandPalette, useInstance, useTransient, useUserSettings } from "@/hooks/store";
|
||||
import { usePlatformOS } from "@/hooks/use-platform-os";
|
||||
|
|
|
|||
|
|
@ -19,10 +19,10 @@ import { useTranslation } from "@plane/i18n";
|
|||
// ui
|
||||
import { CustomMenu, Tooltip, ArchiveIcon, DropIndicator, DragHandle, ControlLink } from "@plane/ui";
|
||||
// components
|
||||
import { Logo } from "@/components/common";
|
||||
import { cn } from "@plane/utils";
|
||||
import { Logo } from "@/components/common/logo";
|
||||
import { LeaveProjectModal, PublishProjectModal } from "@/components/project";
|
||||
// helpers
|
||||
import { cn } from "@/helpers/common.helper";
|
||||
// hooks
|
||||
import { useAppTheme, useCommandPalette, useEventTracker, useProject, useUserPermissions } from "@/hooks/store";
|
||||
import { usePlatformOS } from "@/hooks/use-platform-os";
|
||||
|
|
|
|||
|
|
@ -11,13 +11,11 @@ import { EUserPermissions, EUserPermissionsLevel } from "@plane/constants";
|
|||
import { useTranslation } from "@plane/i18n";
|
||||
// ui
|
||||
import { Loader, TOAST_TYPE, Tooltip, setToast } from "@plane/ui";
|
||||
import { copyUrlToClipboard } from "@plane/utils";
|
||||
import { copyUrlToClipboard, cn, orderJoinedProjects } from "@plane/utils";
|
||||
// components
|
||||
import { CreateProjectModal } from "@/components/project";
|
||||
import { SidebarProjectsListItem } from "@/components/workspace";
|
||||
// helpers
|
||||
import { cn } from "@/helpers/common.helper";
|
||||
import { orderJoinedProjects } from "@/helpers/project.helper";
|
||||
// hooks
|
||||
import { useAppTheme, useCommandPalette, useEventTracker, useProject, useUserPermissions } from "@/hooks/store";
|
||||
// plane web types
|
||||
|
|
|
|||
|
|
@ -7,10 +7,10 @@ import { useTranslation } from "@plane/i18n";
|
|||
// types
|
||||
import { TIssue } from "@plane/types";
|
||||
// components
|
||||
import { cn } from "@plane/utils";
|
||||
import { CreateUpdateIssueModal } from "@/components/issues";
|
||||
// constants
|
||||
// helpers
|
||||
import { cn } from "@/helpers/common.helper";
|
||||
// hooks
|
||||
import { useAppTheme, useCommandPalette, useEventTracker, useProject, useUserPermissions } from "@/hooks/store";
|
||||
import useLocalStorage from "@/hooks/use-local-storage";
|
||||
|
|
|
|||
|
|
@ -8,9 +8,9 @@ import { Home, Inbox, PenSquare } from "lucide-react";
|
|||
import { EUserWorkspaceRoles } from "@plane/constants";
|
||||
import { UserActivityIcon } from "@plane/ui";
|
||||
// components
|
||||
import { cn } from "@plane/utils";
|
||||
import { SidebarUserMenuItem } from "@/components/workspace/sidebar";
|
||||
// helpers
|
||||
import { cn } from "@/helpers/common.helper";
|
||||
// hooks
|
||||
import { useAppTheme, useUserPermissions, useUser } from "@/hooks/store";
|
||||
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@ import { Disclosure, Transition } from "@headlessui/react";
|
|||
import { EUserWorkspaceRoles } from "@plane/constants";
|
||||
import { ContrastIcon } from "@plane/ui";
|
||||
// components
|
||||
import { cn } from "@plane/utils";
|
||||
import { SidebarWorkspaceMenuHeader, SidebarWorkspaceMenuItem } from "@/components/workspace/sidebar";
|
||||
// helpers
|
||||
import { cn } from "@/helpers/common.helper";
|
||||
// hooks
|
||||
import { useAppTheme } from "@/hooks/store";
|
||||
import useLocalStorage from "@/hooks/use-local-storage";
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import Link from "next/link";
|
|||
import { useParams } from "next/navigation";
|
||||
import { useTranslation } from "@plane/i18n";
|
||||
// helpers
|
||||
import { truncateText } from "@/helpers/string.helper";
|
||||
import { truncateText } from "@plane/utils";
|
||||
|
||||
type Props = { view: { key: string; i18n_label: string } };
|
||||
|
||||
|
|
|
|||
|
|
@ -8,10 +8,8 @@ import { useTranslation } from "@plane/i18n";
|
|||
// ui
|
||||
import { TStaticViewTypes } from "@plane/types";
|
||||
import { ContextMenu, CustomMenu, TContextMenuItem, TOAST_TYPE, setToast } from "@plane/ui";
|
||||
import { copyUrlToClipboard } from "@plane/utils";
|
||||
import { copyUrlToClipboard, cn } from "@plane/utils";
|
||||
// helpers
|
||||
import { cn } from "@/helpers/common.helper";
|
||||
|
||||
type Props = {
|
||||
parentRef: React.RefObject<HTMLElement>;
|
||||
workspaceSlug: string;
|
||||
|
|
|
|||
|
|
@ -12,9 +12,9 @@ import { IIssueDisplayFilterOptions, IIssueDisplayProperties, IIssueFilterOption
|
|||
// ui
|
||||
import { Button, Input, TextArea } from "@plane/ui";
|
||||
// components
|
||||
import { getComputedDisplayFilters, getComputedDisplayProperties } from "@plane/utils";
|
||||
import { AppliedFiltersList, DisplayFiltersSelection, FilterSelection, FiltersDropdown } from "@/components/issues";
|
||||
// helpers
|
||||
import { getComputedDisplayFilters, getComputedDisplayProperties } from "@/helpers/issue.helper";
|
||||
// hooks
|
||||
import { useLabel, useMember } from "@/hooks/store";
|
||||
import { AccessController } from "@/plane-web/components/views/access-controller";
|
||||
|
|
|
|||
|
|
@ -9,13 +9,11 @@ import { EViewAccess, EUserPermissions, EUserPermissionsLevel } from "@plane/con
|
|||
import { useTranslation } from "@plane/i18n";
|
||||
import { IWorkspaceView } from "@plane/types";
|
||||
import { ContextMenu, TContextMenuItem, TOAST_TYPE, setToast } from "@plane/ui";
|
||||
import { copyUrlToClipboard } from "@plane/utils";
|
||||
import { copyUrlToClipboard, cn } from "@plane/utils";
|
||||
// components
|
||||
import { CreateUpdateWorkspaceViewModal, DeleteGlobalViewModal } from "@/components/workspace";
|
||||
// constants
|
||||
// helpers
|
||||
import { cn } from "@/helpers/common.helper";
|
||||
import {} from "@/helpers/string.helper";
|
||||
// hooks
|
||||
import { useUser, useUserPermissions } from "@/hooks/store";
|
||||
|
||||
|
|
|
|||
|
|
@ -8,11 +8,10 @@ import { useParams } from "next/navigation";
|
|||
import { Pencil, Trash2 } from "lucide-react";
|
||||
// ui
|
||||
import { CustomMenu } from "@plane/ui";
|
||||
import { calculateTotalFilters, truncateText } from "@plane/utils";
|
||||
// components
|
||||
import { CreateUpdateWorkspaceViewModal, DeleteGlobalViewModal } from "@/components/workspace";
|
||||
// helpers
|
||||
import { calculateTotalFilters } from "@/helpers/filter.helper";
|
||||
import { truncateText } from "@/helpers/string.helper";
|
||||
// store hooks
|
||||
import { useEventTracker, useGlobalView } from "@/hooks/store";
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue