Skip to content

Commit 836aed9

Browse files
author
Sean Fong
committed
Merge branch 'alpha' into health-checks-pilot
# Conflicts: # apps/smart-forms-app/.env
2 parents c69d162 + ab76a39 commit 836aed9

363 files changed

Lines changed: 92836 additions & 20237 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build_test_lint.yml

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ jobs:
6060
run: npm ci
6161

6262
- name: Build workspace packages
63-
run: npm run build -w packages/sdc-template-extract
63+
run: |
64+
npm run build -w packages/sdc-assemble
65+
npm run build -w packages/sdc-populate
66+
npm run build -w packages/sdc-template-extract
67+
npm run build -w packages/smart-forms-renderer
6468
6569
- name: Run jest tests
6670
run: npm run test -w apps/smart-forms-app
@@ -73,17 +77,33 @@ jobs:
7377
if: github.actor != 'dependabot[bot]'
7478
steps:
7579
- uses: actions/checkout@v4
80+
7681
- name: Use Node.js 20.x
7782
uses: actions/setup-node@v4
7883
with:
7984
node-version: 20
8085
cache: npm
86+
8187
- name: Install dependencies
8288
run: npm ci
89+
90+
# sdc-populate is a dependency of the renderer so we need to build it
91+
- name: Build workspace packages
92+
run: |
93+
npm run build -w packages/sdc-populate
94+
8395
- name: Run jest tests
8496
run: npm run test -w packages/smart-forms-renderer
8597
- uses: codecov/codecov-action@v4
8698

99+
- name: Upload smart-forms-renderer coverage report to GitHub
100+
uses: actions/upload-artifact@v4
101+
if: ${{ !cancelled() }}
102+
with:
103+
name: smart-forms-renderer-coverage-report
104+
path: packages/smart-forms-renderer/coverage
105+
retention-days: 30
106+
87107
jest-populate-tests:
88108
name: Jest Tests - Populate
89109
runs-on: ubuntu-latest
@@ -113,6 +133,35 @@ jobs:
113133
path: packages/sdc-populate/coverage
114134
retention-days: 30
115135

136+
jest-assemble-tests:
137+
name: Jest Tests - Assemble
138+
runs-on: ubuntu-latest
139+
# Conditional logic to skip if workflow is triggered by Dependabot
140+
if: github.actor != 'dependabot[bot]'
141+
steps:
142+
- uses: actions/checkout@v4
143+
144+
- name: Use Node.js 20.x
145+
uses: actions/setup-node@v4
146+
with:
147+
node-version: 20
148+
cache: npm
149+
150+
- name: Install dependencies
151+
run: npm ci
152+
153+
- name: Run jest tests
154+
run: npm run test -w packages/sdc-assemble
155+
- uses: codecov/codecov-action@v4
156+
157+
- name: Upload sdc-assemble coverage report to GitHub
158+
uses: actions/upload-artifact@v4
159+
if: ${{ !cancelled() }}
160+
with:
161+
name: sdc-assemble-coverage-report
162+
path: packages/sdc-assemble/coverage
163+
retention-days: 30
164+
116165
jest-extract-tests:
117166
name: Jest Tests - Template-Based Extract
118167
runs-on: ubuntu-latest

.github/workflows/publish_container.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ jobs:
5252
- name: Build and push Docker image
5353
uses: docker/build-push-action@v5
5454
with:
55-
context: apps/smart-forms-app
56-
file: ./Dockerfile
55+
context: ./apps/smart-forms-app
56+
file: ./apps/smart-forms-app/Dockerfile
5757
push: true
5858
tags: ${{ steps.meta.outputs.tags }}
5959
labels: ${{ steps.meta.outputs.labels }}
60+
platforms: linux/amd64,linux/arm64

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
node_modules
22
coverage
33
changelog_guide.md
4+
45
#Mac OS .DS_STORE
56
.DS_STORE
7+
8+
# GitHub copilot instructions
9+
.github/copilot-instructions.md

.prettierignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ coverage
44
build
55
storybook-static
66
*.md
7-
*.stories.*
87
*.cjs
98
*.js
109
*.config.*

CHANGELOG.alpha.md

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,69 @@ This changelog only includes changes from version 1.0.0-alpha.1 onwards. For sta
77

88
WARNING: Alpha releases are not stable and may contain breaking changes. Changes are also most likely to be undocumented.
99

