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

Fix unrelated changes #2196

Merged
merged 34 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
6f2432a
added test for adding unrelated note
TheSlimvReal Jan 23, 2024
821972a
`loadData` function returns result instead of initializing it and ren…
TheSlimvReal Jan 23, 2024
454d313
using same filter logic to initialize data and pass to entities table
TheSlimvReal Jan 23, 2024
c86df39
some code cleanups
TheSlimvReal Jan 23, 2024
b90f7a9
added related property for related notes
TheSlimvReal Jan 23, 2024
3fa13de
inferring related property
TheSlimvReal Jan 23, 2024
473d6b4
added multi property support
TheSlimvReal Jan 23, 2024
e5e4ebe
removed overwrites of `property`
TheSlimvReal Jan 23, 2024
c54ef74
using different approach to update table summary
TheSlimvReal Jan 23, 2024
5a61f1d
updated documentation
TheSlimvReal Jan 23, 2024
9e894dd
correctly setting showInactive toggle in child school overview
TheSlimvReal Jan 23, 2024
0dc0c09
using placeholder instead of new record factory
TheSlimvReal Jan 23, 2024
f030a6a
added todos
TheSlimvReal Jan 23, 2024
b392171
removed unnecessary sorts
TheSlimvReal Jan 24, 2024
4ada0ed
removed unnecessary data filter
TheSlimvReal Jan 24, 2024
4340bc0
not using properties in tests
TheSlimvReal Jan 24, 2024
cdfbfa6
generalized newRecordFactory
TheSlimvReal Jan 24, 2024
366f4c6
aligned new record factory names
TheSlimvReal Jan 24, 2024
48975c1
fixed color highlighting for child school overview
TheSlimvReal Jan 24, 2024
5a16564
small cleanups
TheSlimvReal Jan 24, 2024
2957df5
code cleanups
TheSlimvReal Jan 24, 2024
bbc96e9
Update src/app/core/entity-details/related-entities/related-entities.…
TheSlimvReal Jan 31, 2024
f5ccc48
Merge branch 'master' into fix_unrelated_changes
TheSlimvReal Feb 1, 2024
0e1c6c6
fixed setting of invalid properties
TheSlimvReal Feb 1, 2024
3ef41a2
Merge branch 'master' into fix_unrelated_changes
TheSlimvReal Feb 1, 2024
8791493
added option to set relation property
TheSlimvReal Feb 2, 2024
209e4aa
added fallback handling to Todos list if multiple related properties …
TheSlimvReal Feb 2, 2024
ada0e08
fixed tests
TheSlimvReal Feb 2, 2024
4fccb15
Merge branch 'master' into fix_unrelated_changes
sleidig Feb 2, 2024
1e6ca4e
remove AserComponent in favor of simple RelatedEntities
sleidig Feb 2, 2024
e58e78d
remove Health and BMI related components in favor of generic RelatedE…
sleidig Feb 2, 2024
c5d4248
Merge remote-tracking branch 'origin/master' into fix_unrelated_changes
sleidig Feb 2, 2024
25d2982
improved doc
TheSlimvReal Feb 5, 2024
51daedd
Merge branch 'master' into fix_unrelated_changes
TheSlimvReal Feb 5, 2024
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
7 changes: 4 additions & 3 deletions doc/compodoc_sources/concepts/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,12 +265,13 @@ The component configuration requires another `"title"`, the `"component"` that s
"title": "Education",
"components": [
{
"title": "SchoolHistory",
"title": "School History",
"component": "PreviousSchools"
},
{
"title": "ASER Results",
"component": "Aser"
"title": "Literacy Test Results",
"component": "RelatedEntities",
"config": {}
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export class ActivitiesOverviewComponent
implements OnInit
{
entityCtr = RecurringActivity;
property = "linkedGroups";

titleColumn: FormFieldConfig = {
id: "title",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import { EntitiesTableComponent } from "../../../core/common-components/entities
standalone: true,
})
export class AttendanceDetailsComponent {
@Input() entity: ActivityAttendance = new ActivityAttendance();
@Input() entity: ActivityAttendance;
@Input() forChild: string;
EventNote = EventNote;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ describe("AttendanceService", () => {

const childAttendingSchool = new ChildSchoolRelation();
childAttendingSchool.childId = "child attending school";
const mockQueryRelationsOf = spyOn(
const mockQueryRelations = spyOn(
TestBed.inject(ChildrenService),
"queryActiveRelationsOf",
).and.resolveTo([childAttendingSchool]);
Expand All @@ -298,10 +298,7 @@ describe("AttendanceService", () => {

const event = await service.createEventForActivity(activity, date);

expect(mockQueryRelationsOf).toHaveBeenCalledWith(
linkedSchool.getId(),
date,
);
expect(mockQueryRelations).toHaveBeenCalledWith(linkedSchool.getId(), date);
expect(event.children).toHaveSize(2);
expect(event.children).toContain(directlyAddedChild.getId());
expect(event.children).toContain(childAttendingSchool.childId);
Expand Down

This file was deleted.

This file was deleted.

28 changes: 0 additions & 28 deletions src/app/child-dev-project/children/children-components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,39 +23,11 @@ export const childrenComponents: ComponentTuple[] = [
"./children-list/recent-attendance-blocks/recent-attendance-blocks.component"
).then((c) => c.RecentAttendanceBlocksComponent),
],
[
"Aser",
() =>
import("./aser/aser-component/aser.component").then(
(c) => c.AserComponent,
),
],
[
"ChildBlock",
() =>
import("./child-block/child-block.component").then(
(c) => c.ChildBlockComponent,
),
],
[
"ChildrenBmiDashboard",
() =>
import(
"./health-checkup/children-bmi-dashboard/children-bmi-dashboard.component"
).then((c) => c.ChildrenBmiDashboardComponent),
],
[
"BmiBlock",
() =>
import("./health-checkup/bmi-block/bmi-block.component").then(
(c) => c.BmiBlockComponent,
),
],
[
"HealthCheckup",
() =>
import(
"./health-checkup/health-checkup-component/health-checkup.component"
).then((c) => c.HealthCheckupComponent),
],
];
16 changes: 2 additions & 14 deletions src/app/child-dev-project/children/children.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Child } from "./model/child";
import { EntityMapperService } from "../../core/entity/entity-mapper/entity-mapper.service";
import { Note } from "../notes/model/note";
import { ChildSchoolRelation } from "./model/childSchoolRelation";
import { HealthCheck } from "./health-checkup/model/health-check";
import moment, { Moment } from "moment";
import { DatabaseIndexingService } from "../../core/entity/database-indexing/database-indexing.service";
import { Entity } from "../../core/entity/model/entity";
Expand Down Expand Up @@ -212,7 +211,7 @@ export class ChildrenService {
if (!Array.isArray(doc.children) || !doc.date) return;
if (doc.date.length === 10) {
emit(doc.date);
} else {
} else {
var d = new Date(doc.date || null);
emit(d.getFullYear() + "-" + String(d.getMonth()+1).padStart(2, "0") + "-" + String(d.getDate()).padStart(2, "0"));
}
Expand Down Expand Up @@ -240,7 +239,7 @@ export class ChildrenService {
var dString;
if (doc.date && doc.date.length === 10) {
dString = doc.date;
} else {
} else {
var d = new Date(doc.date || null);
dString = d.getFullYear() + "-" + String(d.getMonth()+1).padStart(2, "0") + "-" + String(d.getDate()).padStart(2, "0");
}
Expand All @@ -263,15 +262,4 @@ export class ChildrenService {
}`,
};
}

/**
*
* @param childId should be set in the specific components and is passed by the URL as a parameter
* This function should be considered refactored and should use a index, once they're made generic
*/
getHealthChecksOfChild(childId: string): Promise<HealthCheck[]> {
return this.entityMapper
.loadType(HealthCheck)
.then((res) => res.filter((h) => h.child === childId));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ import { Entity } from "../../../../core/entity/model/entity";
import { DatabaseEntity } from "../../../../core/entity/database-entity.decorator";
import { DatabaseField } from "../../../../core/entity/database-field.decorator";
import { ConfigurableEnumValue } from "../../../../core/basic-datatypes/configurable-enum/configurable-enum.interface";
import { EntityDatatype } from "../../../../core/basic-datatypes/entity/entity.datatype";
import { Child } from "../../model/child";
import { PLACEHOLDERS } from "../../../../core/entity/schema/entity-schema-field";

@DatabaseEntity("EducationalMaterial")
export class EducationalMaterial extends Entity {
Expand All @@ -28,14 +30,15 @@ export class EducationalMaterial extends Entity {
}

@DatabaseField({
dataType: "entity",
dataType: EntityDatatype.dataType,
additional: Child.ENTITY_TYPE,
entityReferenceRole: "composite",
})
child: string;

@DatabaseField({
label: $localize`:Date on which the material has been borrowed:Date`,
defaultValue: PLACEHOLDERS.NOW,
})
date: Date;

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading