-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5570 from beyondessential/release-2024-15
Release 2024-15
- Loading branch information
Showing
198 changed files
with
2,335 additions
and
1,320 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
*.md linguist-documentation | ||
*.pbxproj -text | ||
packages/types/src/schemas/schemas.ts linguist-generated=true | ||
packages/types/src/types/models.ts linguist-generated=true | ||
yarn.lock linguist-generated=true |
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,51 @@ | ||
name: Check PR title | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
env: | ||
PR_TITLE: ${{ github.event.pull_request.title }} | ||
steps: | ||
- id: release | ||
name: Check for release PR format | ||
if: startsWith(github.event.pull_request.title, 'Release') | ||
shell: bash | ||
run: | | ||
if ! grep -qP '^Release [0-9]{4}-[0-9]{2}$' <<< "$PR_TITLE"; then | ||
echo "::warning::Release PR title should be: 'Release <year>-<ISO week number>'" | ||
exit 1 | ||
fi | ||
- name: Check for Conventional Commit format | ||
shell: bash | ||
if: steps.release.conclusion == 'skipped' | ||
run: | | ||
if ! grep -qP '^\w+(\(\w+\))?:\s' <<< "$PR_TITLE"; then | ||
echo "::warning::PR title should be in Conventional Commit style, e.g. 'feat: ...'" | ||
exit 1 | ||
fi | ||
- name: Check for conventional type allow-list | ||
if: steps.release.conclusion == 'skipped' | ||
shell: bash | ||
run: | | ||
if ! grep -qP '^(ci|db|deps|doc|env|feat|fix|fmt|merge|refactor|repo|revert|style|test|tweak)(\(\w+\))?:\s' <<< "$PR_TITLE"; then | ||
echo "::warning::PR title Conventional Type is not on the list; refer to CONTRIBUTING.md" | ||
exit 1 | ||
fi | ||
- name: Check for Linear card number for feature branches | ||
if: steps.release.conclusion == 'skipped' && startsWith(github.event.pull_request.title, 'feat') | ||
shell: bash | ||
run: | | ||
if ! grep -qP '^\w+(\(\w+\))?:\s[A-Z]+-[0-9]+(:\s+\w+)?' <<< "$PR_TITLE"; then | ||
echo "::warning::PR title should start with ticket number, e.g. 'feat(scope): ABC-123: ...'" | ||
exit 1 | ||
fi |
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
*.env* | ||
!*.env.example* | ||
!*.env.*.example* | ||
!*.env.encrypted* | ||
.DS_Store | ||
**/node_modules | ||
|
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 @@ | ||
AGGREGATION_URL_PREFIX= |
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,7 @@ | ||
AUTH_API_URL= | ||
DATA_TABLE_API_URL= | ||
CENTRAL_API_URL= | ||
ENTITY_API_URL= | ||
REPORT_API_URL= | ||
WEB_CONFIG_API_URL= | ||
API_CLIENT_SALT= |
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,3 @@ | ||
AWS_ACCESS_KEY_ID= | ||
AWS_SECRET_ACCESS_KEY= | ||
AWS_REGION= |
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,4 @@ | ||
DATA_LAKE_DB_NAME= | ||
DATA_LAKE_DB_PASSWORD= | ||
DATA_LAKE_DB_URL= | ||
DATA_LAKE_DB_USER= |
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
DB_DISABLE_SSL= | ||
DB_NAME= | ||
DB_PASSWORD= | ||
DB_URL= | ||
|
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,8 @@ | ||
PALAU_DHIS_CLIENT_SECRET= | ||
PALAU_DHIS_PASSWORD= | ||
PALAU_DHIS_API_URL= | ||
DHIS_CLIENT_ID= | ||
DHIS_CLIENT_SECRET= | ||
DHIS_PASSWORD= | ||
DHIS_USERNAME= | ||
IS_PRODUCTION_ENVIRONMENT= |
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,15 @@ | ||
EXT_DB_niwa_PORT= | ||
EXT_DB_niwa_DATABASE= | ||
EXT_DB_niwa_USER= | ||
EXT_DB_niwa_PASSWORD= | ||
EXT_DB_niwa_HOST= | ||
EXT_DB_data_lake_HOST= | ||
EXT_DB_data_lake_PORT= | ||
EXT_DB_data_lake_DATABASE= | ||
EXT_DB_data_lake_USER= | ||
EXT_DB_data_lake_PASSWORD= | ||
EXT_DB_msupply_scheduled_HOST= | ||
EXT_DB_msupply_scheduled_PORT= | ||
EXT_DB_msupply_scheduled_DATABASE= | ||
EXT_DB_msupply_scheduled_USER= | ||
EXT_DB_msupply_scheduled_PASSWORD= |
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,5 @@ | ||
SITE_EMAIL_ADDRESS= | ||
SMTP_HOST= | ||
SMTP_PASSWORD= | ||
SMTP_USER= | ||
DEV_EMAIL_ADDRESS= |
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,4 @@ | ||
DB_PG_USER= | ||
DB_PG_PASSWORD= | ||
# used in CI/CD, and for running analytics refresh via CLI | ||
DB_ENABLE_SSL= |
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,5 @@ | ||
|
||
JWT_SECRET= | ||
SESSION_COOKIE_SECRET= | ||
|
||
|
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,3 @@ | ||
SUPERSET_API_PROXY_URL= | ||
SUPERSET_API_USERNAME= | ||
SUPERSET_API_PASSWORD= |
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 @@ | ||
WEATHERBIT_API_KEY= |
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 |
---|---|---|
@@ -1,16 +1,4 @@ | ||
PORT= | ||
|
||
API_CLIENT_NAME= | ||
API_CLIENT_PASSWORD= | ||
API_CLIENT_SALT= | ||
|
||
DB_URL= | ||
DB_NAME= | ||
DB_PASSWORD= | ||
DB_USER= | ||
|
||
SESSION_COOKIE_SECRET= | ||
|
||
CENTRAL_API_URL= | ||
ENTITY_API_URL= | ||
REPORT_API_URL= | ||
API_CLIENT_PASSWORD= |
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
56 changes: 56 additions & 0 deletions
56
packages/admin-panel-server/src/routes/ExportEntityHierarchiesRoute.ts
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,56 @@ | ||
/** | ||
* Tupaia | ||
* Copyright (c) 2017 - 2023 Beyond Essential Systems Pty Ltd | ||
*/ | ||
|
||
import { Request } from 'express'; | ||
import xlsx from 'xlsx'; | ||
import { Route } from '@tupaia/server-boilerplate'; | ||
|
||
export type ExportEntityHierarchiesRequest = Request< | ||
{ hierarchies: string }, | ||
{ contents: Buffer; filePath: string; type: string }, | ||
Record<string, never>, | ||
Record<string, any> | ||
>; | ||
|
||
export class ExportEntityHierarchiesRoute extends Route<ExportEntityHierarchiesRequest> { | ||
protected readonly type = 'download'; | ||
|
||
public async buildResponse() { | ||
const { hierarchies } = this.req.query; | ||
const { entity: entityApi } = this.req.ctx.services; | ||
|
||
const hierarchiesArray = Array.isArray(hierarchies) ? hierarchies : [hierarchies]; | ||
|
||
const workbook = xlsx.utils.book_new(); | ||
|
||
for (const hierarchy of hierarchiesArray) { | ||
const descendants = await entityApi.getDescendantsOfEntity( | ||
hierarchy, | ||
hierarchy, | ||
{ | ||
fields: ['name', 'code', 'parent_code'], | ||
}, | ||
false, | ||
false, | ||
); | ||
|
||
const projectEntity = await entityApi.getEntity(hierarchy, hierarchy, { | ||
fields: ['name'], | ||
}); | ||
|
||
const sheetName = projectEntity?.name || hierarchy; | ||
const sheet = xlsx.utils.json_to_sheet(descendants); | ||
xlsx.utils.book_append_sheet(workbook, sheet, sheetName); | ||
} | ||
|
||
const buffer = xlsx.write(workbook, { type: 'buffer', bookType: 'xlsx' }); | ||
|
||
return { | ||
contents: buffer, | ||
filePath: `entity_hierarchies_export_${Date.now()}.xlsx`, | ||
type: '.xlsx', | ||
}; | ||
} | ||
} |
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
Oops, something went wrong.