10+
## [1.0.0-alpha.97] - 2025-09-04
11+
#### Changed
12+
- Changed item-level repopulate button custom extension to the below. See https://chat.fhir.org/#narrow/channel/179255-questionnaire/topic/Granular.20Repopulate.20button/with/533937578 for more details.
13+
```json
14+
{
15+
"url": "https://smartforms.csiro.au/ig/StructureDefinition/questionnaire-initialExpression-repopulatable",
16+
"valueCode": "manual"
17+
}
18+
```
19+
20+
## [1.0.0-alpha.96] - 2025-09-04
21+
#### Added
22+
- Added support for an item-level repopulate button via a custom extension 'https://smartforms.csiro.au/ig/StructureDefinition/questionnaire-initialExpression-showRepopulateButton'. This button can only be used on string, text, integer and decimal fields, and cannot be used in repeating items or groups.
23+
24+
## sdc-template-extract [1.0.8] - 2025-08-29
25+
#### Added
26+
- Fix $extract filtering logic when comparing extracted resource with comparison resource (for modified-only usage). Fixed https://github.com/aehrc/smart-forms/issues/1507.
27+
28+
## [1.0.0-alpha.95] - 2025-08-20
29+
#### Fixed
30+
- Various TypeScript-related bug fixes.
31+
- In the autocomplete component, when the input is less than 2 characters, an info icon will be displayed at the right end.
32+
33+
## [1.0.0-alpha.94] - 2025-08-20
34+
#### Fixed
35+
- Add enableColorScheme at ScopedCssBaseline for native light/dark alignment with parent app i.e. native scrollbars, native focus rings, etc.
36+
Note that this doesn't provide you with dark mode. for that, you need to wrap `<BaseRenderer>` with your own light/dark-mode enabled `<ThemeProvider>`. See https://mui.com/material-ui/customization/theming/ for more details.
37+
38+
## [1.0.0-alpha.93] - 2025-08-19
39+
#### Changed
40+
- Remove MUI GlobalStyles (which overrides the parent app) with ScopedCssBaseline in RendererThemeProvider. This sets a baseline for the renderer's MUI styles without affecting the parent app's styles.
41+
42+
## [1.0.0-alpha.92] - 2025-08-15
43+
#### Changed
44+
- Changed "questionnaire-item-text-hidden" custom extension to use the "https://smartforms.csiro.au/ig/StructureDefinition/<extension_name>" convention. Affected extensions:
45+
46+
| Old Extension URL | New Extension URL |
47+
|-----------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|
48+
| https://smartforms.csiro.au/docs/custom-extension/questionnaire-item-text-hidden | https://smartforms.csiro.au/ig/StructureDefinition/QuestionnaireItemTextHidden (or https://smartforms.csiro.au/docs/custom-extension/QuestionnaireItemTextHidden) |
49+
50+
- Added backwards compatibility for custom extensions defined in Smart Forms.
51+
Both URLs "https://smartforms.csiro.au/ig/StructureDefinition/<extension_name>" and "https://smartforms.csiro.au/docs/custom-extension/<extension_name>" will work for the custom extensions listed below.
52+
53+
| Extension URLs |
54+
|-----------------------------------------------------------------------------|
55+
| https://smartforms.csiro.au/docs/custom-extension/minValue-feedback |
56+
| https://smartforms.csiro.au/docs/custom-extension/maxValue-feedback |
57+
| https://smartforms.csiro.au/docs/custom-extension/required-feedback |
58+
| https://smartforms.csiro.au/docs/custom-extension/minQuantityValue-feedback |
59+
| https://smartforms.csiro.au/docs/custom-extension/maxQuantityValue-feedback |
60+
| https://smartforms.csiro.au/docs/custom-extension/QuestionnaireItemTextHidden |
61+
| https://smartforms.csiro.au/docs/custom-extension/GroupHideAddItemButton |
62+
63+
## sdc-assemble [2.0.2] - 2025-08-15
64+
#### Fixed
65+
- Handle axios-based FetchResourceCallback calls correctly, for both happy and sad paths (res.data).
66+
- Fix TypeScript issues in type predicates.
67+
- When resolving subquestionnaire canonical URLs, enforce in the root questionnaire (returns OperationOutcome if not present), otherwise if it's a recursive resolution within subquestionnaires (for sub-subquestionnaires), be more lenient by returning an empty array.
68+
69+
## [1.0.0-alpha.91] - 2025-08-11
70+
#### Changed
71+
- Remove Iconify dependency and replaced them with MUI icons. This affects the next/previous tab and page buttons.
72+
1073
## sdc-template-extract [1.0.7] - 2025-08-11
1174
#### Added
1275
- Allow handling of non-Error exceptions when evaluating FHIRPath expressions. Reason: fhirpath.js might not type exceptions as Error objects correctly.
@@ -75,7 +138,7 @@ _(WARNING: Possible breaking changes with QuestionnaireStore.itemTypes)_
75138
- Due to space constraints for textfield-based items in gtables/grids, expression update animations for textfield-based items are now changed to a faint green glow. Animations are unchanged for radio and checkbox items.
76139

