Skip to content

Commit

Permalink
feat(dashboard): affiche une petite icône "description" lorsque une a…
Browse files Browse the repository at this point in the history
…ction/consultation a le champ "description" de renseigné
  • Loading branch information
Arnaud AMBROSELLI committed Oct 5, 2023
1 parent a918023 commit 365767a
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 3 deletions.
14 changes: 14 additions & 0 deletions dashboard/src/assets/icons/description-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions dashboard/src/components/ActionsCalendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { CANCEL, DONE, sortActionsOrConsultations } from '../recoil/actions';
import TagTeam from './TagTeam';
import { useLocalStorage } from '../services/useLocalStorage';
import TabsNav from './tailwind/TabsNav';
import DescriptionIcon from './DescriptionIcon';

const ActionsCalendar = ({ actions, isNightSession, columns = ['Heure', 'Nom', 'Personne suivie', 'Créée le', 'Statut', 'Équipe(s) en charge'] }) => {
const history = useHistory();
Expand Down Expand Up @@ -118,6 +119,7 @@ const ActionsCalendar = ({ actions, isNightSession, columns = ['Heure', 'Nom', '
return (
<div className="tw-flex tw-items-center tw-justify-center tw-gap-1">
{!!actionOrConsult.urgent && <ExclamationMarkButton />}
{!!actionOrConsult.description && <DescriptionIcon />}
{!!organisation.groupsEnabled && !!actionOrConsult.group && (
<span className="tw-text-3xl" aria-label="Action familiale" title="Action familiale">
👪
Expand Down
2 changes: 2 additions & 0 deletions dashboard/src/components/ActionsSortableList.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import TagTeam from './TagTeam';
import { useLocalStorage } from '../services/useLocalStorage';
import Page from './pagination';
import useSearchParamState from '../services/useSearchParamState';
import DescriptionIcon from './DescriptionIcon';

const ActionsSortableList = ({ data, limit }) => {
useTitle('Agenda');
Expand Down Expand Up @@ -72,6 +73,7 @@ const ActionsSortableList = ({ data, limit }) => {
return (
<div className="tw-flex tw-items-center tw-justify-center tw-gap-1">
{!!actionOrConsult.urgent && <ExclamationMarkButton />}
{!!actionOrConsult.description && <DescriptionIcon />}
{!!organisation.groupsEnabled && !!actionOrConsult.group && (
<span className="tw-text-3xl" aria-label="Action familiale" title="Action familiale">
👪
Expand Down
1 change: 1 addition & 0 deletions dashboard/src/components/ActionsWeekly.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { organisationState, userState } from '../recoil/auth';
import TagTeam from './TagTeam';
import useSearchParamState from '../services/useSearchParamState';
import { disableConsultationRow } from '../recoil/consultations';
import DescriptionIcon from './DescriptionIcon';

// TODO: remove inline style when UI is stabilized.

Expand Down
8 changes: 8 additions & 0 deletions dashboard/src/components/DescriptionIcon.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React from 'react';
import openNewWindow from '../assets/icons/description-icon.svg';

const DescriptionIcon = () => (
<div className="tw-ml-1 tw-inline-block tw-h-4 tw-w-4 tw-bg-contain tw-text-gray-300" style={{ backgroundImage: `url(${openNewWindow})` }} />
);

export default DescriptionIcon;
7 changes: 5 additions & 2 deletions dashboard/src/scenes/person/components/Actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { AgendaMutedIcon } from './AgendaMutedIcon';
import { FullScreenIcon } from './FullScreenIcon';
import UserName from '../../../components/UserName';
import { itemsGroupedByPersonSelector } from '../../../recoil/selectors';
import DescriptionIcon from '../../../components/DescriptionIcon';

const filteredPersonActionsSelector = selectorFamily({
key: 'filteredPersonActionsSelector',
Expand Down Expand Up @@ -185,8 +186,10 @@ const ActionsTable = ({ filteredData }) => {
history.push(`?${searchParams.toString()}`);
}}>
<div className="tw-flex">
<div className="tw-flex-1">
{action.urgent ? <ExclamationMarkButton /> : null} {`${date}${time}`}
<div className="tw-flex tw-flex-1 tw-items-center tw-gap-x-2">
{action.urgent ? <ExclamationMarkButton /> : null}
{action.description ? <DescriptionIcon /> : null}
<span>{`${date}${time}`}</span>
</div>
<div>
<ActionStatus status={action.status} />
Expand Down
6 changes: 5 additions & 1 deletion dashboard/src/scenes/person/components/Consultations.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { AgendaMutedIcon } from './AgendaMutedIcon';
import { disableConsultationRow } from '../../../recoil/consultations';
import { FullScreenIcon } from './FullScreenIcon';
import UserName from '../../../components/UserName';
import DescriptionIcon from '../../../components/DescriptionIcon';

export const Consultations = ({ person }) => {
const [fullScreen, setFullScreen] = useState(false);
Expand Down Expand Up @@ -184,7 +185,10 @@ const ConsultationsTable = ({ filteredData, person }) => {
history.push(`?${searchParams.toString()}`);
}}>
<div className="tw-flex">
<div className="tw-flex-1">{`${date}${time}`}</div>
<div className="tw-flex-1">
{!!consultation.description && <DescriptionIcon />}
{`${date}${time}`}
</div>
<div>
<ActionStatus status={consultation.status} />
</div>
Expand Down
3 changes: 3 additions & 0 deletions dashboard/src/scenes/report/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ import { useLocalStorage } from '../../services/useLocalStorage';
import { arrayOfitemsGroupedByActionSelector, arrayOfitemsGroupedByConsultationSelector, personsObjectSelector } from '../../recoil/selectors';
import { treatmentsState } from '../../recoil/treatments';
import { medicalFileState } from '../../recoil/medicalFiles';
import DescriptionIcon from '../../components/DescriptionIcon';

const getPeriodTitle = (date, nightSession) => {
if (!nightSession) return `Journée du ${formatDateWithNameOfDay(date)}`;
Expand Down Expand Up @@ -1108,6 +1109,7 @@ const ActionCompletedAt = ({ date, status, actions, setSortOrder, setSortBy, sor
return (
<div className="tw-flex tw-items-center tw-justify-center tw-gap-1">
{!!action.urgent && <ExclamationMarkButton />}
{!!action.description && <DescriptionIcon />}
{!!organisation.groupsEnabled && !!action.group && (
<span className="tw-text-3xl" aria-label="Action familiale" title="Action familiale">
👪
Expand Down Expand Up @@ -1214,6 +1216,7 @@ const ActionCreatedAt = ({ date, actions, setSortOrder, setSortBy, sortBy, sortO
return (
<div className="tw-flex tw-items-center tw-justify-center tw-gap-1">
{!!action.urgent && <ExclamationMarkButton />}
{!!action.description && <DescriptionIcon />}
{!!organisation.groupsEnabled && !!action.group && (
<span className="tw-text-3xl" aria-label="Action familiale" title="Action familiale">
👪
Expand Down
2 changes: 2 additions & 0 deletions dashboard/src/scenes/search/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import ConsultationButton from '../../components/ConsultationButton';
import { useLocalStorage } from '../../services/useLocalStorage';
import { territoryObservationsState } from '../../recoil/territoryObservations';
import TabsNav from '../../components/tailwind/TabsNav';
import DescriptionIcon from '../../components/DescriptionIcon';

const personsWithFormattedBirthDateSelector = selector({
key: 'personsWithFormattedBirthDateSelector',
Expand Down Expand Up @@ -271,6 +272,7 @@ const Actions = ({ actions }) => {
return (
<div className="tw-flex tw-items-center tw-justify-center tw-gap-1">
{!!actionOrConsult.urgent && <ExclamationMarkButton />}
{!!actionOrConsult.description && <DescriptionIcon />}
{!!organisation.groupsEnabled && !!actionOrConsult.group && (
<span className="tw-text-3xl" aria-label="Action familiale" title="Action familiale">
👪
Expand Down

0 comments on commit 365767a

Please sign in to comment.