Commit Graph

115 Commits

Author SHA1 Message Date
Scott Lamb
e9a25322b5 upgrade msw 1->2, fix network error case
In the upgrade I managed to dust off some tests that I'd been skipping
for quite a while. It turns out one of them was pointing out a real
problem: in the network error case, we didn't display the error to the
user properly. It's really sad this reaches our code as a `TypeError`,
but it is what it is.
2023-12-18 17:08:19 -08:00
Scott Lamb
3911334fee switch to vitest 2023-12-18 17:08:09 -08:00
Scott Lamb
24880a5c2d switch from create-react-app to vite
create-react-app is apparently deprecated, so the cool kids use vite,
I guess.
2023-12-18 17:08:09 -08:00
Scott Lamb
79af39f35e add a couple missing imports
(not entirely sure why it works without them but may be complicating
an upgrade)
2023-12-17 16:21:52 -08:00
Scott Lamb
14d1879ccd fix #290 2023-12-17 15:57:52 -08:00
Scott Lamb
3de62eb70d ui test cleanups
* update `msw` 0.49 -> 1.x. (2.x is out now, but small steps.)
* wrap some `jest.{runOnlyPendingTimers,advanceTimersByTime}` calls
  in `act`.
* extend a timeout that had no slack at all
2023-12-09 14:59:40 -08:00
Scott Lamb
1f7806108c upgrade @mui/x-date-pickers to v6 beta
Fixes #256
2023-11-28 10:26:52 -08:00
Scott Lamb
e103a709a0 update caniuse list 2023-09-30 16:04:03 -07:00
Scott Lamb
9820bf8883 tweak ui dev server's websocket situation
* fix the automatic reload
* document that live view doesn't work with `PROXY_TARGET`;
  link to fresh issue
2023-09-30 16:02:52 -07:00
Scott Lamb
438de38202
rework WebSocket error return protocol
This gives much better information to the UI layer, getting rid of a
whole troubleshooting guide entry. See #119 #132 #218 #219

