Skip to content

Commit

Permalink
Merge branch 'stage-release' of https://github.com/makeplane/plane in…
Browse files Browse the repository at this point in the history
…to stage-release
  • Loading branch information
vamsi committed Jan 11, 2023
2 parents 6db3cf2 + 9737b80 commit 14c8c70
Show file tree
Hide file tree
Showing 12 changed files with 6,724 additions and 51 deletions.
6 changes: 3 additions & 3 deletions apps/app/components/project/cycles/stats-view/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import { useState } from "react";
import SingleStat from "components/project/cycles/stats-view/single-stat";
import ConfirmCycleDeletion from "components/project/cycles/confirm-cycle-deletion";
// types
import { ICycle, SelectSprintType } from "types";
import { ICycle, SelectCycleType } from "types";
import { CompletedCycleIcon, CurrentCycleIcon, UpcomingCycleIcon } from "ui/icons";

type TCycleStatsViewProps = {
cycles: ICycle[];
setCreateUpdateCycleModal: React.Dispatch<React.SetStateAction<boolean>>;
setSelectedCycle: React.Dispatch<React.SetStateAction<SelectSprintType>>;
setSelectedCycle: React.Dispatch<React.SetStateAction<SelectCycleType>>;
type: "current" | "upcoming" | "completed";
};

Expand All @@ -21,7 +21,7 @@ const CycleStatsView: React.FC<TCycleStatsViewProps> = ({
type,
}) => {
const [cycleDeleteModal, setCycleDeleteModal] = useState(false);
const [selectedCycleForDelete, setSelectedCycleForDelete] = useState<SelectSprintType>();
const [selectedCycleForDelete, setSelectedCycleForDelete] = useState<SelectCycleType>();

const handleDeleteCycle = (cycle: ICycle) => {
setSelectedCycleForDelete({ ...cycle, actionType: "delete" });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const ConfirmModuleDeletion: React.FC<Props> = ({ isOpen, setIsOpen, data }) =>
<Transition.Root show={isOpen} as={React.Fragment}>
<Dialog
as="div"
className="relative z-10"
className="relative z-20"
initialFocus={cancelButtonRef}
onClose={handleClose}
>
Expand All @@ -79,7 +79,7 @@ const ConfirmModuleDeletion: React.FC<Props> = ({ isOpen, setIsOpen, data }) =>
<div className="fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity" />
</Transition.Child>

<div className="fixed inset-0 z-10 overflow-y-auto">
<div className="fixed inset-0 z-20 overflow-y-auto">
<div className="flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0">
<Transition.Child
as={React.Fragment}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import { mutate } from "swr";
import { useForm } from "react-hook-form";

import { Dialog, Transition } from "@headlessui/react";
// components
import SelectLead from "components/project/modules/create-update-module-modal/select-lead";
import SelectMembers from "components/project/modules/create-update-module-modal/select-members";
import SelectStatus from "components/project/modules/create-update-module-modal/select-status";
// ui
import { Button, Input, TextArea } from "ui";
// services
Expand All @@ -17,9 +21,6 @@ import type { IModule } from "types";
import { renderDateFormat } from "constants/common";
// fetch keys
import { MODULE_LIST } from "constants/fetch-keys";
import SelectLead from "./select-lead";
import SelectMembers from "./select-members";
import SelectStatus from "./select-status";

type Props = {
isOpen: boolean;
Expand Down Expand Up @@ -51,15 +52,6 @@ const CreateUpdateModuleModal: React.FC<Props> = ({ isOpen, setIsOpen, data, pro
defaultValues,
});

useEffect(() => {
if (data) {
setIsOpen(true);
reset(data);
} else {
reset(defaultValues);
}
}, [data, setIsOpen, reset]);

const onSubmit = async (formData: IModule) => {
if (!workspaceSlug) return;
const payload = {
Expand All @@ -71,11 +63,7 @@ const CreateUpdateModuleModal: React.FC<Props> = ({ isOpen, setIsOpen, data, pro
await modulesService
.createModule(workspaceSlug as string, projectId, payload)
.then((res) => {
mutate<IModule[]>(
MODULE_LIST(projectId),
(prevData) => [res, ...(prevData ?? [])],
false
);
mutate(MODULE_LIST(projectId));
handleClose();
})
.catch((err) => {
Expand Down Expand Up @@ -119,6 +107,15 @@ const CreateUpdateModuleModal: React.FC<Props> = ({ isOpen, setIsOpen, data, pro
reset(defaultValues);
};

useEffect(() => {
if (data) {
setIsOpen(true);
reset(data);
} else {
reset(defaultValues);
}
}, [data, setIsOpen, reset]);

return (
<Transition.Root show={isOpen} as={React.Fragment}>
<Dialog as="div" className="relative z-20" onClose={handleClose}>
Expand Down
14 changes: 9 additions & 5 deletions apps/app/pages/404.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,17 @@ const PageNotFound: NextPage = () => {
<div className="space-y-2">
<h3 className="text-lg font-semibold">Oops! Something went wrong.</h3>
<p className="text-sm text-gray-500">
Lorem ipsum dolor sit amet consectetur. Fermentum augue ipsum ipsum adipiscing tempus
diam.
Sorry, the page you are looking for cannot be found. It may have been removed, had its
name changed, or is temporarily unavailable.
</p>
</div>
<Button type="button" largePadding>
Go to Home
</Button>
<Link href="/">
<a className="block">
<Button type="button" largePadding>
Go to Home
</Button>
</a>
</Link>
</div>
</div>
</DefaultLayout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { NextPage, NextPageContext } from "next";

import useSWR from "swr";
// services
import sprintService from "lib/services/cycles.service";
import cycleService from "lib/services/cycles.service";
import projectService from "lib/services/project.service";
import workspaceService from "lib/services/workspace.service";
// layouts
Expand All @@ -16,18 +16,18 @@ import CycleStatsView from "components/project/cycles/stats-view";
// ui
import { BreadcrumbItem, Breadcrumbs, HeaderButton, EmptySpace, EmptySpaceItem, Loader } from "ui";
// icons
import { ArrowPathIcon, PlusIcon } from "@heroicons/react/24/outline";
import { PlusIcon } from "@heroicons/react/24/outline";
// types
import { ICycle, SelectSprintType } from "types";
import { ICycle, SelectCycleType } from "types";
// fetching keys
import { CYCLE_LIST, PROJECT_DETAILS, WORKSPACE_DETAILS } from "constants/fetch-keys";
// lib
import { requiredAuth } from "lib/auth";
import { Tab } from "@headlessui/react";
import { CyclesIcon } from "ui/icons";

const ProjectSprints: NextPage = () => {
const [selectedCycle, setSelectedCycle] = useState<SelectSprintType>();
const ProjectCycles: NextPage = () => {
const [selectedCycle, setSelectedCycle] = useState<SelectCycleType>();
const [createUpdateCycleModal, setCreateUpdateCycleModal] = useState(false);

const {
Expand All @@ -49,7 +49,7 @@ const ProjectSprints: NextPage = () => {
const { data: cycles } = useSWR<ICycle[]>(
activeWorkspace && projectId ? CYCLE_LIST(projectId as string) : null,
activeWorkspace && projectId
? () => sprintService.getCycles(activeWorkspace.slug, projectId as string)
? () => cycleService.getCycles(activeWorkspace.slug, projectId as string)
: null
);

Expand Down Expand Up @@ -224,4 +224,4 @@ export const getServerSideProps = async (ctx: NextPageContext) => {
};
};

export default ProjectSprints;
export default ProjectCycles;
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import ModulesBoardView from "components/project/modules/board-view";
import ModulesListView from "components/project/modules/list-view";
import ConfirmIssueDeletion from "components/project/issues/confirm-issue-deletion";
import ModuleDetailSidebar from "components/project/modules/module-detail-sidebar";
import ConfirmModuleDeletion from "components/project/modules/confirm-module-deleteion";
import ConfirmModuleDeletion from "components/project/modules/confirm-module-deletion";
import CreateUpdateIssuesModal from "components/project/issues/create-update-issue-modal";
import View from "components/core/view";
// ui
Expand Down Expand Up @@ -345,7 +345,7 @@ const SingleModule = () => {
>
<EmptySpace
title="You don't have any issue yet."
description="A cycle is a fixed time period where a team commits to a set number of issues from their backlog. Cycles are usually one, two, or four weeks long."
description="Modules are smaller, focused projects that help you group and organize issues within a specific time frame."
Icon={RectangleStackIcon}
>
<EmptySpaceItem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const ProjectModules: NextPage = () => {
<div className="flex h-full w-full flex-col items-center justify-center px-4">
<EmptySpace
title="You don't have any module yet."
description="A cycle is a fixed time period where a team commits to a set number of issues from their backlog. Cycles are usually one, two, or four weeks long."
description="Modules are smaller, focused projects that help you group and organize issues within a specific time frame."
Icon={RectangleGroupIcon}
>
<EmptySpaceItem
Expand Down
17 changes: 10 additions & 7 deletions apps/app/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ import { ThemeContextProvider } from "contexts/theme.context";

function MyApp({ Component, pageProps }: AppProps) {
return (
<UserProvider>
<ToastContextProvider>
<ThemeContextProvider>
<Component {...pageProps} />
</ThemeContextProvider>
</ToastContextProvider>
</UserProvider>
<>
<UserProvider>
<ToastContextProvider>
<ThemeContextProvider>
<Component {...pageProps} />
</ThemeContextProvider>
</ToastContextProvider>
</UserProvider>
<script defer data-domain="app.plane.so" src="https://plausible.io/js/script.js"></script>
</>
);
}

Expand Down
2 changes: 1 addition & 1 deletion apps/app/types/cycles.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export interface CycleIssueResponse {
cycle: string;
}

export type SelectSprintType =
export type SelectCycleType =
| (ICycle & { actionType: "edit" | "delete" | "create-issue" })
| undefined;

Expand Down
24 changes: 18 additions & 6 deletions apps/app/ui/custom-listbox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,24 @@ const CustomListbox: React.FC<Props> = ({
${className || "px-2 py-1"}`}
>
{icon ?? null}
<span className="block truncate">
{Array.isArray(value)
? value.map((v) => options?.find((o) => o.value === v)?.display).join(", ") ||
`${title}`
: options?.find((o) => o.value === value)?.display || `${title}`}
</span>
<div className="flex items-center gap-2 truncate">
{Array.isArray(value) ? (
value.map((v) => options?.find((o) => o.value === v)?.display).join(", ") ||
`${title}`
) : (
<>
{options?.find((o) => o.value === value)?.color && (
<span
className="h-1.5 w-1.5 flex-shrink-0 rounded-full"
style={{
backgroundColor: options?.find((o) => o.value === value)?.color,
}}
></span>
)}{" "}
{options?.find((o) => o.value === value)?.display || `${title}`}
</>
)}
</div>
</Listbox.Button>

<Transition
Expand Down
5 changes: 5 additions & 0 deletions apps/docs/src/pages/_app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ export default function App({ Component, pageProps }) {
<Component {...pageProps} />
</Layout>
</MDXProvider>
<script
defer
data-domain="docs.plane.so"
src="https://plausible.io/js/script.js"
></script>
</>
)
}
Loading

0 comments on commit 14c8c70

Please sign in to comment.