From 17b5df296cd64955b5cd9f6b7a3eb5ccf1e28d17 Mon Sep 17 00:00:00 2001 From: Albert Backenhof Date: Fri, 31 May 2019 13:30:58 +0200 Subject: [PATCH] Moved Excel export to context menu -Not showing context menu option for desktop users. Issue: DEB-211 --- assets/Excel.png | Bin 2281 -> 0 bytes src/export-button.jsx | 42 ------------------ ...port-column-header.jsx => dim1-header.jsx} | 26 +++++------ src/headers-table/index.jsx | 8 +--- src/index.js | 28 +++++++++--- 5 files changed, 38 insertions(+), 66 deletions(-) delete mode 100644 assets/Excel.png delete mode 100644 src/export-button.jsx rename src/headers-table/{export-column-header.jsx => dim1-header.jsx} (67%) diff --git a/assets/Excel.png b/assets/Excel.png deleted file mode 100644 index 715479c3d6adf001217ad431a55763c3a9941383..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2281 zcmaJ@dpwl+8lNaR$_}|CY`q4#Y;!d;G#Lyt7>rzIm{c@oUS=?tW=1on8#TIYq(bRf zIx-a7$Vo!ZhZ3p9?%Gb;(5&PvkxOi06FbwUJ%60e`*|ok***Zf?VM-%~2~rtL3_?g8VLS*>`K&}R0%UR0_C5qX zArO5B9-S#=(n1JqAs@lg#USK-kroYsczVl4EOs&|1>(U(o`49OY;1-BJPr{SjiaGx zB0rGJ3si`~NJS`}tw?5X<-okX08cqVOTY)EEI`gr5l9GfBJ2Y%L3`G@kucyxh%}i9 z`?Dw}Ee!Azia`K}aD%f^Xf%MwBhXkJ9*^DvU{Gib5~aQIa5R>H!xJ#>z{d-w%_im~ z5F*I_A9HCfB8)4QiU>%gOeRCf+z>)>A`-oI>sB2H1_Redz$Iw{DN7C)NbHvx$e@HR z=82>{p#ab^vf_oQQX))S>7Om|MW1K|l8&Us%j%u{tsEMcT|{P|Vv0a{R?YKJcMw0`If6VEsSK_Yuqa zd@ZQYVv*Wnkh<0W*Q%FYTK(vbpMuw~n&32c5Kblim*B zcvX5U8M`?lLzR-jfTg_1`3c_H+u5Lw812~y-|c;ASo18~*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v$D>eQ=3OWww9mWW;(ea@X12IhV>i z<#l~s22a{9U%ouai%n^;X?)i=6pqSm`_-^e6<=&ysy-DNSm2A7bBlj=E*^Gv|KTM5 qVzFI&efy!GQZtL;DKl{^3?OHZn - ); - } -} - -ExportButton.defaultProps = { - excelExport: false -}; - -ExportButton.propTypes = { - component: PropTypes.shape({}).isRequired, - excelExport: PropTypes.bool, - general: PropTypes.shape({}).isRequired -}; - -export default ExportButton; diff --git a/src/headers-table/export-column-header.jsx b/src/headers-table/dim1-header.jsx similarity index 67% rename from src/headers-table/export-column-header.jsx rename to src/headers-table/dim1-header.jsx index 61775ea..88ec470 100644 --- a/src/headers-table/export-column-header.jsx +++ b/src/headers-table/dim1-header.jsx @@ -1,9 +1,10 @@ import React from 'react'; import PropTypes from 'prop-types'; -import ExportButton from '../export-button.jsx'; import { HEADER_FONT_SIZE } from '../initialize-transformed'; +import Tooltip from '../tooltip/index.jsx'; -const ExportColumnHeader = ({ component, baseCSS, general, title, allowExcelExport, hasSecondDimension, styling }) => { +const Dim1Header = ({ component, baseCSS, title, hasSecondDimension, styling }) => { + const inEditState = component.inEditState(); const rowSpan = hasSecondDimension ? 2 : 1; const isMediumFontSize = styling.headerOptions.fontSizeAdjustment === HEADER_FONT_SIZE.MEDIUM; const style = { @@ -21,21 +22,20 @@ const ExportColumnHeader = ({ component, baseCSS, general, title, allowExcelExpo rowSpan={rowSpan} style={style} > - - {title} + + {title} + ); }; -ExportColumnHeader.propTypes = { - component: PropTypes.shape({}).isRequired, - allowExcelExport: PropTypes.bool.isRequired, +Dim1Header.propTypes = { baseCSS: PropTypes.shape({}).isRequired, - general: PropTypes.shape({}).isRequired, + component: PropTypes.shape({}).isRequired, hasSecondDimension: PropTypes.bool.isRequired, styling: PropTypes.shape({ headerOptions: PropTypes.shape({ @@ -45,4 +45,4 @@ ExportColumnHeader.propTypes = { title: PropTypes.string.isRequired }; -export default ExportColumnHeader; +export default Dim1Header; diff --git a/src/headers-table/index.jsx b/src/headers-table/index.jsx index a9eeab6..1e9fe26 100644 --- a/src/headers-table/index.jsx +++ b/src/headers-table/index.jsx @@ -1,6 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; -import ExportColumnHeader from './export-column-header.jsx'; +import Dim1Header from './dim1-header.jsx'; import ColumnHeader from './column-header.jsx'; import MeasurementColumnHeader from './measurement-column-header.jsx'; import { injectSeparators } from '../utilities'; @@ -12,7 +12,6 @@ class HeadersTable extends React.PureComponent { columnSeparatorWidth, component, data, - general, isKpi, styling } = this.props; @@ -43,11 +42,9 @@ class HeadersTable extends React.PureComponent { {isKpi ? - { + exportXLS( + this.$element, + this.$scope.layout.title, + this.$scope.layout.subtitle, + this.$scope.layout.footnote); + } + }); + return menu; + }, version: 1.0 };