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

Generalized RelatedEntitiesWithSummary (from EducationalMaterialComponent) #2029

Merged
merged 7 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
6 changes: 3 additions & 3 deletions src/app/child-dev-project/children/children-components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ export const childrenComponents: ComponentTuple[] = [
).then((c) => c.ChildrenBmiDashboardComponent),
],
[
"EducationalMaterial",
"RelatedEntitiesWithSummary",
() =>
import(
"./educational-material/educational-material-component/educational-material.component"
).then((c) => c.EducationalMaterialComponent),
"../../core/entity-details/related-entities-with-summary/related-entities-with-summary.component"
).then((c) => c.RelatedEntitiesWithSummaryComponent),
],
[
"BmiBlock",
Expand Down

This file was deleted.

This file was deleted.

20 changes: 15 additions & 5 deletions src/app/core/config/config-fix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -706,14 +706,24 @@ export const defaultJsonConfig = {
"components": [
{
"title": "",
"component": "EducationalMaterial",
"component": "RelatedEntitiesWithSummary",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Migration required

"config": {
"summaries": {
total: true,
average: true,
"entityType": EducationalMaterial.ENTITY_TYPE,
"property": "child",
"columns": [
{ "id": "date", "visibleFrom": "xs" },
{ "id": "materialType", "visibleFrom": "xs" },
{ "id": "materialAmount", "visibleFrom": "md" },
{ "id": "description", "visibleFrom": "md" },
],
"summaries": {
"countProperty": "materialAmount",
"groupBy": "materialType",
"total": true,
"average": false
}
}
}
}
]
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<app-entity-subrecord
[records]="data"
[filter]="filter"
[columns]="columns"
[newRecordFactory]="createNewRecordFactory()"
[isLoading]="isLoading"
></app-entity-subrecord>

<div class="margin-top-large">
<ng-container *ngIf="summary">
sleidig marked this conversation as resolved.
Show resolved Hide resolved
<strong i18n>Total:</strong> {{ summary }} <br />
</ng-container>
<ng-container *ngIf="avgSummary">
<strong i18n>Average:</strong> {{ avgSummary }} <br />
</ng-container>
</div>
Loading