From e00efd03a1f8d6c5857c9bd61c4e1d34aef61aea Mon Sep 17 00:00:00 2001 From: Anubhav Singh Date: Thu, 23 Nov 2023 22:37:13 +0530 Subject: [PATCH 1/4] BUG-1566 - Add Copy functionality --- .../src/pages/builder/_components/toolbar.tsx | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/apps/client/src/pages/builder/_components/toolbar.tsx b/apps/client/src/pages/builder/_components/toolbar.tsx index 439f90b3..a2568fa4 100644 --- a/apps/client/src/pages/builder/_components/toolbar.tsx +++ b/apps/client/src/pages/builder/_components/toolbar.tsx @@ -15,11 +15,13 @@ import { import { Button, Separator, Toggle, Tooltip } from "@reactive-resume/ui"; import { motion } from "framer-motion"; +import { useToast } from "@/client/hooks/use-toast"; import { usePrintResume } from "@/client/services/resume"; import { useBuilderStore } from "@/client/stores/builder"; import { useResumeStore, useTemporalResumeStore } from "@/client/stores/resume"; export const BuilderToolbar = () => { + const { toast } = useToast(); const setValue = useResumeStore((state) => state.setValue); const undo = useTemporalResumeStore((state) => state.undo); const redo = useTemporalResumeStore((state) => state.redo); @@ -42,6 +44,17 @@ export const BuilderToolbar = () => { openInNewTab(url); }; + const onCopy = async () => { + const { url } = await printResume({ id }); + await navigator.clipboard.writeText(url); + + toast({ + variant: "success", + title: t`A link has been copied to your clipboard.`, + description: t`Anyone with this link can view and download the resume. Share it on your profile or with recruiters.`, + }); + }; + const onZoomIn = () => frameRef?.contentWindow?.postMessage({ type: "ZOOM_IN" }, "*"); const onZoomOut = () => frameRef?.contentWindow?.postMessage({ type: "ZOOM_OUT" }, "*"); const onResetView = () => frameRef?.contentWindow?.postMessage({ type: "RESET_VIEW" }, "*"); @@ -117,7 +130,13 @@ export const BuilderToolbar = () => { - From 482c0b49822a9af78add2f2f1a5defdea999aeeb Mon Sep 17 00:00:00 2001 From: Anubhav Singh Date: Fri, 24 Nov 2023 00:21:09 +0530 Subject: [PATCH 2/4] BUG-1569 - Add Lock Option for List View --- .../_layouts/list/_components/resume-item.tsx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/apps/client/src/pages/dashboard/resumes/_layouts/list/_components/resume-item.tsx b/apps/client/src/pages/dashboard/resumes/_layouts/list/_components/resume-item.tsx index 5891d83d..183954e6 100644 --- a/apps/client/src/pages/dashboard/resumes/_layouts/list/_components/resume-item.tsx +++ b/apps/client/src/pages/dashboard/resumes/_layouts/list/_components/resume-item.tsx @@ -3,6 +3,8 @@ import { CopySimple, DotsThreeVertical, FolderOpen, + Lock, + LockOpen, PencilSimple, TrashSimple, } from "@phosphor-icons/react"; @@ -38,6 +40,7 @@ type Props = { export const ResumeListItem = ({ resume }: Props) => { const navigate = useNavigate(); const { open } = useDialog("resume"); + const { open: lockOpen } = useDialog("lock"); const { url } = useResumePreview(resume.id); @@ -55,6 +58,10 @@ export const ResumeListItem = ({ resume }: Props) => { open("duplicate", { id: "resume", item: resume }); }; + const onLockChange = () => { + lockOpen(resume.locked ? "update" : "create", { id: "lock", item: resume }); + }; + const onDelete = () => { open("delete", { id: "resume", item: resume }); }; @@ -153,6 +160,17 @@ export const ResumeListItem = ({ resume }: Props) => { {t`Duplicate`} + {resume.locked ? ( + + + {t`Unlock`} + + ) : ( + + + {t`Lock`} + + )} From f2ca131aee3c09826399b07a8a01fd4d42327087 Mon Sep 17 00:00:00 2001 From: Anubhav Singh Date: Fri, 24 Nov 2023 00:31:11 +0530 Subject: [PATCH 3/4] BUG-1569 - Add Lock Option for List View --- .../_layouts/list/_components/resume-item.tsx | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/apps/client/src/pages/dashboard/resumes/_layouts/list/_components/resume-item.tsx b/apps/client/src/pages/dashboard/resumes/_layouts/list/_components/resume-item.tsx index 183954e6..ab566458 100644 --- a/apps/client/src/pages/dashboard/resumes/_layouts/list/_components/resume-item.tsx +++ b/apps/client/src/pages/dashboard/resumes/_layouts/list/_components/resume-item.tsx @@ -101,6 +101,27 @@ export const ResumeListItem = ({ resume }: Props) => { {t`Duplicate`} + {resume.locked ? ( + { + event.stopPropagation(); + onLockChange(); + }} + > + + {t`Unlock`} + + ) : ( + { + event.stopPropagation(); + onLockChange(); + }} + > + + {t`Lock`} + + )} Date: Fri, 24 Nov 2023 01:40:02 +0530 Subject: [PATCH 4/4] Bug Fixed - 1574 - JSON Schema Field issue --- libs/parser/src/json-resume/index.ts | 2 +- libs/parser/src/json-resume/schema.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/parser/src/json-resume/index.ts b/libs/parser/src/json-resume/index.ts index 2d9b8a43..f6cd1c56 100644 --- a/libs/parser/src/json-resume/index.ts +++ b/libs/parser/src/json-resume/index.ts @@ -147,7 +147,7 @@ export class JsonResumeParser implements Parser { result.sections.certifications.items.push({ ...defaultCertification, id: createId(), - name: certificate.title ?? "", + name: certificate.name ?? "", date: certificate.date ?? "", issuer: certificate.issuer ?? "", summary: certificate.summary ?? "", diff --git a/libs/parser/src/json-resume/schema.ts b/libs/parser/src/json-resume/schema.ts index c73c1a0f..4b708525 100644 --- a/libs/parser/src/json-resume/schema.ts +++ b/libs/parser/src/json-resume/schema.ts @@ -63,7 +63,7 @@ const awardsSchema = z.object({ }); const certificatesSchema = z.object({ - title: z.string().optional(), + name: z.string().optional(), date: iso8601.optional(), issuer: z.string().optional(), summary: z.string().optional(),