diff --git a/packages/utils/src/string.ts b/packages/utils/src/string.ts index 1ad761f97..19840df4d 100644 --- a/packages/utils/src/string.ts +++ b/packages/utils/src/string.ts @@ -55,13 +55,6 @@ export const createSimilarString = (str: string) => { return shuffled; }; -/** - * @description Copies full URL (origin + path) to clipboard - * @param {string} path - URL path to copy - * @returns {Promise} Promise that resolves when copying is complete - * @example - * await copyUrlToClipboard("issues/123") // copies "https://example.com/issues/123" - */ /** * @description Copies text to clipboard * @param {string} text - Text to copy diff --git a/web/app/[workspaceSlug]/(projects)/extended-project-sidebar.tsx b/web/app/[workspaceSlug]/(projects)/extended-project-sidebar.tsx index c79a63237..b96f008ab 100644 --- a/web/app/[workspaceSlug]/(projects)/extended-project-sidebar.tsx +++ b/web/app/[workspaceSlug]/(projects)/extended-project-sidebar.tsx @@ -8,13 +8,12 @@ import { Plus, Search } from "lucide-react"; import { EUserPermissions, EUserPermissionsLevel } from "@plane/constants"; import { useTranslation } from "@plane/i18n"; import { setToast, TOAST_TYPE, Tooltip } from "@plane/ui"; -import { cn } from "@plane/utils"; +import { cn, copyUrlToClipboard } from "@plane/utils"; // components import { CreateProjectModal } from "@/components/project"; import { SidebarProjectsListItem } from "@/components/workspace"; // hooks import { orderJoinedProjects } from "@/helpers/project.helper"; -import { copyUrlToClipboard } from "@/helpers/string.helper"; import { useAppTheme, useProject, useUserPermissions } from "@/hooks/store"; import useExtendedSidebarOutsideClickDetector from "@/hooks/use-extended-sidebar-overview-outside-click"; import { TProject } from "@/plane-web/types"; diff --git a/web/core/components/cycles/analytics-sidebar/sidebar-header.tsx b/web/core/components/cycles/analytics-sidebar/sidebar-header.tsx index 462ad2123..6a89c69dd 100644 --- a/web/core/components/cycles/analytics-sidebar/sidebar-header.tsx +++ b/web/core/components/cycles/analytics-sidebar/sidebar-header.tsx @@ -12,17 +12,16 @@ import { LinkIcon, Trash2, } from "lucide-react"; -// types +// Plane Imports import { CYCLE_STATUS, CYCLE_UPDATED, EUserPermissions, EUserPermissionsLevel } from "@plane/constants"; import { useTranslation } from "@plane/i18n"; import { ICycle } from "@plane/types"; -// ui import { CustomMenu, setToast, TOAST_TYPE } from "@plane/ui"; +import { copyUrlToClipboard } from "@plane/utils"; // components import { DateRangeDropdown } from "@/components/dropdowns"; // helpers import { renderFormattedPayloadDate, getDate } from "@/helpers/date-time.helper"; -import { copyUrlToClipboard } from "@/helpers/string.helper"; // hooks import { useCycle, useEventTracker, useUserPermissions } from "@/hooks/store"; import { useAppRouter } from "@/hooks/use-app-router"; diff --git a/web/core/components/cycles/quick-actions.tsx b/web/core/components/cycles/quick-actions.tsx index ff69d447d..add7277bc 100644 --- a/web/core/components/cycles/quick-actions.tsx +++ b/web/core/components/cycles/quick-actions.tsx @@ -9,11 +9,11 @@ import { ArchiveRestoreIcon, ExternalLink, LinkIcon, Pencil, Trash2 } from "luci import { EUserPermissions, EUserPermissionsLevel } from "@plane/constants"; import { useTranslation } from "@plane/i18n"; import { ArchiveIcon, ContextMenu, CustomMenu, TContextMenuItem, TOAST_TYPE, setToast } from "@plane/ui"; +import { copyUrlToClipboard } from "@plane/utils"; // components import { ArchiveCycleModal, CycleCreateUpdateModal, CycleDeleteModal } from "@/components/cycles"; // helpers import { cn } from "@/helpers/common.helper"; -import { copyUrlToClipboard } from "@/helpers/string.helper"; // hooks import { useCycle, useEventTracker, useUserPermissions } from "@/hooks/store"; import { useAppRouter } from "@/hooks/use-app-router"; diff --git a/web/core/components/inbox/content/inbox-issue-header.tsx b/web/core/components/inbox/content/inbox-issue-header.tsx index 1259b21ef..c86529d6d 100644 --- a/web/core/components/inbox/content/inbox-issue-header.tsx +++ b/web/core/components/inbox/content/inbox-issue-header.tsx @@ -19,6 +19,7 @@ import { EUserPermissions, EUserPermissionsLevel } from "@plane/constants"; import { useTranslation } from "@plane/i18n"; import { TNameDescriptionLoader } from "@plane/types"; import { Button, ControlLink, CustomMenu, Row, TOAST_TYPE, setToast } from "@plane/ui"; +import { copyUrlToClipboard } from "@plane/utils"; // components import { DeclineIssueModal, @@ -33,7 +34,6 @@ import { CreateUpdateIssueModal, NameDescriptionUpdateStatus } from "@/component import { findHowManyDaysLeft } from "@/helpers/date-time.helper"; import { EInboxIssueStatus } from "@/helpers/inbox.helper"; import { generateWorkItemLink } from "@/helpers/issue.helper"; -import { copyUrlToClipboard } from "@/helpers/string.helper"; // hooks import { useUser, useProjectInbox, useProject, useUserPermissions } from "@/hooks/store"; import { useAppRouter } from "@/hooks/use-app-router"; diff --git a/web/core/components/issues/issue-layouts/quick-action-dropdowns/archived-issue.tsx b/web/core/components/issues/issue-layouts/quick-action-dropdowns/archived-issue.tsx index 5957712e2..0e2d54aff 100644 --- a/web/core/components/issues/issue-layouts/quick-action-dropdowns/archived-issue.tsx +++ b/web/core/components/issues/issue-layouts/quick-action-dropdowns/archived-issue.tsx @@ -8,12 +8,12 @@ import { ArchiveRestoreIcon, ExternalLink, Link, Trash2 } from "lucide-react"; // ui import { EIssuesStoreType, EUserPermissions, EUserPermissionsLevel } from "@plane/constants"; import { ContextMenu, CustomMenu, TContextMenuItem, TOAST_TYPE, setToast } from "@plane/ui"; +import { copyUrlToClipboard } from "@plane/utils"; // components import { DeleteIssueModal } from "@/components/issues"; // constants // helpers import { cn } from "@/helpers/common.helper"; -import { copyUrlToClipboard } from "@/helpers/string.helper"; // hooks import { useEventTracker, useIssues, useUserPermissions } from "@/hooks/store"; // types diff --git a/web/core/components/modules/analytics-sidebar/root.tsx b/web/core/components/modules/analytics-sidebar/root.tsx index cfa464d63..d02e85144 100644 --- a/web/core/components/modules/analytics-sidebar/root.tsx +++ b/web/core/components/modules/analytics-sidebar/root.tsx @@ -41,6 +41,7 @@ import { ArchiveIcon, TextArea, } from "@plane/ui"; +import { copyUrlToClipboard } from "@plane/utils"; // components import { DateRangeDropdown, MemberDropdown } from "@/components/dropdowns"; import { @@ -50,10 +51,8 @@ import { ModuleAnalyticsProgress, ModuleLinksList, } from "@/components/modules"; - // helpers import { getDate, renderFormattedPayloadDate } from "@/helpers/date-time.helper"; -import { copyUrlToClipboard } from "@/helpers/string.helper"; // hooks import { useModule, useEventTracker, useProjectEstimates, useUserPermissions } from "@/hooks/store"; import { useAppRouter } from "@/hooks/use-app-router"; diff --git a/web/core/components/modules/quick-actions.tsx b/web/core/components/modules/quick-actions.tsx index 69b6e0eb4..f9e21331b 100644 --- a/web/core/components/modules/quick-actions.tsx +++ b/web/core/components/modules/quick-actions.tsx @@ -10,11 +10,11 @@ import { EUserPermissions, EUserPermissionsLevel } from "@plane/constants"; import { useTranslation } from "@plane/i18n"; // ui import { ArchiveIcon, ContextMenu, CustomMenu, TContextMenuItem, TOAST_TYPE, setToast } from "@plane/ui"; +import { copyUrlToClipboard } from "@plane/utils"; // components import { ArchiveModuleModal, CreateUpdateModuleModal, DeleteModuleModal } from "@/components/modules"; // helpers import { cn } from "@/helpers/common.helper"; -import { copyUrlToClipboard } from "@/helpers/string.helper"; // hooks import { useModule, useEventTracker, useUserPermissions } from "@/hooks/store"; import { useAppRouter } from "@/hooks/use-app-router"; diff --git a/web/core/components/project/card.tsx b/web/core/components/project/card.tsx index 73b7c641d..b7d90213d 100644 --- a/web/core/components/project/card.tsx +++ b/web/core/components/project/card.tsx @@ -22,6 +22,7 @@ import { TContextMenuItem, FavoriteStar, } from "@plane/ui"; +import { copyUrlToClipboard } from "@plane/utils"; // components import { Logo } from "@/components/common"; import { ArchiveRestoreProjectModal, DeleteProjectModal, JoinProjectModal } from "@/components/project"; @@ -29,7 +30,6 @@ import { ArchiveRestoreProjectModal, DeleteProjectModal, JoinProjectModal } from import { cn } from "@/helpers/common.helper"; import { renderFormattedDate } from "@/helpers/date-time.helper"; import { getFileURL } from "@/helpers/file.helper"; -import { copyUrlToClipboard } from "@/helpers/string.helper"; // hooks import { useMember, useProject, useUserPermissions } from "@/hooks/store"; import { useAppRouter } from "@/hooks/use-app-router"; diff --git a/web/core/components/views/quick-actions.tsx b/web/core/components/views/quick-actions.tsx index bb7f4426f..29f4f51ba 100644 --- a/web/core/components/views/quick-actions.tsx +++ b/web/core/components/views/quick-actions.tsx @@ -8,11 +8,11 @@ import { EUserPermissions, EUserPermissionsLevel } from "@plane/constants"; import { IProjectView } from "@plane/types"; // ui import { ContextMenu, CustomMenu, TContextMenuItem, TOAST_TYPE, setToast } from "@plane/ui"; +import { copyUrlToClipboard } from "@plane/utils"; // components import { CreateUpdateProjectViewModal, DeleteProjectViewModal } from "@/components/views"; // helpers import { cn } from "@/helpers/common.helper"; -import { copyUrlToClipboard } from "@/helpers/string.helper"; // hooks import { useUser, useUserPermissions } from "@/hooks/store"; import { PublishViewModal, useViewPublish } from "@/plane-web/components/views/publish"; diff --git a/web/core/components/workspace/settings/workspace-details.tsx b/web/core/components/workspace/settings/workspace-details.tsx index b3371f548..2b7b8d949 100644 --- a/web/core/components/workspace/settings/workspace-details.tsx +++ b/web/core/components/workspace/settings/workspace-details.tsx @@ -5,17 +5,16 @@ import { observer } from "mobx-react"; import { Controller, useForm } from "react-hook-form"; import { Pencil } from "lucide-react"; // constants -import { ORGANIZATION_SIZE, WORKSPACE_UPDATED ,EUserPermissions, EUserPermissionsLevel } from "@plane/constants"; +import { ORGANIZATION_SIZE, WORKSPACE_UPDATED, EUserPermissions, EUserPermissionsLevel } from "@plane/constants"; import { useTranslation } from "@plane/i18n"; import { IWorkspace } from "@plane/types"; -// ui import { Button, CustomSelect, Input, TOAST_TYPE, setToast } from "@plane/ui"; +import { copyUrlToClipboard } from "@plane/utils"; // components import { LogoSpinner } from "@/components/common"; import { WorkspaceImageUploadModal } from "@/components/core"; // helpers import { getFileURL } from "@/helpers/file.helper"; -import { copyUrlToClipboard } from "@/helpers/string.helper"; // hooks import { useEventTracker, useUserPermissions, useWorkspace } from "@/hooks/store"; // plane web components diff --git a/web/core/components/workspace/sidebar/projects-list.tsx b/web/core/components/workspace/sidebar/projects-list.tsx index bde475f48..205eb2450 100644 --- a/web/core/components/workspace/sidebar/projects-list.tsx +++ b/web/core/components/workspace/sidebar/projects-list.tsx @@ -5,23 +5,21 @@ import { combine } from "@atlaskit/pragmatic-drag-and-drop/combine"; import { autoScrollForElements } from "@atlaskit/pragmatic-drag-and-drop-auto-scroll/element"; import { observer } from "mobx-react"; import { useParams, usePathname } from "next/navigation"; -import { Briefcase, ChevronRight, Ellipsis, Plus } from "lucide-react"; +import { Briefcase, ChevronRight, Plus } from "lucide-react"; import { Disclosure, Transition } from "@headlessui/react"; 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"; // components import { CreateProjectModal } from "@/components/project"; -import { SidebarNavItem } from "@/components/sidebar"; import { SidebarProjectsListItem } from "@/components/workspace"; // helpers import { cn } from "@/helpers/common.helper"; import { orderJoinedProjects } from "@/helpers/project.helper"; -import { copyUrlToClipboard } from "@/helpers/string.helper"; // hooks import { useAppTheme, useCommandPalette, useEventTracker, useProject, useUserPermissions } from "@/hooks/store"; -// plane web constants // plane web types import { TProject } from "@/plane-web/types"; diff --git a/web/core/components/workspace/views/default-view-quick-action.tsx b/web/core/components/workspace/views/default-view-quick-action.tsx index 0ee4facab..9ade52acb 100644 --- a/web/core/components/workspace/views/default-view-quick-action.tsx +++ b/web/core/components/workspace/views/default-view-quick-action.tsx @@ -8,9 +8,9 @@ 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"; // helpers import { cn } from "@/helpers/common.helper"; -import { copyUrlToClipboard } from "@/helpers/string.helper"; type Props = { parentRef: React.RefObject; diff --git a/web/core/components/workspace/views/quick-action.tsx b/web/core/components/workspace/views/quick-action.tsx index 2251244b4..5fbdffc4f 100644 --- a/web/core/components/workspace/views/quick-action.tsx +++ b/web/core/components/workspace/views/quick-action.tsx @@ -8,14 +8,14 @@ import { ExternalLink, LinkIcon, Pencil, Trash2, Lock } from "lucide-react"; import { EViewAccess, EUserPermissions, EUserPermissionsLevel } from "@plane/constants"; import { useTranslation } from "@plane/i18n"; import { IWorkspaceView } from "@plane/types"; -// ui -import { ContextMenu, CustomMenu, TContextMenuItem, TOAST_TYPE, setToast } from "@plane/ui"; +import { ContextMenu, TContextMenuItem, TOAST_TYPE, setToast } from "@plane/ui"; +import { copyUrlToClipboard } from "@plane/utils"; // components import { CreateUpdateWorkspaceViewModal, DeleteGlobalViewModal } from "@/components/workspace"; // constants // helpers import { cn } from "@/helpers/common.helper"; -import { copyUrlToClipboard } from "@/helpers/string.helper"; +import {} from "@/helpers/string.helper"; // hooks import { useUser, useUserPermissions } from "@/hooks/store";