Commit Graph
34 Commits
Author SHA1 Message Date
David Lechner 65e5627568 update to blueprintjs 5.x 2023-06-28 14:42:55 -05:00
David Lechner bf4670b25d update to react 18
We were stuck on react 16.x for a long time but dependencies seem to
have caught up enough that migration is trivial now.
2023-05-17 16:33:47 -05:00
David Lechner 2f5d11b648 LicenseDialog: fix console errors in tests
useFetch() was trying to actually fetch the license file and mocking
fetch() caused errors about not wrapping code in act(). So instead,
we can avoid all errors by just mocking useFetch() instead.
2023-03-10 18:16:27 -06:00
David Lechner d88ce8998f test: wrap all user calls in act()
Some user events trigger react dom changes. These need to be wrapped in
act() to avoid a warning printed to the console. To be save, we wrap
all instances.
2023-03-10 18:16:27 -06:00
David Lechner c84afea181 style: make use of more blueprint styles
https://blueprintjs.com/docs/#core/typography

Also fix wrapping license text while we are touching this.
2022-07-27 16:55:46 -05:00
David Lechner d6df128860 i18n: use automatic type inference of translation keys
Finally figured out a way to make typescript strongly type translation
keys so we can avoid the tedium of creating enums of translation keys.
2022-07-22 13:48:50 -05:00
David Lechner d891d349f6 licenses: convert tree to list
This migrates the list of packages from using react-complex-tree to
react-aria since it is a list rather than a tree.
2022-06-15 12:03:29 -05:00
David Lechner fc6d20f5e3 fix breaking change in react-complex-tree 2022-06-03 12:08:23 -05:00
David Lechner 883807b4b4 fix breaking changes for user-event v14 2022-06-02 18:45:28 -05:00
David Lechner a3e55c828a move useI18n to i18n.ts
Since we are using the react-i18n babel loader plugin, useI18n can only
be used once per file. Also we have to remember to add the istanbul
ignore next comment each time we use it. By moving this to a common
file, it can be easily copied and pasted when a new submodule is
created and we don't have to remember the rules when calling it.
2022-05-21 13:57:58 -05:00
David Lechner ef7f6d15c4 improve focus styles 2022-05-16 21:59:58 -05:00
David Lechner 65623f801d update for breaking blueprintjs style changes
it is no longer feasible to build the blueprintjs css ourselves, so we
just use all of the default variable values and override things using
selectors instead.
2022-05-11 18:13:36 -05:00
David Lechner 7cb0cf3151 test: clean up restoreAllMocks()
clearAllMocks() does not remove mock implementations, so we need to be
using restoreAllMocks() instead. Also ensure that it is called first
in case the other cleanup code needs to call a mocked function.
2022-04-04 15:51:57 -05:00
David Lechner f36e774d1e coverage: ignore useI18n 2022-03-25 15:54:04 -05:00
David Lechner 9f254f035f i18n: use babel-loader plugin 2022-03-25 15:54:04 -05:00
David Lechner 7abdcf85e7 LicenseDialog: make license list keyboard accessible 2022-03-19 21:20:02 -05:00
David Lechner aafdca3991 typo 2022-03-16 10:25:08 -05:00
David Lechner 644ac4cb5e licenses/LicenseDialog: use Tree instead of ButtonGroup 2022-03-15 20:13:49 -05:00
David Lechner 57cd40d9dd licenses: finish NonIdealState TODO 2022-03-15 18:49:12 -05:00
David Lechner d1090d01d6 licenses: replace sagas/reducers with useFetch hook 2022-03-15 18:37:06 -05:00
David Lechner 8e4045449c src: use prop unpacking pattern
This makes the code a bit shorter by not having to use `props.` all of
the time. Also make everything VoidFunctionComponent while we are
touching this.
2022-03-12 16:07:31 -06:00
David Lechner 31fb3b9e4c test: drop state from AsyncSaga constructor params
This uses the real rootReducer to populate the initial state in the test
AsyncSaga. This way we don't have to populate default values. Since it
isn't used often, we can omit the parameter and just call the updateState()
method after creating the object if modifications are needed.
2022-03-11 16:04:09 -06:00
David Lechner 80219d297f licenses/reducers: use ReadonlyArray
This helps protect against mistakes in future changes.
2022-03-01 12:00:29 -06:00
David Lechner 9641898a75 actions: refactor actions
The pattern we were using for actions required actions to be defined in
three places, an enum member containing the type string, an type
definition and a function. This combines all three of these into one by
using a helper function based on the ideas from [1].

[1]: https://phryneas.de/redux-typescript-no-discriminating-union
2022-02-25 17:58:30 -06:00
David Lechner cf8744a6cd actions: drop typed dispatch
This doesn't provide much benefit and is just one more rule to remember,
so we can do without it.
2022-02-24 17:16:52 -06:00
David Lechner 54ec447061 actions: added typed useDispatch() hook 2021-12-27 18:01:51 -06:00
David Lechner 8d26f768bf reducers: use typed useSelector hook
This refactors the code to use a typed useSelector() hook.
2021-12-27 17:48:41 -06:00
David Lechner a58b30ed07 licenses: convert LicenseDialog to functions 2021-12-27 12:38:50 -06:00
David Lechner 205937fdc3 add changelog link to about dialog 2021-06-08 14:52:44 -05:00
David Lechner ec6753c314 yarn lint
rules seem to have changed a bit after upgrading packages
2021-05-11 12:45:43 -05:00
David Lechner 922dee31c2 add tests for licenses reducers 2021-02-01 10:26:05 -06:00
David Lechner 89523b3915 make license dialog state local 2021-02-01 10:26:05 -06:00
David Lechner e5073399a0 drop explicit state interfaces
This could cause subtle bugs like the one fixed here where license
was renamed to licenses.
2021-02-01 10:26:05 -06:00
David Lechner 6f204a65f6 reorganize src/ directory
Makes for much less scrolling/jumping around.

https://redux.js.org/style-guide/style-guide#structure-files-as-feature-folders-or-ducks
2021-02-01 10:26:05 -06:00