Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[121] Update libraries batch-2 #126

Merged
merged 26 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
9900cf5
Update libraries batch-2 first part
stanislaw-zakrzewski Apr 9, 2024
7cfbfb6
Move some testing to TODO
stanislaw-zakrzewski Apr 9, 2024
a8bbb46
Update Yup when
stanislaw-zakrzewski Apr 9, 2024
e5f5a65
update set field values
stanislaw-zakrzewski Apr 9, 2024
4e84668
Update breaking changes
stanislaw-zakrzewski Apr 9, 2024
9b411df
Update comment
stanislaw-zakrzewski Apr 9, 2024
a15ae3e
Remove unused
stanislaw-zakrzewski Apr 9, 2024
d3a0982
update datepicker
stanislaw-zakrzewski Apr 10, 2024
244a601
Update libraries batch-2 second part
stanislaw-zakrzewski Apr 10, 2024
13f2eea
Update return values of the functions for countries
stanislaw-zakrzewski Apr 10, 2024
b86a7d9
update typescript
stanislaw-zakrzewski Apr 10, 2024
b236761
Update mismatched versions
stanislaw-zakrzewski Apr 11, 2024
f202235
WIP update router and eslint + vite instead of cra
stanislaw-zakrzewski Apr 15, 2024
23a758f
Update tests for new vitest library
stanislaw-zakrzewski Apr 17, 2024
ce9f2b4
Update command for test and coverage
stanislaw-zakrzewski Apr 17, 2024
fd38634
Skip tests that were blocking flow
stanislaw-zakrzewski Apr 22, 2024
dc59615
Update Location.test.tsx
stanislaw-zakrzewski Apr 22, 2024
1ea9578
Merge branch 'main' into 121-update-libraries-batch-2
stanislaw-zakrzewski Apr 23, 2024
2513917
Update varaible name
stanislaw-zakrzewski Apr 23, 2024
be295b0
Fix merging issues
stanislaw-zakrzewski Apr 23, 2024
8db3a7b
Update index.tsx
stanislaw-zakrzewski Apr 29, 2024
65b0361
Update index.tsx
stanislaw-zakrzewski Apr 29, 2024
4e1f5bb
Update Dockerfile
stanislaw-zakrzewski May 14, 2024
aa7b202
Update vite.config.ts
stanislaw-zakrzewski May 14, 2024
939e93d
Update styling
stanislaw-zakrzewski May 14, 2024
828f43f
Cleanup .idea
stanislaw-zakrzewski May 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/curator-ui-node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "16.x"
node-version: "18.x"
- name: Build and test
run: |
git config --global url."https://github.com/".insteadOf git@github.com:
Expand Down
2 changes: 1 addition & 1 deletion dev/docker-compose.dev.full.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ services:
BASE_URL: "${BASE_URL}"
COMPLETE_DATA_BUCKET: "${COMPLETE_DATA_BUCKET}"
COUNTRY_DATA_BUCKET: "${COUNTRY_DATA_BUCKET}"
REACT_APP_RECAPTCHA_SITE_KEY: "${REACT_APP_RECAPTCHA_SITE_KEY}"
REACT_APP_RECAPTCHA_SITE_KEY: "${VITE_APP_RECAPTCHA_SITE_KEY}"
data:
command: "npm run dev"
volumes:
Expand Down
6 changes: 3 additions & 3 deletions dev/docker-compose.dev.full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ services:
BASE_URL: "${BASE_URL}"
COMPLETE_DATA_BUCKET: "${COMPLETE_DATA_BUCKET}"
COUNTRY_DATA_BUCKET: "${COUNTRY_DATA_BUCKET}"
REACT_APP_RECAPTCHA_SITE_KEY: "${REACT_APP_RECAPTCHA_SITE_KEY}"
REACT_APP_RECAPTCHA_SITE_KEY: "${VITE_APP_RECAPTCHA_SITE_KEY}"
NODE_ENV: "dev"
data:
command: "npm run dev"
Expand All @@ -50,8 +50,8 @@ services:
REACT_APP_PUBLIC_MAPBOX_TOKEN: "${REACT_APP_PUBLIC_MAPBOX_TOKEN}"
REACT_APP_POLICY_PUBLIC_ID: "${REACT_APP_POLICY_PUBLIC_ID}"
REACT_APP_COOKIE_CONSENT_PUBLIC_ID: "${REACT_APP_COOKIE_CONSENT_PUBLIC_ID}"
REACT_APP_RECAPTCHA_SITE_KEY: "${REACT_APP_RECAPTCHA_SITE_KEY}"
REACT_APP_DATA_DICTIONARY_LINK: "${REACT_APP_DATA_DICTIONARY_LINK}"
VITE_APP_RECAPTCHA_SITE_KEY: "${VITE_APP_RECAPTCHA_SITE_KEY}"
VITE_APP_DATA_DICTIONARY_LINK: "${VITE_APP_DATA_DICTIONARY_LINK}"
ENABLE_LOCAL_AUTH: "true"
DISEASE_NAME: "${DISEASE_NAME}"
localstack:
Expand Down
14 changes: 7 additions & 7 deletions dev/docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ services:
# We can't use curator:3001 here because that's an internal DNS,
# not accessible from the user's browser.
# In production simply /auth/google would work.
REACT_APP_LOGIN_URL: "http://localhost:3001/auth/google"
REACT_APP_PUBLIC_MAPBOX_TOKEN: "${REACT_APP_PUBLIC_MAPBOX_TOKEN}"
REACT_APP_POLICY_PUBLIC_ID: "${REACT_APP_POLICY_PUBLIC_ID}"
REACT_APP_COOKIE_CONSENT_PUBLIC_ID: "${REACT_APP_COOKIE_CONSENT_PUBLIC_ID}"
REACT_APP_RECAPTCHA_SITE_KEY: "${REACT_APP_RECAPTCHA_SITE_KEY}"
REACT_APP_DISEASE_NAME: "${REACT_APP_DISEASE_NAME}"
REACT_APP_DATA_DICTIONARY_LINK: "${REACT_APP_DATA_DICTIONARY_LINK}"
VITE_APP_LOGIN_URL: "http://localhost:3001/auth/google"
VITE_APP_PUBLIC_MAPBOX_TOKEN: "${REACT_APP_PUBLIC_MAPBOX_TOKEN}"
VITE_APP_POLICY_PUBLIC_ID: "${REACT_APP_POLICY_PUBLIC_ID}"
VITE_APP_COOKIE_CONSENT_PUBLIC_ID: "${REACT_APP_COOKIE_CONSENT_PUBLIC_ID}"
VITE_APP_RECAPTCHA_SITE_KEY: "${VITE_APP_RECAPTCHA_SITE_KEY}"
VITE_APP_DISEASE_NAME: "${REACT_APP_DISEASE_NAME}"
VITE_APP_DATA_DICTIONARY_LINK: "${VITE_APP_DATA_DICTIONARY_LINK}"
14 changes: 7 additions & 7 deletions dev/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ services:
environment:
PORT: "3002"
# UI and API run on different ports in dev, make the custom proxy work.
REACT_APP_PROXY_URL: "http://curator:3001"
REACT_APP_DISEASE_NAME: "${DISEASE_NAME}"
REACT_APP_MAP_LINK_LOCAL: "${MAP_LINK_LOCAL}"
REACT_APP_MAP_LINK_LOCAL_E2E: "${MAP_LINK_LOCAL_E2E}"
REACT_APP_MAP_LINK_DEV: "${MAP_LINK_DEV}"
REACT_APP_MAP_LINK_QA: "${MAP_LINK_QA}"
REACT_APP_MAP_LINK_PROD: "${MAP_LINK_PROD}"
VITE_APP_PROXY_URL: "http://curator:3001"
VITE_APP_DISEASE_NAME: "${DISEASE_NAME}"
VITE_APP_MAP_LINK_LOCAL: "${MAP_LINK_LOCAL}"
VITE_APP_MAP_LINK_LOCAL_E2E: "${MAP_LINK_LOCAL_E2E}"
VITE_APP_MAP_LINK_DEV: "${MAP_LINK_DEV}"
VITE_APP_MAP_LINK_QA: "${MAP_LINK_QA}"
VITE_APP_MAP_LINK_PROD: "${MAP_LINK_PROD}"
14 changes: 7 additions & 7 deletions verification/curator-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This dockerfile builds the curator API service and its UI in a single container.
# The UI is served as a static resource from the curator API service express server.
# Security best practices are followed and a trimmed down image is used for production serving.
FROM node:16.18.0 as builder
FROM node:18.18.0 as builder

