fix: eslint config and errors

This commit is contained in:
sriram veeraghanta 2024-06-13 21:17:06 +05:30
parent a72d095e60
commit b8ee986636
72 changed files with 153 additions and 181 deletions

View File

@ -16,6 +16,7 @@ module.exports = {
}, },
}, },
rules: { rules: {
"no-useless-escape": "off",
"prefer-const": "error", "prefer-const": "error",
"no-irregular-whitespace": "error", "no-irregular-whitespace": "error",
"no-trailing-spaces": "error", "no-trailing-spaces": "error",
@ -36,6 +37,7 @@ module.exports = {
{ {
selector: ["function", "variable"], selector: ["function", "variable"],
format: ["camelCase", "snake_case", "UPPER_CASE", "PascalCase"], format: ["camelCase", "snake_case", "UPPER_CASE", "PascalCase"],
leadingUnderscore: "allow",
}, },
], ],
}, },

3
web/.eslintignore Normal file
View File

@ -0,0 +1,3 @@
.next/*
out/*
public/*

View File

@ -1,6 +1,4 @@
import { MutableRefObject } from "react";
import { observer } from "mobx-react"; import { observer } from "mobx-react";
import { MoreVertical } from "lucide-react";
// hooks // hooks
import { CycleGanttSidebarBlock } from "@/components/cycles"; import { CycleGanttSidebarBlock } from "@/components/cycles";
import { BLOCK_HEIGHT } from "@/components/gantt-chart/constants"; import { BLOCK_HEIGHT } from "@/components/gantt-chart/constants";

View File

@ -1,6 +1,5 @@
"use client"; "use client";
import { MutableRefObject } from "react";
// ui // ui
import { Loader } from "@plane/ui"; import { Loader } from "@plane/ui";
// components // components
@ -43,12 +42,7 @@ export const CycleGanttSidebar: React.FC<Props> = (props) => {
isDragEnabled={enableReorder} isDragEnabled={enableReorder}
onDrop={handleOnDrop} onDrop={handleOnDrop}
> >
{(isDragging: boolean) => ( {(isDragging: boolean) => <CyclesSidebarBlock block={block} isDragging={isDragging} />}
<CyclesSidebarBlock
block={block}
isDragging={isDragging}
/>
)}
</GanttDnDHOC> </GanttDnDHOC>
); );
}) })

View File

@ -1,6 +1,6 @@
"use client"; "use client";
import { MutableRefObject, useEffect, useRef, useState } from "react"; import { useEffect, useRef, useState } from "react";
import { combine } from "@atlaskit/pragmatic-drag-and-drop/combine"; import { combine } from "@atlaskit/pragmatic-drag-and-drop/combine";
import { draggable, dropTargetForElements } from "@atlaskit/pragmatic-drag-and-drop/element/adapter"; import { draggable, dropTargetForElements } from "@atlaskit/pragmatic-drag-and-drop/element/adapter";
import { attachInstruction, extractInstruction } from "@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item"; import { attachInstruction, extractInstruction } from "@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item";

View File

@ -1,6 +1,4 @@
import React, { MutableRefObject } from "react";
import { observer } from "mobx-react"; import { observer } from "mobx-react";
import { MoreVertical } from "lucide-react";
// components // components
import { MultipleSelectEntityAction } from "@/components/core"; import { MultipleSelectEntityAction } from "@/components/core";
import { useGanttChart } from "@/components/gantt-chart/hooks"; import { useGanttChart } from "@/components/gantt-chart/hooks";

View File

@ -1,6 +1,6 @@
"use client"; "use client";
import { RefObject, MutableRefObject, useState } from "react"; import { RefObject, useState } from "react";
import { observer } from "mobx-react"; import { observer } from "mobx-react";
// ui // ui
import { Loader } from "@plane/ui"; import { Loader } from "@plane/ui";
@ -38,7 +38,7 @@ export const IssueGanttSidebar: React.FC<Props> = observer((props) => {
canLoadMoreBlocks, canLoadMoreBlocks,
ganttContainerRef, ganttContainerRef,
showAllBlocks = false, showAllBlocks = false,
selectionHelpers selectionHelpers,
} = props; } = props;
const [intersectionElement, setIntersectionElement] = useState<HTMLDivElement | null>(null); const [intersectionElement, setIntersectionElement] = useState<HTMLDivElement | null>(null);

View File

@ -1,6 +1,4 @@
import { MutableRefObject } from "react";
import { observer } from "mobx-react"; import { observer } from "mobx-react";
import { MoreVertical } from "lucide-react";
// hooks // hooks
import { BLOCK_HEIGHT } from "@/components/gantt-chart/constants"; import { BLOCK_HEIGHT } from "@/components/gantt-chart/constants";
import { useGanttChart } from "@/components/gantt-chart/hooks"; import { useGanttChart } from "@/components/gantt-chart/hooks";

View File

@ -1,6 +1,5 @@
"use client"; "use client";
import { MutableRefObject } from "react";
// ui // ui
import { Loader } from "@plane/ui"; import { Loader } from "@plane/ui";
// components // components

View File

@ -8,12 +8,12 @@ import { Button } from "@plane/ui";
// helpers // helpers
import { GOD_MODE_URL } from "@/helpers/common.helper"; import { GOD_MODE_URL } from "@/helpers/common.helper";
// images // images
import PlaneTakeOffImage from "@/public/plane-takeoff.png";
// assets // assets
import PlaneBackgroundPatternDark from "@/public/auth/background-pattern-dark.svg"; import PlaneBackgroundPatternDark from "@/public/auth/background-pattern-dark.svg";
import PlaneBackgroundPattern from "@/public/auth/background-pattern.svg"; import PlaneBackgroundPattern from "@/public/auth/background-pattern.svg";
import BlackHorizontalLogo from "@/public/plane-logos/black-horizontal-with-blue-logo.png"; import BlackHorizontalLogo from "@/public/plane-logos/black-horizontal-with-blue-logo.png";
import WhiteHorizontalLogo from "@/public/plane-logos/white-horizontal-with-blue-logo.png"; import WhiteHorizontalLogo from "@/public/plane-logos/white-horizontal-with-blue-logo.png";
import PlaneTakeOffImage from "@/public/plane-takeoff.png";
export const InstanceNotReady: FC = () => { export const InstanceNotReady: FC = () => {
const { resolvedTheme } = useTheme(); const { resolvedTheme } = useTheme();

View File

@ -25,8 +25,8 @@ import {
// icons // icons
// images // images
import { APP_INTEGRATIONS, IMPORTER_SERVICES_LIST, WORKSPACE_INTEGRATIONS } from "@/constants/fetch-keys"; import { APP_INTEGRATIONS, IMPORTER_SERVICES_LIST, WORKSPACE_INTEGRATIONS } from "@/constants/fetch-keys";
import { IntegrationService, GithubIntegrationService } from "@/services/integrations";
import GithubLogo from "@/public/services/github.png"; import GithubLogo from "@/public/services/github.png";
import { IntegrationService, GithubIntegrationService } from "@/services/integrations";
// hooks // hooks
// components // components
// icons // icons

View File

@ -15,8 +15,8 @@ import { IJiraImporterForm } from "@plane/types";
import { Button } from "@plane/ui"; import { Button } from "@plane/ui";
import { IMPORTER_SERVICES_LIST } from "@/constants/fetch-keys"; import { IMPORTER_SERVICES_LIST } from "@/constants/fetch-keys";
// assets // assets
import { JiraImporterService } from "@/services/integrations";
import JiraLogo from "@/public/services/jira.svg"; import JiraLogo from "@/public/services/jira.svg";
import { JiraImporterService } from "@/services/integrations";
// types // types
import { import {
JiraGetImportDetail, JiraGetImportDetail,

View File

@ -16,10 +16,10 @@ import { useUser, useInstance } from "@/hooks/store";
import useIntegrationPopup from "@/hooks/use-integration-popup"; import useIntegrationPopup from "@/hooks/use-integration-popup";
import { usePlatformOS } from "@/hooks/use-platform-os"; import { usePlatformOS } from "@/hooks/use-platform-os";
// services // services
import { IntegrationService } from "@/services/integrations";
// icons // icons
import GithubLogo from "@/public/services/github.png"; import GithubLogo from "@/public/services/github.png";
import SlackLogo from "@/public/services/slack.png"; import SlackLogo from "@/public/services/slack.png";
import { IntegrationService } from "@/services/integrations";
type Props = { type Props = {
integration: IAppIntegration; integration: IAppIntegration;

View File

@ -30,10 +30,10 @@ import { getUserRole } from "@/helpers/user.helper";
import { useEventTracker } from "@/hooks/store"; import { useEventTracker } from "@/hooks/store";
import useDynamicDropdownPosition from "@/hooks/use-dynamic-dropdown"; import useDynamicDropdownPosition from "@/hooks/use-dynamic-dropdown";
// services // services
import { WorkspaceService } from "@/services/workspace.service";
// assets // assets
import InviteMembersDark from "@/public/onboarding/invite-members-dark.svg"; import InviteMembersDark from "@/public/onboarding/invite-members-dark.svg";
import InviteMembersLight from "@/public/onboarding/invite-members-light.svg"; import InviteMembersLight from "@/public/onboarding/invite-members-light.svg";
import { WorkspaceService } from "@/services/workspace.service";
// components // components
import { OnboardingHeader } from "./header"; import { OnboardingHeader } from "./header";
import { SwitchAccountDropdown } from "./switch-account-dropdown"; import { SwitchAccountDropdown } from "./switch-account-dropdown";

View File

@ -21,13 +21,13 @@ import { getPasswordStrength } from "@/helpers/password.helper";
// hooks // hooks
import { useEventTracker, useUser, useUserProfile } from "@/hooks/store"; import { useEventTracker, useUser, useUserProfile } from "@/hooks/store";
// services // services
import { AuthService } from "@/services/auth.service";
import { FileService } from "@/services/file.service";
// assets // assets
import ProfileSetupDark from "@/public/onboarding/profile-setup-dark.svg"; import ProfileSetupDark from "@/public/onboarding/profile-setup-dark.svg";
import ProfileSetupLight from "@/public/onboarding/profile-setup-light.svg"; import ProfileSetupLight from "@/public/onboarding/profile-setup-light.svg";
import UserPersonalizationDark from "@/public/onboarding/user-personalization-dark.svg"; import UserPersonalizationDark from "@/public/onboarding/user-personalization-dark.svg";
import UserPersonalizationLight from "@/public/onboarding/user-personalization-light.svg"; import UserPersonalizationLight from "@/public/onboarding/user-personalization-light.svg";
import { AuthService } from "@/services/auth.service";
import { FileService } from "@/services/file.service";
type TProfileSetupFormValues = { type TProfileSetupFormValues = {
first_name: string; first_name: string;

View File

@ -15,9 +15,9 @@ import { calculateTimeAgo } from "@/helpers/date-time.helper";
//hooks //hooks
// services // services
import { useUser } from "@/hooks/store"; import { useUser } from "@/hooks/store";
import recentActivityEmptyState from "@/public/empty-state/recent_activity.svg";
import { UserService } from "@/services/user.service"; import { UserService } from "@/services/user.service";
// assets // assets
import recentActivityEmptyState from "@/public/empty-state/recent_activity.svg";
const userService = new UserService(); const userService = new UserService();

View File

@ -12,9 +12,9 @@ import { SelectRepository, SelectChannel } from "@/components/integration";
// constants // constants
import { PROJECT_GITHUB_REPOSITORY } from "@/constants/fetch-keys"; import { PROJECT_GITHUB_REPOSITORY } from "@/constants/fetch-keys";
// icons // icons
import { ProjectService } from "@/services/project";
import GithubLogo from "@/public/logos/github-square.png"; import GithubLogo from "@/public/logos/github-square.png";
import SlackLogo from "@/public/services/slack.png"; import SlackLogo from "@/public/services/slack.png";
import { ProjectService } from "@/services/project";
// types // types
type Props = { type Props = {

View File

@ -11,7 +11,7 @@ import { CustomSelect, TOAST_TYPE, Tooltip, setToast } from "@plane/ui";
// components // components
import { ConfirmWorkspaceMemberRemove } from "@/components/workspace"; import { ConfirmWorkspaceMemberRemove } from "@/components/workspace";
// constants // constants
import { WORKSPACE_MEMBER_lEAVE } from "@/constants/event-tracker"; import { WORKSPACE_MEMBER_LEAVE } from "@/constants/event-tracker";
import { EUserWorkspaceRoles, ROLE } from "@/constants/workspace"; import { EUserWorkspaceRoles, ROLE } from "@/constants/workspace";
// hooks // hooks
import { useEventTracker, useMember, useUser } from "@/hooks/store"; import { useEventTracker, useMember, useUser } from "@/hooks/store";
@ -48,7 +48,7 @@ export const WorkspaceMembersListItem: FC<Props> = observer((props) => {
await leaveWorkspace(workspaceSlug.toString()) await leaveWorkspace(workspaceSlug.toString())
.then(() => { .then(() => {
captureEvent(WORKSPACE_MEMBER_lEAVE, { captureEvent(WORKSPACE_MEMBER_LEAVE, {
state: "SUCCESS", state: "SUCCESS",
element: "Workspace settings members page", element: "Workspace settings members page",
}); });

View File

@ -183,7 +183,7 @@ export const MEMBER_INVITED = "Member invited";
export const MEMBER_ACCEPTED = "Member accepted"; export const MEMBER_ACCEPTED = "Member accepted";
export const PROJECT_MEMBER_ADDED = "Project member added"; export const PROJECT_MEMBER_ADDED = "Project member added";
export const PROJECT_MEMBER_LEAVE = "Project member leave"; export const PROJECT_MEMBER_LEAVE = "Project member leave";
export const WORKSPACE_MEMBER_lEAVE = "Workspace member leave"; export const WORKSPACE_MEMBER_LEAVE = "Workspace member leave";
// Sign-in & Sign-up Events // Sign-in & Sign-up Events
export const NAVIGATE_TO_SIGNUP = "Navigate to sign-up page"; export const NAVIGATE_TO_SIGNUP = "Navigate to sign-up page";
export const NAVIGATE_TO_SIGNIN = "Navigate to sign-in page"; export const NAVIGATE_TO_SIGNIN = "Navigate to sign-in page";

View File

@ -1,6 +1,7 @@
import { useContext } from "react"; import { useContext } from "react";
import merge from "lodash/merge"; import merge from "lodash/merge";
// mobx store // mobx store
import { TIssueMap } from "@plane/types";
import { EIssuesStoreType } from "@/constants/issue"; import { EIssuesStoreType } from "@/constants/issue";
import { StoreContext } from "@/lib/store-context"; import { StoreContext } from "@/lib/store-context";
// types // types
@ -12,7 +13,6 @@ import { IProfileIssues, IProfileIssuesFilter } from "@/store/issue/profile";
import { IProjectIssues, IProjectIssuesFilter } from "@/store/issue/project"; import { IProjectIssues, IProjectIssuesFilter } from "@/store/issue/project";
import { IProjectViewIssues, IProjectViewIssuesFilter } from "@/store/issue/project-views"; import { IProjectViewIssues, IProjectViewIssuesFilter } from "@/store/issue/project-views";
import { IWorkspaceIssues, IWorkspaceIssuesFilter } from "@/store/issue/workspace"; import { IWorkspaceIssues, IWorkspaceIssuesFilter } from "@/store/issue/workspace";
import { TIssueMap } from "@plane/types";
// constants // constants
type defaultIssueStore = { type defaultIssueStore = {

View File

@ -1,5 +1,5 @@
import { EIssuesStoreType } from "@/constants/issue";
import { createContext, useContext } from "react"; import { createContext, useContext } from "react";
import { EIssuesStoreType } from "@/constants/issue";
import { useIssues } from "./store"; import { useIssues } from "./store";
export const IssuesStoreContext = createContext<EIssuesStoreType>(EIssuesStoreType.PROJECT); export const IssuesStoreContext = createContext<EIssuesStoreType>(EIssuesStoreType.PROJECT);

View File

@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { useCallback, useEffect, useState } from "react"; import { useCallback, useEffect, useState } from "react";
import { useRouter } from "next/navigation"; import { useRouter } from "next/navigation";

View File

@ -79,7 +79,7 @@ const useUserNotification = (): any => {
}, false); }, false);
}; };
const mutateNotification = (notificationId: string, value: Object) => { const mutateNotification = (notificationId: string, value: object) => {
notificationMutate((previousNotifications: any) => { notificationMutate((previousNotifications: any) => {
if (!previousNotifications) return previousNotifications; if (!previousNotifications) return previousNotifications;

View File

@ -1,7 +1,4 @@
// services // services
import { API_BASE_URL } from "@/helpers/common.helper";
import { APIService } from "@/services/api.service";
// types
import { import {
IAnalyticsParams, IAnalyticsParams,
IAnalyticsResponse, IAnalyticsResponse,
@ -9,6 +6,9 @@ import {
IExportAnalyticsFormData, IExportAnalyticsFormData,
ISaveAnalyticsFormData, ISaveAnalyticsFormData,
} from "@plane/types"; } from "@plane/types";
import { API_BASE_URL } from "@/helpers/common.helper";
import { APIService } from "@/services/api.service";
// types
// helpers // helpers
export class AnalyticsService extends APIService { export class AnalyticsService extends APIService {

View File

@ -1,5 +1,5 @@
import { API_BASE_URL } from "@/helpers/common.helper";
import { IApiToken } from "@plane/types"; import { IApiToken } from "@plane/types";
import { API_BASE_URL } from "@/helpers/common.helper";
import { APIService } from "./api.service"; import { APIService } from "./api.service";
export class APITokenService extends APIService { export class APITokenService extends APIService {
@ -15,7 +15,7 @@ export class APITokenService extends APIService {
}); });
} }
async retrieveApiToken(workspaceSlug: string, tokenId: String): Promise<IApiToken> { async retrieveApiToken(workspaceSlug: string, tokenId: string): Promise<IApiToken> {
return this.get(`/api/workspaces/${workspaceSlug}/api-tokens/${tokenId}`) return this.get(`/api/workspaces/${workspaceSlug}/api-tokens/${tokenId}`)
.then((response) => response?.data) .then((response) => response?.data)
.catch((error) => { .catch((error) => {
@ -31,7 +31,7 @@ export class APITokenService extends APIService {
}); });
} }
async deleteApiToken(workspaceSlug: string, tokenId: String): Promise<IApiToken> { async deleteApiToken(workspaceSlug: string, tokenId: string): Promise<IApiToken> {
return this.delete(`/api/workspaces/${workspaceSlug}/api-tokens/${tokenId}`) return this.delete(`/api/workspaces/${workspaceSlug}/api-tokens/${tokenId}`)
.then((response) => response?.data) .then((response) => response?.data)
.catch((error) => { .catch((error) => {

View File

@ -1,8 +1,8 @@
// services // services
import type { CycleDateCheckData, ICycle, TIssuesResponse } from "@plane/types";
import { API_BASE_URL } from "@/helpers/common.helper"; import { API_BASE_URL } from "@/helpers/common.helper";
import { APIService } from "@/services/api.service"; import { APIService } from "@/services/api.service";
// types // types
import type { CycleDateCheckData, ICycle, TIssuesResponse } from "@plane/types";
// helpers // helpers
export class CycleService extends APIService { export class CycleService extends APIService {

View File

@ -1,8 +1,8 @@
import { THomeDashboardResponse, TWidget, TWidgetStatsResponse, TWidgetStatsRequestParams } from "@plane/types";
import { API_BASE_URL } from "@/helpers/common.helper"; import { API_BASE_URL } from "@/helpers/common.helper";
import { APIService } from "@/services/api.service"; import { APIService } from "@/services/api.service";
// helpers // helpers
// types // types
import { THomeDashboardResponse, TWidget, TWidgetStatsResponse, TWidgetStatsRequestParams } from "@plane/types";
export class DashboardService extends APIService { export class DashboardService extends APIService {
constructor() { constructor() {

View File

@ -1,8 +1,8 @@
import { IGithubRepoInfo, IGithubServiceImportFormData } from "@plane/types";
import { API_BASE_URL } from "@/helpers/common.helper"; import { API_BASE_URL } from "@/helpers/common.helper";
import { APIService } from "@/services/api.service"; import { APIService } from "@/services/api.service";
// helpers // helpers
// types // types
import { IGithubRepoInfo, IGithubServiceImportFormData } from "@plane/types";
const integrationServiceType: string = "github"; const integrationServiceType: string = "github";

View File

@ -1,7 +1,7 @@
import { IAppIntegration, IImporterService, IWorkspaceIntegration, IExportServiceResponse } from "@plane/types";
import { API_BASE_URL } from "@/helpers/common.helper"; import { API_BASE_URL } from "@/helpers/common.helper";
import { APIService } from "@/services/api.service"; import { APIService } from "@/services/api.service";
// types // types
import { IAppIntegration, IImporterService, IWorkspaceIntegration, IExportServiceResponse } from "@plane/types";
// helper // helper
export class IntegrationService extends APIService { export class IntegrationService extends APIService {

View File

@ -1,7 +1,7 @@
import { IJiraMetadata, IJiraResponse, IJiraImporterForm } from "@plane/types";
import { API_BASE_URL } from "@/helpers/common.helper"; import { API_BASE_URL } from "@/helpers/common.helper";
import { APIService } from "@/services/api.service"; import { APIService } from "@/services/api.service";
// types // types
import { IJiraMetadata, IJiraResponse, IJiraImporterForm } from "@plane/types";
export class JiraImporterService extends APIService { export class JiraImporterService extends APIService {
constructor() { constructor() {

View File

@ -1,7 +1,7 @@
import { TIssueActivity } from "@plane/types";
import { API_BASE_URL } from "@/helpers/common.helper"; import { API_BASE_URL } from "@/helpers/common.helper";
import { APIService } from "@/services/api.service"; import { APIService } from "@/services/api.service";
// types // types
import { TIssueActivity } from "@plane/types";
// helper // helper
export class IssueActivityService extends APIService { export class IssueActivityService extends APIService {
@ -17,7 +17,7 @@ export class IssueActivityService extends APIService {
| { | {
created_at__gt: string; created_at__gt: string;
} }
| {} = {} | object = {}
): Promise<TIssueActivity[]> { ): Promise<TIssueActivity[]> {
return this.get(`/api/workspaces/${workspaceSlug}/projects/${projectId}/issues/${issueId}/history/`, { return this.get(`/api/workspaces/${workspaceSlug}/projects/${projectId}/issues/${issueId}/history/`, {
params: { params: {

View File

@ -1,7 +1,7 @@
import { TIssue } from "@plane/types";
import { API_BASE_URL } from "@/helpers/common.helper"; import { API_BASE_URL } from "@/helpers/common.helper";
import { APIService } from "@/services/api.service"; import { APIService } from "@/services/api.service";
// types // types
import { TIssue } from "@plane/types";
// constants // constants
export class IssueArchiveService extends APIService { export class IssueArchiveService extends APIService {

View File

@ -1,7 +1,7 @@
import { TIssueComment } from "@plane/types";
import { API_BASE_URL } from "@/helpers/common.helper"; import { API_BASE_URL } from "@/helpers/common.helper";
import { APIService } from "@/services/api.service"; import { APIService } from "@/services/api.service";
// types // types
import { TIssueComment } from "@plane/types";
// helper // helper
export class IssueCommentService extends APIService { export class IssueCommentService extends APIService {
@ -17,7 +17,7 @@ export class IssueCommentService extends APIService {
| { | {
created_at__gt: string; created_at__gt: string;
} }
| {} = {} | object = {}
): Promise<TIssueComment[]> { ): Promise<TIssueComment[]> {
return this.get(`/api/workspaces/${workspaceSlug}/projects/${projectId}/issues/${issueId}/history/`, { return this.get(`/api/workspaces/${workspaceSlug}/projects/${projectId}/issues/${issueId}/history/`, {
params: { params: {

View File

@ -1,7 +1,7 @@
import { TIssue, TIssuesResponse } from "@plane/types";
import { API_BASE_URL } from "@/helpers/common.helper"; import { API_BASE_URL } from "@/helpers/common.helper";
import { APIService } from "@/services/api.service"; import { APIService } from "@/services/api.service";
// helpers // helpers
import { TIssue, TIssuesResponse } from "@plane/types";
export class IssueDraftService extends APIService { export class IssueDraftService extends APIService {
constructor() { constructor() {

View File

@ -1,8 +1,8 @@
import { IIssueLabel } from "@plane/types";
import { API_BASE_URL } from "@/helpers/common.helper"; import { API_BASE_URL } from "@/helpers/common.helper";
// services // services
import { APIService } from "@/services/api.service"; import { APIService } from "@/services/api.service";
// types // types
import { IIssueLabel } from "@plane/types";
export class IssueLabelService extends APIService { export class IssueLabelService extends APIService {
constructor() { constructor() {

View File

@ -1,8 +1,8 @@
import type { TIssueCommentReaction, TIssueReaction } from "@plane/types";
import { API_BASE_URL } from "@/helpers/common.helper"; import { API_BASE_URL } from "@/helpers/common.helper";
// services // services
import { APIService } from "@/services/api.service"; import { APIService } from "@/services/api.service";
// types // types
import type { TIssueCommentReaction, TIssueReaction } from "@plane/types";
export class IssueReactionService extends APIService { export class IssueReactionService extends APIService {
constructor() { constructor() {

View File

@ -1,8 +1,8 @@
import type { TIssueRelation, TIssue, TIssueRelationTypes } from "@plane/types";
import { API_BASE_URL } from "@/helpers/common.helper"; import { API_BASE_URL } from "@/helpers/common.helper";
// services // services
import { APIService } from "@/services/api.service"; import { APIService } from "@/services/api.service";
// types // types
import type { TIssueRelation, TIssue, TIssueRelationTypes } from "@plane/types";
export class IssueRelationService extends APIService { export class IssueRelationService extends APIService {
constructor() { constructor() {

View File

@ -1,8 +1,8 @@
// services // services
import type { IIssueFiltersResponse } from "@plane/types";
import { API_BASE_URL } from "@/helpers/common.helper"; import { API_BASE_URL } from "@/helpers/common.helper";
import { APIService } from "@/services/api.service"; import { APIService } from "@/services/api.service";
// types // types
import type { IIssueFiltersResponse } from "@plane/types";
export class IssueFiltersService extends APIService { export class IssueFiltersService extends APIService {
constructor() { constructor() {

View File

@ -1,7 +1,4 @@
// services // services
import { API_BASE_URL } from "@/helpers/common.helper";
import { APIService } from "@/services/api.service";
// types
import type { import type {
IUserNotification, IUserNotification,
INotificationParams, INotificationParams,
@ -9,6 +6,9 @@ import type {
PaginatedUserNotification, PaginatedUserNotification,
IMarkAllAsReadPayload, IMarkAllAsReadPayload,
} from "@plane/types"; } from "@plane/types";
import { API_BASE_URL } from "@/helpers/common.helper";
import { APIService } from "@/services/api.service";
// types
// helpers // helpers
export class NotificationService extends APIService { export class NotificationService extends APIService {

View File

@ -1,9 +1,9 @@
// services // services
import type { IState } from "@plane/types";
import { API_BASE_URL } from "@/helpers/common.helper"; import { API_BASE_URL } from "@/helpers/common.helper";
import { APIService } from "@/services/api.service"; import { APIService } from "@/services/api.service";
// helpers // helpers
// types // types
import type { IState } from "@plane/types";
export class ProjectStateService extends APIService { export class ProjectStateService extends APIService {
constructor() { constructor() {

View File

@ -1,7 +1,7 @@
import { IProjectView } from "@plane/types";
import { API_BASE_URL } from "@/helpers/common.helper"; import { API_BASE_URL } from "@/helpers/common.helper";
import { APIService } from "@/services/api.service"; import { APIService } from "@/services/api.service";
// types // types
import { IProjectView } from "@plane/types";
// helpers // helpers
export class ViewService extends APIService { export class ViewService extends APIService {

View File

@ -1,9 +1,9 @@
// api services // api services
import { IWebhook } from "@plane/types";
import { API_BASE_URL } from "@/helpers/common.helper"; import { API_BASE_URL } from "@/helpers/common.helper";
import { APIService } from "@/services/api.service"; import { APIService } from "@/services/api.service";
// helpers // helpers
// types // types
import { IWebhook } from "@plane/types";
export class WebhookService extends APIService { export class WebhookService extends APIService {
constructor() { constructor() {
@ -26,7 +26,7 @@ export class WebhookService extends APIService {
}); });
} }
async createWebhook(workspaceSlug: string, data: {}): Promise<IWebhook> { async createWebhook(workspaceSlug: string, data = {}): Promise<IWebhook> {
return this.post(`/api/workspaces/${workspaceSlug}/webhooks/`, data) return this.post(`/api/workspaces/${workspaceSlug}/webhooks/`, data)
.then((response) => response?.data) .then((response) => response?.data)
.catch((error) => { .catch((error) => {
@ -34,7 +34,7 @@ export class WebhookService extends APIService {
}); });
} }
async updateWebhook(workspaceSlug: string, webhookId: string, data: {}): Promise<IWebhook> { async updateWebhook(workspaceSlug: string, webhookId: string, data = {}): Promise<IWebhook> {
return this.patch(`/api/workspaces/${workspaceSlug}/webhooks/${webhookId}/`, data) return this.patch(`/api/workspaces/${workspaceSlug}/webhooks/${webhookId}/`, data)
.then((response) => response?.data) .then((response) => response?.data)
.catch((error) => { .catch((error) => {

View File

@ -1,8 +1,4 @@
// services // services
import { API_BASE_URL } from "@/helpers/common.helper";
import { APIService } from "@/services/api.service";
// helpers
// types
import { import {
IWorkspace, IWorkspace,
IWorkspaceMemberMe, IWorkspaceMemberMe,
@ -17,6 +13,10 @@ import {
IWorkspaceView, IWorkspaceView,
TIssuesResponse, TIssuesResponse,
} from "@plane/types"; } from "@plane/types";
import { API_BASE_URL } from "@/helpers/common.helper";
import { APIService } from "@/services/api.service";
// helpers
// types
export class WorkspaceService extends APIService { export class WorkspaceService extends APIService {
constructor() { constructor() {

View File

@ -4,9 +4,7 @@ import pickBy from "lodash/pickBy";
import set from "lodash/set"; import set from "lodash/set";
import { action, computed, makeObservable, observable, runInAction } from "mobx"; import { action, computed, makeObservable, observable, runInAction } from "mobx";
// base class // base class
import { EIssueFilterType, EIssuesStoreType } from "@/constants/issue"; import { computedFn } from "mobx-utils";
import { handleIssueQueryParamsByLayout } from "@/helpers/issue.helper";
import { IssueFiltersService } from "@/services/issue_filter.service";
import { import {
IIssueFilterOptions, IIssueFilterOptions,
IIssueDisplayFilterOptions, IIssueDisplayFilterOptions,
@ -16,11 +14,13 @@ import {
TIssueParams, TIssueParams,
IssuePaginationOptions, IssuePaginationOptions,
} from "@plane/types"; } from "@plane/types";
import { EIssueFilterType, EIssuesStoreType } from "@/constants/issue";
import { handleIssueQueryParamsByLayout } from "@/helpers/issue.helper";
import { IssueFiltersService } from "@/services/issue_filter.service";
import { IBaseIssueFilterStore, IssueFilterHelperStore } from "../helpers/issue-filter-helper.store"; import { IBaseIssueFilterStore, IssueFilterHelperStore } from "../helpers/issue-filter-helper.store";
// helpers // helpers
// types // types
import { IIssueRootStore } from "../root.store"; import { IIssueRootStore } from "../root.store";
import { computedFn } from "mobx-utils";
// constants // constants
// services // services

View File

@ -3,9 +3,9 @@ import { action, makeObservable, runInAction } from "mobx";
import { TLoader, IssuePaginationOptions, TIssuesResponse, ViewFlags, TBulkOperationsPayload } from "@plane/types"; import { TLoader, IssuePaginationOptions, TIssuesResponse, ViewFlags, TBulkOperationsPayload } from "@plane/types";
// services // services
// types // types
import { BaseIssuesStore, IBaseIssuesStore } from "../helpers/base-issues.store";
import { IIssueRootStore } from "../root.store"; import { IIssueRootStore } from "../root.store";
import { IArchivedIssuesFilter } from "./filter.store"; import { IArchivedIssuesFilter } from "./filter.store";
import { BaseIssuesStore, IBaseIssuesStore } from "../helpers/base-issues.store";
export interface IArchivedIssues extends IBaseIssuesStore { export interface IArchivedIssues extends IBaseIssuesStore {
// observable // observable

View File

@ -4,9 +4,7 @@ import pickBy from "lodash/pickBy";
import set from "lodash/set"; import set from "lodash/set";
import { action, computed, makeObservable, observable, runInAction } from "mobx"; import { action, computed, makeObservable, observable, runInAction } from "mobx";
// base class // base class
import { EIssueFilterType, EIssuesStoreType } from "@/constants/issue"; import { computedFn } from "mobx-utils";
import { handleIssueQueryParamsByLayout } from "@/helpers/issue.helper";
import { IssueFiltersService } from "@/services/issue_filter.service";
import { import {
IIssueFilterOptions, IIssueFilterOptions,
IIssueDisplayFilterOptions, IIssueDisplayFilterOptions,
@ -16,11 +14,13 @@ import {
TIssueParams, TIssueParams,
IssuePaginationOptions, IssuePaginationOptions,
} from "@plane/types"; } from "@plane/types";
import { EIssueFilterType, EIssuesStoreType } from "@/constants/issue";
import { handleIssueQueryParamsByLayout } from "@/helpers/issue.helper";
import { IssueFiltersService } from "@/services/issue_filter.service";
import { IBaseIssueFilterStore, IssueFilterHelperStore } from "../helpers/issue-filter-helper.store"; import { IBaseIssueFilterStore, IssueFilterHelperStore } from "../helpers/issue-filter-helper.store";
// helpers // helpers
// types // types
import { IIssueRootStore } from "../root.store"; import { IIssueRootStore } from "../root.store";
import { computedFn } from "mobx-utils";
// constants // constants
// services // services

View File

@ -1,4 +1,3 @@
import { action, observable, makeObservable, runInAction } from "mobx";
// base class // base class
// types // types
import concat from "lodash/concat"; import concat from "lodash/concat";
@ -6,7 +5,9 @@ import get from "lodash/get";
import set from "lodash/set"; import set from "lodash/set";
import uniq from "lodash/uniq"; import uniq from "lodash/uniq";
import update from "lodash/update"; import update from "lodash/update";
import { action, observable, makeObservable, runInAction } from "mobx";
// types // types
import { computedFn } from "mobx-utils";
import { import {
TIssue, TIssue,
TLoader, TLoader,
@ -15,11 +16,10 @@ import {
ViewFlags, ViewFlags,
TBulkOperationsPayload, TBulkOperationsPayload,
} from "@plane/types"; } from "@plane/types";
import { IIssueRootStore } from "../root.store";
import { BaseIssuesStore, IBaseIssuesStore } from "../helpers/base-issues.store";
import { ICycleIssuesFilter } from "./filter.store";
import { computedFn } from "mobx-utils";
import { ALL_ISSUES } from "@/constants/issue"; import { ALL_ISSUES } from "@/constants/issue";
import { BaseIssuesStore, IBaseIssuesStore } from "../helpers/base-issues.store";
import { IIssueRootStore } from "../root.store";
import { ICycleIssuesFilter } from "./filter.store";
export const ACTIVE_CYCLE_ISSUES = "ACTIVE_CYCLE_ISSUES"; export const ACTIVE_CYCLE_ISSUES = "ACTIVE_CYCLE_ISSUES";
@ -369,9 +369,7 @@ export class CycleIssues extends BaseIssuesStore implements ICycleIssues {
set(this.activeCycleIds, [cycleId, "nextCursor"], response.next_cursor); set(this.activeCycleIds, [cycleId, "nextCursor"], response.next_cursor);
set(this.activeCycleIds, [cycleId, "nextPageResults"], response.next_page_results); set(this.activeCycleIds, [cycleId, "nextPageResults"], response.next_page_results);
set(this.activeCycleIds, [cycleId, "issueCount"], response.total_count); set(this.activeCycleIds, [cycleId, "issueCount"], response.total_count);
update(this.activeCycleIds, [cycleId, "issueIds"], (issueIds: string[] = []) => { update(this.activeCycleIds, [cycleId, "issueIds"], (issueIds: string[] = []) => this.issuesSortWithOrderBy(uniq(concat(issueIds, activeIssueIds)), this.orderBy));
return this.issuesSortWithOrderBy(uniq(concat(issueIds, activeIssueIds)), this.orderBy);
});
return response; return response;
} catch (error) { } catch (error) {

View File

@ -4,9 +4,7 @@ import pickBy from "lodash/pickBy";
import set from "lodash/set"; import set from "lodash/set";
import { action, computed, makeObservable, observable, runInAction } from "mobx"; import { action, computed, makeObservable, observable, runInAction } from "mobx";
// base class // base class
import { EIssueFilterType, EIssuesStoreType } from "@/constants/issue"; import { computedFn } from "mobx-utils";
import { handleIssueQueryParamsByLayout } from "@/helpers/issue.helper";
import { IssueFiltersService } from "@/services/issue_filter.service";
import { import {
IIssueFilterOptions, IIssueFilterOptions,
IIssueDisplayFilterOptions, IIssueDisplayFilterOptions,
@ -16,11 +14,13 @@ import {
TIssueParams, TIssueParams,
IssuePaginationOptions, IssuePaginationOptions,
} from "@plane/types"; } from "@plane/types";
import { EIssueFilterType, EIssuesStoreType } from "@/constants/issue";
import { handleIssueQueryParamsByLayout } from "@/helpers/issue.helper";
import { IssueFiltersService } from "@/services/issue_filter.service";
import { IBaseIssueFilterStore, IssueFilterHelperStore } from "../helpers/issue-filter-helper.store"; import { IBaseIssueFilterStore, IssueFilterHelperStore } from "../helpers/issue-filter-helper.store";
// helpers // helpers
// types // types
import { IIssueRootStore } from "../root.store"; import { IIssueRootStore } from "../root.store";
import { computedFn } from "mobx-utils";
// constants // constants
// services // services

View File

@ -3,9 +3,9 @@ import { action, makeObservable, runInAction } from "mobx";
// services // services
// types // types
import { TIssue, TLoader, ViewFlags, IssuePaginationOptions, TIssuesResponse, TBulkOperationsPayload } from "@plane/types"; import { TIssue, TLoader, ViewFlags, IssuePaginationOptions, TIssuesResponse, TBulkOperationsPayload } from "@plane/types";
import { BaseIssuesStore, IBaseIssuesStore } from "../helpers/base-issues.store";
import { IIssueRootStore } from "../root.store"; import { IIssueRootStore } from "../root.store";
import { IDraftIssuesFilter } from "./filter.store"; import { IDraftIssuesFilter } from "./filter.store";
import { BaseIssuesStore, IBaseIssuesStore } from "../helpers/base-issues.store";
export interface IDraftIssues extends IBaseIssuesStore { export interface IDraftIssues extends IBaseIssuesStore {
// observable // observable

View File

@ -1,8 +1,8 @@
import isEmpty from "lodash/isEmpty"; import isEmpty from "lodash/isEmpty";
import { EIssueGroupedAction } from "./base-issues.store";
import uniq from "lodash/uniq"; import uniq from "lodash/uniq";
import { TIssue } from "@plane/types"; import { TIssue } from "@plane/types";
import { ALL_ISSUES } from "@/constants/issue"; import { ALL_ISSUES } from "@/constants/issue";
import { EIssueGroupedAction } from "./base-issues.store";
/** /**
* returns, * returns,
@ -172,6 +172,4 @@ export const getSortOrderToFilterEmptyValues = (key: string, object: any) => {
}; };
// get IssueIds from Issue data List // get IssueIds from Issue data List
export const getIssueIds = (issues: TIssue[]) => { export const getIssueIds = (issues: TIssue[]) => issues.map((issue) => issue?.id);
return issues.map((issue) => issue?.id);
};

View File

@ -1,16 +1,17 @@
import { action, computed, makeObservable, observable, runInAction } from "mobx";
import { computedFn } from "mobx-utils";
import update from "lodash/update";
import uniq from "lodash/uniq";
import concat from "lodash/concat";
import pull from "lodash/pull";
import orderBy from "lodash/orderBy";
import clone from "lodash/clone"; import clone from "lodash/clone";
import indexOf from "lodash/indexOf"; import concat from "lodash/concat";
import set from "lodash/set";
import get from "lodash/get"; import get from "lodash/get";
import indexOf from "lodash/indexOf";
import isEmpty from "lodash/isEmpty";
import isEqual from "lodash/isEqual"; import isEqual from "lodash/isEqual";
import isNil from "lodash/isNil"; import isNil from "lodash/isNil";
import orderBy from "lodash/orderBy";
import pull from "lodash/pull";
import set from "lodash/set";
import uniq from "lodash/uniq";
import update from "lodash/update";
import { action, computed, makeObservable, observable, runInAction } from "mobx";
import { computedFn } from "mobx-utils";
// types // types
import { import {
TIssue, TIssue,
@ -27,15 +28,12 @@ import {
TPaginationData, TPaginationData,
TBulkOperationsPayload, TBulkOperationsPayload,
} from "@plane/types"; } from "@plane/types";
import { IIssueRootStore } from "../root.store";
import { IBaseIssueFilterStore } from "./issue-filter-helper.store";
// constants
import { ALL_ISSUES, EIssueLayoutTypes, ISSUE_PRIORITIES } from "@/constants/issue"; import { ALL_ISSUES, EIssueLayoutTypes, ISSUE_PRIORITIES } from "@/constants/issue";
// helpers import { convertToISODateString } from "@/helpers/date-time.helper";
// services import { CycleService } from "@/services/cycle.service";
import { IssueArchiveService, IssueDraftService, IssueService } from "@/services/issue"; import { IssueArchiveService, IssueDraftService, IssueService } from "@/services/issue";
import { ModuleService } from "@/services/module.service"; import { ModuleService } from "@/services/module.service";
import { CycleService } from "@/services/cycle.service"; import { IIssueRootStore } from "../root.store";
import { import {
getDifference, getDifference,
getGroupIssueKeyActions, getGroupIssueKeyActions,
@ -44,8 +42,10 @@ import {
getSortOrderToFilterEmptyValues, getSortOrderToFilterEmptyValues,
getSubGroupIssueKeyActions, getSubGroupIssueKeyActions,
} from "./base-issues-utils"; } from "./base-issues-utils";
import { convertToISODateString } from "@/helpers/date-time.helper"; import { IBaseIssueFilterStore } from "./issue-filter-helper.store";
import isEmpty from "lodash/isEmpty"; // constants
// helpers
// services
export type TIssueDisplayFilterOptions = Exclude<TIssueGroupByOptions, null> | "target_date"; export type TIssueDisplayFilterOptions = Exclude<TIssueGroupByOptions, null> | "target_date";
@ -385,17 +385,14 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
/** /**
* gets the Loader value of particular group/subgroup/ALL_ISSUES * gets the Loader value of particular group/subgroup/ALL_ISSUES
*/ */
getIssueLoader = (groupId?: string, subGroupId?: string) => { getIssueLoader = (groupId?: string, subGroupId?: string) => get(this.loader, getGroupKey(groupId, subGroupId));
return get(this.loader, getGroupKey(groupId, subGroupId));
};
/** /**
* gets the pagination data of particular group/subgroup/ALL_ISSUES * gets the pagination data of particular group/subgroup/ALL_ISSUES
*/ */
getPaginationData = computedFn( getPaginationData = computedFn(
(groupId: string | undefined, subGroupId: string | undefined): TPaginationData | undefined => { (groupId: string | undefined, subGroupId: string | undefined): TPaginationData | undefined =>
return get(this.issuePaginationData, [getGroupKey(groupId, subGroupId)]); get(this.issuePaginationData, [getGroupKey(groupId, subGroupId)])
}
); );
/** /**
@ -1165,17 +1162,15 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
//if update is add, add it at a particular path //if update is add, add it at a particular path
if (issueUpdate.action === EIssueGroupedAction.ADD) { if (issueUpdate.action === EIssueGroupedAction.ADD) {
// add issue Id at the path // add issue Id at the path
update(this, ["groupedIssueIds", ...issueUpdate.path], (issueIds: string[] = []) => { update(this, ["groupedIssueIds", ...issueUpdate.path], (issueIds: string[] = []) =>
return this.issuesSortWithOrderBy(uniq(concat(issueIds, issueId)), this.orderBy); this.issuesSortWithOrderBy(uniq(concat(issueIds, issueId)), this.orderBy)
}); );
} }
//if update is delete, remove it at a particular path //if update is delete, remove it at a particular path
if (issueUpdate.action === EIssueGroupedAction.DELETE) { if (issueUpdate.action === EIssueGroupedAction.DELETE) {
// remove issue Id from the path // remove issue Id from the path
update(this, ["groupedIssueIds", ...issueUpdate.path], (issueIds: string[] = []) => { update(this, ["groupedIssueIds", ...issueUpdate.path], (issueIds: string[] = []) => pull(issueIds, issueId));
return pull(issueIds, issueId);
});
} }
// accumulate the updates so that we don't end up updating the count twice for the same issue // accumulate the updates so that we don't end up updating the count twice for the same issue
@ -1184,9 +1179,9 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
//if update is reorder, reorder it at a particular path //if update is reorder, reorder it at a particular path
if (issueUpdate.action === EIssueGroupedAction.REORDER) { if (issueUpdate.action === EIssueGroupedAction.REORDER) {
// re-order/re-sort the issue Ids at the path // re-order/re-sort the issue Ids at the path
update(this, ["groupedIssueIds", ...issueUpdate.path], (issueIds: string[] = []) => { update(this, ["groupedIssueIds", ...issueUpdate.path], (issueIds: string[] = []) =>
return this.issuesSortWithOrderBy(issueIds, this.orderBy); this.issuesSortWithOrderBy(issueIds, this.orderBy)
}); );
} }
} }
@ -1363,9 +1358,9 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore {
// if groupedIssueIds is an array, update the `groupedIssueIds` store at the issuePath // if groupedIssueIds is an array, update the `groupedIssueIds` store at the issuePath
if (groupedIssueIds && Array.isArray(groupedIssueIds)) { if (groupedIssueIds && Array.isArray(groupedIssueIds)) {
update(this, ["groupedIssueIds", ...issuePath], (issueIds: string[] = []) => { update(this, ["groupedIssueIds", ...issuePath], (issueIds: string[] = []) =>
return this.issuesSortWithOrderBy(uniq(concat(issueIds, groupedIssueIds as string[])), this.orderBy); this.issuesSortWithOrderBy(uniq(concat(issueIds, groupedIssueIds as string[])), this.orderBy)
}); );
// return true to indicate the store has been updated // return true to indicate the store has been updated
return true; return true;
} }

View File

@ -5,9 +5,9 @@ import uniq from "lodash/uniq";
import update from "lodash/update"; import update from "lodash/update";
import { action, makeObservable, observable, runInAction } from "mobx"; import { action, makeObservable, observable, runInAction } from "mobx";
// services // services
import { TIssueComment, TIssueCommentMap, TIssueCommentIdMap } from "@plane/types";
import { IssueCommentService } from "@/services/issue"; import { IssueCommentService } from "@/services/issue";
// types // types
import { TIssueComment, TIssueCommentMap, TIssueCommentIdMap } from "@plane/types";
import { IIssueDetail } from "./root.store"; import { IIssueDetail } from "./root.store";
export type TCommentLoader = "fetch" | "create" | "update" | "delete" | "mutate" | undefined; export type TCommentLoader = "fetch" | "create" | "update" | "delete" | "mutate" | undefined;

View File

@ -7,9 +7,9 @@ import { action, makeObservable, observable, runInAction } from "mobx";
// services // services
// types // types
// helpers // helpers
import { TIssueCommentReaction, TIssueCommentReactionIdMap, TIssueCommentReactionMap } from "@plane/types";
import { groupReactions } from "@/helpers/emoji.helper"; import { groupReactions } from "@/helpers/emoji.helper";
import { IssueReactionService } from "@/services/issue"; import { IssueReactionService } from "@/services/issue";
import { TIssueCommentReaction, TIssueCommentReactionIdMap, TIssueCommentReactionMap } from "@plane/types";
import { IIssueDetail } from "./root.store"; import { IIssueDetail } from "./root.store";
export interface IIssueCommentReactionStoreActions { export interface IIssueCommentReactionStoreActions {

View File

@ -1,9 +1,9 @@
import set from "lodash/set"; import set from "lodash/set";
import { action, computed, makeObservable, observable, runInAction } from "mobx"; import { action, computed, makeObservable, observable, runInAction } from "mobx";
// services // services
import { TIssueLink, TIssueLinkMap, TIssueLinkIdMap } from "@plane/types";
import { IssueService } from "@/services/issue"; import { IssueService } from "@/services/issue";
// types // types
import { TIssueLink, TIssueLinkMap, TIssueLinkIdMap } from "@plane/types";
import { IIssueDetail } from "./root.store"; import { IIssueDetail } from "./root.store";
export interface IIssueLinkStoreActions { export interface IIssueLinkStoreActions {

View File

@ -7,9 +7,9 @@ import { action, makeObservable, observable, runInAction } from "mobx";
// services // services
// types // types
// helpers // helpers
import { TIssueReaction, TIssueReactionMap, TIssueReactionIdMap } from "@plane/types";
import { groupReactions } from "@/helpers/emoji.helper"; import { groupReactions } from "@/helpers/emoji.helper";
import { IssueReactionService } from "@/services/issue"; import { IssueReactionService } from "@/services/issue";
import { TIssueReaction, TIssueReactionMap, TIssueReactionIdMap } from "@plane/types";
import { IIssueDetail } from "./root.store"; import { IIssueDetail } from "./root.store";
export interface IIssueReactionStoreActions { export interface IIssueReactionStoreActions {

View File

@ -1,9 +1,9 @@
import set from "lodash/set"; import set from "lodash/set";
import { action, computed, makeObservable, observable, runInAction } from "mobx"; import { action, computed, makeObservable, observable, runInAction } from "mobx";
// services // services
import { TIssueRelationIdMap, TIssueRelationMap, TIssueRelationTypes, TIssueRelation, TIssue } from "@plane/types";
import { IssueRelationService } from "@/services/issue"; import { IssueRelationService } from "@/services/issue";
// types // types
import { TIssueRelationIdMap, TIssueRelationMap, TIssueRelationTypes, TIssueRelation, TIssue } from "@plane/types";
import { IIssueDetail } from "./root.store"; import { IIssueDetail } from "./root.store";
export interface IIssueRelationStoreActions { export interface IIssueRelationStoreActions {

View File

@ -1,11 +1,11 @@
import { observable, action, makeObservable, runInAction, computed } from "mobx"; import { observable, action, makeObservable, runInAction, computed } from "mobx";
// helpers // helpers
import { computedFn } from "mobx-utils";
import { ICalendarPayload, ICalendarWeek } from "@/components/issues"; import { ICalendarPayload, ICalendarWeek } from "@/components/issues";
import { generateCalendarData } from "@/helpers/calendar.helper"; import { generateCalendarData } from "@/helpers/calendar.helper";
// types // types
import { getWeekNumberOfDate } from "@/helpers/date-time.helper"; import { getWeekNumberOfDate } from "@/helpers/date-time.helper";
import { computedFn } from "mobx-utils";
export interface ICalendarStore { export interface ICalendarStore {
calendarFilters: { calendarFilters: {

View File

@ -4,9 +4,7 @@ import pickBy from "lodash/pickBy";
import set from "lodash/set"; import set from "lodash/set";
import { action, computed, makeObservable, observable, runInAction } from "mobx"; import { action, computed, makeObservable, observable, runInAction } from "mobx";
// base class // base class
import { EIssueFilterType, EIssuesStoreType } from "@/constants/issue"; import { computedFn } from "mobx-utils";
import { handleIssueQueryParamsByLayout } from "@/helpers/issue.helper";
import { IssueFiltersService } from "@/services/issue_filter.service";
import { import {
IIssueFilterOptions, IIssueFilterOptions,
IIssueDisplayFilterOptions, IIssueDisplayFilterOptions,
@ -16,11 +14,13 @@ import {
TIssueParams, TIssueParams,
IssuePaginationOptions, IssuePaginationOptions,
} from "@plane/types"; } from "@plane/types";
import { EIssueFilterType, EIssuesStoreType } from "@/constants/issue";
import { handleIssueQueryParamsByLayout } from "@/helpers/issue.helper";
import { IssueFiltersService } from "@/services/issue_filter.service";
import { IBaseIssueFilterStore, IssueFilterHelperStore } from "../helpers/issue-filter-helper.store"; import { IBaseIssueFilterStore, IssueFilterHelperStore } from "../helpers/issue-filter-helper.store";
// helpers // helpers
// types // types
import { IIssueRootStore } from "../root.store"; import { IIssueRootStore } from "../root.store";
import { computedFn } from "mobx-utils";
// constants // constants
// services // services

View File

@ -1,8 +1,5 @@
import { action, makeObservable, runInAction } from "mobx"; import { action, makeObservable, runInAction } from "mobx";
// base class // base class
import { BaseIssuesStore, IBaseIssuesStore } from "../helpers/base-issues.store";
// services
// types
import { import {
TIssue, TIssue,
TLoader, TLoader,
@ -11,6 +8,9 @@ import {
TIssuesResponse, TIssuesResponse,
TBulkOperationsPayload, TBulkOperationsPayload,
} from "@plane/types"; } from "@plane/types";
import { BaseIssuesStore, IBaseIssuesStore } from "../helpers/base-issues.store";
// services
// types
// store // store
import { IIssueRootStore } from "../root.store"; import { IIssueRootStore } from "../root.store";
import { IModuleIssuesFilter } from "./filter.store"; import { IModuleIssuesFilter } from "./filter.store";

View File

@ -4,9 +4,7 @@ import pickBy from "lodash/pickBy";
import set from "lodash/set"; import set from "lodash/set";
import { action, computed, makeObservable, observable, runInAction } from "mobx"; import { action, computed, makeObservable, observable, runInAction } from "mobx";
// base class // base class
import { EIssueFilterType, EIssuesStoreType } from "@/constants/issue"; import { computedFn } from "mobx-utils";
import { handleIssueQueryParamsByLayout } from "@/helpers/issue.helper";
import { IssueFiltersService } from "@/services/issue_filter.service";
import { import {
IIssueFilterOptions, IIssueFilterOptions,
IIssueDisplayFilterOptions, IIssueDisplayFilterOptions,
@ -16,11 +14,13 @@ import {
TIssueParams, TIssueParams,
IssuePaginationOptions, IssuePaginationOptions,
} from "@plane/types"; } from "@plane/types";
import { EIssueFilterType, EIssuesStoreType } from "@/constants/issue";
import { handleIssueQueryParamsByLayout } from "@/helpers/issue.helper";
import { IssueFiltersService } from "@/services/issue_filter.service";
import { IBaseIssueFilterStore, IssueFilterHelperStore } from "../helpers/issue-filter-helper.store"; import { IBaseIssueFilterStore, IssueFilterHelperStore } from "../helpers/issue-filter-helper.store";
// helpers // helpers
// types // types
import { IIssueRootStore } from "../root.store"; import { IIssueRootStore } from "../root.store";
import { computedFn } from "mobx-utils";
// constants // constants
// services // services

View File

@ -1,13 +1,13 @@
import { action, observable, makeObservable, computed, runInAction } from "mobx"; import { action, observable, makeObservable, computed, runInAction } from "mobx";
// base class // base class
import { UserService } from "@/services/user.service";
import { TIssue, TLoader, IssuePaginationOptions, TIssuesResponse, ViewFlags, TBulkOperationsPayload } from "@plane/types"; import { TIssue, TLoader, IssuePaginationOptions, TIssuesResponse, ViewFlags, TBulkOperationsPayload } from "@plane/types";
import { UserService } from "@/services/user.service";
// services // services
// types // types
import { BaseIssuesStore, IBaseIssuesStore } from "../helpers/base-issues.store";
import { IIssueRootStore } from "../root.store"; import { IIssueRootStore } from "../root.store";
import { IProfileIssuesFilter } from "./filter.store"; import { IProfileIssuesFilter } from "./filter.store";
import { BaseIssuesStore, IBaseIssuesStore } from "../helpers/base-issues.store";
export interface IProfileIssues extends IBaseIssuesStore { export interface IProfileIssues extends IBaseIssuesStore {
// observable // observable

View File

@ -4,9 +4,7 @@ import pickBy from "lodash/pickBy";
import set from "lodash/set"; import set from "lodash/set";
import { action, computed, makeObservable, observable, runInAction } from "mobx"; import { action, computed, makeObservable, observable, runInAction } from "mobx";
// base class // base class
import { EIssueFilterType, EIssuesStoreType } from "@/constants/issue"; import { computedFn } from "mobx-utils";
import { handleIssueQueryParamsByLayout } from "@/helpers/issue.helper";
import { ViewService } from "@/services/view.service";
import { import {
IIssueFilterOptions, IIssueFilterOptions,
IIssueDisplayFilterOptions, IIssueDisplayFilterOptions,
@ -16,11 +14,13 @@ import {
TIssueParams, TIssueParams,
IssuePaginationOptions, IssuePaginationOptions,
} from "@plane/types"; } from "@plane/types";
import { EIssueFilterType, EIssuesStoreType } from "@/constants/issue";
import { handleIssueQueryParamsByLayout } from "@/helpers/issue.helper";
import { ViewService } from "@/services/view.service";
import { IBaseIssueFilterStore, IssueFilterHelperStore } from "../helpers/issue-filter-helper.store"; import { IBaseIssueFilterStore, IssueFilterHelperStore } from "../helpers/issue-filter-helper.store";
// helpers // helpers
// types // types
import { IIssueRootStore } from "../root.store"; import { IIssueRootStore } from "../root.store";
import { computedFn } from "mobx-utils";
// constants // constants
// services // services

View File

@ -10,8 +10,8 @@ import {
} from "@plane/types"; } from "@plane/types";
// services // services
// types // types
import { IIssueRootStore } from "../root.store";
import { BaseIssuesStore, IBaseIssuesStore } from "../helpers/base-issues.store"; import { BaseIssuesStore, IBaseIssuesStore } from "../helpers/base-issues.store";
import { IIssueRootStore } from "../root.store";
import { IProjectViewIssuesFilter } from "./filter.store"; import { IProjectViewIssuesFilter } from "./filter.store";
export interface IProjectViewIssues extends IBaseIssuesStore { export interface IProjectViewIssues extends IBaseIssuesStore {
@ -125,7 +125,7 @@ export class ProjectViewIssues extends BaseIssuesStore implements IProjectViewIs
this.setLoader("pagination", groupId, subGroupId); this.setLoader("pagination", groupId, subGroupId);
// get params from stored pagination options // get params from stored pagination options
let params = this.issueFilterStore?.getFilterParams( const params = this.issueFilterStore?.getFilterParams(
this.paginationOptions, this.paginationOptions,
cursorObject?.nextCursor, cursorObject?.nextCursor,
groupId, groupId,

View File

@ -4,8 +4,7 @@ import pickBy from "lodash/pickBy";
import set from "lodash/set"; import set from "lodash/set";
import { action, computed, makeObservable, observable, runInAction } from "mobx"; import { action, computed, makeObservable, observable, runInAction } from "mobx";
// base class // base class
import { handleIssueQueryParamsByLayout } from "@/helpers/issue.helper"; import { computedFn } from "mobx-utils";
import { IssueFiltersService } from "@/services/issue_filter.service";
import { import {
IIssueFilterOptions, IIssueFilterOptions,
IIssueDisplayFilterOptions, IIssueDisplayFilterOptions,
@ -15,13 +14,14 @@ import {
TIssueParams, TIssueParams,
IssuePaginationOptions, IssuePaginationOptions,
} from "@plane/types"; } from "@plane/types";
import { EIssueFilterType, EIssuesStoreType } from "@/constants/issue";
import { handleIssueQueryParamsByLayout } from "@/helpers/issue.helper";
import { IssueFiltersService } from "@/services/issue_filter.service";
import { IBaseIssueFilterStore, IssueFilterHelperStore } from "../helpers/issue-filter-helper.store"; import { IBaseIssueFilterStore, IssueFilterHelperStore } from "../helpers/issue-filter-helper.store";
// helpers // helpers
// types // types
import { IIssueRootStore } from "../root.store"; import { IIssueRootStore } from "../root.store";
// constants // constants
import { EIssueFilterType, EIssuesStoreType } from "@/constants/issue";
import { computedFn } from "mobx-utils";
// services // services
export interface IProjectIssuesFilter extends IBaseIssueFilterStore { export interface IProjectIssuesFilter extends IBaseIssueFilterStore {

View File

@ -4,9 +4,7 @@ import pickBy from "lodash/pickBy";
import set from "lodash/set"; import set from "lodash/set";
import { action, computed, makeObservable, observable, runInAction } from "mobx"; import { action, computed, makeObservable, observable, runInAction } from "mobx";
// base class // base class
import { EIssueFilterType, EIssueLayoutTypes, EIssuesStoreType } from "@/constants/issue"; import { computedFn } from "mobx-utils";
import { handleIssueQueryParamsByLayout } from "@/helpers/issue.helper";
import { WorkspaceService } from "@/services/workspace.service";
import { import {
IIssueFilterOptions, IIssueFilterOptions,
IIssueDisplayFilterOptions, IIssueDisplayFilterOptions,
@ -17,11 +15,13 @@ import {
TStaticViewTypes, TStaticViewTypes,
IssuePaginationOptions, IssuePaginationOptions,
} from "@plane/types"; } from "@plane/types";
import { EIssueFilterType, EIssueLayoutTypes, EIssuesStoreType } from "@/constants/issue";
import { handleIssueQueryParamsByLayout } from "@/helpers/issue.helper";
import { WorkspaceService } from "@/services/workspace.service";
import { IBaseIssueFilterStore, IssueFilterHelperStore } from "../helpers/issue-filter-helper.store"; import { IBaseIssueFilterStore, IssueFilterHelperStore } from "../helpers/issue-filter-helper.store";
// helpers // helpers
// types // types
import { IIssueRootStore } from "../root.store"; import { IIssueRootStore } from "../root.store";
import { computedFn } from "mobx-utils";
// constants // constants
// services // services

View File

@ -1,11 +1,11 @@
import { action, makeObservable, runInAction } from "mobx"; import { action, makeObservable, runInAction } from "mobx";
// base class // base class
import { WorkspaceService } from "@/services/workspace.service";
import { IssuePaginationOptions, TBulkOperationsPayload, TIssue, TIssuesResponse, TLoader, ViewFlags } from "@plane/types"; import { IssuePaginationOptions, TBulkOperationsPayload, TIssue, TIssuesResponse, TLoader, ViewFlags } from "@plane/types";
import { WorkspaceService } from "@/services/workspace.service";
// services // services
// types // types
import { IIssueRootStore } from "../root.store";
import { BaseIssuesStore, IBaseIssuesStore } from "../helpers/base-issues.store"; import { BaseIssuesStore, IBaseIssuesStore } from "../helpers/base-issues.store";
import { IIssueRootStore } from "../root.store";
import { IWorkspaceIssuesFilter } from "./filter.store"; import { IWorkspaceIssuesFilter } from "./filter.store";
export interface IWorkspaceIssues extends IBaseIssuesStore { export interface IWorkspaceIssues extends IBaseIssuesStore {

View File

@ -1,10 +1,10 @@
import { endOfMonth, endOfWeek, endOfYear, startOfMonth, startOfWeek, startOfYear } from "date-fns"; import { endOfMonth, endOfWeek, endOfYear, startOfMonth, startOfWeek, startOfYear } from "date-fns";
// helpers // helpers
import { renderFormattedDate, renderFormattedPayloadDate } from "./date-time.helper";
// types // types
import { TIssuesListTypes } from "@plane/types"; import { TIssuesListTypes } from "@plane/types";
// constants // constants
import { DURATION_FILTER_OPTIONS, EDurationFilters } from "@/constants/dashboard"; import { DURATION_FILTER_OPTIONS, EDurationFilters } from "@/constants/dashboard";
import { renderFormattedDate, renderFormattedPayloadDate } from "./date-time.helper";
/** /**
* @description returns date range based on the duration filter * @description returns date range based on the duration filter

View File

@ -168,14 +168,13 @@ export const shouldHighlightIssueDueDate = (
// if the issue is overdue, highlight the due date // if the issue is overdue, highlight the due date
return targetDateDistance <= 0; return targetDateDistance <= 0;
}; };
export const getIssueBlocksStructure = (block: TIssue): IGanttBlock => { export const getIssueBlocksStructure = (block: TIssue): IGanttBlock => ({
return {
data: block, data: block,
id: block?.id, id: block?.id,
sort_order: block?.sort_order, sort_order: block?.sort_order,
start_date: getDate(block?.start_date), start_date: getDate(block?.start_date),
target_date: getDate(block?.target_date), target_date: getDate(block?.target_date),
};}; });
export function getChangedIssuefields(formData: Partial<TIssue>, dirtyFields: { [key: string]: boolean | undefined }) { export function getChangedIssuefields(formData: Partial<TIssue>, dirtyFields: { [key: string]: boolean | undefined }) {
const changedFields: Partial<TIssue> = {}; const changedFields: Partial<TIssue> = {};

View File

@ -1,6 +1,6 @@
// types // types
import { STATE_GROUPS } from "@/constants/state";
import { IState, IStateResponse } from "@plane/types"; import { IState, IStateResponse } from "@plane/types";
import { STATE_GROUPS } from "@/constants/state";
export const orderStateGroups = (unorderedStateGroups: IStateResponse | undefined): IStateResponse | undefined => { export const orderStateGroups = (unorderedStateGroups: IStateResponse | undefined): IStateResponse | undefined => {
if (!unorderedStateGroups) return undefined; if (!unorderedStateGroups) return undefined;

View File

@ -50,7 +50,9 @@ const fallbackCopyTextToClipboard = (text: string) => {
// FIXME: Even though we are using this as a fallback, execCommand is deprecated 👎. We should find a better way to do this. // FIXME: Even though we are using this as a fallback, execCommand is deprecated 👎. We should find a better way to do this.
// https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand // https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand
document.execCommand("copy"); document.execCommand("copy");
} catch (err) {} } catch (err) {
// catch fallback error
}
document.body.removeChild(textArea); document.body.removeChild(textArea);
}; };

13
web/next-auth.d.ts vendored
View File

@ -1,13 +0,0 @@
import NextAuth from "next-auth/next";
declare module "next-auth" {
interface Session {
user: {
name: string;
email: string;
image: string;
accessToken: string;
refreshToken: string;
};
}
}

View File

@ -7,7 +7,7 @@
"develop": "next dev --port 3000", "develop": "next dev --port 3000",
"build": "next build", "build": "next build",
"start": "next start", "start": "next start",
"lint": "next lint", "lint": "eslint . --ext .ts,.tsx,.js,.jsx",
"export": "next export", "export": "next export",
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist" "clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist"
}, },