Skip to content

Commit

Permalink
Merge pull request #502 from EyeSeeTea/development
Browse files Browse the repository at this point in the history
Release 1.5.0
  • Loading branch information
adrianq authored Aug 15, 2023
2 parents a6860a5 + 6849d63 commit 41f1a74
Show file tree
Hide file tree
Showing 66 changed files with 2,994 additions and 663 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ module.exports = {
"@typescript-eslint/no-unused-vars": [1, { argsIgnorePattern: "^_" }],
"react/prop-types": "off",
"no-unused-expressions": "warn",
"@typescript-eslint/no-unused-expressions": "warn",
"no-useless-concat": "off",
"no-redeclare": "off",
"no-use-before-define": "off",
"no-debugger": "warn",
"no-useless-constructor": "off",
"default-case": "off",
"array-callback-return": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-use-before-define": "off",
Expand Down
26 changes: 8 additions & 18 deletions cypress/integration/00.project-create.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ describe("Projects - Create", () => {
cy.contains("Award Number should be a number of 5 digits");
cy.contains("Subsequent Lettering must contain exactly two letters");

cy.get(".dm-MuiSnackbarContent-action .dm-MuiIconButton-root").click();

cy.get("[data-field='name']").type("00Cypress Project");
cy.get("[data-field='description']").type("Some description");
cy.get("[data-field='awardNumber']").type(Math.floor(10000 + Math.random() * 90000));
cy.get("[data-field='subsequentLettering']").type("SL");

const startDate = moment();
const startDate = moment.utc({ year: 2022, month: 1, day: 1 });
const endDate = moment().add(3, "months");

cy.contains("Start Date (*)").click({ force: true });
Expand All @@ -40,6 +42,9 @@ describe("Projects - Create", () => {
cy.contains("Funders");
selectInMultiSelector("funders", "Samaritan's Purse - IHQ");

cy.contains("Would you like to use the funder code");
cy.contains("Yes").click();

cy.contains("Next").click();

// Organisation Unit Step
Expand Down Expand Up @@ -83,19 +88,6 @@ describe("Projects - Create", () => {

cy.contains("Next").click();

// Disaggregation

cy.waitForStep("Disaggregation");
cy.get("[data-cy=covid19-selector-B010200]").contains("No").click();
cy.get(".MuiPopover-paper").contains("Yes").click();

cy.contains("Livelihoods").click();

cy.get("[data-cy=covid19-selector-P020100]").contains("No").click();
cy.get(".MuiPopover-paper").contains("Yes").click();

cy.contains("Next").click();

// Selection of MER Indicators

cy.waitForStep("Selection of MER Indicators");
Expand Down Expand Up @@ -142,10 +134,8 @@ describe("Projects - Create", () => {
cy.contains("Agriculture");
cy.contains("Livelihoods");

cy.contains(
"# of agriculture groups receiving support for improved livelihoods - B010200 [COVID-19]"
);
cy.contains("# of people trained in livelihood topics - P020100 [COVID-19] [MER]");
cy.contains("# of agriculture groups receiving support for improved livelihoods - B010200");
cy.contains("# of people trained in livelihood topics - P020100 [MER]");
cy.contains("# of people trained on microfinance - P020103");

cy.server();
Expand Down
8 changes: 4 additions & 4 deletions cypress/integration/01.project-list.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ describe("Project Configuration - List page", () => {
});

it("shows list of projects sorted alphabetically", () => {
cy.get(".MuiTableBody-root tr > td:nth-child(2)").then(el => {
cy.get(".dm-MuiTableBody-root tr > td:nth-child(2)").then(el => {
const names = el.get().map(x => x.innerText);
const sortedNames = _(names)
.orderBy(name => name.toLowerCase())
.orderBy(name => name)
.value();
assert.isTrue(_.isEqual(names, sortedNames));
});
Expand All @@ -69,10 +69,10 @@ describe("Project Configuration - List page", () => {
cy.contains("Name").click();
});

cy.get(".MuiTableBody-root tr > td:nth-child(2)").then(el => {
cy.get(".dm-MuiTableBody-root tr > td:nth-child(2)").then(el => {
const names = el.get().map(x => x.innerText);
const sortedNames = _(names)
.orderBy(name => name.toLowerCase())
.orderBy(name => name)
.reverse()
.value();
console.log({ names, sortedNames });
Expand Down
4 changes: 2 additions & 2 deletions cypress/integration/05.project-download.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe("Download project", () => {
xhr.send();
});

expect(workbook.getWorksheet("Benefit")).to.not.be.undefined;
expect(workbook.getWorksheet("People")).to.not.be.undefined;
expect(workbook.getWorksheet("Benefit")).not.equals(undefined);
expect(workbook.getWorksheet("People")).not.equals(undefined);
});
});
5 changes: 1 addition & 4 deletions cypress/integration/07.project-edit.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe("Projects - Edit", () => {
});

it("gets data from the user to edit a project", () => {
const startDate = moment();
const startDate = moment.utc({ year: 2022, month: 1, day: 1 });
const endDate = moment().add(3, "months");

cy.contains("Edit project");
Expand All @@ -27,9 +27,6 @@ describe("Projects - Edit", () => {
cy.waitForStep("Selection of Indicators");
cy.contains("Next").click();

cy.waitForStep("Disaggregation");
cy.contains("Next").click();

cy.waitForStep("Selection of MER Indicators");
cy.contains("Next").click();

Expand Down
6 changes: 3 additions & 3 deletions cypress/integration/08.project-indicators.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ describe("Projects - Indicators", () => {
cy.contains("Next").click();

// Change pageSize so all indicators are shown in a single page
cy.get(".MuiTablePagination-root").contains("20").click();
cy.get(".MuiMenu-list").contains("100").click();
cy.get(".dm-MuiTablePagination-root").contains("20").click();
cy.get(".dm-MuiMenu-list").contains("100").click();

new IndicatorsPage(cy)
.selectSector("Agriculture")
Expand Down Expand Up @@ -101,6 +101,6 @@ describe("Projects - Indicators", () => {
cy.contains("P020105");

// Livelihoods
cy.contains("P020100 [COVID-19] [MER]");
cy.contains("P020100 [MER]");
});
});
4 changes: 2 additions & 2 deletions cypress/integration/09.countries-list.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe("Countries List page", () => {
});

it("shows list of countries sorted alphabetically", () => {
cy.get(".MuiTableBody-root tr > td:nth-child(2)").then(el => {
cy.get(".dm-MuiTableBody-root tr > td:nth-child(2)").then(el => {
const names = el.get().map(x => x.innerText);
const sortedNames = _(names)
.orderBy(name => name.toLowerCase())
Expand All @@ -46,7 +46,7 @@ describe("Countries List page", () => {
cy.contains("Name").click();
});

cy.get(".MuiTableBody-root tr > td:nth-child(2)").then(el => {
cy.get(".dm-MuiTableBody-root tr > td:nth-child(2)").then(el => {
const names = el.get().map(x => x.innerText);
const sortedNames = _(names)
.orderBy(name => name.toLowerCase())
Expand Down
4 changes: 2 additions & 2 deletions cypress/support/pages/indicators-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ export default class IndicatorsPage {
function getCodes(cb, options) {
const { onlySelected } = options;
const extra = onlySelected ? ".Mui-selected" : "";
cy.get(".MuiTableBody-root").then(() => {
const codeFields = Cypress.$(`.MuiTableRow-root${extra} td:nth-child(3)`)
cy.get(".dm-MuiTableBody-root").then(() => {
const codeFields = Cypress.$(`.dm-MuiTableRow-root${extra} td:nth-child(3)`)
.get()
.map(x => x.innerText);
const codes = _(codeFields)
Expand Down
2 changes: 1 addition & 1 deletion cypress/support/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export function selectOrgUnit(label) {
}

export function selectDatePicker(year, month) {
const pickerSelector = "[class^=MuiPickersBasePicker-pickerView]";
const pickerSelector = "[class^=dm-MuiPickersBasePicker-pickerView]";
cy.get(pickerSelector).contains(year.toString()).click();
cy.get(pickerSelector).contains(month).click();
}
Expand Down
130 changes: 82 additions & 48 deletions i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"POT-Creation-Date: 2022-10-24T06:53:19.502Z\n"
"PO-Revision-Date: 2022-10-24T06:53:19.502Z\n"
"POT-Creation-Date: 2023-08-15T12:39:46.508Z\n"
"PO-Revision-Date: 2023-08-15T12:39:46.508Z\n"

msgid "Name"
msgstr ""
Expand Down Expand Up @@ -89,7 +89,13 @@ msgstr ""
msgid "Validation results"
msgstr ""

msgid "OK"
msgid "Close"
msgstr ""

msgid "Save"
msgstr ""

msgid "Comments saved"
msgstr ""

msgid "Validation data is not loaded, skip validation"
Expand Down Expand Up @@ -265,48 +271,6 @@ msgstr ""
msgid "Checking Existing Data"
msgstr ""

msgid "Save"
msgstr ""

msgid "Description"
msgstr ""

msgid "Award Number"
msgstr ""

msgid "Subsequent Lettering"
msgstr ""

msgid "Period dates"
msgstr ""

msgid "Funders"
msgstr ""

msgid "Selected country"
msgstr ""

msgid "Locations"
msgstr ""

msgid "Sharing"
msgstr ""

msgid "Users"
msgstr ""

msgid "User groups"
msgstr ""

msgid "Sectors"
msgstr ""

msgid "Hidden in data entry as it is selected in multiple sectors!"
msgstr ""

msgid "MER"
msgstr ""

msgid "Saving Project"
msgstr ""

Expand Down Expand Up @@ -397,6 +361,9 @@ msgstr ""
msgid "Narrative"
msgstr ""

msgid "Locations"
msgstr ""

msgid "Project"
msgstr ""

Expand Down Expand Up @@ -459,7 +426,16 @@ msgstr ""
msgid "Data Elements MER"
msgstr ""

msgid "Additional Designation (Location/Sector)"
msgid "Description"
msgstr ""

msgid "Award Number"
msgstr ""

msgid "Subsequent Lettering"
msgstr ""

msgid "Additional Designation (Funder, Location, Sector, etc)"
msgstr ""

msgid "Start Date"
Expand All @@ -468,6 +444,12 @@ msgstr ""
msgid "End Date"
msgstr ""

msgid "Sectors"
msgstr ""

msgid "Funders"
msgstr ""

msgid "Project Locations"
msgstr ""

Expand All @@ -486,6 +468,9 @@ msgstr ""
msgid "Initial Data"
msgstr ""

msgid "Sharing"
msgstr ""

msgid "Award Number should be a number of 5 digits"
msgstr ""

Expand Down Expand Up @@ -617,7 +602,37 @@ msgstr ""
msgid "People"
msgstr ""

msgid "[SP Platform] Request for Data Review: {{name}} ({{code}})"
msgid "NONE"
msgstr ""

msgid "UPDATED"
msgstr ""

msgid "ADDED"
msgstr ""

msgid "REMOVED"
msgstr ""

msgid "Period dates"
msgstr ""

msgid "Selected country"
msgstr ""

msgid "Users"
msgstr ""

msgid "User Groups"
msgstr ""

msgid "Hidden in data entry as it is selected in multiple sectors!"
msgstr ""

msgid "MER"
msgstr ""

msgid "[SP Platform] Request for Data Review: {{-name}} ({{code}})"
msgstr ""

msgid ""
Expand Down Expand Up @@ -662,13 +677,19 @@ msgstr ""
msgid "Project '{{projectName}}' [dangling data values]"
msgstr ""

msgid "... and {{countMore}} more"
msgstr ""

msgid "Award Number {{awardNumber}}"
msgstr ""

msgid "The following sectors have no indicators selected"
msgstr ""

msgid "Select at least one indicator"
msgid "Select at least a total of {{min}} indicators"
msgstr ""

msgid "Select at most a total of {{max}} indicators"
msgstr ""

msgid ""
Expand Down Expand Up @@ -704,6 +725,16 @@ msgstr ""
msgid "Benefit value should have 5 or less decimal places ({{value}})"
msgstr ""

msgid ""
"Global indicator {{-name}} must have a value (as some sub-indicator has a "
"value)"
msgstr ""

msgid ""
"Global indicator {{-name}} value ({{value}}) must be inferior to the sum of "
"new+returning of its sub-indicators ({{subFormula}})"
msgstr ""

msgid ""
"A sub-indicator should be equal to or less than its global indicator: "
"{{-name}} ({{value}})"
Expand Down Expand Up @@ -944,6 +975,9 @@ msgstr ""
msgid "Delete"
msgstr ""

msgid "User groups"
msgstr ""

msgid "Countries"
msgstr ""

Expand Down
Loading

0 comments on commit 41f1a74

Please sign in to comment.