Type fixes

pull/938/head
Rick Carlino 2018-07-27 12:48:59 -05:00
parent dca2ffab86
commit 91c2048913
8 changed files with 15 additions and 25 deletions

View File

@ -76,7 +76,7 @@
"react-router": "^3",
"react-test-renderer": "16.4.1",
"react-transition-group": "^2.3.1",
"redux": "^3.7.2",
"redux": "4.0.0",
"redux-immutable-state-invariant": "^2.1.0",
"redux-thunk": "2.3.0",
"rollbar-sourcemap-webpack-plugin": "^2.3.0",

View File

@ -1,6 +1,6 @@
I hope that we can someday not use this folder and use all the @types/* repositories.
Some (legacy) libraries don't work with the newer typings (eg: Karma).
Some (legacy) libraries don't work with the newer typings (eg: react-redux).
In those rare circumstances, we can put them in here.

View File

@ -38,7 +38,7 @@ describe("AJAX data tracking", () => {
it("sets consistency when calling destroy()", () => {
const uuid = store.getState().resources.index.byKind.Tool[0];
store.dispatch(destroy(uuid));
store.dispatch(destroy(uuid) as any);
expect(maybeStartTracking).toHaveBeenCalled();
});
@ -47,7 +47,7 @@ describe("AJAX data tracking", () => {
x.specialStatus = SpecialStatus.DIRTY;
return x;
});
store.dispatch(saveAll(r));
store.dispatch(saveAll(r) as any);
expect(maybeStartTracking).toHaveBeenCalled();
const uuids: string[] =
_.uniq((maybeStartTracking as jest.Mock).mock.calls
@ -57,7 +57,7 @@ describe("AJAX data tracking", () => {
it("sets consistency when calling initSave()", () => {
mockBody = resources()[0].body;
store.dispatch(initSave(resources()[0]));
store.dispatch(initSave(resources()[0]) as any);
expect(maybeStartTracking).toHaveBeenCalled();
});
});

View File

@ -28,7 +28,7 @@ export function setBoolViaRedux(key: BooleanConfigKey, val: boolean) {
const conf = getWebAppConfig(store.getState().resources.index);
if (conf) {
store.dispatch(edit(conf, { [key]: val }));
store.dispatch(save(conf.uuid));
store.dispatch(save(conf.uuid) as any);
}
return val;
}
@ -44,7 +44,7 @@ export function setNumViaRedux(key: NumberConfigKey, val: number): number {
const conf = getWebAppConfig(store.getState().resources.index);
if (conf) {
store.dispatch(edit(conf, { [key]: val }));
store.dispatch(save(conf.uuid));
store.dispatch(save(conf.uuid) as any);
}
return val;
}

View File

@ -2,7 +2,6 @@ import { fakeState } from "../../__test_support__/fake_state";
import { versionChangeMiddleware } from "../version_tracker_middleware";
import { buildResourceIndex, fakeDevice } from "../../__test_support__/resource_index_builder";
import { MiddlewareAPI } from "redux";
import { Everything } from "../../interfaces";
describe("version tracker middleware", () => {
it("Calls Rollbar.configure", () => {
@ -10,7 +9,7 @@ describe("version tracker middleware", () => {
window.Rollbar = { configure: jest.fn() };
const state = fakeState();
state.resources = buildResourceIndex([fakeDevice()]);
type Mw = MiddlewareAPI<Everything>;
type Mw = MiddlewareAPI<any>;
const fakeStore: Partial<Mw> = {
getState: () => state
};

View File

@ -3,7 +3,7 @@ import { determineInstalledOsVersion, MinVersionOverride } from "../util/index";
import { maybeGetDevice } from "../resources/selectors";
import { MW } from "./middlewares";
import { Everything } from "../interfaces";
import { Store } from "redux";
import { Store, Action } from "redux";
import { Dispatch } from "redux";
import { createReminderFn } from "./upgrade_reminder";
@ -19,7 +19,7 @@ function getVersionFromState(state: Everything) {
const fn: MW =
(store: Store<Everything>) =>
(dispatch: Dispatch<object>) =>
(dispatch: Dispatch<Action<object>>) =>
(action: any) => {
const fbos = getVersionFromState(store.getState());
window.Rollbar && window.Rollbar.configure({ payload: { fbos } });

View File

@ -16,7 +16,7 @@ interface RootComponentProps { store: Store; }
export const attachAppToDom: Callback = () => {
attachToRoot(RootComponent, { store: _store });
_store.dispatch(ready());
_store.dispatch(ready() as any);
};
export class RootComponent extends React.Component<RootComponentProps, {}> {

View File

@ -4289,7 +4289,7 @@ locate-path@^3.0.0:
p-locate "^3.0.0"
path-exists "^3.0.0"
lodash-es@^4.17.5, lodash-es@^4.2.1:
lodash-es@^4.17.5:
version "4.17.10"
resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.10.tgz#62cd7104cdf5dd87f235a837f0ede0e8e5117e05"
@ -4345,7 +4345,7 @@ lodash.uniq@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"
lodash@4.17.10, lodash@^4.0.0, lodash@^4.0.1, lodash@^4.13.1, lodash@^4.15.0, lodash@^4.17.10, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.1, lodash@^4.3.0, lodash@~4.17.4:
lodash@4.17.10, lodash@^4.0.0, lodash@^4.0.1, lodash@^4.13.1, lodash@^4.15.0, lodash@^4.17.10, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.3.0, lodash@~4.17.4:
version "4.17.10"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7"
@ -6090,16 +6090,7 @@ redux-thunk@2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/redux-thunk/-/redux-thunk-2.3.0.tgz#51c2c19a185ed5187aaa9a2d08b666d0d6467622"
redux@^3.7.2:
version "3.7.2"
resolved "https://registry.yarnpkg.com/redux/-/redux-3.7.2.tgz#06b73123215901d25d065be342eb026bc1c8537b"
dependencies:
lodash "^4.2.1"
lodash-es "^4.2.1"
loose-envify "^1.1.0"
symbol-observable "^1.0.3"
redux@^4.0.0:
redux@4.0.0, redux@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/redux/-/redux-4.0.0.tgz#aa698a92b729315d22b34a0553d7e6533555cc03"
dependencies:
@ -6916,7 +6907,7 @@ svgo@^1.0.0:
unquote "~1.1.1"
util.promisify "~1.0.0"
symbol-observable@^1.0.3, symbol-observable@^1.2.0:
symbol-observable@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804"