# Build the curator service.
WORKDIR /usr/src/app/verification/curator-service/api
Expand Down Expand Up @@ -42,12 +42,12 @@ ENV REACT_APP_PUBLIC_MAPBOX_TOKEN "pk.eyJ1IjoiaGVhbHRobWFwIiwiYSI6ImNrYzNjczdmcz
ENV REACT_APP_POLICY_PUBLIC_ID "89575059"
ENV REACT_APP_COOKIE_CONSENT_PUBLIC_ID "2070778"
ENV REACT_APP_RECAPTCHA_SITE_KEY "6LdhjvwgAAAAALrxavR_zR58kxxap07D4ba8X-jE"
ENV REACT_APP_DISEASE_NAME "Mpox"
ENV REACT_APP_MAP_LINK_DEV "http://dev-map.marburg.global.health/"
ENV REACT_APP_MAP_LINK_LOCAL "http://dev-map.marburg.global.health/"
ENV REACT_APP_MAP_LINK_LOCAL_E2E "http://dev-map.marburg.global.health/"
ENV REACT_APP_MAP_LINK_PROD "http://dev-map.marburg.global.health/"
ENV REACT_APP_MAP_LINK_QA "http://map.marburg.global.health/"
ENV VITE_APP_DISEASE_NAME "Mpox"
ENV VITE_APP_MAP_LINK_DEV "http://dev-map.marburg.global.health/"
ENV VITE_APP_MAP_LINK_LOCAL "http://dev-map.marburg.global.health/"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can these be left blank or made consistent? Right now disease is Mpox but URLs are marburg

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an issue that I and Jim found during deploying the app. In order to deploy build is run on the CuratorUI and for build env variables are set. This problem has been already solved partially for the other variables like disease name, which is queried from backend. Same solution can be employed also for map related variables. I can create an issue for that.

