diff --git a/src/components/CampaignPortal/__snapshots__/CampaignPortal.test.jsx.snap b/src/components/CampaignPortal/__snapshots__/CampaignPortal.test.jsx.snap index e3c33d8..11a8f11 100644 --- a/src/components/CampaignPortal/__snapshots__/CampaignPortal.test.jsx.snap +++ b/src/components/CampaignPortal/__snapshots__/CampaignPortal.test.jsx.snap @@ -5172,7 +5172,7 @@ exports[`Select another survey 1`] = `
- {"survey":{"allSurveys":[{"id":"vqs2021x00","label":"Everyday life and health survey 2021","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000},{"id":"simpsons2020x00","label":"Survey on the Simpsons tv show 2020","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000}],"id":"simpsons2020x00","label":"Survey on the Simpsons tv show 2020","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000},"surveyInfo":{"id":"simpsons2020x00","label":"Survey on the Simpsons tv show 2020","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000}} + {"survey":{"allSurveys":[{"id":"vqs2021x00","label":"Everyday life and health survey 2021","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000},{"id":"simpsons2020x00","label":"Survey on the Simpsons tv show 2020","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000}],"id":"simpsons2020x00","label":"Survey on the Simpsons tv show 2020","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"communicationRequestConfiguration":false},"surveyInfo":{"id":"simpsons2020x00","label":"Survey on the Simpsons tv show 2020","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000}}
`; diff --git a/src/components/CollectionTable/__snapshots__/CollectionTable.test.jsx.snap b/src/components/CollectionTable/__snapshots__/CollectionTable.test.jsx.snap index 5c044e3..62707f6 100644 --- a/src/components/CollectionTable/__snapshots__/CollectionTable.test.jsx.snap +++ b/src/components/CollectionTable/__snapshots__/CollectionTable.test.jsx.snap @@ -19915,7 +19915,7 @@ exports[`Select another survey (by interviewer) 1`] = `
- {"allSurveys":[{"id":"vqs2021x00","label":"Everyday life and health survey 2021","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000},{"id":"simpsons2020x00","label":"Survey on the Simpsons tv show 2020","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000}],"id":"simpsons2020x00","label":"Survey on the Simpsons tv show 2020","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000} + {"allSurveys":[{"id":"vqs2021x00","label":"Everyday life and health survey 2021","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000},{"id":"simpsons2020x00","label":"Survey on the Simpsons tv show 2020","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000}],"id":"simpsons2020x00","label":"Survey on the Simpsons tv show 2020","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"communicationRequestConfiguration":false}
`; @@ -19923,7 +19923,7 @@ exports[`Select another survey (by site) 1`] = `
- {"allSurveys":[{"id":"vqs2021x00","label":"Everyday life and health survey 2021","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000},{"id":"simpsons2020x00","label":"Survey on the Simpsons tv show 2020","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000}],"id":"simpsons2020x00","label":"Survey on the Simpsons tv show 2020","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000} + {"allSurveys":[{"id":"vqs2021x00","label":"Everyday life and health survey 2021","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000},{"id":"simpsons2020x00","label":"Survey on the Simpsons tv show 2020","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000}],"id":"simpsons2020x00","label":"Survey on the Simpsons tv show 2020","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"communicationRequestConfiguration":false}
`; diff --git a/src/components/ListSU/ListSU.css b/src/components/ListSU/ListSU.css index a080544..90f0656 100644 --- a/src/components/ListSU/ListSU.css +++ b/src/components/ListSU/ListSU.css @@ -5,24 +5,41 @@ } #SUTable .ColId { - width: 15%; + width: 6%; } #SUTable .ColInterviewer { - width: 20%; + width: 15%; } #SUTable .ColSsech { - width: 11%; + width: 4%; } #SUTable .ColDepartement { - width: 13%; + width: 6%; } #SUTable .ColCity { - width: 20%; + width: 15%; } #SUTable .ColState { width: 13%; +} + +#SUTable .ColTotalReminders { + width: 3%; + min-width: 3rem; +} + +#SUTable .ColLatestReminder { + width: 7%; +} + +#SUTable .ColContactOutcomeType { + width: 10%; +} + +#SUTable .ColContactOutcomeDate { + width: 5%; } \ No newline at end of file diff --git a/src/components/ListSU/SUTable.jsx b/src/components/ListSU/SUTable.jsx index fab19b2..cb56a3e 100644 --- a/src/components/ListSU/SUTable.jsx +++ b/src/components/ListSU/SUTable.jsx @@ -6,14 +6,23 @@ import Spinner from "react-bootstrap/Spinner"; import Card from "react-bootstrap/Card"; import Modal from "react-bootstrap/Modal"; import Form from "react-bootstrap/Form"; -import SortIcon from "../SortIcon/SortIcon"; import SearchField from "../SearchField/SearchField"; import PaginationNav from "../PaginationNav/PaginationNav"; import SurveyUnitLine from "./SurveyUnitLine"; import D from "../../i18n"; +import Utils from "../../utils/Utils"; +import { SUTableHeader } from "./SUTableHeader"; +import { SUTableHeaderParameters } from "./SUTableHeaderParameters"; -function makeTableForExport(data) { - const header = [ +const getInitiatedDate = (reminder) => + reminder.status.find((status) => status.status === "INITIATED")?.date ?? 0; + +const orderReminders = (reminders) => { + reminders.sort((a, b) => getInitiatedDate(b) - getInitiatedDate(a)); +}; + +function makeTableForExport(data, communicationRequestConfiguration) { + const headerTitle = [ [ D.identifier, D.interviewer, @@ -25,17 +34,118 @@ function makeTableForExport(data) { ], ]; - return header.concat( - data.map((line) => [ - line.id, - line.interviewer, - line.idep, - line.ssech, - line.departement?.substring(0, 2), - line.city, - line.state, - ]) - ); + if (communicationRequestConfiguration) { + let maxReminders = 0; + + headerTitle[0].splice(headerTitle[0].length - 1, 0, D.totalReminders); + + data.forEach((survey) => { + const length = + survey.communicationRequests?.filter( + (request) => + request.emiter === "INTERVIEWER" && request.type === "REMINDER" + )?.length ?? 0; + length > maxReminders && (maxReminders = length); + }); + + maxReminders !== 0 && + headerTitle[0].splice( + headerTitle[0].length - 1, + 0, + Array.from(new Array(maxReminders)).reduce((previous) => { + return [ + ...previous, + D.reminderMediumExportLabel, + D.reminderReasonExportLabel, + D.reminderDateExportLabel, + ]; + }, []) + ); + + headerTitle[0].splice( + headerTitle[0].length - 1, + 0, + D.contactOutcomeLabel, + D.contactOutcomeDateLabel + ); + } + + const header = headerTitle; + + return communicationRequestConfiguration + ? header.concat( + data.map((line) => { + const reminders = + line.communicationRequests?.filter( + (request) => + request.emiter === "INTERVIEWER" && request.type === "REMINDER" + ) ?? []; + orderReminders(reminders); + + const reminderInformationsToExport = reminders.reduce( + (previous, current) => { + const initiatedStatus = current.status.find( + (status) => status.status === "INITIATED" + ); + return [ + ...previous, + D[current.medium?.toLowerCase()] ?? "", + D[current.reason?.toLowerCase()] ?? "", + Utils.convertToDateString(new Date(initiatedStatus.date)), + ]; + }, + [] + ); + + return reminders.length !== 0 + ? [ + line.id, + line.interviewer, + line.idep, + line.ssech, + line.departement?.substring(0, 2), + line.city, + reminders.length, + [...reminderInformationsToExport], + line.contactOutcome?.type ? D[line.contactOutcome.type] : "", + line.contactOutcome?.date + ? Utils.convertToDateString( + new Date(line.contactOutcome.date) + ) + : "", + line.state, + ] + : [ + line.id, + line.interviewer, + line.idep, + line.ssech, + line.departement?.substring(0, 2), + line.city, + reminders.length, + line.contactOutcome?.type ? D[line.contactOutcome.type] : "", + line.contactOutcome?.date + ? Utils.convertToDateString( + new Date(line.contactOutcome.date) + ) + : "", + line.state, + ]; + }) + ) + : header.concat( + data.map((line) => { + return [ + line.id, + line.interviewer, + line.idep, + line.ssech, + line.departement?.substring(0, 2), + line.city, + line.state, + ]; + }) + ); } class SUTable extends React.Component { @@ -132,7 +242,10 @@ class SUTable extends React.Component { const title = `${fileLabel}_${new Date() .toLocaleDateString() .replace(/\//g, "")}.csv`.replace(/ /g, "_"); - const table = makeTableForExport(data); + const table = makeTableForExport( + data, + survey.communicationRequestConfiguration + ); const csvContent = `data:text/csv;charset=utf-8,\ufeff${table .map((e) => e.join(";")) .join("\n")}`; @@ -160,7 +273,7 @@ class SUTable extends React.Component { } render() { - const { data, sort, handleSort, isLoading } = this.props; + const { data, sort, handleSort, isLoading, survey } = this.props; const fieldsToSearch = ["city", "interviewer", "id", "state"]; const { pagination, @@ -178,6 +291,12 @@ class SUTable extends React.Component { handleSort(property); }; } + + const parameters = SUTableHeaderParameters.filter( + (parameter) => + parameter.isAlwaysVisible || survey.communicationRequestConfiguration + ); + return ( @@ -248,49 +367,14 @@ class SUTable extends React.Component { onChange={(e) => this.handleCheckAll(e)} /> - - {D.identifier} - - - - {D.interviewer} - - - - {D.ssech} - - - - {D.department} - - - - {D.town} - - - - {D.state} - - + {parameters.map((parameters) => ( + + ))} @@ -302,14 +386,28 @@ class SUTable extends React.Component { displayedLines.length ) ) - .map((line) => ( - toggleCheckBox(line.id)} - /> - ))} + .map((line) => { + const reminders = + line.communicationRequests?.filter( + (request) => + request.emiter === "INTERVIEWER" && + request.type === "REMINDER" + ) ?? []; + + orderReminders(reminders); + + return ( + toggleCheckBox(line.id)} + communicationRequestConfiguration={ + survey.communicationRequestConfiguration + } + /> + ); + })}
diff --git a/src/components/ListSU/SUTableHeader.jsx b/src/components/ListSU/SUTableHeader.jsx new file mode 100644 index 0000000..993f6f7 --- /dev/null +++ b/src/components/ListSU/SUTableHeader.jsx @@ -0,0 +1,56 @@ +import React from "react"; +import SortIcon from "../SortIcon/SortIcon"; +import OverlayTrigger from "react-bootstrap/OverlayTrigger"; +import Tooltip from "react-bootstrap/Tooltip"; + +const HeaderContent = ({ + label, + className, + sortValue, + sort, + handleSortFunction, + dataTestId, + ...props +}) => ( + + {label} + {sortValue && } + +); + +export const SUTableHeader = ({ + label, + tooltipLabel, + className, + sortValue, + sort, + handleSortFunction, + dataTestId, +}) => { + return tooltipLabel ? ( + {tooltipLabel}}> + + + ) : ( + + ); +}; diff --git a/src/components/ListSU/SUTableHeaderParameters.js b/src/components/ListSU/SUTableHeaderParameters.js new file mode 100644 index 0000000..48af4a4 --- /dev/null +++ b/src/components/ListSU/SUTableHeaderParameters.js @@ -0,0 +1,83 @@ +import D from "../../i18n"; + +export const SUTableHeaderParameters =[ + { + label: D.identifier, + className: "Clickable ColId", + sortValue: "id", + isAlwaysVisible: true, + }, + { + label: D.interviewer, + className: "Clickable ColInterviewer", + sortValue: "interviewer", + dataTestId: "TableHeader_interviewer_name", + isAlwaysVisible: true, + }, + { + label: D.ssech, + className: "Clickable ColSsech", + sortValue: "ssech", + isAlwaysVisible: true, + }, + { + label: D.department, + className: "Clickable ColDepartement", + sortValue: "departement", + isAlwaysVisible: true, + }, + { + label: D.town, + className: "Clickable ColCity", + sortValue: "city", + isAlwaysVisible: true, + }, + { + label: D.totalRemindersLabel, + className: "ColTotalReminders", + tooltipLabel: D.totalReminders, + isAlwaysVisible: false, + }, + { + label: D.latestReminderLabel, + className: "ColLatestReminder", + tooltipLabel: D.latestReminder, + isAlwaysVisible: false, + }, + { + label: `${D.latestReminderLabel}-1`, + className: "ColLatestReminder", + tooltipLabel: D.secondLatestReminder, + isAlwaysVisible: false, + }, + { + label: `${D.latestReminderLabel}-2`, + className: "ColLatestReminder", + tooltipLabel: D.thirdLatestReminder, + isAlwaysVisible: false, + }, + { + label: `${D.latestReminderLabel}-3`, + className: "ColLatestReminder", + tooltipLabel: D.fourthLatestReminder, + isAlwaysVisible: false, + }, + { + label: D.contactOutcomeLabel, + className: "ColContactOutcomeType", + isAlwaysVisible: false, + }, + { + label: D.contactOutcomeDateLabel, + className: "Clickable ColContactOutcomeDate", + sortValue: "contactOutcomeDate", + tooltipLabel: D.contactOutcomeDate, + isAlwaysVisible: false, + }, + { + label: D.state, + className: "Clickable ColState", + sortValue: "state", + isAlwaysVisible: true, + } +]; \ No newline at end of file diff --git a/src/components/ListSU/SurveyUnitLine.jsx b/src/components/ListSU/SurveyUnitLine.jsx index 11f7bd6..9638563 100644 --- a/src/components/ListSU/SurveyUnitLine.jsx +++ b/src/components/ListSU/SurveyUnitLine.jsx @@ -1,9 +1,63 @@ import React from "react"; import D from "../../i18n"; +import Utils from "../../utils/Utils"; + +function SurveyUnitLine({ + lineData, + isChecked, + updateFunc, + communicationRequestConfiguration, +}) { + const { + id, + ssech, + departement, + city, + interviewer, + state, + remindersByOrder = [], + contactOutcome, + } = lineData; + + const getReminderDescription = (reminder) => { + switch (reminder.medium) { + case "EMAIL": + switch (reminder.reason) { + case "REFUSAL": + return `${D.reminderEmailMedium} ${D.reminderRefReason}`; + case "UNREACHABLE": + return `${D.reminderEmailMedium} ${D.reminderItjReason}`; + default: + return D.reminderEmailMedium; + } + case "MAIL": + switch (reminder.reason) { + case "REFUSAL": + return `${D.reminderMailMedium} ${D.reminderRefReason}`; + case "UNREACHABLE": + return `${D.reminderMailMedium} ${D.reminderItjReason}`; + default: + return D.reminderMailMedium; + } + default: + switch (reminder.reason) { + case "REFUSAL": + return D.reminderRefReason; + case "UNREACHABLE": + return D.reminderItjReason; + default: + return ""; + } + } + }; + + const getReminderDate = (reminder) => { + const date = reminder.status.find( + (status) => status.status === "INITIATED" + ).date; + return date ? Utils.convertToDateString(new Date(date)) : ""; + }; -function SurveyUnitLine({ lineData, isChecked, updateFunc }) { - const { id, ssech, departement, city, interviewer, state, closingCause } = - lineData; return ( @@ -25,7 +79,43 @@ function SurveyUnitLine({ lineData, isChecked, updateFunc }) { {ssech} {departement?.substring(0, 2) ?? ""} {city} - {closingCause ? D[closingCause] : ""} + {communicationRequestConfiguration && ( + <> + {remindersByOrder.length} + + {remindersByOrder[0] && + `${getReminderDescription(remindersByOrder[0])} ${getReminderDate( + remindersByOrder[0] + )}`} + + + {remindersByOrder[1] && + `${getReminderDescription(remindersByOrder[1])} ${getReminderDate( + remindersByOrder[1] + )}`} + + + {remindersByOrder[2] && + `${getReminderDescription(remindersByOrder[2])} ${getReminderDate( + remindersByOrder[2] + )}`} + + + {remindersByOrder[3] && + `${getReminderDescription(remindersByOrder[3])} ${getReminderDate( + remindersByOrder[3] + )}`} + + + {contactOutcome?.type && D[contactOutcome.type]} + + + {contactOutcome?.date && + Utils.convertToDateString(new Date(contactOutcome.date))} + + + )} + {state ? D[state] : ""} ); } diff --git a/src/components/ListSU/__snapshots__/ListSU.test.jsx.snap b/src/components/ListSU/__snapshots__/ListSU.test.jsx.snap index 96221e3..4b72d9c 100644 --- a/src/components/ListSU/__snapshots__/ListSU.test.jsx.snap +++ b/src/components/ListSU/__snapshots__/ListSU.test.jsx.snap @@ -4804,7 +4804,7 @@ exports[`Select another survey 1`] = `
- {"allSurveys":[{"id":"vqs2021x00","label":"Everyday life and health survey 2021","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000},{"id":"simpsons2020x00","label":"Survey on the Simpsons tv show 2020","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000}],"id":"simpsons2020x00","label":"Survey on the Simpsons tv show 2020","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000} + {"allSurveys":[{"id":"vqs2021x00","label":"Everyday life and health survey 2021","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000},{"id":"simpsons2020x00","label":"Survey on the Simpsons tv show 2020","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000}],"id":"simpsons2020x00","label":"Survey on the Simpsons tv show 2020","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"communicationRequestConfiguration":false}
`; diff --git a/src/components/MainScreen/SurveyListLine.jsx b/src/components/MainScreen/SurveyListLine.jsx index d350a6b..f8660f3 100644 --- a/src/components/MainScreen/SurveyListLine.jsx +++ b/src/components/MainScreen/SurveyListLine.jsx @@ -9,6 +9,7 @@ function SurveyListLine({ lineData, allData }) { label: data.label, collectionStartDate: data.collectionStartDate, endDate: data.endDate, + communicationRequestConfiguration: data.communicationRequestConfiguration ?? false, allSurveys: allData, }; diff --git a/src/components/MainScreen/__snapshots__/MainScreen.test.jsx.snap b/src/components/MainScreen/__snapshots__/MainScreen.test.jsx.snap index 691b4bd..d30ccd0 100644 --- a/src/components/MainScreen/__snapshots__/MainScreen.test.jsx.snap +++ b/src/components/MainScreen/__snapshots__/MainScreen.test.jsx.snap @@ -5743,7 +5743,7 @@ exports[`Go to listSU 1`] = `
- {"id":"vqs202fgd1x00","label":"Everyday life and health survey 2018","collectionStartDate":1577837800000,"endDate":1641514600000,"allSurveys":[{"id":"vqs202fgd1x00","label":"Everyday life and health survey 2018","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"vqs2021x00","label":"Everyday life and health survey 2021","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"vqs2qfsdfsqe021x00","label":"Everyday life and health survey 2026","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"simpsosfqns2020x00","label":"Survey on something 2020","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"simpsonqsdfsqes2020x00","label":"Survey on something else 2020","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"simpsons2020x00","label":"Survey on the Simpsons tv show 2020","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true}]} + {"id":"vqs202fgd1x00","label":"Everyday life and health survey 2018","collectionStartDate":1577837800000,"endDate":1641514600000,"communicationRequestConfiguration":false,"allSurveys":[{"id":"vqs202fgd1x00","label":"Everyday life and health survey 2018","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"vqs2021x00","label":"Everyday life and health survey 2021","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"vqs2qfsdfsqe021x00","label":"Everyday life and health survey 2026","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"simpsosfqns2020x00","label":"Survey on something 2020","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"simpsonqsdfsqes2020x00","label":"Survey on something else 2020","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"simpsons2020x00","label":"Survey on the Simpsons tv show 2020","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true}]}
`; @@ -5751,7 +5751,7 @@ exports[`Go to monitoring table 1`] = `
- {"id":"vqs202fgd1x00","label":"Everyday life and health survey 2018","collectionStartDate":1577837800000,"endDate":1641514600000,"allSurveys":[{"id":"vqs202fgd1x00","label":"Everyday life and health survey 2018","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"vqs2021x00","label":"Everyday life and health survey 2021","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"vqs2qfsdfsqe021x00","label":"Everyday life and health survey 2026","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"simpsosfqns2020x00","label":"Survey on something 2020","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"simpsonqsdfsqes2020x00","label":"Survey on something else 2020","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"simpsons2020x00","label":"Survey on the Simpsons tv show 2020","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true}]} + {"id":"vqs202fgd1x00","label":"Everyday life and health survey 2018","collectionStartDate":1577837800000,"endDate":1641514600000,"communicationRequestConfiguration":false,"allSurveys":[{"id":"vqs202fgd1x00","label":"Everyday life and health survey 2018","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"vqs2021x00","label":"Everyday life and health survey 2021","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"vqs2qfsdfsqe021x00","label":"Everyday life and health survey 2026","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"simpsosfqns2020x00","label":"Survey on something 2020","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"simpsonqsdfsqes2020x00","label":"Survey on something else 2020","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"simpsons2020x00","label":"Survey on the Simpsons tv show 2020","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true}]}
`; @@ -5759,7 +5759,7 @@ exports[`Go to monitoring table by site 1`] = `
- {"id":"vqs2021x00","label":"Everyday life and health survey 2021","collectionStartDate":1577837800000,"endDate":1641514600000,"allSurveys":[{"id":"vqs202fgd1x00","label":"Everyday life and health survey 2018","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"vqs2021x00","label":"Everyday life and health survey 2021","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"vqs2qfsdfsqe021x00","label":"Everyday life and health survey 2026","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"simpsosfqns2020x00","label":"Survey on something 2020","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"simpsonqsdfsqes2020x00","label":"Survey on something else 2020","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"simpsons2020x00","label":"Survey on the Simpsons tv show 2020","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true}]} + {"id":"vqs2021x00","label":"Everyday life and health survey 2021","collectionStartDate":1577837800000,"endDate":1641514600000,"communicationRequestConfiguration":false,"allSurveys":[{"id":"vqs202fgd1x00","label":"Everyday life and health survey 2018","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"vqs2021x00","label":"Everyday life and health survey 2021","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"vqs2qfsdfsqe021x00","label":"Everyday life and health survey 2026","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"simpsosfqns2020x00","label":"Survey on something 2020","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"simpsonqsdfsqes2020x00","label":"Survey on something else 2020","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"simpsons2020x00","label":"Survey on the Simpsons tv show 2020","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true}]}
`; @@ -5767,7 +5767,7 @@ exports[`Go to portal 1`] = `
- {"survey":{"id":"vqs202fgd1x00","label":"Everyday life and health survey 2018","collectionStartDate":1577837800000,"endDate":1641514600000,"allSurveys":[{"id":"vqs202fgd1x00","label":"Everyday life and health survey 2018","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"vqs2021x00","label":"Everyday life and health survey 2021","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"vqs2qfsdfsqe021x00","label":"Everyday life and health survey 2026","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"simpsosfqns2020x00","label":"Survey on something 2020","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"simpsonqsdfsqes2020x00","label":"Survey on something else 2020","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"simpsons2020x00","label":"Survey on the Simpsons tv show 2020","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true}]},"surveyInfo":{"id":"vqs202fgd1x00","label":"Everyday life and health survey 2018","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true}} + {"survey":{"id":"vqs202fgd1x00","label":"Everyday life and health survey 2018","collectionStartDate":1577837800000,"endDate":1641514600000,"communicationRequestConfiguration":false,"allSurveys":[{"id":"vqs202fgd1x00","label":"Everyday life and health survey 2018","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"vqs2021x00","label":"Everyday life and health survey 2021","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"vqs2qfsdfsqe021x00","label":"Everyday life and health survey 2026","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"simpsosfqns2020x00","label":"Survey on something 2020","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"simpsonqsdfsqes2020x00","label":"Survey on something else 2020","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"simpsons2020x00","label":"Survey on the Simpsons tv show 2020","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true}]},"surveyInfo":{"id":"vqs202fgd1x00","label":"Everyday life and health survey 2018","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true}}
`; @@ -5775,7 +5775,7 @@ exports[`Go to portal 2`] = `
- {"survey":{"id":"vqs202fgd1x00","label":"Everyday life and health survey 2018","collectionStartDate":1577837800000,"endDate":1641514600000,"allSurveys":[{"id":"vqs202fgd1x00","label":"Everyday life and health survey 2018","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"vqs2021x00","label":"Everyday life and health survey 2021","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"vqs2qfsdfsqe021x00","label":"Everyday life and health survey 2026","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"simpsosfqns2020x00","label":"Survey on something 2020","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"simpsonqsdfsqes2020x00","label":"Survey on something else 2020","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"simpsons2020x00","label":"Survey on the Simpsons tv show 2020","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true}]},"surveyInfo":{"id":"vqs202fgd1x00","label":"Everyday life and health survey 2018","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true}} + {"survey":{"id":"vqs202fgd1x00","label":"Everyday life and health survey 2018","collectionStartDate":1577837800000,"endDate":1641514600000,"communicationRequestConfiguration":false,"allSurveys":[{"id":"vqs202fgd1x00","label":"Everyday life and health survey 2018","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"vqs2021x00","label":"Everyday life and health survey 2021","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"vqs2qfsdfsqe021x00","label":"Everyday life and health survey 2026","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"simpsosfqns2020x00","label":"Survey on something 2020","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"simpsonqsdfsqes2020x00","label":"Survey on something else 2020","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true},{"id":"simpsons2020x00","label":"Survey on the Simpsons tv show 2020","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true}]},"surveyInfo":{"id":"vqs202fgd1x00","label":"Everyday life and health survey 2018","email":"survey@mail.com","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"allocated":4,"toProcessInterviewer":0,"toAffect":0,"toFollowUp":0,"toReview":0,"finalized":0,"preference":true}}
`; diff --git a/src/components/MonitoringTable/__snapshots__/MonitoringTable.test.jsx.snap b/src/components/MonitoringTable/__snapshots__/MonitoringTable.test.jsx.snap index a7429f3..3eaabb7 100644 --- a/src/components/MonitoringTable/__snapshots__/MonitoringTable.test.jsx.snap +++ b/src/components/MonitoringTable/__snapshots__/MonitoringTable.test.jsx.snap @@ -17695,7 +17695,7 @@ exports[`Select another survey (by interviewer) 1`] = `
- {"allSurveys":[{"id":"vqs2021x00","label":"Everyday life and health survey 2021","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000},{"id":"simpsons2020x00","label":"Survey on the Simpsons tv show 2020","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000}],"id":"simpsons2020x00","label":"Survey on the Simpsons tv show 2020","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000} + {"allSurveys":[{"id":"vqs2021x00","label":"Everyday life and health survey 2021","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000},{"id":"simpsons2020x00","label":"Survey on the Simpsons tv show 2020","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000}],"id":"simpsons2020x00","label":"Survey on the Simpsons tv show 2020","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"communicationRequestConfiguration":false}
`; @@ -17703,7 +17703,7 @@ exports[`Select another survey (by site) 1`] = `
- {"allSurveys":[{"id":"vqs2021x00","label":"Everyday life and health survey 2021","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000},{"id":"simpsons2020x00","label":"Survey on the Simpsons tv show 2020","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000}],"id":"simpsons2020x00","label":"Survey on the Simpsons tv show 2020","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000} + {"allSurveys":[{"id":"vqs2021x00","label":"Everyday life and health survey 2021","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000},{"id":"simpsons2020x00","label":"Survey on the Simpsons tv show 2020","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000}],"id":"simpsons2020x00","label":"Survey on the Simpsons tv show 2020","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"communicationRequestConfiguration":false}
`; diff --git a/src/components/Review/__snapshots__/Review.test.jsx.snap b/src/components/Review/__snapshots__/Review.test.jsx.snap index 4f4a9a8..e55959d 100644 --- a/src/components/Review/__snapshots__/Review.test.jsx.snap +++ b/src/components/Review/__snapshots__/Review.test.jsx.snap @@ -4428,7 +4428,7 @@ exports[`Select another survey 1`] = `
- {"allSurveys":[{"id":"vqs2021x00","label":"Everyday life and health survey 2021","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000},{"id":"simpsons2020x00","label":"Survey on the Simpsons tv show 2020","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000}],"id":"simpsons2020x00","label":"Survey on the Simpsons tv show 2020","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000} + {"allSurveys":[{"id":"vqs2021x00","label":"Everyday life and health survey 2021","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000},{"id":"simpsons2020x00","label":"Survey on the Simpsons tv show 2020","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000}],"id":"simpsons2020x00","label":"Survey on the Simpsons tv show 2020","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"communicationRequestConfiguration":false}
`; diff --git a/src/components/SurveySelector/SurveySelector.jsx b/src/components/SurveySelector/SurveySelector.jsx index 7e9d961..5a08a19 100644 --- a/src/components/SurveySelector/SurveySelector.jsx +++ b/src/components/SurveySelector/SurveySelector.jsx @@ -17,6 +17,7 @@ function switchCurrent(surveyObj, idToSwitch) { switched.label = newSurvey.label; switched.collectionStartDate = newSurvey.collectionStartDate; switched.endDate = newSurvey.endDate; + switched.communicationRequestConfiguration = newSurvey.communicationRequestConfiguration ?? false; return switched; } diff --git a/src/components/Terminated/__snapshots__/Terminated.test.jsx.snap b/src/components/Terminated/__snapshots__/Terminated.test.jsx.snap index ba24386..36ead76 100644 --- a/src/components/Terminated/__snapshots__/Terminated.test.jsx.snap +++ b/src/components/Terminated/__snapshots__/Terminated.test.jsx.snap @@ -6596,7 +6596,7 @@ exports[`Select another survey 1`] = `
- {"allSurveys":[{"id":"vqs2021x00","label":"Everyday life and health survey 2021","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000},{"id":"simpsons2020x00","label":"Survey on the Simpsons tv show 2020","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000}],"id":"simpsons2020x00","label":"Survey on the Simpsons tv show 2020","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000} + {"allSurveys":[{"id":"vqs2021x00","label":"Everyday life and health survey 2021","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000},{"id":"simpsons2020x00","label":"Survey on the Simpsons tv show 2020","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000}],"id":"simpsons2020x00","label":"Survey on the Simpsons tv show 2020","managementStartDate":1576801000000,"interviewerStartDate":1575937000000,"identificationPhaseStartDate":1577233000000,"collectionStartDate":1577837800000,"collectionEndDate":1640996200000,"endDate":1641514600000,"communicationRequestConfiguration":false}
`; diff --git a/src/i18n/labels/labels_listSU.js b/src/i18n/labels/labels_listSU.js index 569b21b..721a2b6 100644 --- a/src/i18n/labels/labels_listSU.js +++ b/src/i18n/labels/labels_listSU.js @@ -59,6 +59,82 @@ const listSU = { fr: 'État du questionnaire', en: 'Questionnaire state', }, + totalRemindersLabel: { + fr: 'T Rel', + en: 'T Rem', + }, + totalReminders: { + fr: 'Total des relances', + en: 'Total reminders', + }, + latestReminderLabel: { + fr: "Rel n", + en: "Rem n", + }, + latestReminder: { + fr: "Relance la plus récente (relance enquêteur)", + en: "Latest reminder (interviewer reminder)", + }, + secondLatestReminder: { + fr: "Avant dernière relance (relance enquêteur)", + en: "Second latest reminder (interviewer reminder)", + }, + thirdLatestReminder: { + fr: "Avant avant dernière relance (relance enquêteur)", + en: "Third latest reminder (interviewer reminder)", + }, + fourthLatestReminder: { + fr: "Avant avant avant dernière relance (relance enquêteur)", + en: "Fourth latest reminder (interviewer reminder)", + }, + reminderEmailMedium: { + fr: "M", + en: "E" + }, + reminderMailMedium: { + fr: "C", + en: "M" + }, + reminderRefReason: { + fr: "Ref", + en: "Ref" + }, + reminderItjReason: { + fr: "IAJ", + en: "ITJ" + }, + contactOutcomeLabel: { + fr: "Bilan des contacts", + en: "Contact Outcome", + }, + contactOutcomeDateLabel: { + fr: "Date T", + en: "T Date", + }, + contactOutcomeDate: { + fr: "Date de la dernière transmission de l’unité", + en: "Latest transmission date", + }, + reminderMediumExportLabel: { + fr: "Mode", + en: "Medium", + }, + reminderReasonExportLabel: { + fr: "Type", + en: "Reason", + }, + reminderDateExportLabel: { + fr: "Date", + en: "Date", + }, + email: { + fr: "Mail", + en: "Email", + }, + mail: { + fr: "Courrier", + en: "Mail", + }, }; export default listSU; diff --git a/src/utils/Utils.js b/src/utils/Utils.js index e3909cc..46314cc 100644 --- a/src/utils/Utils.js +++ b/src/utils/Utils.js @@ -213,6 +213,19 @@ class Utils { return mainSort ? mainSortFunc(a, b) : 0; }; } + if (sortOn === 'contactOutcomeDate') { + return (a, b) => { + const dateA = a.contactOutcome.date; + const dateB = b.contactOutcome.date; + if(!dateA || !dateB){ + return dateA ? 1 * mult : -1 * mult; + } + if (dateA !== dateB) { + return (dateA < dateB ? -1 : 1) * mult; + } + return mainSort ? mainSortFunc(a, b) : 0; + }; + } if (sortOn === 'contact_outcome') { return (a, b) => { if (!a.contactOutcome && !!b.contactOutcome) {