Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 33 additions & 15 deletions apps/app/components/account/email-code-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -68,10 +68,7 @@ export const EmailCodeForm = ({ onSuccess }: any) => {

return (
<>
<form
className="mt-5 space-y-5"
onSubmit={codeSent ? handleSubmit(handleSignin) : handleSubmit(onSubmit)}
>
<form className="mt-5 space-y-5">
{codeSent && (
<div className="rounded-md bg-green-50 p-4">
<div className="flex">
Expand Down Expand Up @@ -117,16 +114,37 @@ export const EmailCodeForm = ({ onSuccess }: any) => {
error={errors.token}
placeholder="Enter code"
/>
{/* <span
className="text-xs outline-none hover:text-theme"
onClick={() => {
console.log("Triggered");
handleSubmit(onSubmit);
}}
>
Resend code
</span> */}
</div>
)}
<div>
<Button
disabled={isSubmitting || (!isValid && isDirty)}
className="w-full text-center"
type="submit"
>
{isSubmitting ? "Signing in..." : codeSent ? "Sign In" : "Continue with Email ID"}
</Button>
{codeSent ? (
<Button
type="submit"
className="w-full text-center"
onClick={handleSubmit(handleSignin)}
disabled={isSubmitting || (!isValid && isDirty)}
>
{isSubmitting ? "Signing in..." : "Sign in"}
</Button>
) : (
<Button
type="submit"
className="w-full text-center"
onClick={handleSubmit(onSubmit)}
disabled={isSubmitting || (!isValid && isDirty)}
>
{isSubmitting ? "Sending code..." : "Send code"}
</Button>
)}
</div>
</form>
</>
Expand Down
4 changes: 3 additions & 1 deletion apps/app/components/core/board-view/single-board.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ export const SingleBoard: React.FC<Props> = ({
? (bgColor = "#22c55e")
: (bgColor = "#ff0000");

const isNotAllowed = userAuth.isGuest || userAuth.isViewer;

return (
<div className={`h-full flex-shrink-0 rounded ${!isCollapsed ? "" : "w-80 border bg-gray-50"}`}>
<div className={`${!isCollapsed ? "" : "flex h-full flex-col space-y-3 overflow-y-auto"}`}>
Expand All @@ -95,7 +97,7 @@ export const SingleBoard: React.FC<Props> = ({
key={issue.id}
draggableId={issue.id}
index={index}
isDragDisabled={selectedGroup === "created_by"}
isDragDisabled={isNotAllowed || selectedGroup === "created_by"}
>
{(provided, snapshot) => (
<SingleBoardIssue
Expand Down
8 changes: 5 additions & 3 deletions apps/app/components/issues/view-select/state.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ export const ViewStateSelect: React.FC<Props> = ({
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 ?? {});

Expand Down
23 changes: 12 additions & 11 deletions apps/app/components/project/card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -85,6 +86,14 @@ export const ProjectCard: React.FC<ProjectCardProps> = (props) => {
</div>
<div className="mt-3 flex h-full items-end justify-between">
<div className="flex gap-2">
<Button
theme="secondary"
className="flex items-center gap-1"
onClick={() => router.push(`/${workspaceSlug}/projects/${project.id}/issues`)}
>
<ClipboardDocumentListIcon className="h-3 w-3" />
Open Project
</Button>
{!isMember ? (
<button
type="button"
Expand All @@ -97,19 +106,11 @@ export const ProjectCard: React.FC<ProjectCardProps> = (props) => {
<span>Select to Join</span>
</button>
) : (
<Button theme="secondary" className="flex items-center gap-1" disabled>
<div className="flex items-center gap-1 text-xs">
<CheckIcon className="h-3 w-3" />
Member
</Button>
</div>
)}
<Button
theme="secondary"
className="flex items-center gap-1"
onClick={() => router.push(`/${workspaceSlug}/projects/${project.id}/issues`)}
>
<ClipboardDocumentListIcon className="h-3 w-3" />
Open Project
</Button>
</div>
<div className="mb-1 flex items-center gap-1 text-xs">
<CalendarDaysIcon className="h-4 w-4" />
Expand Down
4 changes: 0 additions & 4 deletions apps/app/components/project/cycles/confirm-cycle-deletion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ const ConfirmCycleDeletion: React.FC<TConfirmCycleDeletionProps> = ({

const { setToastAlert } = useToast();

useEffect(() => {
data && setIsOpen(true);
}, [data, setIsOpen]);

const handleClose = () => {
setIsOpen(false);
setIsDeleteLoading(false);
Expand Down
Loading