diff --git a/packages/app/i18n/en.pot b/packages/app/i18n/en.pot index a1ba5ea6ae..a91db364a7 100644 --- a/packages/app/i18n/en.pot +++ b/packages/app/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-11-21T07:25:38.180Z\n" -"PO-Revision-Date: 2019-11-21T07:25:38.180Z\n" +"POT-Creation-Date: 2019-11-28T10:06:38.807Z\n" +"PO-Revision-Date: 2019-11-28T10:06:38.807Z\n" msgid "Rename successful" msgstr "" @@ -98,13 +98,13 @@ msgstr "" msgid "Interpretations" msgstr "" -msgid "{{dimensionName}} is locked to {{axisName}} for {{visTypeName}}" +msgid "{{total}} of {{axisMaxNumberOfItems}} selected" msgstr "" -msgid "{{total}} of {{maxNumberOfItemsPerAxis}} selected" +msgid "{{total}} selected" msgstr "" -msgid "{{total}} selected" +msgid "{{dimensionName}} is locked to {{axisName}} for {{visTypeName}}" msgstr "" msgid "Move to" diff --git a/packages/app/i18n/ru.po b/packages/app/i18n/ru.po index 47aa843543..48a2924422 100644 --- a/packages/app/i18n/ru.po +++ b/packages/app/i18n/ru.po @@ -1,7 +1,7 @@ # Translators: # Viktor Varland , 2019 # phil_dhis2, 2019 -# +# msgid "" msgstr "" "Project-Id-Version: i18next-conv\n" @@ -315,9 +315,6 @@ msgstr "" msgid "Single value" msgstr "" -msgid "Open as Map" -msgstr "" - msgid "Reporting rate" msgstr "Показатель отчетности" diff --git a/packages/app/i18n/sv.po b/packages/app/i18n/sv.po index 52abe3acb0..64e695c3ef 100644 --- a/packages/app/i18n/sv.po +++ b/packages/app/i18n/sv.po @@ -1,7 +1,7 @@ # Translators: # Viktor Varland , 2019 # phil_dhis2, 2019 -# +# msgid "" msgstr "" "Project-Id-Version: i18next-conv\n" @@ -105,6 +105,27 @@ msgstr "" msgid "Interpretations" msgstr "tolkningar" +msgid "{{dimensionName}} is locked to {{axisName}} for {{visTypeName}}" +msgstr "" + +msgid "{{total}} of {{maxNumberOfItemsPerAxis}} selected" +msgstr "" + +msgid "{{total}} selected" +msgstr "" + +msgid "Move to" +msgstr "" + +msgid "Remove" +msgstr "Avlägsna" + +msgid "None selected" +msgstr "" + +msgid "Only '{{name}}' in use" +msgstr "" + msgid "Only '{{number}}' in use" msgstr "" diff --git a/packages/app/i18n/uk.po b/packages/app/i18n/uk.po index 77057003e5..15660b8501 100644 --- a/packages/app/i18n/uk.po +++ b/packages/app/i18n/uk.po @@ -1,7 +1,7 @@ # Translators: # Viktor Varland , 2019 # phil_dhis2, 2019 -# +# msgid "" msgstr "" "Project-Id-Version: i18next-conv\n" @@ -126,6 +126,9 @@ msgstr "" msgid "Only '{{name}}' in use" msgstr "" +msgid "Only '{{number}}' in use" +msgstr "" + msgid "Unsaved chart" msgstr "" diff --git a/packages/app/i18n/ur.po b/packages/app/i18n/ur.po index ce436a074f..1030153034 100644 --- a/packages/app/i18n/ur.po +++ b/packages/app/i18n/ur.po @@ -1,6 +1,6 @@ # Translators: # Viktor Varland , 2019 -# +# msgid "" msgstr "" "Project-Id-Version: i18next-conv\n" @@ -113,11 +113,14 @@ msgstr "" msgid "{{total}} selected" msgstr "" -msgid "Move to" -msgstr "پر منتقل" +msgid "Error validating layout" +msgstr "" -msgid "None selected" -msgstr "کوئی بھی منتخب نہیں" +msgid "Create a new visualization by adding dimensions to the layout" +msgstr "" + +msgid "Chart error" +msgstr "" msgid "Only '{{name}}' in use" msgstr "" diff --git a/packages/app/i18n/vi.po b/packages/app/i18n/vi.po index 1b5753fb25..4232c44b72 100644 --- a/packages/app/i18n/vi.po +++ b/packages/app/i18n/vi.po @@ -1,7 +1,7 @@ # Translators: # Viktor Varland , 2019 # phil_dhis2, 2019 -# +# msgid "" msgstr "" "Project-Id-Version: i18next-conv\n" @@ -117,6 +117,9 @@ msgstr "" msgid "Move to" msgstr "" +msgid "Remove" +msgstr "Tháo ra" + msgid "None selected" msgstr "" diff --git a/packages/app/package.json b/packages/app/package.json index 3d2e686e7f..a78e016fb1 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -25,7 +25,7 @@ "webpack-bundle-analyzer": "^3.0.3" }, "dependencies": { - "@dhis2/analytics": "^2.6.11", + "@dhis2/analytics": "^2.6.12", "@dhis2/d2-i18n": "^1.0.6", "@dhis2/d2-ui-core": "^6.2.1", "@dhis2/d2-ui-file-menu": "^6.2.1", diff --git a/packages/app/src/components/DimensionsPanel/Dialogs/DialogManager.js b/packages/app/src/components/DimensionsPanel/Dialogs/DialogManager.js index d8fdfd64b8..0e86aea155 100644 --- a/packages/app/src/components/DimensionsPanel/Dialogs/DialogManager.js +++ b/packages/app/src/components/DimensionsPanel/Dialogs/DialogManager.js @@ -16,7 +16,7 @@ import { DIMENSION_ID_DATA, DIMENSION_ID_PERIOD, DIMENSION_ID_ORGUNIT, - getMaxNumberOfItemsPerAxis, + getAxisMaxNumberOfItems, getDisplayNameByVisType, filterOutFixedDimensions, } from '@dhis2/analytics'; @@ -213,19 +213,19 @@ export class DialogManager extends Component { const visType = type; const numberOfItems = selectedItems.length; - const maxNumberOfItemsPerAxis = getMaxNumberOfItemsPerAxis( + const axisMaxNumberOfItems = getAxisMaxNumberOfItems( visType, axisId ); - const hasMaxNumberOfItemsRule = !!maxNumberOfItemsPerAxis; + const hasMaxNumberOfItemsRule = !!axisMaxNumberOfItems; if ( hasMaxNumberOfItemsRule && - numberOfItems > maxNumberOfItemsPerAxis + numberOfItems > axisMaxNumberOfItems ) { infoBoxMessage = - maxNumberOfItemsPerAxis === 1 + axisMaxNumberOfItems === 1 ? i18n.t( `'{{visualiationType}}' is intended to show a single data item. Only the first item will be used and saved.`, { @@ -240,12 +240,12 @@ export class DialogManager extends Component { visualiationType: getDisplayNameByVisType( visType ), - maxNumber: maxNumberOfItemsPerAxis, + maxNumber: axisMaxNumberOfItems, } ); selectedItems.forEach((item, index) => { - item.isActive = index < maxNumberOfItemsPerAxis; + item.isActive = index < axisMaxNumberOfItems; }); } diff --git a/packages/app/src/components/DimensionsPanel/Dialogs/__tests__/DialogManager.spec.js b/packages/app/src/components/DimensionsPanel/Dialogs/__tests__/DialogManager.spec.js index e20aaf081b..1837230488 100644 --- a/packages/app/src/components/DimensionsPanel/Dialogs/__tests__/DialogManager.spec.js +++ b/packages/app/src/components/DimensionsPanel/Dialogs/__tests__/DialogManager.spec.js @@ -37,7 +37,7 @@ jest.mock('@dhis2/analytics', () => { [periodId]: {}, [ouId]: {}, }, - getMaxNumberOfItemsPerAxis: () => {}, + getAxisMaxNumberOfItems: () => {}, filterOutFixedDimensions: () => [], getAxisName: () => {}, }; diff --git a/packages/app/src/components/DimensionsPanel/DimensionsPanel.js b/packages/app/src/components/DimensionsPanel/DimensionsPanel.js index 6c8c8baa8f..b025e7b539 100644 --- a/packages/app/src/components/DimensionsPanel/DimensionsPanel.js +++ b/packages/app/src/components/DimensionsPanel/DimensionsPanel.js @@ -4,7 +4,7 @@ import { DimensionsPanel, DimensionMenu, getDisallowedDimensions, - getLockedDimensions, + getAllLockedDimensionIds, } from '@dhis2/analytics'; import DialogManager from './Dialogs/DialogManager'; @@ -108,7 +108,7 @@ const getDisallowedDimensionsMemo = createSelector( const getLockedDimensionsMemo = createSelector( [sGetUiType], - type => getLockedDimensions(type) + type => getAllLockedDimensionIds(type) ); const mapStateToProps = state => { diff --git a/packages/app/src/components/Layout/Chip.js b/packages/app/src/components/Layout/Chip.js index dc81b481c0..fa34551b9d 100644 --- a/packages/app/src/components/Layout/Chip.js +++ b/packages/app/src/components/Layout/Chip.js @@ -5,9 +5,9 @@ import LockIcon from '@material-ui/icons/Lock'; import i18n from '@dhis2/d2-i18n'; import { FIXED_DIMENSIONS, - getMaxNumberOfItemsPerAxis, - hasTooManyItemsPerAxis, - getLockedDimensionAxis, + getAxisMaxNumberOfItems, + hasAxisTooManyItems, + getAxisPerLockedDimension, getDisplayNameByVisType, getAxisName, } from '@dhis2/analytics'; @@ -44,12 +44,11 @@ class Chip extends React.Component { timeout = null; - isLocked = getLockedDimensionAxis( - this.props.type, - this.props.dimensionId - ).includes(this.props.axisId); + isLocked = + getAxisPerLockedDimension(this.props.type, this.props.dimensionId) === + this.props.axisId; - maxNumberOfItemsPerAxis = getMaxNumberOfItemsPerAxis( + axisMaxNumberOfItems = getAxisMaxNumberOfItems( this.props.type, this.props.axisId ); @@ -99,11 +98,11 @@ class Chip extends React.Component { const numberOfItems = this.props.items.length; const getItemsLabel = - !!this.maxNumberOfItemsPerAxis && - numberOfItems > this.maxNumberOfItemsPerAxis - ? i18n.t(`{{total}} of {{maxNumberOfItemsPerAxis}} selected`, { + !!this.axisMaxNumberOfItems && + numberOfItems > this.axisMaxNumberOfItems + ? i18n.t(`{{total}} of {{axisMaxNumberOfItems}} selected`, { total: numberOfItems, - maxNumberOfItemsPerAxis: this.maxNumberOfItemsPerAxis, + axisMaxNumberOfItems: this.axisMaxNumberOfItems, }) : i18n.t('{{total}} selected', { total: numberOfItems, @@ -137,8 +136,8 @@ class Chip extends React.Component { ); renderTooltip = () => { - const activeItemIds = !!this.maxNumberOfItemsPerAxis - ? this.props.items.slice(0, this.maxNumberOfItemsPerAxis) + const activeItemIds = !!this.axisMaxNumberOfItems + ? this.props.items.slice(0, this.axisMaxNumberOfItems) : this.props.items; const lockedLabel = this.isLocked @@ -181,7 +180,7 @@ class Chip extends React.Component { >
{this.renderChipIcon()}
{this.renderChipLabel()} - {hasTooManyItemsPerAxis( + {hasAxisTooManyItems( this.props.type, this.props.axisId, this.props.items.length diff --git a/packages/app/src/components/Layout/Tooltip.js b/packages/app/src/components/Layout/Tooltip.js index 67541c4cc9..b42bdea832 100644 --- a/packages/app/src/components/Layout/Tooltip.js +++ b/packages/app/src/components/Layout/Tooltip.js @@ -12,11 +12,10 @@ import { styles } from './styles/Tooltip.style'; const labels = { noneSelected: i18n.t('None selected'), - onlyOneInUse: name => i18n.t("Only '{{name}}' in use", { name }), + onlyOneInUse: name => i18n.t("Only '{{- name}}' in use", { name }), onlyLimitedNumberInUse: number => i18n.t("Only '{{number}}' in use", { number }), }; - export class Tooltip extends React.Component { renderTooltip = (names, warning) => (