Merge branch 'feature/develop-fixes' into develop

This commit is contained in:
JuliaSvinareva 2021-05-31 16:29:18 +03:00
commit 3382d2f373
28 changed files with 96 additions and 54 deletions

View file

@ -355,6 +355,10 @@
color: red;
}
.list-button {
position: initial;
}
.block-title {
position: relative;
overflow: hidden;

View file

@ -103,7 +103,8 @@
.button-fill {
color: @white;
background-color: @themeColor;
// background-color: @themeColor;
background-color: transparent;
}
.button-raised {
@ -116,14 +117,19 @@
}
.buttons-list {
li {
margin: 20px 16px;
color: @white;
border-radius: 2px;
text-transform: uppercase;
height: 36px;
min-height: 36px;
font-size: 14px;
ul {
&::before, &::after {
display: none;
}
li {
margin: 20px 16px;
color: @white;
border-radius: 2px;
text-transform: uppercase;
height: 36px;
min-height: 36px;
font-size: 14px;
}
}
}
@ -142,7 +148,8 @@
font-size: 14px;
font-weight: 500;
border-radius: 2px;
margin: 20px 16px;
// margin: 20px 16px;
margin: 0;
}
.button-raised .list-button {
box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.24);

View file

@ -339,9 +339,9 @@
.buttons-list {
ul {
&::before, &::after {
display: none;
}
// &::before, &::after {
// display: none;
// }
li {
border: 0;
font-weight: normal;

View file

@ -20,7 +20,7 @@ const PageLinkSettings = props => {
>
</ListInput>
</List>
<List>
<List className="buttons-list">
<ListButton className={'button-fill button-raised' + (stateValue.length < 1 ? ' disabled' : '')}
title={_t.textInsertImage}
onClick={() => {props.onInsertByUrl(stateValue)}}></ListButton>

View file

@ -39,7 +39,7 @@ const PageLink = props => {
onChange={(event) => {setTip(event.target.value)}}
></ListInput>
</List>
<List>
<List className="buttons-list">
<ListButton className={'button-fill button-raised' + (stateLink.length < 1 ? ' disabled' : '')} title={_t.textInsert} onClick={() => {
props.onInsertLink(stateLink, stateDisplay, stateTip)
}}></ListButton>

View file

@ -141,7 +141,7 @@ const PageFootnote = props => {
)
})}
</List>
<List>
<List className="buttons-list">
<ListButton className={'button-fill button-raised'} title={_t.textInsertFootnote} onClick={() => {
props.onInsertFootnote(stateFormat, stateStartAt, stateLocation);
}}></ListButton>

View file

@ -446,7 +446,7 @@ const EditChart = props => {
onReorder: props.onReorder
}}></ListItem>
</List>
<List>
<List className="buttons-list">
<ListButton title={_t.textRemoveChart} onClick={() => {props.onRemoveChart()}} className='button-red button-fill button-raised'/>
</List>
</Fragment>

View file

@ -38,7 +38,7 @@ const EditHyperlink = props => {
onChange={(event) => {setTip(event.target.value)}}
></ListInput>
</List>
<List>
<List className="buttons-list">
<ListButton className={'button-fill button-raised' + (stateLink.length < 1 ? ' disabled' : '')} title={_t.textEditLink} onClick={() => {
props.onEditLink(stateLink, stateDisplay, stateTip)
}}></ListButton>

View file

@ -156,7 +156,7 @@ const PageLinkSettings = props => {
>
</ListInput>
</List>
<List>
<List className="buttons-list">
<ListButton className={'button-fill button-raised' + (stateValue.length < 1 ? ' disabled' : '')} title={_t.textReplaceImage} onClick={() => {onReplace()}}></ListButton>
</List>
</Page>
@ -236,6 +236,10 @@ const PageReorder = props => {
const EditImage = props => {
const { t } = useTranslation();
const _t = t('Edit', {returnObjects: true});
const storeFocusObjects = props.storeFocusObjects;
const imageObject = storeFocusObjects.imageObject;
const pluginGuid = imageObject.asc_getPluginGuid();
return (
<Fragment>
<List>
@ -246,7 +250,7 @@ const EditImage = props => {
onOverlap: props.onOverlap,
onWrapDistance: props.onWrapDistance
}}></ListItem>
<ListItem title={_t.textReplace} link='/edit-image-replace/' routeProps={{
<ListItem title={_t.textReplace} link='/edit-image-replace/' className={pluginGuid ? 'disabled' : ''} routeProps={{
onReplaceByFile: props.onReplaceByFile,
onReplaceByUrl: props.onReplaceByUrl
}}></ListItem>
@ -254,7 +258,7 @@ const EditImage = props => {
onReorder: props.onReorder
}}></ListItem>
</List>
<List>
<List className="buttons-list">
<ListButton className='button-fill button-raised' title={_t.textActualSize} onClick={() => {props.onDefaulSize()}}/>
<ListButton className='button-red button-fill button-raised' title={_t.textRemoveImage} onClick={() => {props.onRemoveImage()}}/>
</List>

View file

@ -536,7 +536,7 @@ const EditShape = props => {
onReorder: props.onReorder
}}></ListItem>
</List>
<List>
<List className="buttons-list">
<ListButton title={_t.textRemoveShape} onClick={() => {props.onRemoveShape()}} className='button-red button-fill button-raised'/>
</List>
</Fragment>

View file

@ -560,7 +560,9 @@ const EditTable = props => {
</a>
</Row>
</ListItem>
<ListButton title={_t.textRemoveTable} onClick={() => {props.onRemoveTable()}} className='button-red button-fill button-raised'></ListButton>
<List className="buttons-list">
<ListButton title={_t.textRemoveTable} onClick={() => {props.onRemoveTable()}} className='button-red button-fill button-raised'></ListButton>
</List>
</List>
<List>
<ListItem title={_t.textTableOptions} link='/edit-table-options/' routeProps={{

View file

@ -20,7 +20,7 @@ const PageLinkSettings = props => {
>
</ListInput>
</List>
<List>
<List className="buttons-list">
<ListButton className={'button-fill button-raised' + (stateValue.length < 1 ? ' disabled' : '')}
title={_t.textInsertImage}
onClick={() => {props.onInsertByUrl(stateValue)}}></ListButton>

View file

@ -143,7 +143,7 @@ const PageLink = props => {
/>
</List>
<List className="buttons-list">
<ListItem title={_t.textInsert} href="#"
<ListButton title={_t.textInsert}
className={`button-fill button-raised${typeLink === 1 && link.length < 1 && ' disabled'}`}
onClick={() => {
props.onInsertLink(typeLink, (typeLink === 1 ?

View file

@ -392,7 +392,7 @@ const EditChart = props => {
onAlign: props.onAlign
}}></ListItem>
</List>
<List>
<List className="buttons-list">
<ListButton title={_t.textRemoveChart} onClick={() => {props.onRemoveChart()}} className='button-red button-fill button-raised'/>
</List>
</Fragment>

View file

@ -8,11 +8,14 @@ import {Device} from '../../../../../common/mobile/utils/device';
const EditImage = props => {
const { t } = useTranslation();
const _t = t('View.Edit', {returnObjects: true});
const storeFocusObjects = props.storeFocusObjects;
const imageObject = storeFocusObjects.imageObject;
const pluginGuid = imageObject.asc_getPluginGuid();
return (
<Fragment>
<List>
<ListItem title={_t.textReplace} link="/edit-replace-image/" routeProps={{
<ListItem title={_t.textReplace} link="/edit-replace-image/" className={pluginGuid ? 'disabled' : ''} routeProps={{
onReplaceByFile: props.onReplaceByFile,
onReplaceByUrl: props.onReplaceByUrl
}}></ListItem>
@ -24,8 +27,8 @@ const EditImage = props => {
}}></ListItem>
</List>
<List className="buttons-list">
<ListItem href="#" className="button button-raised button-fill" onClick={props.onDefaultSize}>{_t.textActualSize}</ListItem>
<ListItem href="#" className="button button-raised button-red" onClick={props.onRemoveImage}>{_t.textRemoveImage}</ListItem>
<ListButton className="button-fill button-raised" onClick={props.onDefaultSize}>{_t.textActualSize}</ListButton>
<ListButton className="button-red button-fill button-raised" onClick={props.onRemoveImage}>{_t.textRemoveImage}</ListButton>
</List>
</Fragment>
)

View file

@ -195,7 +195,7 @@ const PageLink = props => {
/>
</List>
<List className="buttons-list">
<ListItem title={_t.textEditLink} href="#"
<ListButton title={_t.textEditLink}
className={`button-fill button-raised${typeLink === 1 && link.length < 1 && ' disabled'}`}
onClick={() => {
props.onEditLink(typeLink, (typeLink === 1 ?
@ -203,8 +203,8 @@ const PageLink = props => {
{linkTo: linkTo, numberTo: numberTo, display: stateDisplay, tip: screenTip, displayDisabled: displayDisabled}));
}}
/>
<ListItem title={_t.textRemoveLink} href="#"
className={`button-fill button-red`}
<ListButton title={_t.textRemoveLink}
className={`button-red button-fill button-raised`}
onClick={() => {
props.onRemoveLink()
}}

View file

@ -1,6 +1,6 @@
import React, {Fragment, useState} from 'react';
import {observer, inject} from "mobx-react";
import {f7, Page, Navbar, List, ListItem, Row, BlockTitle, Link, Toggle, Icon, View, NavRight, ListItemCell, Range, Button, Segmented, Tab, Tabs} from 'framework7-react';
import {f7, Page, Navbar, List, ListItem, Row, BlockTitle, Link, Toggle, Icon, View, NavRight, ListItemCell, Range, Button, Segmented, Tab, Tabs, ListButton} from 'framework7-react';
import { ThemeColorPalette, CustomColorPicker } from '../../../../../common/mobile/lib/component/ThemeColorPalette.jsx';
import { useTranslation } from 'react-i18next';
import {Device} from '../../../../../common/mobile/utils/device';
@ -39,7 +39,7 @@ const EditShape = props => {
}}></ListItem>
</List>
<List className="buttons-list">
<ListItem href="#" className="button button-raised button-red" onClick={props.onRemoveShape}>{_t.textRemoveShape}</ListItem>
<ListButton className="button-red button-fill button-raised" onClick={props.onRemoveShape}>{_t.textRemoveShape}</ListButton>
</List>
</Fragment>
)

View file

@ -1,6 +1,6 @@
import React, {Fragment, useState} from 'react';
import {observer, inject} from "mobx-react";
import {f7, Page, Navbar, List, ListItem, Row, BlockTitle, Link, Toggle, Icon, View, NavRight, ListItemCell, Range, Button, Segmented} from 'framework7-react';
import {f7, Page, Navbar, List, ListItem, Row, BlockTitle, Link, Toggle, Icon, View, NavRight, ListItemCell, Range, Button, Segmented, ListButton} from 'framework7-react';
import { ThemeColorPalette, CustomColorPicker } from '../../../../../common/mobile/lib/component/ThemeColorPalette.jsx';
import { useTranslation } from 'react-i18next';
import {Device} from '../../../../../common/mobile/utils/device';
@ -32,8 +32,8 @@ const EditSlide = props => {
}}></ListItem>
</List>
<List className="buttons-list">
<ListItem href="#" className="button button-raised button-fill" onClick={props.onDuplicateSlide}>{_t.textDuplicateSlide}</ListItem>
<ListItem href="#" className="button button-raised button-red" onClick={props.onRemoveSlide}>{_t.textDeleteSlide}</ListItem>
<ListButton className="button-fill button-raised" onClick={props.onDuplicateSlide}>{_t.textDuplicateSlide}</ListButton>
<ListButton className="button-red button-fill button-raised" onClick={props.onRemoveSlide}>{_t.textDeleteSlide}</ListButton>
</List>
</Fragment>
)

View file

@ -501,7 +501,7 @@ const EditTable = props => {
</Row>
</ListItem>
<List className="buttons-list">
<ListItem href="#" title={_t.textRemoveTable} onClick={() => {props.onRemoveTable()}} className='button button-raised button-red'></ListItem>
<ListButton title={_t.textRemoveTable} onClick={() => {props.onRemoveTable()}} className='button-red button-fill button-raised'></ListButton>
</List>
</List>
<List>

View file

@ -223,6 +223,8 @@
"txtNotUrl": "This field should be a URL in the format \"http://www.example.com\"",
"textEmptyImgUrl": "You need to specify image URL.",
"notcriticalErrorTitle": "Warning",
"errorStockChart": "Incorrect row order. To build a stock chart place the data on the sheet in the following order:<br> opening price, max price, min price, closing price.",
"errorMaxRows": "ERROR! The maximum number of data series per chart is 255.",
"textLink": "Link",
"textAddLink": "Add Link",
"textLinkType": "Link Type",

View file

@ -1,6 +1,7 @@
import React, {Component} from 'react';
import { f7 } from 'framework7-react';
import {Device} from '../../../../../common/mobile/utils/device';
import { withTranslation } from 'react-i18next';
import AddChart from '../../view/add/AddChart';
@ -20,10 +21,24 @@ class AddChartController extends Component {
onInsertChart (type) {
const api = Common.EditorApi.get();
const settings = api.asc_getChartObject();
settings.changeType(type);
api.asc_addChartDrawingObject(settings);
this.closeModal();
const { t } = this.props;
const _t = t('View.Add', {returnObjects: true});
const settings = api.asc_getChartObject(true);
const info = api.asc_getCellInfo();
const selType = info.asc_getSelectionType();
const isChartEdit = (selType == Asc.c_oAscSelectionType.RangeChart || selType == Asc.c_oAscSelectionType.RangeChartText);
if (settings) {
isChartEdit ? settings.changeType(type) : settings.putType(type);
let range = settings.getRange(),
isValid = !!range ? api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.Chart, range, true, !settings.getInColumns(), settings.getType()) : Asc.c_oAscError.ID.No;
if (isValid == Asc.c_oAscError.ID.No) {
isChartEdit ? api.asc_editChartDrawingObject(settings) : api.asc_addChartDrawingObject(settings);
this.closeModal();
} else {
f7.dialog.alert((isValid == Asc.c_oAscError.ID.StockChartError) ? _t.errorStockChart : ((isValid == Asc.c_oAscError.ID.MaxDataSeriesError) ? _t.errorMaxRows : _t.txtInvalidRange), _t.notcriticalErrorTitle);
}
}
}
render () {
@ -34,4 +49,6 @@ class AddChartController extends Component {
}
}
export default AddChartController;
const AddChartControllerTranslated = withTranslation()(AddChartController);
export {AddChartControllerTranslated as AddChartController};

View file

@ -5,7 +5,7 @@ import {f7} from 'framework7-react';
import { observer, inject } from "mobx-react";
import {Device} from '../../../../../common/mobile/utils/device';
import AddChartController from "../../controller/add/AddChart";
import {AddChartController} from "../../controller/add/AddChart";
import {AddFunctionController} from "../../controller/add/AddFunction";
import {PageFunctionGroup, PageFunctionInfo} from "./AddFunction";
import AddShapeController from "../../controller/add/AddShape";

View file

@ -36,7 +36,7 @@ const PageLinkSettings = props => {
>
</ListInput>
</List>
<List>
<List className="buttons-list">
<ListButton className={'button-fill button-raised' + (stateValue.length < 1 ? ' disabled' : '')}
title={_t.textInsertImage}
onClick={() => {props.onInsertByUrl(stateValue)}}></ListButton>

View file

@ -129,7 +129,7 @@ const AddLinkView = props => {
className={isIos ? 'list-input-right' : ''}
/>
</List>
<List>
<List className="buttons-list">
<ListButton title={_t.textInsert}
className={`button-fill button-raised${(typeLink === 'ext' && link.length < 1 || typeLink === 'int' && range.length < 1) && ' disabled'}`}
onClick={() => {props.onInsertLink(typeLink === 'ext' ?

View file

@ -1466,7 +1466,7 @@ const EditChart = props => {
onReorder: props.onReorder
}}></ListItem>
</List>
<List>
<List className="buttons-list">
<ListButton title={_t.textRemoveChart} onClick={() => {props.onRemoveChart()}} className='button-red button-fill button-raised'/>
</List>
</Fragment>

View file

@ -7,11 +7,14 @@ import {Device} from '../../../../../common/mobile/utils/device';
const EditImage = props => {
const { t } = useTranslation();
const _t = t('View.Edit', {returnObjects: true});
const storeFocusObjects = props.storeFocusObjects;
const imageObject = storeFocusObjects.imageObject;
const pluginGuid = imageObject.asc_getPluginGuid();
return (
<Fragment>
<List>
<ListItem title={_t.textReplace} link="/edit-replace-image/" routeProps={{
<ListItem title={_t.textReplace} link="/edit-replace-image/" className={pluginGuid ? 'disabled' : ''} routeProps={{
onReplaceByFile: props.onReplaceByFile,
onReplaceByUrl: props.onReplaceByUrl
}}></ListItem>
@ -20,8 +23,8 @@ const EditImage = props => {
}}></ListItem>
</List>
<List className="buttons-list">
<ListItem href="#" className="button button-raised button-fill" onClick={props.onDefaultSize}>{_t.textActualSize}</ListItem>
<ListItem href="#" className="button button-raised button-red" onClick={props.onRemoveImage}>{_t.textRemoveImage}</ListItem>
<ListButton className="button-fill button-raised" onClick={props.onDefaultSize}>{_t.textActualSize}</ListButton>
<ListButton className="button-red button-fill button-raised" onClick={props.onRemoveImage}>{_t.textRemoveImage}</ListButton>
</List>
</Fragment>
)

View file

@ -157,7 +157,7 @@ const EditLink = props => {
className={isIos ? 'list-input-right' : ''}
/>
</List>
<List>
<List className="buttons-list">
<ListButton title={_t.textEditLink}
className={`button-fill button-raised${(typeLink === 'ext' && link.length < 1 || typeLink === 'int' || range.length < 1 || !curSheet.length) && ' disabled'}`}
onClick={() => {props.onEditLink(typeLink === 1 ?
@ -165,7 +165,7 @@ const EditLink = props => {
{type: 2, url: range, sheet: curSheet, text: stateDisplayText, tooltip: screenTip})}}
/>
<ListButton title={_t.textRemoveLink}
className={`button-fill button-red`}
className={`button-red button-fill button-raised`}
onClick={() => props.onRemoveLink()}
/>
</List>

View file

@ -1,6 +1,6 @@
import React, {Fragment, useState} from 'react';
import {observer, inject} from "mobx-react";
import {f7, Page, Navbar, NavRight, List, ListItem, Link, Icon, Range, Tab, Tabs} from 'framework7-react';
import {f7, Page, Navbar, NavRight, List, ListItem, Link, Icon, Range, Tab, Tabs, ListButton} from 'framework7-react';
import { ThemeColorPalette, CustomColorPicker } from '../../../../../common/mobile/lib/component/ThemeColorPalette.jsx';
import { useTranslation } from 'react-i18next';
import {Device} from '../../../../../common/mobile/utils/device';
@ -36,7 +36,7 @@ const EditShape = props => {
}}></ListItem>
</List>
<List className="buttons-list">
<ListItem href="#" className="button button-raised button-red" onClick={props.onRemoveShape}>{_t.textRemoveShape}</ListItem>
<ListButton className="button-red button-fill button-raised" onClick={props.onRemoveShape}>{_t.textRemoveShape}</ListButton>
</List>
</Fragment>
)