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
|
|
@ -13,10 +13,8 @@ import {
|
|||
TCycleDistribution,
|
||||
TCycleEstimateType,
|
||||
} from "@plane/types";
|
||||
import { orderCycles, shouldFilterCycle, getDate, DistributionUpdates, updateDistribution } from "@plane/utils";
|
||||
// helpers
|
||||
import { orderCycles, shouldFilterCycle } from "@/helpers/cycle.helper";
|
||||
import { getDate } from "@/helpers/date-time.helper";
|
||||
import { DistributionUpdates, updateDistribution } from "@/helpers/distribution-update.helper";
|
||||
// services
|
||||
import { syncIssuesWithDeletedCycles } from "@/local-db/utils/load-workspace";
|
||||
import { CycleService } from "@/services/cycle.service";
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
import clone from "lodash/clone";
|
||||
import set from "lodash/set";
|
||||
import { makeObservable, observable, runInAction, action } from "mobx";
|
||||
import { TInboxIssue, TInboxIssueStatus, EInboxIssueSource } from "@plane/constants";
|
||||
import { TInboxIssue, TInboxIssueStatus, EInboxIssueSource, EInboxIssueStatus } from "@plane/constants";
|
||||
import { TIssue, TInboxDuplicateIssueDetails } from "@plane/types";
|
||||
// helpers
|
||||
import { EInboxIssueStatus } from "@/helpers/inbox.helper";
|
||||
// local db
|
||||
import { addIssueToPersistanceLayer } from "@/local-db/utils/utils";
|
||||
// services
|
||||
|
|
|
|||
|
|
@ -4,16 +4,16 @@ import omit from "lodash/omit";
|
|||
import set from "lodash/set";
|
||||
import { action, computed, makeObservable, observable, runInAction } from "mobx";
|
||||
import { computedFn } from "mobx-utils";
|
||||
import { TInboxIssue, TInboxIssueCurrentTab, EInboxIssueCurrentTab, EInboxIssueStatus, EPastDurationFilters } from "@plane/constants";
|
||||
// types
|
||||
import { TInboxIssue, TInboxIssueCurrentTab } from "@plane/constants";
|
||||
import {
|
||||
TInboxIssueFilter,
|
||||
TInboxIssueSorting,
|
||||
TInboxIssuePaginationInfo,
|
||||
TInboxIssueSortingOrderByQueryParam,
|
||||
} from "@plane/types";
|
||||
import { getCustomDates} from "@plane/utils";
|
||||
// helpers
|
||||
import { EInboxIssueCurrentTab, EInboxIssueStatus, EPastDurationFilters, getCustomDates } from "@/helpers/inbox.helper";
|
||||
// services
|
||||
import { InboxIssueService } from "@/services/inbox";
|
||||
// root store
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import {
|
|||
TIssueParams,
|
||||
IssuePaginationOptions,
|
||||
} from "@plane/types";
|
||||
import { handleIssueQueryParamsByLayout } from "@/helpers/issue.helper";
|
||||
import { handleIssueQueryParamsByLayout } from "@plane/utils";
|
||||
import { IssueFiltersService } from "@/services/issue_filter.service";
|
||||
import { IBaseIssueFilterStore, IssueFilterHelperStore } from "../helpers/issue-filter-helper.store";
|
||||
// helpers
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import {
|
|||
TIssueParams,
|
||||
IssuePaginationOptions,
|
||||
} from "@plane/types";
|
||||
import { handleIssueQueryParamsByLayout } from "@/helpers/issue.helper";
|
||||
import { handleIssueQueryParamsByLayout } from "@plane/utils";
|
||||
import { IssueFiltersService } from "@/services/issue_filter.service";
|
||||
import { IBaseIssueFilterStore, IssueFilterHelperStore } from "../helpers/issue-filter-helper.store";
|
||||
// helpers
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ import {
|
|||
TBulkOperationsPayload,
|
||||
} from "@plane/types";
|
||||
// helpers
|
||||
import { getDistributionPathsPostUpdate } from "@/helpers/distribution-update.helper";
|
||||
import { getDistributionPathsPostUpdate } from "@plane/utils";
|
||||
//local
|
||||
import { storage } from "@/lib/local-storage";
|
||||
import { persistence } from "@/local-db/storage.sqlite";
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import {
|
|||
TIssueParams,
|
||||
IssuePaginationOptions,
|
||||
} from "@plane/types";
|
||||
import { handleIssueQueryParamsByLayout } from "@/helpers/issue.helper";
|
||||
import { handleIssueQueryParamsByLayout } from "@plane/utils";
|
||||
import { IssueFiltersService } from "@/services/issue_filter.service";
|
||||
import { IBaseIssueFilterStore, IssueFilterHelperStore } from "../helpers/issue-filter-helper.store";
|
||||
// helpers
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import {
|
|||
TIssueGroupByOptions,
|
||||
TIssueOrderByOptions,
|
||||
} from "@plane/types";
|
||||
import { checkDateCriteria, convertToISODateString, parseDateFilter } from "@/helpers/date-time.helper";
|
||||
import { checkDateCriteria, convertToISODateString, parseDateFilter } from "@plane/utils";
|
||||
import { store } from "@/lib/store-context";
|
||||
import { EIssueGroupedAction, ISSUE_GROUP_BY_KEY } from "./base-issues.store";
|
||||
|
||||
|
|
|
|||
|
|
@ -29,11 +29,10 @@ import {
|
|||
TGroupedIssueCount,
|
||||
TPaginationData,
|
||||
TBulkOperationsPayload,
|
||||
IBlockUpdateDependencyData,
|
||||
} from "@plane/types";
|
||||
// components
|
||||
import { IBlockUpdateDependencyData } from "@/components/gantt-chart";
|
||||
// helpers
|
||||
import { convertToISODateString } from "@/helpers/date-time.helper";
|
||||
import { convertToISODateString } from "@plane/utils";
|
||||
// local-db
|
||||
import { SPECIAL_ORDER_BY } from "@/local-db/utils/query-constructor";
|
||||
import { updatePersistentLayer } from "@/local-db/utils/utils";
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ import {
|
|||
TStaticViewTypes,
|
||||
} from "@plane/types";
|
||||
// helpers
|
||||
import { getComputedDisplayFilters, getComputedDisplayProperties } from "@/helpers/issue.helper";
|
||||
import { getComputedDisplayFilters, getComputedDisplayProperties } from "@plane/utils";
|
||||
// lib
|
||||
import { storage } from "@/lib/local-storage";
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import { action, makeObservable, observable, runInAction } from "mobx";
|
|||
// types
|
||||
// helpers
|
||||
import { TIssueCommentReaction, TIssueCommentReactionIdMap, TIssueCommentReactionMap } from "@plane/types";
|
||||
import { groupReactions } from "@/helpers/emoji.helper";
|
||||
import { groupReactions } from "@plane/utils";
|
||||
import { IssueReactionService } from "@/services/issue";
|
||||
import { IIssueDetail } from "./root.store";
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import { action, makeObservable, observable, runInAction } from "mobx";
|
|||
// types
|
||||
// helpers
|
||||
import { TIssueReaction, TIssueReactionMap, TIssueReactionIdMap, TIssue, TIssueServiceType } from "@plane/types";
|
||||
import { groupReactions } from "@/helpers/emoji.helper";
|
||||
import { groupReactions } from "@plane/utils";
|
||||
import { IssueReactionService } from "@/services/issue";
|
||||
import { IIssueDetail } from "./root.store";
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { computedFn } from "mobx-utils";
|
|||
// types
|
||||
import { TIssue } from "@plane/types";
|
||||
// helpers
|
||||
import { getCurrentDateTimeInISO } from "@/helpers/date-time.helper";
|
||||
import { getCurrentDateTimeInISO } from "@plane/utils";
|
||||
import { rootStore } from "@/lib/store-context";
|
||||
// services
|
||||
import { deleteIssueFromLocal } from "@/local-db/utils/load-issues";
|
||||
|
|
|
|||
|
|
@ -2,11 +2,9 @@ import { observable, action, makeObservable, runInAction, computed } from "mobx"
|
|||
|
||||
// helpers
|
||||
import { computedFn } from "mobx-utils";
|
||||
import { ICalendarPayload, ICalendarWeek } from "@/components/issues";
|
||||
import { generateCalendarData } from "@/helpers/calendar.helper";
|
||||
import { ICalendarPayload, ICalendarWeek } from "@plane/types";
|
||||
import { generateCalendarData, getWeekNumberOfDate } from "@plane/utils";
|
||||
// types
|
||||
import { getWeekNumberOfDate } from "@/helpers/date-time.helper";
|
||||
|
||||
export interface ICalendarStore {
|
||||
calendarFilters: {
|
||||
activeMonthDate: Date;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { action, makeObservable, observable, runInAction } from "mobx";
|
||||
import { computedFn } from "mobx-utils";
|
||||
// helpers
|
||||
import { ChartDataType, TGanttViews } from "@/components/gantt-chart";
|
||||
import type { ChartDataType, TGanttViews } from "@plane/types";
|
||||
import { currentViewDataWithView } from "@/components/gantt-chart/data";
|
||||
// types
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import {
|
|||
TIssueParams,
|
||||
IssuePaginationOptions,
|
||||
} from "@plane/types";
|
||||
import { handleIssueQueryParamsByLayout } from "@/helpers/issue.helper";
|
||||
import { handleIssueQueryParamsByLayout } from "@plane/utils";
|
||||
import { IssueFiltersService } from "@/services/issue_filter.service";
|
||||
import { IBaseIssueFilterStore, IssueFilterHelperStore } from "../helpers/issue-filter-helper.store";
|
||||
// helpers
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import {
|
|||
TBulkOperationsPayload,
|
||||
} from "@plane/types";
|
||||
// helpers
|
||||
import { getDistributionPathsPostUpdate } from "@/helpers/distribution-update.helper";
|
||||
import { getDistributionPathsPostUpdate } from "@plane/utils";
|
||||
import { BaseIssuesStore, IBaseIssuesStore } from "../helpers/base-issues.store";
|
||||
//
|
||||
import { IIssueRootStore } from "../root.store";
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import {
|
|||
TIssueParams,
|
||||
IssuePaginationOptions,
|
||||
} from "@plane/types";
|
||||
import { handleIssueQueryParamsByLayout } from "@/helpers/issue.helper";
|
||||
import { handleIssueQueryParamsByLayout } from "@plane/utils";
|
||||
import { IssueFiltersService } from "@/services/issue_filter.service";
|
||||
import { IBaseIssueFilterStore, IssueFilterHelperStore } from "../helpers/issue-filter-helper.store";
|
||||
// helpers
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import {
|
|||
TIssueParams,
|
||||
IssuePaginationOptions,
|
||||
} from "@plane/types";
|
||||
import { handleIssueQueryParamsByLayout } from "@/helpers/issue.helper";
|
||||
import { handleIssueQueryParamsByLayout } from "@plane/utils";
|
||||
// services
|
||||
import { ViewService } from "@/plane-web/services";
|
||||
import { IBaseIssueFilterStore, IssueFilterHelperStore } from "../helpers/issue-filter-helper.store";
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import {
|
|||
TIssueParams,
|
||||
IssuePaginationOptions,
|
||||
} from "@plane/types";
|
||||
import { handleIssueQueryParamsByLayout } from "@/helpers/issue.helper";
|
||||
import { handleIssueQueryParamsByLayout } from "@plane/utils";
|
||||
import { IssueFiltersService } from "@/services/issue_filter.service";
|
||||
import { IBaseIssueFilterStore, IssueFilterHelperStore } from "../helpers/issue-filter-helper.store";
|
||||
// helpers
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import {
|
|||
TIssueParams,
|
||||
IssuePaginationOptions,
|
||||
} from "@plane/types";
|
||||
import { handleIssueQueryParamsByLayout } from "@/helpers/issue.helper";
|
||||
import { handleIssueQueryParamsByLayout } from "@plane/utils";
|
||||
import { IssueFiltersService } from "@/services/issue_filter.service";
|
||||
import { IBaseIssueFilterStore, IssueFilterHelperStore } from "../helpers/issue-filter-helper.store";
|
||||
// helpers
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import {
|
|||
} from "@plane/types";
|
||||
// constants
|
||||
// helpers
|
||||
import { getCurrentDateTimeInISO, convertToISODateString } from "@/helpers/date-time.helper";
|
||||
import { getCurrentDateTimeInISO, convertToISODateString } from "@plane/utils";
|
||||
// local-db
|
||||
import { addIssueToPersistanceLayer } from "@/local-db/utils/utils";
|
||||
// services
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ import {
|
|||
IssuePaginationOptions,
|
||||
} from "@plane/types";
|
||||
// services
|
||||
import { handleIssueQueryParamsByLayout } from "@/helpers/issue.helper";
|
||||
import { handleIssueQueryParamsByLayout } from "@plane/utils";
|
||||
import { WorkspaceService } from "@/plane-web/services";
|
||||
import { IBaseIssueFilterStore, IssueFilterHelperStore } from "../helpers/issue-filter-helper.store";
|
||||
// helpers
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { computedFn } from "mobx-utils";
|
|||
// types
|
||||
import { IIssueLabel, IIssueLabelTree } from "@plane/types";
|
||||
// helpers
|
||||
import { buildTree } from "@/helpers/array.helper";
|
||||
import { buildTree } from "@plane/utils";
|
||||
// services
|
||||
import { syncIssuesWithDeletedLabels } from "@/local-db/utils/load-workspace";
|
||||
import { IssueLabelService } from "@/services/issue";
|
||||
|
|
|
|||
|
|
@ -6,9 +6,8 @@ import { action, computed, observable, makeObservable, runInAction } from "mobx"
|
|||
import { computedFn } from "mobx-utils";
|
||||
// types
|
||||
import { IModule, ILinkDetails, TModulePlotType } from "@plane/types";
|
||||
import { DistributionUpdates, updateDistribution, orderModules, shouldFilterModule } from "@plane/utils";
|
||||
// helpers
|
||||
import { DistributionUpdates, updateDistribution } from "@/helpers/distribution-update.helper";
|
||||
import { orderModules, shouldFilterModule } from "@/helpers/module.helper";
|
||||
// services
|
||||
import { syncIssuesWithDeletedModules } from "@/local-db/utils/load-workspace";
|
||||
import { ModuleService } from "@/services/module.service";
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import {
|
|||
TUnreadNotificationsCount,
|
||||
} from "@plane/types";
|
||||
// helpers
|
||||
import { convertToEpoch } from "@/helpers/date-time.helper";
|
||||
import { convertToEpoch } from "@plane/utils";
|
||||
// services
|
||||
import workspaceNotificationService from "@/services/workspace-notification.service";
|
||||
// store
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { computedFn } from "mobx-utils";
|
|||
import { EUserPermissions, EUserProjectRoles } from "@plane/constants";
|
||||
import { TPage, TPageFilters, TPageNavigationTabs } from "@plane/types";
|
||||
// helpers
|
||||
import { filterPagesByPageType, getPageName, orderPages, shouldFilterPage } from "@/helpers/page.helper";
|
||||
import { filterPagesByPageType, getPageName, orderPages, shouldFilterPage } from "@plane/utils";
|
||||
// plane web constants
|
||||
// plane web store
|
||||
import { RootStore } from "@/plane-web/store/root.store";
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { EViewAccess } from "@plane/constants";
|
|||
import { IProjectView, TPublishViewDetails, TPublishViewSettings, TViewFilters } from "@plane/types";
|
||||
// constants
|
||||
// helpers
|
||||
import { getValidatedViewFilters, getViewName, orderViews, shouldFilterView } from "@/helpers/project-views.helpers";
|
||||
import { getValidatedViewFilters, getViewName, orderViews, shouldFilterView } from "@plane/utils";
|
||||
// services
|
||||
import { ViewService } from "@/plane-web/services";
|
||||
// store
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import { computedFn } from "mobx-utils";
|
|||
// plane imports
|
||||
import { TFetchStatus, TLoader, TProjectAnalyticsCount, TProjectAnalyticsCountParams } from "@plane/types";
|
||||
// helpers
|
||||
import { orderProjects, shouldFilterProject } from "@/helpers/project.helper";
|
||||
import { orderProjects, shouldFilterProject } from "@plane/utils";
|
||||
// services
|
||||
import { TProject, TPartialProject } from "@/plane-web/types/projects";
|
||||
import { IssueLabelService, IssueService } from "@/services/issue";
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { computedFn } from "mobx-utils";
|
|||
import { STATE_GROUPS } from "@plane/constants";
|
||||
import { IState } from "@plane/types";
|
||||
// helpers
|
||||
import { sortStates } from "@/helpers/state.helper";
|
||||
import { sortStates } from "@plane/utils";
|
||||
// plane web
|
||||
import { syncIssuesWithDeletedStates } from "@/local-db/utils/load-workspace";
|
||||
import { ProjectStateService } from "@/plane-web/services/project/project-state.service";
|
||||
|
|
|
|||
|
|
@ -1,13 +1,12 @@
|
|||
import cloneDeep from "lodash/cloneDeep";
|
||||
import set from "lodash/set";
|
||||
import { action, makeObservable, observable, runInAction, computed } from "mobx";
|
||||
// plane imports
|
||||
import { EUserPermissions } from "@plane/constants";
|
||||
import { EUserPermissions, API_BASE_URL } from "@plane/constants";
|
||||
// types
|
||||
import { IUser } from "@plane/types";
|
||||
import { TUserPermissions } from "@plane/types/src/enums";
|
||||
// helpers
|
||||
import { API_BASE_URL } from "@/helpers/common.helper";
|
||||
// local db
|
||||
// local
|
||||
import { persistence } from "@/local-db/storage.sqlite";
|
||||
// plane web imports
|
||||
import { RootStore } from "@/plane-web/store/root.store";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue