diff --git a/apps/app/components/account/email-code-form.tsx b/apps/app/components/account/email-code-form.tsx index 93298b4e0..98ab10cb7 100644 --- a/apps/app/components/account/email-code-form.tsx +++ b/apps/app/components/account/email-code-form.tsx @@ -34,8 +34,8 @@ export const EmailCodeForm = ({ onSuccess }: any) => { reValidateMode: "onChange", }); - const onSubmit = ({ email }: EmailCodeFormValues) => { - authenticationService + const onSubmit = async ({ email }: EmailCodeFormValues) => { + await authenticationService .emailCode({ email }) .then((res) => { setValue("key", res.key); @@ -46,8 +46,8 @@ export const EmailCodeForm = ({ onSuccess }: any) => { }); }; - const handleSignin = (formData: EmailCodeFormValues) => { - authenticationService + const handleSignin = async (formData: EmailCodeFormValues) => { + await authenticationService .magicSignIn(formData) .then((response) => { onSuccess(response); @@ -68,10 +68,7 @@ export const EmailCodeForm = ({ onSuccess }: any) => { return ( <> -
+ {codeSent && (
@@ -117,16 +114,37 @@ export const EmailCodeForm = ({ onSuccess }: any) => { error={errors.token} placeholder="Enter code" /> + {/* { + console.log("Triggered"); + handleSubmit(onSubmit); + }} + > + Resend code + */}
)}
- + {codeSent ? ( + + ) : ( + + )}
diff --git a/apps/app/components/core/board-view/single-board.tsx b/apps/app/components/core/board-view/single-board.tsx index 2063f6e14..e7cb49798 100644 --- a/apps/app/components/core/board-view/single-board.tsx +++ b/apps/app/components/core/board-view/single-board.tsx @@ -69,6 +69,8 @@ export const SingleBoard: React.FC = ({ ? (bgColor = "#22c55e") : (bgColor = "#ff0000"); + const isNotAllowed = userAuth.isGuest || userAuth.isViewer; + return (
@@ -95,7 +97,7 @@ export const SingleBoard: React.FC = ({ key={issue.id} draggableId={issue.id} index={index} - isDragDisabled={selectedGroup === "created_by"} + isDragDisabled={isNotAllowed || selectedGroup === "created_by"} > {(provided, snapshot) => ( = ({ isNotAllowed, }) => { const router = useRouter(); - const { workspaceSlug, projectId } = router.query; + const { workspaceSlug } = router.query; const { data: stateGroups } = useSWR( - workspaceSlug && projectId ? STATE_LIST(issue.project) : null, - workspaceSlug ? () => stateService.getStates(workspaceSlug as string, issue.project) : null + workspaceSlug && issue ? STATE_LIST(issue.project) : null, + workspaceSlug && issue + ? () => stateService.getStates(workspaceSlug as string, issue.project) + : null ); const states = getStatesList(stateGroups ?? {}); diff --git a/apps/app/components/project/card.tsx b/apps/app/components/project/card.tsx index 0ddaf1cd7..656f1d10b 100644 --- a/apps/app/components/project/card.tsx +++ b/apps/app/components/project/card.tsx @@ -12,13 +12,14 @@ import { ClipboardDocumentListIcon, } from "@heroicons/react/24/outline"; // types -import type { IProject } from "types"; // ui import { Button } from "components/ui"; // hooks import useProjectMembers from "hooks/use-project-members"; // helpers import { renderShortNumericDateFormat } from "helpers/date-time.helper"; +// types +import type { IProject } from "types"; export type ProjectCardProps = { workspaceSlug: string; @@ -85,6 +86,14 @@ export const ProjectCard: React.FC = (props) => {
+ {!isMember ? ( ) : ( - +
)} -
diff --git a/apps/app/components/project/cycles/confirm-cycle-deletion.tsx b/apps/app/components/project/cycles/confirm-cycle-deletion.tsx index ab35d343b..c1a5f38ed 100644 --- a/apps/app/components/project/cycles/confirm-cycle-deletion.tsx +++ b/apps/app/components/project/cycles/confirm-cycle-deletion.tsx @@ -36,10 +36,6 @@ const ConfirmCycleDeletion: React.FC = ({ const { setToastAlert } = useToast(); - useEffect(() => { - data && setIsOpen(true); - }, [data, setIsOpen]); - const handleClose = () => { setIsOpen(false); setIsDeleteLoading(false); diff --git a/apps/app/components/project/cycles/cycle-detail-sidebar/index.tsx b/apps/app/components/project/cycles/cycle-detail-sidebar/index.tsx index ef3788314..f552bef88 100644 --- a/apps/app/components/project/cycles/cycle-detail-sidebar/index.tsx +++ b/apps/app/components/project/cycles/cycle-detail-sidebar/index.tsx @@ -18,6 +18,7 @@ import { ChartPieIcon, LinkIcon, Squares2X2Icon, + TrashIcon, UserIcon, } from "@heroicons/react/24/outline"; // ui @@ -28,6 +29,8 @@ import useToast from "hooks/use-toast"; import cyclesService from "services/cycles.service"; // components import { SidebarProgressStats } from "components/core"; +import ProgressChart from "components/core/sidebar/progress-chart"; +import ConfirmCycleDeletion from "components/project/cycles/confirm-cycle-deletion"; // helpers import { copyTextToClipboard } from "helpers/string.helper"; import { groupBy } from "helpers/array.helper"; @@ -36,7 +39,7 @@ import { renderDateFormat, renderShortNumericDateFormat } from "helpers/date-tim import { CycleIssueResponse, ICycle, IIssue } from "types"; // fetch-keys import { CYCLE_DETAILS } from "constants/fetch-keys"; -import ProgressChart from "components/core/sidebar/progress-chart"; +// constants import { CYCLE_STATUS } from "constants/cycle"; type Props = { @@ -47,6 +50,8 @@ type Props = { }; const CycleDetailSidebar: React.FC = ({ issues, cycle, isOpen, cycleIssues }) => { + const [cycleDeleteModal, setCycleDeleteModal] = useState(false); + const router = useRouter(); const { workspaceSlug, projectId, cycleId } = router.query; @@ -103,212 +108,227 @@ const CycleDetailSidebar: React.FC = ({ issues, cycle, isOpen, cycleIssue const isStartValid = new Date(`${cycle?.start_date}`) <= new Date(); const isEndValid = new Date(`${cycle?.end_date}`) >= new Date(`${cycle?.start_date}`); - return ( -
- {cycle ? ( - <> -
-
- ( - - - {watch("status")} - - } - value={value} - onChange={(value: any) => { - submitChanges({ status: value }); - }} - > - {CYCLE_STATUS.map((option) => ( - - {option.label} - - ))} - - )} - /> -
- - {({ open }) => ( - <> - - - - {renderShortNumericDateFormat(`${cycle.start_date}`) - ? renderShortNumericDateFormat(`${cycle.start_date}`) - : "N/A"}{" "} - -{" "} - {renderShortNumericDateFormat(`${cycle.end_date}`) - ? renderShortNumericDateFormat(`${cycle.end_date}`) - : "N/A"} - - - - - { - const [start, end] = dates; - submitChanges({ - start_date: renderDateFormat(start), - end_date: renderDateFormat(end), - }); - if (setStartDateRange) { - setStartDateRange(start); - } - if (setEndDateRange) { - setEndDateRange(end); - } - }} - startDate={startDateRange} - endDate={endDateRange} - selectsRange - inline - /> - - - - )} - -
-
-

{cycle.name}

-
- -
-
-
-
-
-
- -

Owned by

-
-
- {cycle.owned_by && - (cycle.owned_by.avatar && cycle.owned_by.avatar !== "" ? ( -
- {cycle.owned_by?.first_name} -
- ) : ( -
- {cycle.owned_by?.first_name && cycle.owned_by.first_name !== "" - ? cycle.owned_by.first_name.charAt(0) - : cycle.owned_by?.email.charAt(0)} -
- ))} - {cycle.owned_by.first_name !== "" - ? cycle.owned_by.first_name - : cycle.owned_by.email} -
-
-
-
- -

Progress

-
-
-
- - - -
- {groupedIssues.completed.length}/{cycleIssues?.length} -
-
-
-
-
-
- {isStartValid && isEndValid ? ( -
- + +
+ {cycle ? ( + <> +
+
+ ( + + + {watch("status")} + + } + value={value} + onChange={(value: any) => { + submitChanges({ status: value }); + }} + > + {CYCLE_STATUS.map((option) => ( + + {option.label} + + ))} + + )} />
- ) : ( - "" - )} - {issues.length > 0 ? ( - - ) : ( - "" - )} -
- - ) : ( - -
- - -
-
- - - -
-
- )} -
+ + {({ open }) => ( + <> + + + + {renderShortNumericDateFormat(`${cycle.start_date}`) + ? renderShortNumericDateFormat(`${cycle.start_date}`) + : "N/A"}{" "} + -{" "} + {renderShortNumericDateFormat(`${cycle.end_date}`) + ? renderShortNumericDateFormat(`${cycle.end_date}`) + : "N/A"} + + + + + + { + const [start, end] = dates; + submitChanges({ + start_date: renderDateFormat(start), + end_date: renderDateFormat(end), + }); + if (setStartDateRange) { + setStartDateRange(start); + } + if (setEndDateRange) { + setEndDateRange(end); + } + }} + startDate={startDateRange} + endDate={endDateRange} + selectsRange + inline + /> + + + + )} + +
+
+

{cycle.name}

+
+ + +
+
+
+
+
+
+ +

Owned by

+
+
+ {cycle.owned_by && + (cycle.owned_by.avatar && cycle.owned_by.avatar !== "" ? ( +
+ {cycle.owned_by?.first_name} +
+ ) : ( +
+ {cycle.owned_by?.first_name && cycle.owned_by.first_name !== "" + ? cycle.owned_by.first_name.charAt(0) + : cycle.owned_by?.email.charAt(0)} +
+ ))} + {cycle.owned_by.first_name !== "" + ? cycle.owned_by.first_name + : cycle.owned_by.email} +
+
+
+
+ +

Progress

+
+
+
+ + + +
+ {groupedIssues.completed.length}/{cycleIssues?.length} +
+
+
+
+
+
+ {isStartValid && isEndValid ? ( +
+ +
+ ) : ( + "" + )} + {issues.length > 0 ? ( + + ) : ( + "" + )} +
+ + ) : ( + +
+ + +
+
+ + + +
+
+ )} +
+ ); }; diff --git a/apps/app/components/states/single-state.tsx b/apps/app/components/states/single-state.tsx index 2c0f4071e..ef558d302 100644 --- a/apps/app/components/states/single-state.tsx +++ b/apps/app/components/states/single-state.tsx @@ -148,9 +148,7 @@ export const SingleState: React.FC = ({ backgroundColor: state.color, }} /> -
- {addSpaceIfCamelCase(state.name)} {state.sequence} -
+
{addSpaceIfCamelCase(state.name)}
{index !== 0 && ( diff --git a/apps/app/components/workspace/home-cards-list.tsx b/apps/app/components/workspace/home-cards-list.tsx index 1aaebdc98..cca5989e7 100644 --- a/apps/app/components/workspace/home-cards-list.tsx +++ b/apps/app/components/workspace/home-cards-list.tsx @@ -16,7 +16,7 @@ export const WorkspaceHomeCardsList: FC = (props) = }, { title: "Issues pending", - number: myIssues?.length ?? 0 - groupedIssues.completed.length, + number: myIssues.length - groupedIssues.completed.length, }, { title: "Projects", diff --git a/apps/app/pages/[workspaceSlug]/me/my-issues.tsx b/apps/app/pages/[workspaceSlug]/me/my-issues.tsx index 899b4974f..d5b8bbfaf 100644 --- a/apps/app/pages/[workspaceSlug]/me/my-issues.tsx +++ b/apps/app/pages/[workspaceSlug]/me/my-issues.tsx @@ -58,54 +58,56 @@ const MyIssuesPage: NextPage = () => { } right={
- - {({ open }) => ( - <> - - View - + {myIssues && myIssues.length > 0 && ( + + {({ open }) => ( + <> + + View + - - -
-
-

Properties

-
- {Object.keys(properties).map((key) => ( - - ))} + + +
+
+

Properties

+
+ {Object.keys(properties).map((key) => ( + + ))} +
-
- - - - )} - + + + + )} + + )}