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: {
"no-useless-escape": "off",
"prefer-const": "error",
"no-irregular-whitespace": "error",
"no-trailing-spaces": "error",
@ -36,6 +37,7 @@ module.exports = {
{
selector: ["function", "variable"],
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 { MoreVertical } from "lucide-react";
// hooks
import { CycleGanttSidebarBlock } from "@/components/cycles";
import { BLOCK_HEIGHT } from "@/components/gantt-chart/constants";

View File

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

View File

@ -1,6 +1,6 @@
"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 { draggable, dropTargetForElements } from "@atlaskit/pragmatic-drag-and-drop/element/adapter";
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 { MoreVertical } from "lucide-react";
// components
import { MultipleSelectEntityAction } from "@/components/core";
import { useGanttChart } from "@/components/gantt-chart/hooks";

View File

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

View File

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

View File

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

View File

@ -8,12 +8,12 @@ import { Button } from "@plane/ui";
// helpers
import { GOD_MODE_URL } from "@/helpers/common.helper";
// images
import PlaneTakeOffImage from "@/public/plane-takeoff.png";
// assets
import PlaneBackgroundPatternDark from "@/public/auth/background-pattern-dark.svg";
import PlaneBackgroundPattern from "@/public/auth/background-pattern.svg";
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 PlaneTakeOffImage from "@/public/plane-takeoff.png";
export const InstanceNotReady: FC = () => {
const { resolvedTheme } = useTheme();

View File

@ -25,8 +25,8 @@ import {
// icons
// images
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 { IntegrationService, GithubIntegrationService } from "@/services/integrations";
// hooks
// components
// icons

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -11,7 +11,7 @@ import { CustomSelect, TOAST_TYPE, Tooltip, setToast } from "@plane/ui";
// components
import { ConfirmWorkspaceMemberRemove } from "@/components/workspace";
// constants
import { WORKSPACE_MEMBER_lEAVE } from "@/constants/event-tracker";
import { WORKSPACE_MEMBER_LEAVE } from "@/constants/event-tracker";
import { EUserWorkspaceRoles, ROLE } from "@/constants/workspace";
// hooks
import { useEventTracker, useMember, useUser } from "@/hooks/store";
@ -48,7 +48,7 @@ export const WorkspaceMembersListItem: FC<Props> = observer((props) => {
await leaveWorkspace(workspaceSlug.toString())
.then(() => {
captureEvent(WORKSPACE_MEMBER_lEAVE, {
captureEvent(WORKSPACE_MEMBER_LEAVE, {
state: "SUCCESS",
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 PROJECT_MEMBER_ADDED = "Project member added";
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
export const NAVIGATE_TO_SIGNUP = "Navigate to sign-up page";
export const NAVIGATE_TO_SIGNIN = "Navigate to sign-in page";

View File

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

View File

@ -1,5 +1,5 @@
import { EIssuesStoreType } from "@/constants/issue";
import { createContext, useContext } from "react";
import { EIssuesStoreType } from "@/constants/issue";
import { useIssues } from "./store";
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 { useRouter } from "next/navigation";

View File

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

View File

@ -1,7 +1,4 @@
// services
import { API_BASE_URL } from "@/helpers/common.helper";
import { APIService } from "@/services/api.service";
// types
import {
IAnalyticsParams,
IAnalyticsResponse,
@ -9,6 +6,9 @@ import {
IExportAnalyticsFormData,
ISaveAnalyticsFormData,
} from "@plane/types";
import { API_BASE_URL } from "@/helpers/common.helper";
import { APIService } from "@/services/api.service";
// types
// helpers
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 { API_BASE_URL } from "@/helpers/common.helper";
import { APIService } from "./api.service";
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}`)
.then((response) => response?.data)
.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}`)
.then((response) => response?.data)
.catch((error) => {

View File

@ -1,8 +1,8 @@
// services
import type { CycleDateCheckData, ICycle, TIssuesResponse } from "@plane/types";
import { API_BASE_URL } from "@/helpers/common.helper";
import { APIService } from "@/services/api.service";
// types
import type { CycleDateCheckData, ICycle, TIssuesResponse } from "@plane/types";
// helpers
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 { APIService } from "@/services/api.service";
// helpers
// types
import { THomeDashboardResponse, TWidget, TWidgetStatsResponse, TWidgetStatsRequestParams } from "@plane/types";
export class DashboardService extends APIService {
constructor() {

View File

@ -1,8 +1,8 @@
import { IGithubRepoInfo, IGithubServiceImportFormData } from "@plane/types";
import { API_BASE_URL } from "@/helpers/common.helper";
import { APIService } from "@/services/api.service";
// helpers
// types
import { IGithubRepoInfo, IGithubServiceImportFormData } from "@plane/types";
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 { APIService } from "@/services/api.service";
// types
import { IAppIntegration, IImporterService, IWorkspaceIntegration, IExportServiceResponse } from "@plane/types";
// helper
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 { APIService } from "@/services/api.service";
// types
import { IJiraMetadata, IJiraResponse, IJiraImporterForm } from "@plane/types";
export class JiraImporterService extends APIService {
constructor() {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,9 +1,9 @@
// api services
import { IWebhook } from "@plane/types";
import { API_BASE_URL } from "@/helpers/common.helper";
import { APIService } from "@/services/api.service";
// helpers
// types
import { IWebhook } from "@plane/types";
export class WebhookService extends APIService {
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)
.then((response) => response?.data)
.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)
.then((response) => response?.data)
.catch((error) => {

View File

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

View File

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

View File

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

View File

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

View File

@ -1,4 +1,3 @@
import { action, observable, makeObservable, runInAction } from "mobx";
// base class
// types
import concat from "lodash/concat";
@ -6,7 +5,9 @@ import get from "lodash/get";
import set from "lodash/set";
import uniq from "lodash/uniq";
import update from "lodash/update";
import { action, observable, makeObservable, runInAction } from "mobx";
// types
import { computedFn } from "mobx-utils";
import {
TIssue,
TLoader,
@ -15,11 +16,10 @@ import {
ViewFlags,
TBulkOperationsPayload,
} 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 { 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";
@ -369,9 +369,7 @@ export class CycleIssues extends BaseIssuesStore implements ICycleIssues {
set(this.activeCycleIds, [cycleId, "nextCursor"], response.next_cursor);
set(this.activeCycleIds, [cycleId, "nextPageResults"], response.next_page_results);
set(this.activeCycleIds, [cycleId, "issueCount"], response.total_count);
update(this.activeCycleIds, [cycleId, "issueIds"], (issueIds: string[] = []) => {
return this.issuesSortWithOrderBy(uniq(concat(issueIds, activeIssueIds)), this.orderBy);
});
update(this.activeCycleIds, [cycleId, "issueIds"], (issueIds: string[] = []) => this.issuesSortWithOrderBy(uniq(concat(issueIds, activeIssueIds)), this.orderBy));
return response;
} catch (error) {

View File

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

View File

@ -3,9 +3,9 @@ import { action, makeObservable, runInAction } from "mobx";
// services
// 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 { IDraftIssuesFilter } from "./filter.store";
import { BaseIssuesStore, IBaseIssuesStore } from "../helpers/base-issues.store";
export interface IDraftIssues extends IBaseIssuesStore {
// observable

View File

@ -1,8 +1,8 @@
import isEmpty from "lodash/isEmpty";
import { EIssueGroupedAction } from "./base-issues.store";
import uniq from "lodash/uniq";
import { TIssue } from "@plane/types";
import { ALL_ISSUES } from "@/constants/issue";
import { EIssueGroupedAction } from "./base-issues.store";
/**
* returns,
@ -172,6 +172,4 @@ export const getSortOrderToFilterEmptyValues = (key: string, object: any) => {
};
// get IssueIds from Issue data List
export const getIssueIds = (issues: TIssue[]) => {
return issues.map((issue) => issue?.id);
};
export const getIssueIds = (issues: TIssue[]) => 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 indexOf from "lodash/indexOf";
import set from "lodash/set";
import concat from "lodash/concat";
import get from "lodash/get";
import indexOf from "lodash/indexOf";
import isEmpty from "lodash/isEmpty";
import isEqual from "lodash/isEqual";
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
import {
TIssue,
@ -27,15 +28,12 @@ import {
TPaginationData,
TBulkOperationsPayload,
} 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";
// helpers
// services
import { convertToISODateString } from "@/helpers/date-time.helper";
import { CycleService } from "@/services/cycle.service";
import { IssueArchiveService, IssueDraftService, IssueService } from "@/services/issue";
import { ModuleService } from "@/services/module.service";
import { CycleService } from "@/services/cycle.service";
import { IIssueRootStore } from "../root.store";
import {
getDifference,
getGroupIssueKeyActions,
@ -44,8 +42,10 @@ import {
getSortOrderToFilterEmptyValues,
getSubGroupIssueKeyActions,
} from "./base-issues-utils";
import { convertToISODateString } from "@/helpers/date-time.helper";
import isEmpty from "lodash/isEmpty";
import { IBaseIssueFilterStore } from "./issue-filter-helper.store";
// constants
// helpers
// services
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
*/
getIssueLoader = (groupId?: string, subGroupId?: string) => {
return get(this.loader, getGroupKey(groupId, subGroupId));
};
getIssueLoader = (groupId?: string, subGroupId?: string) => get(this.loader, getGroupKey(groupId, subGroupId));
/**
* gets the pagination data of particular group/subgroup/ALL_ISSUES
*/
getPaginationData = computedFn(
(groupId: string | undefined, subGroupId: string | undefined): TPaginationData | undefined => {
return get(this.issuePaginationData, [getGroupKey(groupId, subGroupId)]);
}
(groupId: string | undefined, subGroupId: string | undefined): TPaginationData | undefined =>
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 (issueUpdate.action === EIssueGroupedAction.ADD) {
// add issue Id at the path
update(this, ["groupedIssueIds", ...issueUpdate.path], (issueIds: string[] = []) => {
return this.issuesSortWithOrderBy(uniq(concat(issueIds, issueId)), this.orderBy);
});
update(this, ["groupedIssueIds", ...issueUpdate.path], (issueIds: string[] = []) =>
this.issuesSortWithOrderBy(uniq(concat(issueIds, issueId)), this.orderBy)
);
}
//if update is delete, remove it at a particular path
if (issueUpdate.action === EIssueGroupedAction.DELETE) {
// remove issue Id from the path
update(this, ["groupedIssueIds", ...issueUpdate.path], (issueIds: string[] = []) => {
return pull(issueIds, issueId);
});
update(this, ["groupedIssueIds", ...issueUpdate.path], (issueIds: string[] = []) => pull(issueIds, issueId));
}
// 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 (issueUpdate.action === EIssueGroupedAction.REORDER) {
// re-order/re-sort the issue Ids at the path
update(this, ["groupedIssueIds", ...issueUpdate.path], (issueIds: string[] = []) => {
return this.issuesSortWithOrderBy(issueIds, this.orderBy);
});
update(this, ["groupedIssueIds", ...issueUpdate.path], (issueIds: string[] = []) =>
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 && Array.isArray(groupedIssueIds)) {
update(this, ["groupedIssueIds", ...issuePath], (issueIds: string[] = []) => {
return this.issuesSortWithOrderBy(uniq(concat(issueIds, groupedIssueIds as string[])), this.orderBy);
});
update(this, ["groupedIssueIds", ...issuePath], (issueIds: string[] = []) =>
this.issuesSortWithOrderBy(uniq(concat(issueIds, groupedIssueIds as string[])), this.orderBy)
);
// return true to indicate the store has been updated
return true;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,11 +1,11 @@
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";
// types
import { getWeekNumberOfDate } from "@/helpers/date-time.helper";
import { computedFn } from "mobx-utils";
export interface ICalendarStore {
calendarFilters: {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,10 +1,10 @@
import { endOfMonth, endOfWeek, endOfYear, startOfMonth, startOfWeek, startOfYear } from "date-fns";
// helpers
import { renderFormattedDate, renderFormattedPayloadDate } from "./date-time.helper";
// types
import { TIssuesListTypes } from "@plane/types";
// constants
import { DURATION_FILTER_OPTIONS, EDurationFilters } from "@/constants/dashboard";
import { renderFormattedDate, renderFormattedPayloadDate } from "./date-time.helper";
/**
* @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
return targetDateDistance <= 0;
};
export const getIssueBlocksStructure = (block: TIssue): IGanttBlock => {
return {
export const getIssueBlocksStructure = (block: TIssue): IGanttBlock => ({
data: block,
id: block?.id,
sort_order: block?.sort_order,
start_date: getDate(block?.start_date),
target_date: getDate(block?.target_date),
};};
});
export function getChangedIssuefields(formData: Partial<TIssue>, dirtyFields: { [key: string]: boolean | undefined }) {
const changedFields: Partial<TIssue> = {};

View File

@ -1,6 +1,6 @@
// types
import { STATE_GROUPS } from "@/constants/state";
import { IState, IStateResponse } from "@plane/types";
import { STATE_GROUPS } from "@/constants/state";
export const orderStateGroups = (unorderedStateGroups: IStateResponse | undefined): IStateResponse | 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.
// https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand
document.execCommand("copy");
} catch (err) {}
} catch (err) {
// catch fallback error
}
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",
"build": "next build",
"start": "next start",
"lint": "next lint",
"lint": "eslint . --ext .ts,.tsx,.js,.jsx",
"export": "next export",
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist"
},