Bug 49336

This commit is contained in:
SergeyEzhin 2021-05-05 19:04:31 +03:00
parent d55aad76ac
commit 0b17b27492
4 changed files with 94 additions and 66 deletions

View file

@ -122,6 +122,9 @@ const PageStyle = props => {
const chartProperties = props.storeFocusObjects.chartObject ? props.storeFocusObjects.chartObject.get_ChartProperties() : null;
const types = storeChartSettings.types;
const curType = chartProperties ? chartProperties.getType() : null;
const chartStyles = storeChartSettings.chartStyles;
// console.log(chartStyles, curType);
// console.log(Asc.c_oAscChartTypeSettings.comboBarLine, Asc.c_oAscChartTypeSettings.comboBarLineSecondary, Asc.c_oAscChartTypeSettings.comboAreaBar, Asc.c_oAscChartTypeSettings.comboCustom);
const styles = storeChartSettings.styles;
@ -154,7 +157,7 @@ const PageStyle = props => {
<Navbar backLink={_t.textBack}>
<div className="tab-buttons tabbar">
<Link key={"de-link-chart-type"} tabLink={"#edit-chart-type"} tabLinkActive={true}>{_t.textType}</Link>
<Link key={"de-link-chart-style"} tabLink={"#edit-chart-style"}>{_t.textStyle}</Link>
{chartStyles ? <Link key={"de-link-chart-style"} tabLink={"#edit-chart-style"}>{_t.textStyle}</Link> : null}
<Link key={"de-link-chart-fill"} tabLink={"#edit-chart-fill"}>{_t.textFill}</Link>
<Link key={"de-link-chart-border"} tabLink={"#edit-chart-border"}>{_t.textBorder}</Link>
</div>
@ -181,26 +184,28 @@ const PageStyle = props => {
})}
</div>
</Tab>
<Tab key={"de-tab-chart-style"} id={"edit-chart-style"} className="page-content no-padding-top dataview">
<div className={'chart-styles'}>
{styles ? styles.map((row, rowIndex) => {
return (
<ul className="row" key={`row-${rowIndex}`}>
{row.map((style, index)=>{
return(
<li key={`${rowIndex}-${index}`}
onClick={()=>{props.onStyle(style.asc_getName())}}>
<img src={`${style.asc_getImage()}`}/>
</li>
)
})}
</ul>
)
}) :
<div className={'text-content'}>{_t.textNoStyles}</div>
}
</div>
</Tab>
{chartStyles ?
<Tab key={"de-tab-chart-style"} id={"edit-chart-style"} className="page-content no-padding-top dataview">
<div className={'chart-styles'}>
{styles ? styles.map((row, rowIndex) => {
return (
<ul className="row" key={`row-${rowIndex}`}>
{row.map((style, index)=>{
return(
<li key={`${rowIndex}-${index}`}
onClick={()=>{props.onStyle(style.asc_getName())}}>
<img src={`${style.asc_getImage()}`}/>
</li>
)
})}
</ul>
)
}) :
<div className={'text-content'}>{_t.textNoStyles}</div>
}
</div>
</Tab>
: null}
<Tab key={"de-tab-chart-fill"} id={"edit-chart-fill"} className="page-content no-padding-top">
<PaletteFill onFillColor={props.onFillColor} f7router={props.f7router}/>
</Tab>
@ -372,6 +377,7 @@ const PageReorder = props => {
const EditChart = props => {
const { t } = useTranslation();
const _t = t('Edit', {returnObjects: true});
return (
<Fragment>
<List>

View file

@ -4,6 +4,7 @@ import {List, ListItem, ListButton, Icon, Row, Page, Navbar, BlockTitle, Toggle,
import { useTranslation } from 'react-i18next';
import {Device} from '../../../../../common/mobile/utils/device';
import {CustomColorPicker, ThemeColorPalette} from "../../../../../common/mobile/lib/component/ThemeColorPalette.jsx";
import { f7 } from 'framework7-react';
const PageCustomFillColor = props => {
const { t } = useTranslation();
@ -136,6 +137,9 @@ const PageStyle = props => {
const curType = chartProperties ? chartProperties.getType() : null;
const styles = storeChartSettings.styles;
const shapeObject = props.storeFocusObjects.shapeObject;
const chartStyles = storeChartSettings.chartStyles;
// console.log(chartStyles, curType);
// console.log(Asc.c_oAscChartTypeSettings.comboBarLine, Asc.c_oAscChartTypeSettings.comboBarLineSecondary, Asc.c_oAscChartTypeSettings.comboAreaBar, Asc.c_oAscChartTypeSettings.comboCustom);
let borderSize, borderType, borderColor;
@ -168,10 +172,10 @@ const PageStyle = props => {
<Page>
<Navbar backLink={_t.textBack}>
<div className="tab-buttons tabbar">
<Link key={"pe-link-chart-type"} tabLink={"#edit-chart-type"} tabLinkActive={true}>{_t.textType}</Link>
<Link key={"pe-link-chart-style"} tabLink={"#edit-chart-style"}>{_t.textStyle}</Link>
<Link key={"pe-link-chart-fill"} tabLink={"#edit-chart-fill"}>{_t.textFill}</Link>
<Link key={"pe-link-chart-border"} tabLink={"#edit-chart-border"}>{_t.textBorder}</Link>
<Link key={"pe-link-chart-type"} tabLink={"#edit-chart-type"} tabLinkActive={true}>{_t.textType}</Link>
{chartStyles ? <Link key={"pe-link-chart-style"} tabLink={"#edit-chart-style"}>{_t.textStyle}</Link> : null}
<Link key={"pe-link-chart-fill"} tabLink={"#edit-chart-fill"}>{_t.textFill}</Link>
<Link key={"pe-link-chart-border"} tabLink={"#edit-chart-border"}>{_t.textBorder}</Link>
</div>
</Navbar>
<Tabs animated>
@ -196,26 +200,28 @@ const PageStyle = props => {
})}
</div>
</Tab>
<Tab key={"pe-tab-chart-style"} id={"edit-chart-style"} className="page-content no-padding-top dataview">
<div className={'chart-styles'}>
{styles ? styles.map((row, rowIndex) => {
return (
<ul className="row" key={`row-${rowIndex}`}>
{row.map((style, index)=>{
return(
<li key={`${rowIndex}-${index}`}
onClick={()=>{props.onStyle(style.asc_getName())}}>
<img src={`${style.asc_getImage()}`}/>
</li>
)
})}
</ul>
)
}) :
<div className={'text-content'}>{_t.textNoStyles}</div>
}
</div>
</Tab>
{chartStyles ?
<Tab key={"pe-tab-chart-style"} id={"edit-chart-style"} className="page-content no-padding-top dataview">
<div className={'chart-styles'}>
{styles ? styles.map((row, rowIndex) => {
return (
<ul className="row" key={`row-${rowIndex}`}>
{row.map((style, index)=>{
return(
<li key={`${rowIndex}-${index}`}
onClick={()=>{props.onStyle(style.asc_getName())}}>
<img src={`${style.asc_getImage()}`}/>
</li>
)
})}
</ul>
)
}) :
<div className={'text-content'}>{_t.textNoStyles}</div>
}
</div>
</Tab>
: null}
<Tab key={"pe-tab-chart-fill"} id={"edit-chart-fill"} className="page-content no-padding-top">
<PaletteFill onFillColor={props.onFillColor} f7router={props.f7router}/>
</Tab>

View file

@ -29,6 +29,17 @@ class EditChartController extends Component {
this.onHorAxisTickMajor = this.onHorAxisTickMajor.bind(this);
this.onHorAxisTickMinor = this.onHorAxisTickMinor.bind(this);
this.onHorAxisLabelPos = this.onHorAxisLabelPos.bind(this);
const type = props.storeFocusObjects.chartObject.get_ChartProperties().getType();
if (type==Asc.c_oAscChartTypeSettings.comboBarLine ||
type==Asc.c_oAscChartTypeSettings.comboBarLineSecondary ||
type==Asc.c_oAscChartTypeSettings.comboAreaBar ||
type==Asc.c_oAscChartTypeSettings.comboCustom) {
props.storeChartSettings.clearChartStyles();
} else {
const api = Common.EditorApi.get();
props.storeChartSettings.updateChartStyles(api.asc_getChartPreviews(type));
}
}
closeModal() {

View file

@ -137,6 +137,9 @@ const PageStyle = props => {
const styles = storeChartSettings.styles;
const types = storeChartSettings.types;
const curType = chartProperties && chartProperties.getType();
const chartStyles = storeChartSettings.chartStyles;
// console.log(chartStyles, curType);
// console.log(Asc.c_oAscChartTypeSettings.comboBarLine, Asc.c_oAscChartTypeSettings.comboBarLineSecondary, Asc.c_oAscChartTypeSettings.comboAreaBar, Asc.c_oAscChartTypeSettings.comboCustom);
// Init border size
@ -171,7 +174,7 @@ const PageStyle = props => {
<Navbar backLink={_t.textBack}>
<div className="tab-buttons tabbar">
<Link key={"sse-link-chart-type"} tabLink={"#edit-chart-type"} tabLinkActive={true}>{_t.textType}</Link>
<Link key={"sse-link-chart-style"} tabLink={"#edit-chart-style"}>{_t.textStyle}</Link>
{chartStyles ? <Link key={"sse-link-chart-style"} tabLink={"#edit-chart-style"}>{_t.textStyle}</Link> : null}
<Link key={"sse-link-chart-fill"} tabLink={"#edit-chart-fill"}>{_t.textFill}</Link>
<Link key={"sse-link-chart-border"} tabLink={"#edit-chart-border"}>{_t.textBorder}</Link>
</div>
@ -196,26 +199,28 @@ const PageStyle = props => {
})}
</div>
</Tab>
<Tab key={"sse-tab-chart-style"} id={"edit-chart-style"} className="page-content no-padding-top dataview">
<div className={'chart-styles'}>
{styles ? styles.map((row, rowIndex) => {
return (
<ul className="row" key={`row-${rowIndex}`}>
{row.map((style, index)=>{
return(
<li key={`${rowIndex}-${index}`}
onClick={() => {props.onStyle(style.asc_getName())}}>
<img src={`${style.asc_getImage()}`}/>
</li>
)
})}
</ul>
)
}) :
<div className={'text-content'}>{_t.textNoStyles}</div>
}
</div>
</Tab>
{chartStyles ?
<Tab key={"sse-tab-chart-style"} id={"edit-chart-style"} className="page-content no-padding-top dataview">
<div className={'chart-styles'}>
{styles ? styles.map((row, rowIndex) => {
return (
<ul className="row" key={`row-${rowIndex}`}>
{row.map((style, index)=>{
return(
<li key={`${rowIndex}-${index}`}
onClick={() => {props.onStyle(style.asc_getName())}}>
<img src={`${style.asc_getImage()}`}/>
</li>
)
})}
</ul>
)
}) :
<div className={'text-content'}>{_t.textNoStyles}</div>
}
</div>
</Tab>
: null}
<Tab key={"sse-tab-chart-fill"} id={"edit-chart-fill"} className="page-content no-padding-top">
<PaletteFill onFillColor={props.onFillColor} f7router={props.f7router}/>
</Tab>