-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into official-release
# Conflicts: # doc/compodoc_sources/summary.json # src/app/child-dev-project/children/children-list/children-list.component.spec.ts # src/app/core/admin/admin.module.ts # src/app/core/admin/services/backup.service.spec.ts # src/app/core/config/config-fix.ts # src/app/core/entity-components/entity-form/entity-form/entity-form.component.html # src/app/core/entity-components/entity-form/entity-form/entity-form.component.scss # src/app/core/entity-components/entity-list/entity-list.component.spec.ts # src/app/core/export/export-data-button/export-data-button.component.spec.ts # src/app/core/export/export-data-button/export-data-button.component.ts # src/app/core/export/export-service/export-column-config.ts # src/app/core/export/export-service/export.service.spec.ts # src/app/core/export/export-service/export.service.ts # src/app/core/session/session-service/remote-session.spec.ts # src/app/core/session/session-service/remote-session.ts # src/app/core/session/session-service/synced-session.service.spec.ts # src/app/core/session/session-service/synced-session.service.ts # src/app/core/session/session.service.provider.ts # src/app/features/reporting/query.service.ts
- Loading branch information
Showing
215 changed files
with
4,415 additions
and
4,835 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -210,7 +210,7 @@ Example: | |
``` | ||
"filters": [ | ||
{ | ||
"id": "medium" | ||
"id": "language" | ||
}, | ||
{ | ||
"id": "privateSchool", | ||
|
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 @@ | ||
# Infrastructure | ||
Aam Digital is an Angular application and can be deployed on a simple webserver. | ||
To do so we are using Docker and some other tools. | ||
|
||
The following diagram show the actions that are performed when new code changes are published. | ||
|
||
![CI/CD Flow](../../images/CICD-Flow.svg) | ||
|
||
## Dockerfile | ||
The Dockerfile can be found in [/build/Dockerfile](https://github.com/Aam-Digital/ndb-core/blob/master/build/Dockerfile). | ||
It provides a stable environment where the application is build, tested and packaged. | ||
It consists of two stages. | ||
The first stage is build on top of a `node` image and builds the application for production usage and optionally runs tests and uploads the test coverage. | ||
The second stage is build on top of a `nginx` image and only copies the files from the previous stage, which are necessary for deploying the application. | ||
This process makes the final image as small as possible. | ||
`nginx` is used to run a lightweight webserver. | ||
The configuration for `nginx` can be found in [/build/default.conf](https://github.com/Aam-Digital/ndb-core/blob/master/build/default.conf). | ||
|
||
## Pull Requests | ||
Whenever a new pull request is created, GitHub creates a new app on Heroku and posts the link to this app in the PR. | ||
For each new commit of a PR, GitHub then builds the Docker image for this branch. | ||
This includes building the application in production mode, linting the sourcecode and running the tests. | ||
If all these stages pass, GitHub will upload the newly created image to Heroku. | ||
Once this is done, a version of Aam Digital with the new changes included can be visited through the posted link. | ||
|
||
## Master Updates | ||
After approving a PR and merging it into the master, semantic release automatically creates a new tag for this change. | ||
For each new tag a tagged Docker image is uploaded to [DockerHub](https://hub.docker.com/r/aamdigital/ndb-server). | ||
|
||
## Deploying Aam Digital | ||
The Docker image from DockerHub can then be downloaded and run via Docker using the following command: | ||
> docker pull aamdigital/ndb-server && docker run -p=80:80 aamdigital/ndb-server | ||
However, this will only run Aam Digital in demo-mode. | ||
To run Aam Digital with a real database, a new `config.json` file has to be mounted into the image. | ||
This should have a structure equal to `config.default.json` ([/src/assets/config.default.json](https://github.com/Aam-Digital/ndb-core/blob/master/src/assets/config.default.json)). | ||
It holds the information about where to find the remote database, what the name of the app is and in which mode the app is being run. | ||
|
||
The [ndb-setup](https://github.com/Aam-Digital/ndb-setup) project provides a clear workflow for how to deploy a new instance of Aam Digital and CouchDB. | ||
It extends the Docker image with a `docker-compose.yml` file which handles all the dependencies. | ||
For further information checkout the [README](https://github.com/Aam-Digital/ndb-setup/blob/master/README.md). | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
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,99 @@ | ||
# Exports | ||
|
||
The list views like `/child`, `/school`, `/note` ,... have a button to export data. | ||
Clicking this button will create a downloadable `.csv` file. | ||
The format of this file can be adjusted through the configuration for the list view. | ||
|
||
## Config Format | ||
|
||
The configuration of the export format is part of the configuration of the [EntityListComponent](../../interfaces/EntityListConfig.html). | ||
|
||
E.g. | ||
```json | ||
"view:child": { | ||
"component": "ChildrenList", | ||
"config": { | ||
"exportConfig": [ | ||
{ "label": "Child", "query": ".name" }, | ||
{ | ||
"query": ":getRelated(ChildSchoolRelation, childId)", | ||
"subQueries": [ | ||
{ "label": "School Name", "query": ".schoolId:toEntities(School).name" }, | ||
{ "label": "From", "query": ".start" }, | ||
{ "label": "To", "query": ".end" } | ||
] | ||
|
||
} | ||
], | ||
"title": "Children List", | ||
"columns": [...], | ||
"columnGroups": {...}, | ||
"filters": [...] | ||
} | ||
}, | ||
``` | ||
|
||
## Configuring a Export | ||
|
||
The structure of the exports is according to the [ExportColumnConfig](../../interfaces/ExportColumnConfig.html). | ||
|
||
The `label` property is optional and provides a title for this column. | ||
If nothing is provided the query (without dots) is used (e.g. for `"query": ".name"` the label will be `name`). | ||
|
||
The `query` has to be a valid [JSON-Query](https://github.com/auditassistant/json-query#queries). | ||
The query will be run on each entity of the list page that is visited (e.g. on each child). | ||
For further information about the query-syntax read the [Reports Guide](reports.md) which uses the same query language. | ||
|
||
The `subQueries` is optional and expects an array of `ExportColumnConfigs`. | ||
The queries of the `subQueries` will be run for each result of the parent query. | ||
In the example above, this would mean that for each `ChildSchoolRelation` the name of the school, the from- and the to-date will be exported. | ||
If `subQueries` is defined, each object of the parent query will lead to one row in the report. | ||
In the example above this would mean if there are `n` children and each of them has `m` child-school-relations then the final report will have `n*m` rows and the columns `Child`, `School Name`, `From`, `To` (`Child` from the first query and the others from the sub-queries). | ||
In case `subQueries` is defined, the result of the parent query will not be visible in the export. | ||
If the results of the parent query is wanted in the report, a simple sub-query can be added that returns all values of the parent query (`query: "[*]"`). | ||
|
||
## Example Output | ||
|
||
Using the config from above with the following data: | ||
|
||
```typescript | ||
const child1 = { | ||
_id: "Child:1", | ||
name: "Peter" | ||
} | ||
const child2 = { | ||
_id: "Child:2", | ||
name: "Anna" | ||
} | ||
const relation1 = { | ||
_id: "ChildSchoolRelation:1", | ||
schoolId: "1", | ||
childId: "1", | ||
start: "01/01/2020", | ||
end: "01/01/2021" | ||
} | ||
const relation2 = { | ||
_id: "ChildSchoolRelation:2", | ||
schoolId: "1", | ||
childId: "1", | ||
start: "01/01/2021", | ||
} | ||
const relation3 = { | ||
_id: "ChildSchoolRelation:3", | ||
schoolId: "1", | ||
childId: "1", | ||
start: "01/01/2021", | ||
} | ||
const school = { | ||
_id: "School:1", | ||
name: "High School" | ||
} | ||
``` | ||
|
||
Would create a `.csv` file according to the following table: | ||
|
||
| Child | School Name | From | To | | ||
| --- | --- | --- | --- | | ||
| Peter | High School | 01/01/2020 | 01/01/2021 | | ||
| Peter | High School | 01/01/2021 | | | ||
| Anna | High School | 01/01/2021 | | |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.