ENV VITE_APP_MAP_LINK_LOCAL_E2E "http://dev-map.marburg.global.health/"
ENV VITE_APP_MAP_LINK_PROD "http://dev-map.marburg.global.health/"
ENV VITE_APP_MAP_LINK_QA "http://map.marburg.global.health/"

RUN npm run build

Expand Down
5 changes: 2 additions & 3 deletions verification/curator-service/ui/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,12 @@
{
"files": ["**/*.ts", "**/*.tsx"],
"plugins": ["@typescript-eslint"],
"extends": [
"react-app",
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:cypress/recommended",
"prettier", // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
"plugin:prettier/recommended" // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array
"plugin:prettier/recommended" // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array
]
}
],
Expand Down
59 changes: 59 additions & 0 deletions verification/curator-service/ui/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
"parserOptions": {
"ecmaVersion": 2017,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"env": {
"browser": true,
"node": true,
"es6": true,
"jest": true
},
"rules": {
"no-bitwise": [
"error"
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"always"
],
"@typescript-eslint/no-redeclare": "off",
"@typescript-eslint/no-unused-expressions": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-var-requires": "off"
},
"overrides": [
{
"files": ["**/*.ts", "**/*.tsx"],
"plugins": ["@typescript-eslint"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:cypress/recommended",
"prettier", // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
"plugin:prettier/recommended" // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array
]
}
],
"settings": {
"react": {
"version": "detect"
}
}
}
2 changes: 1 addition & 1 deletion verification/curator-service/ui/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Dev docker file for curator UI.
FROM node:16.18.0
FROM node:18.18.0

WORKDIR /usr/src/app/verification/curator-service/ui
# Install app dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,31 @@

<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<link rel="icon" href="/favicon.ico" />
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Inter">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="Epidemiology data ingestion and curation" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<link rel="apple-touch-icon" href="/logo192.png" />

<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@globaldothealth" />
<meta name="twitter:creator" content="@globaldothealth" />
<meta property="twitter:description" content="Epidemiology data ingestion and curation" />
<meta property="twitter:title" content="Global.health | a Data Science Initiative" />
<meta property="twitter:image" content="%PUBLIC_URL%/Gh-ogimage.png" />
<meta property="twitter:image" content="/Gh-ogimage.png" />
<meta property="og:url" content="https://data.covid-19.global.health/" />
<meta property="og:title" content="Global.health | a Data Science Initiative" />
<meta property="og:description" content="Epidemiology data ingestion and curation" />
<meta property="og:image" content="%PUBLIC_URL%/Gh-ogimage.png" />
<meta property="og:image:url" content="%PUBLIC_URL%/Gh-ogimage.png" />
<meta property="og:image" content="/Gh-ogimage.png" />
<meta property="og:image:url" content="/Gh-ogimage.png" />
<meta name="twitter:card" content="Epidemiology data ingestion and curation" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<link rel="manifest" href="/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Expand All @@ -53,6 +53,7 @@
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
<script type="module" src="/src/index.tsx"></script>
</body>

</html>
Loading
Loading