{title}
@@ -32,6 +37,7 @@ ItemHeader.displayName = 'ItemHeader'
ItemHeader.propTypes = {
dashboardMode: PropTypes.string,
+ isShortened: PropTypes.bool,
title: PropTypes.string,
}
diff --git a/src/components/Item/ItemHeader/PrintItemInfo.js b/src/components/Item/ItemHeader/PrintItemInfo.js
new file mode 100644
index 000000000..228b3e254
--- /dev/null
+++ b/src/components/Item/ItemHeader/PrintItemInfo.js
@@ -0,0 +1,20 @@
+import React from 'react'
+import { Tooltip } from '@dhis2/ui'
+import i18n from '@dhis2/d2-i18n'
+
+import InfoIcon from '../../../icons/Info'
+
+import classes from './styles/PrintItemInfo.module.css'
+
+const PrintWarning = () => (
+
+
+
+
+
+)
+
+export default PrintWarning
diff --git a/src/components/Item/ItemHeader/styles/PrintItemInfo.module.css b/src/components/Item/ItemHeader/styles/PrintItemInfo.module.css
new file mode 100644
index 000000000..31759d4a4
--- /dev/null
+++ b/src/components/Item/ItemHeader/styles/PrintItemInfo.module.css
@@ -0,0 +1,12 @@
+.warning {
+ position: absolute;
+ top: 5px;
+ right: 5px;
+ visibility: visible;
+}
+
+@media print {
+ .warning {
+ display: none;
+ }
+}
diff --git a/src/components/Item/ListItem/Item.js b/src/components/Item/ListItem/Item.js
index 6a2551ff7..56397ecda 100644
--- a/src/components/Item/ListItem/Item.js
+++ b/src/components/Item/ListItem/Item.js
@@ -56,6 +56,7 @@ const ListItem = (props, context) => {
title={getItemTitle(item)}
itemId={item.id}
dashboardMode={dashboardMode}
+ isShortened={item.shortened}
/>
diff --git a/src/components/Item/MessagesItem/Item.js b/src/components/Item/MessagesItem/Item.js
index 00b116504..ff3eeefb0 100644
--- a/src/components/Item/MessagesItem/Item.js
+++ b/src/components/Item/MessagesItem/Item.js
@@ -114,6 +114,7 @@ class MessagesItem extends Component {
title={i18n.t('Messages')}
itemId={this.props.item.id}
dashboardMode={this.props.dashboardMode}
+ isShortened={this.props.item.shortened}
/>
{this.props.messages.length > 0 && (
diff --git a/src/components/Item/NotSupportedItem/Item.js b/src/components/Item/NotSupportedItem/Item.js
index e1db8d51d..440973ad2 100644
--- a/src/components/Item/NotSupportedItem/Item.js
+++ b/src/components/Item/NotSupportedItem/Item.js
@@ -12,6 +12,7 @@ const NotSupportedItem = props => (
})}
itemId={props.item.id}
dashboardMode={props.dashboardMode}
+ isShortened={props.item.shortened}
/>
{
title={i18n.t('Spacer')}
itemId={props.item.id}
dashboardMode={props.dashboardMode}
+ isShortened={props.item.shortened}
/>
{i18n.t(
diff --git a/src/components/Item/TextItem/Item.js b/src/components/Item/TextItem/Item.js
index af1e6a917..61204967f 100644
--- a/src/components/Item/TextItem/Item.js
+++ b/src/components/Item/TextItem/Item.js
@@ -5,6 +5,7 @@ import PropTypes from 'prop-types'
import Input from '@material-ui/core/Input'
import ItemHeader from '../ItemHeader/ItemHeader'
+import PrintItemInfo from '../ItemHeader/PrintItemInfo'
import Line from '../../../widgets/Line'
import {
Parser as RichTextParser,
@@ -18,7 +19,7 @@ import {
sGetIsPrinting,
sGetPrintDashboardItems,
} from '../../../reducers/printDashboard'
-import { isEditMode } from '../../Dashboard/dashboardModes'
+import { isEditMode, PRINT_LAYOUT } from '../../Dashboard/dashboardModes'
const style = {
textDiv: {
@@ -86,7 +87,28 @@ const TextItem = props => {
)
}
- return <>{isEditMode(dashboardMode) ? editItem() : viewItem()}>
+ const printItem = () => {
+ const textDivStyle = Object.assign({}, style.textField, style.textDiv)
+ return (
+ <>
+ {props.item.shortened ? : null}
+
+ {text}
+
+ >
+ )
+ }
+
+ let textItem
+ if (isEditMode(dashboardMode)) {
+ textItem = editItem
+ } else if (dashboardMode === PRINT_LAYOUT) {
+ textItem = printItem
+ } else {
+ textItem = viewItem
+ }
+
+ return <>{textItem()}>
}
const mapStateToProps = (state, ownProps) => {
diff --git a/src/components/Item/VisualizationItem/Item.js b/src/components/Item/VisualizationItem/Item.js
index f2f09a08a..0a09f0c73 100644
--- a/src/components/Item/VisualizationItem/Item.js
+++ b/src/components/Item/VisualizationItem/Item.js
@@ -304,6 +304,7 @@ export class Item extends Component {
actionButtons={actionButtons}
ref={this.headerRef}
dashboardMode={dashboardMode}
+ isShortened={item.shortened}
/>
(
+
+)
+
+export default WarningIcon
diff --git a/src/modules/printUtils.js b/src/modules/printUtils.js
index 7fb4c7a81..c09e94e7d 100644
--- a/src/modules/printUtils.js
+++ b/src/modules/printUtils.js
@@ -7,7 +7,7 @@ import { itemTypeMap } from './itemTypes'
// const a4LandscapeHeightPx = 794
export const a4LandscapeWidthPx = 1102
-export const MAX_ITEM_GRID_HEIGHT = 33
+export const MAX_ITEM_GRID_HEIGHT = 34
export const getTransformYPx = elStyle => {
if (!elStyle || !elStyle.transform) {