-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: bump analytics to 24.10.12 and use periodSettings
- Loading branch information
1 parent
8417371
commit 7304118
Showing
8 changed files
with
113 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { useDataEngine } from '@dhis2/app-runtime'; | ||
import PropTypes from 'prop-types'; | ||
import React, { useContext, useState, useEffect, createContext } from 'react'; | ||
|
||
const systemInfoQuery = { | ||
resource: 'system/info', | ||
params: { | ||
fields: 'calendar', | ||
}, | ||
}; | ||
|
||
export const SystemInfoCtx = createContext({}); | ||
|
||
const SystemInfoProvider = ({ children }) => { | ||
const [settings, setSettings] = useState({}); | ||
const engine = useDataEngine(); | ||
|
||
useEffect(() => { | ||
async function fetchData() { | ||
const { systemInfo } = await engine.query({ | ||
systemInfo: systemInfoQuery, | ||
}); | ||
|
||
setSettings(systemInfo); | ||
} | ||
fetchData(); | ||
}, []); | ||
|
||
return ( | ||
<SystemInfoCtx.Provider value={settings}> | ||
{children} | ||
</SystemInfoCtx.Provider> | ||
); | ||
}; | ||
|
||
SystemInfoProvider.propTypes = { | ||
children: PropTypes.node, | ||
}; | ||
|
||
export default SystemInfoProvider; | ||
|
||
export const useSystemInfo = () => useContext(SystemInfoCtx); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1849,13 +1849,13 @@ | |
classnames "^2.3.1" | ||
prop-types "^15.7.2" | ||
|
||
"@dhis2/analytics@^24.10.7": | ||
version "24.10.7" | ||
resolved "https://registry.yarnpkg.com/@dhis2/analytics/-/analytics-24.10.7.tgz#dcb8c265e4fa97952e9ae0dae7becb5f0c2d2687" | ||
integrity sha512-yE3blq2L4IbmGt2ypNORgwIaTb1yvjCjdyxJA5/xH30aNDTqYPJQoyzo+U/KN1v8r495W39+C/s6GDbFBZ7j0A== | ||
"@dhis2/analytics@^24.10.12": | ||
version "24.10.12" | ||
resolved "https://registry.yarnpkg.com/@dhis2/analytics/-/analytics-24.10.12.tgz#2eb0a466570aff572defc77aafd4710359079250" | ||
integrity sha512-eqDCD1Is2XOdRTuDjnpoRImgVO8sa3AgqN8G0RSPnkrvg/ohqBvAkpir0RECDjLGkmYNuxTXkA/zCjc+m32RWQ== | ||
dependencies: | ||
"@dhis2/d2-ui-rich-text" "^7.4.0" | ||
"@dhis2/multi-calendar-dates" "1.0.0" | ||
"@dhis2/multi-calendar-dates" "^1.2.2" | ||
classnames "^2.3.1" | ||
d2-utilizr "^0.2.16" | ||
d3-color "^1.2.3" | ||
|
@@ -2043,6 +2043,15 @@ | |
i18next "^10.3" | ||
moment "^2.24.0" | ||
|
||
"@dhis2/d2-i18n@^1.1.3": | ||
version "1.1.3" | ||
resolved "https://registry.yarnpkg.com/@dhis2/d2-i18n/-/d2-i18n-1.1.3.tgz#ad73030f7cfceeed1b5bcaad86a9b336130bdfb1" | ||
integrity sha512-vOu6RDNumOJM396mHt35bETk9ai9b6XJyAwlUy1HstUZNvfET61F8rjCmMuXZU6zJ8ELux8kMFqlH8IG0vDJmA== | ||
dependencies: | ||
"@types/i18next" "^11.9.0" | ||
i18next "^10.3" | ||
moment "^2.24.0" | ||
|
||
"@dhis2/[email protected]", "@dhis2/d2-ui-core@^7.4.0": | ||
version "7.4.0" | ||
resolved "https://registry.yarnpkg.com/@dhis2/d2-ui-core/-/d2-ui-core-7.4.0.tgz#796afffbca4cf7f76a500d979e53c01abe8ebcb2" | ||
|
@@ -2103,12 +2112,13 @@ | |
suggestions "^1.7.1" | ||
uuid "^9.0.0" | ||
|
||
"@dhis2/multi-calendar-dates@1.0.0": | ||
version "1.0.0" | ||
resolved "https://registry.yarnpkg.com/@dhis2/multi-calendar-dates/-/multi-calendar-dates-1.0.0.tgz#bf7f49aecdffa9781837a5d60d56a094b74ab4df" | ||
integrity sha512-IB9a+feuS6yE4lpZj/eZ9uBmpYI7Hxitl2Op0JjoRL4tP+p6uw4ns9cjoSdUeIU9sOAxVZV7oQqSyIw+9P6YjQ== | ||
"@dhis2/multi-calendar-dates@^1.2.2": | ||
version "1.2.3" | ||
resolved "https://registry.yarnpkg.com/@dhis2/multi-calendar-dates/-/multi-calendar-dates-1.2.3.tgz#ef36bc80b34eaaa7f7cefa51b443528c019ff2d2" | ||
integrity sha512-K3E9yAH/SPXi1O7RWuK7bznYTa1v3x4Ys0ihpMWnKH++OLMx76yK/1H1m9v7NgQvMry29ATQMJh0n/vJSg+EpA== | ||
dependencies: | ||
"@js-temporal/polyfill" "^0.4.2" | ||
"@dhis2/d2-i18n" "^1.1.3" | ||
"@js-temporal/polyfill" "0.4.3" | ||
classnames "^2.3.2" | ||
|
||
"@dhis2/prop-types@^3.1.2": | ||
|
@@ -2575,13 +2585,13 @@ | |
"@jridgewell/resolve-uri" "^3.0.3" | ||
"@jridgewell/sourcemap-codec" "^1.4.10" | ||
|
||
"@js-temporal/polyfill@^0.4.2": | ||
version "0.4.4" | ||
resolved "https://registry.yarnpkg.com/@js-temporal/polyfill/-/polyfill-0.4.4.tgz#4c26b4a1a68c19155808363f520204712cfc2558" | ||
integrity sha512-2X6bvghJ/JAoZO52lbgyAPFj8uCflhTo2g7nkFzEQdXd/D8rEeD4HtmTEpmtGCva260fcd66YNXBOYdnmHqSOg== | ||
"@js-temporal/[email protected].3": | ||
version "0.4.3" | ||
resolved "https://registry.yarnpkg.com/@js-temporal/polyfill/-/polyfill-0.4.3.tgz#e8f8cf86745eb5050679c46a5ebedb9a9cc1f09b" | ||
integrity sha512-6Fmjo/HlkyVCmJzAPnvtEWlcbQUSRhi8qlN9EtJA/wP7FqXsevLLrlojR44kzNzrRkpf7eDJ+z7b4xQD/Ycypw== | ||
dependencies: | ||
jsbi "^4.3.0" | ||
tslib "^2.4.1" | ||
jsbi "^4.1.0" | ||
tslib "^2.3.1" | ||
|
||
"@juggle/resize-observer@^3.3.1": | ||
version "3.3.1" | ||
|
@@ -3306,6 +3316,11 @@ | |
dependencies: | ||
"@types/node" "*" | ||
|
||
"@types/i18next@^11.9.0": | ||
version "11.9.3" | ||
resolved "https://registry.yarnpkg.com/@types/i18next/-/i18next-11.9.3.tgz#04d84c6539908ad69665d26d8967f942d1638550" | ||
integrity sha512-snM7bMKy6gt7UYdpjsxycqSCAy0fr2JVPY0B8tJ2vp9bN58cE7C880k20PWFM4KXxQ3KsstKM8DLCawGCIH0tg== | ||
|
||
"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1": | ||
version "2.0.3" | ||
resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz#4ba8ddb720221f432e443bd5f9117fd22cfd4762" | ||
|
@@ -12073,7 +12088,7 @@ js-yaml@^4.1.0: | |
dependencies: | ||
argparse "^2.0.1" | ||
|
||
jsbi@^4.3.0: | ||
jsbi@^4.1.0: | ||
version "4.3.0" | ||
resolved "https://registry.yarnpkg.com/jsbi/-/jsbi-4.3.0.tgz#b54ee074fb6fcbc00619559305c8f7e912b04741" | ||
integrity sha512-SnZNcinB4RIcnEyZqFPdGPVgrg2AcnykiBy0sHVJQKHYeaLUvi3Exj+iaPpLnFVkDPZIV4U0yvgC9/R4uEAZ9g== | ||
|
@@ -18199,10 +18214,10 @@ tslib@^2.0.1, tslib@^2.0.3: | |
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.2.0.tgz#fb2c475977e35e241311ede2693cee1ec6698f5c" | ||
integrity sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w== | ||
|
||
tslib@^2.4.1: | ||
version "2.6.2" | ||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" | ||
integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== | ||
tslib@^2.3.1: | ||
version "2.6.3" | ||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.3.tgz#0438f810ad7a9edcde7a241c3d80db693c8cbfe0" | ||
integrity sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ== | ||
|
||
tslib@~2.1.0: | ||
version "2.1.0" | ||
|