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
|
|
@ -6,21 +6,19 @@ import { observer } from "mobx-react";
|
|||
import { useSearchParams } from "next/navigation";
|
||||
import { AlertCircle, ChevronUp, ChevronDown } from "lucide-react";
|
||||
import { Disclosure, Transition } from "@headlessui/react";
|
||||
import { EIssueFilterType, EIssuesStoreType } from "@plane/constants";
|
||||
import { EIssueFilterType, EIssuesStoreType, EEstimateSystem } from "@plane/constants";
|
||||
import { useTranslation } from "@plane/i18n";
|
||||
import { IIssueFilterOptions, TModulePlotType } from "@plane/types";
|
||||
import { CustomSelect, Spinner } from "@plane/ui";
|
||||
// components
|
||||
import ProgressChart from "@/components/core/sidebar/progress-chart";
|
||||
import { ModuleProgressStats } from "@/components/modules";
|
||||
// constants
|
||||
// helpers
|
||||
import { getDate } from "@/helpers/date-time.helper";
|
||||
import { getDate } from "@plane/utils";
|
||||
import ProgressChart from "@/components/core/sidebar/progress-chart";
|
||||
import { ModuleProgressStats } from "@/components/modules";
|
||||
// hooks
|
||||
import { useIssues, useModule, useProjectEstimates } from "@/hooks/store";
|
||||
// plane web constants
|
||||
import { EEstimateSystem } from "@/plane-web/constants/estimates";
|
||||
|
||||
type TModuleAnalyticsProgress = {
|
||||
workspaceSlug: string;
|
||||
projectId: string;
|
||||
|
|
|
|||
|
|
@ -14,11 +14,10 @@ import {
|
|||
TStateGroups,
|
||||
} from "@plane/types";
|
||||
import { Avatar, StateGroupIcon } from "@plane/ui";
|
||||
import { cn, getFileURL } from "@plane/utils";
|
||||
// components
|
||||
import { SingleProgressStats } from "@/components/core";
|
||||
// helpers
|
||||
import { cn } from "@/helpers/common.helper";
|
||||
import { getFileURL } from "@/helpers/file.helper";
|
||||
// hooks
|
||||
import { useProjectState } from "@/hooks/store";
|
||||
import useLocalStorage from "@/hooks/use-local-storage";
|
||||
|
|
|
|||
|
|
@ -6,21 +6,15 @@ import { useParams } from "next/navigation";
|
|||
import { Controller, useForm } from "react-hook-form";
|
||||
import { CalendarClock, ChevronDown, ChevronRight, Info, Plus, SquareUser, Users } from "lucide-react";
|
||||
import { Disclosure, Transition } from "@headlessui/react";
|
||||
import { MODULE_STATUS, MODULE_LINK_CREATED, MODULE_LINK_DELETED, MODULE_LINK_UPDATED, MODULE_UPDATED, EUserPermissions, EUserPermissionsLevel, EEstimateSystem } from "@plane/constants";
|
||||
// plane types
|
||||
import {
|
||||
MODULE_STATUS,
|
||||
MODULE_LINK_CREATED,
|
||||
MODULE_LINK_DELETED,
|
||||
MODULE_LINK_UPDATED,
|
||||
MODULE_UPDATED,
|
||||
EUserPermissions,
|
||||
EUserPermissionsLevel,
|
||||
} from "@plane/constants";
|
||||
import { useTranslation } from "@plane/i18n";
|
||||
import { ILinkDetails, IModule, ModuleLink } from "@plane/types";
|
||||
// plane ui
|
||||
import { Loader, LayersIcon, CustomSelect, ModuleStatusIcon, TOAST_TYPE, setToast, TextArea } from "@plane/ui";
|
||||
// components
|
||||
// helpers
|
||||
import { getDate, renderFormattedPayloadDate } from "@plane/utils";
|
||||
import { DateRangeDropdown, MemberDropdown } from "@/components/dropdowns";
|
||||
import {
|
||||
ArchiveModuleModal,
|
||||
|
|
@ -29,13 +23,9 @@ import {
|
|||
ModuleAnalyticsProgress,
|
||||
ModuleLinksList,
|
||||
} from "@/components/modules";
|
||||
// helpers
|
||||
import { getDate, renderFormattedPayloadDate } from "@/helpers/date-time.helper";
|
||||
// hooks
|
||||
import { useModule, useEventTracker, useProjectEstimates, useUserPermissions } from "@/hooks/store";
|
||||
// plane web constants
|
||||
import { EEstimateSystem } from "@/plane-web/constants/estimates";
|
||||
|
||||
const defaultValues: Partial<IModule> = {
|
||||
lead_id: "",
|
||||
member_ids: [],
|
||||
|
|
|
|||
|
|
@ -2,9 +2,8 @@ import { observer } from "mobx-react";
|
|||
// icons
|
||||
import { X } from "lucide-react";
|
||||
import { DATE_AFTER_FILTER_OPTIONS } from "@plane/constants";
|
||||
import { renderFormattedDate, capitalizeFirstLetter } from "@plane/utils";
|
||||
// helpers
|
||||
import { renderFormattedDate } from "@/helpers/date-time.helper";
|
||||
import { capitalizeFirstLetter } from "@/helpers/string.helper";
|
||||
// constants
|
||||
|
||||
type Props = {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { X } from "lucide-react";
|
|||
// plane ui
|
||||
import { Avatar } from "@plane/ui";
|
||||
// helpers
|
||||
import { getFileURL } from "@/helpers/file.helper";
|
||||
import { getFileURL } from "@plane/utils";
|
||||
// hooks
|
||||
import { useMember } from "@/hooks/store";
|
||||
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@ import { useTranslation } from "@plane/i18n";
|
|||
import { TModuleDisplayFilters, TModuleFilters } from "@plane/types";
|
||||
// components
|
||||
import { Header, EHeaderVariant, Tag } from "@plane/ui";
|
||||
import { replaceUnderscoreIfSnakeCase } from "@plane/utils";
|
||||
import { AppliedDateFilters, AppliedMembersFilters, AppliedStatusFilters } from "@/components/modules";
|
||||
// helpers
|
||||
import { replaceUnderscoreIfSnakeCase } from "@/helpers/string.helper";
|
||||
// types
|
||||
|
||||
type Props = {
|
||||
|
|
|
|||
|
|
@ -7,13 +7,12 @@ import { ListFilter, Search, X } from "lucide-react";
|
|||
import { useOutsideClickDetector } from "@plane/hooks";
|
||||
// types
|
||||
import type { TModuleFilters } from "@plane/types";
|
||||
import { cn, calculateTotalFilters } from "@plane/utils";
|
||||
// components
|
||||
import { ArchiveTabsList } from "@/components/archives";
|
||||
import { FiltersDropdown } from "@/components/issues";
|
||||
import { ModuleFiltersSelection, ModuleOrderByDropdown } from "@/components/modules";
|
||||
// helpers
|
||||
import { cn } from "@/helpers/common.helper";
|
||||
import { calculateTotalFilters } from "@/helpers/filter.helper";
|
||||
// hooks
|
||||
import { useMember, useModuleFilter } from "@/hooks/store";
|
||||
|
||||
|
|
|
|||
|
|
@ -6,11 +6,11 @@ import useSWR from "swr";
|
|||
import { useTranslation } from "@plane/i18n";
|
||||
import { TModuleFilters } from "@plane/types";
|
||||
// components
|
||||
import { calculateTotalFilters } from "@plane/utils";
|
||||
import { DetailedEmptyState } from "@/components/empty-state";
|
||||
import { ArchivedModulesView, ModuleAppliedFiltersList } from "@/components/modules";
|
||||
import { CycleModuleListLayout } from "@/components/ui";
|
||||
// helpers
|
||||
import { calculateTotalFilters } from "@/helpers/filter.helper";
|
||||
// hooks
|
||||
import { useModule, useModuleFilter } from "@/hooks/store";
|
||||
import { useResolvedAssetPath } from "@/hooks/use-resolved-asset-path";
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@ import { observer } from "mobx-react";
|
|||
// plane ui
|
||||
import { Avatar, Loader } from "@plane/ui";
|
||||
// components
|
||||
import { getFileURL } from "@plane/utils";
|
||||
import { FilterHeader, FilterOption } from "@/components/issues";
|
||||
// helpers
|
||||
import { getFileURL } from "@/helpers/file.helper";
|
||||
// hooks
|
||||
import { useMember, useUser } from "@/hooks/store";
|
||||
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@ import { observer } from "mobx-react";
|
|||
// plane ui
|
||||
import { Avatar, Loader } from "@plane/ui";
|
||||
// components
|
||||
import { getFileURL } from "@plane/utils";
|
||||
import { FilterHeader, FilterOption } from "@/components/issues";
|
||||
// helpers
|
||||
import { getFileURL } from "@/helpers/file.helper";
|
||||
// hooks
|
||||
import { useMember, useUser } from "@/hooks/store";
|
||||
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@ import { observer } from "mobx-react";
|
|||
// constants
|
||||
import { DATE_AFTER_FILTER_OPTIONS } from "@plane/constants";
|
||||
// components
|
||||
import { isInDateFormat } from "@plane/utils";
|
||||
import { DateFilterModal } from "@/components/core";
|
||||
import { FilterHeader, FilterOption } from "@/components/issues";
|
||||
|
||||
// helpers
|
||||
import { isInDateFormat } from "@/helpers/date-time.helper";
|
||||
|
||||
type Props = {
|
||||
appliedFilters: string[] | null;
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@ import { observer } from "mobx-react";
|
|||
// plane constants
|
||||
import { DATE_AFTER_FILTER_OPTIONS } from "@plane/constants";
|
||||
// components
|
||||
import { isInDateFormat } from "@plane/utils";
|
||||
import { DateFilterModal } from "@/components/core";
|
||||
import { FilterHeader, FilterOption } from "@/components/issues";
|
||||
// helpers
|
||||
import { isInDateFormat } from "@/helpers/date-time.helper";
|
||||
|
||||
type Props = {
|
||||
appliedFilters: string[] | null;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import { TModuleOrderByOptions } from "@plane/types";
|
|||
// ui
|
||||
import { CustomMenu, getButtonStyling } from "@plane/ui";
|
||||
// helpers
|
||||
import { cn } from "@/helpers/common.helper";
|
||||
import { cn } from "@plane/utils";
|
||||
// types
|
||||
// constants
|
||||
|
||||
|
|
|
|||
|
|
@ -8,12 +8,10 @@ import { useTranslation } from "@plane/i18n";
|
|||
import { IModule } from "@plane/types";
|
||||
// ui
|
||||
import { Button, Input, TextArea } from "@plane/ui";
|
||||
import { getDate, renderFormattedPayloadDate, getTabIndex } from "@plane/utils";
|
||||
// components
|
||||
import { DateRangeDropdown, ProjectDropdown, MemberDropdown } from "@/components/dropdowns";
|
||||
import { ModuleStatusSelect } from "@/components/modules";
|
||||
// helpers
|
||||
import { getDate, renderFormattedPayloadDate } from "@/helpers/date-time.helper";
|
||||
import { getTabIndex } from "@/helpers/tab-indices.helper";
|
||||
// hooks
|
||||
import { useUser } from "@/hooks/store/user/user-user";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,10 @@
|
|||
import { observer } from "mobx-react";
|
||||
import { useParams } from "next/navigation";
|
||||
// PLane
|
||||
import { IModule } from "@plane/types";
|
||||
import { IBlockUpdateData, IBlockUpdateDependencyData, IModule } from "@plane/types";
|
||||
// components
|
||||
import {
|
||||
GanttChartRoot,
|
||||
IBlockUpdateData,
|
||||
IBlockUpdateDependencyData,
|
||||
ModuleGanttSidebar,
|
||||
} from "@/components/gantt-chart";
|
||||
import { ETimeLineTypeType, TimeLineTypeContext } from "@/components/gantt-chart/contexts";
|
||||
|
|
@ -19,7 +17,7 @@ export const ModulesListGanttChartView: React.FC = observer(() => {
|
|||
const { workspaceSlug, projectId } = useParams();
|
||||
// store
|
||||
const { currentProjectDetails } = useProject();
|
||||
const { getFilteredModuleIds, updateModuleDetails, getModuleById } = useModule();
|
||||
const { getFilteredModuleIds, updateModuleDetails } = useModule();
|
||||
const { currentProjectDisplayFilters: displayFilters } = useModuleFilter();
|
||||
|
||||
// derived values
|
||||
|
|
|
|||
|
|
@ -4,10 +4,9 @@ import { Copy, Pencil, Trash2 } from "lucide-react";
|
|||
import { ILinkDetails } from "@plane/types";
|
||||
// plane ui
|
||||
import { setToast, TOAST_TYPE, Tooltip } from "@plane/ui";
|
||||
import { getIconForLink } from "@plane/utils";
|
||||
import { getIconForLink, copyTextToClipboard, calculateTimeAgo } from "@plane/utils";
|
||||
// helpers
|
||||
import { calculateTimeAgo } from "@/helpers/date-time.helper";
|
||||
import { copyTextToClipboard } from "@/helpers/string.helper";
|
||||
//
|
||||
// hooks
|
||||
import { useMember } from "@/hooks/store";
|
||||
import { usePlatformOS } from "@/hooks/use-platform-os";
|
||||
|
|
|
|||
|
|
@ -27,14 +27,13 @@ import {
|
|||
setPromiseToast,
|
||||
setToast,
|
||||
} from "@plane/ui";
|
||||
import { getDate, renderFormattedPayloadDate, generateQueryParams } from "@plane/utils";
|
||||
// components
|
||||
import { DateRangeDropdown } from "@/components/dropdowns";
|
||||
import { ButtonAvatars } from "@/components/dropdowns/member/avatar";
|
||||
import { ModuleQuickActions } from "@/components/modules";
|
||||
import { ModuleStatusDropdown } from "@/components/modules/module-status-dropdown";
|
||||
// helpers
|
||||
import { getDate, renderFormattedPayloadDate } from "@/helpers/date-time.helper";
|
||||
import { generateQueryParams } from "@/helpers/router.helper";
|
||||
// hooks
|
||||
import { useEventTracker, useMember, useModule, useUserPermissions } from "@/hooks/store";
|
||||
import { useAppRouter } from "@/hooks/use-app-router";
|
||||
|
|
|
|||
|
|
@ -20,12 +20,12 @@ import { IModule } from "@plane/types";
|
|||
// ui
|
||||
import { FavoriteStar, TOAST_TYPE, Tooltip, setPromiseToast, setToast } from "@plane/ui";
|
||||
// components
|
||||
import { renderFormattedPayloadDate, getDate } from "@plane/utils";
|
||||
import { DateRangeDropdown } from "@/components/dropdowns";
|
||||
import { ModuleQuickActions } from "@/components/modules";
|
||||
import { ModuleStatusDropdown } from "@/components/modules/module-status-dropdown";
|
||||
// constants
|
||||
// hooks
|
||||
import { renderFormattedPayloadDate, getDate } from "@/helpers/date-time.helper";
|
||||
import { useEventTracker, useMember, useModule, useUserPermissions } from "@/hooks/store";
|
||||
import { ButtonAvatars } from "../dropdowns/member/avatar";
|
||||
|
||||
|
|
|
|||
|
|
@ -8,10 +8,10 @@ import { Check, Info } from "lucide-react";
|
|||
// ui
|
||||
import { CircularProgressIndicator } from "@plane/ui";
|
||||
// components
|
||||
import { generateQueryParams } from "@plane/utils";
|
||||
import { ListItem } from "@/components/core/list";
|
||||
import { ModuleListItemAction, ModuleQuickActions } from "@/components/modules";
|
||||
// helpers
|
||||
import { generateQueryParams } from "@/helpers/router.helper";
|
||||
// hooks
|
||||
import { useModule } from "@/hooks/store";
|
||||
import { useAppRouter } from "@/hooks/use-app-router";
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import React, { useEffect } from "react";
|
|||
import { observer } from "mobx-react";
|
||||
import { usePathname, useSearchParams } from "next/navigation";
|
||||
// hooks
|
||||
import { generateQueryParams } from "@/helpers/router.helper";
|
||||
import { generateQueryParams } from "@plane/utils";
|
||||
import { useModule } from "@/hooks/store";
|
||||
import { useAppRouter } from "@/hooks/use-app-router";
|
||||
// components
|
||||
|
|
|
|||
|
|
@ -12,14 +12,13 @@ import { useTranslation } from "@plane/i18n";
|
|||
import { TModuleFilters } from "@plane/types";
|
||||
// ui
|
||||
import { Tooltip } from "@plane/ui";
|
||||
import { cn, calculateTotalFilters } from "@plane/utils";
|
||||
// plane utils
|
||||
import { cn } from "@plane/utils";
|
||||
// components
|
||||
import { FiltersDropdown } from "@/components/issues";
|
||||
import { ModuleFiltersSelection, ModuleOrderByDropdown } from "@/components/modules/dropdowns";
|
||||
// constants
|
||||
// helpers
|
||||
import { calculateTotalFilters } from "@/helpers/filter.helper";
|
||||
// hooks
|
||||
import { useMember, useModuleFilter } from "@/hooks/store";
|
||||
import { usePlatformOS } from "@/hooks/use-platform-os";
|
||||
|
|
|
|||
|
|
@ -10,11 +10,10 @@ 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";
|
||||
import { copyUrlToClipboard, cn } from "@plane/utils";
|
||||
// components
|
||||
import { ArchiveModuleModal, CreateUpdateModuleModal, DeleteModuleModal } from "@/components/modules";
|
||||
// helpers
|
||||
import { cn } from "@/helpers/common.helper";
|
||||
// hooks
|
||||
import { useModule, useEventTracker, useUserPermissions } from "@/hooks/store";
|
||||
import { useAppRouter } from "@/hooks/use-app-router";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue