Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connect datatypes with components #817

Merged
merged 247 commits into from
Jul 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
247 commits
Select commit Hold shift + click to select a range
fcc3da3
added functionality for defining a component to display a property in…
TheSlimvReal May 13, 2021
5adec27
initializing default components in the entity list component
TheSlimvReal May 13, 2021
1faccd5
changed children list config to use default components
TheSlimvReal May 13, 2021
d34f09f
a lable is automatically added through schema if none is present
TheSlimvReal May 13, 2021
7239ace
added labels to the child entity and removed labels from children lis…
TheSlimvReal May 13, 2021
d86d8c8
automatically initializing columns that are only defined in the colum…
TheSlimvReal May 13, 2021
419c3c9
fixed sideeffects
TheSlimvReal May 13, 2021
25b051e
finished childrenList config to use information from schema
TheSlimvReal May 13, 2021
8846898
refactored some names
TheSlimvReal May 14, 2021
ad6f5d6
form component adds additional information from schemas
TheSlimvReal May 14, 2021
948341f
refactored getComponent function
TheSlimvReal May 14, 2021
ed945b9
cleaned up from component
TheSlimvReal May 14, 2021
60dbdac
added dynamic textfield component
TheSlimvReal May 14, 2021
0fbf0a8
refactored form component and edit components
TheSlimvReal May 14, 2021
65edf3f
copied setup code from edit text component
TheSlimvReal May 14, 2021
a79a607
added dynamic edit configurable enum component
TheSlimvReal May 14, 2021
9af5468
refactored the config that is passed between form and edit components
TheSlimvReal May 14, 2021
4c82d1f
fixed error messages
TheSlimvReal May 14, 2021
22ccdbd
added component to edit dates
TheSlimvReal May 14, 2021
e44a258
added component to edit selectables
TheSlimvReal May 14, 2021
5678cb9
added component to calcualte the age
TheSlimvReal May 14, 2021
0f7e325
adding component for editing booleans
TheSlimvReal May 14, 2021
b75138b
implement edit boolean component
TheSlimvReal May 15, 2021
0dcbf93
added component to edit long texts
TheSlimvReal May 15, 2021
ced5a0a
added component for editing photo files
TheSlimvReal May 15, 2021
178c664
added new datatype for displaying photos
TheSlimvReal May 17, 2021
57dcea1
using new datatype for editing photos in form
TheSlimvReal May 17, 2021
5e3bd5b
using the new specialPhoto everywhere
TheSlimvReal May 17, 2021
55b3bbf
added tests for photo datatype
TheSlimvReal May 17, 2021
e68ad00
removed old datatypes
TheSlimvReal May 17, 2021
c2f4406
added migration script for old photoFile format
TheSlimvReal May 17, 2021
2857d30
added migration service to migrate children to correct format
TheSlimvReal May 17, 2021
8cb0ab1
making sure that default values are not saved
TheSlimvReal May 17, 2021
47348f9
renamed photo attribute
TheSlimvReal May 17, 2021
de53618
fixed a bug when deleting the filename
TheSlimvReal May 17, 2021
9b2009e
undone demo data changes
TheSlimvReal May 17, 2021
6b77fb8
changed comment
TheSlimvReal May 17, 2021
fee56d1
fixed prettier errors
TheSlimvReal May 17, 2021
fd851fd
fixed code smells
TheSlimvReal May 17, 2021
b95a292
Merge branch 'child-photo-improvement' into connect-datatypes-with-co…
TheSlimvReal May 17, 2021
b52dcac
added type info for formControls
TheSlimvReal May 17, 2021
be9ad6b
implemented edit photo component
TheSlimvReal May 17, 2021
f5a1d74
fix config to use new form syntax
TheSlimvReal May 17, 2021
c162766
fix config for school to use new syntax
TheSlimvReal May 17, 2021
500f44c
fixed tests
TheSlimvReal May 17, 2021
46b91ac
added story for entity subrecord
TheSlimvReal May 18, 2021
80c2670
using form components in entity subrecord
TheSlimvReal May 18, 2021
b949823
created new forms module
TheSlimvReal May 18, 2021
ef21856
created additional form service
TheSlimvReal May 18, 2021
91df6cd
fixed form service
TheSlimvReal May 18, 2021
ecd25ba
entity subrecord uses form service
TheSlimvReal May 18, 2021
c71cf2c
removed unnecessary fields
TheSlimvReal May 18, 2021
dd6f042
changed input type for entity subrecord columns
TheSlimvReal May 18, 2021
0752adb
form service also sets the component if none is present
TheSlimvReal May 18, 2021
d0db2fd
using new entitysubrecord config for aser component
TheSlimvReal May 18, 2021
bf53a63
renamed edit components folder
TheSlimvReal May 18, 2021
6bd7656
added component to display functions
TheSlimvReal May 18, 2021
18b446a
refactored educational-material.component.ts
TheSlimvReal May 18, 2021
2db28f2
refactored health-checkup.component.ts
TheSlimvReal May 18, 2021
13e7b23
refactored notes-of-child.component.ts
TheSlimvReal May 18, 2021
d124349
added component to edit selectable entities in forms
TheSlimvReal May 18, 2021
76923a6
adapted config to new pattern
TheSlimvReal May 18, 2021
3b97477
fixed historical data config
TheSlimvReal May 19, 2021
7c8fded
fixed historical data story
TheSlimvReal May 19, 2021
90787df
added table view for edit components
TheSlimvReal May 19, 2021
984bd84
added color function
TheSlimvReal May 19, 2021
e9ceae1
cleaned up formfieldconfig interface
TheSlimvReal May 19, 2021
956af4e
adding story for previous schools
TheSlimvReal May 19, 2021
66427f9
fixed select school functionality
TheSlimvReal May 19, 2021
b04986f
using view components from entity list
TheSlimvReal May 19, 2021
f6ace9e
renamed edit-entity-array and crated edit-single-entity
TheSlimvReal May 20, 2021
2c12d8e
added component to display an arbitrary entity
TheSlimvReal May 20, 2021
04441b7
added story for entity select
TheSlimvReal May 20, 2021
0744b39
refactored entity select
TheSlimvReal May 20, 2021
7236d97
extended display entity component to be dynamic
TheSlimvReal May 20, 2021
0e9b2d2
added component to edit a single entity
TheSlimvReal May 20, 2021
5c00b40
only creating formGroups on demand
TheSlimvReal May 20, 2021
ee30512
fixed sorting for entity subrecord
TheSlimvReal May 20, 2021
35a2c34
moved readonly function to entity list module
TheSlimvReal May 20, 2021
7dc8a62
created general concept for view components
TheSlimvReal May 20, 2021
df95f93
renamed interfaces for view and edit components
TheSlimvReal May 20, 2021
7517000
removed unnecessary uuid generating
TheSlimvReal May 20, 2021
e6c8670
added view component to display an array of entities
TheSlimvReal May 20, 2021
dfcea84
fixed error
TheSlimvReal May 20, 2021
a96df27
updated entity subrecord story
TheSlimvReal May 20, 2021
f10cf74
fixed and updated config
TheSlimvReal May 21, 2021
05f225f
removed unused components
TheSlimvReal May 21, 2021
4fc0d0b
fixed most of the tests
TheSlimvReal May 21, 2021
c51930f
fixed test for previous schools component
TheSlimvReal May 21, 2021
6650d86
moved form validation to entity
TheSlimvReal May 21, 2021
a2f9fab
fixed test
TheSlimvReal May 21, 2021
39eb5c4
added component to edit percentages
TheSlimvReal May 21, 2021
9f11406
fixed validators for percentage
TheSlimvReal May 21, 2021
2929ca7
added component to display attendance
TheSlimvReal May 21, 2021
f18e3be
added component to display a unit as suffix
TheSlimvReal May 21, 2021
a5b92b4
added short label to entitySchemaFields
TheSlimvReal May 21, 2021
d3bcb28
renamed some interfaces
TheSlimvReal May 21, 2021
4599198
renamed interfaces
TheSlimvReal May 24, 2021
44f4c50
added story for entity list component
TheSlimvReal May 24, 2021
de1a826
using entity subrecord in entity list component
TheSlimvReal May 24, 2021
53b80fc
fix runtime errors
TheSlimvReal May 24, 2021
3351ecf
working on fixing the unit tests
TheSlimvReal May 24, 2021
d20032d
fixed tests
TheSlimvReal May 24, 2021
f491e4a
fixed lint errors
TheSlimvReal May 24, 2021
e616f74
removed duplicate input definition
TheSlimvReal May 25, 2021
025d395
using schema information to create filters
TheSlimvReal May 25, 2021
b14a904
added service to generate filters
TheSlimvReal May 25, 2021
2678eae
added tests for filter service
TheSlimvReal May 25, 2021
0e63a21
removed duplicate tests
TheSlimvReal May 25, 2021
fc2611f
increased test coverage for entity subrecord component
TheSlimvReal May 25, 2021
a12b2b0
added tests to entity list and edit single entity components
TheSlimvReal May 25, 2021
1510059
fixed sorting behavior
TheSlimvReal May 26, 2021
64a0ade
cleaned up config
TheSlimvReal May 26, 2021
c0cd9d1
using entity subrecord in children overview
TheSlimvReal May 26, 2021
31986c7
removed cyclic dependency to component map
TheSlimvReal May 26, 2021
cb3a03e
fixed tests for children overview
TheSlimvReal May 26, 2021
0481628
added tests for previousschoolscomponent
TheSlimvReal May 26, 2021
1816f17
added tests for edit percentage component
TheSlimvReal May 26, 2021
581c88f
added test for edit photo component
TheSlimvReal May 26, 2021
5df742d
moved view-components to entity subrecord
TheSlimvReal May 26, 2021
5166695
added tests for display entity component
TheSlimvReal May 26, 2021
8dd0505
fixed display entity component
TheSlimvReal May 26, 2021
c3ed0d8
using form component to edit recurring activity participatns and groups
TheSlimvReal May 26, 2021
9d4149f
moved all view and edit components to entity utils modul
TheSlimvReal May 26, 2021
6cbfce0
removed unused activity participants section
TheSlimvReal May 26, 2021
7ffe268
refactored entity select component
TheSlimvReal May 26, 2021
e8743c9
changed default date format
TheSlimvReal May 26, 2021
b78f24d
added visible from attribute
TheSlimvReal May 26, 2021
a3fc40c
added visible from attribute
TheSlimvReal May 26, 2021
892fe58
removed unused code
TheSlimvReal May 26, 2021
3ee1a21
fixed prettier errors
TheSlimvReal May 26, 2021
2e7f373
Merge remote-tracking branch 'origin/master' into connect-datatypes-w…
TheSlimvReal May 26, 2021
e2e2110
removed unused method
TheSlimvReal May 31, 2021
c6b743f
added visible from info to aser component
TheSlimvReal May 31, 2021
a9a97ed
added hover effect to table rows
TheSlimvReal May 31, 2021
b2d65b5
made is visible form function more compact
TheSlimvReal May 31, 2021
74c76d9
fixed wrong columns being displayed
TheSlimvReal May 31, 2021
7e5f97f
removed unused files
TheSlimvReal May 31, 2021
58c9ecb
automatically opening a popup when clicking a form
TheSlimvReal Jun 1, 2021
d7f392b
unsing popup as default with possible overwrite for entity subrecord
TheSlimvReal Jun 1, 2021
504ae9c
fixed attendance details component
TheSlimvReal Jun 1, 2021
d4035d0
refactored entity form service
TheSlimvReal Jun 1, 2021
dfa4de2
moved form component
TheSlimvReal Jun 1, 2021
f256f22
always showing tooltip for configurable enum
TheSlimvReal Jun 1, 2021
8c8a0a1
fixed tests
TheSlimvReal Jun 2, 2021
04c0c5e
fixed prettier
TheSlimvReal Jun 2, 2021
0d3c988
using to string method for sorting
TheSlimvReal Jun 2, 2021
09b1bab
added description field to schema
TheSlimvReal Jun 2, 2021
226dade
fixed save behavior of entity-form component and created hook for add…
TheSlimvReal Jun 2, 2021
79567e3
fixed removing and saving problems
TheSlimvReal Jun 2, 2021
4bcb5d2
moved required tag to schema
TheSlimvReal Jun 3, 2021
cff14fd
also allowing simple string arrays to be passed to entity subrecord o…
TheSlimvReal Jun 3, 2021
a1e2626
renamed placeholder to label
TheSlimvReal Jun 3, 2021
60d0e17
fixed some tests
TheSlimvReal Jun 3, 2021
985a01a
allowing default value for edit single component
TheSlimvReal Jun 7, 2021
e847a1b
added service to migrate old configs to new format
TheSlimvReal Jun 7, 2021
cd65919
renamed ext to additional
TheSlimvReal Jun 7, 2021
76e2d1b
fixed tests
TheSlimvReal Jun 8, 2021
a1c325f
Merge branch 'automatic-forms' into config-migration
TheSlimvReal Jun 8, 2021
28e64c6
correctly migrating entity list components
TheSlimvReal Jun 8, 2021
429bc80
implemented migration for entity list
TheSlimvReal Jun 8, 2021
b2fa44b
undone changes to configservice
TheSlimvReal Jun 8, 2021
2a0bdc8
added migration for PreviousSchoolsComponent
TheSlimvReal Jun 8, 2021
3f65cb0
added migration for HistoricalDataComponent
TheSlimvReal Jun 8, 2021
1d76cd7
added migration for ActivityParticipantsSection
TheSlimvReal Jun 8, 2021
70a64d7
saving config after migration
TheSlimvReal Jun 8, 2021
4b4ce16
added migration to admin component
TheSlimvReal Jun 9, 2021
f2c21d4
added migration for PreviousTeamsComponent
TheSlimvReal Jun 9, 2021
1b9f12e
refactor: move photo path logic to service
sleidig Jun 9, 2021
a074965
added migration for all components using displayedColumns
TheSlimvReal Jun 9, 2021
d93a054
fixed default value
TheSlimvReal Jun 9, 2021
103f6f6
added documentation
TheSlimvReal Jun 9, 2021
22d5929
Merge remote-tracking branch 'origin/child-photo-improvement' into ch…
TheSlimvReal Jun 9, 2021
ee6637c
only save changed objects after photo migration
sleidig Jun 14, 2021
5341d91
Merge branch 'master' into child-photo-improvement
sleidig Jun 14, 2021
ac861a2
Merge branch 'child-photo-improvement' into connect-datatypes-with-co…
sleidig Jun 14, 2021
5c80fcf
Merge branch 'master' into connect-datatypes-with-components
sleidig Jun 14, 2021
77c6028
avoid merge changes
sleidig Jun 16, 2021
1277e76
Merge branch 'master' into connect-datatypes-with-components
sleidig Jun 23, 2021
c804102
move paginator component to entity-subrecord where it is actually needed
sleidig Jun 23, 2021
f48c987
refactored validation function
TheSlimvReal Jun 23, 2021
4f76655
Merge remote-tracking branch 'origin/connect-datatypes-with-component…
TheSlimvReal Jun 24, 2021
dbb296f
fixed unit tests
TheSlimvReal Jun 24, 2021
bc64417
fixed unit tests
TheSlimvReal Jun 24, 2021
268acc8
fixed member ordering
TheSlimvReal Jun 24, 2021
e50eaaf
added tests for entity validation
TheSlimvReal Jun 24, 2021
3d1ebb9
fixed failing test
TheSlimvReal Jun 24, 2021
bacd2a0
refactored reading and math levels
TheSlimvReal Jun 24, 2021
295ebbd
Merge branch 'connect-datatypes-with-components' into automatic-forms
sleidig Jun 24, 2021
e805019
refactored gender as configurable enum
TheSlimvReal Jun 24, 2021
95893d6
refactored material types
TheSlimvReal Jun 24, 2021
4f3126b
added migrations for the new configurable enums
TheSlimvReal Jun 24, 2021
9b4cbda
added test for ensuring that the new enums are available
TheSlimvReal Jun 24, 2021
f66e367
made warning level configurable enum
TheSlimvReal Jun 24, 2021
d4706d2
added migration for input select
TheSlimvReal Jun 25, 2021
1b0adbf
removed edit selectable component
TheSlimvReal Jun 25, 2021
d615682
fix wrong selector name
TheSlimvReal Jun 25, 2021
7fcf16c
added edit number component
TheSlimvReal Jun 25, 2021
2645317
added boolean datatype
TheSlimvReal Jun 25, 2021
ce52590
applied changes according to the review
TheSlimvReal Jun 25, 2021
8877d63
cleaned up display entity array component
TheSlimvReal Jun 25, 2021
e8a7c78
added pipe to reduce change detection cycles
TheSlimvReal Jun 25, 2021
57971d9
fixed tests
TheSlimvReal Jun 28, 2021
412b9b8
fixed error message when no edit component is defined
TheSlimvReal Jun 28, 2021
e6599b6
fixed failing test
TheSlimvReal Jun 28, 2021
dd51ada
fixed prettier
TheSlimvReal Jun 28, 2021
6f157cb
fixed property assignment problem
TheSlimvReal Jun 28, 2021
ff74a0e
added further documentation
TheSlimvReal Jun 28, 2021
c9ad459
opening details popup in edit mode
TheSlimvReal Jun 28, 2021
32a9220
overworked saving process of popups
TheSlimvReal Jun 28, 2021
afb024b
fixed some runtime problems
TheSlimvReal Jun 28, 2021
e846cfa
fixed failing tests
TheSlimvReal Jun 28, 2021
cf050b3
Merge pull request #834 from Aam-Digital/automatic-forms
TheSlimvReal Jun 28, 2021
f6cb065
Merge pull request #849 from Aam-Digital/config-migration
TheSlimvReal Jun 28, 2021
7245f6b
Merge remote-tracking branch 'origin/master' into connect-datatypes-w…
TheSlimvReal Jun 28, 2021
acefa9c
Merge branch 'connect-datatypes-with-components' into review-fixes
TheSlimvReal Jun 28, 2021
90fff42
some minor fixes
TheSlimvReal Jun 29, 2021
19adcc7
undoing warning-level changes
TheSlimvReal Jun 30, 2021
97adb65
undone changes to warning level
TheSlimvReal Jun 30, 2021
f6a8131
made select migration less complex
TheSlimvReal Jun 30, 2021
bd84a4d
adapted warning levels for note details
TheSlimvReal Jun 30, 2021
4d0da85
entity copy is moved into the form service
TheSlimvReal Jun 30, 2021
403e6d7
fixed tests
TheSlimvReal Jun 30, 2021
8b85091
fixed prettier
TheSlimvReal Jun 30, 2021
f0ca8aa
fixed bug when migrating genders
TheSlimvReal Jun 30, 2021
4dfca83
fixed bug in filter functions
TheSlimvReal Jun 30, 2021
a45e6c0
Connect Datatype Review Improvements (#866)
TheSlimvReal Jun 30, 2021
8dbb469
simplify child fields for health
sleidig Jun 30, 2021
f74dd5e
removing label and display text components
TheSlimvReal Jul 1, 2021
501b430
updating input entity
TheSlimvReal Jul 1, 2021
f894c4b
changed the saved lables
TheSlimvReal Jul 1, 2021
aedd6c7
fixed assignedTo conversion
TheSlimvReal Jul 1, 2021
acb4a66
fixed bug where for configurable enum filters
TheSlimvReal Jul 1, 2021
24e4353
moved sorting accessor
TheSlimvReal Jul 1, 2021
bfdaf39
fixed filtering accessor
TheSlimvReal Jul 1, 2021
975c0d6
fixed entity-form story
TheSlimvReal Jul 1, 2021
e8f1f3f
fixed changed after has been checked error
TheSlimvReal Jul 2, 2021
c6b6031
fixed boolean filter default issue
TheSlimvReal Jul 2, 2021
ee20f7c
Merge branch 'review-fixes' into connect-datatypes-with-components
TheSlimvReal Jul 2, 2021
9e2df4a
fixed boolean filter default issue
TheSlimvReal Jul 2, 2021
3d0a7f5
Merge branch 'master' into connect-datatypes-with-components
TheSlimvReal Jul 2, 2021
d86d7cf
updated entity subrecord documentation
TheSlimvReal Jul 2, 2021
b9873e5
added documentation for schema system
TheSlimvReal Jul 2, 2021
4a87530
updated documentation for config system
TheSlimvReal Jul 2, 2021
96ae9dd
added migration for assignedTo filters
TheSlimvReal Jul 2, 2021
26f0d4a
Merge remote-tracking branch 'origin/connect-datatypes-with-component…
TheSlimvReal Jul 2, 2021
68d7abd
hide entity-select input field when disabled while still avoiding cha…
sleidig Jul 2, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
242 changes: 33 additions & 209 deletions doc/compodoc_sources/concepts/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ List components showing data in a table (such as ChildrenList oder SchoolsList)

The `"title"` is the text shown in the heading of the component.

`"columns"` contains an array of the columns to be displayed. Each column-entry has the three fields `"component"`, `"title"` and `"id"`.
`"columns"` contains an array of the columns to be displayed.
The configuration for the columns happens with the [FormFieldConfiguration](../../interfaces/FormFieldConfig.html) interface.
If all the information is available on the schema or through the datatype of a property, it is sufficient to put a string with the name of the property into the columns array.

Example:
```
Expand All @@ -154,24 +156,21 @@ Example:
"config": {
"title": "Children List",
"columns": [
{
"component": "DisplayText",
"title": "PN",
"id": "projectNumber"
},
{
"component": "ChildBlock",
"title": "Name",
"id": "name"
}
"projectNumber",
{
"view": "ChildBlock",
"label": "Name",
"id": "name"
},
...
```

The `"columnGroup"` object holds the three properties `"default"`, `"mobile"` and `"groups"`.
`"default"` and `"mobile"` hold the names of the group of columns being displayed by default or on a mobile device.
If the `"columnGroup"` property is not defined, all columns will be displayed.
If `"default"` or `"mobile"` is not defined, the first entry of `"groups"` will be used.
`"groups"` consists of an array of groups of columns, where every entry has a `"name"` and an array of column names within `"columns"`.
`"groups"` consists of an array of groups of columns, where every entry has a `"name"` and an array of column ids within `"columns"`.
Properties that are listed in any of the `groups` arrays and don't require further configurations, can be omitted from the `columns` array, the `EntityListComponent` will automatically add them.

Example:
```
Expand Down Expand Up @@ -200,13 +199,10 @@ Example:
```

The object `"filters"` within the config of a list component can be used to create filter options for the list data.
Currently, three types of filters exist: default, boolean and prebuilt.
For default and boolean filters, the `"id"` field refers to an attribute of the entity which is displayed in the list.
The default filter only requires the field `"id"` and will provide filter options for all possible values of this property.
A boolean filter can be specified with `"type": "boolean"` and requires the fields `"id"`, `"default"`, `"true"`, `"false"` and `"all"` to be set.
The type of filter will be automatically determined by the datatype of that property.
The filters allow to filter the table by the possible values of a property.
This will create a filter for boolean values with three buttons (`all`, `true`, `false`).
The names of these buttons can be specified using the `"true"`, `"false"` and `"all"` option.
The `"default"` options defines which button should be active on default and has to be `""`, `"true"` or `"false"`.
The prebuilt option is used to enable or disable filters that contain more logic and are implemented inside the component which is displayed.
This option requires the fields `"type"` and `"id"`, where `"id"` matched the `id` of a prebuilt filter inside a component.

Expand All @@ -218,8 +214,7 @@ Example:
},
{
"id": "privateSchool",
"type": "boolean",
"default": "",
"default": "all",
"true": "Private School",
"false": "Government School",
"all": "All"
Expand Down Expand Up @@ -283,61 +278,22 @@ It allows to dynamically create a form through configuration.
The configuration for this component expects a single field, the `"cols"`.
This field should be a two dimensional array where the first dimension defines what is rendered next to each other (the columns), and the second dimension what is rendered in each column.
If all fields are the same height, then every field can be defined as a column.
The inner object can have the following but not always required fields: `"input"`, `"id"`, `"placeholder"`, `"required"`, `"options"` and `"enumId"`.
`"input"` defines which input type should be used.
`"id"` defines the entity attribute which should be displayed and modified.
`"placeholder"` defines a value that is displayed if no value is present.
`"required"` specifies whether a value is required, default is `false`.
`"options"` is only required when `"input": "select"` and defines the available select options.
`"enumId"` is only required when `"input": "configurable-enum-select"` and refers to the config id of the enum that should be used for the select options.
The definitions for the columns is defined by the [FormFieldConfiguration](../../interfaces/FormFieldConfig.html)
However, the schema definitions of the entity should be sufficient so that only the names of the properties which should be editable in the form have to be provided.
This means instead of placing an object in the `cols` array, simple strings do the same job.

```
"config": {
"cols": [
[
{
"input": "photo",
"id": "photoFile",
"placeholder": "Photo Filename"
}
"photo"
],
[
{
"input": "text",
"id": "name",
"placeholder": "Name",
"required": true
},
{
"input": "text",
"id": "projectNumber",
"placeholder": "Project Number"
}
"name"
"projectNumber"
],
[
{
"input": "age"
},
{
"input": "datepicker",
"id": "dateOfBirth",
"placeholder": "Date of Birth"
},
{
"input": "select",
"id": "gender",
"placeholder": "Gender",
"options": [
"M",
"F"
],
},
{
"input": "configurable-enum-select",
"id": "has_aadhar",
"placeholder": "Aadhar Status",
"enumId": "document-status"
},
"dateOfBirth"
]
]
}
Expand All @@ -349,23 +305,20 @@ It can be configured which attributes of the `ChildSchoolRelation` are shown in
Possible configurations are `single` and `columns` which are both optional.
`single` is a boolean and if is set to `true` the component will show which (if any) school the child is currently attending.
This should only be set to `true`, when the use-case only allows one active school per child.
`columns` is an object and determines which columns are shown and how the columns are called.
If `columns` is set, then `schoolId`, `start` and `end` need to be defined.
`schoolClass` and `result` are optional.
The value of a field determines the name of the column, e.g. setting `schoolId: School` will give the column which displays the schools the name `School`.
If `schoolClass` or `result` is not defined, then the respective column will not be visible.
`columns` is an object and determines which columns of the `ChildSchoolRelation` are shown.
The configuration is according to the [EntitySubrecordComponent](../how-to-guides/entity-subrecord-component.md);

Example:
```
"config": {
"single": true,
"columns": {
"schoolId": "School",
"schoolClass": "Class",
"start": "From",
"end": "To",
"result": "Result"
}
"columns": [
"schoolId",
"schoolClass",
"start",
"end",
"result",
],
}
```

Expand All @@ -381,10 +334,10 @@ Example:
```
"entity:Child": {
"attributes": [
{"name": "address", "schema": { "dataType": "string" } },
{"name": "phone", "schema": { "dataType": "string" } },
{"name": "address", "schema": { "dataType": "string", "label": "Address" } },
{"name": "phone", "schema": { "dataType": "string", "label": "Phone number" } },
...
{"name": "health_lastDeworming", "schema": { "dataType": "Date" } }
{"name": "health_lastDeworming", "schema": { "dataType": "Date", "label": "Last deworming" } }
]
}

Expand Down Expand Up @@ -555,132 +508,3 @@ Example:
"countAs": "IGNORE"
}
```


-----
## Example

An example of a full config file:

```
{
"navigationMenu": {
"items": [
{"name": "Dashboard", "icon": "home", "link": "/dashboard"},
{"name": "Children", "icon": "child", "link": "/child"},
{"name": "Schools", "icon": "university", "link": "/school"},
{"name": "Notes", "icon": "file-text", "link": "/note"},
{"name": "Attendance Register", "icon": "table", "link": "/attendance"},
{"name": "Admin", "icon": "wrench", "link": "/admin"},
{"name": "Users", "icon": "user", "link": "/users"},
{"name": "Database Conflicts", "icon": "wrench", "link": "/admin/conflicts"},
{"name": "Help", "icon": "question-circle", "link": "/help"}
]
},
"notes": {
"InteractionTypes": {
"NONE": {"name": ""},
"HOME_VISIT": {"name": "Home Visit"},
"GUARDIAN_TALK": {"name": "Talk with Guardians"},
"CHILD_TALK": {"name": "Talk with Child"},
"INCIDENT": {"name": "Incident"},
"DISCUSSION": {"name": "Discussion/Decision", "color": "#E1BEE7"},
"VISIT": {"name": "School/Hostel Visit"},
"PHONE_CALL": {"name": "Phone Call"},
"COACHING_TALK": {"name": "Talk with Coaching Teacher"},
"PEER_TALK": {"name": "Talk with Peer"},
"NEIGHBOUR_TALK": {"name": "Talk with Neighbours"},
"GUARDIAN_MEETING": {"name": "Guardians' Meeting", "color": "#E1F5FE", "isMeeting": true},
"CHILDREN_MEETING": {"name": "Children's Meeting", "color": "#E1F5FE", "isMeeting": true},
"DAILY_ROUTINE": {"name": "Daily Routine", "color": "#F1F8E9"},
"ANNUAL_SURVEY": {"name": "Annual Survey", "color": "#FFFDE7"},
"EXCURSION": {"name": "Excursion/Trip", "color": "#E1F5FE", "isMeeting": true},
"PARTNER_CONTACT": {"name": "Contact with other partners (club/NGO/...)"},
"RATION_DISTRIBUTION": {"name": "Ration Distribution", "color": "#E1F5FE", "isMeeting": true}
}
},
"view:": {
"component": "Dashboard",
"config": {
"widgets": [
{
"component": "ChildrenCountDashboard"
},
{
"component": "RecentNotesDashboard"
},
{
"component": "NoRecentNotesDashboard",
"config": {
"sinceDays": 28,
"fromBeginningOfWeek": false
}
},
{
"component": "AttendanceWeekDashboard",
"config": {
"daysOffset": 0,
"periodLabel": "last week"
}
},
{
"component": "AttendanceWeekDashboard",
"config": {
"daysOffset": 7,
"periodLabel": "this week"
}
},
{
"component": "ProgressDashboard",
"config": {
"dashboardConfigId": "1"
}
},
{
"component": "AttendanceAverageDashboard"
},
{
"component": "AttendanceWarningsDashboard"
}
]
}
},
"view:user": {"component": "UserAccount"},
"view:note": {"component": "NotesManager", "config": { "title": "Notes & Reports"}},
"view:admin": {"component": "Admin", "requiresAdmin": true},
"view:users": {"component": "UserList", "requiresAdmin": true},
"view:help": {"component": "Help"},
"view:attendance": {"component": "AttendanceManager"},
"view:attendance/analysis": {"component": "AttendanceAnalysis"},
"view:attendance/add/month": {"component": "AddMonthAttendance"},
"view:attendance/add/day": {"component": "AddDayAttendance"},

"view:school": {"component": "SchoolsList", "config": { "title": "Schools List"} },
"view:school/:id": {
"component": "SchoolDetails",
"config": {
"submenu": [
{
"name": "Education",
"components": ["previousSchools", "aserResults"]
}
],
"icon": "university"
}
},
"view:child": {"component": "ChildrenList", "config": { "title": "Children List"} },
"view:child/:id": {
"component": "ChildDetails",
"config": {
"submenu": [
{
"name": "Education",
"components": ["previousSchools", "aserResults"]
}
],
"icon": "child"
}
}
}

