Skip to content

Commit

Permalink
Merge pull request #4 from EyeSeeTea/feature/dashboard
Browse files Browse the repository at this point in the history
Feature/dashboard
  • Loading branch information
ifoche authored Apr 2, 2020
2 parents 784c975 + cd95d1b commit fc0219e
Show file tree
Hide file tree
Showing 31 changed files with 1,963 additions and 184 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module.exports = {
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/ban-ts-ignore": "off",
"@typescript-eslint/no-empty-function": "off",
"react-hooks/exhaustive-deps": "error",
"react-hooks/exhaustive-deps": "warn",
},
plugins: ["cypress"],
env: { "cypress/globals": true },
Expand Down
29 changes: 1 addition & 28 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,9 @@ dist: bionic
cache:
directories:
- "$HOME/.cache"
before_install:
- echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
# Install python dependencies
- sudo apt-get update
- sudo apt-get install python3 python python3-setuptools docker.io docker-compose
# Install d2-docker
- git clone https://github.com/EyeSeeTea/d2-docker.git
- cd d2-docker/
- sudo python3 setup.py install
- d2-docker --help
# Hack to not be prompted in the terminal
- sudo apt-get remove golang-docker-credential-helpers
# Start docker service
- sudo systemctl unmask docker.service
- sudo systemctl unmask docker.socket
- sudo systemctl start docker.service
# Login to docker
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
# Start docker service
- d2-docker start eyeseetea/dhis2-data:2.30-cc-gee-webapp-dev -d --port 8080
install:
- yarn install --frozen-lockfile
- yarn cy:verify
- yarn build
script:
- PORT=8081 REACT_APP_DHIS2_BASE_URL=http://localhost:8080 REACT_APP_CYPRESS=true yarn start &
- yarn wait-on http-get://localhost:8081
- yarn wait-on http-get://localhost:8080
- CYPRESS_EXTERNAL_API=http://localhost:8080 CYPRESS_ROOT_URL=http://localhost:8081 yarn cy:e2e:run --record --key $CYPRESS_KEY
- kill $(jobs -p) || true
- yarn build-webapp
addons:
apt:
packages:
Expand Down
12 changes: 1 addition & 11 deletions cypress/integration/example-page.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,10 @@
context("Example page", () => {
before(() => {
cy.login("who");
cy.visit("#/for");
cy.visit("#/");
});

it("has page title", () => {
cy.title().should("equal", "GEE App");
});

it("increments counter when button clicked", () => {
cy.contains("+1").click();
cy.contains("Value=1");
});

it("shows feedback when button clicked", () => {
cy.contains("Click to show feedback").click();
cy.contains("Some info");
});
});
37 changes: 8 additions & 29 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,54 +72,33 @@ Cypress.Commands.add("waitForStep", stepName => {

Cypress.Commands.add("selectInMultiSelector", (selector, option) => {
cy.get(selector + " > div select:first").select(option);
cy.contains("Selected")
.next("button")
.click();
cy.contains("Selected").next("button").click();
});

Cypress.Commands.add("unselectInMultiSelector", (containerSelector, option) => {
const selector = containerSelector ? containerSelector + " > div select:last" : "select:last";

cy.get(selector).select(option);
cy.contains("Selected")
.next("button")
.next("button")
.click();
cy.contains("Selected").next("button").next("button").click();
});

Cypress.Commands.add("selectInOrgUnitTree", label => {
cy.contains(label)
.find("input")
.click();
cy.contains(label)
.should("have.css", "color")
.and("equal", "rgb(255, 165, 0)");
cy.contains(label).find("input").click();
cy.contains(label).should("have.css", "color").and("equal", "rgb(255, 165, 0)");
});

Cypress.Commands.add("expandInOrgUnitTree", (container, orgUnit) => {
cy.get(container)
.contains(orgUnit)
.parent()
.parent()
.contains("▸")
.click();
cy.get(container).contains(orgUnit).parent().parent().contains("▸").click();
});

Cypress.Commands.add("selectRowInTableByText", text => {
cy.get("table")
.contains(text)
.click();
cy.get("table").contains(text).click();
});

Cypress.Commands.add("selectInDropdown", (containerSelector, label, option) => {
const parent = containerSelector ? cy.get(containerSelector) : cy;

parent
.contains(label)
.parent()
.click();
parent.contains(label).parent().click();

cy.get('[role="listbox"]')
.contains(option)
.click();
cy.get('[role="listbox"]').contains(option).click();
});
6 changes: 2 additions & 4 deletions cypress/support/network-fixtures.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const stubRequest = (url, response, method = "GET") => {
response: "",
onRequest: xhr => {
const originalOnLoad = xhr.xhr.onload;
xhr.xhr.onload = function() {
xhr.xhr.onload = function () {
Object.defineProperty(this, "response", {
writable: true,
});
Expand Down Expand Up @@ -137,9 +137,7 @@ Cypress.Commands.add("startServer", collection => {
Cypress.Commands.add("saveFixtures", collection => {
if (generateFixtures) {
xhrManager.requests.forEach(req => {
cy.wrap(req, { log: false })
.its("response")
.should("not.be", null);
cy.wrap(req, { log: false }).its("response").should("not.be", null);
});
cy.writeFile(`cypress/fixtures/${collection}.json`, xhrManager, {
timeout: 30000,
Expand Down
185 changes: 183 additions & 2 deletions i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,201 @@ 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: 2020-03-09T08:28:53.161Z\n"
"PO-Revision-Date: 2020-03-09T08:28:53.161Z\n"
"POT-Creation-Date: 2020-03-30T07:07:17.941Z\n"
"PO-Revision-Date: 2020-03-30T07:07:17.941Z\n"

msgid "Select organisation unit"
msgstr ""

msgid "Save"
msgstr ""

msgid "Fixed period"
msgstr ""

msgid "Today"
msgstr ""

msgid "Yesterday"
msgstr ""

msgid "Last 7 days"
msgstr ""

msgid "Last 14 days"
msgstr ""

msgid "This week"
msgstr ""

msgid "Last week"
msgstr ""

msgid "This month"
msgstr ""

msgid "Last month"
msgstr ""

msgid "This quarter"
msgstr ""

msgid "Last quarter"
msgstr ""

msgid "This year"
msgstr ""

msgid "Last year"
msgstr ""

msgid "Select period interval"
msgstr ""

msgid "Period"
msgstr ""

msgid "Start date"
msgstr ""

msgid "End date"
msgstr ""

msgid "<No value>"
msgstr ""

msgid "Help"
msgstr ""

msgid "Back"
msgstr ""

msgid "Cancel?"
msgstr ""

msgid ""
"You are about to exit. All your changes will be lost. Are you sure you want "
"to proceed?"
msgstr ""

msgid "Yes"
msgstr ""

msgid "No"
msgstr ""

msgid "Id"
msgstr ""

msgid "Name"
msgstr ""

msgid "Description"
msgstr ""

msgid "Selected mappings"
msgstr ""

msgid "Selected organisation units"
msgstr ""

msgid "Selected query period"
msgstr ""

msgid "Instance Dataset"
msgstr ""

msgid "G.E.E Dataset"
msgstr ""

msgid "Created at"
msgstr ""

msgid "Click to show feedback"
msgstr ""

msgid "Import"
msgstr ""

msgid "Select Organisation Units"
msgstr ""

msgid "Select Period"
msgstr ""

msgid "Import to DHIS2 "
msgstr ""

msgid "Download JSON "
msgstr ""

msgid "List and manage a new import."
msgstr ""

msgid "Configuration"
msgstr ""

msgid "Add"
msgstr ""

msgid "List"
msgstr ""

msgid "Data set"
msgstr ""

msgid "Created"
msgstr ""

msgid "Details"
msgstr ""

msgid "Edit"
msgstr ""

msgid "Delete"
msgstr ""

msgid "{{n}} mappings deleted"
msgstr ""

msgid "Delete project"
msgstr ""

msgid ""
"This operation will delete ({{n}}) mappings. This operation cannot be "
"undone. Are you sure you want to proceed?"
msgstr ""

msgid "Deleting..."
msgstr ""

msgid "Proceed"
msgstr ""

msgid "Cancel"
msgstr ""

msgid "Search by name or code"
msgstr ""

msgid "General info"
msgstr ""

msgid "Summary and save"
msgstr ""

msgid "New mapping"
msgstr ""

msgid "Edit mapping"
msgstr ""

msgid "Cancel mapping creation"
msgstr ""

msgid "Cancel mapping edition"
msgstr ""

msgid "Ok"
msgstr ""
Loading

0 comments on commit fc0219e

Please sign in to comment.