mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-07-25 10:59:28 +08:00
Merge pull request #2777 from ONLYOFFICE/feature/fix-bugs
[SSE mobile] Fix Bug 65753
This commit is contained in:
@ -517,6 +517,7 @@
|
||||
"errorUpdateVersion": "The file version has been changed. The page will be reloaded.",
|
||||
"leavePageText": "You have unsaved changes. Click 'Stay on this Page' to wait for autosave. Click 'Leave this Page' to discard all the unsaved changes.",
|
||||
"notcriticalErrorTitle": "Warning",
|
||||
"textConvertForm": "Download file as pdf to save the form in the format ready for filling.",
|
||||
"SDK": {
|
||||
" -Section ": " -Section ",
|
||||
"above": "above",
|
||||
@ -729,7 +730,7 @@
|
||||
"textRightToLeft": "Right To Left",
|
||||
"textSameAsSystem": "Same as system",
|
||||
"textSave": "Save",
|
||||
"textSaveAsPdf": "Save as PDF",
|
||||
"del_textSaveAsPdf": "Save as PDF",
|
||||
"textSearch": "Search",
|
||||
"textSetPassword": "Set Password",
|
||||
"textSettings": "Settings",
|
||||
|
||||
@ -239,8 +239,10 @@ class MainController extends Component {
|
||||
if (this._isDocReady)
|
||||
return;
|
||||
|
||||
const { t } = this.props;
|
||||
const appOptions = this.props.storeAppOptions;
|
||||
const isForm = appOptions.isForm;
|
||||
const isOForm = appOptions.isOForm;
|
||||
const appSettings = this.props.storeApplicationSettings;
|
||||
|
||||
f7.emit('resize');
|
||||
@ -302,6 +304,18 @@ class MainController extends Component {
|
||||
Common.Notifications.trigger('document:ready');
|
||||
Common.Gateway.documentReady();
|
||||
appOptions.changeDocReady(true);
|
||||
|
||||
if(isOForm) {
|
||||
f7.dialog.create({
|
||||
title: t('Main.notcriticalErrorTitle'),
|
||||
text: t('Main.textConvertForm'),
|
||||
buttons: [
|
||||
{
|
||||
text: t('Main.textOk')
|
||||
}
|
||||
]
|
||||
}).open();
|
||||
}
|
||||
};
|
||||
|
||||
const _process_array = (array, fn) => {
|
||||
|
||||
@ -178,6 +178,8 @@ export class storeAppOptions {
|
||||
this.fileKey = document.key;
|
||||
this.isXpsViewer = /^(?:(djvu|xps|oxps))$/.exec(document.fileType);
|
||||
this.typeForm = /^(?:(pdf))$/.exec(document.fileType); // can fill forms only in pdf format
|
||||
this.typeOForm = /^(?:(oform))$/.exec(document.fileType);
|
||||
this.isOForm = !!(this.typeOForm && typeof this.typeOForm[1] === 'string');
|
||||
this.canFillForms = this.canLicense && !!(this.typeForm && typeof this.typeForm[1] === 'string') && ((permissions.fillForms === undefined) ? this.isEdit : permissions.fillForms) && (this.config.mode !== 'view');
|
||||
this.isForm = !this.isXpsViewer && !!window.isPDFForm;
|
||||
this.canProtect = permissions.protect !== false;
|
||||
|
||||
@ -85,7 +85,7 @@ const SettingsPage = inject("storeAppOptions", "storeReview", "storeDocumentInfo
|
||||
</ListItem>
|
||||
: ''),
|
||||
(_canDownload && canFillForms && !canSubmitForms ?
|
||||
<ListItem key='save-form-link' title={t('Settings.textSaveAsPdf')} link='#' className='no-indicator' onClick={settingsContext.saveAsPdf}>
|
||||
<ListItem key='save-form-link' title={t('Settings.textSave')} link='#' className='no-indicator' onClick={settingsContext.saveAsPdf}>
|
||||
<Icon slot="media" icon="icon-save-form"></Icon>
|
||||
</ListItem>
|
||||
: ''),
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
import React, { useContext } from 'react';
|
||||
import { f7 } from 'framework7-react';
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { withTranslation} from 'react-i18next';
|
||||
@ -6,7 +5,6 @@ import { LocalStorage } from '../../../../common/mobile/utils/LocalStorage.mjs';
|
||||
|
||||
import ContextMenuController from '../../../../common/mobile/lib/controller/ContextMenu';
|
||||
import { idContextMenuElement } from '../../../../common/mobile/lib/view/ContextMenu';
|
||||
// import { Device } from '../../../../common/mobile/utils/device';
|
||||
import EditorUIController from '../lib/patch';
|
||||
|
||||
@inject(stores => ({
|
||||
@ -17,7 +15,7 @@ import EditorUIController from '../lib/patch';
|
||||
isRestrictedEdit: stores.storeAppOptions.isRestrictedEdit,
|
||||
users: stores.users,
|
||||
isDisconnected: stores.users.isDisconnected,
|
||||
storeSheets: stores.sheets,
|
||||
storeWorksheets: stores.storeWorksheets,
|
||||
wsProps: stores.storeWorksheets.wsProps,
|
||||
wsLock: stores.storeWorksheets.wsLock,
|
||||
objects: stores.storeFocusObjects.objects,
|
||||
@ -106,6 +104,7 @@ class ContextMenu extends ContextMenuController {
|
||||
|
||||
const api = Common.EditorApi.get();
|
||||
const info = api.asc_getCellInfo();
|
||||
|
||||
switch (action) {
|
||||
case 'cut':
|
||||
if (!LocalStorage.getBool("sse-hide-copy-cut-paste-warning")) {
|
||||
@ -127,17 +126,19 @@ class ContextMenu extends ContextMenuController {
|
||||
break;
|
||||
case 'openlink':
|
||||
const linkinfo = info.asc_getHyperlink();
|
||||
|
||||
if ( linkinfo.asc_getType() == Asc.c_oAscHyperlinkType.RangeLink ) {
|
||||
const { storeWorksheets } = this.props;
|
||||
const nameSheet = linkinfo.asc_getSheet();
|
||||
const curActiveSheet = api.asc_getActiveWorksheetIndex();
|
||||
const tab = storeWorksheets.sheets.find((sheet) => sheet.name === nameSheet);
|
||||
api.asc_setWorksheetRange(linkinfo);
|
||||
const {storeSheets} = this.props;
|
||||
const tab = storeSheets.sheets.find((sheet) => sheet.name === nameSheet);
|
||||
|
||||
if (tab) {
|
||||
const sdkIndex = tab.index;
|
||||
if (sdkIndex !== curActiveSheet) {
|
||||
const index = storeSheets.sheets.indexOf(tab);
|
||||
storeSheets.setActiveWorksheet(index);
|
||||
const index = storeWorksheets.sheets.indexOf(tab);
|
||||
storeWorksheets.setActiveWorksheet(index);
|
||||
Common.Notifications.trigger('sheet:active', sdkIndex);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,8 +1,5 @@
|
||||
|
||||
// import {storeDocumentSettings} from './documentSettings';
|
||||
import {storeFocusObjects} from "./focusObjects";
|
||||
import {storeUsers} from '../../../../common/mobile/lib/store/users';
|
||||
import {storeWorksheets} from './sheets';
|
||||
import {storeFunctions} from './functions';
|
||||
import {storePalette} from "./palette";
|
||||
import {storeTextSettings} from "./textSettings";
|
||||
@ -20,6 +17,7 @@ import {storeComments} from "../../../../common/mobile/lib/store/comments";
|
||||
import {storeToolbarSettings} from "./toolbar";
|
||||
import { storeThemes } from '../../../../common/mobile/lib/store/themes';
|
||||
import { storeVersionHistory } from "../../../../common/mobile/lib/store/versionHistory";
|
||||
import {storeWorksheets} from "./sheets";
|
||||
|
||||
export const stores = {
|
||||
storeFocusObjects: new storeFocusObjects(),
|
||||
|
||||
@ -20,7 +20,7 @@ class Worksheet {
|
||||
}
|
||||
|
||||
export class storeWorksheets {
|
||||
sheets;
|
||||
sheets = [];
|
||||
|
||||
constructor() {
|
||||
makeObservable(this, {
|
||||
|
||||
Reference in New Issue
Block a user