```
21 changes: 12 additions & 9 deletions doc/compodoc_sources/concepts/entity-schema-system.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# Entity Schema
> THIS DOCUMENT IS STILL WORK IN PROGRESS AND WILL BE CONTINUOUSLY UPDATED AS THE DESIGN OF THE SYSTEM EVOLVES

-----

An example of a schema definition:
Expand All @@ -21,22 +19,27 @@ class Note extends Entity {
The logical flow looks something like this:
1. Entities are requested through the `EntityMapperService` (`entityMapper.load(...)`)
2. The `EntitySchemaService` functions as a helper to the `EntityMapperService`
and takes care of data transformations based on the schema of that Entity type.
3. Data from the database is "loaded" into an Entity instance to combine the raw data
with its Entity class by the `EntityMapperService` together with the `EntitySchemaService`.
4. The Entity classes themselves only define the schema through the `@DatabaseEntity` and `@DatabaseField` decorators
and takes care of data transformations based on the schema of that entity type.
3. Data from the database is "loaded" into an entity instance to combine the raw data
with its entity class by the `EntityMapperService` together with the `EntitySchemaService`.
4. The entity classes themselves only define the schema through the `@DatabaseEntity` and `@DatabaseField` decorators
and are otherwise simple Typescript objects.

The process of saving an Entity to the database works similarly with `EntitySchemaService`
The process of saving an entity to the database works similarly with `EntitySchemaService`
supporting the `EntityMapperService` and transforming the entity object into the desired format to be persisted into the database.


-----



`EntitySchemaService` keeps a registry of "data types",
i.e. transformation functions that will be called for a specific schema field's dataType.

Basic data transformations for `string`, `number`, `date` and `month` are supported by default.
You can register your own transformations by injecting the `EntitySchemaService` and using its `registerSchemaDatatype()` method.

## Schema options

The schema definitions contains information regarding the schema transformation as well as how a property can be displayed.
The [EntitySchemaField](../../interfaces/EntitySchemaField.html) interface shows all configuration options.
If the `editComponent` and the `viewComponent` are not set, the default components of this property's datatype will be used.
The `description` field allows adding further explanation which will be displayed as a tooltip.
Loading