Skip to content

Commit

Permalink
add annelisId in relationType form
Browse files Browse the repository at this point in the history
  • Loading branch information
folland87 committed Sep 26, 2024
1 parent 2c603c6 commit 3d80086
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/forms/relation-types/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function validate(body) {
return validationErrors;
}
function sanitize(form) {
const fields = ['name', 'pluralName', 'maleName', 'feminineName', 'priority', 'otherNames', 'for', 'mandateTypeGroup'];
const fields = ['name', 'pluralName', 'maleName', 'feminineName', 'priority', 'otherNames', 'for', 'mandateTypeGroup', 'annelisId'];
const body = {};
Object.keys(form).forEach((key) => { if (fields.includes(key)) { body[key] = form[key]; } });
body.priority = parseInt(body.priority, 10);
Expand Down Expand Up @@ -123,6 +123,9 @@ export default function RelationTypesForm({ id, data, onSave, onDelete }) {
options={GROUP_OPTIONS}
/>
</Col>
<Col n="12" spacing="pb-3w">
<TextInput label="Identifiant annelis" value={form.annelisId} onChange={(e) => updateForm({ annelisId: e.target.value })} />
</Col>
</Row>
<FormFooter
id={id}
Expand Down
13 changes: 13 additions & 0 deletions src/pages/admin/relation-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,19 @@ export default function RelationTypesPage() {
</Text>
</Row>
)}
{item?.annelisId && (
<Row>
<Text as="span" bold className="fr-mb-2v">
Annelis ID :
{' '}
<Badge type="info" text={item.annelisId} />
<CopyButton
copyText={item.annelisId}
size="sm"
/>
</Text>
</Row>
)}
<Row>
<Text spacing="mt-2w mb-0" size="xs">
Créé le
Expand Down

0 comments on commit 3d80086

Please sign in to comment.