Skip to content

Commit

Permalink
Merge branch 'master' into feat/rich-text-user-mention-components
Browse files Browse the repository at this point in the history
  • Loading branch information
jenniferarnesen authored Dec 21, 2023
2 parents e748233 + 913eb40 commit 5afcf61
Show file tree
Hide file tree
Showing 12 changed files with 289 additions and 79 deletions.
42 changes: 42 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,45 @@
# [26.2.0](https://github.com/dhis2/analytics/compare/v26.1.8...v26.2.0) (2023-12-14)


### Features

* implement cumulative values in PT engine (DHIS2-5497) ([#1567](https://github.com/dhis2/analytics/issues/1567)) ([2b404b4](https://github.com/dhis2/analytics/commit/2b404b423cfb49347bdf57125870bb7b55338322))

## [26.1.8](https://github.com/dhis2/analytics/compare/v26.1.7...v26.1.8) (2023-11-26)


### Bug Fixes

* **translations:** sync translations from transifex (master) ([43a607b](https://github.com/dhis2/analytics/commit/43a607ba0310b19edd07d866f15337e736567b2f))

## [26.1.7](https://github.com/dhis2/analytics/compare/v26.1.6...v26.1.7) (2023-11-19)


### Bug Fixes

* **translations:** sync translations from transifex (master) ([cb4a052](https://github.com/dhis2/analytics/commit/cb4a052a19ebdced3ea7b6ffb7d1c40064abac38))

## [26.1.6](https://github.com/dhis2/analytics/compare/v26.1.5...v26.1.6) (2023-11-07)


### Bug Fixes

* use json+patch for PATCH requests ([#1593](https://github.com/dhis2/analytics/issues/1593)) ([bdb0b9c](https://github.com/dhis2/analytics/commit/bdb0b9ceaa5ef102ef9768038c763b70a3d5e7d1))

## [26.1.5](https://github.com/dhis2/analytics/compare/v26.1.4...v26.1.5) (2023-11-03)


### Bug Fixes

* use correct colors in "basic" color set ([#1592](https://github.com/dhis2/analytics/issues/1592)) ([6356250](https://github.com/dhis2/analytics/commit/63562501bd8b020742bb7ee8b17621975790c3c6))

## [26.1.4](https://github.com/dhis2/analytics/compare/v26.1.3...v26.1.4) (2023-10-29)


### Bug Fixes

* **translations:** sync translations from transifex (master) ([435e077](https://github.com/dhis2/analytics/commit/435e07717c586365dfa67ad9ffb8acd5167e9ea2))

## [26.1.3](https://github.com/dhis2/analytics/compare/v26.1.2...v26.1.3) (2023-10-22)


Expand Down
18 changes: 11 additions & 7 deletions i18n/uz_UZ_Cyrl.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: i18next-conv\n"
"POT-Creation-Date: 2023-07-06T08:30:33.216Z\n"
"POT-Creation-Date: 2023-09-27T14:15:13.876Z\n"
"PO-Revision-Date: 2020-04-28 22:05+0000\n"
"Last-Translator: Ibatov <[email protected]>, 2023\n"
"Language-Team: Uzbek (Cyrillic) (https://app.transifex.com/hisp-uio/teams/100509/uz@Cyrl/)\n"
Expand Down Expand Up @@ -77,7 +77,7 @@ msgid "This app could not retrieve required data."
msgstr ""

msgid "Network error"
msgstr ""
msgstr "Тармоқда хатолик"

msgid "Data / Edit calculation"
msgstr ""
Expand Down Expand Up @@ -237,7 +237,7 @@ msgid "Dimension recommended with selected data"
msgstr "Танланган маълумотлар учун созламалар тавсия этилади"

msgid "All items"
msgstr ""
msgstr "Барча элементлар"

msgid "Automatically include all items"
msgstr ""
Expand Down Expand Up @@ -333,7 +333,7 @@ msgid "map"
msgstr "харита"

msgid "visualization"
msgstr ""
msgstr "Визуализация"

msgid "Edit"
msgstr "Таҳрирлаш"
Expand Down Expand Up @@ -373,6 +373,10 @@ msgstr ""
msgid "Write an interpretation"
msgstr "Талқин ёзиш"

msgid ""
"Other people viewing this interpretation in the future may see more data."
msgstr ""

msgid "Post interpretation"
msgstr ""

Expand Down Expand Up @@ -595,10 +599,10 @@ msgid_plural "{{count}} groups"
msgstr[0] ""

msgid "Selected: {{commaSeparatedListOfOrganisationUnits}}"
msgstr ""
msgstr "Танланган: {{commaSeparatedListOfOrganisationUnits}}"

msgid "Nothing selected"
msgstr ""
msgstr "Ҳеч нима танланмаган"

msgid "User organisation unit"
msgstr "Ташкилий бўлим фойдаланувчиси"
Expand Down Expand Up @@ -922,7 +926,7 @@ msgid "Indicator group"
msgstr "Индикатор гуруҳи"

msgid "All groups"
msgstr ""
msgstr "Барча гуруҳлар"

msgid "Indicator"
msgstr "Индикатор"
Expand Down
8 changes: 6 additions & 2 deletions i18n/zh.po
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#
# Translators:
# Viktor Varland <[email protected]>, 2021
# phil_dhis2, 2022
# Philip Larsen Donnelly, 2022
# 晓东 林 <[email protected]>, 2023
# easylin <[email protected]>, 2023
#
msgid ""
msgstr ""
"Project-Id-Version: i18next-conv\n"
"POT-Creation-Date: 2023-07-06T08:30:33.216Z\n"
"POT-Creation-Date: 2023-09-27T14:15:13.876Z\n"
"PO-Revision-Date: 2020-04-28 22:05+0000\n"
"Last-Translator: easylin <[email protected]>, 2023\n"
"Language-Team: Chinese (https://app.transifex.com/hisp-uio/teams/100509/zh/)\n"
Expand Down Expand Up @@ -376,6 +376,10 @@ msgstr "隐藏解释"
msgid "Write an interpretation"
msgstr "书写注释"

msgid ""
"Other people viewing this interpretation in the future may see more data."
msgstr "将来查看此解释的其他人可能会看到更多数据。"

msgid "Post interpretation"
msgstr "后解释"

Expand Down
18 changes: 11 additions & 7 deletions i18n/zh_CN.po
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#
# Translators:
# easylin <[email protected]>, 2023
# 晓东 林 <[email protected]>, 2023
# easylin <[email protected]>, 2023
#
msgid ""
msgstr ""
"Project-Id-Version: i18next-conv\n"
"POT-Creation-Date: 2023-07-06T08:30:33.216Z\n"
"POT-Creation-Date: 2023-09-27T14:15:13.876Z\n"
"PO-Revision-Date: 2020-04-28 22:05+0000\n"
"Last-Translator: 晓东 林 <13981924470@126.com>, 2023\n"
"Last-Translator: easylin <lin_xd@126.com>, 2023\n"
"Language-Team: Chinese (China) (https://app.transifex.com/hisp-uio/teams/100509/zh_CN/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down Expand Up @@ -78,7 +78,7 @@ msgid "This app could not retrieve required data."
msgstr ""

msgid "Network error"
msgstr ""
msgstr "网络错误"

msgid "Data / Edit calculation"
msgstr ""
Expand Down Expand Up @@ -374,6 +374,10 @@ msgstr ""
msgid "Write an interpretation"
msgstr ""

msgid ""
"Other people viewing this interpretation in the future may see more data."
msgstr ""

msgid "Post interpretation"
msgstr ""

Expand Down Expand Up @@ -596,10 +600,10 @@ msgid_plural "{{count}} groups"
msgstr[0] ""

msgid "Selected: {{commaSeparatedListOfOrganisationUnits}}"
msgstr ""
msgstr "已选择:{{commaSeparatedListOfOrganisationUnits}}"

msgid "Nothing selected"
msgstr ""
msgstr "未选择任何内容"

msgid "User organisation unit"
msgstr "用户所在机构"
Expand All @@ -611,7 +615,7 @@ msgid "User sub-x2-units"
msgstr "二级下属机构"

msgid "Select a level"
msgstr ""
msgstr "选择一个等级"

msgid "Select a group"
msgstr ""
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dhis2/analytics",
"version": "26.1.3",
"version": "26.2.0",
"main": "./build/cjs/index.js",
"module": "./build/es/index.js",
"exports": {
Expand Down
40 changes: 40 additions & 0 deletions src/__demo__/PivotTable.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,26 @@ storiesOf('PivotTable', module).add(
}
)

storiesOf('PivotTable', module).add(
'cumulative + empty columns (weekly) - shown',
(_, { pivotTableOptions }) => {
const visualization = {
...weeklyColumnsVisualization,
...pivotTableOptions,
hideEmptyColumns: false,
cumulativeValues: true,
}
return (
<div style={{ width: 800, height: 600 }}>
<PivotTable
data={weeklyColumnsData}
visualization={visualization}
/>
</div>
)
}
)

storiesOf('PivotTable', module).add(
'empty columns (weekly) - hidden',
(_, { pivotTableOptions }) => {
Expand All @@ -803,6 +823,26 @@ storiesOf('PivotTable', module).add(
}
)

storiesOf('PivotTable', module).add(
'cumulative + empty columns (weekly) - hidden',
(_, { pivotTableOptions }) => {
const visualization = {
...weeklyColumnsVisualization,
...pivotTableOptions,
hideEmptyColumns: true,
cumulativeValues: true,
}
return (
<div style={{ width: 800, height: 600 }}>
<PivotTable
data={weeklyColumnsData}
visualization={visualization}
/>
</div>
)
}
)

storiesOf('PivotTable', module).add(
'empty columns + assigned cats (shown)',
(_, { pivotTableOptions }) => {
Expand Down
9 changes: 6 additions & 3 deletions src/api/expression.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@ export const createCalculationMutation = {
}

export const updateCalculationMutation = {
type: 'update',
type: 'json-patch',
resource: 'expressionDimensionItems',
partial: true,
id: ({ id }) => id,
data: ({ name, expression }) => ({ name, shortName: name, expression }),
data: ({ name, expression }) => [
{ op: 'add', path: '/name', value: name },
{ op: 'add', path: '/shortName', value: name },
{ op: 'add', path: '/expression', value: expression },
],
}

export const deleteCalculationMutation = {
Expand Down
37 changes: 31 additions & 6 deletions src/components/FileMenu/RenameDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,25 @@ import {
labelForFileType,
} from './utils.js'

const formatPayload = (name, description) => {
const payload = [{ op: 'add', path: '/name', value: name }]

if (description) {
payload.push({
op: 'add',
path: '/description',
value: description,
})
}

return payload
}

const getMutation = (type) => ({
resource: endpointFromFileType(type),
id: ({ id }) => id,
type: 'update',
partial: true,
data: ({ name, description }) => ({ name, description }),
type: 'json-patch',
data: ({ name, description }) => formatPayload(name, description),
})

export const RenameDialog = ({ type, object, onClose, onRename, onError }) => {
Expand Down Expand Up @@ -52,7 +65,7 @@ export const RenameDialog = ({ type, object, onClose, onRename, onError }) => {
}

return (
<Modal onClose={onClose}>
<Modal onClose={onClose} dataTest="file-menu-rename-modal">
<style jsx>{modalStyles}</style>
<ModalTitle>
{i18n.t('Rename {{fileType}}', {
Expand All @@ -67,22 +80,34 @@ export const RenameDialog = ({ type, object, onClose, onRename, onError }) => {
required
value={name}
onChange={({ value }) => setName(value)}
dataTest="file-menu-rename-modal-name"
/>
<TextAreaField
label={i18n.t('Description')}
disabled={loading}
value={description}
rows={3}
onChange={({ value }) => setDescription(value)}
dataTest="file-menu-rename-modal-description"
/>
</div>
</ModalContent>
<ModalActions>
<ButtonStrip>
<Button onClick={onClose} disabled={loading} secondary>
<Button
onClick={onClose}
disabled={loading}
secondary
dataTest="file-menu-rename-modal-cancel"
>
{i18n.t('Cancel')}
</Button>
<Button onClick={renameObject} disabled={loading} primary>
<Button
onClick={renameObject}
disabled={loading}
primary
dataTest="file-menu-rename-modal-rename"
>
{i18n.t('Rename')}
</Button>
</ButtonStrip>
Expand Down
2 changes: 2 additions & 0 deletions src/components/Options/VisualizationOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
modalContent,
tabSection,
tabSectionTitle,
tabSectionTitleDisabled,
tabSectionTitleMargin,
tabSectionOption,
tabSectionOptionItem,
Expand Down Expand Up @@ -95,6 +96,7 @@ const VisualizationOptions = ({
{tabContent.styles}
{tabSection.styles}
{tabSectionTitle.styles}
{tabSectionTitleDisabled.styles}
{tabSectionTitleMargin.styles}
{tabSectionOption.styles}
{tabSectionOptionItem.styles}
Expand Down
6 changes: 6 additions & 0 deletions src/components/Options/styles/VisualizationOptions.style.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ export const tabSectionTitle = css.resolve`
}
`

export const tabSectionTitleDisabled = css.resolve`
span {
color: ${colors.grey600};
}
`

export const tabSectionTitleMargin = css.resolve`
span {
margin-top: ${spacers.dp8};
Expand Down
Loading

0 comments on commit 5afcf61

Please sign in to comment.