I also restructured the code in anticipation of a new WebSocket event
stream (#40).
2023-02-15 17:26:40 -08:00
Scott Lamb
015dfef9c9
fix #257
Apparently a `MenuItem` with a value of `undefined` is possible but
doesn't actually fire a change event. Strange. Use the string `"null"`
instead.
2023-02-13 11:05:27 -08:00
Scott Lamb
098b54c9f9
upgrade to react 18
* new root rendering api
* components are now allowed to return undefine
* testing library changes for userEvent.type
2023-01-11 22:25:56 -08:00
Scott Lamb
fbb5e6b266
upgrade typescript and msw 2023-01-11 20:55:38 -08:00
Scott Lamb
f827c0647a
npm update 2023-01-11 20:46:59 -08:00
Scott Lamb
58e19265ef
use react-hook-form-mui for AddEditDialog too 2023-01-11 14:54:18 -08:00
Scott Lamb
dc9c62e8bb
react-hook-form-mui in ChangePassword 2023-01-09 17:16:05 -08:00
Scott Lamb
dac0f44ed8
user admin UI 2023-01-08 03:30:53 -06:00
Scott Lamb
a4bc7f5218
config file reference and doc reorganization 2023-01-06 14:25:13 -06:00
Scott Lamb
a6bdf0bd80
change password dialog in UI 2022-12-27 23:28:42 -05:00
Scott Lamb
918bb05d40 update @types/node 2022-10-03 21:18:49 -07:00
Scott Lamb
96e6cbfd5f update typescript and msw
No problems seen so far.

msw version 0.46.0 is advertised as supporting ts v4.8, so I updated
them together, even though tests seemed to pass without the msw update.
2022-10-03 21:15:28 -07:00
Scott Lamb
d509d3ff40 update @mui/lab
This is now only used for LoadingButton.
2022-10-03 20:55:10 -07:00
Scott Lamb
1ad14007a5 ui: update date pickers 2022-10-03 20:51:39 -07:00
Scott Lamb
a614a8f559 update @mui/material and @mui/icons-material
This works much better with a working lockfile...
2022-10-03 17:59:28 -07:00
Scott Lamb
be9c2e5815 remake package-lock.json from scratch
This had stuff like
`node_modules/@babel/core/node_modules/@babel/code-frame` that I don't
think is right. I think the lockfile version upgrade went badly.
2022-10-03 17:56:49 -07:00
Scott Lamb
5738410bdc npx browserslist@latest --update-db 2022-10-03 08:29:11 -04:00
Scott Lamb
8d716bf4dd Stop using deprecated @mui/styles
I was struggling to upgrade the version of mui stuff (material and date
picker). I'm hoping getting rid of the deprecated stuff eases this a
bit.

I don't love that I can't just use sx on plain HTML stuff and have to
wrap it in Box, but oh well. Looks like I'm not alone, fwiw.
https://github.com/mui/material-ui/issues/23220
2022-10-03 08:29:11 -04:00
Scott Lamb
4addf3c90c npm upgrade 2022-03-16 15:46:42 -07:00
Scott Lamb
3c1171e405 link to JS equality rules 2022-03-07 13:48:47 -08:00
Scott Lamb
93792fcc57 better document TimerangeSelector
I haven't figured out how to expose its state in the URL (for #202),
but documenting how it works today seems like a good first step.
2022-03-07 13:13:32 -08:00
Scott Lamb
08109d61ce clean up App.tsx
This structure (described in
https://github.com/scottlamb/moonfire-nvr/issues/202#issue-1161741347)
has less activity-specific logic in App.tsx itself and avoids duplicate
route handling.

This fixes the `No routes matched location "/"` mentioned in #202.
2022-03-07 11:55:44 -08:00
Scott Lamb
782eb2f0d8 add some URL parameters for the list view
This is still missing the time range, which is more complex than the
others. Small steps.
2022-03-04 15:21:37 -08:00
Scott Lamb
bcc59e9109 plumb more api response through to list view
This keeps a coarser-grained `toplevel` property rather than `user`
and `session`. It also synthesizes a `streams` field within it with ids.
This makes it easier to put the streams in the URL by id.
2022-03-04 12:03:47 -08:00
Scott Lamb
90c9a31ad0 upgrade almost all frontend deps
typescript isn't at the latest because eslint warns about it.
2022-03-04 08:55:06 -08:00
Scott Lamb
274dc09ec3 upgrade typescript to 4.5.5
I found one significant breaking change: caught exceptions are now
unknown rather than any. Rework the error handling a bit to match.
2022-03-03 14:49:14 -08:00
Scott Lamb
a82453e73a upgrade to create-react-scripts v5
I had to disable more of the Login tests to get this to work.
Frustrating, but I just can't figure out how to fake jest timers,
msw, and the testing libraries to all get along anymore.
2022-03-03 14:39:08 -08:00
Scott Lamb
8a65a09c7f upgrade msw version 2022-03-03 12:56:46 -08:00
Scott Lamb
bc29e8b23c fix eslint 8 complaints
I'm working on this upgrade now.
https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/prefer-presence-queries.md
2022-03-03 12:37:39 -08:00
Scott Lamb
d40715c210 fix some type errors in VideoList.test.tsx
For whatever reason, these aren't caught in my current setup. I'm trying
to upgrade the whole frontend mess (typescript version, react-scripts
version) and they're caught then.
2022-03-03 12:28:27 -08:00
Damian Krysta
e90d804f1a FIX build - add OR empty string
Signed-off-by: Damian Krysta <damian@krysta.dev>
2022-03-02 10:07:46 -08:00
Damian Krysta
4d3d72c7b5 EDIT - remove or condition
Signed-off-by: Damian Krysta <damian@krysta.dev>
2022-03-02 10:07:46 -08:00
Damian Krysta
f8ff07d2ad EDIT Multiview - fix none in cam selector
Signed-off-by: Damian Krysta <damian@krysta.dev>
2022-03-02 10:07:46 -08:00
Damian Krysta
41dfae336e EDIT - Run prettier
Signed-off-by: Damian Krysta <damian@krysta.dev>
2022-03-02 10:07:46 -08:00
Damian Krysta
28208b7bb4 CHANGE router type
Signed-off-by: Damian Krysta <damian@krysta.dev>
2022-03-02 10:07:46 -08:00
Damian Krysta
3240c20eae FIX tests
Signed-off-by: Damian Krysta <damian@krysta.dev>
2022-03-02 10:07:46 -08:00
Damian Krysta
56918bf5c2 Add store in url for layout and all cameras
Signed-off-by: Damian Krysta <damian@krysta.dev>
2022-03-02 10:07:46 -08:00
Damian Krysta
552f6bf19d FIX lint
Signed-off-by: Damian Krysta <damian@krysta.dev>
2022-03-02 10:07:46 -08:00
Damian Krysta
3988c3922d ADD set search param after selected cam
Signed-off-by: Damian Krysta <damian@krysta.dev>
2022-03-02 10:07:46 -08:00
Damian Krysta
2d517c28dc ADD react router and reading from query params
Signed-off-by: Damian Krysta <damian@krysta.dev>
2022-03-02 10:07:46 -08:00
dependabot[bot]
c9b1e49f3d Bump url-parse from 1.5.3 to 1.5.10 in /ui
Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.5.3 to 1.5.10.
- [Release notes](https://github.com/unshiftio/url-parse/releases)
- [Commits](https://github.com/unshiftio/url-parse/compare/1.5.3...1.5.10)

---
updated-dependencies:
- dependency-name: url-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-02 09:22:42 -08:00