77140
## [1.0.0-alpha.80] - 2025-07-15
78-
_(WARNING: Possible breaking changes with Questionnaires definitions)_
141+
_(WARNING: Possible breaking changes with Questionnaire definitions)_
79142
#### Changed
80143
- Changed all instances of custom extensions to use the "https://smartforms.csiro.au/docs/custom-extension/*" convention. Affected extensions:
81144

LICENSE

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1489,18 +1489,6 @@ separate files distributed with the Software.
14891489
│ ├─ publisher: Nicholas C. Zakas
14901490
│ ├─ path: node_modules/@humanwhocodes/object-schema
14911491
│ └─ licenseFile: node_modules/@humanwhocodes/object-schema/LICENSE
1492-
├─ @iconify/react@4.1.0
1493-
│ ├─ licenses: MIT
1494-
│ ├─ repository: https://github.com/iconify/iconify
1495-
│ ├─ publisher: Vjacheslav Trushkin
1496-
│ ├─ path: node_modules/@iconify/react
1497-
│ └─ licenseFile: node_modules/@iconify/react/license.txt
1498-
├─ @iconify/types@2.0.0
1499-
│ ├─ licenses: MIT
1500-
│ ├─ repository: https://github.com/iconify/iconify
1501-
│ ├─ publisher: Vjacheslav Trushkin
1502-
│ ├─ path: node_modules/@iconify/types
1503-
│ └─ licenseFile: node_modules/@iconify/types/license.txt
15041492
├─ @istanbuljs/load-nyc-config@1.1.0
15051493
│ ├─ licenses: ISC
15061494
│ ├─ repository: https://github.com/istanbuljs/load-nyc-config
@@ -13645,4 +13633,4 @@ separate files distributed with the Software.
1364513633
├─ path: node_modules/yui-lint
1364613634
└─ licenseFile: node_modules/yui-lint/LICENSE
1364713635

13648-
Generated by license-checker v25.0.1 https://www.npmjs.com/package/license-checker
13636+
Generated by license-checker v25.0.1 https://www.npmjs.com/package/license-checker

LOCAL_DEVELOPMENT.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ However, it has its own set of complexities to watch out for, such as dependenci
5050

5151
2. Duplicate .env and rename it to .env.local. This file will be used to store your local environment variables.
5252

53-
3. Change VITE_PRESERVE_SYM_LINKS=true to VITE_PRESERVE_SYM_LINKS=false in .env.local. This will allow `tsc -w` to watch for changes properly in the smart-forms-renderer component.
53+
3. Change VITE_PRESERVE_SYM_LINKS=true to VITE_PRESERVE_SYM_LINKS=false in .env.local or add it if it does not exist. This will allow `tsc -w` to watch for changes properly in the smart-forms-renderer component.
5454

5555

