-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix/buggy address and open terminated su questionnaire (#83) * fix: provide questionnaireId in queen URL fix : handle buggy address * fix: handle missing departement for export * fix: unnecessary script option * fix: update test * Issue contact (#86) * terminatedTable * add contactOutcome & update snapshop * bump version * rollback version * fix pr review * delete import * fix size column * test: update snapshots * bump version --------- Co-authored-by: Simon Demazière <[email protected]> * chore: sonar configuration (#88) * ci: coverage for sonar and exclusions * ci: fix sonar conf * ci: fix sonar conf for coverage * add collection dates table in CampaignPortal (#91) * add collection dates table in CampaignPortal * rework test * bump version --------- Co-authored-by: Nicolas Turban <[email protected]> * fix checkAll on ReviewTable (#90) * fix checkAll on ReviewTable * fix checkAll on CloseSUTable * bump version * fix package * fix snapshots * fix modalPreferences * test: correct failing test * review changes * use NCO and some function * fix tests * bump version --------- Co-authored-by: Grafikart <[email protected]> Co-authored-by: Simon Demazière <[email protected]> * components refactoring (#93) * components refactoring * remove useless rerender in CampaignPortal * rework interviewer condition * review (rename state and rework functions) * bump version * Feat/add collection dates table (#92) * fix collectionStartDate and add email * wip referents * fix useEffect and add referents in portal page * bump version * remove useless className and add default referents value * add reminders and outcome data in ListSU (#95) * add reminders and outcome data in ListSU * remove useless traduction * rework functions to get reminders * refacto SUTable component * rework SUTableHeader component * bump version * add contactOutcome column * Update package.json * fix contactOutcome type (#97) * fix contactOutcome type * Update package.json * add contact outcome type sorter * reorder types * Update package.json * fix sort when contactOutcome is undefined * Update package.json * fix utils (#100) * fix utils * change condition * Update package.json --------- Co-authored-by: MickaelMenet <[email protected]> Co-authored-by: RenauxLeaInsee <[email protected]> Co-authored-by: Nicolas Turban <[email protected]> Co-authored-by: Grafikart <[email protected]> Co-authored-by: Lea Renaux <[email protected]>
- Loading branch information
1 parent
2517c9d
commit a20b623
Showing
57 changed files
with
7,282 additions
and
5,501 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,14 +5,18 @@ import OverlayTrigger from 'react-bootstrap/OverlayTrigger'; | |
import Popover from 'react-bootstrap/Popover'; | ||
import D from '../../i18n'; | ||
|
||
function Contacts() { | ||
function Contacts({email, referents}) { | ||
const renderTooltip = ( | ||
<Popover id="popover-basic"> | ||
<Popover.Content> | ||
{D.sendMail} | ||
</Popover.Content> | ||
</Popover> | ||
); | ||
|
||
const primaryReferents = referents?.filter((referent) => referent.role === "PRIMARY") ?? []; | ||
const secondaryReferents = referents?.filter((referent) => referent.role === "SECONDARY") ?? []; | ||
|
||
return ( | ||
<Card className="ViewCard"> | ||
<div> | ||
|
@@ -24,26 +28,64 @@ function Contacts() { | |
<tr | ||
className="Clickable" | ||
data-testid="mail-button" | ||
onClick={() => { window.location.assign('mailto:[email protected]'); }} | ||
onClick={() => { window.location.assign(`mailto:${email}`); }} | ||
> | ||
<th className="ContactsLeftHeader">{D.functionalBox}</th> | ||
<td className=" LightGreyLine MailLink">[email protected]</td> | ||
<td className=" LightGreyLine MailLink" >{email}</td> | ||
</tr> | ||
</OverlayTrigger> | ||
<tr> | ||
<th rowSpan="2" className="VerticallyCentered ContactsLeftHeader">{D.cpos}</th> | ||
<td className="LightGreyLine">Chloé Dupont</td> | ||
</tr> | ||
<tr> | ||
<td className="LightGreyLine">01 01 01 01 01</td> | ||
</tr> | ||
<tr> | ||
<th rowSpan="2" className="VerticallyCentered ContactsLeftHeader">{D.deputyCpos}</th> | ||
<td className="LightGreyLine">Thierry Fabres</td> | ||
</tr> | ||
<tr> | ||
<td className="LightGreyLine">02 01 01 01 01</td> | ||
</tr> | ||
|
||
{(referents === undefined || primaryReferents.length === 0) && | ||
<tr> | ||
<th className="VerticallyCentered ContactsLeftHeader">{D.cpos}</th> | ||
<td>{"-"}</td> | ||
</tr> | ||
} | ||
|
||
{primaryReferents.map((primaryReferent) => { | ||
return ( | ||
<tr key={primaryReferent.phoneNumber}> | ||
<th className="VerticallyCentered ContactsLeftHeader">{D.cpos}</th> | ||
<td className="ContactRow"> | ||
<span> | ||
{primaryReferent.firstName || primaryReferent.lastName ? | ||
`${primaryReferent.firstName ?? ""} ${primaryReferent.lastName ?? ""}` | ||
: "-" | ||
} | ||
</span> | ||
<span > | ||
{primaryReferent.phoneNumber ?? "-"} | ||
</span> | ||
</td> | ||
</tr> | ||
) | ||
})} | ||
|
||
{(referents === undefined || secondaryReferents.length === 0) && | ||
<tr> | ||
<th className="VerticallyCentered ContactsLeftHeader">{D.deputyCpos}</th> | ||
<td>{"-"}</td> | ||
</tr> | ||
} | ||
|
||
{secondaryReferents.map((secondaryReferent) => { | ||
return ( | ||
<tr key={secondaryReferent.phoneNumber}> | ||
<th className="VerticallyCentered ContactsLeftHeader">{D.deputyCpos}</th> | ||
<td className="ContactRow"> | ||
<span> | ||
{secondaryReferent.firstName || secondaryReferent.lastName ? | ||
`${secondaryReferent.firstName ?? ""} ${secondaryReferent.lastName ?? ""}` | ||
: "-" | ||
} | ||
</span> | ||
<span > | ||
{secondaryReferent.phoneNumber ?? "-"} | ||
</span> | ||
</td> | ||
</tr> | ||
) | ||
})} | ||
</tbody> | ||
</Table> | ||
</div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import React from 'react'; | ||
import Card from 'react-bootstrap/Card'; | ||
import D from '../../i18n'; | ||
import Utils from '../../utils/Utils'; | ||
import Table from 'react-bootstrap/Table'; | ||
|
||
export const DatesTable = ({identificationPhaseStartDate, collectionStartDate, collectionEndDate, endDate }) => { | ||
return ( | ||
<Card className="ViewCard"> | ||
<Card.Title className="Title">{D.dates}</Card.Title> | ||
<Table className="CustomTable" bordered striped responsive size="sm"> | ||
<tbody> | ||
<tr> | ||
<th className="DatesLeftHeader">{D.identificationPhaseStartDate}</th> | ||
<td className="LightGreyLine VerticallyCentered">{identificationPhaseStartDate && Utils.convertToDateString(identificationPhaseStartDate)}</td> | ||
</tr> | ||
<tr> | ||
<th className="DatesLeftHeader">{D.collectionStartDate}</th> | ||
<td className="LightGreyLine VerticallyCentered">{collectionStartDate && Utils.convertToDateString(collectionStartDate)}</td> | ||
</tr> | ||
<tr> | ||
<th className="DatesLeftHeader">{D.collectionEndDate}</th> | ||
<td className="LightGreyLine VerticallyCentered">{collectionEndDate && Utils.convertToDateString(collectionEndDate)}</td> | ||
</tr> | ||
<tr> | ||
<th className="DatesLeftHeader">{D.endDate}</th> | ||
<td className="LightGreyLine VerticallyCentered">{endDate && Utils.convertToDateString(endDate)}</td> | ||
</tr> | ||
</tbody> | ||
</Table> | ||
</Card> | ||
|
||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import React from 'react'; | ||
import { DatesTable } from "./Dates"; | ||
import { render, screen } from '@testing-library/react'; | ||
import Utils from '../../utils/Utils'; | ||
|
||
describe("dates component", () => { | ||
it("should display all labels", () => { | ||
render( | ||
<DatesTable | ||
identificationPhaseStartDate={1578907245000} | ||
collectionStartDate={1609492845000} | ||
collectionEndDate={1698706800000} | ||
endDate={1706655600000} | ||
/> | ||
|
||
); | ||
|
||
expect(screen.getByText("Dates")).toBeInTheDocument(); | ||
expect(screen.getByText("Start of identification phase")).toBeInTheDocument(); | ||
expect(screen.getByText("Collection start date")).toBeInTheDocument(); | ||
expect(screen.getByText("Collection end date")).toBeInTheDocument(); | ||
expect(screen.getByText("Processing end date")).toBeInTheDocument(); | ||
|
||
}) | ||
|
||
it("should display all formated dates", () => { | ||
render( | ||
<DatesTable | ||
identificationPhaseStartDate={1578907245000} | ||
collectionStartDate={1609492845000} | ||
collectionEndDate={1698706800000} | ||
endDate={1706655600000} | ||
/> | ||
|
||
); | ||
|
||
expect(screen.getByText(Utils.convertToDateString(1578907245000))).toBeInTheDocument(); | ||
expect(screen.getByText(Utils.convertToDateString(1609492845000))).toBeInTheDocument(); | ||
expect(screen.getByText(Utils.convertToDateString(1698706800000))).toBeInTheDocument(); | ||
expect(screen.getByText(Utils.convertToDateString(1706655600000))).toBeInTheDocument(); | ||
}) | ||
}) |
Oops, something went wrong.