Do not suggest a user that is no longer active within the activity form

This commit is contained in:
2025-12-01 18:59:55 +01:00
parent 0caad2b7cd
commit 9375580907
3 changed files with 12 additions and 4 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,8 +1,8 @@
import "es6-promise/auto";
import { createStore } from "vuex";
import { postLocation } from "./api";
import {createStore} from "vuex";
import {postLocation} from "./api";
import prepareLocations from "./store.locations.js";
import { fetchResults, makeFetch } from "ChillMainAssets/lib/api/apiMethods";
import {fetchResults, makeFetch} from "ChillMainAssets/lib/api/apiMethods";
const debug = process.env.NODE_ENV !== "production";
//console.log('window.activity', window.activity);
@@ -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

@@ -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) {