From f188c9fdc5c98ec74ead2799b5872d53deca90ee Mon Sep 17 00:00:00 2001 From: sriram veeraghanta Date: Wed, 6 Mar 2024 19:52:40 +0530 Subject: [PATCH] fix: build issues --- .../account/o-auth/o-auth-options.tsx | 12 ++- .../widgets/recent-collaborators.tsx | 94 ------------------- web/components/instance/ai-form.tsx | 1 + web/components/instance/email-form.tsx | 1 + web/components/instance/general-form.tsx | 1 + .../instance/github-config-form.tsx | 1 + .../instance/google-config-form.tsx | 1 + web/components/instance/image-config-form.tsx | 1 + .../instance/setup-form/sign-in-form.tsx | 2 + web/components/integration/github/root.tsx | 1 + web/components/issues/delete-issue-modal.tsx | 2 + .../calendar/base-calendar-root.tsx | 2 + .../gantt/quick-add-issue-form.tsx | 3 +- .../issue-layouts/kanban/base-kanban-root.tsx | 2 +- web/components/modules/modal.tsx | 2 +- web/components/onboarding/invite-members.tsx | 4 +- .../project/create-project-modal.tsx | 2 +- .../project/delete-project-modal.tsx | 1 + web/components/project/integration-card.tsx | 3 + .../project/send-project-invitation-modal.tsx | 3 + web/components/toast-alert/index.tsx | 61 ------------ web/components/ui/graphs/marimekko-graph.tsx | 48 ---------- web/components/ui/multi-level-dropdown.tsx | 14 +-- .../workspace/create-workspace-form.tsx | 1 + .../workspace/sidebar-quick-action.tsx | 2 +- web/constants/dashboard.ts | 2 +- .../settings-layout/profile/sidebar.tsx | 2 - web/layouts/user-profile-layout/layout.tsx | 5 +- .../profile/[userId]/index.tsx | 2 +- web/pages/create-workspace.tsx | 2 +- 30 files changed, 48 insertions(+), 230 deletions(-) delete mode 100644 web/components/dashboard/widgets/recent-collaborators.tsx delete mode 100644 web/components/toast-alert/index.tsx delete mode 100644 web/components/ui/graphs/marimekko-graph.tsx diff --git a/web/components/account/o-auth/o-auth-options.tsx b/web/components/account/o-auth/o-auth-options.tsx index 1671b94fc..39123328e 100644 --- a/web/components/account/o-auth/o-auth-options.tsx +++ b/web/components/account/o-auth/o-auth-options.tsx @@ -1,10 +1,12 @@ import { observer } from "mobx-react-lite"; -// services -import { TOAST_TYPE, setToast } from "@plane/ui"; -import { GitHubSignInButton, GoogleSignInButton } from "components/account"; -import { useApplication } from "hooks/store"; // ui +import { TOAST_TYPE, setToast } from "@plane/ui"; // components +import { GitHubSignInButton, GoogleSignInButton } from "components/account"; +// hooks +import { useApplication } from "hooks/store"; +// services +import { AuthService } from "services/auth.service"; type Props = { handleSignInRedirection: () => Promise; @@ -74,7 +76,7 @@ export const OAuthOptions: React.FC = observer((props) => {
{envConfig?.google_client_id && ( -
+
)} diff --git a/web/components/dashboard/widgets/recent-collaborators.tsx b/web/components/dashboard/widgets/recent-collaborators.tsx deleted file mode 100644 index 438f87c45..000000000 --- a/web/components/dashboard/widgets/recent-collaborators.tsx +++ /dev/null @@ -1,94 +0,0 @@ -import { useEffect } from "react"; -import { observer } from "mobx-react-lite"; -import Link from "next/link"; -// hooks -import { Avatar } from "@plane/ui"; -import { RecentCollaboratorsEmptyState, WidgetLoader, WidgetProps } from "components/dashboard/widgets"; -import { useDashboard, useMember, useUser } from "hooks/store"; -// components -// ui -// types -import { TRecentCollaboratorsWidgetResponse } from "@plane/types"; - -type CollaboratorListItemProps = { - issueCount: number; - userId: string; - workspaceSlug: string; -}; - -const WIDGET_KEY = "recent_collaborators"; - -const CollaboratorListItem: React.FC = observer((props) => { - const { issueCount, userId, workspaceSlug } = props; - // store hooks - const { currentUser } = useUser(); - const { getUserDetails } = useMember(); - // derived values - const userDetails = getUserDetails(userId); - const isCurrentUser = userId === currentUser?.id; - - if (!userDetails) return null; - - return ( - -
- -
-
- {isCurrentUser ? "You" : userDetails?.display_name} -
-

- {issueCount} active issue{issueCount > 1 ? "s" : ""} -

- - ); -}); - -export const RecentCollaboratorsWidget: React.FC = observer((props) => { - const { dashboardId, workspaceSlug } = props; - // store hooks - const { fetchWidgetStats, getWidgetStats } = useDashboard(); - const widgetStats = getWidgetStats(workspaceSlug, dashboardId, WIDGET_KEY); - - useEffect(() => { - fetchWidgetStats(workspaceSlug, dashboardId, { - widget_key: WIDGET_KEY, - }); - // eslint-disable-next-line react-hooks/exhaustive-deps - }, []); - - if (!widgetStats) return ; - - return ( -
-
-

Most active members

-

- Top eight active members in your project by last activity -

-
- {widgetStats.length > 1 ? ( -
- {widgetStats.map((user) => ( - - ))} -
- ) : ( -
- -
- )} -
- ); -}); diff --git a/web/components/instance/ai-form.tsx b/web/components/instance/ai-form.tsx index 63246ff34..250feb511 100644 --- a/web/components/instance/ai-form.tsx +++ b/web/components/instance/ai-form.tsx @@ -4,6 +4,7 @@ import { Eye, EyeOff } from "lucide-react"; // ui import { Button, Input, TOAST_TYPE, setToast } from "@plane/ui"; // types +import { IFormattedInstanceConfiguration } from "@plane/types"; // hooks import { useApplication } from "hooks/store"; diff --git a/web/components/instance/email-form.tsx b/web/components/instance/email-form.tsx index 0caf825b6..664b96ea2 100644 --- a/web/components/instance/email-form.tsx +++ b/web/components/instance/email-form.tsx @@ -4,6 +4,7 @@ import { Controller, useForm } from "react-hook-form"; import { Eye, EyeOff } from "lucide-react"; import { Button, Input, ToggleSwitch, TOAST_TYPE, setToast } from "@plane/ui"; // types +import { IFormattedInstanceConfiguration } from "@plane/types"; // hooks import { useApplication } from "hooks/store"; diff --git a/web/components/instance/general-form.tsx b/web/components/instance/general-form.tsx index cef757ccf..6fedc8831 100644 --- a/web/components/instance/general-form.tsx +++ b/web/components/instance/general-form.tsx @@ -3,6 +3,7 @@ import { Controller, useForm } from "react-hook-form"; // ui import { Button, Input, TOAST_TYPE, setToast } from "@plane/ui"; // types +import { IInstance, IInstanceAdmin } from "@plane/types"; // hooks import { useApplication } from "hooks/store"; diff --git a/web/components/instance/github-config-form.tsx b/web/components/instance/github-config-form.tsx index 90c4c880e..20fb08aff 100644 --- a/web/components/instance/github-config-form.tsx +++ b/web/components/instance/github-config-form.tsx @@ -4,6 +4,7 @@ import { Copy, Eye, EyeOff } from "lucide-react"; // ui import { Button, Input, TOAST_TYPE, setToast } from "@plane/ui"; // types +import { IFormattedInstanceConfiguration } from "@plane/types"; // hooks import { useApplication } from "hooks/store"; diff --git a/web/components/instance/google-config-form.tsx b/web/components/instance/google-config-form.tsx index 49dfcc01c..27d4f4300 100644 --- a/web/components/instance/google-config-form.tsx +++ b/web/components/instance/google-config-form.tsx @@ -4,6 +4,7 @@ import { Copy } from "lucide-react"; // ui import { Button, Input, TOAST_TYPE, setToast } from "@plane/ui"; // types +import { IFormattedInstanceConfiguration } from "@plane/types"; // hooks import { useApplication } from "hooks/store"; diff --git a/web/components/instance/image-config-form.tsx b/web/components/instance/image-config-form.tsx index 9ab79aad0..7be2089f1 100644 --- a/web/components/instance/image-config-form.tsx +++ b/web/components/instance/image-config-form.tsx @@ -4,6 +4,7 @@ import { Eye, EyeOff } from "lucide-react"; // ui import { Button, Input, TOAST_TYPE, setToast } from "@plane/ui"; // types +import { IFormattedInstanceConfiguration } from "@plane/types"; // hooks import { useApplication } from "hooks/store"; diff --git a/web/components/instance/setup-form/sign-in-form.tsx b/web/components/instance/setup-form/sign-in-form.tsx index 106f2d692..a2e71faf2 100644 --- a/web/components/instance/setup-form/sign-in-form.tsx +++ b/web/components/instance/setup-form/sign-in-form.tsx @@ -5,6 +5,8 @@ import { Eye, EyeOff, XCircle } from "lucide-react"; import { Input, Button, TOAST_TYPE, setToast } from "@plane/ui"; // helpers import { checkEmailValidity } from "helpers/string.helper"; +// hooks +import { useUser } from "hooks/store"; // services import { AuthService } from "services/auth.service"; const authService = new AuthService(); diff --git a/web/components/integration/github/root.tsx b/web/components/integration/github/root.tsx index 956640de8..74f2f9c66 100644 --- a/web/components/integration/github/root.tsx +++ b/web/components/integration/github/root.tsx @@ -30,6 +30,7 @@ import { IntegrationService, GithubIntegrationService } from "services/integrati // types import { IGithubRepoCollaborator, IGithubServiceImportFormData } from "@plane/types"; // fetch-keys +import { APP_INTEGRATIONS, IMPORTER_SERVICES_LIST, WORKSPACE_INTEGRATIONS } from "constants/fetch-keys"; export type TIntegrationSteps = "import-configure" | "import-data" | "repo-details" | "import-users" | "import-confirm"; export interface IIntegrationData { diff --git a/web/components/issues/delete-issue-modal.tsx b/web/components/issues/delete-issue-modal.tsx index ada126ccb..b6c08c14b 100644 --- a/web/components/issues/delete-issue-modal.tsx +++ b/web/components/issues/delete-issue-modal.tsx @@ -5,6 +5,8 @@ import { AlertTriangle } from "lucide-react"; import { Button, TOAST_TYPE, setToast } from "@plane/ui"; // types import { TIssue } from "@plane/types"; +// hooks +import { useIssues, useProject } from "hooks/store"; type Props = { isOpen: boolean; diff --git a/web/components/issues/issue-layouts/calendar/base-calendar-root.tsx b/web/components/issues/issue-layouts/calendar/base-calendar-root.tsx index 4162afe85..2a8cbcc26 100644 --- a/web/components/issues/issue-layouts/calendar/base-calendar-root.tsx +++ b/web/components/issues/issue-layouts/calendar/base-calendar-root.tsx @@ -15,6 +15,8 @@ import { TGroupedIssues, TIssue } from "@plane/types"; import { IQuickActionProps } from "../list/list-view-types"; import { EIssueActions } from "../types"; import { handleDragDrop } from "./utils"; +import { useIssues, useUser } from "hooks/store"; +import { EUserProjectRoles } from "constants/project"; interface IBaseCalendarRoot { issueStore: IProjectIssues | IModuleIssues | ICycleIssues | IProjectViewIssues; diff --git a/web/components/issues/issue-layouts/gantt/quick-add-issue-form.tsx b/web/components/issues/issue-layouts/gantt/quick-add-issue-form.tsx index 94a6243e5..b2d3ac9d4 100644 --- a/web/components/issues/issue-layouts/gantt/quick-add-issue-form.tsx +++ b/web/components/issues/issue-layouts/gantt/quick-add-issue-form.tsx @@ -15,6 +15,7 @@ import useOutsideClickDetector from "hooks/use-outside-click-detector"; // ui // types import { IProject, TIssue } from "@plane/types"; +import { ISSUE_CREATED } from "constants/event-tracker"; // constants interface IInputProps { @@ -162,7 +163,7 @@ export const GanttQuickAddIssueForm: React.FC = observe ) : ( -
-
-
-
- {alert.type === "success" ? ( -
-
-

{alert.title}

- {alert.message &&

{alert.message}

} -
-
-
-
- ))} - - ); -}; - -export default ToastAlerts; diff --git a/web/components/ui/graphs/marimekko-graph.tsx b/web/components/ui/graphs/marimekko-graph.tsx deleted file mode 100644 index c0e6eb300..000000000 --- a/web/components/ui/graphs/marimekko-graph.tsx +++ /dev/null @@ -1,48 +0,0 @@ -// nivo -import { ResponsiveMarimekko, SvgProps } from "@nivo/marimekko"; -// helpers -import { CHARTS_THEME, DEFAULT_MARGIN } from "constants/graph"; -import { generateYAxisTickValues } from "helpers/graph.helper"; -// types -import { TGraph } from "./types"; -// constants - -type Props = { - id: string; - value: string; - customYAxisTickValues?: number[]; -}; - -export const MarimekkoGraph: React.FC, "height" | "width">> = ({ - id, - value, - customYAxisTickValues, - height = "400px", - width = "100%", - margin, - theme, - ...rest -}) => ( -
- 7 ? -45 : 0, - }} - labelTextColor={{ from: "color", modifiers: [["darker", 1.6]] }} - theme={{ ...CHARTS_THEME, ...(theme ?? {}) }} - animate - {...rest} - /> -
-); diff --git a/web/components/ui/multi-level-dropdown.tsx b/web/components/ui/multi-level-dropdown.tsx index 8bb0ebcf3..8633d1586 100644 --- a/web/components/ui/multi-level-dropdown.tsx +++ b/web/components/ui/multi-level-dropdown.tsx @@ -71,7 +71,7 @@ export const MultiLevelDropdown: React.FC = ({
{ + onClick={(e: any) => { if (option.hasChildren) { e?.stopPropagation(); e?.preventDefault(); @@ -108,12 +108,12 @@ export const MultiLevelDropdown: React.FC = ({ height === "sm" ? "max-h-28" : height === "md" - ? "max-h-44" - : height === "rg" - ? "max-h-56" - : height === "lg" - ? "max-h-80" - : "" + ? "max-h-44" + : height === "rg" + ? "max-h-56" + : height === "lg" + ? "max-h-80" + : "" }`} > {option.children ? ( diff --git a/web/components/workspace/create-workspace-form.tsx b/web/components/workspace/create-workspace-form.tsx index 822ee1347..9cbfa25a3 100644 --- a/web/components/workspace/create-workspace-form.tsx +++ b/web/components/workspace/create-workspace-form.tsx @@ -12,6 +12,7 @@ import { useEventTracker, useWorkspace } from "hooks/store"; // ui // types import { IWorkspace } from "@plane/types"; +import { WorkspaceService } from "services/workspace.service"; type Props = { onSubmit?: (res: IWorkspace) => Promise; diff --git a/web/components/workspace/sidebar-quick-action.tsx b/web/components/workspace/sidebar-quick-action.tsx index d2ce2f5b3..a378a8b3f 100644 --- a/web/components/workspace/sidebar-quick-action.tsx +++ b/web/components/workspace/sidebar-quick-action.tsx @@ -27,7 +27,7 @@ export const WorkspaceSidebarQuickAction = observer(() => { membership: { currentWorkspaceRole }, } = useUser(); - const { storedValue } = useLocalStorage>>("draftedIssue", {}); + const { storedValue, setValue } = useLocalStorage>>("draftedIssue", {}); //useState control for displaying draft issue button instead of group hover const [isDraftButtonOpen, setIsDraftButtonOpen] = useState(false); diff --git a/web/constants/dashboard.ts b/web/constants/dashboard.ts index 35599d661..3d11b4f12 100644 --- a/web/constants/dashboard.ts +++ b/web/constants/dashboard.ts @@ -11,7 +11,7 @@ import OverdueIssuesLight from "public/empty-state/dashboard/light/overdue-issue import UpcomingIssuesLight from "public/empty-state/dashboard/light/upcoming-issues.svg"; // types import { TIssuesListTypes, TStateGroups } from "@plane/types"; -import { Props } from "components/icons/types"; + // constants import { EUserWorkspaceRoles } from "./workspace"; // icons diff --git a/web/layouts/settings-layout/profile/sidebar.tsx b/web/layouts/settings-layout/profile/sidebar.tsx index caa5cd56e..1bae51d8b 100644 --- a/web/layouts/settings-layout/profile/sidebar.tsx +++ b/web/layouts/settings-layout/profile/sidebar.tsx @@ -11,9 +11,7 @@ import { useApplication, useUser, useWorkspace } from "hooks/store"; import { Tooltip, TOAST_TYPE, setToast } from "@plane/ui"; // constants import { PROFILE_ACTION_LINKS } from "constants/profile"; -import { useApplication, useUser, useWorkspace } from "hooks/store"; import useOutsideClickDetector from "hooks/use-outside-click-detector"; -import useToast from "hooks/use-toast"; const WORKSPACE_ACTION_LINKS = [ { diff --git a/web/layouts/user-profile-layout/layout.tsx b/web/layouts/user-profile-layout/layout.tsx index 243eaed1a..fcabf5f49 100644 --- a/web/layouts/user-profile-layout/layout.tsx +++ b/web/layouts/user-profile-layout/layout.tsx @@ -1,10 +1,9 @@ import { observer } from "mobx-react-lite"; import { useRouter } from "next/router"; -// hooks -import { ProfileNavbar, ProfileSidebar } from "components/profile"; -import { useUser } from "hooks/store"; // components import { ProfileNavbar, ProfileSidebar } from "components/profile"; +// hooks +import { useUser } from "hooks/store"; // constants import { EUserWorkspaceRoles } from "constants/workspace"; diff --git a/web/pages/[workspaceSlug]/profile/[userId]/index.tsx b/web/pages/[workspaceSlug]/profile/[userId]/index.tsx index eb71989ed..947da1369 100644 --- a/web/pages/[workspaceSlug]/profile/[userId]/index.tsx +++ b/web/pages/[workspaceSlug]/profile/[userId]/index.tsx @@ -49,7 +49,7 @@ const ProfileOverviewPage: NextPageWithLayout = () => {
- +
diff --git a/web/pages/create-workspace.tsx b/web/pages/create-workspace.tsx index 629e4a379..add8d6673 100644 --- a/web/pages/create-workspace.tsx +++ b/web/pages/create-workspace.tsx @@ -66,7 +66,7 @@ const CreateWorkspacePage: NextPageWithLayout = observer(() => {