diff --git a/cypress/fixtures/getSurveyUnitsSurveyOnSomething.json b/cypress/fixtures/getSurveyUnitsSurveyOnSomething.json index 1cacef7..faac9ec 100644 --- a/cypress/fixtures/getSurveyUnitsSurveyOnSomething.json +++ b/cypress/fixtures/getSurveyUnitsSurveyOnSomething.json @@ -1,290 +1,314 @@ [ - { - "id" : "1023", - "ssech" : "hgSkR29", - "location" : "95160", - "city" : "MONTMORENCY", - "finalizationDate": 1603347357468, - "interviewer" : { - "id" : "INTW5", - "interviewerFirstName" : "Chloé", - "interviewerLastName" : "Dupont" - } - }, - { - "id" : "4811", - "ssech" : "dlcB55jdf", - "location" : "90000", - "city" : "BELFORT", - "finalizationDate": 1603347357468, - "interviewer" : { - "id" : "INTW6", - "interviewerFirstName" : "Jacques", - "interviewerLastName" : "Boulanger" - } - }, - { - "id" : "1024", - "ssech" : "hgSkR29", - "location" : "95160", - "city" : "MONTMORENCY", - "finalizationDate": 1603347357468, - "interviewer" : { - "id" : "INTW5", - "interviewerFirstName" : "Chloé", - "interviewerLastName" : "Dupont" - } - }, - { - "id" : "4812", - "ssech" : "dlcB55jdf", - "location" : "90000", - "city" : "BELFORT", - "finalizationDate": 1603347357468, - "interviewer" : { - "id" : "INTW6", - "interviewerFirstName" : "Jacques", - "interviewerLastName" : "Boulanger" - } - }, - { - "id" : "1025", - "ssech" : "hgSkR29", - "location" : "95160", - "city" : "MONTMORENCY", - "finalizationDate": 1603347357468, - "interviewer" : { - "id" : "INTW5", - "interviewerFirstName" : "Chloé", - "interviewerLastName" : "Dupont" - } - }, - { - "id" : "4813", - "ssech" : "dlcB55jdf", - "location" : "95160", - "city" : "MONTMORENCY", - "finalizationDate": 1603347357468, - "interviewer" : { - "id" : "INTW6", - "interviewerFirstName" : "Jacques", - "interviewerLastName" : "Boulanger" - } - }, - { - "id" : "1027", - "ssech" : "hgSkR29", - "location" : "95160", - "city" : "MONTMORENCY", - "finalizationDate": 1603347357468, - "interviewer" : { - "id" : "INTW5", - "interviewerFirstName" : "Chloé", - "interviewerLastName" : "Dupont" - } - }, - { - "id" : "4815", - "ssech" : "dlcB55jdf", - "location" : "95160", - "city" : "MONTMORENCY", - "finalizationDate": 1603347357468, - "interviewer" : { - "id" : "INTW7", - "interviewerFirstName" : "Thierry", - "interviewerLastName" : "Fabres" - } - }, - { - "id" : "1028", - "ssech" : "hgSkR29", - "location" : "95160", - "city" : "MONTMORENCY", - "finalizationDate": 1603347357468, - "interviewer" : { - "id" : "INTW5", - "interviewerFirstName" : "Chloé", - "interviewerLastName" : "Dupont" - } - }, - { - "id" : "4816", - "ssech" : "dlcB55jdf", - "location" : "90000", - "city" : "BELFORT", - "finalizationDate": 1603347357468, - "interviewer" : { - "id" : "INTW6", - "interviewerFirstName" : "Jacques", - "interviewerLastName" : "Boulanger" - } - }, - { - "id" : "1029", - "ssech" : "hgSkR29", - "location" : "95160", - "city" : "MONTMORENCY", - "finalizationDate": 1603347357468, - "interviewer" : { - "id" : "INTW7", - "interviewerFirstName" : "Thierry", - "interviewerLastName" : "Fabres" - } - }, - { - "id" : "4817", - "ssech" : "dlcB55jdf", - "location" : "90000", - "city" : "BELFORT", - "finalizationDate": 1603347357468, - "interviewer" : { - "id" : "INTW6", - "interviewerFirstName" : "Jacques", - "interviewerLastName" : "Boulanger" - } - }, - { - "id" : "1030", - "ssech" : "hgSkR29", - "location" : "95160", - "city" : "MONTMORENCY", - "finalizationDate": 1603347357468, - "interviewer" : { - "id" : "INTW5", - "interviewerFirstName" : "Chloé", - "interviewerLastName" : "Dupont" - } - }, - { - "id" : "4818", - "ssech" : "dlcB55jdf", - "location" : "95160", - "city" : "MONTMORENCY", - "finalizationDate": 1603347357468, - "interviewer" : { - "id" : "INTW6", - "interviewerFirstName" : "Jacques", - "interviewerLastName" : "Boulanger" - } - }, - { - "id" : "3819", - "ssech" : "dlcB55jdf", - "location" : "90000", - "city" : "BELFORT", - "finalizationDate": 1603347357468, - "interviewer" : { - "id" : "INTW6", - "interviewerFirstName" : "Jacques", - "interviewerLastName" : "Boulanger" - } - }, - { - "id" : "3820", - "ssech" : "dlcB55jdf", - "location" : "90000", - "city" : "BELFORT", - "finalizationDate": 1603347357468, - "interviewer" : { - "id" : "INTW6", - "interviewerFirstName" : "Jacques", - "interviewerLastName" : "Boulanger" - } - }, - { - "id" : "3821", - "ssech" : "dlcB55jdf", - "location" : "90000", - "city" : "BELFORT", - "finalizationDate": 1603347357468, - "interviewer" : { - "id" : "INTW6", - "interviewerFirstName" : "Jacques", - "interviewerLastName" : "Boulanger" - } - }, - { - "id" : "3822", - "ssech" : "dlcB55jdf", - "location" : "95160", - "city" : "MONTMORENCY", - "finalizationDate": 1603347357468, - "interviewer" : { - "id" : "INTW6", - "interviewerFirstName" : "Jacques", - "interviewerLastName" : "Boulanger" - } - }, - { - "id" : "3823", - "ssech" : "dlcB55jdf", - "location" : "95160", - "city" : "MONTMORENCY", - "finalizationDate": 1603347357468, - "interviewer" : { - "id" : "INTW6", - "interviewerFirstName" : "Jacques", - "interviewerLastName" : "Boulanger" - } - }, - { - "id" : "3824", - "ssech" : "dlcB55jdf", - "location" : "95160", - "city" : "MONTMORENCY", - "finalizationDate": 1603347357468, - "interviewer" : { - "id" : "INTW6", - "interviewerFirstName" : "Jacques", - "interviewerLastName" : "Boulanger" - } - }, - { - "id" : "3825", - "ssech" : "dlcB55jdf", - "location" : "95160", - "city" : "MONTMORENCY", - "finalizationDate": 1603347357468, - "interviewer" : { - "id" : "INTW6", - "interviewerFirstName" : "Jacques", - "interviewerLastName" : "Boulanger" - } - }, - { - "id" : "3826", - "ssech" : "dlcB55jdf", - "location" : "95160", - "city" : "MONTMORENCY", - "finalizationDate": 1603347357468, - "interviewer" : { - "id" : "INTW6", - "interviewerFirstName" : "Jacques", - "interviewerLastName" : "Boulanger" - } - }, - { - "id" : "3827", - "ssech" : "dlcB55jdf", - "location" : "95160", - "city" : "MONTMORENCY", - "finalizationDate": 1603347357468, - "interviewer" : { - "id" : "INTW6", - "interviewerFirstName" : "Jacques", - "interviewerLastName" : "Boulanger" - } - }, - { - "id" : "3828", - "ssech" : "dlcB55jdf", - "location" : "95160", - "city" : "MONTMORENCY", - "finalizationDate": 1603347357468, - "interviewer" : { - "id" : "INTW6", - "interviewerFirstName" : "Jacques", - "interviewerLastName" : "Boulanger" - } - } - ] \ No newline at end of file + { + "id" : "1023", + "displayName" : "1023", + "ssech" : "hgSkR29", + "location" : "95160", + "city" : "MONTMORENCY", + "finalizationDate": 1603347357468, + "interviewer" : { + "id" : "INTW5", + "interviewerFirstName" : "Chloé", + "interviewerLastName" : "Dupont" + } + }, + { + "id" : "4811", + "displayName" : "4811", + "ssech" : "dlcB55jdf", + "location" : "90000", + "city" : "BELFORT", + "finalizationDate": 1603347357468, + "interviewer" : { + "id" : "INTW6", + "interviewerFirstName" : "Jacques", + "interviewerLastName" : "Boulanger" + } + }, + { + "id" : "1024", + "displayName" : "1024", + "ssech" : "hgSkR29", + "location" : "95160", + "city" : "MONTMORENCY", + "finalizationDate": 1603347357468, + "interviewer" : { + "id" : "INTW5", + "interviewerFirstName" : "Chloé", + "interviewerLastName" : "Dupont" + } + }, + { + "id" : "4812", + "displayName" : "4812", + "ssech" : "dlcB55jdf", + "location" : "90000", + "city" : "BELFORT", + "finalizationDate": 1603347357468, + "interviewer" : { + "id" : "INTW6", + "interviewerFirstName" : "Jacques", + "interviewerLastName" : "Boulanger" + } + }, + { + "id" : "1025", + "displayName" : "1025", + "ssech" : "hgSkR29", + "location" : "95160", + "city" : "MONTMORENCY", + "finalizationDate": 1603347357468, + "interviewer" : { + "id" : "INTW5", + "interviewerFirstName" : "Chloé", + "interviewerLastName" : "Dupont" + } + }, + { + "id" : "4813", + "displayName" : "4813", + "ssech" : "dlcB55jdf", + "location" : "95160", + "city" : "MONTMORENCY", + "finalizationDate": 1603347357468, + "interviewer" : { + "id" : "INTW6", + "interviewerFirstName" : "Jacques", + "interviewerLastName" : "Boulanger" + } + }, + { + "id" : "1027", + "displayName" : "1027", + "ssech" : "hgSkR29", + "location" : "95160", + "city" : "MONTMORENCY", + "finalizationDate": 1603347357468, + "interviewer" : { + "id" : "INTW5", + "interviewerFirstName" : "Chloé", + "interviewerLastName" : "Dupont" + } + }, + { + "id" : "4815", + "displayName" : "4815", + "ssech" : "dlcB55jdf", + "location" : "95160", + "city" : "MONTMORENCY", + "finalizationDate": 1603347357468, + "interviewer" : { + "id" : "INTW7", + "interviewerFirstName" : "Thierry", + "interviewerLastName" : "Fabres" + } + }, + { + "id" : "1028", + "displayName" : "1028", + "ssech" : "hgSkR29", + "location" : "95160", + "city" : "MONTMORENCY", + "finalizationDate": 1603347357468, + "interviewer" : { + "id" : "INTW5", + "interviewerFirstName" : "Chloé", + "interviewerLastName" : "Dupont" + } + }, + { + "id" : "4816", + "displayName" : "4816", + "ssech" : "dlcB55jdf", + "location" : "90000", + "city" : "BELFORT", + "finalizationDate": 1603347357468, + "interviewer" : { + "id" : "INTW6", + "interviewerFirstName" : "Jacques", + "interviewerLastName" : "Boulanger" + } + }, + { + "id" : "1029", + "displayName" : "1029", + "ssech" : "hgSkR29", + "location" : "95160", + "city" : "MONTMORENCY", + "finalizationDate": 1603347357468, + "interviewer" : { + "id" : "INTW7", + "interviewerFirstName" : "Thierry", + "interviewerLastName" : "Fabres" + } + }, + { + "id" : "4817", + "displayName" : "4817", + "ssech" : "dlcB55jdf", + "location" : "90000", + "city" : "BELFORT", + "finalizationDate": 1603347357468, + "interviewer" : { + "id" : "INTW6", + "interviewerFirstName" : "Jacques", + "interviewerLastName" : "Boulanger" + } + }, + { + "id" : "1030", + "displayName" : "1030", + "ssech" : "hgSkR29", + "location" : "95160", + "city" : "MONTMORENCY", + "finalizationDate": 1603347357468, + "interviewer" : { + "id" : "INTW5", + "interviewerFirstName" : "Chloé", + "interviewerLastName" : "Dupont" + } + }, + { + "id" : "4818", + "displayName" : "4818", + "ssech" : "dlcB55jdf", + "location" : "95160", + "city" : "MONTMORENCY", + "finalizationDate": 1603347357468, + "interviewer" : { + "id" : "INTW6", + "interviewerFirstName" : "Jacques", + "interviewerLastName" : "Boulanger" + } + }, + { + "id" : "3819", + "displayName" : "3819", + "ssech" : "dlcB55jdf", + "location" : "90000", + "city" : "BELFORT", + "finalizationDate": 1603347357468, + "interviewer" : { + "id" : "INTW6", + "interviewerFirstName" : "Jacques", + "interviewerLastName" : "Boulanger" + } + }, + { + "id" : "3820", + "displayName" : "3820", + "ssech" : "dlcB55jdf", + "location" : "90000", + "city" : "BELFORT", + "finalizationDate": 1603347357468, + "interviewer" : { + "id" : "INTW6", + "interviewerFirstName" : "Jacques", + "interviewerLastName" : "Boulanger" + } + }, + { + "id" : "3821", + "displayName" : "3821", + "ssech" : "dlcB55jdf", + "location" : "90000", + "city" : "BELFORT", + "finalizationDate": 1603347357468, + "interviewer" : { + "id" : "INTW6", + "interviewerFirstName" : "Jacques", + "interviewerLastName" : "Boulanger" + } + }, + { + "id" : "3822", + "displayName" : "3822", + "ssech" : "dlcB55jdf", + "location" : "95160", + "city" : "MONTMORENCY", + "finalizationDate": 1603347357468, + "interviewer" : { + "id" : "INTW6", + "interviewerFirstName" : "Jacques", + "interviewerLastName" : "Boulanger" + } + }, + { + "id" : "3823", + "displayName" : "3823", + "ssech" : "dlcB55jdf", + "location" : "95160", + "city" : "MONTMORENCY", + "finalizationDate": 1603347357468, + "interviewer" : { + "id" : "INTW6", + "interviewerFirstName" : "Jacques", + "interviewerLastName" : "Boulanger" + } + }, + { + "id" : "3824", + "displayName" : "3824", + "ssech" : "dlcB55jdf", + "location" : "95160", + "city" : "MONTMORENCY", + "finalizationDate": 1603347357468, + "interviewer" : { + "id" : "INTW6", + "interviewerFirstName" : "Jacques", + "interviewerLastName" : "Boulanger" + } + }, + { + "id" : "3825", + "displayName" : "3825", + "ssech" : "dlcB55jdf", + "location" : "95160", + "city" : "MONTMORENCY", + "finalizationDate": 1603347357468, + "interviewer" : { + "id" : "INTW6", + "interviewerFirstName" : "Jacques", + "interviewerLastName" : "Boulanger" + } + }, + { + "id" : "3826", + "displayName" : "3826", + "ssech" : "dlcB55jdf", + "location" : "95160", + "city" : "MONTMORENCY", + "finalizationDate": 1603347357468, + "interviewer" : { + "id" : "INTW6", + "interviewerFirstName" : "Jacques", + "interviewerLastName" : "Boulanger" + } + }, + { + "id" : "3827", + "displayName" : "3827", + "ssech" : "dlcB55jdf", + "location" : "95160", + "city" : "MONTMORENCY", + "finalizationDate": 1603347357468, + "interviewer" : { + "id" : "INTW6", + "interviewerFirstName" : "Jacques", + "interviewerLastName" : "Boulanger" + } + }, + { + "id" : "3828", + "displayName" : "3828", + "ssech" : "dlcB55jdf", + "location" : "95160", + "city" : "MONTMORENCY", + "finalizationDate": 1603347357468, + "interviewer" : { + "id" : "INTW6", + "interviewerFirstName" : "Jacques", + "interviewerLastName" : "Boulanger" + } + } +] \ No newline at end of file diff --git a/cypress/fixtures/getSurveyUnitsVqs.json b/cypress/fixtures/getSurveyUnitsVqs.json index 0e04a59..d4e5bc2 100644 --- a/cypress/fixtures/getSurveyUnitsVqs.json +++ b/cypress/fixtures/getSurveyUnitsVqs.json @@ -1,6 +1,7 @@ [ { "id" : "1032", + "displayName" : "1032", "ssech" : "hgSkR29", "location" : "95160", "city" : "MONTMORENCY", @@ -13,6 +14,7 @@ }, { "id" : "4819", + "displayName" : "4819", "ssech" : "dlcB55jdf", "location" : "90000", "city" : "BELFORT", @@ -24,4 +26,3 @@ } } ] - diff --git a/package.json b/package.json index 052a87b..a64356e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sonor", - "version": "0.5.35", + "version": "0.6.0", "private": true, "dependencies": { "@tanstack/react-query": "4.0.5", diff --git a/sonar-project.properties b/sonar-project.properties index 8187f9c..d3a8ae1 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -4,5 +4,5 @@ sonar.organization=inseefr # exclude tests files for code duplication evaluation sonar.sources = src -sonar.exclusions = src/tests/**, src/components/**/__snapshots__/* , //src/tests/** +sonar.exclusions = src/tests/**, src/components/**/__snapshots__/* , src/components/**/*.test.jsx, components/**/*.test.jsx, //src/tests/** sonar.javascript.lcov.reportPaths = coverage/lcov.info \ No newline at end of file diff --git a/src/components/Close/Close.test.jsx b/src/components/Close/Close.test.jsx index b4676be..2c712f2 100644 --- a/src/components/Close/Close.test.jsx +++ b/src/components/Close/Close.test.jsx @@ -1,34 +1,46 @@ // Link.react.test.js -import React from 'react'; -import { act } from 'react-dom/test-utils'; +import React from "react"; +import { act } from "react-dom/test-utils"; import { - render, screen, fireEvent, cleanup, waitForElement, wait, -} from '@testing-library/react'; -import { Router, Route, Switch } from 'react-router-dom'; -import { createMemoryHistory } from 'history'; -import DataFormatter from '../../utils/DataFormatter'; -import Close from './Close'; -import mocks from '../../tests/mocks'; + render, + screen, + fireEvent, + cleanup, + waitForElement, + wait, +} from "@testing-library/react"; +import { Router, Route, Switch } from "react-router-dom"; +import { createMemoryHistory } from "history"; +import DataFormatter from "../../utils/DataFormatter"; +import Close from "./Close"; +import mocks from "../../tests/mocks"; const history = createMemoryHistory(); const toLocaleDateString = Date.prototype.toLocaleString; -Date.prototype.toLocaleDateString = function() { - return toLocaleDateString.call(this, 'en-EN', { timeZone: 'UTC',year: "numeric", month: "numeric", day: "numeric" }); +Date.prototype.toLocaleDateString = function () { + return toLocaleDateString.call(this, "en-EN", { + timeZone: "UTC", + year: "numeric", + month: "numeric", + day: "numeric", + }); }; const OriginalDate = global.Date; jest - .spyOn(global, 'Date') - .mockImplementation((a) => (a ? new OriginalDate(a) : new OriginalDate('2020-08-20T11:01:58.135Z'))); + .spyOn(global, "Date") + .mockImplementation((a) => + a ? new OriginalDate(a) : new OriginalDate("2020-08-20T11:01:58.135Z") + ); Date.now = jest.fn(() => 1597916474000); beforeEach(() => { - history.push('/close/vqs2021x00'); + history.push("/close/vqs2021x00"); }); afterEach(cleanup); -jest.mock('../../utils/DataFormatter'); +jest.mock("../../utils/DataFormatter"); const survey = mocks.surveyVqs; const resp = mocks.formattedCloseData; @@ -36,13 +48,22 @@ const resp = mocks.formattedCloseData; const TestingRouter = ({ ComponentWithRedirection }) => ( - } /> + } + /> (
-
{JSON.stringify(routeProps.history.location.pathname)}
-
{!routeProps.history.location || !routeProps.history.location.survey || JSON.stringify(routeProps.history.location.survey)}
+
+ {JSON.stringify(routeProps.history.location.pathname)} +
+
+ {!routeProps.history.location || + !routeProps.history.location.survey || + JSON.stringify(routeProps.history.location.survey)} +
)} /> @@ -51,83 +72,99 @@ const TestingRouter = ({ ComponentWithRedirection }) => ( ); DataFormatter.mockImplementation(() => ({ - getDataForClosePage: (c) => (setTimeout(() => { c(resp); }, 3)), + getDataForClosePage: (c) => + setTimeout(() => { + c(resp); + }, 3), })); const mockDataRetreiver = new DataFormatter(); -it('Component is correctly displayed', async () => { +it("Component is correctly displayed", async () => { const component = render( - , +
+ ); + await waitForElement(() => + screen.getByTestId("TableHeader_interviewer_name") ); - await waitForElement(() => screen.getByTestId('TableHeader_interviewer_name')); // Should match snapshot (rows displayed) expect(component).toMatchSnapshot(); }); -it('Sort by interviewer name', async () => { +it("Sort by interviewer name", async () => { const component = render( - , + ); - await waitForElement(() => screen.getByTestId('TableHeader_interviewer_name')); - screen.getByTestId('TableHeader_interviewer_name').click(); + await waitForElement(() => + screen.getByTestId("TableHeader_interviewer_name") + ); + screen.getByTestId("TableHeader_interviewer_name").click(); // Should match snapshot (rows sorted by name) expect(component).toMatchSnapshot(); }); -it('Change page', async () => { +it("Change page", async () => { const component = render( - , + ); - await waitForElement(() => screen.getByTestId('TableHeader_interviewer_name')); - screen.getByTestId('pagination-nav').lastChild.firstChild.click(); + await waitForElement(() => + screen.getByTestId("TableHeader_interviewer_name") + ); + screen.getByTestId("pagination-nav").lastChild.firstChild.click(); // Should match snapshot (rows displayed have changed) expect(component).toMatchSnapshot(); }); -it('Change pagination size', async () => { +it("Change pagination size", async () => { const component = render( - , + + ); + await waitForElement(() => + screen.getByTestId("TableHeader_interviewer_name") ); - await waitForElement(() => screen.getByTestId('TableHeader_interviewer_name')); act(() => { - fireEvent.change(component.getByTestId('pagination-size-selector'), { target: { value: '10' } }); + fireEvent.change(component.getByTestId("pagination-size-selector"), { + target: { value: "10" }, + }); }); // Should match snapshot (all 8 rows are now displayed) expect(component).toMatchSnapshot(); }); -it('Export table', async () => { +it("Export table", async () => { const component = render( - , + + ); + await waitForElement(() => + screen.getByTestId("TableHeader_interviewer_name") ); - await waitForElement(() => screen.getByTestId('TableHeader_interviewer_name')); const realRemoveFunc = HTMLAnchorElement.prototype.remove; const removeElmMock = jest.fn(); HTMLAnchorElement.prototype.remove = removeElmMock; - const fileTitle = 'UE_à_clore_8202020.csv'; - const fileContent = 'data:text/csv;charset=utf-8,%EF%BB%BFSurvey;Identifier;Interviewer;Ssech;Department;Town;Provisional%20state%0ASimpsons;1023;Dupont%20Chlo%C3%A9;hgSkR29;95;MONTMORENCY;ANS%0ASimpsons;4811;Boulanger%20Jacques;dlcB55jdf;90;BELFORT;ANS%0ASimpsons;1024;Dupont%20Chlo%C3%A9;hgSkR29;95;MONTMORENCY;ANS%0AVQS;4812;Boulanger%20Jacques;dlcB55jdf;90;BELFORT;ANS%0AVQS;1025;Dupont%20Chlo%C3%A9;hgSkR29;95;MONTMORENCY;ANS%0AVQS;4813;Boulanger%20Jacques;dlcB55jdf;90;BELFORT;ANS%0AVQS;1027;Dupont%20Chlo%C3%A9;hgSkR29;95;MONTMORENCY;ANS%0AVQS;4815;Fabres%20Thierry;dlcB55jdf;90;BELFORT;ANS%0AVQS;1028;Dupont%20Chlo%C3%A9;hgSkR29;95;MONTMORENCY;ANS%0AVQS;4816;Boulanger%20Jacques;dlcB55jdf;90;BELFORT;ANS%0AVQS;1029;Fabres%20Thierry;hgSkR29;95;MONTMORENCY;ANS%0AVQS;4817;Boulanger%20Jacques;dlcB55jdf;90;BELFORT;ANS%0AVQS;1030;Dupont%20Chlo%C3%A9;hgSkR29;95;MONTMORENCY;ANS%0ALC%202020;4818;Boulanger%20Jacques;dlcB55jdf;90;BELFORT;ANS%0ALC%202020;1032;Dupont%20Chlo%C3%A9;hgSkR29;95;MONTMORENCY;ANS%0ALC%202020;4819;Boulanger%20Jacques;dlcB55jdf;90;BELFORT;ANS'; - screen.getByTestId('export-button').click(); - const downnloadLink = component.baseElement.querySelector('a[download]'); + const fileTitle = "UE_à_clore_8202020.csv"; + const fileContent = + "data:text/csv;charset=utf-8,%EF%BB%BFSurvey;Identifier;Survey%20unit%20identifier;Interviewer;Ssech;Department;Town;Provisional%20state%0ASimpsons;1023;1023;Dupont%20Chlo%C3%A9;hgSkR29;95;MONTMORENCY;ANS%0ASimpsons;4811;4811;Boulanger%20Jacques;dlcB55jdf;90;BELFORT;ANS%0ASimpsons;1024;1024;Dupont%20Chlo%C3%A9;hgSkR29;95;MONTMORENCY;ANS%0AVQS;4812;4812;Boulanger%20Jacques;dlcB55jdf;90;BELFORT;ANS%0AVQS;1025;1025;Dupont%20Chlo%C3%A9;hgSkR29;95;MONTMORENCY;ANS%0AVQS;4813;4813;Boulanger%20Jacques;dlcB55jdf;90;BELFORT;ANS%0AVQS;1027;1027;Dupont%20Chlo%C3%A9;hgSkR29;95;MONTMORENCY;ANS%0AVQS;4815;4815;Fabres%20Thierry;dlcB55jdf;90;BELFORT;ANS%0AVQS;1028;1028;Dupont%20Chlo%C3%A9;hgSkR29;95;MONTMORENCY;ANS%0AVQS;4816;4816;Boulanger%20Jacques;dlcB55jdf;90;BELFORT;ANS%0AVQS;1029;1029;Fabres%20Thierry;hgSkR29;95;MONTMORENCY;ANS%0AVQS;4817;4817;Boulanger%20Jacques;dlcB55jdf;90;BELFORT;ANS%0AVQS;1030;1030;Dupont%20Chlo%C3%A9;hgSkR29;95;MONTMORENCY;ANS%0ALC%202020;4818;4818;Boulanger%20Jacques;dlcB55jdf;90;BELFORT;ANS%0ALC%202020;1032;1032;Dupont%20Chlo%C3%A9;hgSkR29;95;MONTMORENCY;ANS%0ALC%202020;4819;4819;Boulanger%20Jacques;dlcB55jdf;90;BELFORT;ANS"; + screen.getByTestId("export-button").click(); + const downnloadLink = component.baseElement.querySelector("a[download]"); // Check that file title is correct - expect(downnloadLink.getAttribute('download')).toEqual(fileTitle); + expect(downnloadLink.getAttribute("download")).toEqual(fileTitle); // Check that file content is correct - expect(downnloadLink.getAttribute('href')).toEqual(fileContent); + expect(downnloadLink.getAttribute("href")).toEqual(fileContent); // Should match snapshot (with link attached) expect(component).toMatchSnapshot(); @@ -137,4 +174,4 @@ it('Export table', async () => { HTMLAnchorElement.prototype.remove = realRemoveFunc; downnloadLink.remove(); -}); \ No newline at end of file +}); diff --git a/src/components/Close/CloseSUTable.jsx b/src/components/Close/CloseSUTable.jsx index 74672e7..6e5a0a5 100644 --- a/src/components/Close/CloseSUTable.jsx +++ b/src/components/Close/CloseSUTable.jsx @@ -1,38 +1,46 @@ -import React from 'react'; -import Button from 'react-bootstrap/Button'; -import { Col, Row } from 'react-bootstrap'; -import Table from 'react-bootstrap/Table'; -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 CloseSurveyUnitLine from './CloseSurveyUnitLine'; -import D from '../../i18n'; -import Utils from '../../utils/Utils'; +import React from "react"; +import Button from "react-bootstrap/Button"; +import { Col, Row } from "react-bootstrap"; +import Table from "react-bootstrap/Table"; +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 CloseSurveyUnitLine from "./CloseSurveyUnitLine"; +import D from "../../i18n"; +import Utils from "../../utils/Utils"; function makeTableForExport(data) { - const header = [[ - D.survey, - D.identifier, - D.interviewer, - D.ssech, - D.department, - D.town, - D.state, - ]]; + const header = [ + [ + D.survey, + D.identifier, + D.displayNameDownload, + D.interviewer, + D.ssech, + D.department, + D.town, + D.state, + ], + ]; - return header.concat(data.map((line) => ([ - line.campaign, - line.id, - `${line.interviewer?.interviewerLastName ?? ""} ${line.interviewer?.interviewerFirstName ?? ""}`, - line.ssech, - line.location ? line.location.substring(0, 2) : null, - line.city, - line.state, - ]))); + return header.concat( + data.map((line) => [ + line.campaign, + line.id, + line.displayName, + `${line.interviewer?.interviewerLastName ?? ""} ${ + line.interviewer?.interviewerFirstName ?? "" + }`, + line.ssech, + line.location ? line.location.substring(0, 2) : null, + line.city, + line.state, + ]) + ); } class CloseSUTable extends React.Component { @@ -41,10 +49,13 @@ class CloseSUTable extends React.Component { this.state = { pagination: { size: 10, page: 1 }, displayedLines: props.data, - checkboxArray: props.data?.map((element) => {return {id: element.id, isChecked: false}}) ?? [], + checkboxArray: + props.data?.map((element) => { + return { id: element.id, isChecked: false }; + }) ?? [], checkAll: false, show: false, - stateModified: '', + stateModified: "", }; } @@ -52,21 +63,32 @@ class CloseSUTable extends React.Component { const { data } = this.props; if (prevProps.data !== data) { this.setState({ displayedLines: data }); - const newCheckboxArray = data?.map((element) => {return {id: element.id, isChecked: false}}) ?? [] + const newCheckboxArray = + data?.map((element) => { + return { id: element.id, isChecked: false }; + }) ?? []; this.setState({ checkboxArray: newCheckboxArray, checkAll: false }); } } handlePageChange(pagination) { - const checkAll = Utils.getCheckAllValue(this.state.checkboxArray, pagination); + const checkAll = Utils.getCheckAllValue( + this.state.checkboxArray, + pagination + ); this.setState({ pagination, checkAll }); } handleCheckAll(e) { - const { checkboxArray, displayedLines, pagination} = this.state; - - const newCheckboxArray = Utils.handleCheckAll(e.target.checked, checkboxArray, displayedLines, pagination); - + const { checkboxArray, displayedLines, pagination } = this.state; + + const newCheckboxArray = Utils.handleCheckAll( + e.target.checked, + checkboxArray, + displayedLines, + pagination + ); + this.setState({ checkboxArray: newCheckboxArray, checkAll: e.target.checked, @@ -76,7 +98,12 @@ class CloseSUTable extends React.Component { toggleCheckBox(id) { const { checkboxArray, displayedLines, pagination } = this.state; - const {newCheckboxArray, newCheckAll} = Utils.getOnToggleChanges(id, checkboxArray, displayedLines, pagination); + const { newCheckboxArray, newCheckAll } = Utils.getOnToggleChanges( + id, + checkboxArray, + displayedLines, + pagination + ); this.setState({ checkboxArray: newCheckboxArray, @@ -94,28 +121,32 @@ class CloseSUTable extends React.Component { isDisabled() { const { checkboxArray } = this.state; - return !checkboxArray.some((element) => element.isChecked ); + return !checkboxArray.some((element) => element.isChecked); } validate() { const { validateChangingState } = this.props; const { checkboxArray, stateModified } = this.state; const lstSUChangingState = checkboxArray - .filter((su) => (su.isChecked)) - .map((su) => (su.id)); + .filter((su) => su.isChecked) + .map((su) => su.id); validateChangingState(lstSUChangingState, stateModified); } handleExport() { const { data } = this.props; - const fileLabel = 'UE_à_clore'; - const title = `${fileLabel}_${new Date().toLocaleDateString().replace(/\//g, '')}.csv`.replace(/ /g, '_'); + const fileLabel = "UE_à_clore"; + const title = `${fileLabel}_${new Date() + .toLocaleDateString() + .replace(/\//g, "")}.csv`.replace(/ /g, "_"); const table = makeTableForExport(data); - const csvContent = `data:text/csv;charset=utf-8,\ufeff${table.map((e) => e.join(';')).join('\n')}`; + const csvContent = `data:text/csv;charset=utf-8,\ufeff${table + .map((e) => e.join(";")) + .join("\n")}`; const encodedUri = encodeURI(csvContent); - const link = document.createElement('a'); - link.setAttribute('href', encodedUri); - link.setAttribute('download', title); + const link = document.createElement("a"); + link.setAttribute("href", encodedUri); + link.setAttribute("download", title); document.body.appendChild(link); link.click(); link.remove(); @@ -123,7 +154,9 @@ class CloseSUTable extends React.Component { updateLines(matchingLines) { const { pagination, checkboxArray } = this.state; - const newCheckboxArray = checkboxArray.map((element) => {return {id :element.id, isChecked: false}}) + const newCheckboxArray = checkboxArray.map((element) => { + return { id: element.id, isChecked: false }; + }); this.setState({ checkboxArray: newCheckboxArray, checkAll: false, @@ -133,192 +166,255 @@ class CloseSUTable extends React.Component { } render() { + const { data, sort, handleSort, isLoading } = this.props; + const fieldsToSearch = [ + "campaign", + "displayName", + "city", + "state", + "interviewer", + ]; const { - data, sort, handleSort, isLoading, - } = this.props; - const fieldsToSearch = ['campaign', 'id', 'city', 'state', 'interviewer']; - const { - pagination, displayedLines, checkboxArray, checkAll, show, stateModified, + pagination, + displayedLines, + checkboxArray, + checkAll, + show, + stateModified, } = this.state; - const toggleCheckBox = (i) => { this.toggleCheckBox(i); }; - function handleSortFunct(property) { return () => { handleSort(property); }; } + const toggleCheckBox = (i) => { + this.toggleCheckBox(i); + }; + function handleSortFunct(property) { + return () => { + handleSort(property); + }; + } return ( {D.unprocessedSurveyUnitsToClose} - {isLoading ? '' : data.length} - {!data.length - || ( - - )} + {isLoading ? "" : data.length} + {!data.length || ( + + )} - { - isLoading - ? - : ( - <> - { - data.length > 0 - ? ( -
- - - this.updateLines(matchinglines)} - /> - - - this.handlePageChange(newPagination)} - /> - - - - {D.result} - {displayedLines.length} - / - {data.length} -   - {D.units} - - - - - - - - - - - - - - - - - - - {displayedLines - .slice( - (pagination.page - 1) * pagination.size, - Math.min(pagination.page * pagination.size, displayedLines.length), - ) - .map((line) => { - const element = checkboxArray.find((checkbox) => checkbox.id === line.id) - return ( - toggleCheckBox(line.id)} - /> - )})} - -
- this.handleCheckAll(e)} /> - - {D.survey} - - - {D.identifier} - - - {D.interviewer} - - - {D.ssech} - - - {D.identificationState} - - - {D.contactOutcome} - - - {D.questionnaireState} - - - {D.state} - -
-
- - { this.handlePageChange(newPagination); }} - numberOfItems={displayedLines.length} + {isLoading ? ( + + ) : ( + <> + {data.length > 0 ? ( +
+ + + + this.updateLines(matchinglines) + } + /> + + + + this.handlePageChange(newPagination) + } + /> + + + + {D.result} + {displayedLines.length}/{data.length} +   + {D.units} + + + + + + + + + + + + + + + + + + + {displayedLines + .slice( + (pagination.page - 1) * pagination.size, + Math.min( + pagination.page * pagination.size, + displayedLines.length + ) + ) + .map((line) => { + const element = checkboxArray.find( + (checkbox) => checkbox.id === line.id + ); + return ( + toggleCheckBox(line.id)} /> - - this.handleClose()}> - - {D.modaleModifiedText} - - - - {D.state} - this.setState({ stateModified: e.target.value })} - > - - - - - - - - - - - - - - - ) - : {D.noListSuToDisplay} - } - + ); + })} + +
+ this.handleCheckAll(e)} + /> + + {D.survey} + + + {D.identifier} + + + {D.interviewer} + + + {D.ssech} + + + {D.identificationState} + + + {D.contactOutcome} + + + {D.questionnaireState} + + + {D.state} + +
+
+ + { + this.handlePageChange(newPagination); + }} + numberOfItems={displayedLines.length} + /> +
+ this.handleClose()}> + + {D.modaleModifiedText} + + + + {D.state} + + this.setState({ stateModified: e.target.value }) + } + > + + + + + + + + + + + + + +
+ ) : ( + {D.noListSuToDisplay} )} + + )} ); } diff --git a/src/components/Close/CloseSurveyUnitLine.jsx b/src/components/Close/CloseSurveyUnitLine.jsx index a05ffc9..7f541ac 100644 --- a/src/components/Close/CloseSurveyUnitLine.jsx +++ b/src/components/Close/CloseSurveyUnitLine.jsx @@ -3,7 +3,7 @@ import React from 'react'; function CloseSurveyUnitLine({ lineData, isChecked, updateFunc }) { const { - campaign, id, ssech, contactOutcome, questionnaireState, interviewer, closingCause, identificationState + campaign, id,displayName, ssech, contactOutcome, questionnaireState, interviewer, closingCause, identificationState } = lineData; return ( @@ -11,7 +11,7 @@ function CloseSurveyUnitLine({ lineData, isChecked, updateFunc }) { updateFunc()} /> {campaign} - {id} + {displayName} {`${interviewer?.interviewerLastName ?? ""} ${interviewer?.interviewerFirstName ?? ""}`} {ssech} {identificationState ? D[identificationState] : ''} diff --git a/src/components/Close/__snapshots__/Close.test.jsx.snap b/src/components/Close/__snapshots__/Close.test.jsx.snap index bd11add..fcb7056 100644 --- a/src/components/Close/__snapshots__/Close.test.jsx.snap +++ b/src/components/Close/__snapshots__/Close.test.jsx.snap @@ -156,7 +156,7 @@ Object { class="fa fa-fw fa-caret-down sortIconDown iconInactive" /> @@ -714,7 +714,7 @@ Object { class="fa fa-fw fa-caret-down sortIconDown iconInactive" /> @@ -1329,7 +1329,7 @@ Object { class="fa fa-fw fa-caret-down sortIconDown iconInactive" /> @@ -2059,7 +2059,7 @@ Object { class="fa fa-fw fa-caret-down sortIconDown iconInactive" /> @@ -2846,7 +2846,7 @@ Object { class="fa fa-fw fa-caret-down sortIconDown iconInactive" /> @@ -3576,7 +3576,7 @@ Object { class="fa fa-fw fa-caret-down sortIconDown iconInactive" /> @@ -4363,7 +4363,7 @@ Object { class="fa fa-fw fa-caret-down sortIconDown iconInactive" /> @@ -4942,7 +4942,7 @@ Object {
, "container":
@@ -5097,7 +5097,7 @@ Object { class="fa fa-fw fa-caret-down sortIconDown iconInactive" /> diff --git a/src/components/ListSU/ListSU.jsx b/src/components/ListSU/ListSU.jsx index a9036aa..273e0a7 100644 --- a/src/components/ListSU/ListSU.jsx +++ b/src/components/ListSU/ListSU.jsx @@ -77,7 +77,7 @@ function ListSU({ useEffect(() => { if (sort.sortOn === null) { - handleSort('id', true); + handleSort('displayName', true); } }, [data, handleSort, sort.sortOn]); diff --git a/src/components/ListSU/ListSU.test.jsx b/src/components/ListSU/ListSU.test.jsx index 28c3e04..b1e3f30 100644 --- a/src/components/ListSU/ListSU.test.jsx +++ b/src/components/ListSU/ListSU.test.jsx @@ -155,7 +155,7 @@ it('Export table', async () => { HTMLAnchorElement.prototype.remove = removeElmMock; const fileTitle = 'National_organizational_unit_Everyday_life_and_health_survey_2021_UE_confiees_8202020.csv'; - const fileContent = 'data:text/csv;charset=utf-8,%EF%BB%BFIdentifier;Interviewer;Idep;Ssech;Department;Town;Provisional%20state%0A20;Lucas%20Margie;INTW1;1;59;Aulnoye-Aimeries;%0A21;Campbell%20Carlton;INTW2;1;38;Vienne;%0A22;Xern%20Fabrice;INTW4;2;62;Arras;%0A29;Delmare%20Mathilde;INTW12;1;65;Belfort;%0A33;Antoine%20Tarje;INTW14;1;75;Paris;%0A55;Bertrand%20Ulysse;INTW4;2;62;Arras;%0A23;Grant%20Melody;INTW4;1;35;Rennes;'; + const fileContent = 'data:text/csv;charset=utf-8,%EF%BB%BFIdentifier;Survey%20unit%20identifier;Interviewer;Idep;Ssech;Department;Town;Provisional%20state%0A20;20;Lucas%20Margie;INTW1;1;59;Aulnoye-Aimeries;%0A21;21;Campbell%20Carlton;INTW2;1;38;Vienne;%0A22;22;Xern%20Fabrice;INTW4;2;62;Arras;%0A29;29;Delmare%20Mathilde;INTW12;1;65;Belfort;%0A33;33;Antoine%20Tarje;INTW14;1;75;Paris;%0A55;55;Bertrand%20Ulysse;INTW4;2;62;Arras;%0A23;23;Grant%20Melody;INTW4;1;35;Rennes;'; screen.getByTestId('export-button').click(); const downnloadLink = component.baseElement.querySelector('a[download]'); diff --git a/src/components/ListSU/SUTable.jsx b/src/components/ListSU/SUTable.jsx index cb56a3e..6847409 100644 --- a/src/components/ListSU/SUTable.jsx +++ b/src/components/ListSU/SUTable.jsx @@ -25,6 +25,7 @@ function makeTableForExport(data, communicationRequestConfiguration) { const headerTitle = [ [ D.identifier, + D.displayNameDownload, D.interviewer, D.idep, D.ssech, @@ -100,6 +101,7 @@ function makeTableForExport(data, communicationRequestConfiguration) { return reminders.length !== 0 ? [ line.id, + line.displayName, line.interviewer, line.idep, line.ssech, @@ -117,6 +119,7 @@ function makeTableForExport(data, communicationRequestConfiguration) { ] : [ line.id, + line.displayName, line.interviewer, line.idep, line.ssech, @@ -137,6 +140,7 @@ function makeTableForExport(data, communicationRequestConfiguration) { data.map((line) => { return [ line.id, + line.displayName, line.interviewer, line.idep, line.ssech, @@ -274,7 +278,7 @@ class SUTable extends React.Component { render() { const { data, sort, handleSort, isLoading, survey } = this.props; - const fieldsToSearch = ["city", "interviewer", "id", "state"]; + const fieldsToSearch = ["city", "interviewer", "displayName", "state"]; const { pagination, displayedLines, @@ -395,7 +399,6 @@ class SUTable extends React.Component { ) ?? []; orderReminders(reminders); - return ( )} - {id} + {displayName} {interviewer} {ssech} {departement?.substring(0, 2) ?? ""} diff --git a/src/components/ListSU/__snapshots__/ListSU.test.jsx.snap b/src/components/ListSU/__snapshots__/ListSU.test.jsx.snap index 4b72d9c..a34095b 100644 --- a/src/components/ListSU/__snapshots__/ListSU.test.jsx.snap +++ b/src/components/ListSU/__snapshots__/ListSU.test.jsx.snap @@ -4173,7 +4173,7 @@ Object {
, "container":
diff --git a/src/components/Review/ReviewTable.jsx b/src/components/Review/ReviewTable.jsx index 9124490..5a517ca 100644 --- a/src/components/Review/ReviewTable.jsx +++ b/src/components/Review/ReviewTable.jsx @@ -23,6 +23,7 @@ class ReviewTable extends React.Component { displayedLines: props.data, showComment: false, suToModifySelected: "", + suToModifySelectedDisplayName:"", oldComment: "", newComment: "", }; @@ -57,7 +58,7 @@ class ReviewTable extends React.Component { } handleShowComment(line) { - this.setState({ showComment: true, suToModifySelected: line.id }); + this.setState({ showComment: true, suToModifySelected: line.id, suToModifySelectedDisplayName: line.displayName }); if (line.comments != null) { let comToSet = ""; const comment = line.comments.find((c) => c.type === "MANAGEMENT"); @@ -128,10 +129,10 @@ class ReviewTable extends React.Component { checkAll, show, showComment, - suToModifySelected, + suToModifySelectedDisplayName, oldComment, } = this.state; - const fieldsToSearch = ["campaignLabel", "interviewer", "id"]; + const fieldsToSearch = ["campaignLabel", "interviewer", "displayName"]; const toggleCheckBox = (i) => { this.toggleCheckBox(i); }; @@ -193,8 +194,8 @@ class ReviewTable extends React.Component { {D.survey} - - + + {D.identifier} handleCloseComment()}> - {D.modifiedCommentSu + suToModifySelected} + {D.modifiedCommentSu + suToModifySelectedDisplayName} diff --git a/src/components/Review/SurveyUnitLine.jsx b/src/components/Review/SurveyUnitLine.jsx index 9287756..bd17157 100644 --- a/src/components/Review/SurveyUnitLine.jsx +++ b/src/components/Review/SurveyUnitLine.jsx @@ -11,7 +11,7 @@ function SurveyUnitLine({ view, dataRetreiver, }) { - const { campaignLabel, interviewer, id, viewed, contactOutcome } = lineData; + const { campaignLabel, interviewer, id, displayName, viewed, contactOutcome } = lineData; const queenUrl = `${window.localStorage.getItem("QUEEN_URL_FRONT_END")}`; return ( @@ -26,7 +26,7 @@ function SurveyUnitLine({ /> {campaignLabel} - {id} + {displayName} {contactOutcome?.type && D[contactOutcome.type]} diff --git a/src/components/Terminated/DisplayStateHistoryTable.jsx b/src/components/Terminated/DisplayStateHistoryTable.jsx index 066585b..c356dff 100644 --- a/src/components/Terminated/DisplayStateHistoryTable.jsx +++ b/src/components/Terminated/DisplayStateHistoryTable.jsx @@ -4,7 +4,7 @@ import Card from 'react-bootstrap/Card'; import Utils from '../../utils/Utils'; import D from '../../i18n'; -function displayStateHistoryTable(stateData, stateId, hideStateHistoryTable, maxWidth) { +function displayStateHistoryTable(stateData, displayName, hideStateHistoryTable, maxWidth) { return (
@@ -15,7 +15,7 @@ function displayStateHistoryTable(stateData, stateId, hideStateHistoryTable, max tabIndex={0} onClick={() => { hideStateHistoryTable(); }} /> - {`${D.titleStateSu}${stateId}`} + {`${D.titleStateSu}${displayName}`} diff --git a/src/components/Terminated/TerminatedTable.jsx b/src/components/Terminated/TerminatedTable.jsx index 5b34d73..4e42a24 100644 --- a/src/components/Terminated/TerminatedTable.jsx +++ b/src/components/Terminated/TerminatedTable.jsx @@ -26,6 +26,7 @@ class TerminatedTable extends React.Component { stateId: "", showComment: false, suToModifySelected: "", + suToModifySelectedDisplayName: "", oldComment: "", newComment: "", }; @@ -41,7 +42,7 @@ class TerminatedTable extends React.Component { ]; } - toggleStateHistoryTable(e, newStateTitle) { + toggleStateHistoryTable(e, newStateTitle, displayName) { const { dataRetreiver } = this.props; e.stopPropagation(); dataRetreiver.getStatesSurvey(newStateTitle, (data) => { @@ -49,6 +50,7 @@ class TerminatedTable extends React.Component { toggleStateHistory: true, stateId: newStateTitle, stateData: data, + displayName:displayName }); }); } @@ -62,7 +64,7 @@ class TerminatedTable extends React.Component { } handleShowComment(line) { - this.setState({ showComment: true, suToModifySelected: line.id }); + this.setState({ showComment: true, suToModifySelected: line.id, suToModifySelectedDisplayName: line.displayName }); if (line.comments != null) { let comToSet = ""; const comment = line.comments.find((c) => c.type === "MANAGEMENT"); @@ -99,7 +101,7 @@ class TerminatedTable extends React.Component { @@ -147,7 +149,7 @@ class TerminatedTable extends React.Component { className="fa fa-history HistoryDisplayIcon Clickable" aria-hidden="true" onClick={(e) => { - this.toggleStateHistoryTable(e, data.id); + this.toggleStateHistoryTable(e, data.id, data.displayName); }} /> @@ -162,16 +164,16 @@ class TerminatedTable extends React.Component { displayData, stateData, toggleStateHistory, - stateId, + displayName, showComment, - suToModifySelected, + suToModifySelectedDisplayName, oldComment, } = this.state; const { data, survey, handleSort, sort } = this.props; const fieldsToSearch = [ "interviewerFirstName", "interviewerLastName", - "id", + "displayName", ]; const handleCloseComment = () => { this.handleCloseComment(); @@ -227,10 +229,10 @@ class TerminatedTable extends React.Component { id="stateHistoryDate" data-testid="TableHeader_id_terminated" rowSpan="2" - onClick={handleSortFunct("id")} + onClick={handleSortFunct("displayName")} className="Clickable ColId" > - + {D.identifier}
{survey.label} - {data.id} + {data.displayName} {`${data.interviewer.interviewerLastName} ${data.interviewer.interviewerFirstName}`} {`${Utils.convertToDateString(data.finalizationDate)}`} handleCloseComment()}> - {D.modifiedCommentSu + suToModifySelected} + {D.modifiedCommentSu + suToModifySelectedDisplayName} @@ -342,7 +344,7 @@ class TerminatedTable extends React.Component { {!toggleStateHistory || displayStateHistoryTable( stateData, - stateId, + displayName, () => this.hideStateHistoryTable(), () => this.getMaxWidth() )} diff --git a/src/i18n/labels/labels_listSU.js b/src/i18n/labels/labels_listSU.js index 721a2b6..dd1e338 100644 --- a/src/i18n/labels/labels_listSU.js +++ b/src/i18n/labels/labels_listSU.js @@ -1,71 +1,79 @@ const listSU = { result: { - fr: 'Resultat : ', - en: 'Result: ', + fr: "Resultat : ", + en: "Result: ", }, units: { - fr: 'unités', - en: 'units', + fr: "unités", + en: "units", }, surveyUnitsAllocatedToTheOU: { - fr: 'Unités enquêtées confiées au site : ', - en: 'Survey units allocated to the organizational unit: ', + fr: "Unités enquêtées confiées au site : ", + en: "Survey units allocated to the organizational unit: ", }, identifier: { - fr: 'Identifiant', - en: 'Identifier', + fr: "Identifiant", + en: "Identifier", + }, + displayName: { + fr: "Identifiant", + en: "Identifier", + }, + displayNameDownload: { + fr: `Identifiant de l'ue`, + en: "Survey unit identifier", }, ssech: { - fr: 'Ssech', - en: 'Ssech', + fr: "Ssech", + en: "Ssech", }, department: { - fr: 'Département', - en: 'Department', + fr: "Département", + en: "Department", }, town: { - fr: 'Commune', - en: 'Town', + fr: "Commune", + en: "Town", }, noListSuToDisplay: { - fr: 'Aucune unité enquêtée à afficher', - en: 'There are no survey units to display', + fr: "Aucune unité enquêtée à afficher", + en: "There are no survey units to display", }, state: { - fr: 'Statut provisoire', - en: 'Provisional state', + fr: "Statut provisoire", + en: "Provisional state", }, modified: { - fr: 'Modifier le statut', - en: 'Change the state', + fr: "Modifier le statut", + en: "Change the state", }, modaleModifiedText: { - fr: 'Sélectionner la modalité souhaitée', - en: 'Select the desired modality', + fr: "Sélectionner la modalité souhaitée", + en: "Select the desired modality", }, validate: { - fr: 'Valider', - en: 'Validate', + fr: "Valider", + en: "Validate", }, cancel: { - fr: 'Annuler', - en: 'Cancel', + fr: "Annuler", + en: "Cancel", }, contactOutcome: { - fr: 'Bilan des contacts', - en: 'Contact outcome', + fr: "Bilan des contacts", + en: "Contact outcome", }, questionnaireState: { - fr: 'État du questionnaire', - en: 'Questionnaire state', + fr: "État du questionnaire", + en: "Questionnaire state", }, totalRemindersLabel: { - fr: 'T Rel', - en: 'T Rem', + fr: "T Rel", + en: "T Rem", }, totalReminders: { - fr: 'Total des relances', - en: 'Total reminders', + fr: "Total des relances", + en: "Total reminders", }, latestReminderLabel: { fr: "Rel n", @@ -89,19 +97,19 @@ const listSU = { }, reminderEmailMedium: { fr: "M", - en: "E" + en: "E", }, reminderMailMedium: { fr: "C", - en: "M" + en: "M", }, reminderRefReason: { fr: "Ref", - en: "Ref" + en: "Ref", }, reminderItjReason: { fr: "IAJ", - en: "ITJ" + en: "ITJ", }, contactOutcomeLabel: { fr: "Bilan des contacts", diff --git a/src/tests/mocks/formattedCloseData.js b/src/tests/mocks/formattedCloseData.js index d142daa..4005dbe 100644 --- a/src/tests/mocks/formattedCloseData.js +++ b/src/tests/mocks/formattedCloseData.js @@ -1,237 +1,253 @@ const val = [ { - "id": "1023", - "ssech": "hgSkR29", - "location": "95160", - "city": "MONTMORENCY", - "finalizationDate": 1561932000000, - "interviewer": { - "id": "INTW5", - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont" - }, - "campaign": "Simpsons", - "state": "ANS" - }, - { - "id": "4811", - "ssech": "dlcB55jdf", - "location": "90000", - "city": "BELFORT", - "finalizationDate": 1561932000000, - "interviewer": { - "id": "INTW6", - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger" - }, - "campaign": "Simpsons", - "state": "ANS" - }, - { - "id": "1024", - "ssech": "hgSkR29", - "location": "95160", - "city": "MONTMORENCY", - "finalizationDate": 1603304314268, - "interviewer": { - "id": "INTW5", - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont" - }, - "campaign": "Simpsons", - "state": "ANS" - }, - { - "id": "4812", - "ssech": "dlcB55jdf", - "location": "90000", - "city": "BELFORT", - "finalizationDate": 1603304314268, - "interviewer": { - "id": "INTW6", - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger" - }, - "campaign": "VQS", - "state": "ANS" - }, - { - "id": "1025", - "ssech": "hgSkR29", - "location": "95160", - "city": "MONTMORENCY", - "finalizationDate": 1603304314268, - "interviewer": { - "id": "INTW5", - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont" - }, - "campaign": "VQS", - "state": "ANS" - }, - { - "id": "4813", - "ssech": "dlcB55jdf", - "location": "90000", - "city": "BELFORT", - "finalizationDate": 1603304314268, - "interviewer": { - "id": "INTW6", - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger" - }, - "campaign": "VQS", - "state": "ANS" - }, - { - "id": "1027", - "ssech": "hgSkR29", - "location": "95160", - "city": "MONTMORENCY", - "finalizationDate": 1603304314268, - "interviewer": { - "id": "INTW5", - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont" - }, - "campaign": "VQS", - "state": "ANS" - }, - { - "id": "4815", - "ssech": "dlcB55jdf", - "location": "90000", - "city": "BELFORT", - "finalizationDate": 1603304314268, - "interviewer": { - "id": "INTW7", - "interviewerFirstName": "Thierry", - "interviewerLastName": "Fabres" - }, - "campaign": "VQS", - "state": "ANS" - }, - { - "id": "1028", - "ssech": "hgSkR29", - "location": "95160", - "city": "MONTMORENCY", - "finalizationDate": 1603304314268, - "interviewer": { - "id": "INTW5", - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont" - }, - "campaign": "VQS", - "state": "ANS" - }, - { - "id": "4816", - "ssech": "dlcB55jdf", - "location": "90000", - "city": "BELFORT", - "finalizationDate": 1603304314268, - "interviewer": { - "id": "INTW6", - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger" - }, - "campaign": "VQS", - "state": "ANS", - "comments": [ + id: "1023", + displayName: "1023", + ssech: "hgSkR29", + location: "95160", + city: "MONTMORENCY", + finalizationDate: 1561932000000, + interviewer: { + id: "INTW5", + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + }, + campaign: "Simpsons", + state: "ANS", + }, + { + id: "4811", + displayName: "4811", + ssech: "dlcB55jdf", + location: "90000", + city: "BELFORT", + finalizationDate: 1561932000000, + interviewer: { + id: "INTW6", + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + }, + campaign: "Simpsons", + state: "ANS", + }, + { + id: "1024", + displayName: "1024", + ssech: "hgSkR29", + location: "95160", + city: "MONTMORENCY", + finalizationDate: 1603304314268, + interviewer: { + id: "INTW5", + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + }, + campaign: "Simpsons", + state: "ANS", + }, + { + id: "4812", + displayName: "4812", + ssech: "dlcB55jdf", + location: "90000", + city: "BELFORT", + finalizationDate: 1603304314268, + interviewer: { + id: "INTW6", + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + }, + campaign: "VQS", + state: "ANS", + }, + { + id: "1025", + displayName: "1025", + ssech: "hgSkR29", + location: "95160", + city: "MONTMORENCY", + finalizationDate: 1603304314268, + interviewer: { + id: "INTW5", + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + }, + campaign: "VQS", + state: "ANS", + }, + { + id: "4813", + displayName: "4813", + ssech: "dlcB55jdf", + location: "90000", + city: "BELFORT", + finalizationDate: 1603304314268, + interviewer: { + id: "INTW6", + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + }, + campaign: "VQS", + state: "ANS", + }, + { + id: "1027", + displayName: "1027", + ssech: "hgSkR29", + location: "95160", + city: "MONTMORENCY", + finalizationDate: 1603304314268, + interviewer: { + id: "INTW5", + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + }, + campaign: "VQS", + state: "ANS", + }, + { + id: "4815", + displayName: "4815", + ssech: "dlcB55jdf", + location: "90000", + city: "BELFORT", + finalizationDate: 1603304314268, + interviewer: { + id: "INTW7", + interviewerFirstName: "Thierry", + interviewerLastName: "Fabres", + }, + campaign: "VQS", + state: "ANS", + }, + { + id: "1028", + displayName: "1028", + ssech: "hgSkR29", + location: "95160", + city: "MONTMORENCY", + finalizationDate: 1603304314268, + interviewer: { + id: "INTW5", + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + }, + campaign: "VQS", + state: "ANS", + }, + { + id: "4816", + displayName: "4816", + ssech: "dlcB55jdf", + location: "90000", + city: "BELFORT", + finalizationDate: 1603304314268, + interviewer: { + id: "INTW6", + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + }, + campaign: "VQS", + state: "ANS", + comments: [ { - "type": "managementComment", - "value": "Test" + type: "managementComment", + value: "Test", }, { - "type": "interviewerComment", - "value": "Test" - } - ] - }, - { - "id": "1029", - "ssech": "hgSkR29", - "location": "95160", - "city": "MONTMORENCY", - "finalizationDate": 1603304314268, - "campaign": "VQS", - "state": "ANS", - "interviewer": { - "id": "INTW7", - "interviewerFirstName": "Thierry", - "interviewerLastName": "Fabres" - } - }, - { - "id": "4817", - "ssech": "dlcB55jdf", - "location": "90000", - "city": "BELFORT", - "finalizationDate": 1603304314268, - "campaign": "VQS", - "state": "ANS", - "interviewer": { - "id": "INTW6", - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger" - } - }, - { - "id": "1030", - "ssech": "hgSkR29", - "location": "95160", - "city": "MONTMORENCY", - "finalizationDate": 1561932000000, - "campaign": "VQS", - "state": "ANS", - "interviewer": { - "id": "INTW5", - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont" - } - }, - { - "id": "4818", - "ssech": "dlcB55jdf", - "location": "90000", - "city": "BELFORT", - "finalizationDate": 1561932000000, - "campaign": "LC 2020", - "state": "ANS", - "interviewer": { - "id": "INTW6", - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger" - } - }, - { - "id": "1032", - "ssech": "hgSkR29", - "location": "95160", - "city": "MONTMORENCY", - "finalizationDate": 1603304314268, - "campaign": "LC 2020", - "state": "ANS", - "interviewer": { - "id": "INTW5", - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont" - } - }, - { - "id": "4819", - "ssech": "dlcB55jdf", - "location": "90000", - "city": "BELFORT", - "finalizationDate": 1603304314268, - "campaign": "LC 2020", - "state": "ANS", - "interviewer": { - "id": "INTW6", - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger" - } - } + type: "interviewerComment", + value: "Test", + }, + ], + }, + { + id: "1029", + displayName: "1029", + ssech: "hgSkR29", + location: "95160", + city: "MONTMORENCY", + finalizationDate: 1603304314268, + campaign: "VQS", + state: "ANS", + interviewer: { + id: "INTW7", + interviewerFirstName: "Thierry", + interviewerLastName: "Fabres", + }, + }, + { + id: "4817", + displayName: "4817", + ssech: "dlcB55jdf", + location: "90000", + city: "BELFORT", + finalizationDate: 1603304314268, + campaign: "VQS", + state: "ANS", + interviewer: { + id: "INTW6", + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + }, + }, + { + id: "1030", + displayName: "1030", + ssech: "hgSkR29", + location: "95160", + city: "MONTMORENCY", + finalizationDate: 1561932000000, + campaign: "VQS", + state: "ANS", + interviewer: { + id: "INTW5", + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + }, + }, + { + id: "4818", + displayName: "4818", + ssech: "dlcB55jdf", + location: "90000", + city: "BELFORT", + finalizationDate: 1561932000000, + campaign: "LC 2020", + state: "ANS", + interviewer: { + id: "INTW6", + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + }, + }, + { + id: "1032", + displayName: "1032", + ssech: "hgSkR29", + location: "95160", + city: "MONTMORENCY", + finalizationDate: 1603304314268, + campaign: "LC 2020", + state: "ANS", + interviewer: { + id: "INTW5", + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + }, + }, + { + id: "4819", + displayName: "4819", + ssech: "dlcB55jdf", + location: "90000", + city: "BELFORT", + finalizationDate: 1603304314268, + campaign: "LC 2020", + state: "ANS", + interviewer: { + id: "INTW6", + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + }, + }, ]; -export default val; \ No newline at end of file +export default val; diff --git a/src/tests/mocks/formattedLisSuToReviewSimpsons.js b/src/tests/mocks/formattedLisSuToReviewSimpsons.js index ef71d79..08ae660 100644 --- a/src/tests/mocks/formattedLisSuToReviewSimpsons.js +++ b/src/tests/mocks/formattedLisSuToReviewSimpsons.js @@ -3,97 +3,113 @@ const val = [ "campaignLabel": "Survey on the Simpsons tv show 2020", "interviewer": "Boulanger Jacques", "idep": "INTW6", - "id": "4819" + "id": "4819", + "displayName": "4819" }, { "campaignLabel": "Survey on the Simpsons tv show 2020", "interviewer": "Boulanger Jacques", "idep": "INTW6", - "id": "4812" + "id": "4812", + "displayName": "4812" }, { "campaignLabel": "Survey on the Simpsons tv show 2020", "interviewer": "Boulanger Jacques", "idep": "INTW6", - "id": "4813" + "id": "4813", + "displayName": "4813" }, { "campaignLabel": "Survey on the Simpsons tv show 2020", "interviewer": "Boulanger Jacques", "idep": "INTW6", - "id": "4811" + "id": "4811", + "displayName": "4811" }, { "campaignLabel": "Survey on the Simpsons tv show 2020", "interviewer": "Boulanger Jacques", "idep": "INTW6", - "id": "4816" + "id": "4816", + "displayName": "4816" }, { "campaignLabel": "Survey on the Simpsons tv show 2020", "interviewer": "Boulanger Jacques", "idep": "INTW6", - "id": "4818" + "id": "4818", + "displayName": "4818" }, { "campaignLabel": "Survey on the Simpsons tv show 2020", "interviewer": "Boulanger Jacques", "idep": "INTW6", - "id": "4817" + "id": "4817", + "displayName": "4817" }, { "campaignLabel": "Survey on the Simpsons tv show 2020", "interviewer": "Dupont Chloé", "idep": "INTW5", - "id": "1025" + "id": "1025", + "displayName": "1025" }, { "campaignLabel": "Survey on the Simpsons tv show 2020", "interviewer": "Dupont Chloé", "idep": "INTW5", - "id": "1027" + "id": "1027", + "displayName": "1027" }, { "campaignLabel": "Survey on the Simpsons tv show 2020", "interviewer": "Dupont Chloé", "idep": "INTW5", - "id": "1024" + "id": "1024", + "displayName": "1024" }, { "campaignLabel": "Survey on the Simpsons tv show 2020", "interviewer": "Dupont Chloé", "idep": "INTW5", - "id": "1030" + "id": "1030", + "displayName": "1030" }, { "campaignLabel": "Survey on the Simpsons tv show 2020", "interviewer": "Dupont Chloé", "idep": "INTW5", - "id": "1032" + "id": "1032", + "displayName": "1032" }, { "campaignLabel": "Survey on the Simpsons tv show 2020", "interviewer": "Dupont Chloé", "idep": "INTW5", - "id": "1023" + "id": "1023", + "displayName": "1023" }, { "campaignLabel": "Survey on the Simpsons tv show 2020", "interviewer": "Dupont Chloé", "idep": "INTW5", - "id": "1028" + "id": "1028", + "displayName": "1028" }, { "campaignLabel": "Survey on the Simpsons tv show 2020", "interviewer": "Fabres Thierry", "idep": "INTW7", - "id": "1029" + "id": "1029", + "displayName": "1029" }, { "campaignLabel": "Survey on the Simpsons tv show 2020", "interviewer": "Fabres Thierry", "idep": "INTW7", - "id": "4815" + "id": "4815", + "displayName": "4815" } ]; export default val; \ No newline at end of file diff --git a/src/tests/mocks/formattedListSuData.js b/src/tests/mocks/formattedListSuData.js index 9368189..f26f49b 100644 --- a/src/tests/mocks/formattedListSuData.js +++ b/src/tests/mocks/formattedListSuData.js @@ -5,6 +5,7 @@ const val = { "city": "MONTMORENCY", "departement": "95160", "id": "1023", + "displayName": "1023", "idep": "INTW5", "interviewer": "Dupont Chloé", "ssech": "hgSkR29" @@ -13,6 +14,7 @@ const val = { "city": "MONTMORENCY", "departement": "95160", "id": "1024", + "displayName": "1024", "idep": "INTW5", "interviewer": "Dupont Chloé", "ssech": "hgSkR29" @@ -21,6 +23,7 @@ const val = { "city": "MONTMORENCY", "departement": "95160", "id": "1025", + "displayName": "1025", "idep": "INTW5", "interviewer": "Dupont Chloé", "ssech": "hgSkR29" @@ -29,6 +32,7 @@ const val = { "city": "MONTMORENCY", "departement": "95160", "id": "1027", + "displayName": "1027", "idep": "INTW5", "interviewer": "Dupont Chloé", "ssech": "hgSkR29" @@ -37,6 +41,7 @@ const val = { "city": "MONTMORENCY", "departement": "95160", "id": "1028", + "displayName": "1028", "idep": "INTW5", "interviewer": "Dupont Chloé", "ssech": "hgSkR29" @@ -45,6 +50,7 @@ const val = { "city": "MONTMORENCY", "departement": "95160", "id": "1029", + "displayName": "1029", "idep": "INTW7", "interviewer": "Fabres Thierry", "ssech": "hgSkR29" @@ -53,6 +59,7 @@ const val = { "city": "MONTMORENCY", "departement": "95160", "id": "1030", + "displayName": "1030", "idep": "INTW5", "interviewer": "Dupont Chloé", "ssech": "hgSkR29" @@ -61,6 +68,7 @@ const val = { "city": "MONTMORENCY", "departement": "95160", "id": "1032", + "displayName": "1032", "idep": "INTW5", "interviewer": "Dupont Chloé", "ssech": "hgSkR29" @@ -69,6 +77,7 @@ const val = { "city": "BELFORT", "departement": "90000", "id": "4811", + "displayName": "4811", "idep": "INTW6", "interviewer": "Boulanger Jacques", "ssech": "dlcB55jdf" @@ -77,6 +86,7 @@ const val = { "city": "BRIVE-LA-GAILLARDE", "departement": "90000", "id": "4812", + "displayName": "4812", "idep": "INTW6", "interviewer": "Boulanger Jacques", "ssech": "dlcB55jdf" @@ -85,6 +95,7 @@ const val = { "city": "BELFORT", "departement": "90000", "id": "4813", + "displayName": "4813", "idep": "INTW6", "interviewer": "Boulanger Jacques", "ssech": "dlcB55jdf" @@ -93,6 +104,7 @@ const val = { "city": "BELFORT", "departement": "90000", "id": "4815", + "displayName": "4815", "idep": "INTW7", "interviewer": "Fabres Thierry", "ssech": "dlcB55jdf" @@ -101,6 +113,7 @@ const val = { "city": "BELFORT", "departement": "90000", "id": "4816", + "displayName": "4816", "idep": "INTW6", "interviewer": "Boulanger Jacques", "ssech": "dlcB55jdf" @@ -109,6 +122,7 @@ const val = { "city": "BELFORT", "departement": "90000", "id": "4817", + "displayName": "4817", "idep": "INTW6", "interviewer": "Boulanger Jacques", "ssech": "dlcB55jdf" @@ -117,6 +131,7 @@ const val = { "city": "BELFORT", "departement": "90000", "id": "4818", + "displayName": "4818", "idep": "INTW6", "interviewer": "Boulanger Jacques", "ssech": "dlcB55jdf" @@ -125,6 +140,7 @@ const val = { "city": "BELFORT", "departement": "90000", "id": "4819", + "displayName": "4819", "idep": "INTW6", "interviewer": "Boulanger Jacques", "ssech": "dlcB55jdf" diff --git a/src/tests/mocks/formattedReviewData.js b/src/tests/mocks/formattedReviewData.js index d073fa6..f70a0fc 100644 --- a/src/tests/mocks/formattedReviewData.js +++ b/src/tests/mocks/formattedReviewData.js @@ -1,99 +1,115 @@ const val = [ { - "campaignLabel": "Survey on the Simpsons tv show 2020", - "interviewer": "Boulanger Jacques", - "idep": "INTW6", - "id": "4819" + campaignLabel: "Survey on the Simpsons tv show 2020", + interviewer: "Boulanger Jacques", + idep: "INTW6", + id: "4819", + displayName: "4819", }, { - "campaignLabel": "Survey on the Simpsons tv show 2020", - "interviewer": "Boulanger Jacques", - "idep": "INTW6", - "id": "4812" + campaignLabel: "Survey on the Simpsons tv show 2020", + interviewer: "Boulanger Jacques", + idep: "INTW6", + id: "4812", + displayName: "4812", }, { - "campaignLabel": "Survey on the Simpsons tv show 2020", - "interviewer": "Boulanger Jacques", - "idep": "INTW6", - "id": "4813" + campaignLabel: "Survey on the Simpsons tv show 2020", + interviewer: "Boulanger Jacques", + idep: "INTW6", + id: "4813", + displayName: "4813", }, { - "campaignLabel": "Survey on the Simpsons tv show 2020", - "interviewer": "Boulanger Jacques", - "idep": "INTW6", - "id": "4811" + campaignLabel: "Survey on the Simpsons tv show 2020", + interviewer: "Boulanger Jacques", + idep: "INTW6", + id: "4811", + displayName: "4811", }, { - "campaignLabel": "Survey on the Simpsons tv show 2020", - "interviewer": "Boulanger Jacques", - "idep": "INTW6", - "id": "4816" + campaignLabel: "Survey on the Simpsons tv show 2020", + interviewer: "Boulanger Jacques", + idep: "INTW6", + id: "4816", + displayName: "4816", }, { - "campaignLabel": "Survey on the Simpsons tv show 2020", - "interviewer": "Boulanger Jacques", - "idep": "INTW6", - "id": "4818" + campaignLabel: "Survey on the Simpsons tv show 2020", + interviewer: "Boulanger Jacques", + idep: "INTW6", + id: "4818", + displayName: "4818", }, { - "campaignLabel": "Survey on the Simpsons tv show 2020", - "interviewer": "Boulanger Jacques", - "idep": "INTW6", - "id": "4817" + campaignLabel: "Survey on the Simpsons tv show 2020", + interviewer: "Boulanger Jacques", + idep: "INTW6", + id: "4817", + displayName: "4817", }, { - "campaignLabel": "Survey on the Simpsons tv show 2020", - "interviewer": "Dupont Chloé", - "idep": "INTW5", - "id": "1025" + campaignLabel: "Survey on the Simpsons tv show 2020", + interviewer: "Dupont Chloé", + idep: "INTW5", + id: "1025", + displayName: "1025", }, { - "campaignLabel": "Survey on the Simpsons tv show 2020", - "interviewer": "Dupont Chloé", - "idep": "INTW5", - "id": "1027" + campaignLabel: "Survey on the Simpsons tv show 2020", + interviewer: "Dupont Chloé", + idep: "INTW5", + id: "1027", + displayName: "1027", }, { - "campaignLabel": "Survey on the Simpsons tv show 2020", - "interviewer": "Dupont Chloé", - "idep": "INTW5", - "id": "1024" + campaignLabel: "Survey on the Simpsons tv show 2020", + interviewer: "Dupont Chloé", + idep: "INTW5", + id: "1024", + displayName: "1024", }, { - "campaignLabel": "Survey on the Simpsons tv show 2020", - "interviewer": "Dupont Chloé", - "idep": "INTW5", - "id": "1030" + campaignLabel: "Survey on the Simpsons tv show 2020", + interviewer: "Dupont Chloé", + idep: "INTW5", + id: "1030", + displayName: "1030", }, { - "campaignLabel": "Survey on the Simpsons tv show 2020", - "interviewer": "Dupont Chloé", - "idep": "INTW5", - "id": "1032" + campaignLabel: "Survey on the Simpsons tv show 2020", + interviewer: "Dupont Chloé", + idep: "INTW5", + id: "1032", + displayName: "1032", }, { - "campaignLabel": "Survey on the Simpsons tv show 2020", - "interviewer": "Dupont Chloé", - "idep": "INTW5", - "id": "1023" + campaignLabel: "Survey on the Simpsons tv show 2020", + interviewer: "Dupont Chloé", + idep: "INTW5", + id: "1023", + displayName: "1023", }, { - "campaignLabel": "Survey on the Simpsons tv show 2020", - "interviewer": "Dupont Chloé", - "idep": "INTW5", - "id": "1028" + campaignLabel: "Survey on the Simpsons tv show 2020", + interviewer: "Dupont Chloé", + idep: "INTW5", + id: "1028", + displayName: "1028", }, { - "campaignLabel": "Survey on the Simpsons tv show 2020", - "interviewer": "Fabres Thierry", - "idep": "INTW7", - "id": "1029" + campaignLabel: "Survey on the Simpsons tv show 2020", + interviewer: "Fabres Thierry", + idep: "INTW7", + id: "1029", + displayName: "1029", }, { - "campaignLabel": "Survey on the Simpsons tv show 2020", - "interviewer": "Fabres Thierry", - "idep": "INTW7", - "id": "4815" + campaignLabel: "Survey on the Simpsons tv show 2020", + interviewer: "Fabres Thierry", + idep: "INTW7", + id: "4815", + displayName: "4815", }, ]; -export default val; \ No newline at end of file +export default val; diff --git a/src/tests/mocks/formattedSuTerminated.js b/src/tests/mocks/formattedSuTerminated.js index c75f0a8..2684e55 100644 --- a/src/tests/mocks/formattedSuTerminated.js +++ b/src/tests/mocks/formattedSuTerminated.js @@ -1,747 +1,779 @@ const val = [ { - "city": "MONTMORENCY", - "comments": [ + city: "MONTMORENCY", + comments: [ { - "type": "managementComment", - "value": "Test" + type: "managementComment", + value: "Test", }, { - "type": "interviewerComment", - "value": "Test" - } + type: "interviewerComment", + value: "Test", + }, ], - "finalizationDate": 1561932000000, - "id": "1023", - "interviewer": { - "id": "INTW5", - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont" - }, - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont", - "location": "95160", - "questionnaireId": "QXT55", - "reading": true, - "ssech": "hgSkR29", - "viewed": false + finalizationDate: 1561932000000, + id: "1023", + displayName: "1023", + interviewer: { + id: "INTW5", + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + }, + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + location: "95160", + questionnaireId: "QXT55", + reading: true, + ssech: "hgSkR29", + viewed: false, }, { - "city": "BELFORT", - "comments": [ + city: "BELFORT", + comments: [ { - "type": "managementComment", - "value": "Test" + type: "managementComment", + value: "Test", }, { - "type": "interviewerComment", - "value": "Test" - } + type: "interviewerComment", + value: "Test", + }, ], - "finalizationDate": 1561932000000, - "id": "4811", - "interviewer": { - "id": "INTW6", - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger" - }, - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger", - "location": "90000", - "questionnaireId": "QXT55", - "reading": true, - "ssech": "dlcB55jdf", - "viewed": false + finalizationDate: 1561932000000, + id: "4811", + displayName: "4811", + interviewer: { + id: "INTW6", + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + }, + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + location: "90000", + questionnaireId: "QXT55", + reading: true, + ssech: "dlcB55jdf", + viewed: false, }, { - "city": "MONTMORENCY", - "comments": [ + city: "MONTMORENCY", + comments: [ { - "type": "managementComment", - "value": "Test" + type: "managementComment", + value: "Test", }, { - "type": "interviewerComment", - "value": "Test" - } + type: "interviewerComment", + value: "Test", + }, ], - "finalizationDate": 1603304314268, - "id": "1024", - "interviewer": { - "id": "INTW5", - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont" - }, - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont", - "location": "95160", - "questionnaireId": "QXT55", - "reading": true, - "ssech": "hgSkR29", - "viewed": false + finalizationDate: 1603304314268, + id: "1024", + displayName: "1024", + interviewer: { + id: "INTW5", + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + }, + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + location: "95160", + questionnaireId: "QXT55", + reading: true, + ssech: "hgSkR29", + viewed: false, }, { - "city": "BRIVE-LA-GAILLARDE", - "comments": [ + city: "BRIVE-LA-GAILLARDE", + comments: [ { - "type": "managementComment", - "value": "Test" + type: "managementComment", + value: "Test", }, { - "type": "interviewerComment", - "value": "Test" - } + type: "interviewerComment", + value: "Test", + }, ], - "finalizationDate": 1603304314268, - "id": "4812", - "interviewer": { - "id": "INTW6", - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger" - }, - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger", - "location": "90000", - "questionnaireId": "QXT55", - "reading": true, - "ssech": "dlcB55jdf", - "viewed": false + finalizationDate: 1603304314268, + id: "4812", + displayName: "4812", + interviewer: { + id: "INTW6", + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + }, + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + location: "90000", + questionnaireId: "QXT55", + reading: true, + ssech: "dlcB55jdf", + viewed: false, }, { - "city": "MONTMORENCY", - "comments": [ + city: "MONTMORENCY", + comments: [ { - "type": "managementComment", - "value": "Test" + type: "managementComment", + value: "Test", }, { - "type": "interviewerComment", - "value": "Test" - } + type: "interviewerComment", + value: "Test", + }, ], - "finalizationDate": 1603304314268, - "id": "1025", - "interviewer": { - "id": "INTW5", - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont" - }, - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont", - "location": "95160", - "questionnaireId": "QXT55", - "reading": true, - "ssech": "hgSkR29", - "viewed": true + finalizationDate: 1603304314268, + id: "1025", + displayName: "1025", + interviewer: { + id: "INTW5", + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + }, + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + location: "95160", + questionnaireId: "QXT55", + reading: true, + ssech: "hgSkR29", + viewed: true, }, { - "city": "BELFORT", - "comments": [ + city: "BELFORT", + comments: [ { - "type": "managementComment", - "value": "Test" + type: "managementComment", + value: "Test", }, { - "type": "interviewerComment", - "value": "Test" - } + type: "interviewerComment", + value: "Test", + }, ], - "finalizationDate": 1603304314268, - "id": "4813", - "interviewer": { - "id": "INTW6", - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger" - }, - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger", - "location": "90000", - "questionnaireId": "QXT55", - "reading": true, - "ssech": "dlcB55jdf", - "viewed": true + finalizationDate: 1603304314268, + id: "4813", + displayName: "4813", + interviewer: { + id: "INTW6", + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + }, + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + location: "90000", + questionnaireId: "QXT55", + reading: true, + ssech: "dlcB55jdf", + viewed: true, }, { - "city": "MONTMORENCY", - "comments": [ + city: "MONTMORENCY", + comments: [ { - "type": "managementComment", - "value": "Test" + type: "managementComment", + value: "Test", }, { - "type": "interviewerComment", - "value": "Test" - } + type: "interviewerComment", + value: "Test", + }, ], - "finalizationDate": 1603304314268, - "id": "1027", - "interviewer": { - "id": "INTW5", - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont" - }, - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont", - "location": "95160", - "questionnaireId": "QXT55", - "reading": true, - "ssech": "hgSkR29", - "viewed": true + finalizationDate: 1603304314268, + id: "1027", + displayName: "1027", + interviewer: { + id: "INTW5", + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + }, + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + location: "95160", + questionnaireId: "QXT55", + reading: true, + ssech: "hgSkR29", + viewed: true, }, { - "city": "BELFORT", - "comments": [ + city: "BELFORT", + comments: [ { - "type": "managementComment", - "value": "Test" + type: "managementComment", + value: "Test", }, { - "type": "interviewerComment", - "value": "Test" - } + type: "interviewerComment", + value: "Test", + }, ], - "finalizationDate": 1603304314268, - "id": "4815", - "interviewer": { - "id": "INTW7", - "interviewerFirstName": "Thierry", - "interviewerLastName": "Fabres" - }, - "interviewerFirstName": "Thierry", - "interviewerLastName": "Fabres", - "location": "90000", - "questionnaireId": "QXT55", - "reading": false, - "ssech": "dlcB55jdf", - "viewed": true + finalizationDate: 1603304314268, + id: "4815", + displayName: "4815", + interviewer: { + id: "INTW7", + interviewerFirstName: "Thierry", + interviewerLastName: "Fabres", + }, + interviewerFirstName: "Thierry", + interviewerLastName: "Fabres", + location: "90000", + questionnaireId: "QXT55", + reading: false, + ssech: "dlcB55jdf", + viewed: true, }, { - "city": "MONTMORENCY", - "comments": [ + city: "MONTMORENCY", + comments: [ { - "type": "managementComment", - "value": "Test" + type: "managementComment", + value: "Test", }, { - "type": "interviewerComment", - "value": "Test" - } + type: "interviewerComment", + value: "Test", + }, ], - "finalizationDate": 1603304314268, - "id": "1028", - "interviewer": { - "id": "INTW5", - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont" - }, - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont", - "location": "95160", - "questionnaireId": "QXT55", - "reading": false, - "ssech": "hgSkR29", - "viewed": true + finalizationDate: 1603304314268, + id: "1028", + displayName: "1028", + interviewer: { + id: "INTW5", + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + }, + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + location: "95160", + questionnaireId: "QXT55", + reading: false, + ssech: "hgSkR29", + viewed: true, }, { - "city": "BELFORT", - "comments": [ + city: "BELFORT", + comments: [ { - "type": "managementComment", - "value": "Test" + type: "managementComment", + value: "Test", }, { - "type": "interviewerComment", - "value": "Test" - } + type: "interviewerComment", + value: "Test", + }, ], - "finalizationDate": 1603304314268, - "id": "4816", - "interviewer": { - "id": "INTW6", - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger" - }, - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger", - "location": "90000", - "questionnaireId": "QXT55", - "reading": false, - "ssech": "dlcB55jdf", - "viewed": true - }, - { - "city": "MONTMORENCY", - "finalizationDate": 1603304314268, - "id": "1029", - "interviewer": { - "id": "INTW7", - "interviewerFirstName": "Thierry", - "interviewerLastName": "Fabres" - }, - "interviewerFirstName": "Thierry", - "interviewerLastName": "Fabres", - "location": "95160", - "questionnaireId": "QXT55", - "reading": false, - "ssech": "hgSkR29", - "viewed": true - }, - { - "city": "BELFORT", - "finalizationDate": 1603304314268, - "id": "4817", - "interviewer": { - "id": "INTW6", - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger" - }, - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger", - "location": "90000", - "questionnaireId": "QXT55", - "reading": false, - "ssech": "dlcB55jdf", - "viewed": true - }, - { - "city": "MONTMORENCY", - "finalizationDate": 1561932000000, - "id": "1030", - "interviewer": { - "id": "INTW5", - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont" - }, - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont", - "location": "95160", - "questionnaireId": "QXT55", - "reading": false, - "ssech": "hgSkR29", - "viewed": true - }, - { - "city": "BELFORT", - "finalizationDate": 1561932000000, - "id": "4818", - "interviewer": { - "id": "INTW6", - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger" - }, - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger", - "location": "90000", - "questionnaireId": "QXT55", - "reading": false, - "ssech": "dlcB55jdf", - "viewed": true - }, - { - "city": "MONTMORENCY", - "finalizationDate": 1603304314268, - "id": "1032", - "interviewer": { - "id": "INTW5", - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont" - }, - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont", - "location": "95160", - "questionnaireId": "QXT55", - "reading": false, - "ssech": "hgSkR29", - "viewed": true - }, - { - "city": "BELFORT", - "finalizationDate": 1603304314268, - "id": "4819", - "interviewer": { - "id": "INTW6", - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger" - }, - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger", - "location": "90000", - "questionnaireId": "QXT55", - "reading": false, - "ssech": "dlcB55jdf", - "viewed": true - }, - { - "city": "MONTMORENCY", - "comments": [ - { - "type": "managementComment", - "value": "Test" - }, - { - "type": "interviewerComment", - "value": "Test" - } + finalizationDate: 1603304314268, + id: "4816", + displayName: "4816", + interviewer: { + id: "INTW6", + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + }, + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + location: "90000", + questionnaireId: "QXT55", + reading: false, + ssech: "dlcB55jdf", + viewed: true, + }, + { + city: "MONTMORENCY", + finalizationDate: 1603304314268, + id: "1029", + displayName: "1029", + interviewer: { + id: "INTW7", + interviewerFirstName: "Thierry", + interviewerLastName: "Fabres", + }, + interviewerFirstName: "Thierry", + interviewerLastName: "Fabres", + location: "95160", + questionnaireId: "QXT55", + reading: false, + ssech: "hgSkR29", + viewed: true, + }, + { + city: "BELFORT", + finalizationDate: 1603304314268, + id: "4817", + displayName: "4817", + interviewer: { + id: "INTW6", + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + }, + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + location: "90000", + questionnaireId: "QXT55", + reading: false, + ssech: "dlcB55jdf", + viewed: true, + }, + { + city: "MONTMORENCY", + finalizationDate: 1561932000000, + id: "1030", + displayName: "1030", + interviewer: { + id: "INTW5", + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + }, + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + location: "95160", + questionnaireId: "QXT55", + reading: false, + ssech: "hgSkR29", + viewed: true, + }, + { + city: "BELFORT", + finalizationDate: 1561932000000, + id: "4818", + displayName: "4818", + interviewer: { + id: "INTW6", + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + }, + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + location: "90000", + questionnaireId: "QXT55", + reading: false, + ssech: "dlcB55jdf", + viewed: true, + }, + { + city: "MONTMORENCY", + finalizationDate: 1603304314268, + id: "1032", + displayName: "1032", + interviewer: { + id: "INTW5", + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + }, + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + location: "95160", + questionnaireId: "QXT55", + reading: false, + ssech: "hgSkR29", + viewed: true, + }, + { + city: "BELFORT", + finalizationDate: 1603304314268, + id: "4819", + displayName: "4819", + interviewer: { + id: "INTW6", + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + }, + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + location: "90000", + questionnaireId: "QXT55", + reading: false, + ssech: "dlcB55jdf", + viewed: true, + }, + { + city: "MONTMORENCY", + comments: [ + { + type: "managementComment", + value: "Test", + }, + { + type: "interviewerComment", + value: "Test", + }, ], - "finalizationDate": 1561932000000, - "id": "1023", - "interviewer": { - "id": "INTW5", - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont" - }, - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont", - "location": "95160", - "questionnaireId": "QXT55", - "reading": true, - "ssech": "hgSkR29", - "viewed": false + finalizationDate: 1561932000000, + id: "1023", + displayName: "1023", + interviewer: { + id: "INTW5", + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + }, + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + location: "95160", + questionnaireId: "QXT55", + reading: true, + ssech: "hgSkR29", + viewed: false, }, { - "city": "BELFORT", - "comments": [ + city: "BELFORT", + comments: [ { - "type": "managementComment", - "value": "Test" + type: "managementComment", + value: "Test", }, { - "type": "interviewerComment", - "value": "Test" - } + type: "interviewerComment", + value: "Test", + }, ], - "finalizationDate": 1561932000000, - "id": "4811", - "interviewer": { - "id": "INTW6", - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger" - }, - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger", - "location": "90000", - "questionnaireId": "QXT55", - "reading": true, - "ssech": "dlcB55jdf", - "viewed": false + finalizationDate: 1561932000000, + id: "4811", + displayName: "4811", + interviewer: { + id: "INTW6", + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + }, + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + location: "90000", + questionnaireId: "QXT55", + reading: true, + ssech: "dlcB55jdf", + viewed: false, }, { - "city": "MONTMORENCY", - "comments": [ + city: "MONTMORENCY", + comments: [ { - "type": "managementComment", - "value": "Test" + type: "managementComment", + value: "Test", }, { - "type": "interviewerComment", - "value": "Test" - } + type: "interviewerComment", + value: "Test", + }, ], - "finalizationDate": 1603304314268, - "id": "1024", - "interviewer": { - "id": "INTW5", - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont" - }, - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont", - "location": "95160", - "questionnaireId": "QXT55", - "reading": true, - "ssech": "hgSkR29", - "viewed": false + finalizationDate: 1603304314268, + id: "1024", + displayName: "1024", + interviewer: { + id: "INTW5", + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + }, + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + location: "95160", + questionnaireId: "QXT55", + reading: true, + ssech: "hgSkR29", + viewed: false, }, { - "city": "BRIVE-LA-GAILLARDE", - "comments": [ + city: "BRIVE-LA-GAILLARDE", + comments: [ { - "type": "managementComment", - "value": "Test" + type: "managementComment", + value: "Test", }, { - "type": "interviewerComment", - "value": "Test" - } + type: "interviewerComment", + value: "Test", + }, ], - "finalizationDate": 1603304314268, - "id": "4812", - "interviewer": { - "id": "INTW6", - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger" - }, - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger", - "location": "90000", - "questionnaireId": "QXT55", - "reading": true, - "ssech": "dlcB55jdf", - "viewed": false + finalizationDate: 1603304314268, + id: "4812", + displayName: "4812", + interviewer: { + id: "INTW6", + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + }, + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + location: "90000", + questionnaireId: "QXT55", + reading: true, + ssech: "dlcB55jdf", + viewed: false, }, { - "city": "MONTMORENCY", - "comments": [ + city: "MONTMORENCY", + comments: [ { - "type": "managementComment", - "value": "Test" + type: "managementComment", + value: "Test", }, { - "type": "interviewerComment", - "value": "Test" - } + type: "interviewerComment", + value: "Test", + }, ], - "finalizationDate": 1603304314268, - "id": "1025", - "interviewer": { - "id": "INTW5", - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont" - }, - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont", - "location": "95160", - "questionnaireId": "QXT55", - "reading": true, - "ssech": "hgSkR29", - "viewed": true + finalizationDate: 1603304314268, + id: "1025", + displayName: "1025", + interviewer: { + id: "INTW5", + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + }, + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + location: "95160", + questionnaireId: "QXT55", + reading: true, + ssech: "hgSkR29", + viewed: true, }, { - "city": "BELFORT", - "comments": [ + city: "BELFORT", + comments: [ { - "type": "managementComment", - "value": "Test" + type: "managementComment", + value: "Test", }, { - "type": "interviewerComment", - "value": "Test" - } + type: "interviewerComment", + value: "Test", + }, ], - "finalizationDate": 1603304314268, - "id": "4813", - "interviewer": { - "id": "INTW6", - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger" - }, - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger", - "location": "90000", - "questionnaireId": "QXT55", - "reading": true, - "ssech": "dlcB55jdf", - "viewed": true + finalizationDate: 1603304314268, + id: "4813", + displayName: "4813", + interviewer: { + id: "INTW6", + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + }, + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + location: "90000", + questionnaireId: "QXT55", + reading: true, + ssech: "dlcB55jdf", + viewed: true, }, { - "city": "MONTMORENCY", - "comments": [ + city: "MONTMORENCY", + comments: [ { - "type": "managementComment", - "value": "Test" + type: "managementComment", + value: "Test", }, { - "type": "interviewerComment", - "value": "Test" - } + type: "interviewerComment", + value: "Test", + }, ], - "finalizationDate": 1603304314268, - "id": "1027", - "interviewer": { - "id": "INTW5", - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont" - }, - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont", - "location": "95160", - "questionnaireId": "QXT55", - "reading": true, - "ssech": "hgSkR29", - "viewed": true + finalizationDate: 1603304314268, + id: "1027", + displayName: "1027", + interviewer: { + id: "INTW5", + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + }, + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + location: "95160", + questionnaireId: "QXT55", + reading: true, + ssech: "hgSkR29", + viewed: true, }, { - "city": "BELFORT", - "comments": [ + city: "BELFORT", + comments: [ { - "type": "managementComment", - "value": "Test" + type: "managementComment", + value: "Test", }, { - "type": "interviewerComment", - "value": "Test" - } + type: "interviewerComment", + value: "Test", + }, ], - "finalizationDate": 1603304314268, - "id": "4815", - "interviewer": { - "id": "INTW7", - "interviewerFirstName": "Thierry", - "interviewerLastName": "Fabres" - }, - "interviewerFirstName": "Thierry", - "interviewerLastName": "Fabres", - "location": "90000", - "questionnaireId": "QXT55", - "reading": false, - "ssech": "dlcB55jdf", - "viewed": true + finalizationDate: 1603304314268, + id: "4815", + displayName: "4815", + interviewer: { + id: "INTW7", + interviewerFirstName: "Thierry", + interviewerLastName: "Fabres", + }, + interviewerFirstName: "Thierry", + interviewerLastName: "Fabres", + location: "90000", + questionnaireId: "QXT55", + reading: false, + ssech: "dlcB55jdf", + viewed: true, }, { - "city": "MONTMORENCY", - "comments": [ + city: "MONTMORENCY", + comments: [ { - "type": "managementComment", - "value": "Test" + type: "managementComment", + value: "Test", }, { - "type": "interviewerComment", - "value": "Test" - } + type: "interviewerComment", + value: "Test", + }, ], - "finalizationDate": 1603304314268, - "id": "1028", - "interviewer": { - "id": "INTW5", - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont" - }, - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont", - "location": "95160", - "questionnaireId": "QXT55", - "reading": false, - "ssech": "hgSkR29", - "viewed": true + finalizationDate: 1603304314268, + id: "1028", + displayName: "1028", + interviewer: { + id: "INTW5", + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + }, + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + location: "95160", + questionnaireId: "QXT55", + reading: false, + ssech: "hgSkR29", + viewed: true, }, { - "city": "BELFORT", - "comments": [ + city: "BELFORT", + comments: [ { - "type": "managementComment", - "value": "Test" + type: "managementComment", + value: "Test", }, { - "type": "interviewerComment", - "value": "Test" - } + type: "interviewerComment", + value: "Test", + }, ], - "finalizationDate": 1603304314268, - "id": "4816", - "interviewer": { - "id": "INTW6", - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger" - }, - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger", - "location": "90000", - "questionnaireId": "QXT55", - "reading": false, - "ssech": "dlcB55jdf", - "viewed": true - }, - { - "city": "MONTMORENCY", - "finalizationDate": 1603304314268, - "id": "1029", - "interviewer": { - "id": "INTW7", - "interviewerFirstName": "Thierry", - "interviewerLastName": "Fabres" - }, - "interviewerFirstName": "Thierry", - "interviewerLastName": "Fabres", - "location": "95160", - "questionnaireId": "QXT55", - "reading": false, - "ssech": "hgSkR29", - "viewed": true - }, - { - "city": "BELFORT", - "finalizationDate": 1603304314268, - "id": "4817", - "interviewer": { - "id": "INTW6", - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger" - }, - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger", - "location": "90000", - "questionnaireId": "QXT55", - "reading": false, - "ssech": "dlcB55jdf", - "viewed": true - }, - { - "city": "MONTMORENCY", - "finalizationDate": 1561932000000, - "id": "1030", - "interviewer": { - "id": "INTW5", - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont" - }, - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont", - "location": "95160", - "questionnaireId": "QXT55", - "reading": false, - "ssech": "hgSkR29", - "viewed": true - }, - { - "city": "BELFORT", - "finalizationDate": 1561932000000, - "id": "4818", - "interviewer": { - "id": "INTW6", - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger" - }, - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger", - "location": "90000", - "questionnaireId": "QXT55", - "reading": false, - "ssech": "dlcB55jdf", - "viewed": true - }, - { - "city": "MONTMORENCY", - "finalizationDate": 1603304314268, - "id": "1032", - "interviewer": { - "id": "INTW5", - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont" - }, - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont", - "location": "95160", - "questionnaireId": "QXT55", - "reading": false, - "ssech": "hgSkR29", - "viewed": true - }, - { - "city": "BELFORT", - "finalizationDate": 1603304314268, - "id": "4819", - "interviewer": { - "id": "INTW6", - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger" - }, - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger", - "location": "90000", - "questionnaireId": "QXT55", - "reading": false, - "ssech": "dlcB55jdf", - "viewed": true - } + finalizationDate: 1603304314268, + id: "4816", + displayName: "4816", + interviewer: { + id: "INTW6", + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + }, + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + location: "90000", + questionnaireId: "QXT55", + reading: false, + ssech: "dlcB55jdf", + viewed: true, + }, + { + city: "MONTMORENCY", + finalizationDate: 1603304314268, + id: "1029", + displayName: "1029", + interviewer: { + id: "INTW7", + interviewerFirstName: "Thierry", + interviewerLastName: "Fabres", + }, + interviewerFirstName: "Thierry", + interviewerLastName: "Fabres", + location: "95160", + questionnaireId: "QXT55", + reading: false, + ssech: "hgSkR29", + viewed: true, + }, + { + city: "BELFORT", + finalizationDate: 1603304314268, + id: "4817", + displayName: "4817", + interviewer: { + id: "INTW6", + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + }, + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + location: "90000", + questionnaireId: "QXT55", + reading: false, + ssech: "dlcB55jdf", + viewed: true, + }, + { + city: "MONTMORENCY", + finalizationDate: 1561932000000, + id: "1030", + displayName: "1030", + interviewer: { + id: "INTW5", + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + }, + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + location: "95160", + questionnaireId: "QXT55", + reading: false, + ssech: "hgSkR29", + viewed: true, + }, + { + city: "BELFORT", + finalizationDate: 1561932000000, + id: "4818", + displayName: "4818", + interviewer: { + id: "INTW6", + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + }, + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + location: "90000", + questionnaireId: "QXT55", + reading: false, + ssech: "dlcB55jdf", + viewed: true, + }, + { + city: "MONTMORENCY", + finalizationDate: 1603304314268, + id: "1032", + displayName: "1032", + interviewer: { + id: "INTW5", + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + }, + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + location: "95160", + questionnaireId: "QXT55", + reading: false, + ssech: "hgSkR29", + viewed: true, + }, + { + city: "BELFORT", + finalizationDate: 1603304314268, + id: "4819", + displayName: "4819", + interviewer: { + id: "INTW6", + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + }, + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + location: "90000", + questionnaireId: "QXT55", + reading: false, + ssech: "dlcB55jdf", + viewed: true, + }, ]; -export default val; \ No newline at end of file +export default val; diff --git a/src/tests/mocks/listSU.js b/src/tests/mocks/listSU.js index 07aeb96..4da38e8 100644 --- a/src/tests/mocks/listSU.js +++ b/src/tests/mocks/listSU.js @@ -5,6 +5,7 @@ const val = { "city": "Aulnoye-Aimeries", "departement": "59620", "id": "20", + "displayName": "20", "idep": "INTW1", "interviewer": "Lucas Margie", "ssech": 1 @@ -13,6 +14,7 @@ const val = { "city": "Vienne", "departement": "38200", "id": "21", + "displayName": "21", "idep": "INTW2", "interviewer": "Campbell Carlton", "ssech": 1 @@ -21,6 +23,7 @@ const val = { "city": "Arras", "departement": "62000", "id": "22", + "displayName": "22", "idep": "INTW4", "interviewer": "Xern Fabrice", "ssech": 2 @@ -29,6 +32,7 @@ const val = { "city": "Belfort", "departement": "65000", "id": "29", + "displayName": "29", "idep": "INTW12", "interviewer": "Delmare Mathilde", "ssech": 1 @@ -37,6 +41,7 @@ const val = { "city": "Paris", "departement": "75000", "id": "33", + "displayName": "33", "idep": "INTW14", "interviewer": "Antoine Tarje", "ssech": 1 @@ -45,6 +50,7 @@ const val = { "city": "Arras", "departement": "62000", "id": "55", + "displayName": "55", "idep": "INTW4", "interviewer": "Bertrand Ulysse", "ssech": 2 @@ -53,6 +59,7 @@ const val = { "city": "Rennes", "departement": "35000", "id": "23", + "displayName": "23", "idep": "INTW4", "interviewer": "Grant Melody", "ssech": 1 diff --git a/src/tests/mocks/pearlJamMocks.js b/src/tests/mocks/pearlJamMocks.js index 1ac41af..257f0ab 100644 --- a/src/tests/mocks/pearlJamMocks.js +++ b/src/tests/mocks/pearlJamMocks.js @@ -1,1587 +1,1627 @@ const val = { - "campaignsByInterviewer": [ + campaignsByInterviewer: [ { - "id": "simpsons2020x00", - "label": "Survey on the Simpsons tv show 2020", - "managementStartDate": 1576801000000, - "endDate": 1641514600000 + id: "simpsons2020x00", + label: "Survey on the Simpsons tv show 2020", + managementStartDate: 1576801000000, + endDate: 1641514600000, }, { - "id": "vqs2021x00", - "label": "Everyday life and health survey 2021", - "managementStartDate": 1576801000000, - "endDate": 1641514600000 + id: "vqs2021x00", + label: "Everyday life and health survey 2021", + managementStartDate: 1576801000000, + endDate: 1641514600000, }, { - "id": "simpsosfqns2020x00", - "label": "Survey on something 2020", - "managementStartDate": 1576801000000, - "endDate": 1641514600000 - } + id: "simpsosfqns2020x00", + label: "Survey on something 2020", + managementStartDate: 1576801000000, + endDate: 1641514600000, + }, ], - "interviewers": [ + interviewers: [ { - "id": "INTW5", - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont" + id: "INTW5", + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", }, { - "id": "INTW6", - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger" + id: "INTW6", + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", }, { - "id": "INTW7", - "interviewerFirstName": "Thierry", - "interviewerLastName": "Fabres" + id: "INTW7", + interviewerFirstName: "Thierry", + interviewerLastName: "Fabres", }, { - "id": "INTW8", - "interviewerFirstName": "Bertrand", - "interviewerLastName": "Renard" + id: "INTW8", + interviewerFirstName: "Bertrand", + interviewerLastName: "Renard", }, { - "id": "INTW9", - "interviewerFirstName": "Emilie", - "interviewerLastName": "Boulanger" + id: "INTW9", + interviewerFirstName: "Emilie", + interviewerLastName: "Boulanger", }, { - "id": "INTW10", - "interviewerFirstName": "Renée", - "interviewerLastName": "Dupont" + id: "INTW10", + interviewerFirstName: "Renée", + interviewerLastName: "Dupont", }, { - "id": "INTW11", - "interviewerFirstName": "Alphonse", - "interviewerLastName": "Delmarre" - } + id: "INTW11", + interviewerFirstName: "Alphonse", + interviewerLastName: "Delmarre", + }, ], - "interviewersByCampaign": [ + interviewersByCampaign: [ { - "id": "INTW5", - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont", - "surveyUnitCount": 84 + id: "INTW5", + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + surveyUnitCount: 84, }, { - "id": "INTW6", - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger", - "surveyUnitCount": 55 + id: "INTW6", + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + surveyUnitCount: 55, }, { - "id": "INTW7", - "interviewerFirstName": "Thierry", - "interviewerLastName": "Fabres", - "surveyUnitCount": 76 + id: "INTW7", + interviewerFirstName: "Thierry", + interviewerLastName: "Fabres", + surveyUnitCount: 76, }, { - "id": "INTW8", - "interviewerFirstName": "Bertrand", - "interviewerLastName": "Renard", - "surveyUnitCount": 84 + id: "INTW8", + interviewerFirstName: "Bertrand", + interviewerLastName: "Renard", + surveyUnitCount: 84, }, { - "id": "INTW9", - "interviewerFirstName": "Emilie", - "interviewerLastName": "Boulanger", - "surveyUnitCount": 55 + id: "INTW9", + interviewerFirstName: "Emilie", + interviewerLastName: "Boulanger", + surveyUnitCount: 55, }, { - "id": "INTW10", - "interviewerFirstName": "Renée", - "interviewerLastName": "Dupont", - "surveyUnitCount": 84 + id: "INTW10", + interviewerFirstName: "Renée", + interviewerLastName: "Dupont", + surveyUnitCount: 84, }, { - "id": "INTW11", - "interviewerFirstName": "Alphonse", - "interviewerLastName": "Delmarre", - "surveyUnitCount": 55 - } + id: "INTW11", + interviewerFirstName: "Alphonse", + interviewerLastName: "Delmarre", + surveyUnitCount: 55, + }, ], - "notAttributed": { - "count": 14 + notAttributed: { + count: 14, }, - "abandoned": { - "count": 2 + abandoned: { + count: 2, }, - "terminated": [ - { - "campaignLabel": "simpsons2020x00", - "id": "1023", - "ssech": "hgSkR29", - "location": "95160", - "city": "MONTMORENCY", - "finalizationDate": 1561932000000, - "interviewer": { - "id": "INTW5", - "interviewerFirstName": "Chloé", - "interviewerLastName": "Berlin" - } - }, - { - "campaignLabel": "simpsons2020x00", - "id": "4811", - "ssech": "dlcB55jdf", - "location": "90000", - "city": "BELFORT", - "finalizationDate": 1561932100001, - "interviewer": { - "id": "INTW6", - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger" - } - }, - { - "campaignLabel": "simpsons2020x00", - "id": "1024", - "ssech": "hgSkR29", - "location": "95160", - "city": "MONTMORENCY", - "finalizationDate": 1613304314269, - "interviewer": { - "id": "INTW5", - "interviewerFirstName": "Chloé", - "interviewerLastName": "Berlin" - } - }, - { - "campaignLabel": "simpsons2020x00", - "id": "4812", - "ssech": "dlcB55jdf", - "location": "90000", - "city": "BELFORT", - "finalizationDate": 1623314314268, - "interviewer": { - "id": "INTW6", - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger" - } - }, - { - "campaignLabel": "simpsons2020x00", - "id": "1025", - "ssech": "hgSkR29", - "location": "95160", - "city": "MONTMORENCY", - "finalizationDate": 1761932000000, - "interviewer": { - "id": "INTW5", - "interviewerFirstName": "Chloé", - "interviewerLastName": "Berlin" - } - }, - { - "campaignLabel": "simpsons2020x00", - "id": "4813", - "ssech": "dlcB55jdf", - "location": "90000", - "city": "BELFORT", - "finalizationDate": 1661932000000, - "interviewer": { - "id": "INTW6", - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger" - } - }, - { - "campaignLabel": "simpsons2020x00", - "id": "1026", - "ssech": "hgSkR29", - "location": "95160", - "city": "MONTMORENCY", - "finalizationDate": 1651932000069, - "interviewer": { - "id": "INTW5", - "interviewerFirstName": "Chloé", - "interviewerLastName": "Berlin" - } - }, - { - "campaignLabel": "simpsons2020x00", - "id": "4814", - "ssech": "dlcB55jdf", - "location": "90000", - "city": "BELFORT", - "finalizationDate": 1603304314268, - "interviewer": { - "id": "INTW6", - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger" - } - } + terminated: [ + { + campaignLabel: "simpsons2020x00", + id: "1023", + displayName: "1023", + ssech: "hgSkR29", + location: "95160", + city: "MONTMORENCY", + finalizationDate: 1561932000000, + interviewer: { + id: "INTW5", + interviewerFirstName: "Chloé", + interviewerLastName: "Berlin", + }, + }, + { + campaignLabel: "simpsons2020x00", + id: "4811", + displayName: "4811", + ssech: "dlcB55jdf", + location: "90000", + city: "BELFORT", + finalizationDate: 1561932100001, + interviewer: { + id: "INTW6", + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + }, + }, + { + campaignLabel: "simpsons2020x00", + id: "1024", + displayName: "1024", + ssech: "hgSkR29", + location: "95160", + city: "MONTMORENCY", + finalizationDate: 1613304314269, + interviewer: { + id: "INTW5", + interviewerFirstName: "Chloé", + interviewerLastName: "Berlin", + }, + }, + { + campaignLabel: "simpsons2020x00", + id: "4812", + displayName: "4812", + ssech: "dlcB55jdf", + location: "90000", + city: "BELFORT", + finalizationDate: 1623314314268, + interviewer: { + id: "INTW6", + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + }, + }, + { + campaignLabel: "simpsons2020x00", + id: "1025", + displayName: "1025", + ssech: "hgSkR29", + location: "95160", + city: "MONTMORENCY", + finalizationDate: 1761932000000, + interviewer: { + id: "INTW5", + interviewerFirstName: "Chloé", + interviewerLastName: "Berlin", + }, + }, + { + campaignLabel: "simpsons2020x00", + id: "4813", + displayName: "4813", + ssech: "dlcB55jdf", + location: "90000", + city: "BELFORT", + finalizationDate: 1661932000000, + interviewer: { + id: "INTW6", + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + }, + }, + { + campaignLabel: "simpsons2020x00", + id: "1026", + displayName: "1026", + ssech: "hgSkR29", + location: "95160", + city: "MONTMORENCY", + finalizationDate: 1651932000069, + interviewer: { + id: "INTW5", + interviewerFirstName: "Chloé", + interviewerLastName: "Berlin", + }, + }, + { + campaignLabel: "simpsons2020x00", + id: "4814", + displayName: "4814", + ssech: "dlcB55jdf", + location: "90000", + city: "BELFORT", + finalizationDate: 1603304314268, + interviewer: { + id: "INTW6", + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + }, + }, ], - "states": { - "id": "ue432", - "states": [ + states: { + id: "ue432", + states: [ { - "id": 3, - "date": 1595657530000, - "type": "AOC" + id: 3, + date: 1595657530000, + type: "AOC", }, { - "id": 2, - "date": 1596120310000, - "type": "ANS" + id: 2, + date: 1596120310000, + type: "ANS", }, { - "id": 1, - "date": 1596188129587, - "type": "ANS" - } - ] + id: 1, + date: 1596188129587, + type: "ANS", + }, + ], }, - "stateCountTotal": { - "organizationUnits": [ + stateCountTotal: { + organizationUnits: [ { - "idDem": "OU-SOUTH", - "labelDem": "South region organizational unit", - "isLocal": true, - "nvmCount": 0, - "anvCount": 0, - "nnsCount": 2, - "vinCount": 0, - "vicCount": 20, - "prcCount": 29, - "aocCount": 30, - "apsCount": 20, - "insCount": 5, - "wftCount": 0, - "wfsCount": 0, - "tbrCount": 2, - "finCount": 1, - - "cloCount": 3, - "npaCount": 2, - "npiCount": 3, - "rowCount": 4, - "nvaCount": 0, - "total": 104 + idDem: "OU-SOUTH", + labelDem: "South region organizational unit", + isLocal: true, + nvmCount: 0, + anvCount: 0, + nnsCount: 2, + vinCount: 0, + vicCount: 20, + prcCount: 29, + aocCount: 30, + apsCount: 20, + insCount: 5, + wftCount: 0, + wfsCount: 0, + tbrCount: 2, + finCount: 1, + + cloCount: 3, + npaCount: 2, + npiCount: 3, + rowCount: 4, + nvaCount: 0, + total: 104, }, { - "idDem": "OU-NORTH", - "labelDem": "North region organizational unit", - "isLocal": true, - "nvmCount": 0, - "anvCount": 0, - "nnsCount": 2, - "vinCount": 0, - "vicCount": 22, - "prcCount": 8, - "aocCount": 30, - "apsCount": 12, - "insCount": 5, - "wftCount": 8, - "wfsCount": 0, - "tbrCount": 2, - "finCount": 1, - - "cloCount": 3, - "npaCount": 2, - "npiCount": 3, - "rowCount": 4, - "nvaCount": 0, - "total": 104 + idDem: "OU-NORTH", + labelDem: "North region organizational unit", + isLocal: true, + nvmCount: 0, + anvCount: 0, + nnsCount: 2, + vinCount: 0, + vicCount: 22, + prcCount: 8, + aocCount: 30, + apsCount: 12, + insCount: 5, + wftCount: 8, + wfsCount: 0, + tbrCount: 2, + finCount: 1, + + cloCount: 3, + npaCount: 2, + npiCount: 3, + rowCount: 4, + nvaCount: 0, + total: 104, }, { - "idDem": "OU-NATIONAL", - "labelDem": "National organizational unit", - "isLocal": false, - "nvmCount": 0, - "anvCount": 0, - "nnsCount": 2, - "vinCount": 0, - "vicCount": 22, - "prcCount": 8, - "aocCount": 30, - "apsCount": 12, - "insCount": 5, - "wftCount": 0, - "wfsCount": 0, - "tbrCount": 2, - "finCount": 1, - - "cloCount": 3, - "npaCount": 2, - "npiCount": 3, - "rowCount": 4, - "nvaCount": 0, - "total": 104 - } + idDem: "OU-NATIONAL", + labelDem: "National organizational unit", + isLocal: false, + nvmCount: 0, + anvCount: 0, + nnsCount: 2, + vinCount: 0, + vicCount: 22, + prcCount: 8, + aocCount: 30, + apsCount: 12, + insCount: 5, + wftCount: 0, + wfsCount: 0, + tbrCount: 2, + finCount: 1, + + cloCount: 3, + npaCount: 2, + npiCount: 3, + rowCount: 4, + nvaCount: 0, + total: 104, + }, ], - "france": { - "nvmCount": 0, - "anvCount": 0, - "nnsCount": 2, - "vinCount": 0, - "vicCount": 8, - "prcCount": 29, - "aocCount": 20, - "apsCount": 20, - "insCount": 5, - "wftCount": 0, - "wfsCount": 0, - "tbrCount": 2, - "finCount": 1, + france: { + nvmCount: 0, + anvCount: 0, + nnsCount: 2, + vinCount: 0, + vicCount: 8, + prcCount: 29, + aocCount: 20, + apsCount: 20, + insCount: 5, + wftCount: 0, + wfsCount: 0, + tbrCount: 2, + finCount: 1, - "cloCount": 3, - "npaCount": 2, - "npiCount": 3, - "rowCount": 4, - "nvaCount": 0, - "total": 104 - } + cloCount: 3, + npaCount: 2, + npiCount: 3, + rowCount: 4, + nvaCount: 0, + total: 104, + }, }, - "stateCountNotAttributed": { - "nvmCount": 22, - "nnsCount": 22, - "anvCount": 22, - "vinCount": 22, - "vicCount": 22, - "prcCount": 29, - "aocCount": 30, - "apsCount": 12, - "insCount": 5, - "wftCount": 0, - "wfsCount": 0, - "tbrCount": 2, - "finCount": 1, - - "cloCount": 3, - "npaCount": 0, - "npiCount": 1, - "rowCount": 0, - "nvaCount": 0, - "total": 104 + stateCountNotAttributed: { + nvmCount: 22, + nnsCount: 22, + anvCount: 22, + vinCount: 22, + vicCount: 22, + prcCount: 29, + aocCount: 30, + apsCount: 12, + insCount: 5, + wftCount: 0, + wfsCount: 0, + tbrCount: 2, + finCount: 1, + + cloCount: 3, + npaCount: 0, + npiCount: 1, + rowCount: 0, + nvaCount: 0, + total: 104, }, - "stateCountByCampaign": [ - { - "campaign": { - "id": "simpsons2020x00", - "label": "Survey on the Simpsons tv show 2020" - }, - "nvmCount": 22, - "nnsCount": 22, - "anvCount": 22, - "vinCount": 22, - "vicCount": 22, - "prcCount": 29, - "aocCount": 30, - "apsCount": 12, - "insCount": 5, - "wftCount": 0, - "wfsCount": 0, - "tbrCount": 2, - "finCount": 1, + stateCountByCampaign: [ + { + campaign: { + id: "simpsons2020x00", + label: "Survey on the Simpsons tv show 2020", + }, + nvmCount: 22, + nnsCount: 22, + anvCount: 22, + vinCount: 22, + vicCount: 22, + prcCount: 29, + aocCount: 30, + apsCount: 12, + insCount: 5, + wftCount: 0, + wfsCount: 0, + tbrCount: 2, + finCount: 1, - "cloCount": 3, - "npaCount": 2, - "npiCount": 2, - "rowCount": 2, - "nvaCount": 0, - "total": 104 - }, - { - "campaign": { - "id": "simpsosfqns2020x00", - "label": "Survey on something 2020" - }, - "nvmCount": 22, - "nnsCount": 22, - "anvCount": 22, - "vinCount": 22, - "vicCount": 22, - "prcCount": 29, - "aocCount": 30, - "apsCount": 12, - "insCount": 5, - "wftCount": 0, - "wfsCount": 0, - "tbrCount": 2, - "finCount": 1, + cloCount: 3, + npaCount: 2, + npiCount: 2, + rowCount: 2, + nvaCount: 0, + total: 104, + }, + { + campaign: { + id: "simpsosfqns2020x00", + label: "Survey on something 2020", + }, + nvmCount: 22, + nnsCount: 22, + anvCount: 22, + vinCount: 22, + vicCount: 22, + prcCount: 29, + aocCount: 30, + apsCount: 12, + insCount: 5, + wftCount: 0, + wfsCount: 0, + tbrCount: 2, + finCount: 1, - "cloCount": 3, - "npaCount": 2, - "npiCount": 2, - "rowCount": 2, - "nvaCount": 0, - "total": 104 - }, - { - "campaign": { - "id": "vqs2fsqe021x00", - "label": "Everyday life and health survey 2022" - }, - "nvmCount": 22, - "nnsCount": 22, - "anvCount": 22, - "vinCount": 22, - "vicCount": 22, - "prcCount": 29, - "aocCount": 30, - "apsCount": 12, - "insCount": 5, - "wftCount": 0, - "wfsCount": 0, - "tbrCount": 2, - "finCount": 1, + cloCount: 3, + npaCount: 2, + npiCount: 2, + rowCount: 2, + nvaCount: 0, + total: 104, + }, + { + campaign: { + id: "vqs2fsqe021x00", + label: "Everyday life and health survey 2022", + }, + nvmCount: 22, + nnsCount: 22, + anvCount: 22, + vinCount: 22, + vicCount: 22, + prcCount: 29, + aocCount: 30, + apsCount: 12, + insCount: 5, + wftCount: 0, + wfsCount: 0, + tbrCount: 2, + finCount: 1, - "cloCount": 3, - "npaCount": 2, - "npiCount": 2, - "rowCount": 2, - "nvaCount": 0, - "total": 104 - }, - { - "campaign": { - "id": "simpsonqsdfsqes2020x00", - "label": "Survey on something else 2020" - }, - "nvmCount": 22, - "nnsCount": 22, - "anvCount": 22, - "vinCount": 22, - "vicCount": 22, - "prcCount": 29, - "aocCount": 30, - "apsCount": 12, - "insCount": 5, - "wftCount": 0, - "wfsCount": 0, - "tbrCount": 2, - "finCount": 1, + cloCount: 3, + npaCount: 2, + npiCount: 2, + rowCount: 2, + nvaCount: 0, + total: 104, + }, + { + campaign: { + id: "simpsonqsdfsqes2020x00", + label: "Survey on something else 2020", + }, + nvmCount: 22, + nnsCount: 22, + anvCount: 22, + vinCount: 22, + vicCount: 22, + prcCount: 29, + aocCount: 30, + apsCount: 12, + insCount: 5, + wftCount: 0, + wfsCount: 0, + tbrCount: 2, + finCount: 1, - "cloCount": 3, - "npaCount": 2, - "npiCount": 2, - "rowCount": 2, - "nvaCount": 0, - "total": 104 - }, - { - "campaign": { - "id": "vqs2qfsdfsqe021x00", - "label": "Everyday life and health survey 2026" - }, - "nvmCount": 22, - "nnsCount": 22, - "anvCount": 22, - "vinCount": 22, - "vicCount": 22, - "prcCount": 29, - "aocCount": 30, - "apsCount": 12, - "insCount": 5, - "wftCount": 0, - "wfsCount": 0, - "tbrCount": 2, - "finCount": 1, + cloCount: 3, + npaCount: 2, + npiCount: 2, + rowCount: 2, + nvaCount: 0, + total: 104, + }, + { + campaign: { + id: "vqs2qfsdfsqe021x00", + label: "Everyday life and health survey 2026", + }, + nvmCount: 22, + nnsCount: 22, + anvCount: 22, + vinCount: 22, + vicCount: 22, + prcCount: 29, + aocCount: 30, + apsCount: 12, + insCount: 5, + wftCount: 0, + wfsCount: 0, + tbrCount: 2, + finCount: 1, - "cloCount": 3, - "npaCount": 2, - "npiCount": 2, - "rowCount": 2, - "nvaCount": 0, - "total": 104 - }, - { - "campaign": { - "id": "simpsonkgs2020x00", - "label": "Survey on the Simpsons tv show 2021" - }, - "nvmCount": 22, - "nnsCount": 22, - "anvCount": 22, - "vinCount": 22, - "vicCount": 22, - "prcCount": 29, - "aocCount": 30, - "apsCount": 12, - "insCount": 5, - "wftCount": 0, - "wfsCount": 0, - "tbrCount": 2, - "finCount": 1, + cloCount: 3, + npaCount: 2, + npiCount: 2, + rowCount: 2, + nvaCount: 0, + total: 104, + }, + { + campaign: { + id: "simpsonkgs2020x00", + label: "Survey on the Simpsons tv show 2021", + }, + nvmCount: 22, + nnsCount: 22, + anvCount: 22, + vinCount: 22, + vicCount: 22, + prcCount: 29, + aocCount: 30, + apsCount: 12, + insCount: 5, + wftCount: 0, + wfsCount: 0, + tbrCount: 2, + finCount: 1, - "cloCount": 3, - "npaCount": 2, - "npiCount": 2, - "rowCount": 2, - "nvaCount": 0, - "total": 104 - }, - { - "campaign": { - "id": "vqs202fgd1x00", - "label": "Everyday life and health survey 2018" - }, - "nvmCount": 22, - "nnsCount": 22, - "anvCount": 22, - "vinCount": 22, - "vicCount": 22, - "prcCount": 29, - "aocCount": 30, - "apsCount": 12, - "insCount": 5, - "wftCount": 0, - "wfsCount": 0, - "tbrCount": 2, - "finCount": 1, + cloCount: 3, + npaCount: 2, + npiCount: 2, + rowCount: 2, + nvaCount: 0, + total: 104, + }, + { + campaign: { + id: "vqs202fgd1x00", + label: "Everyday life and health survey 2018", + }, + nvmCount: 22, + nnsCount: 22, + anvCount: 22, + vinCount: 22, + vicCount: 22, + prcCount: 29, + aocCount: 30, + apsCount: 12, + insCount: 5, + wftCount: 0, + wfsCount: 0, + tbrCount: 2, + finCount: 1, - "cloCount": 3, - "npaCount": 2, - "npiCount": 2, - "rowCount": 2, - "nvaCount": 0, - "total": 104 - } + cloCount: 3, + npaCount: 2, + npiCount: 2, + rowCount: 2, + nvaCount: 0, + total: 104, + }, ], - "surveyUnits": [ - { - "id": "1023", - "ssech": "hgSkR29", - "location": "95160", - "city": "MONTMORENCY", - "finalizationDate": 1561932000000, - "reading": true, - "viewed": false, - "interviewer": { - "id": "INTW5", - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont" - }, - "comments": [ + surveyUnits: [ + { + id: "1023", + displayName: "1023", + ssech: "hgSkR29", + location: "95160", + city: "MONTMORENCY", + finalizationDate: 1561932000000, + reading: true, + viewed: false, + interviewer: { + id: "INTW5", + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + }, + comments: [ { - "type": "managementComment", - "value": "Test" + type: "managementComment", + value: "Test", }, { - "type": "interviewerComment", - "value": "Test" - } - ] - }, - { - "id": "4811", - "ssech": "dlcB55jdf", - "location": "90000", - "city": "BELFORT", - "finalizationDate": 1561932000000, - "reading": true, - "viewed": false, - "interviewer": { - "id": "INTW6", - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger" - }, - "comments": [ + type: "interviewerComment", + value: "Test", + }, + ], + }, + { + id: "4811", + displayName: "4811", + ssech: "dlcB55jdf", + location: "90000", + city: "BELFORT", + finalizationDate: 1561932000000, + reading: true, + viewed: false, + interviewer: { + id: "INTW6", + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + }, + comments: [ { - "type": "managementComment", - "value": "Test" + type: "managementComment", + value: "Test", }, { - "type": "interviewerComment", - "value": "Test" - } - ] - }, - { - "id": "1024", - "ssech": "hgSkR29", - "location": "95160", - "city": "MONTMORENCY", - "finalizationDate": 1603304314268, - "reading": true, - "viewed": false, - "interviewer": { - "id": "INTW5", - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont" - }, - "comments": [ + type: "interviewerComment", + value: "Test", + }, + ], + }, + { + id: "1024", + displayName: "1024", + ssech: "hgSkR29", + location: "95160", + city: "MONTMORENCY", + finalizationDate: 1603304314268, + reading: true, + viewed: false, + interviewer: { + id: "INTW5", + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + }, + comments: [ { - "type": "managementComment", - "value": "Test" + type: "managementComment", + value: "Test", }, { - "type": "interviewerComment", - "value": "Test" - } - ] - }, - { - "id": "4812", - "ssech": "dlcB55jdf", - "location": "90000", - "city": "BRIVE-LA-GAILLARDE", - "finalizationDate": 1603304314268, - "reading": true, - "viewed": false, - "interviewer": { - "id": "INTW6", - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger" - }, - "comments": [ + type: "interviewerComment", + value: "Test", + }, + ], + }, + { + id: "4812", + displayName: "4812", + ssech: "dlcB55jdf", + location: "90000", + city: "BRIVE-LA-GAILLARDE", + finalizationDate: 1603304314268, + reading: true, + viewed: false, + interviewer: { + id: "INTW6", + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + }, + comments: [ { - "type": "managementComment", - "value": "Test" + type: "managementComment", + value: "Test", }, { - "type": "interviewerComment", - "value": "Test" - } - ] - }, - { - "id": "1025", - "ssech": "hgSkR29", - "location": "95160", - "city": "MONTMORENCY", - "finalizationDate": 1603304314268, - "reading": true, - "viewed": true, - "interviewer": { - "id": "INTW5", - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont" - }, - "comments": [ + type: "interviewerComment", + value: "Test", + }, + ], + }, + { + id: "1025", + displayName: "1025", + ssech: "hgSkR29", + location: "95160", + city: "MONTMORENCY", + finalizationDate: 1603304314268, + reading: true, + viewed: true, + interviewer: { + id: "INTW5", + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + }, + comments: [ { - "type": "managementComment", - "value": "Test" + type: "managementComment", + value: "Test", }, { - "type": "interviewerComment", - "value": "Test" - } - ] - }, - { - "id": "4813", - "ssech": "dlcB55jdf", - "location": "90000", - "city": "BELFORT", - "finalizationDate": 1603304314268, - "reading": true, - "viewed": true, - "interviewer": { - "id": "INTW6", - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger" - }, - "comments": [ + type: "interviewerComment", + value: "Test", + }, + ], + }, + { + id: "4813", + displayName: "4813", + ssech: "dlcB55jdf", + location: "90000", + city: "BELFORT", + finalizationDate: 1603304314268, + reading: true, + viewed: true, + interviewer: { + id: "INTW6", + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + }, + comments: [ { - "type": "managementComment", - "value": "Test" + type: "managementComment", + value: "Test", }, { - "type": "interviewerComment", - "value": "Test" - } - ] - }, - { - "id": "1027", - "ssech": "hgSkR29", - "location": "95160", - "city": "MONTMORENCY", - "finalizationDate": 1603304314268, - "reading": true, - "viewed": true, - "interviewer": { - "id": "INTW5", - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont" - }, - "comments": [ + type: "interviewerComment", + value: "Test", + }, + ], + }, + { + id: "1027", + displayName: "1027", + ssech: "hgSkR29", + location: "95160", + city: "MONTMORENCY", + finalizationDate: 1603304314268, + reading: true, + viewed: true, + interviewer: { + id: "INTW5", + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + }, + comments: [ { - "type": "managementComment", - "value": "Test" + type: "managementComment", + value: "Test", }, { - "type": "interviewerComment", - "value": "Test" - } - ] - }, - { - "id": "4815", - "ssech": "dlcB55jdf", - "location": "90000", - "city": "BELFORT", - "finalizationDate": 1603304314268, - "reading": false, - "viewed": true, - "interviewer": { - "id": "INTW7", - "interviewerFirstName": "Thierry", - "interviewerLastName": "Fabres" - }, - "comments": [ + type: "interviewerComment", + value: "Test", + }, + ], + }, + { + id: "4815", + displayName: "4815", + ssech: "dlcB55jdf", + location: "90000", + city: "BELFORT", + finalizationDate: 1603304314268, + reading: false, + viewed: true, + interviewer: { + id: "INTW7", + interviewerFirstName: "Thierry", + interviewerLastName: "Fabres", + }, + comments: [ { - "type": "managementComment", - "value": "Test" + type: "managementComment", + value: "Test", }, { - "type": "interviewerComment", - "value": "Test" - } - ] - }, - { - "id": "1028", - "ssech": "hgSkR29", - "location": "95160", - "city": "MONTMORENCY", - "finalizationDate": 1603304314268, - "reading": false, - "viewed": true, - "interviewer": { - "id": "INTW5", - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont" - }, - "comments": [ + type: "interviewerComment", + value: "Test", + }, + ], + }, + { + id: "1028", + displayName: "1028", + ssech: "hgSkR29", + location: "95160", + city: "MONTMORENCY", + finalizationDate: 1603304314268, + reading: false, + viewed: true, + interviewer: { + id: "INTW5", + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + }, + comments: [ { - "type": "managementComment", - "value": "Test" + type: "managementComment", + value: "Test", }, { - "type": "interviewerComment", - "value": "Test" - } - ] - }, - { - "id": "4816", - "ssech": "dlcB55jdf", - "location": "90000", - "city": "BELFORT", - "finalizationDate": 1603304314268, - "reading": false, - "viewed": true, - "interviewer": { - "id": "INTW6", - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger" - }, - "comments": [ + type: "interviewerComment", + value: "Test", + }, + ], + }, + { + id: "4816", + displayName: "4816", + ssech: "dlcB55jdf", + location: "90000", + city: "BELFORT", + finalizationDate: 1603304314268, + reading: false, + viewed: true, + interviewer: { + id: "INTW6", + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + }, + comments: [ { - "type": "managementComment", - "value": "Test" + type: "managementComment", + value: "Test", }, { - "type": "interviewerComment", - "value": "Test" - } - ] - }, - { - "id": "1029", - "ssech": "hgSkR29", - "location": "95160", - "city": "MONTMORENCY", - "finalizationDate": 1603304314268, - "reading": false, - "viewed": true, - "interviewer": { - "id": "INTW7", - "interviewerFirstName": "Thierry", - "interviewerLastName": "Fabres" - } - }, - { - "id": "4817", - "ssech": "dlcB55jdf", - "location": "90000", - "city": "BELFORT", - "finalizationDate": 1603304314268, - "reading": false, - "viewed": true, - "interviewer": { - "id": "INTW6", - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger" - } - }, - { - "id": "1030", - "ssech": "hgSkR29", - "location": "95160", - "city": "MONTMORENCY", - "finalizationDate": 1561932000000, - "reading": false, - "viewed": true, - "interviewer": { - "id": "INTW5", - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont" - } - }, - { - "id": "4818", - "ssech": "dlcB55jdf", - "location": "90000", - "city": "BELFORT", - "finalizationDate": 1561932000000, - "reading": false, - "viewed": true, - "interviewer": { - "id": "INTW6", - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger" - } - }, - { - "id": "1032", - "ssech": "hgSkR29", - "location": "95160", - "city": "MONTMORENCY", - "finalizationDate": 1603304314268, - "reading": false, - "viewed": true, - "interviewer": { - "id": "INTW5", - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont" - } - }, - { - "id": "4819", - "ssech": "dlcB55jdf", - "location": "90000", - "city": "BELFORT", - "finalizationDate": 1603304314268, - "reading": false, - "viewed": true, - "interviewer": { - "id": "INTW6", - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger" - } - } + type: "interviewerComment", + value: "Test", + }, + ], + }, + { + id: "1029", + displayName: "1029", + ssech: "hgSkR29", + location: "95160", + city: "MONTMORENCY", + finalizationDate: 1603304314268, + reading: false, + viewed: true, + interviewer: { + id: "INTW7", + interviewerFirstName: "Thierry", + interviewerLastName: "Fabres", + }, + }, + { + id: "4817", + displayName: "4817", + ssech: "dlcB55jdf", + location: "90000", + city: "BELFORT", + finalizationDate: 1603304314268, + reading: false, + viewed: true, + interviewer: { + id: "INTW6", + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + }, + }, + { + id: "1030", + displayName: "1030", + ssech: "hgSkR29", + location: "95160", + city: "MONTMORENCY", + finalizationDate: 1561932000000, + reading: false, + viewed: true, + interviewer: { + id: "INTW5", + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + }, + }, + { + id: "4818", + displayName: "4818", + ssech: "dlcB55jdf", + location: "90000", + city: "BELFORT", + finalizationDate: 1561932000000, + reading: false, + viewed: true, + interviewer: { + id: "INTW6", + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + }, + }, + { + id: "1032", + displayName: "1032", + ssech: "hgSkR29", + location: "95160", + city: "MONTMORENCY", + finalizationDate: 1603304314268, + reading: false, + viewed: true, + interviewer: { + id: "INTW5", + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + }, + }, + { + id: "4819", + displayName: "4819", + ssech: "dlcB55jdf", + location: "90000", + city: "BELFORT", + finalizationDate: 1603304314268, + reading: false, + viewed: true, + interviewer: { + id: "INTW6", + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + }, + }, ], - "surveyUnitsClosable": [ - { - "id": "1023", - "ssech": "hgSkR29", - "location": "95160", - "city": "MONTMORENCY", - "finalizationDate": 1561932000000, - "interviewer": { - "id": "INTW5", - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont" - }, - "campaign": "Simpsons", - "state": "ANS" - }, - { - "id": "4811", - "ssech": "dlcB55jdf", - "location": "90000", - "city": "BELFORT", - "finalizationDate": 1561932000000, - "interviewer": { - "id": "INTW6", - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger" - }, - "campaign": "Simpsons", - "state": "ANS" - }, - { - "id": "1024", - "ssech": "hgSkR29", - "location": "95160", - "city": "MONTMORENCY", - "finalizationDate": 1603304314268, - "interviewer": { - "id": "INTW5", - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont" - }, - "campaign": "Simpsons", - "state": "ANS" - }, - { - "id": "4812", - "ssech": "dlcB55jdf", - "location": "90000", - "city": "BELFORT", - "finalizationDate": 1603304314268, - "interviewer": { - "id": "INTW6", - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger" - }, - "campaign": "VQS", - "state": "ANS" - }, - { - "id": "1025", - "ssech": "hgSkR29", - "location": "95160", - "city": "MONTMORENCY", - "finalizationDate": 1603304314268, - "interviewer": { - "id": "INTW5", - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont" - }, - "campaign": "VQS", - "state": "ANS" - }, - { - "id": "4813", - "ssech": "dlcB55jdf", - "location": "90000", - "city": "BELFORT", - "finalizationDate": 1603304314268, - "interviewer": { - "id": "INTW6", - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger" - }, - "campaign": "VQS", - "state": "ANS" - }, - { - "id": "1027", - "ssech": "hgSkR29", - "location": "95160", - "city": "MONTMORENCY", - "finalizationDate": 1603304314268, - "interviewer": { - "id": "INTW5", - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont" - }, - "campaign": "VQS", - "state": "ANS" - }, - { - "id": "4815", - "ssech": "dlcB55jdf", - "location": "90000", - "city": "BELFORT", - "finalizationDate": 1603304314268, - "interviewer": { - "id": "INTW7", - "interviewerFirstName": "Thierry", - "interviewerLastName": "Fabres" - }, - "campaign": "VQS", - "state": "ANS" - }, - { - "id": "1028", - "ssech": "hgSkR29", - "location": "95160", - "city": "MONTMORENCY", - "finalizationDate": 1603304314268, - "interviewer": { - "id": "INTW5", - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont" - }, - "campaign": "VQS", - "state": "ANS" - }, - { - "id": "4816", - "ssech": "dlcB55jdf", - "location": "90000", - "city": "BELFORT", - "finalizationDate": 1603304314268, - "interviewer": { - "id": "INTW6", - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger" - }, - "campaign": "VQS", - "state": "ANS", - "comments": [ + surveyUnitsClosable: [ + { + id: "1023", + displayName: "1023", + ssech: "hgSkR29", + location: "95160", + city: "MONTMORENCY", + finalizationDate: 1561932000000, + interviewer: { + id: "INTW5", + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + }, + campaign: "Simpsons", + state: "ANS", + }, + { + id: "4811", + displayName: "4811", + ssech: "dlcB55jdf", + location: "90000", + city: "BELFORT", + finalizationDate: 1561932000000, + interviewer: { + id: "INTW6", + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + }, + campaign: "Simpsons", + state: "ANS", + }, + { + id: "1024", + displayName: "1024", + ssech: "hgSkR29", + location: "95160", + city: "MONTMORENCY", + finalizationDate: 1603304314268, + interviewer: { + id: "INTW5", + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + }, + campaign: "Simpsons", + state: "ANS", + }, + { + id: "4812", + displayName: "4812", + ssech: "dlcB55jdf", + location: "90000", + city: "BELFORT", + finalizationDate: 1603304314268, + interviewer: { + id: "INTW6", + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + }, + campaign: "VQS", + state: "ANS", + }, + { + id: "1025", + displayName: "1025", + ssech: "hgSkR29", + location: "95160", + city: "MONTMORENCY", + finalizationDate: 1603304314268, + interviewer: { + id: "INTW5", + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + }, + campaign: "VQS", + state: "ANS", + }, + { + id: "4813", + displayName: "4813", + ssech: "dlcB55jdf", + location: "90000", + city: "BELFORT", + finalizationDate: 1603304314268, + interviewer: { + id: "INTW6", + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + }, + campaign: "VQS", + state: "ANS", + }, + { + id: "1027", + displayName: "1027", + ssech: "hgSkR29", + location: "95160", + city: "MONTMORENCY", + finalizationDate: 1603304314268, + interviewer: { + id: "INTW5", + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + }, + campaign: "VQS", + state: "ANS", + }, + { + id: "4815", + displayName: "4815", + ssech: "dlcB55jdf", + location: "90000", + city: "BELFORT", + finalizationDate: 1603304314268, + interviewer: { + id: "INTW7", + interviewerFirstName: "Thierry", + interviewerLastName: "Fabres", + }, + campaign: "VQS", + state: "ANS", + }, + { + id: "1028", + displayName: "1028", + ssech: "hgSkR29", + location: "95160", + city: "MONTMORENCY", + finalizationDate: 1603304314268, + interviewer: { + id: "INTW5", + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + }, + campaign: "VQS", + state: "ANS", + }, + { + id: "4816", + displayName: "4816", + ssech: "dlcB55jdf", + location: "90000", + city: "BELFORT", + finalizationDate: 1603304314268, + interviewer: { + id: "INTW6", + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + }, + campaign: "VQS", + state: "ANS", + comments: [ { - "type": "managementComment", - "value": "Test" + type: "managementComment", + value: "Test", }, { - "type": "interviewerComment", - "value": "Test" - } - ] - }, - { - "id": "1029", - "ssech": "hgSkR29", - "location": "95160", - "city": "MONTMORENCY", - "finalizationDate": 1603304314268, - "campaign": "VQS", - "state": "ANS", - "interviewer": { - "id": "INTW7", - "interviewerFirstName": "Thierry", - "interviewerLastName": "Fabres" - } - }, - { - "id": "4817", - "ssech": "dlcB55jdf", - "location": "90000", - "city": "BELFORT", - "finalizationDate": 1603304314268, - "campaign": "VQS", - "state": "ANS", - "interviewer": { - "id": "INTW6", - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger" - } - }, - { - "id": "1030", - "ssech": "hgSkR29", - "location": "95160", - "city": "MONTMORENCY", - "finalizationDate": 1561932000000, - "campaign": "VQS", - "state": "ANS", - "interviewer": { - "id": "INTW5", - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont" - } - }, - { - "id": "4818", - "ssech": "dlcB55jdf", - "location": "90000", - "city": "BELFORT", - "finalizationDate": 1561932000000, - "campaign": "LC 2020", - "state": "ANS", - "interviewer": { - "id": "INTW6", - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger" - } - }, - { - "id": "1032", - "ssech": "hgSkR29", - "location": "95160", - "city": "MONTMORENCY", - "finalizationDate": 1603304314268, - "campaign": "LC 2020", - "state": "ANS", - "interviewer": { - "id": "INTW5", - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont" - } - }, - { - "id": "4819", - "ssech": "dlcB55jdf", - "location": "90000", - "city": "BELFORT", - "finalizationDate": 1603304314268, - "campaign": "LC 2020", - "state": "ANS", - "interviewer": { - "id": "INTW6", - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger" - } - } + type: "interviewerComment", + value: "Test", + }, + ], + }, + { + id: "1029", + displayName: "1029", + ssech: "hgSkR29", + location: "95160", + city: "MONTMORENCY", + finalizationDate: 1603304314268, + campaign: "VQS", + state: "ANS", + interviewer: { + id: "INTW7", + interviewerFirstName: "Thierry", + interviewerLastName: "Fabres", + }, + }, + { + id: "4817", + displayName: "4817", + ssech: "dlcB55jdf", + location: "90000", + city: "BELFORT", + finalizationDate: 1603304314268, + campaign: "VQS", + state: "ANS", + interviewer: { + id: "INTW6", + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + }, + }, + { + id: "1030", + displayName: "1030", + ssech: "hgSkR29", + location: "95160", + city: "MONTMORENCY", + finalizationDate: 1561932000000, + campaign: "VQS", + state: "ANS", + interviewer: { + id: "INTW5", + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + }, + }, + { + id: "4818", + displayName: "4818", + ssech: "dlcB55jdf", + location: "90000", + city: "BELFORT", + finalizationDate: 1561932000000, + campaign: "LC 2020", + state: "ANS", + interviewer: { + id: "INTW6", + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + }, + }, + { + id: "1032", + displayName: "1032", + ssech: "hgSkR29", + location: "95160", + city: "MONTMORENCY", + finalizationDate: 1603304314268, + campaign: "LC 2020", + state: "ANS", + interviewer: { + id: "INTW5", + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + }, + }, + { + id: "4819", + displayName: "4819", + ssech: "dlcB55jdf", + location: "90000", + city: "BELFORT", + finalizationDate: 1603304314268, + campaign: "LC 2020", + state: "ANS", + interviewer: { + id: "INTW6", + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + }, + }, ], - "interviewerStateCount": { - "nvmCount": 0, - "anvCount": 0, - "nnsCount": 2, - "vinCount": 0, - "vicCount": 3, - "prcCount": 29, - "aocCount": 8, - "apsCount": 8, - "insCount": 5, - "wftCount": 0, - "wfsCount": 0, - "tbrCount": 2, - "finCount": 1, - - "cloCount": 3, - "npaCount": 2, - "npiCount": 3, - "rowCount": 4, - "nvaCount": 0, - "total": 104 + interviewerStateCount: { + nvmCount: 0, + anvCount: 0, + nnsCount: 2, + vinCount: 0, + vicCount: 3, + prcCount: 29, + aocCount: 8, + apsCount: 8, + insCount: 5, + wftCount: 0, + wfsCount: 0, + tbrCount: 2, + finCount: 1, + + cloCount: 3, + npaCount: 2, + npiCount: 3, + rowCount: 4, + nvaCount: 0, + total: 104, }, - "stateCountByInterv": [ - { - "interviewer": { - "id": "INTW5", - "interviewerFirstName": "Chloé", - "interviewerLastName": "Dupont" - }, - "nvmCount": 0, - "anvCount": 0, - "nnsCount": 2, - "vinCount": 0, - "vicCount": 4, - "prcCount": 2, - "aocCount": 4, - "apsCount": 4, - "insCount": 6, - "wftCount": 3, - "wfsCount": 3, - "tbrCount": 21, - "finCount": 2, + stateCountByInterv: [ + { + interviewer: { + id: "INTW5", + interviewerFirstName: "Chloé", + interviewerLastName: "Dupont", + }, + nvmCount: 0, + anvCount: 0, + nnsCount: 2, + vinCount: 0, + vicCount: 4, + prcCount: 2, + aocCount: 4, + apsCount: 4, + insCount: 6, + wftCount: 3, + wfsCount: 3, + tbrCount: 21, + finCount: 2, - "cloCount": 3, - "npaCount": 2, - "npiCount": 3, - "rowCount": 4, - "nvaCount": 0, - "total": 95 - }, - { - "interviewer": { - "id": "INTW6", - "interviewerFirstName": "Jacques", - "interviewerLastName": "Boulanger" - }, - "nvmCount": 0, - "anvCount": 0, - "nnsCount": 2, - "vinCount": 0, - "vicCount": 4, - "prcCount": 2, - "aocCount": 4, - "apsCount": 4, - "insCount": 6, - "wftCount": 3, - "wfsCount": 3, - "tbrCount": 21, - "finCount": 2, + cloCount: 3, + npaCount: 2, + npiCount: 3, + rowCount: 4, + nvaCount: 0, + total: 95, + }, + { + interviewer: { + id: "INTW6", + interviewerFirstName: "Jacques", + interviewerLastName: "Boulanger", + }, + nvmCount: 0, + anvCount: 0, + nnsCount: 2, + vinCount: 0, + vicCount: 4, + prcCount: 2, + aocCount: 4, + apsCount: 4, + insCount: 6, + wftCount: 3, + wfsCount: 3, + tbrCount: 21, + finCount: 2, - "cloCount": 3, - "npaCount": 2, - "npiCount": 3, - "rowCount": 4, - "nvaCount": 0, - "total": 95 - }, - { - "interviewer": { - "id": "INTW7", - "interviewerFirstName": "Thierry", - "interviewerLastName": "Fabres" - }, - "nvmCount": 0, - "anvCount": 0, - "nnsCount": 2, - "vinCount": 0, - "vicCount": 4, - "prcCount": 2, - "aocCount": 4, - "apsCount": 4, - "insCount": 6, - "wftCount": 3, - "wfsCount": 3, - "tbrCount": 21, - "finCount": 2, + cloCount: 3, + npaCount: 2, + npiCount: 3, + rowCount: 4, + nvaCount: 0, + total: 95, + }, + { + interviewer: { + id: "INTW7", + interviewerFirstName: "Thierry", + interviewerLastName: "Fabres", + }, + nvmCount: 0, + anvCount: 0, + nnsCount: 2, + vinCount: 0, + vicCount: 4, + prcCount: 2, + aocCount: 4, + apsCount: 4, + insCount: 6, + wftCount: 3, + wfsCount: 3, + tbrCount: 21, + finCount: 2, - "cloCount": 3, - "npaCount": 2, - "npiCount": 3, - "rowCount": 4, - "nvaCount": 0, - "total": 95 - }, - { - "interviewer": { - "id": "INTW8", - "interviewerFirstName": "Bertrand", - "interviewerLastName": "Renard" - }, - "nvmCount": 0, - "anvCount": 0, - "nnsCount": 2, - "vinCount": 0, - "vicCount": 4, - "prcCount": 2, - "aocCount": 4, - "apsCount": 4, - "insCount": 6, - "wftCount": 3, - "wfsCount": 3, - "tbrCount": 21, - "finCount": 2, + cloCount: 3, + npaCount: 2, + npiCount: 3, + rowCount: 4, + nvaCount: 0, + total: 95, + }, + { + interviewer: { + id: "INTW8", + interviewerFirstName: "Bertrand", + interviewerLastName: "Renard", + }, + nvmCount: 0, + anvCount: 0, + nnsCount: 2, + vinCount: 0, + vicCount: 4, + prcCount: 2, + aocCount: 4, + apsCount: 4, + insCount: 6, + wftCount: 3, + wfsCount: 3, + tbrCount: 21, + finCount: 2, - "cloCount": 3, - "npaCount": 2, - "npiCount": 3, - "rowCount": 4, - "nvaCount": 0, - "total": 95 - }, - { - "interviewer": { - "id": "INTW9", - "interviewerFirstName": "Emilie", - "interviewerLastName": "Boulanger" - }, - "nvmCount": 0, - "anvCount": 0, - "nnsCount": 2, - "vinCount": 0, - "vicCount": 4, - "prcCount": 2, - "aocCount": 4, - "apsCount": 4, - "insCount": 6, - "wftCount": 3, - "wfsCount": 3, - "tbrCount": 21, - "finCount": 2, + cloCount: 3, + npaCount: 2, + npiCount: 3, + rowCount: 4, + nvaCount: 0, + total: 95, + }, + { + interviewer: { + id: "INTW9", + interviewerFirstName: "Emilie", + interviewerLastName: "Boulanger", + }, + nvmCount: 0, + anvCount: 0, + nnsCount: 2, + vinCount: 0, + vicCount: 4, + prcCount: 2, + aocCount: 4, + apsCount: 4, + insCount: 6, + wftCount: 3, + wfsCount: 3, + tbrCount: 21, + finCount: 2, - "cloCount": 3, - "npaCount": 2, - "npiCount": 3, - "rowCount": 4, - "nvaCount": 0, - "total": 95 - }, - { - "interviewer": { - "id": "INTW10", - "interviewerFirstName": "Renée", - "interviewerLastName": "Dupont" - }, - "nvmCount": 0, - "anvCount": 0, - "nnsCount": 2, - "vinCount": 0, - "vicCount": 4, - "prcCount": 2, - "aocCount": 4, - "apsCount": 4, - "insCount": 6, - "wftCount": 3, - "wfsCount": 3, - "tbrCount": 21, - "finCount": 2, + cloCount: 3, + npaCount: 2, + npiCount: 3, + rowCount: 4, + nvaCount: 0, + total: 95, + }, + { + interviewer: { + id: "INTW10", + interviewerFirstName: "Renée", + interviewerLastName: "Dupont", + }, + nvmCount: 0, + anvCount: 0, + nnsCount: 2, + vinCount: 0, + vicCount: 4, + prcCount: 2, + aocCount: 4, + apsCount: 4, + insCount: 6, + wftCount: 3, + wfsCount: 3, + tbrCount: 21, + finCount: 2, - "cloCount": 3, - "npaCount": 2, - "npiCount": 3, - "rowCount": 4, - "nvaCount": 0, - "total": 95 - }, - { - "interviewer": { - "id": "INTW11", - "interviewerFirstName": "Alphonse", - "interviewerLastName": "Delmarre" - }, - "nvmCount": 0, - "anvCount": 0, - "nnsCount": 2, - "vinCount": 0, - "vicCount": 4, - "prcCount": 2, - "aocCount": 4, - "apsCount": 4, - "insCount": 6, - "wftCount": 3, - "wfsCount": 3, - "tbrCount": 21, - "finCount": 2, + cloCount: 3, + npaCount: 2, + npiCount: 3, + rowCount: 4, + nvaCount: 0, + total: 95, + }, + { + interviewer: { + id: "INTW11", + interviewerFirstName: "Alphonse", + interviewerLastName: "Delmarre", + }, + nvmCount: 0, + anvCount: 0, + nnsCount: 2, + vinCount: 0, + vicCount: 4, + prcCount: 2, + aocCount: 4, + apsCount: 4, + insCount: 6, + wftCount: 3, + wfsCount: 3, + tbrCount: 21, + finCount: 2, - "cloCount": 3, - "npaCount": 2, - "npiCount": 3, - "rowCount": 4, - "nvaCount": 0, - "total": 95 - } + cloCount: 3, + npaCount: 2, + npiCount: 3, + rowCount: 4, + nvaCount: 0, + total: 95, + }, ], - "contactOutcomes": [ - { - "campaign": { - "id": "simpsons2020x00", - "label": "Survey on the Simpsons tv show 2020" - }, - "refCount":2, - "impCount":5, - "ucdCount":11, - "utrCount":9, - "alaCount":7, - "dukCount":2, -"duuCount":0, - "dcdCount":1, - "nuhCount":1, - "noaCount":1, - }, - { - "campaign": { - "id": "simpsosfqns2020x00", - "label": "Survey on something 2020" - }, - "refCount":2, - "impCount":5, - "ucdCount":11, - "utrCount":9, - "alaCount":7, - "dukCount":2, -"duuCount":0, - "dcdCount":1, - "nuhCount":1, - "noaCount":1, - }, - { - "campaign": { - "id": "vqs2fsqe021x00", - "label": "Everyday life and health survey 2022" - }, - "refCount":2, - "impCount":5, - "ucdCount":11, - "utrCount":9, - "alaCount":7, - "dukCount":2, -"duuCount":0, - "dcdCount":1, - "nuhCount":1, - "noaCount":1, - }, - { - "campaign": { - "id": "simpsonqsdfsqes2020x00", - "label": "Survey on something else 2020" - }, - "refCount":2, - "impCount":5, - "ucdCount":11, - "utrCount":9, - "alaCount":7, - "dukCount":2, -"duuCount":0, - "dcdCount":1, - "nuhCount":1, - "noaCount":1, - }, - { - "campaign": { - "id": "vqs2qfsdfsqe021x00", - "label": "Everyday life and health survey 2026" - }, - "refCount":2, - "impCount":5, - "ucdCount":11, - "utrCount":9, - "alaCount":7, - "dukCount":2, -"duuCount":0, - "dcdCount":1, - "nuhCount":1, - "noaCount":1, - }, - { - "campaign": { - "id": "simpsonkgs2020x00", - "label": "Survey on the Simpsons tv show 2021" - }, - "refCount":2, - "impCount":5, - "ucdCount":11, - "utrCount":9, - "alaCount":7, - "dukCount":2, -"duuCount":0, - "dcdCount":1, - "nuhCount":1, - "noaCount":1, - }, - { - "campaign": { - "id": "vqs202fgd1x00", - "label": "Everyday life and health survey 2018" - }, - "refCount":2, - "impCount":5, - "ucdCount":11, - "utrCount":9, - "alaCount":7, - "dukCount":2, -"duuCount":0, - "dcdCount":1, - "nuhCount":1, - "noaCount":1, - } + contactOutcomes: [ + { + campaign: { + id: "simpsons2020x00", + label: "Survey on the Simpsons tv show 2020", + }, + refCount: 2, + impCount: 5, + ucdCount: 11, + utrCount: 9, + alaCount: 7, + dukCount: 2, + duuCount: 0, + dcdCount: 1, + nuhCount: 1, + noaCount: 1, + }, + { + campaign: { + id: "simpsosfqns2020x00", + label: "Survey on something 2020", + }, + refCount: 2, + impCount: 5, + ucdCount: 11, + utrCount: 9, + alaCount: 7, + dukCount: 2, + duuCount: 0, + dcdCount: 1, + nuhCount: 1, + noaCount: 1, + }, + { + campaign: { + id: "vqs2fsqe021x00", + label: "Everyday life and health survey 2022", + }, + refCount: 2, + impCount: 5, + ucdCount: 11, + utrCount: 9, + alaCount: 7, + dukCount: 2, + duuCount: 0, + dcdCount: 1, + nuhCount: 1, + noaCount: 1, + }, + { + campaign: { + id: "simpsonqsdfsqes2020x00", + label: "Survey on something else 2020", + }, + refCount: 2, + impCount: 5, + ucdCount: 11, + utrCount: 9, + alaCount: 7, + dukCount: 2, + duuCount: 0, + dcdCount: 1, + nuhCount: 1, + noaCount: 1, + }, + { + campaign: { + id: "vqs2qfsdfsqe021x00", + label: "Everyday life and health survey 2026", + }, + refCount: 2, + impCount: 5, + ucdCount: 11, + utrCount: 9, + alaCount: 7, + dukCount: 2, + duuCount: 0, + dcdCount: 1, + nuhCount: 1, + noaCount: 1, + }, + { + campaign: { + id: "simpsonkgs2020x00", + label: "Survey on the Simpsons tv show 2021", + }, + refCount: 2, + impCount: 5, + ucdCount: 11, + utrCount: 9, + alaCount: 7, + dukCount: 2, + duuCount: 0, + dcdCount: 1, + nuhCount: 1, + noaCount: 1, + }, + { + campaign: { + id: "vqs202fgd1x00", + label: "Everyday life and health survey 2018", + }, + refCount: 2, + impCount: 5, + ucdCount: 11, + utrCount: 9, + alaCount: 7, + dukCount: 2, + duuCount: 0, + dcdCount: 1, + nuhCount: 1, + noaCount: 1, + }, ], - "contactOutcomesNotAttributed": { - "refCount":2, - "impCount":5, - "ucdCount":11, - "utrCount":9, - "alaCount":7, - "dukCount":2, -"duuCount":0, - "dcdCount":1, - "nuhCount":1, - "noaCount":1, + contactOutcomesNotAttributed: { + refCount: 2, + impCount: 5, + ucdCount: 11, + utrCount: 9, + alaCount: 7, + dukCount: 2, + duuCount: 0, + dcdCount: 1, + nuhCount: 1, + noaCount: 1, }, - "contactOutcomesByInterviewer": { - "refCount":2, - "impCount":5, - "ucdCount":11, - "utrCount":9, - "alaCount":7, - "dukCount":2, -"duuCount":0, - "dcdCount":1, - "nuhCount":1, - "noaCount":1, + contactOutcomesByInterviewer: { + refCount: 2, + impCount: 5, + ucdCount: 11, + utrCount: 9, + alaCount: 7, + dukCount: 2, + duuCount: 0, + dcdCount: 1, + nuhCount: 1, + noaCount: 1, }, - "contactOutcomesByCampaign": { - "organizationUnits": [ + contactOutcomesByCampaign: { + organizationUnits: [ { - "idDem": "OU-SOUTH", - "labelDem": "South region organizational unit", - "isLocal": true, - "refCount":2, - "impCount":5, - "ucdCount":11, - "utrCount":9, - "alaCount":7, - "dukCount":2, -"duuCount":0, - "dcdCount":1, - "nuhCount":1, - "noaCount":1, - "total": 104 + idDem: "OU-SOUTH", + labelDem: "South region organizational unit", + isLocal: true, + refCount: 2, + impCount: 5, + ucdCount: 11, + utrCount: 9, + alaCount: 7, + dukCount: 2, + duuCount: 0, + dcdCount: 1, + nuhCount: 1, + noaCount: 1, + total: 104, }, { - "idDem": "OU-NORTH", - "labelDem": "North region organizational unit", - "isLocal": true, - "refCount":2, - "impCount":5, - "ucdCount":11, - "utrCount":9, - "alaCount":7, - "dukCount":2, -"duuCount":0, - "dcdCount":1, - "nuhCount":1, - "noaCount":1, - "total": 104 + idDem: "OU-NORTH", + labelDem: "North region organizational unit", + isLocal: true, + refCount: 2, + impCount: 5, + ucdCount: 11, + utrCount: 9, + alaCount: 7, + dukCount: 2, + duuCount: 0, + dcdCount: 1, + nuhCount: 1, + noaCount: 1, + total: 104, }, { - "idDem": "OU-NATIONAL", - "labelDem": "National organizational unit", - "isLocal": false, - "refCount":2, - "impCount":5, - "ucdCount":11, - "utrCount":9, - "alaCount":7, - "dukCount":2, -"duuCount":0, - "dcdCount":1, - "nuhCount":1, - "noaCount":1, - "total": 104 - } + idDem: "OU-NATIONAL", + labelDem: "National organizational unit", + isLocal: false, + refCount: 2, + impCount: 5, + ucdCount: 11, + utrCount: 9, + alaCount: 7, + dukCount: 2, + duuCount: 0, + dcdCount: 1, + nuhCount: 1, + noaCount: 1, + total: 104, + }, ], - "france": { - "refCount":2, - "impCount":5, - "ucdCount":11, - "utrCount":9, - "alaCount":7, - "dukCount":2, -"duuCount":0, - "dcdCount":1, - "nuhCount":1, - "noaCount":1, - "total": 104 - } + france: { + refCount: 2, + impCount: 5, + ucdCount: 11, + utrCount: 9, + alaCount: 7, + dukCount: 2, + duuCount: 0, + dcdCount: 1, + nuhCount: 1, + noaCount: 1, + total: 104, + }, }, - surveyUnitsQuestionnaireId:[ + surveyUnitsQuestionnaireId: [ { id: "1023", - questionnaireId: "QUESTIONNAIRE_ID" + questionnaireId: "QUESTIONNAIRE_ID", }, { id: "4811", - questionnaireId: "QUESTIONNAIRE_ID" + questionnaireId: "QUESTIONNAIRE_ID", }, { id: "1024", - questionnaireId: "QUESTIONNAIRE_ID" + questionnaireId: "QUESTIONNAIRE_ID", }, { id: "4812", - questionnaireId: "QUESTIONNAIRE_ID" + questionnaireId: "QUESTIONNAIRE_ID", }, { id: "1025", - questionnaireId: "QUESTIONNAIRE_ID" + questionnaireId: "QUESTIONNAIRE_ID", }, { id: "4813", - questionnaireId: "QUESTIONNAIRE_ID" + questionnaireId: "QUESTIONNAIRE_ID", }, { id: "1027", - questionnaireId: "QUESTIONNAIRE_ID" + questionnaireId: "QUESTIONNAIRE_ID", }, { id: "4815", - questionnaireId: "QUESTIONNAIRE_ID" + questionnaireId: "QUESTIONNAIRE_ID", }, { id: "1028", - questionnaireId: "QUESTIONNAIRE_ID" + questionnaireId: "QUESTIONNAIRE_ID", }, { id: "4816", - questionnaireId: "QUESTIONNAIRE_ID" + questionnaireId: "QUESTIONNAIRE_ID", }, { id: "1029", - questionnaireId: "QUESTIONNAIRE_ID" + questionnaireId: "QUESTIONNAIRE_ID", }, { id: "4817", - questionnaireId: "QUESTIONNAIRE_ID" + questionnaireId: "QUESTIONNAIRE_ID", }, { id: "1030", - questionnaireId: "QUESTIONNAIRE_ID" + questionnaireId: "QUESTIONNAIRE_ID", }, { id: "4818", - questionnaireId: "QUESTIONNAIRE_ID" + questionnaireId: "QUESTIONNAIRE_ID", }, { id: "1032", - questionnaireId: "QUESTIONNAIRE_ID" + questionnaireId: "QUESTIONNAIRE_ID", }, { id: "4819", - questionnaireId: "QUESTIONNAIRE_ID" - } - ] + questionnaireId: "QUESTIONNAIRE_ID", + }, + ], }; -export default val; \ No newline at end of file +export default val; diff --git a/src/tests/mocks/reviewDataAllSurveys.js b/src/tests/mocks/reviewDataAllSurveys.js index 19fb4e6..332e8ed 100644 --- a/src/tests/mocks/reviewDataAllSurveys.js +++ b/src/tests/mocks/reviewDataAllSurveys.js @@ -1,65 +1,74 @@ const val = [ { - "campaignLabel": "Survey on the Simpsons tv show 2020", - "interviewer": "Dupont Chloé", - "idep": "INTW5", - "id": "1032", - "contactOutcome": {type: "INA" } + campaignLabel: "Survey on the Simpsons tv show 2020", + interviewer: "Dupont Chloé", + idep: "INTW5", + id: "1032", + displayName: "1032", + contactOutcome: { type: "INA" }, }, { - "campaignLabel": "Survey on the Simpsons tv show 2020", - "interviewer": "Boulanger Jacques", - "idep": "INTW6", - "id": "4819", - "contactOutcome": {type: "IMP" } + campaignLabel: "Survey on the Simpsons tv show 2020", + interviewer: "Boulanger Jacques", + idep: "INTW6", + id: "4819", + displayName: "4819", + contactOutcome: { type: "IMP" }, }, { - "campaignLabel": "Survey on the Simpsons tv show 2020", - "interviewer": "Boulanger Jacques", - "idep": "INTW6", - "id": "4818", - "contactOutcome": {type:"REF" } + campaignLabel: "Survey on the Simpsons tv show 2020", + interviewer: "Boulanger Jacques", + idep: "INTW6", + id: "4818", + displayName: "4818", + contactOutcome: { type: "REF" }, }, { - "campaignLabel": "Survey on the Simpsons tv show 2020", - "interviewer": "Boulanger Jacques", - "idep": "INTW6", - "id": "4817", - "contactOutcome": {type:"ALA" } + campaignLabel: "Survey on the Simpsons tv show 2020", + interviewer: "Boulanger Jacques", + idep: "INTW6", + id: "4817", + displayName: "4817", + contactOutcome: { type: "ALA" }, }, { - "campaignLabel": "Survey on the Simpsons tv show 2020", - "interviewer": "Boulanger Jacques", - "idep": "INTW6", - "id": "4816", - "contactOutcome":{type: "UCD" } + campaignLabel: "Survey on the Simpsons tv show 2020", + interviewer: "Boulanger Jacques", + idep: "INTW6", + id: "4816", + displayName: "4816", + contactOutcome: { type: "UCD" }, }, { - "campaignLabel": "Survey on the Simpsons tv show 2020", - "interviewer": "Boulanger Jacques", - "idep": "INTW6", - "id": "4813", - "contactOutcome": {type:"UTR" } + campaignLabel: "Survey on the Simpsons tv show 2020", + interviewer: "Boulanger Jacques", + idep: "INTW6", + id: "4813", + displayName: "4813", + contactOutcome: { type: "UTR" }, }, { - "campaignLabel": "Survey on the Simpsons tv show 2020", - "interviewer": "Boulanger Jacques", - "idep": "INTW6", - "id": "4812", - "contactOutcome":{type: "ACP" } + campaignLabel: "Survey on the Simpsons tv show 2020", + interviewer: "Boulanger Jacques", + idep: "INTW6", + id: "4812", + displayName: "4812", + contactOutcome: { type: "ACP" }, }, { - "campaignLabel": "Survey on the Simpsons tv show 2020", - "interviewer": "Boulanger Jacques", - "idep": "INTW6", - "id": "4811", - "contactOutcome": {type:"DCD" } + campaignLabel: "Survey on the Simpsons tv show 2020", + interviewer: "Boulanger Jacques", + idep: "INTW6", + id: "4811", + displayName: "4811", + contactOutcome: { type: "DCD" }, }, { - "campaignLabel": "Survey on the Simpsons tv show 2020", - "interviewer": "Dupont Chloé", - "idep": "INTW5", - "id": "1099", - } + campaignLabel: "Survey on the Simpsons tv show 2020", + interviewer: "Dupont Chloé", + idep: "INTW5", + id: "1099", + displayName: "1099", + }, ]; -export default val; \ No newline at end of file +export default val; diff --git a/src/tests/mocks/reviewDataOneSurvey.js b/src/tests/mocks/reviewDataOneSurvey.js index f46f1e7..0f20c19 100644 --- a/src/tests/mocks/reviewDataOneSurvey.js +++ b/src/tests/mocks/reviewDataOneSurvey.js @@ -1,15 +1,17 @@ const val = [ { - "campaignLabel": "Survey on the Simpsons tv show 2020", - "interviewer": "Dupont Chloé", - "idep": "INTW5", - "id": "1032" + campaignLabel: "Survey on the Simpsons tv show 2020", + interviewer: "Dupont Chloé", + idep: "INTW5", + id: "1032", + displayName: "1032", }, { - "campaignLabel": "Survey on the Simpsons tv show 2020", - "interviewer": "Boulanger Jacques", - "idep": "INTW6", - "id": "4818" - } + campaignLabel: "Survey on the Simpsons tv show 2020", + interviewer: "Boulanger Jacques", + idep: "INTW6", + id: "4818", + displayName: "4818", + }, ]; -export default val; \ No newline at end of file +export default val; diff --git a/src/tests/mocks/suTerminated.js b/src/tests/mocks/suTerminated.js index 2a1496b..0333f2e 100644 --- a/src/tests/mocks/suTerminated.js +++ b/src/tests/mocks/suTerminated.js @@ -1,10 +1,11 @@ const val = [ { id: '1023', + displayName: '1023', ssech: 'hgSkR29', location: '95160', city: 'MONTMORENCY', - contactOutcome: {type :'INA'}, + contactOutcome: { type: 'INA' }, finalizationDate: 1561932000000, interviewer: { id: 'INTW5', @@ -14,10 +15,11 @@ const val = [ }, { id: '1023b', + displayName: '1023b', ssech: 'hgSkR29', location: '95160', city: 'MONTMORENCY', - contactOutcome: {type : 'INA'}, + contactOutcome: { type: 'INA' }, finalizationDate: 1561932000000, interviewer: { id: 'INTW5', @@ -27,10 +29,11 @@ const val = [ }, { id: '1023c', + displayName: '1023c', ssech: 'hgSkR29', location: '95160', city: 'MONTMORENCY', - contactOutcome: {type :'INA'}, + contactOutcome: { type: 'INA' }, finalizationDate: 1561932000000, interviewer: { id: 'INTW5', @@ -40,10 +43,11 @@ const val = [ }, { id: '1023d', + displayName: '1023d', ssech: 'hgSkR29', location: '95160', city: 'MONTMORENCY', - contactOutcome: {type :'INA'}, + contactOutcome: { type: 'INA' }, finalizationDate: 1561932000000, interviewer: { id: 'INTW5', @@ -53,10 +57,11 @@ const val = [ }, { id: '4811', + displayName: '4811', ssech: 'dlcB55jdf', location: '90000', city: 'BELFORT', - contactOutcome: {type :'INA'}, + contactOutcome: { type: 'INA' }, finalizationDate: 1561932100001, interviewer: { id: 'INTW6', @@ -66,10 +71,11 @@ const val = [ }, { id: '1024', + displayName: '1024', ssech: 'hgSkR29', location: '95160', city: 'MONTMORENCY', - contactOutcome: {type :'INA'}, + contactOutcome: { type: 'INA' }, finalizationDate: 1613304314269, interviewer: { id: 'INTW5', @@ -79,10 +85,11 @@ const val = [ }, { id: '4812', + displayName: '4812', ssech: 'dlcB55jdf', location: '90000', city: 'BELFORT', - contactOutcome: {type :'INA'}, + contactOutcome: { type: 'INA' }, finalizationDate: 1623314314268, interviewer: { id: 'INTW6', @@ -92,10 +99,11 @@ const val = [ }, { id: '1025', + displayName: '1025', ssech: 'hgSkR29', location: '95160', city: 'MONTMORENCY', - contactOutcome: {type :'INA'}, + contactOutcome: { type: 'INA' }, finalizationDate: 1761932000000, interviewer: { id: 'INTW5', @@ -105,10 +113,11 @@ const val = [ }, { id: '4813', + displayName: '4813', ssech: 'dlcB55jdf', location: '90000', city: 'BELFORT', - contactOutcome: {type :'INA'}, + contactOutcome: { type: 'INA' }, finalizationDate: 1661932000000, interviewer: { id: 'INTW6', @@ -118,10 +127,11 @@ const val = [ }, { id: '1026', + displayName: '1026', ssech: 'hgSkR29', location: '95160', city: 'MONTMORENCY', - contactOutcome: {type :'INA'}, + contactOutcome: { type: 'INA' }, finalizationDate: 1651932000069, interviewer: { id: 'INTW5', @@ -131,10 +141,11 @@ const val = [ }, { id: '4814', + displayName: '4814', ssech: 'dlcB55jdf', location: '90000', city: 'BELFORT', - contactOutcome: {type :'INA'}, + contactOutcome: { type: 'INA' }, finalizationDate: 1603304314268, interviewer: { id: 'INTW6', @@ -144,10 +155,11 @@ const val = [ }, { id: '1028', + displayName: '1028', ssech: 'hgSkR29', location: '95160', city: 'MONTMORENCY', - contactOutcome: {type :'INA'}, + contactOutcome: { type: 'INA' }, interviewer: { id: 'INTW5', interviewerFirstName: 'Chloé', @@ -156,10 +168,11 @@ const val = [ }, { id: '4816', + displayName: '4816', ssech: 'dlcB55jdf', location: '90000', city: 'BELFORT', - contactOutcome: {type :'INA'}, + contactOutcome: { type: 'INA' }, interviewer: { id: 'INTW6', interviewerFirstName: 'Jacques', @@ -168,10 +181,11 @@ const val = [ }, { id: '1029', + displayName: '1029', ssech: 'hgSkR29', location: '95160', city: 'MONTMORENCY', - contactOutcome: {type :'INA'}, + contactOutcome: { type: 'INA' }, interviewer: { id: 'INTW7', interviewerFirstName: 'Thierry', @@ -180,10 +194,11 @@ const val = [ }, { id: '4817', + displayName: '4817', ssech: 'dlcB55jdf', location: '90000', city: 'BELFORT', - contactOutcome: {type :'INA'}, + contactOutcome: { type: 'INA' }, interviewer: { id: 'INTW6', interviewerFirstName: 'Jacques', @@ -192,10 +207,11 @@ const val = [ }, { id: '1030', + displayName: '1030', ssech: 'hgSkR29', location: '95160', city: 'MONTMORENCY', - contactOutcome: {type :'INA'}, + contactOutcome: { type: 'INA' }, interviewer: { id: 'INTW5', interviewerFirstName: 'Chloé', @@ -204,10 +220,11 @@ const val = [ }, { id: '4818', + displayName: '4818', ssech: 'dlcB55jdf', location: '90000', city: 'BELFORT', - contactOutcome: {type :'INA'}, + contactOutcome: { type: 'INA' }, interviewer: { id: 'INTW6', interviewerFirstName: 'Jacques', @@ -216,10 +233,11 @@ const val = [ }, { id: '1032', + displayName: '1032', ssech: 'hgSkR29', location: '95160', city: 'MONTMORENCY', - contactOutcome: {type :'INA'}, + contactOutcome: { type: 'INA' }, interviewer: { id: 'INTW5', interviewerFirstName: 'Chloé', @@ -228,10 +246,11 @@ const val = [ }, { id: '4819', + displayName: '4819', ssech: 'dlcB55jdf', location: '90000', city: 'BELFORT', - contactOutcome: {type :'INA'}, + contactOutcome: { type: 'INA' }, interviewer: { id: 'INTW6', interviewerFirstName: 'Jacques', diff --git a/src/utils/DataFormatter.js b/src/utils/DataFormatter.js index 466278a..8b00703 100644 --- a/src/utils/DataFormatter.js +++ b/src/utils/DataFormatter.js @@ -25,12 +25,11 @@ class DataFormatter { cb(data); }); } - + getAllCampaigns(cb) { this.service.getCampaigns((data) => { cb(data); }); - } getPreferences(cb) { @@ -147,7 +146,7 @@ class DataFormatter { }); } - getFormattedCampaignsForMainScreen(date, cb, campaigns){ + getFormattedCampaignsForMainScreen(date, cb, campaigns) { const formattedData = campaigns .filter((survey) => Utils.isVisible(survey, date)) .map((survey) => { @@ -160,10 +159,10 @@ class DataFormatter { ); return formattedSurvey; }); - if (cb) { - cb(formattedData); - } - return formattedData + if (cb) { + cb(formattedData); + } + return formattedData; } getDataForClosePage(cb) { @@ -182,6 +181,7 @@ class DataFormatter { this.service.getSurveyUnits(surveyId, null, (res) => { const processedData = res.map((su) => ({ id: su.id, + displayName: su.displayName, ssech: su.ssech, departement: su.location, city: su.city, @@ -192,7 +192,7 @@ class DataFormatter { state: su.state, closingCause: su.closingCause, })); - resolve(Utils.sortData(processedData, "id", true)); + resolve(Utils.sortData(processedData, "displayName", true)); }); }); Promise.all([p1, p2]).then((data) => { @@ -239,42 +239,41 @@ class DataFormatter { getListSUToReview(surveyId, campaigns) { return new Promise((resolve) => { - const promises = campaigns - .filter((campaign) => surveyId !== null ? campaign.id === surveyId : campaign.toReview > 0 ) - .map( - (campaign) => - new Promise((resolveCampaign) => { - // get SU by campaignId with state = TBR - this.service.getSurveyUnits( - campaign.id, - "TBR", - (surveyUnits) => { - const lstSU = surveyUnits - // format survey-unit data - .map((su) => ({ - campaignLabel: campaign.label, - campaignId: campaign.id, - interviewer: su.interviewer - ? `${su.interviewer.interviewerLastName} ${su.interviewer.interviewerFirstName}` - : D.unaffected, - idep: su.interviewer ? su.interviewer.id : "", - id: su.id, - viewed: su.viewed, - comments: su.comments, - contactOutcome: su.contactOutcome - })) - // order by interviewer name - .sort((a, b) => (a.interviewer > b.interviewer ? 1 : -1)); - resolveCampaign(lstSU); - } - ); - }) - ); + const promises = campaigns + .filter((campaign) => + surveyId !== null ? campaign.id === surveyId : campaign.toReview > 0 + ) + .map( + (campaign) => + new Promise((resolveCampaign) => { + // get SU by campaignId with state = TBR + this.service.getSurveyUnits(campaign.id, "TBR", (surveyUnits) => { + const lstSU = surveyUnits + // format survey-unit data + .map((su) => ({ + campaignLabel: campaign.label, + campaignId: campaign.id, + interviewer: su.interviewer + ? `${su.interviewer.interviewerLastName} ${su.interviewer.interviewerFirstName}` + : D.unaffected, + idep: su.interviewer ? su.interviewer.id : "", + id: su.id, + displayName: su.displayName, + viewed: su.viewed, + comments: su.comments, + contactOutcome: su.contactOutcome, + })) + // order by interviewer name + .sort((a, b) => (a.interviewer > b.interviewer ? 1 : -1)); + resolveCampaign(lstSU); + }); + }) + ); - Promise.all(promises).then((data) => { - resolve(data.flat()); - }); + Promise.all(promises).then((data) => { + resolve(data.flat()); }); + }); } /** @@ -442,7 +441,14 @@ class DataFormatter { }); } - async getDataForMonitoringTable(survey, givenDate, pagination, mode, cb, campaigns) { + async getDataForMonitoringTable( + survey, + givenDate, + pagination, + mode, + cb, + campaigns + ) { // Adding 24h to take all states added before the next day into account const date = givenDate + 86400000; const interviewers = []; @@ -464,7 +470,12 @@ class DataFormatter { if (getDataForSingleSurvey) { surveysToGetInterviewersFrom = [survey]; } else { - surveysToGetInterviewersFrom = await this.getFormattedCampaignsForMainScreen(date, null, campaigns); + surveysToGetInterviewersFrom = + await this.getFormattedCampaignsForMainScreen( + date, + null, + campaigns + ); } site = (await this.service.getUser()).organizationUnit.label; p1 = new Promise((resolve) => { diff --git a/src/utils/Utils.js b/src/utils/Utils.js index ffaeecf..2eb35ce 100644 --- a/src/utils/Utils.js +++ b/src/utils/Utils.js @@ -178,6 +178,7 @@ class Utils { 'campaign', 'label', 'id', + 'displayName', 'identificationState', 'survey', 'site', @@ -418,7 +419,7 @@ class Utils { sortedData = this.sortData(data, sortOn, newOrder, 'label'); break; case 'listSU': - sortedData = this.sortData(data, sortOn, newOrder, 'id'); + sortedData = this.sortData(data, sortOn, newOrder, 'displayName'); break; case 'terminated': sortedData = this.sortData(data, sortOn, newOrder, 'campaignLabel');