5656
## Running the Smart Forms and Storybook Locally on Docker with Live Code Reload
@@ -66,11 +66,9 @@ docker-compose --env-file ./apps/smart-forms-app/.env.local build
6666
```sh
6767
docker-compose --env-file ./apps/smart-forms-app/.env.local up
6868
```
69-
4. Press CTRL+C to stop the container.
69+
4. Go to [http://localhost:5173/](http://localhost:5173/) for Smart Forms App
7070

71-
5. Go to [http://localhost:5173/](http://localhost:5173/) for Smart Forms App
72-
73-
6. Go to [http://localhost:6006/](http://localhost:6006/) for Story Book App
71+
5. Go to [http://localhost:6006/](http://localhost:6006/) for Story Book App
7472

7573
NOTE: In the Docker setup, the current source code folder is shared as a volume to the Docker container. This allows the live code reload to work.
7674

@@ -80,9 +78,18 @@ TODO: We have experienced some issues with "Type Error: styled_default is not de
8078

8179

8280
## Running the Smart Forms app locally
83-
1. Ensure you are in the directory containing the Smart Forms app.
81+
1. In order to prepare all packages for use, you need to run the build script in each package located in the /packages directory.
82+
83+
cd packages/<package-name>
84+
npm run build
85+
86+
Repeat this for each package in /packages
87+
88+
2. Ensure you are in the directory containing the Smart Forms app.
89+
90+
cd apps/smart-forms-app
8491

85-
2. Start the app on localhost. It defaults to port 5173.
92+
3. Start the app on localhost. It defaults to port 5173.
8693
```sh
8794
npm start
8895
```

apps/smart-forms-app/Dockerfile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
11
# Dockerfile
22

33
# Step 1: Use a Node.js image to build the app
4-
FROM node:18 AS builder
4+
FROM --platform=$BUILDPLATFORM node:18 AS builder
55

66
# Set working directory inside the container
77
WORKDIR /app
88

99
# Copy package.json and package-lock.json
1010
COPY package*.json ./
1111

12+
# Install build tools for native dependencies
13+
RUN apt-get update && apt-get install -y python3 build-essential && rm -rf /var/lib/apt/lists/*
14+
15+
# Set npm config for python and permissions (use ENV for cross-platform compatibility)
16+
ENV npm_config_python=python3 \
17+
npm_config_unsafe_perm=true
18+
1219
# Install dependencies
1320
RUN npm install
1421

@@ -20,7 +27,7 @@ RUN npm run build
2027

2128

2229
# Step 2: Use an Nginx image to serve the static files
23-
FROM nginx:alpine
30+
FROM --platform=$BUILDPLATFORM nginx:alpine
2431

2532
# Copy the build files from the builder stage to the Nginx web directory
2633
COPY --from=builder /app/dist /usr/share/nginx/html
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// Mock for CSS/font imports
2+
module.exports = {};

apps/smart-forms-app/jest.config.ts

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,53 @@ import type { Config } from 'jest';
1919

2020
const config: Config = {
2121
verbose: true,
22-
roots: ['<rootDir>'],
22+
roots: ['src'],
23+
preset: 'ts-jest',
24+
testEnvironment: 'jsdom',
25+
setupFilesAfterEnv: ['./src/setup-jest.ts'],
2326
transform: {
24-
'^.+\\.ts?$': 'ts-jest'
27+
'^.+\\.(ts|tsx)$': ['ts-jest', {
28+
useESM: true,
29+
isolatedModules: true,
30+
}]
31+
},
32+
transformIgnorePatterns: [
33+
'/node_modules/(?!(@aehrc|@fontsource)/)'
34+
],
35+
moduleNameMapper: {
36+
'^@fontsource/(.*)$': '<rootDir>/__mocks__/emptyModule.js'
2537
},
2638
// Exclude "spec" folder
27-
testRegex: '(/__tests__/.*|(\\.|/)(test))\\.ts?$',
28-
moduleFileExtensions: ['ts', 'js', 'json', 'node'],
39+
testRegex: '(/__tests__/.*|(\\.|/)(test))\\.(ts|tsx)?$',
40+
moduleFileExtensions: ['ts', 'tsx', 'js', 'json', 'node'],
2941
collectCoverage: true,
42+
collectCoverageFrom: [
43+
'**/api/*.{ts,tsx}',
44+
'**/hooks/*.{ts,tsx}',
45+
'**/utils/*.{ts,tsx}',
46+
'**/contexts/*.{ts,tsx}',
47+
'!**/*.config.{ts,tsx,js,jsx}', // exclude config files
48+
'!**/*.test.{ts,tsx}', // exclude test files
49+
'!**/*.spec.{ts,tsx}', // exclude spec files
50+
'!**/*.styles.{ts,tsx}', // exclude style files
51+
'!**/*.interface.{ts,tsx}', // exclude interface files
52+
'!**/*.d.ts', // exclude declaration files
53+
'!**/e2e/**', // exclude e2e files
54+
'!src/test/data-shared/**', // explicitly exclude src/test/data-shared
55+
'!src/features/standalone/**', // explicitly exclude src/features/standalone
56+
'!src/theme/**', // explicitly exclude src/theme
57+
'!src/globals.ts', // explicitly exclude src/globals.ts
58+
'!src/utils/dayjsExtend.ts', // explicitly exclude src/utils/dayjsExtend.ts
59+
'!src/stores/selector.ts', // explicitly exclude src/stores/selector.ts
60+
],
61+
coverageThreshold: {
62+
"global": {
63+
"statements": 80,
64+
"branches": 75,
65+
"functions": 80,
66+
"lines": 80
67+
}
68+
},
3069
clearMocks: true,
3170
coverageDirectory: 'coverage'
3271
};

0 commit comments

Comments
 (0)