From 2ad27524b0fb984766803ba70fb7e5fa04aa0f7f Mon Sep 17 00:00:00 2001
From: Sampo Riitala <57003465+realtalin@users.noreply.github.com>
Date: Fri, 15 Nov 2024 04:13:31 +0200
Subject: [PATCH] fix outdated names
---
README.md | 112 +++++++++---------
cypress/e2e/locality.cy.js | 2 +-
.../components/Locality/Tabs/LocalityTab.tsx | 4 +-
.../components/Map/CoordinateSelectionMap.tsx | 9 +-
4 files changed, 66 insertions(+), 61 deletions(-)
diff --git a/README.md b/README.md
index 8fddff65..731ffefd 100644
--- a/README.md
+++ b/README.md
@@ -2,87 +2,87 @@
**NOW - New and Old Worlds - Database of fossil mammals**
-Rebuild of a fossil database application, old version at https://nowdatabase.luomus.fi/
+Rebuild of a fossil database application, old version at https://nowdatabase.luomus.fi/
The new version is not deployed yet.
-_____
+---
### Developer documentation
**Basic commands** :computer:
-+ `npm run setup`
- + Installs all node modules, and generates prisma client
-+ `npm run dev`
- + Uses `docker-compose.dev.yml`
- + Run in development mode: with hot reload
- + To create test users visit `http://localhost:4000/test/create-test-users`
+- `npm run setup`
+ - Installs all node modules, and generates prisma client
+- `npm run dev`
+ - Uses `docker-compose.dev.yml`
+ - Run in development mode: with hot reload
+ - To create test users visit `http://localhost:4000/test/create-test-users`
Testing:
-+ `npm run check`
- + Runs `tsc` and `eslint` for frontend and backend: Use this to check for errors before committing.
-+ `npm run test:api`
- + Runs the api-tests in a docker container
- + Requires database to be running. Can be achieved by `npm run start:anon -- db-anon` or just `npm run start:anon:api`.
- + Uses `test_data`
- + Uses `.test.env`
- + `npm run test:api:build` builds the container used to run the tests.
- + `npm run test:api:run` runs the previously built container.
-+ `npm run test:e2e`
- + Runs e2e-tests inside a docker container.
- + Requires `frontend`, `backend` and `database` to be running. Can be achieved by running `npm run start:anon`.
- + Uses `test_data`
-+ `npm run test:e2e:local`
- + Runs cypress-tests locally (not in docker) in headless mode.
- + Requires `npm run start:anon` to be running first.
-+ `npm run test:api:local`
- + Runs backend api tests locally (not in docker).
- + Requires `db-anon` to be running first. (Note: backend doesn't need to be running.)
- + Requires `.test.env`
-+ `npm run cypress`
- + Opens cypress GUI. You can run tests and see what they do.
+- `npm run check`
+ - Runs `tsc` and `eslint` for frontend and backend: Use this to check for errors before committing.
+- `npm run test:api`
+ - Runs the api-tests in a docker container
+ - Requires database to be running. Can be achieved by `npm run start:anon -- db-anon` or just `npm run start:anon:api`.
+ - Uses `test_data`
+ - Uses `.test.env`
+ - `npm run test:api:build` builds the container used to run the tests.
+ - `npm run test:api:run` runs the previously built container.
+- `npm run test:e2e`
+ - Runs e2e-tests inside a docker container.
+ - Requires `frontend`, `backend` and `database` to be running. Can be achieved by running `npm run start:anon`.
+ - Uses `test_data`
+- `npm run test:e2e:local`
+ - Runs cypress-tests locally (not in docker) in headless mode.
+ - Requires `npm run start:anon` to be running first.
+- `npm run test:api:local`
+ - Runs backend api tests locally (not in docker).
+ - Requires `db-anon` to be running first. (Note: backend doesn't need to be running.)
+ - Requires `.test.env`
+- `npm run cypress`
+ - Opens cypress GUI. You can run tests and see what they do.
Windows testing:
-+ Both `e2e` and `api-tests` have a Windows specific command.
- + `e2e` is `npm run test:e2e:windows`
- + `api-tests` is `npm run test:api:windows`
- + For `api-tests`: inside `.test.env`, you need to change all instances of `localhost` to `host.docker.internal`.
- + These include `MARIADB_HOST`, `DATABASE_URL` and `LOG_DATABASE_URL`.
- + Note: these are not tested yet.
+- Both `e2e` and `api-tests` have a Windows specific command.
+ - `e2e` is `npm run test:e2e:windows`
+ - `api-tests` is `npm run test:api:windows`
+ - For `api-tests`: inside `.test.env`, you need to change all instances of `localhost` to `host.docker.internal`.
+ - These include `MARIADB_HOST`, `DATABASE_URL` and `LOG_DATABASE_URL`.
+ - Note: these are not tested yet.
Test env-file:
-+ `.test.env`
- + `api-tests` requires `.test.env` to set the correct environment variables.
- + This is created by copying `.anon.env` and changing all instances of `nowdb-db-anon` to `localhost`.
- + These include `MARIADB_HOST`, `DATABASE_URL` and `LOG_DATABASE_URL`.
+- `.test.env`
+ - `api-tests` requires `.test.env` to set the correct environment variables.
+ - This is created by copying `.anon.env` and changing all instances of `nowdb-db-anon` to `localhost`.
+ - These include `MARIADB_HOST`, `DATABASE_URL` and `LOG_DATABASE_URL`.
Coverage:
-+ Coverage opening
- + Coverage can be opened by opening the `coverage/lcov-report/index.html` with your browser of choice.
-+ `coverage:sed`
- + Fixes issues with `.nyc_output` paths. Replaces the paths inside Docker to `$PWD` (current directory).
-+ `coverage`
- + First fixes paths with `coverage:sed` and then recreates `coverage/lcov-report` to match the new path.
-+ `coverage:report`
- + Alias to `npm run coverage`. Used by cypress e2e tests so that `coverage:sed` gets executed automatically.
+- Coverage opening
+ - Coverage can be opened by opening the `coverage/lcov-report/index.html` with your browser of choice.
+- `coverage:sed`
+ - Fixes issues with `.nyc_output` paths. Replaces the paths inside Docker to `$PWD` (current directory).
+- `coverage`
+ - First fixes paths with `coverage:sed` and then recreates `coverage/lcov-report` to match the new path.
+- `coverage:report`
+ - Alias to `npm run coverage`. Used by cypress e2e tests so that `coverage:sed` gets executed automatically.
Run with the same image that is used in production:
-+ `npm start`
- + Uses `docker-compose.yml`
- + This builds the code and runs it. Mostly you'll want to use this after major technical changes to check the code works also in production mode, before deploying. And then you'll likely want to do: `npm start -- --build` to force rebuild of containers.
+- `npm start`
+ - Uses `docker-compose.yml`
+ - This builds the code and runs it. Mostly you'll want to use this after major technical changes to check the code works also in production mode, before deploying. And then you'll likely want to do: `npm start -- --build` to force rebuild of containers.
Docker:
-+ `npm run dev:down`
- + Stops and removes the dev container and it's volumes.
-+ `-- --build`
- + Useful flag to force docker to rebuild the containers. Example usage for dev: `npm run dev -- --build`
+- `npm run dev:down`
+ - Stops and removes the dev container and it's volumes.
+- `-- --build`
+ - Useful flag to force docker to rebuild the containers. Example usage for dev: `npm run dev -- --build`
**Further documentation**
@@ -98,4 +98,4 @@ Docker:
:mag_right: [Class diagram](documentation/class_diagram.md) See the relations of relevant tables. Notice that it omits some unimportant tables and does not show most columns.
-:earth_africa: [Map feature](/documentation/components/map_feat.md) Map's functionality and development notes
+:earth_africa: [Map features](/documentation/components/map_features.md) Maps' functionality and development notes
diff --git a/cypress/e2e/locality.cy.js b/cypress/e2e/locality.cy.js
index b803b672..873a7dba 100644
--- a/cypress/e2e/locality.cy.js
+++ b/cypress/e2e/locality.cy.js
@@ -178,7 +178,7 @@ describe("Locality's Map works", () => {
cy.contains('Coordinates')
cy.get('[id=edit-button]').click()
cy.contains('Latitude')
- cy.contains('Open Map').click()
+ cy.contains('Get Coordinates').click()
cy.contains('OpenStreetMap')
cy.contains('Leaflet')
diff --git a/frontend/src/components/Locality/Tabs/LocalityTab.tsx b/frontend/src/components/Locality/Tabs/LocalityTab.tsx
index 243adf3c..3fc7893d 100644
--- a/frontend/src/components/Locality/Tabs/LocalityTab.tsx
+++ b/frontend/src/components/Locality/Tabs/LocalityTab.tsx
@@ -7,7 +7,7 @@ import { useForm } from 'react-hook-form'
import { EditableTable } from '@/components/DetailView/common/EditableTable'
import { EditingModal } from '@/components/DetailView/common/EditingModal'
import { emptyOption } from '@/components/DetailView/common/misc'
-import { Map } from '@/components/Map/CoordinateSelectionMap'
+import { CoordinateSelectionMap } from '@/components/Map/CoordinateSelectionMap'
import { useState } from 'react'
import { convertDmsToDec, convertDecToDms } from '@/util/coordinateConversion'
@@ -157,7 +157,7 @@ export const LocalityTab = () => {
const coordinateButton = (