Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
d784657
feat(templates): add includeMetadataCodes flag for Code column
gqcorneby Jul 8, 2026
189d3b4
feat(templates): include org unit code in metadata sheet
gqcorneby Jul 9, 2026
b46eb92
test(templates): simplify sheetBuilder metadata specs
gqcorneby Jul 9, 2026
851e8ff
feat(templates): add regenerate-metadata use case and CLI script
gqcorneby Jul 10, 2026
74c6f5b
chore(scripts): add yarn regenerate-metadata alias
gqcorneby Jul 9, 2026
c0ba49c
chore(deps): bump @eyeseetea/d2-api to 1.21.0
gqcorneby Jul 9, 2026
e1dd2c8
refactor(templates): dedupe metadata code-column writes
gqcorneby Jul 9, 2026
54341c9
feat(scripts): make metadata generation flags configurable
gqcorneby Jul 10, 2026
a760ff0
docs(scripts): document regenerate-metadata CLI in README
gqcorneby Jul 10, 2026
8806a81
refactor(scripts): type form-type with oneOf instead of a cast
gqcorneby Jul 29, 2026
2836b71
test(templates): cover Code column for org units
gqcorneby Jul 29, 2026
860a383
fix(utils): decode base64 without Buffer in getBlobFromBase64
gqcorneby Jul 29, 2026
a153e3b
refactor(utils): extract cleanFormula to utils/string
gqcorneby Jul 29, 2026
dc5747e
refactor(webapp): extract shared TemplateDropzone component
gqcorneby Jul 29, 2026
8857b5e
feat(templates): resolve a template from an uploaded file
gqcorneby Jul 29, 2026
585e155
feat(settings): regenerate template metadata from the UI
gqcorneby Jul 29, 2026
fd2bfb2
Merge remote-tracking branch 'origin/development' into feature/regene…
gqcorneby Jul 29, 2026
2d1fdb1
style(webapp): format import page mime type list
gqcorneby Jul 29, 2026
8ead3cc
refactor(templates): extract shared template resolution helpers
gqcorneby Jul 29, 2026
c392cc6
refactor(webapp): move regenerate dialog logic to a hook
gqcorneby Jul 29, 2026
1f7498e
chore(i18n): update catalogs after the hook and helper extraction
gqcorneby Jul 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,35 @@ npx ts-node src/scripts/import-multiple-files.ts \
--results-path="/path/to/folder/for/json_results" \
file1.xlsx file2.xlsx
```

### Regenerate template metadata (from DHIS2)

You can use the script `regenerate-metadata.ts` to refresh **only** the Metadata
sheet of an existing template from fresh DHIS2 metadata, leaving every other sheet
(custom form, dropdowns, VBA) untouched:

```bash
yarn regenerate-metadata \
--dhis2-url="https://play.dhis2.org" \
--auth="user:pass" \
--input=template.xlsm \
--output=template.regenerated.xlsm \
--form-id=U6z7eJniNfL \
--form-type=trackerPrograms \
--include-codes
```

| Flag | Required | Description |
| ---- | -------- | ----------- |
| `--dhis2-url` / `-u` | yes | DHIS2 base URL (auth can be embedded here or via `--auth`). |
| `--auth` / `-a` | — | `"username:password"` (special characters are handled). |
| `--input` / `-i` | yes | Path to the input template (`.xlsm`/`.xlsx`). |
| `--output` / `-o` | yes | Path where the regenerated template is written. |
| `--form-id` | yes | DHIS2 program/dataSet id whose metadata is used. |
| `--form-type` | — | `trackerPrograms` \| `programs` \| `dataSets` (default `trackerPrograms`). |
| `--language` | — | Metadata name language (default `en`). |
| `--include-codes` | — | Write the Code column in the Metadata sheet (default off). |
| `--use-codes` | — | Use item codes instead of names for org units, data elements, options… (default off). |
| `--org-unit-short-name` | — | Use each org unit's short name instead of its regular name (default off). |

The same operation is available in the app, under Settings → Maintenance → Regenerate template metadata.
174 changes: 108 additions & 66 deletions i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"POT-Creation-Date: 2026-06-30T17:31:02.698Z\n"
"PO-Revision-Date: 2026-06-30T17:31:02.699Z\n"
"POT-Creation-Date: 2026-07-29T11:52:52.301Z\n"
"PO-Revision-Date: 2026-07-29T11:52:52.301Z\n"

msgid "Events - Create/update"
msgstr ""
Expand Down Expand Up @@ -120,6 +120,11 @@ msgstr ""
msgid "Found in {{locations}} of the Excel file"
msgstr ""

msgid ""
"Could not identify this template. Check the file is a Bulk Load template "
"and that your session is still active."
msgstr ""

msgid "Cannot read data form id"
msgstr ""

Expand Down Expand Up @@ -369,6 +374,80 @@ msgstr ""
msgid "Items older than {{period}}"
msgstr ""

msgid "File cleanup completed successfully"
msgstr ""

msgid "An error occurred during file cleanup"
msgstr ""

msgid "History cleanup completed successfully"
msgstr ""

msgid "An error occurred during history cleanup"
msgstr ""

msgid "Regenerate template metadata"
msgstr ""

msgid "Maintenance"
msgstr ""

msgid "File cleanup"
msgstr ""

msgid ""
"Remove files older than the selected period. History entries will be kept "
"but the files will be unaccessible"
msgstr ""

msgid "Cleaning up files..."
msgstr ""

msgid "Confirm File Cleanup"
msgstr ""

msgid ""
"Are you sure you want to remove all files older than the selected period? "
"This action cannot be undone. History entries will be kept but the files "
"will be inaccessible."
msgstr ""

msgid "Remove files older than"
msgstr ""

msgid "Clean up files"
msgstr ""

msgid "History cleanup"
msgstr ""

msgid ""
"Remove history entries and their documents older than the selected period. "
"This action cannot be undone"
msgstr ""

msgid "Cleaning up history..."
msgstr ""

msgid "Confirm History Cleanup"
msgstr ""

msgid ""
"Are you sure you want to remove all history entries and their documents "
"older than the selected period? This action cannot be undone."
msgstr ""

msgid "Remove history entries older than"
msgstr ""

msgid "Clean up history"
msgstr ""

msgid ""
"Refresh the Metadata sheet of an existing template file with current DHIS2 "
"metadata"
msgstr ""

msgid "Access to Template Generation"
msgstr ""

Expand Down Expand Up @@ -404,16 +483,30 @@ msgstr ""
msgid "Populate events for every Tracked Entity Instance (TEI)"
msgstr ""

msgid "File cleanup completed successfully"
msgid "Regenerate"
msgstr ""

msgid "An error occurred during file cleanup"
msgid "Drag and drop the template file to regenerate"
msgstr ""

msgid "History cleanup completed successfully"
msgid "Template"
msgstr ""

msgid "An error occurred during history cleanup"
msgid "Data Form Type"
msgstr ""

msgid "Include the Code column in the Metadata sheet"
msgstr ""

msgid "Use codes instead of names for metadata items"
msgstr ""

msgid "Use the short name of organisation units"
msgstr ""

msgid ""
"The Metadata sheet will be re-protected with the standard Bulk Load sheet "
"password. All other sheets and the macros are left untouched."
msgstr ""

msgid "Select Organisation Units on template generation"
Expand Down Expand Up @@ -531,60 +624,6 @@ msgstr ""
msgid "Permissions"
msgstr ""

msgid "Maintenance"
msgstr ""

msgid "File cleanup"
msgstr ""

msgid ""
"Remove files older than the selected period. History entries will be kept "
"but the files will be unaccessible"
msgstr ""

msgid "Cleaning up files..."
msgstr ""

msgid "Confirm File Cleanup"
msgstr ""

msgid ""
"Are you sure you want to remove all files older than the selected period? "
"This action cannot be undone. History entries will be kept but the files "
"will be inaccessible."
msgstr ""

msgid "Remove files older than"
msgstr ""

msgid "Clean up files"
msgstr ""

msgid "History cleanup"
msgstr ""

msgid ""
"Remove history entries and their documents older than the selected period. "
"This action cannot be undone"
msgstr ""

msgid "Cleaning up history..."
msgstr ""

msgid "Confirm History Cleanup"
msgstr ""

msgid ""
"Are you sure you want to remove all history entries and their documents "
"older than the selected period? This action cannot be undone."
msgstr ""

msgid "Remove history entries older than"
msgstr ""

msgid "Clean up history"
msgstr ""

msgid "Edit custom template"
msgstr ""

Expand Down Expand Up @@ -674,9 +713,6 @@ msgstr ""
msgid "Description"
msgstr ""

msgid "Data Form Type"
msgstr ""

msgid "Type"
msgstr ""

Expand Down Expand Up @@ -1001,9 +1037,6 @@ msgstr ""
msgid "Select available organisation units to include in the template"
msgstr ""

msgid "Template"
msgstr ""

msgid "Data Model"
msgstr ""

Expand Down Expand Up @@ -1161,6 +1194,15 @@ msgstr ""
msgid "Error loading import details"
msgstr ""

msgid "Only .xlsx and .xlsm template files are accepted"
msgstr ""

msgid "Regenerating metadata..."
msgstr ""

msgid "Metadata regenerated"
msgstr ""

msgid "Error deleting data values"
msgstr ""

Expand Down
Loading
Loading