Merge pull request #605 from ONLYOFFICE/feature/add-new-option

Client:EmptyView Added new option
This commit is contained in:
Alexey Safronov 2024-08-28 16:14:49 +04:00 committed by GitHub
commit bc2d7792a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 18 additions and 0 deletions

View File

@ -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",

View File

@ -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: <UploadPDFFormIcon />,
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(() => []);
}

View File

@ -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;