From b0fa048c5814e894dcb6a128e392c928f2dabca7 Mon Sep 17 00:00:00 2001 From: Akmal Isomadinov Date: Wed, 28 Aug 2024 17:09:59 +0500 Subject: [PATCH] Client:EmptyView Added new option --- packages/client/public/locales/en/EmptyView.json | 2 ++ .../EmptyViewContainer.helpers.tsx | 12 ++++++++++++ .../EmptyViewContainer/EmptyViewContainer.hooks.ts | 4 ++++ 3 files changed, 18 insertions(+) diff --git a/packages/client/public/locales/en/EmptyView.json b/packages/client/public/locales/en/EmptyView.json index 9b6e1578b4..bedc6ae2e3 100644 --- a/packages/client/public/locales/en/EmptyView.json +++ b/packages/client/public/locales/en/EmptyView.json @@ -3,6 +3,8 @@ "CollaboratorEmptyTitle": "The room is empty.", "CreateDocument": "Create a new document", "CreateDocumentDescription": "Take advantage of vast word processing functionality.", + "CreateForm": "Create a new PDF form", + "CreateFormDescription": "Collect votes, get opinions and store data using PDF forms", "CreateNewFileDescription": "Start working in the room by creating files or folders", "CreateNewFileTitle": "Create a new file", "CreatePresentation": "Create a new presentation", diff --git a/packages/client/src/components/EmptyContainer/sub-components/EmptyViewContainer/EmptyViewContainer.helpers.tsx b/packages/client/src/components/EmptyContainer/sub-components/EmptyViewContainer/EmptyViewContainer.helpers.tsx index 20167a86c3..247f014007 100644 --- a/packages/client/src/components/EmptyContainer/sub-components/EmptyViewContainer/EmptyViewContainer.helpers.tsx +++ b/packages/client/src/components/EmptyContainer/sub-components/EmptyViewContainer/EmptyViewContainer.helpers.tsx @@ -10,6 +10,7 @@ import { ShareAccessRights, } from "@docspace/shared/enums"; +import UploadPDFFormIcon from "PUBLIC_DIR/images/emptyview/upload.pdf.form.svg"; import CreateNewFormIcon from "PUBLIC_DIR/images/emptyview/create.new.form.svg"; import CreateNewSpreadsheetIcon from "PUBLIC_DIR/images/emptyview/create.new.spreadsheet.svg"; import CreateNewPresentation from "PUBLIC_DIR/images/emptyview/create.new.presentation.svg"; @@ -232,6 +233,15 @@ export const getOptions = ( disabled: false, }; + const createForm = { + title: t("EmptyView:CreateForm"), + description: t("EmptyView:CreateFormDescription"), + icon: , + key: "create-form-option", + onClick: () => actions.onCreate("pdf"), + disabled: false, + }; + const createRoom = { title: t("EmptyView:CreateRoomTitleOption"), description: t("EmptyView:CreateRoomDescriotionOption"), @@ -316,6 +326,7 @@ export const getOptions = ( createDoc, createSpreadsheet, createPresentation, + createForm, ]) .with([FolderType.Recent, P._], () => ({ ...actions.onGoToPersonal(), @@ -360,6 +371,7 @@ export const getOptions = ( createDoc, createSpreadsheet, createPresentation, + createForm, ]) .otherwise(() => []); } diff --git a/packages/client/src/components/EmptyContainer/sub-components/EmptyViewContainer/EmptyViewContainer.hooks.ts b/packages/client/src/components/EmptyContainer/sub-components/EmptyViewContainer/EmptyViewContainer.hooks.ts index 1d50ec6c0e..aaf8ab1333 100644 --- a/packages/client/src/components/EmptyContainer/sub-components/EmptyViewContainer/EmptyViewContainer.hooks.ts +++ b/packages/client/src/components/EmptyContainer/sub-components/EmptyViewContainer/EmptyViewContainer.hooks.ts @@ -4,6 +4,7 @@ import { useNavigate, LinkProps } from "react-router-dom"; import { Events, + FileExtensions, FilesSelectorFilterTypes, FilterType, RoomSearchArea, @@ -216,10 +217,13 @@ export const useOptions = ( (extension: ExtensiontionType, withoutDialog?: boolean) => { const event: CreateEvent = new Event(Events.CREATE); + const edit = extension === FileExtensions.PDF; + const payload = { id: -1, extension, withoutDialog, + edit, }; event.payload = payload;