Compare commits

..

3 Commits

9 changed files with 30 additions and 35 deletions

View File

@@ -0,0 +1,6 @@
kind: Fixed
body: Do not suggest a user that is no longer active in the activity form.
time: 2025-12-01T18:58:59.410998029+01:00
custom:
Issue: "475"
SchemaChange: No schema change

View File

@@ -1,6 +0,0 @@
kind: Fixed
body: Remove double display of person id in the banner when there is a deathdate
time: 2025-12-03T11:38:32.653635449+01:00
custom:
Issue: "441"
SchemaChange: No schema change

View File

@@ -103,7 +103,7 @@ const store = createStore({
}
// console.log("suggested users", suggestedUsers);
return suggestedUsers;
return suggestedUsers.filter((u) => u.enabled === true);
},
suggestedResources(state) {
// const resources = state.activity.accompanyingPeriod.resources;

View File

@@ -52,36 +52,31 @@ interface BaseMetadataWithHtml extends BaseMetadata {
html: string;
}
export interface GenericDocForAccompanyingCourseDocument
extends GenericDocForAccompanyingPeriod {
export interface GenericDocForAccompanyingCourseDocument extends GenericDocForAccompanyingPeriod {
key: "accompanying_course_document";
metadata: BaseMetadataWithHtml;
storedObject: StoredObject;
}
export interface GenericDocForAccompanyingCourseActivityDocument
extends GenericDocForAccompanyingPeriod {
export interface GenericDocForAccompanyingCourseActivityDocument extends GenericDocForAccompanyingPeriod {
key: "accompanying_course_activity_document";
metadata: BaseMetadataWithHtml;
storedObject: StoredObject;
}
export interface GenericDocForAccompanyingCourseCalendarDocument
extends GenericDocForAccompanyingPeriod {
export interface GenericDocForAccompanyingCourseCalendarDocument extends GenericDocForAccompanyingPeriod {
key: "accompanying_course_calendar_document";
metadata: BaseMetadataWithHtml;
storedObject: StoredObject;
}
export interface GenericDocForAccompanyingCoursePersonDocument
extends GenericDocForAccompanyingPeriod {
export interface GenericDocForAccompanyingCoursePersonDocument extends GenericDocForAccompanyingPeriod {
key: "person_document";
metadata: BaseMetadataWithHtml;
storedObject: StoredObject;
}
export interface GenericDocForAccompanyingCourseWorkEvaluationDocument
extends GenericDocForAccompanyingPeriod {
export interface GenericDocForAccompanyingCourseWorkEvaluationDocument extends GenericDocForAccompanyingPeriod {
key: "accompanying_period_work_evaluation_document";
metadata: BaseMetadataWithHtml;
storedObject: StoredObject;

View File

@@ -46,8 +46,7 @@ export interface StoredObjectVersionCreated extends StoredObjectVersion {
persisted: false;
}
export interface StoredObjectVersionPersisted
extends StoredObjectVersionCreated {
export interface StoredObjectVersionPersisted extends StoredObjectVersionCreated {
version: number;
id: number;
createdAt: DateTime | null;
@@ -61,8 +60,7 @@ export interface StoredObjectStatusChange {
type: string;
}
export interface StoredObjectVersionWithPointInTime
extends StoredObjectVersionPersisted {
export interface StoredObjectVersionWithPointInTime extends StoredObjectVersionPersisted {
"point-in-times": StoredObjectPointInTime[];
"from-restored": StoredObjectVersionPersisted | null;
}

View File

@@ -20,8 +20,7 @@ export interface TransportExceptionInterface {
name: string;
}
export interface ValidationExceptionInterface
extends TransportExceptionInterface {
export interface ValidationExceptionInterface extends TransportExceptionInterface {
name: "ValidationException";
error: object;
violations: string[];
@@ -41,8 +40,7 @@ export interface AccessExceptionInterface extends TransportExceptionInterface {
violations: string[];
}
export interface NotFoundExceptionInterface
extends TransportExceptionInterface {
export interface NotFoundExceptionInterface extends TransportExceptionInterface {
name: "NotFoundException";
}
@@ -53,8 +51,7 @@ export interface ServerExceptionInterface extends TransportExceptionInterface {
body: string;
}
export interface ConflictHttpExceptionInterface
extends TransportExceptionInterface {
export interface ConflictHttpExceptionInterface extends TransportExceptionInterface {
name: "ConflictHttpException";
violations: string[];
}

View File

@@ -41,6 +41,7 @@ class UserNormalizer implements ContextAwareNormalizerInterface, NormalizerAware
'isAbsent' => false,
'absenceStart' => null,
'absenceEnd' => null,
'enabled' => true,
];
public function __construct(private readonly UserRender $userRender, private readonly ClockInterface $clock) {}
@@ -108,6 +109,7 @@ class UserNormalizer implements ContextAwareNormalizerInterface, NormalizerAware
'isAbsent' => $object->isAbsent(),
'absenceStart' => $this->normalizer->normalize($object->getAbsenceStart(), $format, $absenceDatesContext),
'absenceEnd' => $this->normalizer->normalize($object->getAbsenceEnd(), $format, $absenceDatesContext),
'enabled' => $object->isEnabled(),
];
if ('docgen' === $format) {

View File

@@ -103,6 +103,7 @@ final class UserNormalizerTest extends TestCase
'main_center' => ['context' => Center::class],
'absenceStart' => ['context' => \DateTimeImmutable::class],
'absenceEnd' => ['context' => \DateTimeImmutable::class],
'enabled' => true
]];
yield [$userNoPhone, 'docgen', ['docgen:expects' => User::class],
@@ -124,6 +125,7 @@ final class UserNormalizerTest extends TestCase
'main_center' => ['context' => Center::class],
'absenceStart' => ['context' => \DateTimeImmutable::class],
'absenceEnd' => ['context' => \DateTimeImmutable::class],
'enabled' => true
]];
yield [null, 'docgen', ['docgen:expects' => User::class], [
@@ -144,6 +146,7 @@ final class UserNormalizerTest extends TestCase
'main_center' => ['context' => Center::class],
'absenceStart' => null,
'absenceEnd' => null,
'enabled' => true
]];
}
}

View File

@@ -81,25 +81,25 @@
</div>
{%- if options['addInfo'] -%}
<p class="moreinfo">
{% if person.gender is not null %}{{ person.gender.icon|chill_entity_render_box }} {% endif %}
{% if person.gender is not null %}{{ person.gender.icon|chill_entity_render_box }}{% endif %}
{%- if person.deathdate is not null -%}
{%- if person.birthdate is not null -%}
{# must be on one line to avoid spaces with dash #}
<time datetime="{{ person.birthdate|date('Y-m-d') }}" title="{{ 'birthdate'|trans|e('html_attr') }}">{{ person.birthdate|format_date("medium") }}</time>&#x2013;
{%- else -%}
<span>{{ 'Date of death'|trans }}: </span>
{{ 'Date of death'|trans }}:
{%- endif -%}
{#- must be on one line to avoid spaces with dash -#}
<time datetime="{{ person.deathdate|date('Y-m-d') }}" title="{{ 'deathdate'|trans }}">{{ person.deathdate|format_date("medium") }}</time>
{%- if options['addAge'] -%}
<span class="age">&nbsp;{{ 'years_old'|trans({ 'age': person.age }) }}</span>
{%- endif -%}
{# {%- if options['addId'] -%}#}
{# {%- set personId = person|chill_person_id_render_text %}#}
{# <span class="id-number" title="{{ 'Person'|trans ~ ' ' ~ personId }}">#}
{# ({{ personId }})#}
{# </span>#}
{# {%- endif -%}#}
{%- if options['addId'] -%}
{%- set personId = person|chill_person_id_render_text %}
<span class="id-number" title="{{ 'Person'|trans ~ ' ' ~ personId }}">
({{ personId }})
</span>
{%- endif -%}
{%- elseif person.birthdate is not null -%}
<time datetime="{{ person.birthdate|date('Y-m-d') }}" title="{{ 'Birthdate'|trans }}">
{{ 'Born the date'|trans({'gender': person.gender ? person.gender.genderTranslation.value : 'neutral',