diff --git a/i18n/en.pot b/i18n/en.pot index 0347e8aa4..f1a6f3c0e 100644 --- a/i18n/en.pot +++ b/i18n/en.pot @@ -5,8 +5,8 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -"POT-Creation-Date: 2019-05-07T10:46:49.139Z\n" -"PO-Revision-Date: 2019-05-07T10:46:49.139Z\n" +"POT-Creation-Date: 2019-05-22T08:39:03.062Z\n" +"PO-Revision-Date: 2019-05-22T08:39:03.062Z\n" msgid "Dashboard" msgstr "" @@ -41,10 +41,10 @@ msgstr "" msgid "Search for a dashboard" msgstr "" -msgid "Show less" +msgid "Show more" msgstr "" -msgid "Show more" +msgid "Show less" msgstr "" msgid "No access" diff --git a/src/components/ControlBar/DashboardsBar.js b/src/components/ControlBar/DashboardsBar.js index d4ba1803c..897612702 100644 --- a/src/components/ControlBar/DashboardsBar.js +++ b/src/components/ControlBar/DashboardsBar.js @@ -124,12 +124,11 @@ export class DashboardsBar extends Component { /> ))} - {this.props.userRows !== MAX_ROW_COUNT ? ( - - ) : null} + ); } diff --git a/src/components/ControlBar/ShowMoreButton.js b/src/components/ControlBar/ShowMoreButton.js index 2676a8b6b..64a523420 100644 --- a/src/components/ControlBar/ShowMoreButton.js +++ b/src/components/ControlBar/ShowMoreButton.js @@ -1,30 +1,40 @@ import React from 'react'; import i18n from '@dhis2/d2-i18n'; +import { colors } from '@dhis2/ui-core'; import { withStyles } from '@material-ui/core/styles'; -import { colors } from '../../modules/colors'; - export const SHOWMORE_BAR_HEIGHT = 16; const styles = { showMore: { - color: colors.royalBlue, + color: colors.grey700, cursor: 'pointer', fontSize: 11, - fontWeight: 700, - height: SHOWMORE_BAR_HEIGHT, paddingTop: 5, - textTransform: 'uppercase', - visibility: 'visible', + '&:hover': { + textDecoration: 'underline', + }, + }, + disabled: { + paddingTop: 5, + color: colors.grey500, + fontSize: 11, + cursor: 'not-allowed', }, }; -export const ShowMoreButton = ({ onClick, isMaxHeight, classes }) => ( -
-
- {isMaxHeight ? i18n.t('Show less') : i18n.t('Show more')} +export const ShowMoreButton = ({ onClick, isMaxHeight, classes, disabled }) => { + return ( +
+ {disabled ? ( +
{i18n.t('Show more')}
+ ) : ( +
+ {isMaxHeight ? i18n.t('Show less') : i18n.t('Show more')} +
+ )}
-
-); + ); +}; export default withStyles(styles)(ShowMoreButton); diff --git a/src/components/ControlBar/__tests__/ConfirmDeleteDialog.spec.js b/src/components/ControlBar/__tests__/ConfirmDeleteDialog.spec.js index ffee33d4d..415f2e173 100644 --- a/src/components/ControlBar/__tests__/ConfirmDeleteDialog.spec.js +++ b/src/components/ControlBar/__tests__/ConfirmDeleteDialog.spec.js @@ -1,6 +1,5 @@ import React from 'react'; import { shallow } from 'enzyme'; -import { Button } from '@dhis2/ui-core'; import DialogActions from '@material-ui/core/DialogActions'; import { ConfirmDeleteDialog } from '../ConfirmDeleteDialog'; import { getStubContext } from '../../../setupTests'; diff --git a/src/components/ControlBar/__tests__/__snapshots__/DashboardsBar.spec.js.snap b/src/components/ControlBar/__tests__/__snapshots__/DashboardsBar.spec.js.snap index 9536e03f4..32a345f12 100644 --- a/src/components/ControlBar/__tests__/__snapshots__/DashboardsBar.spec.js.snap +++ b/src/components/ControlBar/__tests__/__snapshots__/DashboardsBar.spec.js.snap @@ -52,7 +52,11 @@ ShallowWrapper { />
, - null, + , ], "editMode": false, "height": 424, @@ -169,7 +173,19 @@ ShallowWrapper { ], "type": "div", }, - null, + Object { + "instance": null, + "key": undefined, + "nodeType": "class", + "props": Object { + "disabled": true, + "isMaxHeight": true, + "onClick": [Function], + }, + "ref": null, + "rendered": null, + "type": [Function], + }, ], "type": [Function], }, @@ -210,7 +226,11 @@ ShallowWrapper { /> , - null, + , ], "editMode": false, "height": 424, @@ -327,7 +347,19 @@ ShallowWrapper { ], "type": "div", }, - null, + Object { + "instance": null, + "key": undefined, + "nodeType": "class", + "props": Object { + "disabled": true, + "isMaxHeight": true, + "onClick": [Function], + }, + "ref": null, + "rendered": null, + "type": [Function], + }, ], "type": [Function], }, @@ -426,6 +458,7 @@ ShallowWrapper { , , @@ -550,6 +583,7 @@ ShallowWrapper { "key": undefined, "nodeType": "class", "props": Object { + "disabled": false, "isMaxHeight": false, "onClick": [Function], }, @@ -598,6 +632,7 @@ ShallowWrapper { , , @@ -722,6 +757,7 @@ ShallowWrapper { "key": undefined, "nodeType": "class", "props": Object { + "disabled": false, "isMaxHeight": false, "onClick": [Function], }, @@ -827,6 +863,7 @@ ShallowWrapper { , , @@ -951,6 +988,7 @@ ShallowWrapper { "key": undefined, "nodeType": "class", "props": Object { + "disabled": false, "isMaxHeight": false, "onClick": [Function], }, @@ -999,6 +1037,7 @@ ShallowWrapper { , , @@ -1123,6 +1162,7 @@ ShallowWrapper { "key": undefined, "nodeType": "class", "props": Object { + "disabled": false, "isMaxHeight": false, "onClick": [Function], }, @@ -1254,6 +1294,7 @@ ShallowWrapper { /> , , @@ -1419,6 +1460,7 @@ ShallowWrapper { "key": undefined, "nodeType": "class", "props": Object { + "disabled": false, "isMaxHeight": false, "onClick": [Function], }, @@ -1479,6 +1521,7 @@ ShallowWrapper { /> , , @@ -1644,6 +1687,7 @@ ShallowWrapper { "key": undefined, "nodeType": "class", "props": Object { + "disabled": false, "isMaxHeight": false, "onClick": [Function], },