Skip to content

Commit

Permalink
feat: add email to person fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnaud AMBROSELLI committed Dec 12, 2023
1 parent 91370bb commit be6b6ac
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions api/src/utils/custom-fields/person.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const personFields = [
{ name: "alertness", type: "boolean", label: "Personne très vulnérable", encrypted: true, importable: true, filterable: true },
{ name: "wanderingAt", type: "date", label: "En rue depuis le", encrypted: true, importable: true, filterable: true },
{ name: "phone", type: "text", label: "Téléphone", encrypted: true, importable: true, filterable: true },
{ name: "email", type: "text", label: "Email", encrypted: true, importable: true, filterable: true },
{ name: "assignedTeams", type: "multi-choice", label: "Équipes en charge", encrypted: true, importable: true, filterable: false },
{ name: "_id", label: "", encrypted: false, importable: false, filterable: false },
{ name: "organisation", label: "", encrypted: false, importable: false, filterable: false },
Expand Down
8 changes: 7 additions & 1 deletion dashboard/src/scenes/person/components/EditModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export default function EditModal({ person, selectedPanel, onClose, isMedicalFil
</div>
</FormGroup>
</Col>
<Col md={8}>
<Col md={4}>
<FormGroup>
<Label htmlFor="person-select-assigned-team">Équipe(s) en charge</Label>
<div>
Expand All @@ -188,6 +188,12 @@ export default function EditModal({ person, selectedPanel, onClose, isMedicalFil
<Input name="phone" id="phone" value={values.phone || ''} onChange={handleChange} />
</FormGroup>
</Col>
<Col md={4}>
<FormGroup>
<Label htmlFor="email">Email</Label>
<Input type="email" name="email" id="email" value={values.email || ''} onChange={handleChange} />
</FormGroup>
</Col>
{!['restricted-access'].includes(user.role) && (
<Col md={12}>
<FormGroup>
Expand Down
8 changes: 8 additions & 0 deletions dashboard/src/scenes/person/components/InfosMain.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ export function InfosMain({ person, isMedicalFile }) {
<b>Téléphone : </b>
{person.phone}
</div>
<div>
<b>Email : </b>
{person.email ? (
<a className="tw-text-white tw-underline" href={`mailto:${person.email}`} target="_blank" rel="noopener noreferrer">
{person.email}
</a>
) : null}
</div>
</div>
<div className="tw-mt-4 tw-flex tw-flex-row tw-items-center tw-justify-center tw-gap-2">
<button className="tw-block tw-px-2 tw-py-1 tw-text-sm tw-text-white tw-underline tw-opacity-80" onClick={() => window.print()}>
Expand Down

0 comments on commit be6b6ac

Please sign in to comment.