21 Commits

Author SHA1 Message Date
Dan Albert
de8d42e3e5 Test (most of) the rest of WaypointMarker.
There isn't any UI observable behavior of the dragend of the waypoint,
but we can test that the backend was called. The only uncovered parts of
that component are now error paths, but the error handling in that
component is to just ignore errors, so there's also nothing to test
there.
2023-06-28 22:44:02 -07:00
Dan Albert
374759df0f Test most of WaypointMarker.
Unlike the other map tests which heavily rely on mocks, this one uses
React refs to inspect the constructed leaflet objects. The DOM itself
doesn't appear to contain anything worth testing against (react-leaflet
rendering doesn't work like typical React rendering).

This required some infrastructure changes:

1. Forwarded ref from WaypointMarker to Marker so the test can observe
   it. Added a mergeRefs helper (and its own tests) to make that easier.
2. Switched from identity-obj-proxy to jest-transform-stub, because the
   former doesn't produce a useable image for imports, and we need
   usable images for leaflet to be able to render.

This doesn't yet test drag and drop behavior since that requires mocking
the backend, and this commit is already complicated enough. That'll be
next.
2023-06-27 22:41:33 -07:00
Dan Albert
57a4a7c282 Test typescript and collect coverage.
We don't actually have any tests yet :(
2023-05-03 23:18:15 -07:00
Dan Albert
c835cda5b6 Update NPM dependencies.
New versions of react and leaflet, along with a lot of other packages.
I'm hoping that the newest react-leaflet might let use solve the carrier
drag and drop issues in a less hacky way, since that's the cause of
https://github.com/dcs-liberation/dcs_liberation/issues/2388.
2022-10-07 13:33:53 -07:00
Dan Albert
36ef1479a6 Update caniuse-lite.
Complains when tests are run.
2022-10-07 13:33:53 -07:00
dependabot[bot]
8f0d071afb Bump electron from 17.1.0 to 17.2.0 in /client
Bumps [electron](https://github.com/electron/electron) from 17.1.0 to 17.2.0.
- [Release notes](https://github.com/electron/electron/releases)
- [Changelog](https://github.com/electron/electron/blob/main/docs/breaking-changes.md)
- [Commits](https://github.com/electron/electron/compare/v17.1.0...v17.2.0)

---
updated-dependencies:
- dependency-name: electron
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-16 16:28:14 -07:00
Raffson
30bdcfac29 Fix eslint warning in CI 2022-06-16 09:38:29 -07:00
Raffson
70e5c578ae
Add the ruler to the new map.
https://github.com/dcs-liberation/dcs_liberation/issues/2158
2022-06-12 13:15:26 -07:00
Dan Albert
6f21067ddb Fix lint error, add lint script. 2022-03-06 21:59:44 -08:00
Dan Albert
de284c2bf6 Add tooling/docs for auto-generating API hooks. 2022-03-06 18:18:35 -08:00
Dan Albert
8165d3bd8c Add support for running the build react map.
https://github.com/dcs-liberation/dcs_liberation/issues/2039
2022-03-06 01:53:22 -08:00
Dan Albert
17f2f007d2 Copy open source licenses into the distribution.
https://github.com/dcs-liberation/dcs_liberation/issues/2039
2022-03-06 01:34:53 -08:00
Dan Albert
7e213dbfbe Add license checking to npm ci.
These are all the licenses we currently depend on.

https://github.com/dcs-liberation/dcs_liberation/issues/2039
2022-03-06 01:33:33 -08:00
Dan Albert
fcb897a0e8 Uninstall @types/axios.
Axios ships types by default now so we don't need this.
2022-03-06 01:02:09 -08:00
Dan Albert
5230591dc2 Add npm ci to GitHub actions.
Formatting currently being forced to preserve line endings because for
whatever reason that's only causing problems in CI.
2022-03-06 00:59:58 -08:00
Dan Albert
fef123c2d4 Add redux-logger.
This automatically logs state changes (in a readable form) to the js
console. We'll probably want to turn this off in production to cut down
on log noise.
2022-03-04 00:24:31 -08:00
Dan Albert
13ca5352c7 Add import sorting to prettier. 2022-03-03 23:32:57 -08:00
Dan Albert
8e8bbe84f3 Add websocket handling for selected flights. 2022-03-01 21:08:08 -08:00
Dan Albert
e51662526b Add an electron app for the React front-end. 2022-02-28 22:24:46 -08:00
Dan Albert
155f9d4052 Make react-scripts devdependency to shut up audit.
The vulnerabilities are false positives and React doesn't think those
are worth fixing to make `npm audit` be quiet. We can at least make them
go away for `npm audit --production`, which is the official advice:
https://github.com/facebook/create-react-app/issues/11174.
2022-02-28 00:44:13 -08:00
Dan Albert
59e98b31df Add a basic React implementation of the map.
See client/README.md for instructions.
2022-02-28 00:31:56 -08:00