Skip to content

Conversation

@Chisomchima
Copy link
Member

@Chisomchima Chisomchima commented Dec 16, 2025

Screen.Recording.2025-12-17.at.10.52.38.mov

@dhis2-bot
Copy link
Contributor

dhis2-bot commented Dec 16, 2025

🚀 Deployed on https://pr-1452--dhis2-settings.netlify.app

@dhis2-bot dhis2-bot temporarily deployed to netlify December 16, 2025 19:09 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify December 17, 2025 08:11 Inactive
kabaros and others added 8 commits December 17, 2025 09:24
# [100.11.0](v100.10.0...v100.11.0) (2025-11-18)

### Features

* add orgUnitCentroidsInEventsAnalytics to analytics settings ([cb81cde](cb81cde))
* add orgUnitCentroidsInEventsAnalytics to analytics settings ([e5c0ecf](e5c0ecf))
- Commented out the keyHideDailyPeriods, keyHideWeeklyPeriods,
  keyHideBiWeeklyPeriods, keyHideMonthlyPeriods, and
  keyHideBiMonthlyPeriods settings in settingsCategories.js and
  settingsKeyMapping.js.
- Introduced the PeriodTypes component in settingsFields.component.jsx
  to handle period types settings.
@sonarqubecloud
Copy link

@Chisomchima Chisomchima requested a review from tomzemp December 17, 2025 09:57
Copy link
Member

@tomzemp tomzemp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!
This needs to be feature toggled for v43.

For implementation, I think it might be better to keep the current allowed period types in state, and then update that state when the post succeeds (if post fails, do not update). That will save you from performing a refetch.

I also think that it might be better to just use the translations for the periods provided by the backend (e.g. use displayName from api/periodTypes). The labels are not as nice looking as the ones suggested by Joe (e.g. the backend has Weekly Wednesday as the display name, not Weekly (starting Wednesday), but the logic will be simpler and we'll pick up translations more reliably. (That's also partly a question for @cooper-joe). If you want to go with the nicer labels, I've noted some places where I saw the logic would need to be updated to get translations to flow through.

}

const monthMap = {
April: 'April',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these should be translated


if (name.startsWith('Weekly')) {
const day = name.replace('Weekly', '')
return day
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the day won't be translated here, so you'd need to also create a dayMap and add translations for the weekdays

July: 'July',
Oct: 'October',
Nov: 'November',
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sep is used in FinancialSep and would need to be added here
For translation purposes, you'd need to add the full names of the months too (e.g. not just Nov, but also November) as the backend is not consistent with when it uses abbreviations/full month in the period name

setting: 'keyDashboardContextMenuItemViewFullscreen',
},
{
setting: 'orgUnitCentroidsInEventsAnalytics',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is merged right? So maybe you need to update your branch here by merging master and retriggering the comparison?

setUpdating(true)
try {
const d2 = await getD2()
const api = d2.Api.getApi()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use useDataMutation ? or is that not working for some reason. I think it would be better not to fetch with app-runtime tooling and post with d2 (also would prefer to not use d2 in any new code that is not relying heavily on existing settings app code)

updatedPeriodTypes
)

await refetch()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this refetch is also refetching api/periodTypes which is not necessary

setting: 'keyAnalysisDigitGroupSeparator',
},
{
setting: 'keyHideDailyPeriods',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these need to remain (at least for v42-, and TBD for v43+)

// {
// setting: 'keyHideBiMonthlyPeriods',
// },
{ setting: 'periodTypes' },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be feature toggled for v43+
Also, maybe a name like dataOutputPeriodTypes would be slightly clearer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants