Web: Files: Added "Fill in the form" context menu action from ".ofrom" files
This commit is contained in:
parent
ce41e5d4cb
commit
839d81f356
@ -16,6 +16,10 @@ export default function withContextOptions(WrappedComponent) {
|
||||
openLocationAction(locationId, !fileExst);
|
||||
};
|
||||
|
||||
onClickLinkFillForm = () => {
|
||||
return this.gotoDocEditor(false);
|
||||
};
|
||||
|
||||
onOpenLocation = () => {
|
||||
const { item, openLocationAction } = this.props;
|
||||
const { parentId, folderId, fileExst } = item;
|
||||
@ -364,6 +368,14 @@ export default function withContextOptions(WrappedComponent) {
|
||||
onClick: this.onClickLinkForPortal,
|
||||
disabled: false,
|
||||
};
|
||||
case "fill-form":
|
||||
return {
|
||||
key: option,
|
||||
label: t("Common:FillFormButton"),
|
||||
icon: "/static/images/access.edit.form.react.svg",
|
||||
onClick: this.onClickLinkFillForm,
|
||||
disabled: false,
|
||||
};
|
||||
case "edit":
|
||||
return {
|
||||
key: option,
|
||||
|
@ -417,7 +417,11 @@ class FilesStore {
|
||||
isMy,
|
||||
} = this.treeFoldersStore;
|
||||
|
||||
const { canWebEdit, canViewedDocs } = this.formatsStore.docserviceStore;
|
||||
const {
|
||||
canWebEdit,
|
||||
canViewedDocs,
|
||||
canFormFillingDocs,
|
||||
} = this.formatsStore.docserviceStore;
|
||||
|
||||
const isThirdPartyFolder =
|
||||
item.providerKey && item.id === item.rootFolderId;
|
||||
@ -429,10 +433,12 @@ class FilesStore {
|
||||
const { isDesktopClient } = this.authStore.settingsStore;
|
||||
|
||||
if (isFile) {
|
||||
const shouldEdit = canWebEdit(item.fileExst);
|
||||
const shouldFillForm = canFormFillingDocs(item.fileExst);
|
||||
const shouldEdit = !shouldFillForm && canWebEdit(item.fileExst);
|
||||
const shouldView = canViewedDocs(item.fileExst);
|
||||
let fileOptions = [
|
||||
//"open",
|
||||
"fill-form",
|
||||
"edit",
|
||||
"preview",
|
||||
"view",
|
||||
@ -466,6 +472,9 @@ class FilesStore {
|
||||
"delete",
|
||||
];
|
||||
|
||||
if (!shouldFillForm)
|
||||
fileOptions = this.removeOptions(fileOptions, ["fill-form"]);
|
||||
|
||||
if (personal) {
|
||||
fileOptions = this.removeOptions(fileOptions, [
|
||||
"owner-change",
|
||||
|
@ -41,6 +41,7 @@
|
||||
"EncryptionKeysReload": "Encryption keys must be re-entered",
|
||||
"EncryptionFilePreparing": "Preparing file for encryption",
|
||||
"Error": "Error",
|
||||
"FillFormButton": "Fill in the form",
|
||||
"FullAccess": "Full access",
|
||||
"Guest": "Guest",
|
||||
"Language": "Language",
|
||||
|
Loading…
Reference in New Issue
Block a user