From 2efb2d9d8f762a5b3651c126efaa28b19eb5eb42 Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Thu, 10 Sep 2020 12:30:30 +0200 Subject: [PATCH 1/9] fix: get title and desc from the printDashboard redux prop --- src/actions/selected.js | 4 +--- .../Item/PrintTitlePageItem/Item.js | 21 ++++++++++++++----- src/components/TitleBar/ViewTitleBar.js | 2 +- src/reducers/printDashboard.js | 6 ++++++ 4 files changed, 24 insertions(+), 9 deletions(-) diff --git a/src/actions/selected.js b/src/actions/selected.js index 818ab5177..b3b4b8adc 100644 --- a/src/actions/selected.js +++ b/src/actions/selected.js @@ -33,7 +33,6 @@ import { EVENT_CHART, MESSAGES, } from '../modules/itemTypes' -import { orObject } from '../modules/util' // actions @@ -57,8 +56,7 @@ export const tSetSelectedDashboardById = id => async (dispatch, getState) => { dispatch(acSetSelectedIsLoading(true)) const snackbarTimeout = setTimeout(() => { - const dashboardName = orObject(sGetDashboardById(getState(), id)) - .displayName + const dashboardName = sGetDashboardById(getState(), id).displayName if (sGetSelectedIsLoading(getState()) && dashboardName) { loadingDashboardMsg.name = dashboardName diff --git a/src/components/Item/PrintTitlePageItem/Item.js b/src/components/Item/PrintTitlePageItem/Item.js index d29b1da67..a1437d03a 100644 --- a/src/components/Item/PrintTitlePageItem/Item.js +++ b/src/components/Item/PrintTitlePageItem/Item.js @@ -3,14 +3,17 @@ import { connect } from 'react-redux' import PropTypes from 'prop-types' import i18n from '@dhis2/d2-i18n' -import { orObject } from '../../../modules/util' - import { sGetSelectedId, sGetSelectedShowDescription, } from '../../../reducers/selected' import { sGetDashboardById } from '../../../reducers/dashboards' import { sGetNamedItemFilters } from '../../../reducers/itemFilters' +import { sGetIsEditing } from '../../../reducers/editDashboard' +import { + sGetPrintDashboardName, + sGetPrintDashboardDescription, +} from '../../../reducers/printDashboard' import classes from './styles/Item.module.css' @@ -63,12 +66,20 @@ PrintTitlePageItem.defaultProps = { const mapStateToProps = state => { const id = sGetSelectedId(state) - const dashboard = orObject(sGetDashboardById(state, id)) + const isEditMode = sGetIsEditing(state) + + const name = isEditMode + ? sGetPrintDashboardName(state) || i18n.t('Untitled dashboard') + : sGetDashboardById(state, id).displayName + + const description = isEditMode + ? sGetPrintDashboardDescription(state) + : sGetDashboardById(state, id).displayDescription return { - name: dashboard.displayName, + name, + description, itemFilters: sGetNamedItemFilters(state), - description: dashboard.displayDescription, showDescription: sGetSelectedShowDescription(state), } } diff --git a/src/components/TitleBar/ViewTitleBar.js b/src/components/TitleBar/ViewTitleBar.js index cdbca529c..c6dd8c181 100644 --- a/src/components/TitleBar/ViewTitleBar.js +++ b/src/components/TitleBar/ViewTitleBar.js @@ -201,7 +201,7 @@ ViewTitleBar.contextTypes = { const mapStateToProps = state => { const id = sGetSelectedId(state) - const dashboard = orObject(sGetDashboardById(state, id)) + const dashboard = sGetDashboardById(state, id) return { id, diff --git a/src/reducers/printDashboard.js b/src/reducers/printDashboard.js index 9c1d4c3cb..320b26c33 100644 --- a/src/reducers/printDashboard.js +++ b/src/reducers/printDashboard.js @@ -130,6 +130,12 @@ export const sGetPrintDashboardRoot = state => state.printDashboard export const sGetIsPrinting = state => !isEmpty(state.printDashboard) +export const sGetPrintDashboardName = state => + sGetPrintDashboardRoot(state).name + +export const sGetPrintDashboardDescription = state => + sGetPrintDashboardRoot(state).description + export const sGetPrintDashboardItems = state => { return ( sGetPrintDashboardRoot(state)?.dashboardItems || DEFAULT_DASHBOARD_ITEMS From f123463e237753ea5f6c5c5b5c01caab42a3ca68 Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Thu, 17 Sep 2020 12:38:40 +0200 Subject: [PATCH 2/9] fix: revert refactor and save it for later --- src/actions/selected.js | 4 +++- src/components/Item/PrintTitlePageItem/Item.js | 7 +++++-- src/components/TitleBar/ViewTitleBar.js | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/actions/selected.js b/src/actions/selected.js index b3b4b8adc..818ab5177 100644 --- a/src/actions/selected.js +++ b/src/actions/selected.js @@ -33,6 +33,7 @@ import { EVENT_CHART, MESSAGES, } from '../modules/itemTypes' +import { orObject } from '../modules/util' // actions @@ -56,7 +57,8 @@ export const tSetSelectedDashboardById = id => async (dispatch, getState) => { dispatch(acSetSelectedIsLoading(true)) const snackbarTimeout = setTimeout(() => { - const dashboardName = sGetDashboardById(getState(), id).displayName + const dashboardName = orObject(sGetDashboardById(getState(), id)) + .displayName if (sGetSelectedIsLoading(getState()) && dashboardName) { loadingDashboardMsg.name = dashboardName diff --git a/src/components/Item/PrintTitlePageItem/Item.js b/src/components/Item/PrintTitlePageItem/Item.js index a1437d03a..057e58d35 100644 --- a/src/components/Item/PrintTitlePageItem/Item.js +++ b/src/components/Item/PrintTitlePageItem/Item.js @@ -15,6 +15,8 @@ import { sGetPrintDashboardDescription, } from '../../../reducers/printDashboard' +import { orObject } from '../../../modules/util' + import classes from './styles/Item.module.css' const PrintTitlePageItem = ({ @@ -67,14 +69,15 @@ PrintTitlePageItem.defaultProps = { const mapStateToProps = state => { const id = sGetSelectedId(state) const isEditMode = sGetIsEditing(state) + const viewDashboard = orObject(sGetDashboardById(state, id)) const name = isEditMode ? sGetPrintDashboardName(state) || i18n.t('Untitled dashboard') - : sGetDashboardById(state, id).displayName + : viewDashboard.displayName const description = isEditMode ? sGetPrintDashboardDescription(state) - : sGetDashboardById(state, id).displayDescription + : viewDashboard.displayDescription return { name, diff --git a/src/components/TitleBar/ViewTitleBar.js b/src/components/TitleBar/ViewTitleBar.js index c6dd8c181..cdbca529c 100644 --- a/src/components/TitleBar/ViewTitleBar.js +++ b/src/components/TitleBar/ViewTitleBar.js @@ -201,7 +201,7 @@ ViewTitleBar.contextTypes = { const mapStateToProps = state => { const id = sGetSelectedId(state) - const dashboard = sGetDashboardById(state, id) + const dashboard = orObject(sGetDashboardById(state, id)) return { id, From 256ac8b3f48483fb0eda5b5617601a6280b238c5 Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Fri, 18 Sep 2020 12:00:59 +0200 Subject: [PATCH 3/9] fix: move item handling to FilterDialog so initial list setting works --- src/components/ItemFilter/FilterDialog.js | 149 +++++++++++++------- src/components/ItemFilter/FilterSelector.js | 67 +-------- 2 files changed, 103 insertions(+), 113 deletions(-) diff --git a/src/components/ItemFilter/FilterDialog.js b/src/components/ItemFilter/FilterDialog.js index e5c030f2c..8e864441b 100644 --- a/src/components/ItemFilter/FilterDialog.js +++ b/src/components/ItemFilter/FilterDialog.js @@ -1,6 +1,7 @@ -import React, { Component } from 'react' +import React, { useState } from 'react' import PropTypes from 'prop-types' - +import { connect } from 'react-redux' +import i18n from '@dhis2/d2-i18n' import { Button, Modal, @@ -9,9 +10,6 @@ import { ModalActions, ButtonStrip, } from '@dhis2/ui' - -import i18n from '@dhis2/d2-i18n' - import { PeriodDimension, DynamicDimension, @@ -20,21 +18,73 @@ import { DIMENSION_ID_ORGUNIT, } from '@dhis2/analytics' -class FilterDialog extends Component { - onConfirm = id => () => this.props.onConfirm(id) +import { acAddItemFilter, acRemoveItemFilter } from '../../actions/itemFilters' +import { sGetItemFiltersRoot } from '../../reducers/itemFilters' + +const FilterDialog = ( + { + displayNameProperty, + dimension, + initiallySelectedItems, + addItemFilter, + removeItemFilter, + onClose, + }, + context +) => { + const [filters, setFilters] = useState(initiallySelectedItems) - renderDialogContent() { - const { displayNameProperty, dimension, selectedItems } = this.props - const dialogId = dimension.id + const onSelectItems = ({ dimensionId, items }) => { + setFilters({ [dimensionId]: items }) + } + const onDeselectItems = ({ dimensionId, itemIdsToRemove }) => { + const oldList = filters[dimensionId] || [] + const newList = oldList.filter( + item => !itemIdsToRemove.includes(item.id) + ) + + const list = newList.length ? newList : [] + + setFilters({ ...filters, [dimensionId]: list }) + } + + const onReorderItems = ({ dimensionId, itemIds }) => { + const oldList = filters[dimensionId] || [] + const reorderedList = itemIds.map(id => + oldList.find(item => item.id === id) + ) + + setFilters({ ...filters, [dimensionId]: reorderedList }) + } + + const saveFilter = () => { + const id = dimension.id + const filterItems = filters[id] + + if (filterItems && filterItems.length) { + addItemFilter({ + id, + value: [...filterItems], + }) + } else { + removeItemFilter(id) + } + + onClose(id) + } + + const renderDialogContent = () => { const commonProps = { - d2: this.context.d2, - onSelect: this.props.onSelect, - onDeselect: this.props.onDeselect, - onReorder: this.props.onReorder, + d2: context.d2, + onSelect: onSelectItems, + onDeselect: onDeselectItems, + onReorder: onReorderItems, } - switch (dialogId) { + const selectedItems = filters[dimension.id] || [] + + switch (dimension.id) { case DIMENSION_ID_PERIOD: { return ( @@ -63,51 +113,46 @@ class FilterDialog extends Component { } } - render() { - const { dimension, onClose } = this.props - const dialogId = dimension.id - - return ( - <> - {dialogId && ( - - {dimension.name} - - {this.renderDialogContent()} - - - - - - - - - )} - - ) - } + return ( + <> + {dimension.id && ( + + {dimension.name} + {renderDialogContent()} + + + + + + + + )} + + ) } FilterDialog.propTypes = { + addItemFilter: PropTypes.func, dimension: PropTypes.object, displayNameProperty: PropTypes.string, - selectedItems: PropTypes.array, + initiallySelectedItems: PropTypes.object, + removeItemFilter: PropTypes.func, onClose: PropTypes.func, - onConfirm: PropTypes.func, - onDeselect: PropTypes.func, - onReorder: PropTypes.func, - onSelect: PropTypes.func, } FilterDialog.contextTypes = { d2: PropTypes.object, } -export default FilterDialog +const mapStateToProps = state => ({ + initiallySelectedItems: sGetItemFiltersRoot(state), +}) + +export default connect(mapStateToProps, { + addItemFilter: acAddItemFilter, + removeItemFilter: acRemoveItemFilter, +})(FilterDialog) diff --git a/src/components/ItemFilter/FilterSelector.js b/src/components/ItemFilter/FilterSelector.js index 8b5c9a159..6e31cd4a2 100644 --- a/src/components/ItemFilter/FilterSelector.js +++ b/src/components/ItemFilter/FilterSelector.js @@ -2,6 +2,7 @@ import React, { useState, useRef } from 'react' import PropTypes from 'prop-types' import { connect } from 'react-redux' import ArrowDropDownIcon from '@material-ui/icons/ArrowDropDown' +import isEmpty from 'lodash/isEmpty' import i18n from '@dhis2/d2-i18n' import { DimensionsPanel } from '@dhis2/analytics' @@ -12,11 +13,8 @@ import FilterDialog from './FilterDialog' import { sGetSettingsDisplayNameProperty } from '../../reducers/settings' import { sGetActiveModalDimension } from '../../reducers/activeModalDimension' import { sGetDimensions } from '../../reducers/dimensions' -import { - sGetItemFiltersRoot, - sGetFiltersKeys, -} from '../../reducers/itemFilters' -import { acAddItemFilter, acRemoveItemFilter } from '../../actions/itemFilters' +import { sGetFiltersKeys } from '../../reducers/itemFilters' + import { acClearActiveModalDimension, acSetActiveModalDimension, @@ -24,14 +22,11 @@ import { const FilterSelector = props => { const [showPopover, setShowPopover] = useState(false) - const [filters, setFilters] = useState(props.initiallySelectedItems) const ref = useRef(null) - const closePanel = () => setShowPopover(false) - const onCloseDialog = () => { - closePanel() + setShowPopover(false) props.clearActiveModalDimension() } @@ -42,45 +37,6 @@ const FilterSelector = props => { ) } - const onSelectItems = ({ dimensionId, items }) => { - setFilters({ ...filters, [dimensionId]: items }) - } - - const onDeselectItems = ({ dimensionId, itemIdsToRemove }) => { - const oldList = filters[dimensionId] || [] - const newList = oldList.filter( - item => !itemIdsToRemove.includes(item.id) - ) - - const list = newList.length ? newList : [] - - setFilters({ ...filters, [dimensionId]: list }) - } - - const onReorderItems = ({ dimensionId, itemIds }) => { - const oldList = filters[dimensionId] || [] - const reorderedList = itemIds.map(id => - oldList.find(item => item.id === id) - ) - - setFilters({ ...filters, [dimensionId]: reorderedList }) - } - - const saveFilter = id => { - const filterItems = filters[id] - - if (filterItems && filterItems.length) { - props.addItemFilter({ - id, - value: [...filterItems], - }) - } else { - props.removeItemFilter(id) - } - - onCloseDialog() - } - return ( <> @@ -91,7 +47,7 @@ const FilterSelector = props => { {showPopover && ( { /> )} - {props.dimension ? ( + {!isEmpty(props.dimension) ? ( ) : null} @@ -124,18 +75,14 @@ const mapStateToProps = state => ({ displayNameProperty: sGetSettingsDisplayNameProperty(state), dimension: sGetActiveModalDimension(state), dimensions: sGetDimensions(state), - initiallySelectedItems: sGetItemFiltersRoot(state), selectedDimensions: sGetFiltersKeys(state), }) FilterSelector.propTypes = { - addItemFilter: PropTypes.func, clearActiveModalDimension: PropTypes.func, dimension: PropTypes.object, dimensions: PropTypes.array, displayNameProperty: PropTypes.string, - initiallySelectedItems: PropTypes.object, - removeItemFilter: PropTypes.func, selectedDimensions: PropTypes.array, setActiveModalDimension: PropTypes.func, } @@ -143,6 +90,4 @@ FilterSelector.propTypes = { export default connect(mapStateToProps, { clearActiveModalDimension: acClearActiveModalDimension, setActiveModalDimension: acSetActiveModalDimension, - addItemFilter: acAddItemFilter, - removeItemFilter: acRemoveItemFilter, })(FilterSelector) From 2e9b30c23491305800bf020b08cd8835279c2d37 Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Fri, 18 Sep 2020 13:19:41 +0200 Subject: [PATCH 4/9] fix: remove unnecessary code --- src/components/ItemFilter/FilterDialog.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/components/ItemFilter/FilterDialog.js b/src/components/ItemFilter/FilterDialog.js index 8e864441b..adadfe089 100644 --- a/src/components/ItemFilter/FilterDialog.js +++ b/src/components/ItemFilter/FilterDialog.js @@ -44,9 +44,7 @@ const FilterDialog = ( item => !itemIdsToRemove.includes(item.id) ) - const list = newList.length ? newList : [] - - setFilters({ ...filters, [dimensionId]: list }) + setFilters({ ...filters, [dimensionId]: newList }) } const onReorderItems = ({ dimensionId, itemIds }) => { From 437bbb95978974330d101afa6e5da675795cf2cd Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Fri, 18 Sep 2020 13:45:55 +0200 Subject: [PATCH 5/9] fix: remove orObject from MSTP --- src/actions/selected.js | 12 ++++++++---- src/components/Item/PrintTitlePageItem/Item.js | 9 +++++---- src/components/TitleBar/ViewTitleBar.js | 3 ++- src/reducers/dashboards.js | 2 ++ 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/actions/selected.js b/src/actions/selected.js index 818ab5177..c2da6de6b 100644 --- a/src/actions/selected.js +++ b/src/actions/selected.js @@ -1,4 +1,8 @@ -import { getCustomDashboards, sGetDashboardById } from '../reducers/dashboards' +import { + getCustomDashboards, + sGetDashboardById, + EMPTY_DASHBOARD, +} from '../reducers/dashboards' import { SET_SELECTED_ID, SET_SELECTED_ISLOADING, @@ -33,7 +37,6 @@ import { EVENT_CHART, MESSAGES, } from '../modules/itemTypes' -import { orObject } from '../modules/util' // actions @@ -57,8 +60,9 @@ export const tSetSelectedDashboardById = id => async (dispatch, getState) => { dispatch(acSetSelectedIsLoading(true)) const snackbarTimeout = setTimeout(() => { - const dashboardName = orObject(sGetDashboardById(getState(), id)) - .displayName + const dashboardName = ( + sGetDashboardById(getState(), id) || EMPTY_DASHBOARD + ).displayName if (sGetSelectedIsLoading(getState()) && dashboardName) { loadingDashboardMsg.name = dashboardName diff --git a/src/components/Item/PrintTitlePageItem/Item.js b/src/components/Item/PrintTitlePageItem/Item.js index d29b1da67..2181730fe 100644 --- a/src/components/Item/PrintTitlePageItem/Item.js +++ b/src/components/Item/PrintTitlePageItem/Item.js @@ -3,13 +3,14 @@ import { connect } from 'react-redux' import PropTypes from 'prop-types' import i18n from '@dhis2/d2-i18n' -import { orObject } from '../../../modules/util' - import { sGetSelectedId, sGetSelectedShowDescription, } from '../../../reducers/selected' -import { sGetDashboardById } from '../../../reducers/dashboards' +import { + sGetDashboardById, + EMPTY_DASHBOARD, +} from '../../../reducers/dashboards' import { sGetNamedItemFilters } from '../../../reducers/itemFilters' import classes from './styles/Item.module.css' @@ -63,7 +64,7 @@ PrintTitlePageItem.defaultProps = { const mapStateToProps = state => { const id = sGetSelectedId(state) - const dashboard = orObject(sGetDashboardById(state, id)) + const dashboard = sGetDashboardById(state, id) || EMPTY_DASHBOARD return { name: dashboard.displayName, diff --git a/src/components/TitleBar/ViewTitleBar.js b/src/components/TitleBar/ViewTitleBar.js index cdbca529c..ce41d9dd2 100644 --- a/src/components/TitleBar/ViewTitleBar.js +++ b/src/components/TitleBar/ViewTitleBar.js @@ -21,6 +21,7 @@ import { import { sGetDashboardById, sGetDashboardItems, + EMPTY_DASHBOARD, } from '../../reducers/dashboards' import classes from './styles/ViewTitleBar.module.css' @@ -201,7 +202,7 @@ ViewTitleBar.contextTypes = { const mapStateToProps = state => { const id = sGetSelectedId(state) - const dashboard = orObject(sGetDashboardById(state, id)) + const dashboard = sGetDashboardById(state, id) || EMPTY_DASHBOARD return { id, diff --git a/src/reducers/dashboards.js b/src/reducers/dashboards.js index 6735a1346..747a3ae36 100644 --- a/src/reducers/dashboards.js +++ b/src/reducers/dashboards.js @@ -17,6 +17,8 @@ export const DEFAULT_STATE_DASHBOARDS = { items: [], } +export const EMPTY_DASHBOARD = {} + // reducer helper functions const updateDashboardProp = ({ state, dashboardId, prop, value }) => ({ From 63955c8bf3829b80634ee289e30d81ae2198c6e2 Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Fri, 18 Sep 2020 13:53:47 +0200 Subject: [PATCH 6/9] fix: remove prop that was basically duplicate causing unneeded rerenders --- src/components/ItemFilter/FilterSelector.js | 9 ++------- src/reducers/itemFilters.js | 2 -- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/components/ItemFilter/FilterSelector.js b/src/components/ItemFilter/FilterSelector.js index 8b5c9a159..9f4354460 100644 --- a/src/components/ItemFilter/FilterSelector.js +++ b/src/components/ItemFilter/FilterSelector.js @@ -12,10 +12,7 @@ import FilterDialog from './FilterDialog' import { sGetSettingsDisplayNameProperty } from '../../reducers/settings' import { sGetActiveModalDimension } from '../../reducers/activeModalDimension' import { sGetDimensions } from '../../reducers/dimensions' -import { - sGetItemFiltersRoot, - sGetFiltersKeys, -} from '../../reducers/itemFilters' +import { sGetItemFiltersRoot } from '../../reducers/itemFilters' import { acAddItemFilter, acRemoveItemFilter } from '../../actions/itemFilters' import { acClearActiveModalDimension, @@ -100,7 +97,7 @@ const FilterSelector = props => { style={{ width: '320px' }} dimensions={props.dimensions} onDimensionClick={selectDimension} - selectedIds={props.selectedDimensions} + selectedIds={Object.keys(props.initiallySelectedItems)} /> )} @@ -125,7 +122,6 @@ const mapStateToProps = state => ({ dimension: sGetActiveModalDimension(state), dimensions: sGetDimensions(state), initiallySelectedItems: sGetItemFiltersRoot(state), - selectedDimensions: sGetFiltersKeys(state), }) FilterSelector.propTypes = { @@ -136,7 +132,6 @@ FilterSelector.propTypes = { displayNameProperty: PropTypes.string, initiallySelectedItems: PropTypes.object, removeItemFilter: PropTypes.func, - selectedDimensions: PropTypes.array, setActiveModalDimension: PropTypes.func, } diff --git a/src/reducers/itemFilters.js b/src/reducers/itemFilters.js index a26433eeb..e56801510 100644 --- a/src/reducers/itemFilters.js +++ b/src/reducers/itemFilters.js @@ -38,8 +38,6 @@ export default (state = DEFAULT_STATE_ITEM_FILTERS, action) => { export const sGetItemFiltersRoot = state => state.itemFilters -export const sGetFiltersKeys = state => Object.keys(sGetItemFiltersRoot(state)) - // simplify the filters structure to: // [{ id: 'pe', name: 'Period', values: [{ id: 2019: name: '2019' }, {id: 'LAST_MONTH', name: 'Last month' }]}, ...] export const sGetNamedItemFilters = createSelector( From c94d7fbc91cee0a3eb6c73d943d4a7af5f806fb7 Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Fri, 18 Sep 2020 13:54:27 +0200 Subject: [PATCH 7/9] fix: remove orObject from MSTP --- src/components/TitleBar/ViewTitleBar.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/TitleBar/ViewTitleBar.js b/src/components/TitleBar/ViewTitleBar.js index ce41d9dd2..a2ef407ab 100644 --- a/src/components/TitleBar/ViewTitleBar.js +++ b/src/components/TitleBar/ViewTitleBar.js @@ -83,6 +83,8 @@ const ViewTitleBar = (props, context) => { const buttonRef = createRef() + const userAccess = orObject(access) + return ( <>
@@ -95,7 +97,7 @@ const ViewTitleBar = (props, context) => {
- {access.update ? ( + {userAccess.update ? ( { ) : null} - {access.manage ? ( + {userAccess.manage ? ( @@ -211,7 +213,7 @@ const mapStateToProps = state => { dashboardItems: sGetDashboardItems(state), showDescription: sGetSelectedShowDescription(state), starred: dashboard.starred, - access: orObject(dashboard.access), + access: dashboard.access, } } From 795f476eeb7a0daa08a65a8b652897128738f935 Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Thu, 24 Sep 2020 10:33:16 +0200 Subject: [PATCH 8/9] fix: use better spacing in item title when the title wraps to multiple lines (#1099) --- .../Item/ItemHeader/styles/ItemHeader.module.css | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/components/Item/ItemHeader/styles/ItemHeader.module.css b/src/components/Item/ItemHeader/styles/ItemHeader.module.css index 37d1719a4..9c58160e9 100644 --- a/src/components/Item/ItemHeader/styles/ItemHeader.module.css +++ b/src/components/Item/ItemHeader/styles/ItemHeader.module.css @@ -1,10 +1,6 @@ -.itemWrap { - padding: var(--spacers-dp8); -} - .itemHeaderWrap { display: flex; - margin: var(--spacers-dp4) var(--spacers-dp4) var(--spacers-dp8) + margin: var(--spacers-dp8) var(--spacers-dp4) var(--spacers-dp8) var(--spacers-dp8); } @@ -12,7 +8,6 @@ font-weight: 700; color: var(--colors-grey800); font-size: 14px; - line-height: 28px; padding: 0; margin: 0; align-self: center; From b467a2f31021dc7312ac262cea1cd8d94e4a6ef6 Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Thu, 24 Sep 2020 10:33:16 +0200 Subject: [PATCH 9/9] fix: use better spacing in item title when the title wraps to multiple lines (#1099) --- .../Item/ItemHeader/styles/ItemHeader.module.css | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/components/Item/ItemHeader/styles/ItemHeader.module.css b/src/components/Item/ItemHeader/styles/ItemHeader.module.css index 37d1719a4..9c58160e9 100644 --- a/src/components/Item/ItemHeader/styles/ItemHeader.module.css +++ b/src/components/Item/ItemHeader/styles/ItemHeader.module.css @@ -1,10 +1,6 @@ -.itemWrap { - padding: var(--spacers-dp8); -} - .itemHeaderWrap { display: flex; - margin: var(--spacers-dp4) var(--spacers-dp4) var(--spacers-dp8) + margin: var(--spacers-dp8) var(--spacers-dp4) var(--spacers-dp8) var(--spacers-dp8); } @@ -12,7 +8,6 @@ font-weight: 700; color: var(--colors-grey800); font-size: 14px; - line-height: 28px; padding: 0; margin: 0; align-self: center;