mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-27 09:05:01 +00:00
Filter PersonIdentifierWorker
by presence
during initialization and update type definitions. Add presence
field to PersonIdentifierWorkerNormalizer
.
This commit is contained in:
@@ -28,6 +28,7 @@ final readonly class PersonIdentifierWorkerNormalizer implements NormalizerInter
|
|||||||
'engine' => $object->getDefinition()->getEngine(),
|
'engine' => $object->getDefinition()->getEngine(),
|
||||||
'label' => $object->getDefinition()->getLabel(),
|
'label' => $object->getDefinition()->getLabel(),
|
||||||
'isActive' => $object->getDefinition()->isActive(),
|
'isActive' => $object->getDefinition()->isActive(),
|
||||||
|
'presence' => $object->getDefinition()->getPresence()->value,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -423,12 +423,15 @@ export interface SearchOptions {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type PersonIdentifierPresence = 'NOT_EDITABLE' | 'ON_EDIT' | 'ON_CREATION' | 'REQUIRED';
|
||||||
|
|
||||||
export interface PersonIdentifierWorker {
|
export interface PersonIdentifierWorker {
|
||||||
type: "person_identifier_worker";
|
type: "person_identifier_worker";
|
||||||
definition_id: number;
|
definition_id: number;
|
||||||
engine: string;
|
engine: string;
|
||||||
label: TranslatableString;
|
label: TranslatableString;
|
||||||
isActive: boolean;
|
isActive: boolean;
|
||||||
|
presence: PersonIdentifierPresence;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class MakeFetchException extends Error {
|
export class MakeFetchException extends Error {
|
||||||
|
@@ -649,7 +649,10 @@ onMounted(() => {
|
|||||||
config.genders = genders;
|
config.genders = genders;
|
||||||
});
|
});
|
||||||
getPersonIdentifiers().then((identifiers) => {
|
getPersonIdentifiers().then((identifiers) => {
|
||||||
config.identifiers = identifiers;
|
config.identifiers = identifiers.filter(
|
||||||
|
(w: PersonIdentifierWorker) =>
|
||||||
|
w.presence === 'ON_CREATION' || w.presence === 'REQUIRED'
|
||||||
|
);
|
||||||
});
|
});
|
||||||
if (props.action !== "create") {
|
if (props.action !== "create") {
|
||||||
loadData();
|
loadData();
|
||||||
|
Reference in New Issue
Block a user