Merge pull request #925 from ONLYOFFICE/feature/fix-bug-reactjs

Feature/fix bug reactjs
This commit is contained in:
maxkadushkin 2021-06-16 12:17:27 +03:00 committed by GitHub
commit 0991b8dbdb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 51 additions and 38 deletions

View file

@ -212,6 +212,8 @@
.dialog.modal-in { .dialog.modal-in {
z-index: 14000; z-index: 14000;
max-height: 100%;
overflow: auto;
} }
.dialog-backdrop.backdrop-in { .dialog-backdrop.backdrop-in {

View file

@ -1,5 +1,5 @@
{ {
"Main" : { "Main": {
"SDK": { "SDK": {
"Series": "Series", "Series": "Series",
"Diagram Title": "Chart Title", "Diagram Title": "Chart Title",
@ -47,12 +47,10 @@
"textPaidFeature": "Paid feature", "textPaidFeature": "Paid feature",
"textCustomLoader": "Please note that according to the terms of the license you are not entitled to change the loader. Please contact our Sales Department to get a quote.", "textCustomLoader": "Please note that according to the terms of the license you are not entitled to change the loader. Please contact our Sales Department to get a quote.",
"textClose": "Close", "textClose": "Close",
"errorProcessSaveResult": "Saving is failed.", "errorProcessSaveResult": "Saving is failed.",
"criticalErrorTitle": "Error", "criticalErrorTitle": "Error",
"warnProcessRightsChange": "You have been denied the right to edit the file.", "warnProcessRightsChange": "You have been denied the right to edit the file.",
"errorAccessDeny": "You are trying to perform an action you do not have rights for.<br>Please contact your Document Server administrator.", "errorAccessDeny": "You are trying to perform an action you do not have rights for.<br>Please contact your Document Server administrator.",
"errorUpdateVersion": "The file version has been changed. The page will be reloaded.", "errorUpdateVersion": "The file version has been changed. The page will be reloaded.",
"titleUpdateVersion": "Version changed", "titleUpdateVersion": "Version changed",
"textHasMacros": "The file contains automatic macros.<br>Do you want to run macros?", "textHasMacros": "The file contains automatic macros.<br>Do you want to run macros?",
@ -468,7 +466,7 @@
"textCancel": "Cancel", "textCancel": "Cancel",
"textPictureFromLibrary": "Picture from Library", "textPictureFromLibrary": "Picture from Library",
"textPictureFromURL": "Picture from URL", "textPictureFromURL": "Picture from URL",
"textLinkSettings": "LinkSettings", "textLinkSettings": "Link Settings",
"textBack": "Back", "textBack": "Back",
"textEmptyImgUrl": "You need to specify image URL.", "textEmptyImgUrl": "You need to specify image URL.",
"txtNotUrl": "This field should be a URL in the format \"http://www.example.com\"", "txtNotUrl": "This field should be a URL in the format \"http://www.example.com\"",

View file

@ -204,8 +204,8 @@ const ErrorController = inject('storeAppOptions')(({storeAppOptions, LoadingDocu
if (id === Asc.c_oAscError.ID.Warning && btn === 'ok' && (storeAppOptions.canDownload || storeAppOptions.canDownloadOrigin)) { if (id === Asc.c_oAscError.ID.Warning && btn === 'ok' && (storeAppOptions.canDownload || storeAppOptions.canDownloadOrigin)) {
api.asc_DownloadOrigin(); api.asc_DownloadOrigin();
} else if(id === Asc.c_oAscError.ID.SplitCellMaxRows || } else if(id === Asc.c_oAscError.ID.SplitCellMaxRows ||
Asc.c_oAscError.ID.SplitCellMaxCols || id === Asc.c_oAscError.ID.SplitCellMaxCols ||
Asc.c_oAscError.ID.SplitCellRowsDivider && btn === 'ok' && (storeAppOptions.canDownload || storeAppOptions.canDownloadOrigin)) { id === Asc.c_oAscError.ID.SplitCellRowsDivider) {
Common.Notifications.trigger('showSplitModal',true); Common.Notifications.trigger('showSplitModal',true);
} }
storeAppOptions.changeEditingRights(false); storeAppOptions.changeEditingRights(false);

View file

@ -76,30 +76,36 @@ const AddLayoutContent = ({ tabs }) => {
) )
}; };
const AddTabs = props => { const AddTabs = inject("storeFocusObjects")(observer(({storeFocusObjects, showPanels, style, inPopover}) => {
const { t } = useTranslation(); const { t } = useTranslation();
const _t = t('Add', {returnObjects: true}); const _t = t('Add', {returnObjects: true});
const showPanels = props.showPanels;
const tabs = []; const tabs = [];
if (!showPanels) { const options = storeFocusObjects.settings;
if (!showPanels && options.indexOf('text') > -1) {
tabs.push({ tabs.push({
caption: _t.textTable, caption: _t.textTable,
id: 'add-table', id: 'add-table',
icon: 'icon-add-table', icon: 'icon-add-table',
component: <AddTableController/> component: <AddTableController/>
}); });
}
if(!showPanels) {
tabs.push({ tabs.push({
caption: _t.textShape, caption: _t.textShape,
id: 'add-shape', id: 'add-shape',
icon: 'icon-add-shape', icon: 'icon-add-shape',
component: <AddShapeController/> component: <AddShapeController/>
}); });
}
if(!showPanels) {
tabs.push({ tabs.push({
caption: _t.textImage, caption: _t.textImage,
id: 'add-image', id: 'add-image',
icon: 'icon-add-image', icon: 'icon-add-image',
component: <AddImageController/> component: <AddImageController/>
}); });
}
if(!showPanels) {
tabs.push({ tabs.push({
caption: _t.textOther, caption: _t.textOther,
id: 'add-other', id: 'add-other',
@ -115,14 +121,14 @@ const AddTabs = props => {
}); });
} }
return ( return (
<View style={props.style} stackPages={true} routes={routes}> <View style={style} stackPages={true} routes={routes}>
<Page pageContent={false}> <Page pageContent={false}>
<AddLayoutNavbar tabs={tabs} inPopover={props.inPopover}/> <AddLayoutNavbar tabs={tabs} inPopover={inPopover}/>
<AddLayoutContent tabs={tabs} /> <AddLayoutContent tabs={tabs} />
</Page> </Page>
</View> </View>
) )
}; }));
class AddView extends Component { class AddView extends Component {
constructor(props) { constructor(props) {

View file

@ -153,46 +153,55 @@ const PageFootnote = props => {
const AddOther = props => { const AddOther = props => {
const { t } = useTranslation(); const { t } = useTranslation();
const _t = t('Add', {returnObjects: true}); const _t = t('Add', {returnObjects: true});
const storeFocusObjects = props.storeFocusObjects;
let isShape = storeFocusObjects.settings.indexOf('shape') > -1,
isText = storeFocusObjects.settings.indexOf('text') > -1,
isChart = storeFocusObjects.settings.indexOf('chart') > -1;
return ( return (
<List> <List>
<ListItem title={_t.textComment} onClick={() => { {isText &&<ListItem title={_t.textComment} onClick={() => {
props.closeModal(); props.closeModal();
Common.Notifications.trigger('addcomment'); Common.Notifications.trigger('addcomment');
}}> }}>
<Icon slot="media" icon="icon-insert-comment"></Icon> <Icon slot="media" icon="icon-insert-comment"></Icon>
</ListItem> </ListItem>}
<ListItem title={_t.textLink} link={'/add-link/'} routeProps={{ {isText && <ListItem title={_t.textLink} link={'/add-link/'} routeProps={{
onInsertLink: props.onInsertLink, onInsertLink: props.onInsertLink,
getDisplayLinkText: props.getDisplayLinkText getDisplayLinkText: props.getDisplayLinkText
}}> }}>
<Icon slot="media" icon="icon-link"></Icon> <Icon slot="media" icon="icon-link"></Icon>
</ListItem> </ListItem>}
<ListItem title={_t.textPageNumber} link={'/add-page-number/'} routeProps={{ <ListItem title={_t.textPageNumber} link={'/add-page-number/'} routeProps={{
onInsertPageNumber: props.onInsertPageNumber onInsertPageNumber: props.onInsertPageNumber
}}> }}>
<Icon slot="media" icon="icon-pagenumber"></Icon> <Icon slot="media" icon="icon-pagenumber"></Icon>
</ListItem> </ListItem>
<ListItem title={_t.textBreak} link={'/add-break/'} routeProps={{ {(isShape || isChart) ? null :
onPageBreak: props.onPageBreak, <ListItem title={_t.textBreak} link={'/add-break/'} routeProps={{
onColumnBreak: props.onColumnBreak, onPageBreak: props.onPageBreak,
onInsertSectionBreak: props.onInsertSectionBreak onColumnBreak: props.onColumnBreak,
}}> onInsertSectionBreak: props.onInsertSectionBreak
<Icon slot="media" icon="icon-sectionbreak"></Icon> }}>
</ListItem> <Icon slot="media" icon="icon-sectionbreak"></Icon>
<ListItem title={_t.textFootnote} link={'/add-footnote/'} routeProps={{ </ListItem>
getFootnoteProps: props.getFootnoteProps, }
getFootnoteStartAt: props.getFootnoteStartAt, {(isShape || isChart) ? null :
onFootnoteStartAt: props.onFootnoteStartAt, <ListItem title={_t.textFootnote} link={'/add-footnote/'} routeProps={{
onInsertFootnote: props.onInsertFootnote, getFootnoteProps: props.getFootnoteProps,
initFootnoteStartAt: props.initFootnoteStartAt getFootnoteStartAt: props.getFootnoteStartAt,
}}> onFootnoteStartAt: props.onFootnoteStartAt,
<Icon slot="media" icon="icon-footnote"></Icon> onInsertFootnote: props.onInsertFootnote,
</ListItem> initFootnoteStartAt: props.initFootnoteStartAt
}}>
<Icon slot="media" icon="icon-footnote"></Icon>
</ListItem>}
</List> </List>
) )
}; };
const AddOtherContainer = inject("storeComments")(observer(AddOther)); const AddOtherContainer = inject("storeComments","storeFocusObjects")(observer(AddOther));
export {AddOtherContainer as AddOther, export {AddOtherContainer as AddOther,
PageNumber as PageAddNumber, PageNumber as PageAddNumber,

View file

@ -1,6 +1,6 @@
{ {
"Controller" : { "Controller": {
"Main" : { "Main": {
"SDK": { "SDK": {
"Series": "Series", "Series": "Series",
"Diagram Title": "Chart Title", "Diagram Title": "Chart Title",
@ -48,12 +48,10 @@
"textPaidFeature": "Paid feature", "textPaidFeature": "Paid feature",
"textCustomLoader": "Please note that according to the terms of the license you are not entitled to change the loader. Please contact our Sales Department to get a quote.", "textCustomLoader": "Please note that according to the terms of the license you are not entitled to change the loader. Please contact our Sales Department to get a quote.",
"textClose": "Close", "textClose": "Close",
"errorProcessSaveResult": "Saving is failed.", "errorProcessSaveResult": "Saving is failed.",
"criticalErrorTitle": "Error", "criticalErrorTitle": "Error",
"warnProcessRightsChange": "You have been denied the right to edit the file.", "warnProcessRightsChange": "You have been denied the right to edit the file.",
"errorAccessDeny": "You are trying to perform an action you do not have rights for.<br>Please contact your Document Server administrator.", "errorAccessDeny": "You are trying to perform an action you do not have rights for.<br>Please contact your Document Server administrator.",
"errorUpdateVersion": "The file version has been changed. The page will be reloaded.", "errorUpdateVersion": "The file version has been changed. The page will be reloaded.",
"titleUpdateVersion": "Version changed", "titleUpdateVersion": "Version changed",
"textHasMacros": "The file contains automatic macros.<br>Do you want to run macros?", "textHasMacros": "The file contains automatic macros.<br>Do you want to run macros?",
@ -219,7 +217,7 @@
"textOther": "Other", "textOther": "Other",
"textPictureFromLibrary": "Picture from Library", "textPictureFromLibrary": "Picture from Library",
"textPictureFromURL": "Picture from URL", "textPictureFromURL": "Picture from URL",
"textLinkSettings": "LinkSettings", "textLinkSettings": "Link Settings",
"textBack": "Back", "textBack": "Back",
"textEmptyImgUrl": "You need to specify image URL.", "textEmptyImgUrl": "You need to specify image URL.",
"txtNotUrl": "This field should be a URL in the format \"http://www.example.com\"", "txtNotUrl": "This field should be a URL in the format \"http://www.example.com\"",