Skip to content

Commit

Permalink
Merge branch 'master' into fix/add-endpoint-to-text-matcher
Browse files Browse the repository at this point in the history
  • Loading branch information
edoardo authored Nov 19, 2024
2 parents 6c3e9e2 + 39186d3 commit f642539
Show file tree
Hide file tree
Showing 15 changed files with 110 additions and 90 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/dhis2-verify-lib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
- name: Build
run: yarn build

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: lib-build
path: |
Expand All @@ -77,7 +77,7 @@ jobs:
path: '**/node_modules'
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}

- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: lib-build

Expand All @@ -104,7 +104,7 @@ jobs:
path: '**/node_modules'
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}

- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: lib-build

Expand All @@ -123,7 +123,7 @@ jobs:
with:
node-version: 14.x

- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: lib-build

Expand Down
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
## [3.11.2](https://github.com/dhis2/app-runtime/compare/v3.11.1...v3.11.2) (2024-10-14)


### Bug Fixes

* expand FetchErrorDetails type ([#1389](https://github.com/dhis2/app-runtime/issues/1389)) ([ff0ad60](https://github.com/dhis2/app-runtime/commit/ff0ad6077aecdb7627ec985a61c159159be6b8ea))

## [3.11.1](https://github.com/dhis2/app-runtime/compare/v3.11.0...v3.11.1) (2024-10-09)


### Bug Fixes

* handle alert returned async by parentAlertsAdd [LIBS-695] ([#1388](https://github.com/dhis2/app-runtime/issues/1388)) ([9c989b2](https://github.com/dhis2/app-runtime/commit/9c989b2f9c408b7d5988dd0ec8756e86ddf2632f))

# [3.11.0](https://github.com/dhis2/app-runtime/compare/v3.10.6...v3.11.0) (2024-09-10)


### Features

* fixed dimensions efficiency ([#1386](https://github.com/dhis2/app-runtime/issues/1386)) ([2b07a14](https://github.com/dhis2/app-runtime/commit/2b07a14ea7e781c1948cfa651a4ad5759a811c79))

## [3.10.6](https://github.com/dhis2/app-runtime/compare/v3.10.5...v3.10.6) (2024-07-26)


Expand Down
16 changes: 8 additions & 8 deletions docs/components/Plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ const MyPlugin = (propsFromParent) => {

## Plugin Props (reserved props)

| Name | Type | Required | Description |
| :--------------------: | :------------: | :---------------------------------------------: | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **pluginShortName** | _string_ | _required_ if `pluginSource` is not provided | The shortName of the app/plugin you wish to load (matching the result from api/apps). Used to look up the plugin entry point. If this is not provided, `pluginSource` must be provided. `pluginSource` will take precedence if provided. |
| **pluginSource** | _string_ (url) | _required_ if `pluginShortName` is not provided | The URL of the plugin. If this is not provided, `pluginShortName` must be provided. |
| **onError** | _Function_ | _optional_ | Callback function to be called when an error in the plugin triggers an error boundary. You can use this to pass an error back up to the app and create a custom handling/UX if errors occur in the plugin. In general, it is recommended that you use the plugin's built-in error boundaries |
| **showAlertsInPlugin** | _boolean_ | _optional_ | If `true`, any alerts within the plugin (defined with the `useAlert` hook) will be rendered within the iframe. By default, this is `false`. It is recommended, in general, that you do not override this and allow alerts to be hoisted up to the app level |
| **height** | _number_ | _optional_ | If a height is provided, the iframe will be fixed to the specified height. If no height is provided, the iframe will automatically resize based on its contents. |
| **width** | _number_ | _optional_ | If a width is provided, the iframe will be fixed to the specified width. If no width is provided, the iframe will automatically resize based on its contents. |
| Name | Type | Required | Description |
| :--------------------: | :------------: | :---------------------------------------------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **pluginShortName** | _string_ | _required_ if `pluginSource` is not provided | The shortName of the app/plugin you wish to load (matching the result from api/apps). Used to look up the plugin entry point. If this is not provided, `pluginSource` must be provided. `pluginSource` will take precedence if provided. |
| **pluginSource** | _string_ (url) | _required_ if `pluginShortName` is not provided | The URL of the plugin. If this is not provided, `pluginShortName` must be provided. |
| **onError** | _Function_ | _optional_ | Callback function to be called when an error in the plugin triggers an error boundary. You can use this to pass an error back up to the app and create a custom handling/UX if errors occur in the plugin. In general, it is recommended that you use the plugin's built-in error boundaries |
| **showAlertsInPlugin** | _boolean_ | _optional_ | If `true`, any alerts within the plugin (defined with the `useAlert` hook) will be rendered within the iframe. By default, this is `false`. It is recommended, in general, that you do not override this and allow alerts to be hoisted up to the app level |
| **height** | _string_ | _optional_ | If a height is provided, the iframe will be fixed to the specified height. If no height is provided, the iframe will automatically resize its height based on its contents. The value of `height` will not be passed to the plugin, as it is in an internal implementation detail. If you do need to also pass the height to the plugin, you can pass another variable (e.g. `pluginHeight`). |
| **width** | _string_ | _optional_ | If a width is provided, the iframe will be fixed to the specified width. If no width is provided, the iframe will automatically resize its width based on its contents. The value of `width` will not be passed to the plugin, as it is in an internal implementation detail. If you do need to also pass the width to the plugin, you can pass another variable (e.g. `pluginWidth`). |

## Plugin Props (custom props)

Expand Down
32 changes: 16 additions & 16 deletions examples/cra/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1054,32 +1054,32 @@
integrity sha512-ij4wRiunFfaJxjB0BdrYHIH8FxBJpOwNPhhAcunlmPdXudL1WQV1qoP9un6JsEBAgQH+7UXyyjh0g7jTxXK6tg==

"@dhis2/app-runtime@file:../../runtime":
version "3.10.4"
version "3.10.6"
dependencies:
"@dhis2/app-service-alerts" "3.10.4"
"@dhis2/app-service-config" "3.10.4"
"@dhis2/app-service-data" "3.10.4"
"@dhis2/app-service-offline" "3.10.4"
"@dhis2/app-service-plugin" "3.10.4"
"@dhis2/app-service-alerts" "3.10.6"
"@dhis2/app-service-config" "3.10.6"
"@dhis2/app-service-data" "3.10.6"
"@dhis2/app-service-offline" "3.10.6"
"@dhis2/app-service-plugin" "3.10.6"

"@dhis2/[email protected].4", "@dhis2/app-service-alerts@file:../../services/alerts":
version "3.10.4"
"@dhis2/[email protected].6", "@dhis2/app-service-alerts@file:../../services/alerts":
version "3.10.6"

"@dhis2/[email protected].4", "@dhis2/app-service-config@file:../../services/config":
version "3.10.4"
"@dhis2/[email protected].6", "@dhis2/app-service-config@file:../../services/config":
version "3.10.6"

"@dhis2/[email protected].4", "@dhis2/app-service-data@file:../../services/data":
version "3.10.4"
"@dhis2/[email protected].6", "@dhis2/app-service-data@file:../../services/data":
version "3.10.6"
dependencies:
react-query "^3.13.11"

"@dhis2/[email protected].4", "@dhis2/app-service-offline@file:../../services/offline":
version "3.10.4"
"@dhis2/[email protected].6", "@dhis2/app-service-offline@file:../../services/offline":
version "3.10.6"
dependencies:
lodash "^4.17.21"

"@dhis2/[email protected].4", "@dhis2/app-service-plugin@file:../../services/plugin":
version "3.10.4"
"@dhis2/[email protected].6", "@dhis2/app-service-plugin@file:../../services/plugin":
version "3.10.6"
dependencies:
post-robot "^10.0.46"

Expand Down
32 changes: 16 additions & 16 deletions examples/query-playground/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1812,32 +1812,32 @@
moment "^2.24.0"

"@dhis2/app-runtime@*", "@dhis2/app-runtime@^2.8.0", "@dhis2/app-runtime@file:../../runtime":
version "3.10.4"
version "3.10.6"
dependencies:
"@dhis2/app-service-alerts" "3.10.4"
"@dhis2/app-service-config" "3.10.4"
"@dhis2/app-service-data" "3.10.4"
"@dhis2/app-service-offline" "3.10.4"
"@dhis2/app-service-plugin" "3.10.4"
"@dhis2/app-service-alerts" "3.10.6"
"@dhis2/app-service-config" "3.10.6"
"@dhis2/app-service-data" "3.10.6"
"@dhis2/app-service-offline" "3.10.6"
"@dhis2/app-service-plugin" "3.10.6"

"@dhis2/[email protected].4", "@dhis2/app-service-alerts@file:../../services/alerts":
version "3.10.4"
"@dhis2/[email protected].6", "@dhis2/app-service-alerts@file:../../services/alerts":
version "3.10.6"

"@dhis2/[email protected].4", "@dhis2/app-service-config@file:../../services/config":
version "3.10.4"
"@dhis2/[email protected].6", "@dhis2/app-service-config@file:../../services/config":
version "3.10.6"

"@dhis2/[email protected].4", "@dhis2/app-service-data@file:../../services/data":
version "3.10.4"
"@dhis2/[email protected].6", "@dhis2/app-service-data@file:../../services/data":
version "3.10.6"
dependencies:
react-query "^3.13.11"

"@dhis2/[email protected].4", "@dhis2/app-service-offline@file:../../services/offline":
version "3.10.4"
"@dhis2/[email protected].6", "@dhis2/app-service-offline@file:../../services/offline":
version "3.10.6"
dependencies:
lodash "^4.17.21"

"@dhis2/[email protected].4", "@dhis2/app-service-plugin@file:../../services/plugin":
version "3.10.4"
"@dhis2/[email protected].6", "@dhis2/app-service-plugin@file:../../services/plugin":
version "3.10.6"
dependencies:
post-robot "^10.0.46"

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "3.10.6",
"version": "3.11.2",
"description": "A singular runtime dependency for applications on the DHIS2 platform",
"repository": "https://github.com/dhis2/app-runtime.git",
"author": "Austin McGee <[email protected]>",
Expand Down
12 changes: 6 additions & 6 deletions runtime/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@dhis2/app-runtime",
"description": "A singular runtime dependency for applications on the DHIS2 platform",
"version": "3.10.6",
"version": "3.11.2",
"main": "./build/cjs/index.js",
"module": "./build/es/index.js",
"types": "./build/types/index.d.ts",
Expand Down Expand Up @@ -29,11 +29,11 @@
"build/**"
],
"dependencies": {
"@dhis2/app-service-config": "3.10.6",
"@dhis2/app-service-data": "3.10.6",
"@dhis2/app-service-alerts": "3.10.6",
"@dhis2/app-service-offline": "3.10.6",
"@dhis2/app-service-plugin": "3.10.6"
"@dhis2/app-service-config": "3.11.2",
"@dhis2/app-service-data": "3.11.2",
"@dhis2/app-service-alerts": "3.11.2",
"@dhis2/app-service-offline": "3.11.2",
"@dhis2/app-service-plugin": "3.11.2"
},
"peerDependencies": {
"prop-types": "^15.7.2",
Expand Down
2 changes: 1 addition & 1 deletion services/alerts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dhis2/app-service-alerts",
"version": "3.10.6",
"version": "3.11.2",
"main": "./build/cjs/index.js",
"module": "./build/es/index.js",
"types": "./build/types/index.d.ts",
Expand Down
9 changes: 7 additions & 2 deletions services/alerts/src/useAlert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,18 @@ export const useAlert = (
typeof options === 'function' ? options(props) : options

if (plugin && parentAlertsAdd && !showAlertsInPlugin) {
alertRef.current = parentAlertsAdd(
// Functions passed through post-robot are asynchronous
parentAlertsAdd(
{
message: resolvedMessage,
options: resolvedOptions,
},
alertRef
)
// Conditional chaining gives backwards compatibility
// with cli-app-scripts < 12
)?.then((newAlert: Alert) => {
alertRef.current = newAlert
})
} else {
alertRef.current = add(
{
Expand Down
2 changes: 1 addition & 1 deletion services/config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dhis2/app-service-config",
"version": "3.10.6",
"version": "3.11.2",
"main": "./build/cjs/index.js",
"module": "./build/es/index.js",
"types": "build/types/index.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions services/data/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dhis2/app-service-data",
"version": "3.10.6",
"version": "3.11.2",
"main": "./build/cjs/index.js",
"module": "./build/es/index.js",
"types": "build/types/index.d.ts",
Expand Down Expand Up @@ -35,7 +35,7 @@
"react-query": "^3.13.11"
},
"peerDependencies": {
"@dhis2/app-service-config": "3.10.6",
"@dhis2/app-service-config": "3.11.2",
"prop-types": "^15.7.2",
"react": "^16.8",
"react-dom": "^16.8"
Expand Down
9 changes: 8 additions & 1 deletion services/data/src/engine/types/FetchError.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
export type FetchErrorTypeName = 'network' | 'unknown' | 'access' | 'aborted'
export type FetchErrorDetails = { message?: string }
export type FetchErrorDetails = {
httpStatus?: string
httpStatusCode?: number
status?: string
message?: string
errorCode?: string
[x: string]: any
}

export interface FetchErrorPayload {
type: FetchErrorTypeName
Expand Down
4 changes: 2 additions & 2 deletions services/offline/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@dhis2/app-service-offline",
"description": "A runtime service for online/offline detection and offline caching",
"version": "3.10.6",
"version": "3.11.2",
"main": "./build/cjs/index.js",
"module": "./build/es/index.js",
"types": "build/types/index.d.ts",
Expand Down Expand Up @@ -33,7 +33,7 @@
"coverage": "yarn test --coverage"
},
"peerDependencies": {
"@dhis2/app-service-config": "3.10.6",
"@dhis2/app-service-config": "3.11.2",
"prop-types": "^15.7.2",
"react": "^16.8.6",
"react-dom": "^16.8.6"
Expand Down
6 changes: 3 additions & 3 deletions services/plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dhis2/app-service-plugin",
"version": "3.10.6",
"version": "3.11.2",
"main": "./build/cjs/index.js",
"module": "./build/es/index.js",
"types": "build/types/index.d.ts",
Expand Down Expand Up @@ -28,8 +28,8 @@
"prop-types": "^15.7.2",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"@dhis2/app-service-alerts": "3.10.6",
"@dhis2/app-service-data": "3.10.6"
"@dhis2/app-service-alerts": "3.11.2",
"@dhis2/app-service-data": "3.11.2"
},
"devDependencies": {
"@types/post-robot": "^10.0.3"
Expand Down
Loading

0 comments on commit f642539

Please sign in to comment.