diff --git a/flow-typed/npm/@dhis2/app-runtime_vx.x.x.js b/flow-typed/npm/@dhis2/app-runtime_vx.x.x.js index e79403168e..85c440d7aa 100644 --- a/flow-typed/npm/@dhis2/app-runtime_vx.x.x.js +++ b/flow-typed/npm/@dhis2/app-runtime_vx.x.x.js @@ -1,5 +1,5 @@ -// flow-typed signature: 4ec574b3692d6473e61b486d24627884 -// flow-typed version: <>/@dhis2/app-runtime_v^2.0.4/flow_v0.127.0 +// flow-typed signature: 3910b305da3bfe25f2baf70df7de7c09 +// flow-typed version: <>/@dhis2/app-runtime_v^2.2.2/flow_v0.127.0 /** * This is an autogenerated libdef stub for: diff --git a/flow-typed/npm/@dhis2/ui-widgets_vx.x.x.js b/flow-typed/npm/@dhis2/ui-widgets_vx.x.x.js index 79238838f4..2d3b7e83d2 100644 --- a/flow-typed/npm/@dhis2/ui-widgets_vx.x.x.js +++ b/flow-typed/npm/@dhis2/ui-widgets_vx.x.x.js @@ -1,4 +1,4 @@ -// flow-typed signature: 591553bf8aad49d4d9911513100f03ea +// flow-typed signature: 1bea3f59a710f19b7854040438211809 // flow-typed version: <>/@dhis2/ui-widgets_v^2.0.3/flow_v0.127.0 /** @@ -22,23 +22,103 @@ declare module '@dhis2/ui-widgets' { * require those files directly. Feel free to delete any files that aren't * needed. */ -declare module '@dhis2/ui-widgets/build/cjs/lib' { +declare module '@dhis2/ui-widgets/build/cjs/HeaderBar' { declare module.exports: any; } -declare module '@dhis2/ui-widgets/build/docs/main.16c27494b5840c9e457b.bundle' { +declare module '@dhis2/ui-widgets/build/cjs/HeaderBar/Apps' { declare module.exports: any; } -declare module '@dhis2/ui-widgets/build/docs/main.1e11b83ef734cf811c21.bundle' { +declare module '@dhis2/ui-widgets/build/cjs/HeaderBar/ImageIcon' { declare module.exports: any; } -declare module '@dhis2/ui-widgets/build/docs/precache-manifest.292cca89d870e936e99a7f6e74f915ba' { +declare module '@dhis2/ui-widgets/build/cjs/HeaderBar/Logo' { declare module.exports: any; } -declare module '@dhis2/ui-widgets/build/docs/runtime~main.1e11b83ef734cf811c21.bundle' { +declare module '@dhis2/ui-widgets/build/cjs/HeaderBar/LogoImage' { + declare module.exports: any; +} + +declare module '@dhis2/ui-widgets/build/cjs/HeaderBar/NotificationIcon' { + declare module.exports: any; +} + +declare module '@dhis2/ui-widgets/build/cjs/HeaderBar/Notifications' { + declare module.exports: any; +} + +declare module '@dhis2/ui-widgets/build/cjs/HeaderBar/Profile' { + declare module.exports: any; +} + +declare module '@dhis2/ui-widgets/build/cjs/HeaderBar/Profile/ProfileHeader' { + declare module.exports: any; +} + +declare module '@dhis2/ui-widgets/build/cjs/HeaderBar/Profile/ProfileMenu' { + declare module.exports: any; +} + +declare module '@dhis2/ui-widgets/build/cjs/HeaderBar/TextIcon' { + declare module.exports: any; +} + +declare module '@dhis2/ui-widgets/build/cjs/HeaderBar/Title' { + declare module.exports: any; +} + +declare module '@dhis2/ui-widgets/build/cjs/icons/Account' { + declare module.exports: any; +} + +declare module '@dhis2/ui-widgets/build/cjs/icons/Apps' { + declare module.exports: any; +} + +declare module '@dhis2/ui-widgets/build/cjs/icons/Cancel' { + declare module.exports: any; +} + +declare module '@dhis2/ui-widgets/build/cjs/icons/Email' { + declare module.exports: any; +} + +declare module '@dhis2/ui-widgets/build/cjs/icons/Exit' { + declare module.exports: any; +} + +declare module '@dhis2/ui-widgets/build/cjs/icons/Help' { + declare module.exports: any; +} + +declare module '@dhis2/ui-widgets/build/cjs/icons/Info' { + declare module.exports: any; +} + +declare module '@dhis2/ui-widgets/build/cjs/icons/Message' { + declare module.exports: any; +} + +declare module '@dhis2/ui-widgets/build/cjs/icons/Settings' { + declare module.exports: any; +} + +declare module '@dhis2/ui-widgets/build/cjs' { + declare module.exports: any; +} + +declare module '@dhis2/ui-widgets/build/cjs/locales' { + declare module.exports: any; +} + +declare module '@dhis2/ui-widgets/build/docs/main.7c4f2415070fdb7a2c2e.bundle' { + declare module.exports: any; +} + +declare module '@dhis2/ui-widgets/build/docs/main.ef6876ec1eae4a6e1fbf.bundle' { declare module.exports: any; } @@ -46,57 +126,283 @@ declare module '@dhis2/ui-widgets/build/docs/runtime~main.3e80324d580cf3681712.b declare module.exports: any; } +declare module '@dhis2/ui-widgets/build/docs/runtime~main.ef6876ec1eae4a6e1fbf.bundle' { + declare module.exports: any; +} + declare module '@dhis2/ui-widgets/build/docs/sb_dll/storybook_ui_dll' { declare module.exports: any; } -declare module '@dhis2/ui-widgets/build/docs/service-worker' { +declare module '@dhis2/ui-widgets/build/docs/vendors~main.b29c49ca2442945bba0e.bundle' { + declare module.exports: any; +} + +declare module '@dhis2/ui-widgets/build/docs/vendors~main.ef6876ec1eae4a6e1fbf.bundle' { + declare module.exports: any; +} + +declare module '@dhis2/ui-widgets/build/es/HeaderBar' { + declare module.exports: any; +} + +declare module '@dhis2/ui-widgets/build/es/HeaderBar/Apps' { + declare module.exports: any; +} + +declare module '@dhis2/ui-widgets/build/es/HeaderBar/ImageIcon' { + declare module.exports: any; +} + +declare module '@dhis2/ui-widgets/build/es/HeaderBar/Logo' { + declare module.exports: any; +} + +declare module '@dhis2/ui-widgets/build/es/HeaderBar/LogoImage' { + declare module.exports: any; +} + +declare module '@dhis2/ui-widgets/build/es/HeaderBar/NotificationIcon' { + declare module.exports: any; +} + +declare module '@dhis2/ui-widgets/build/es/HeaderBar/Notifications' { + declare module.exports: any; +} + +declare module '@dhis2/ui-widgets/build/es/HeaderBar/Profile' { + declare module.exports: any; +} + +declare module '@dhis2/ui-widgets/build/es/HeaderBar/Profile/ProfileHeader' { + declare module.exports: any; +} + +declare module '@dhis2/ui-widgets/build/es/HeaderBar/Profile/ProfileMenu' { + declare module.exports: any; +} + +declare module '@dhis2/ui-widgets/build/es/HeaderBar/TextIcon' { + declare module.exports: any; +} + +declare module '@dhis2/ui-widgets/build/es/HeaderBar/Title' { + declare module.exports: any; +} + +declare module '@dhis2/ui-widgets/build/es/icons/Account' { + declare module.exports: any; +} + +declare module '@dhis2/ui-widgets/build/es/icons/Apps' { declare module.exports: any; } -declare module '@dhis2/ui-widgets/build/docs/vendors~main.1e11b83ef734cf811c21.bundle' { +declare module '@dhis2/ui-widgets/build/es/icons/Cancel' { declare module.exports: any; } -declare module '@dhis2/ui-widgets/build/docs/vendors~main.a23e29d582cdff4715fe.bundle' { +declare module '@dhis2/ui-widgets/build/es/icons/Email' { declare module.exports: any; } -declare module '@dhis2/ui-widgets/build/es/lib' { +declare module '@dhis2/ui-widgets/build/es/icons/Exit' { + declare module.exports: any; +} + +declare module '@dhis2/ui-widgets/build/es/icons/Help' { + declare module.exports: any; +} + +declare module '@dhis2/ui-widgets/build/es/icons/Info' { + declare module.exports: any; +} + +declare module '@dhis2/ui-widgets/build/es/icons/Message' { + declare module.exports: any; +} + +declare module '@dhis2/ui-widgets/build/es/icons/Settings' { + declare module.exports: any; +} + +declare module '@dhis2/ui-widgets/build/es' { + declare module.exports: any; +} + +declare module '@dhis2/ui-widgets/build/es/locales' { declare module.exports: any; } // Filename aliases -declare module '@dhis2/ui-widgets/build/cjs/lib.js' { - declare module.exports: $Exports<'@dhis2/ui-widgets/build/cjs/lib'>; +declare module '@dhis2/ui-widgets/build/cjs/HeaderBar.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/cjs/HeaderBar'>; +} +declare module '@dhis2/ui-widgets/build/cjs/HeaderBar/Apps.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/cjs/HeaderBar/Apps'>; +} +declare module '@dhis2/ui-widgets/build/cjs/HeaderBar/ImageIcon.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/cjs/HeaderBar/ImageIcon'>; +} +declare module '@dhis2/ui-widgets/build/cjs/HeaderBar/Logo.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/cjs/HeaderBar/Logo'>; } -declare module '@dhis2/ui-widgets/build/docs/main.16c27494b5840c9e457b.bundle.js' { - declare module.exports: $Exports<'@dhis2/ui-widgets/build/docs/main.16c27494b5840c9e457b.bundle'>; +declare module '@dhis2/ui-widgets/build/cjs/HeaderBar/LogoImage.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/cjs/HeaderBar/LogoImage'>; } -declare module '@dhis2/ui-widgets/build/docs/main.1e11b83ef734cf811c21.bundle.js' { - declare module.exports: $Exports<'@dhis2/ui-widgets/build/docs/main.1e11b83ef734cf811c21.bundle'>; +declare module '@dhis2/ui-widgets/build/cjs/HeaderBar/NotificationIcon.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/cjs/HeaderBar/NotificationIcon'>; } -declare module '@dhis2/ui-widgets/build/docs/precache-manifest.292cca89d870e936e99a7f6e74f915ba.js' { - declare module.exports: $Exports<'@dhis2/ui-widgets/build/docs/precache-manifest.292cca89d870e936e99a7f6e74f915ba'>; +declare module '@dhis2/ui-widgets/build/cjs/HeaderBar/Notifications.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/cjs/HeaderBar/Notifications'>; } -declare module '@dhis2/ui-widgets/build/docs/runtime~main.1e11b83ef734cf811c21.bundle.js' { - declare module.exports: $Exports<'@dhis2/ui-widgets/build/docs/runtime~main.1e11b83ef734cf811c21.bundle'>; +declare module '@dhis2/ui-widgets/build/cjs/HeaderBar/Profile.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/cjs/HeaderBar/Profile'>; +} +declare module '@dhis2/ui-widgets/build/cjs/HeaderBar/Profile/ProfileHeader.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/cjs/HeaderBar/Profile/ProfileHeader'>; +} +declare module '@dhis2/ui-widgets/build/cjs/HeaderBar/Profile/ProfileMenu.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/cjs/HeaderBar/Profile/ProfileMenu'>; +} +declare module '@dhis2/ui-widgets/build/cjs/HeaderBar/TextIcon.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/cjs/HeaderBar/TextIcon'>; +} +declare module '@dhis2/ui-widgets/build/cjs/HeaderBar/Title.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/cjs/HeaderBar/Title'>; +} +declare module '@dhis2/ui-widgets/build/cjs/icons/Account.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/cjs/icons/Account'>; +} +declare module '@dhis2/ui-widgets/build/cjs/icons/Apps.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/cjs/icons/Apps'>; +} +declare module '@dhis2/ui-widgets/build/cjs/icons/Cancel.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/cjs/icons/Cancel'>; +} +declare module '@dhis2/ui-widgets/build/cjs/icons/Email.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/cjs/icons/Email'>; +} +declare module '@dhis2/ui-widgets/build/cjs/icons/Exit.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/cjs/icons/Exit'>; +} +declare module '@dhis2/ui-widgets/build/cjs/icons/Help.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/cjs/icons/Help'>; +} +declare module '@dhis2/ui-widgets/build/cjs/icons/Info.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/cjs/icons/Info'>; +} +declare module '@dhis2/ui-widgets/build/cjs/icons/Message.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/cjs/icons/Message'>; +} +declare module '@dhis2/ui-widgets/build/cjs/icons/Settings.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/cjs/icons/Settings'>; +} +declare module '@dhis2/ui-widgets/build/cjs/index' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/cjs'>; +} +declare module '@dhis2/ui-widgets/build/cjs/index.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/cjs'>; +} +declare module '@dhis2/ui-widgets/build/cjs/locales/index' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/cjs/locales'>; +} +declare module '@dhis2/ui-widgets/build/cjs/locales/index.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/cjs/locales'>; +} +declare module '@dhis2/ui-widgets/build/docs/main.7c4f2415070fdb7a2c2e.bundle.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/docs/main.7c4f2415070fdb7a2c2e.bundle'>; +} +declare module '@dhis2/ui-widgets/build/docs/main.ef6876ec1eae4a6e1fbf.bundle.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/docs/main.ef6876ec1eae4a6e1fbf.bundle'>; } declare module '@dhis2/ui-widgets/build/docs/runtime~main.3e80324d580cf3681712.bundle.js' { declare module.exports: $Exports<'@dhis2/ui-widgets/build/docs/runtime~main.3e80324d580cf3681712.bundle'>; } +declare module '@dhis2/ui-widgets/build/docs/runtime~main.ef6876ec1eae4a6e1fbf.bundle.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/docs/runtime~main.ef6876ec1eae4a6e1fbf.bundle'>; +} declare module '@dhis2/ui-widgets/build/docs/sb_dll/storybook_ui_dll.js' { declare module.exports: $Exports<'@dhis2/ui-widgets/build/docs/sb_dll/storybook_ui_dll'>; } -declare module '@dhis2/ui-widgets/build/docs/service-worker.js' { - declare module.exports: $Exports<'@dhis2/ui-widgets/build/docs/service-worker'>; +declare module '@dhis2/ui-widgets/build/docs/vendors~main.b29c49ca2442945bba0e.bundle.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/docs/vendors~main.b29c49ca2442945bba0e.bundle'>; +} +declare module '@dhis2/ui-widgets/build/docs/vendors~main.ef6876ec1eae4a6e1fbf.bundle.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/docs/vendors~main.ef6876ec1eae4a6e1fbf.bundle'>; +} +declare module '@dhis2/ui-widgets/build/es/HeaderBar.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/es/HeaderBar'>; +} +declare module '@dhis2/ui-widgets/build/es/HeaderBar/Apps.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/es/HeaderBar/Apps'>; +} +declare module '@dhis2/ui-widgets/build/es/HeaderBar/ImageIcon.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/es/HeaderBar/ImageIcon'>; +} +declare module '@dhis2/ui-widgets/build/es/HeaderBar/Logo.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/es/HeaderBar/Logo'>; +} +declare module '@dhis2/ui-widgets/build/es/HeaderBar/LogoImage.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/es/HeaderBar/LogoImage'>; +} +declare module '@dhis2/ui-widgets/build/es/HeaderBar/NotificationIcon.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/es/HeaderBar/NotificationIcon'>; +} +declare module '@dhis2/ui-widgets/build/es/HeaderBar/Notifications.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/es/HeaderBar/Notifications'>; +} +declare module '@dhis2/ui-widgets/build/es/HeaderBar/Profile.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/es/HeaderBar/Profile'>; +} +declare module '@dhis2/ui-widgets/build/es/HeaderBar/Profile/ProfileHeader.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/es/HeaderBar/Profile/ProfileHeader'>; +} +declare module '@dhis2/ui-widgets/build/es/HeaderBar/Profile/ProfileMenu.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/es/HeaderBar/Profile/ProfileMenu'>; +} +declare module '@dhis2/ui-widgets/build/es/HeaderBar/TextIcon.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/es/HeaderBar/TextIcon'>; +} +declare module '@dhis2/ui-widgets/build/es/HeaderBar/Title.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/es/HeaderBar/Title'>; +} +declare module '@dhis2/ui-widgets/build/es/icons/Account.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/es/icons/Account'>; +} +declare module '@dhis2/ui-widgets/build/es/icons/Apps.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/es/icons/Apps'>; +} +declare module '@dhis2/ui-widgets/build/es/icons/Cancel.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/es/icons/Cancel'>; +} +declare module '@dhis2/ui-widgets/build/es/icons/Email.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/es/icons/Email'>; +} +declare module '@dhis2/ui-widgets/build/es/icons/Exit.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/es/icons/Exit'>; +} +declare module '@dhis2/ui-widgets/build/es/icons/Help.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/es/icons/Help'>; +} +declare module '@dhis2/ui-widgets/build/es/icons/Info.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/es/icons/Info'>; +} +declare module '@dhis2/ui-widgets/build/es/icons/Message.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/es/icons/Message'>; +} +declare module '@dhis2/ui-widgets/build/es/icons/Settings.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/es/icons/Settings'>; +} +declare module '@dhis2/ui-widgets/build/es/index' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/es'>; } -declare module '@dhis2/ui-widgets/build/docs/vendors~main.1e11b83ef734cf811c21.bundle.js' { - declare module.exports: $Exports<'@dhis2/ui-widgets/build/docs/vendors~main.1e11b83ef734cf811c21.bundle'>; +declare module '@dhis2/ui-widgets/build/es/index.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/es'>; } -declare module '@dhis2/ui-widgets/build/docs/vendors~main.a23e29d582cdff4715fe.bundle.js' { - declare module.exports: $Exports<'@dhis2/ui-widgets/build/docs/vendors~main.a23e29d582cdff4715fe.bundle'>; +declare module '@dhis2/ui-widgets/build/es/locales/index' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/es/locales'>; } -declare module '@dhis2/ui-widgets/build/es/lib.js' { - declare module.exports: $Exports<'@dhis2/ui-widgets/build/es/lib'>; +declare module '@dhis2/ui-widgets/build/es/locales/index.js' { + declare module.exports: $Exports<'@dhis2/ui-widgets/build/es/locales'>; } diff --git a/flow-typed/npm/connected-react-router_vx.x.x.js b/flow-typed/npm/connected-react-router_vx.x.x.js index 4bfffc3109..2e170bb798 100644 --- a/flow-typed/npm/connected-react-router_vx.x.x.js +++ b/flow-typed/npm/connected-react-router_vx.x.x.js @@ -1,5 +1,5 @@ -// flow-typed signature: 126ed1774b1cf79efaf3386bbfbec3d9 -// flow-typed version: <>/connected-react-router_v^6.4.0/flow_v0.127.0 +// flow-typed signature: 823558c9e3e460211681b657a5b49bf9 +// flow-typed version: <>/connected-react-router_v^6.6.1/flow_v0.127.0 /** * This is an autogenerated libdef stub for: diff --git a/flow-typed/npm/docdash_vx.x.x.js b/flow-typed/npm/docdash_vx.x.x.js index 343b928a8d..7784b4c08d 100644 --- a/flow-typed/npm/docdash_vx.x.x.js +++ b/flow-typed/npm/docdash_vx.x.x.js @@ -1,5 +1,5 @@ -// flow-typed signature: 4b33d9fc1652b8033f7af297050f773a -// flow-typed version: <>/docdash_v^1.1.1/flow_v0.127.0 +// flow-typed signature: c3c851442f1d82044dca830a910432c5 +// flow-typed version: <>/docdash_v^1.2.0/flow_v0.127.0 /** * This is an autogenerated libdef stub for: diff --git a/flow-typed/npm/eslint-config-airbnb_vx.x.x.js b/flow-typed/npm/eslint-config-airbnb_vx.x.x.js index 973a497dfc..f70b9478cf 100644 --- a/flow-typed/npm/eslint-config-airbnb_vx.x.x.js +++ b/flow-typed/npm/eslint-config-airbnb_vx.x.x.js @@ -1,5 +1,5 @@ -// flow-typed signature: 4c259b65be070ed582d03c794eaee6ee -// flow-typed version: <>/eslint-config-airbnb_v18.1.0/flow_v0.127.0 +// flow-typed signature: 0f696a8f8fc207e97b213b5c782b5072 +// flow-typed version: <>/eslint-config-airbnb_v^15.1.0/flow_v0.127.0 /** * This is an autogenerated libdef stub for: @@ -26,10 +26,6 @@ declare module 'eslint-config-airbnb/base' { declare module.exports: any; } -declare module 'eslint-config-airbnb/hooks' { - declare module.exports: any; -} - declare module 'eslint-config-airbnb/legacy' { declare module.exports: any; } @@ -38,18 +34,10 @@ declare module 'eslint-config-airbnb/rules/react-a11y' { declare module.exports: any; } -declare module 'eslint-config-airbnb/rules/react-hooks' { - declare module.exports: any; -} - declare module 'eslint-config-airbnb/rules/react' { declare module.exports: any; } -declare module 'eslint-config-airbnb/test/requires' { - declare module.exports: any; -} - declare module 'eslint-config-airbnb/test/test-base' { declare module.exports: any; } @@ -58,17 +46,10 @@ declare module 'eslint-config-airbnb/test/test-react-order' { declare module.exports: any; } -declare module 'eslint-config-airbnb/whitespace' { - declare module.exports: any; -} - // Filename aliases declare module 'eslint-config-airbnb/base.js' { declare module.exports: $Exports<'eslint-config-airbnb/base'>; } -declare module 'eslint-config-airbnb/hooks.js' { - declare module.exports: $Exports<'eslint-config-airbnb/hooks'>; -} declare module 'eslint-config-airbnb/index' { declare module.exports: $Exports<'eslint-config-airbnb'>; } @@ -81,21 +62,12 @@ declare module 'eslint-config-airbnb/legacy.js' { declare module 'eslint-config-airbnb/rules/react-a11y.js' { declare module.exports: $Exports<'eslint-config-airbnb/rules/react-a11y'>; } -declare module 'eslint-config-airbnb/rules/react-hooks.js' { - declare module.exports: $Exports<'eslint-config-airbnb/rules/react-hooks'>; -} declare module 'eslint-config-airbnb/rules/react.js' { declare module.exports: $Exports<'eslint-config-airbnb/rules/react'>; } -declare module 'eslint-config-airbnb/test/requires.js' { - declare module.exports: $Exports<'eslint-config-airbnb/test/requires'>; -} declare module 'eslint-config-airbnb/test/test-base.js' { declare module.exports: $Exports<'eslint-config-airbnb/test/test-base'>; } declare module 'eslint-config-airbnb/test/test-react-order.js' { declare module.exports: $Exports<'eslint-config-airbnb/test/test-react-order'>; } -declare module 'eslint-config-airbnb/whitespace.js' { - declare module.exports: $Exports<'eslint-config-airbnb/whitespace'>; -} diff --git a/flow-typed/npm/eslint-plugin-import_vx.x.x.js b/flow-typed/npm/eslint-plugin-import_vx.x.x.js index 885806faf1..cec186c71e 100644 --- a/flow-typed/npm/eslint-plugin-import_vx.x.x.js +++ b/flow-typed/npm/eslint-plugin-import_vx.x.x.js @@ -1,5 +1,5 @@ -// flow-typed signature: b7867b20624e1259fed8d4a04d6920a6 -// flow-typed version: <>/eslint-plugin-import_v^2.20.1/flow_v0.127.0 +// flow-typed signature: ca6aa07f7769b509858ec57714755c5f +// flow-typed version: <>/eslint-plugin-import_v2.7.0/flow_v0.127.0 /** * This is an autogenerated libdef stub for: @@ -46,10 +46,6 @@ declare module 'eslint-plugin-import/config/stage-0' { declare module.exports: any; } -declare module 'eslint-plugin-import/config/typescript' { - declare module.exports: any; -} - declare module 'eslint-plugin-import/config/warnings' { declare module.exports: any; } @@ -62,10 +58,6 @@ declare module 'eslint-plugin-import/lib/core/staticRequire' { declare module.exports: any; } -declare module 'eslint-plugin-import/lib/docsUrl' { - declare module.exports: any; -} - declare module 'eslint-plugin-import/lib/ExportMap' { declare module.exports: any; } @@ -82,18 +74,10 @@ declare module 'eslint-plugin-import/lib/rules/default' { declare module.exports: any; } -declare module 'eslint-plugin-import/lib/rules/dynamic-import-chunkname' { - declare module.exports: any; -} - declare module 'eslint-plugin-import/lib/rules/export' { declare module.exports: any; } -declare module 'eslint-plugin-import/lib/rules/exports-last' { - declare module.exports: any; -} - declare module 'eslint-plugin-import/lib/rules/extensions' { declare module.exports: any; } @@ -102,10 +86,6 @@ declare module 'eslint-plugin-import/lib/rules/first' { declare module.exports: any; } -declare module 'eslint-plugin-import/lib/rules/group-exports' { - declare module.exports: any; -} - declare module 'eslint-plugin-import/lib/rules/imports-first' { declare module.exports: any; } @@ -142,14 +122,6 @@ declare module 'eslint-plugin-import/lib/rules/no-commonjs' { declare module.exports: any; } -declare module 'eslint-plugin-import/lib/rules/no-cycle' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/rules/no-default-export' { - declare module.exports: any; -} - declare module 'eslint-plugin-import/lib/rules/no-deprecated' { declare module.exports: any; } @@ -186,10 +158,6 @@ declare module 'eslint-plugin-import/lib/rules/no-named-default' { declare module.exports: any; } -declare module 'eslint-plugin-import/lib/rules/no-named-export' { - declare module.exports: any; -} - declare module 'eslint-plugin-import/lib/rules/no-namespace' { declare module.exports: any; } @@ -198,18 +166,10 @@ declare module 'eslint-plugin-import/lib/rules/no-nodejs-modules' { declare module.exports: any; } -declare module 'eslint-plugin-import/lib/rules/no-relative-parent-imports' { - declare module.exports: any; -} - declare module 'eslint-plugin-import/lib/rules/no-restricted-paths' { declare module.exports: any; } -declare module 'eslint-plugin-import/lib/rules/no-self-import' { - declare module.exports: any; -} - declare module 'eslint-plugin-import/lib/rules/no-unassigned-import' { declare module.exports: any; } @@ -218,14 +178,6 @@ declare module 'eslint-plugin-import/lib/rules/no-unresolved' { declare module.exports: any; } -declare module 'eslint-plugin-import/lib/rules/no-unused-modules' { - declare module.exports: any; -} - -declare module 'eslint-plugin-import/lib/rules/no-useless-path-segments' { - declare module.exports: any; -} - declare module 'eslint-plugin-import/lib/rules/no-webpack-loader-syntax' { declare module.exports: any; } @@ -265,9 +217,6 @@ declare module 'eslint-plugin-import/config/recommended.js' { declare module 'eslint-plugin-import/config/stage-0.js' { declare module.exports: $Exports<'eslint-plugin-import/config/stage-0'>; } -declare module 'eslint-plugin-import/config/typescript.js' { - declare module.exports: $Exports<'eslint-plugin-import/config/typescript'>; -} declare module 'eslint-plugin-import/config/warnings.js' { declare module.exports: $Exports<'eslint-plugin-import/config/warnings'>; } @@ -277,9 +226,6 @@ declare module 'eslint-plugin-import/lib/core/importType.js' { declare module 'eslint-plugin-import/lib/core/staticRequire.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/core/staticRequire'>; } -declare module 'eslint-plugin-import/lib/docsUrl.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/docsUrl'>; -} declare module 'eslint-plugin-import/lib/ExportMap.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/ExportMap'>; } @@ -295,24 +241,15 @@ declare module 'eslint-plugin-import/lib/index.js' { declare module 'eslint-plugin-import/lib/rules/default.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/default'>; } -declare module 'eslint-plugin-import/lib/rules/dynamic-import-chunkname.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/dynamic-import-chunkname'>; -} declare module 'eslint-plugin-import/lib/rules/export.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/export'>; } -declare module 'eslint-plugin-import/lib/rules/exports-last.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/exports-last'>; -} declare module 'eslint-plugin-import/lib/rules/extensions.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/extensions'>; } declare module 'eslint-plugin-import/lib/rules/first.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/first'>; } -declare module 'eslint-plugin-import/lib/rules/group-exports.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/group-exports'>; -} declare module 'eslint-plugin-import/lib/rules/imports-first.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/imports-first'>; } @@ -340,12 +277,6 @@ declare module 'eslint-plugin-import/lib/rules/no-anonymous-default-export.js' { declare module 'eslint-plugin-import/lib/rules/no-commonjs.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-commonjs'>; } -declare module 'eslint-plugin-import/lib/rules/no-cycle.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-cycle'>; -} -declare module 'eslint-plugin-import/lib/rules/no-default-export.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-default-export'>; -} declare module 'eslint-plugin-import/lib/rules/no-deprecated.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-deprecated'>; } @@ -373,36 +304,21 @@ declare module 'eslint-plugin-import/lib/rules/no-named-as-default.js' { declare module 'eslint-plugin-import/lib/rules/no-named-default.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-named-default'>; } -declare module 'eslint-plugin-import/lib/rules/no-named-export.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-named-export'>; -} declare module 'eslint-plugin-import/lib/rules/no-namespace.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-namespace'>; } declare module 'eslint-plugin-import/lib/rules/no-nodejs-modules.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-nodejs-modules'>; } -declare module 'eslint-plugin-import/lib/rules/no-relative-parent-imports.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-relative-parent-imports'>; -} declare module 'eslint-plugin-import/lib/rules/no-restricted-paths.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-restricted-paths'>; } -declare module 'eslint-plugin-import/lib/rules/no-self-import.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-self-import'>; -} declare module 'eslint-plugin-import/lib/rules/no-unassigned-import.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-unassigned-import'>; } declare module 'eslint-plugin-import/lib/rules/no-unresolved.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-unresolved'>; } -declare module 'eslint-plugin-import/lib/rules/no-unused-modules.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-unused-modules'>; -} -declare module 'eslint-plugin-import/lib/rules/no-useless-path-segments.js' { - declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-useless-path-segments'>; -} declare module 'eslint-plugin-import/lib/rules/no-webpack-loader-syntax.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-webpack-loader-syntax'>; } diff --git a/flow-typed/npm/eslint-plugin-jsx-a11y_vx.x.x.js b/flow-typed/npm/eslint-plugin-jsx-a11y_vx.x.x.js index 7eddd8e022..cb90c55d89 100644 --- a/flow-typed/npm/eslint-plugin-jsx-a11y_vx.x.x.js +++ b/flow-typed/npm/eslint-plugin-jsx-a11y_vx.x.x.js @@ -1,5 +1,5 @@ -// flow-typed signature: 0bddc0500c12568817e83912cc5c59c2 -// flow-typed version: <>/eslint-plugin-jsx-a11y_v^6.2.3/flow_v0.127.0 +// flow-typed signature: c7b990041efdf1e9ba57815cb296a796 +// flow-typed version: <>/eslint-plugin-jsx-a11y_v^5.1.1/flow_v0.127.0 /** * This is an autogenerated libdef stub for: @@ -42,18 +42,6 @@ declare module 'eslint-plugin-jsx-a11y/__mocks__/JSXExpressionContainerMock' { declare module.exports: any; } -declare module 'eslint-plugin-jsx-a11y/__mocks__/JSXSpreadAttributeMock' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__mocks__/JSXTextMock' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__mocks__/LiteralMock' { - declare module.exports: any; -} - declare module 'eslint-plugin-jsx-a11y/__tests__/__util__/parserOptionsMapper' { declare module.exports: any; } @@ -106,11 +94,11 @@ declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/click-events-have-key declare module.exports: any; } -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/control-has-associated-label-test' { +declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/heading-has-content-test' { declare module.exports: any; } -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/heading-has-content-test' { +declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/href-no-hash-test' { declare module.exports: any; } @@ -130,10 +118,6 @@ declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/interactive-supports- declare module.exports: any; } -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/label-has-associated-control-test' { - declare module.exports: any; -} - declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/label-has-for-test' { declare module.exports: any; } @@ -210,18 +194,6 @@ declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/attributesComparator-t declare module.exports: any; } -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/getComputedRole-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/getExplicitRole-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/getImplicitRole-test' { - declare module.exports: any; -} - declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/getSuggestion-test' { declare module.exports: any; } @@ -234,30 +206,10 @@ declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/hasAccessibleChild-tes declare module.exports: any; } -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/implicitRoles/input-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/implicitRoles/menu-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/implicitRoles/menuitem-test' { - declare module.exports: any; -} - declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isAbstractRole-test' { declare module.exports: any; } -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isDisabledElement-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isDOMElement-test' { - declare module.exports: any; -} - declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isInteractiveElement-test' { declare module.exports: any; } @@ -274,27 +226,19 @@ declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isNonInteractiveRole-t declare module.exports: any; } -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isNonLiteralProperty-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isSemanticRoleElement-test' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/mayContainChildComponent-test' { +declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/parserOptionsMapper-test' { declare module.exports: any; } -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/mayHaveAccessibleLabel-test' { +declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/schemas-test' { declare module.exports: any; } -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/parserOptionsMapper-test' { +declare module 'eslint-plugin-jsx-a11y/flow/eslint-jsx' { declare module.exports: any; } -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/schemas-test' { +declare module 'eslint-plugin-jsx-a11y/flow/eslint' { declare module.exports: any; } @@ -342,11 +286,11 @@ declare module 'eslint-plugin-jsx-a11y/lib/rules/click-events-have-key-events' { declare module.exports: any; } -declare module 'eslint-plugin-jsx-a11y/lib/rules/control-has-associated-label' { +declare module 'eslint-plugin-jsx-a11y/lib/rules/heading-has-content' { declare module.exports: any; } -declare module 'eslint-plugin-jsx-a11y/lib/rules/heading-has-content' { +declare module 'eslint-plugin-jsx-a11y/lib/rules/href-no-hash' { declare module.exports: any; } @@ -366,10 +310,6 @@ declare module 'eslint-plugin-jsx-a11y/lib/rules/interactive-supports-focus' { declare module.exports: any; } -declare module 'eslint-plugin-jsx-a11y/lib/rules/label-has-associated-control' { - declare module.exports: any; -} - declare module 'eslint-plugin-jsx-a11y/lib/rules/label-has-for' { declare module.exports: any; } @@ -446,14 +386,6 @@ declare module 'eslint-plugin-jsx-a11y/lib/util/attributesComparator' { declare module.exports: any; } -declare module 'eslint-plugin-jsx-a11y/lib/util/getComputedRole' { - declare module.exports: any; -} - -declare module 'eslint-plugin-jsx-a11y/lib/util/getExplicitRole' { - declare module.exports: any; -} - declare module 'eslint-plugin-jsx-a11y/lib/util/getImplicitRole' { declare module.exports: any; } @@ -626,75 +558,395 @@ declare module 'eslint-plugin-jsx-a11y/lib/util/isAbstractRole' { declare module.exports: any; } -declare module 'eslint-plugin-jsx-a11y/lib/util/isDisabledElement' { +declare module 'eslint-plugin-jsx-a11y/lib/util/isHiddenFromScreenReader' { declare module.exports: any; } -declare module 'eslint-plugin-jsx-a11y/lib/util/isDOMElement' { +declare module 'eslint-plugin-jsx-a11y/lib/util/isInteractiveElement' { declare module.exports: any; } -declare module 'eslint-plugin-jsx-a11y/lib/util/isHiddenFromScreenReader' { +declare module 'eslint-plugin-jsx-a11y/lib/util/isInteractiveRole' { declare module.exports: any; } -declare module 'eslint-plugin-jsx-a11y/lib/util/isInteractiveElement' { +declare module 'eslint-plugin-jsx-a11y/lib/util/isNonInteractiveElement' { declare module.exports: any; } -declare module 'eslint-plugin-jsx-a11y/lib/util/isInteractiveRole' { +declare module 'eslint-plugin-jsx-a11y/lib/util/isNonInteractiveRole' { declare module.exports: any; } -declare module 'eslint-plugin-jsx-a11y/lib/util/isNonInteractiveElement' { +declare module 'eslint-plugin-jsx-a11y/lib/util/isPresentationRole' { declare module.exports: any; } -declare module 'eslint-plugin-jsx-a11y/lib/util/isNonInteractiveRole' { +declare module 'eslint-plugin-jsx-a11y/lib/util/schemas' { declare module.exports: any; } -declare module 'eslint-plugin-jsx-a11y/lib/util/isNonLiteralProperty' { +declare module 'eslint-plugin-jsx-a11y/scripts/addRuleToIndex' { declare module.exports: any; } -declare module 'eslint-plugin-jsx-a11y/lib/util/isPresentationRole' { +declare module 'eslint-plugin-jsx-a11y/scripts/boilerplate/doc' { declare module.exports: any; } -declare module 'eslint-plugin-jsx-a11y/lib/util/isSemanticRoleElement' { +declare module 'eslint-plugin-jsx-a11y/scripts/boilerplate/rule' { declare module.exports: any; } -declare module 'eslint-plugin-jsx-a11y/lib/util/mayContainChildComponent' { +declare module 'eslint-plugin-jsx-a11y/scripts/boilerplate/test' { declare module.exports: any; } -declare module 'eslint-plugin-jsx-a11y/lib/util/mayHaveAccessibleLabel' { +declare module 'eslint-plugin-jsx-a11y/scripts/create-rule' { declare module.exports: any; } -declare module 'eslint-plugin-jsx-a11y/lib/util/schemas' { +declare module 'eslint-plugin-jsx-a11y/src' { declare module.exports: any; } -declare module 'eslint-plugin-jsx-a11y/scripts/addRuleToIndex' { +declare module 'eslint-plugin-jsx-a11y/src/rules/accessible-emoji' { declare module.exports: any; } -declare module 'eslint-plugin-jsx-a11y/scripts/boilerplate/doc' { +declare module 'eslint-plugin-jsx-a11y/src/rules/alt-text' { declare module.exports: any; } -declare module 'eslint-plugin-jsx-a11y/scripts/boilerplate/rule' { +declare module 'eslint-plugin-jsx-a11y/src/rules/anchor-has-content' { declare module.exports: any; } -declare module 'eslint-plugin-jsx-a11y/scripts/boilerplate/test' { +declare module 'eslint-plugin-jsx-a11y/src/rules/anchor-is-valid' { declare module.exports: any; } -declare module 'eslint-plugin-jsx-a11y/scripts/create-rule' { +declare module 'eslint-plugin-jsx-a11y/src/rules/aria-activedescendant-has-tabindex' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/rules/aria-props' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/rules/aria-proptypes' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/rules/aria-role' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/rules/aria-unsupported-elements' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/rules/click-events-have-key-events' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/rules/heading-has-content' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/rules/href-no-hash' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/rules/html-has-lang' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/rules/iframe-has-title' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/rules/img-redundant-alt' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/rules/interactive-supports-focus' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/rules/label-has-for' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/rules/lang' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/rules/media-has-caption' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/rules/mouse-events-have-key-events' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/rules/no-access-key' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/rules/no-autofocus' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/rules/no-distracting-elements' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/rules/no-interactive-element-to-noninteractive-role' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/rules/no-noninteractive-element-interactions' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/rules/no-noninteractive-element-to-interactive-role' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/rules/no-noninteractive-tabindex' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/rules/no-onchange' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/rules/no-redundant-roles' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/rules/no-static-element-interactions' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/rules/role-has-required-aria-props' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/rules/role-supports-aria-props' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/rules/scope' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/rules/tabindex-no-positive' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/attributesComparator' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/getImplicitRole' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/getSuggestion' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/getTabIndex' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/hasAccessibleChild' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/a' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/area' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/article' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/aside' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/body' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/button' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/datalist' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/details' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/dialog' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/dl' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/form' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/h1' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/h2' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/h3' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/h4' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/h5' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/h6' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/hr' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/img' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/input' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/li' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/link' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/menu' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/menuitem' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/meter' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/nav' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/ol' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/option' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/output' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/progress' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/section' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/select' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/tbody' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/textarea' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/tfoot' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/thead' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/ul' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/isAbstractRole' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/isHiddenFromScreenReader' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/isInteractiveElement' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/isInteractiveRole' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/isNonInteractiveElement' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/isNonInteractiveRole' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/isPresentationRole' { + declare module.exports: any; +} + +declare module 'eslint-plugin-jsx-a11y/src/util/schemas' { declare module.exports: any; } @@ -714,15 +966,6 @@ declare module 'eslint-plugin-jsx-a11y/__mocks__/JSXElementMock.js' { declare module 'eslint-plugin-jsx-a11y/__mocks__/JSXExpressionContainerMock.js' { declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__mocks__/JSXExpressionContainerMock'>; } -declare module 'eslint-plugin-jsx-a11y/__mocks__/JSXSpreadAttributeMock.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__mocks__/JSXSpreadAttributeMock'>; -} -declare module 'eslint-plugin-jsx-a11y/__mocks__/JSXTextMock.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__mocks__/JSXTextMock'>; -} -declare module 'eslint-plugin-jsx-a11y/__mocks__/LiteralMock.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__mocks__/LiteralMock'>; -} declare module 'eslint-plugin-jsx-a11y/__tests__/__util__/parserOptionsMapper.js' { declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/__util__/parserOptionsMapper'>; } @@ -762,12 +1005,12 @@ declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-unsupported-elem declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/click-events-have-key-events-test.js' { declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/click-events-have-key-events-test'>; } -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/control-has-associated-label-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/control-has-associated-label-test'>; -} declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/heading-has-content-test.js' { declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/heading-has-content-test'>; } +declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/href-no-hash-test.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/href-no-hash-test'>; +} declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/html-has-lang-test.js' { declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/html-has-lang-test'>; } @@ -780,9 +1023,6 @@ declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/img-redundant-alt-tes declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/interactive-supports-focus-test.js' { declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/interactive-supports-focus-test'>; } -declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/label-has-associated-control-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/label-has-associated-control-test'>; -} declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/label-has-for-test.js' { declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/label-has-for-test'>; } @@ -840,15 +1080,6 @@ declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/tabindex-no-positive- declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/attributesComparator-test.js' { declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/attributesComparator-test'>; } -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/getComputedRole-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/getComputedRole-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/getExplicitRole-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/getExplicitRole-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/getImplicitRole-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/getImplicitRole-test'>; -} declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/getSuggestion-test.js' { declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/getSuggestion-test'>; } @@ -858,24 +1089,9 @@ declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/getTabIndex-test.js' { declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/hasAccessibleChild-test.js' { declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/hasAccessibleChild-test'>; } -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/implicitRoles/input-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/implicitRoles/input-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/implicitRoles/menu-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/implicitRoles/menu-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/implicitRoles/menuitem-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/implicitRoles/menuitem-test'>; -} declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isAbstractRole-test.js' { declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/isAbstractRole-test'>; } -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isDisabledElement-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/isDisabledElement-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isDOMElement-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/isDOMElement-test'>; -} declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isInteractiveElement-test.js' { declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/isInteractiveElement-test'>; } @@ -888,24 +1104,18 @@ declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isNonInteractiveElemen declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isNonInteractiveRole-test.js' { declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/isNonInteractiveRole-test'>; } -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isNonLiteralProperty-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/isNonLiteralProperty-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isSemanticRoleElement-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/isSemanticRoleElement-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/mayContainChildComponent-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/mayContainChildComponent-test'>; -} -declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/mayHaveAccessibleLabel-test.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/mayHaveAccessibleLabel-test'>; -} declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/parserOptionsMapper-test.js' { declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/parserOptionsMapper-test'>; } declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/schemas-test.js' { declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/schemas-test'>; } +declare module 'eslint-plugin-jsx-a11y/flow/eslint-jsx.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/flow/eslint-jsx'>; +} +declare module 'eslint-plugin-jsx-a11y/flow/eslint.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/flow/eslint'>; +} declare module 'eslint-plugin-jsx-a11y/lib/index' { declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib'>; } @@ -942,12 +1152,12 @@ declare module 'eslint-plugin-jsx-a11y/lib/rules/aria-unsupported-elements.js' { declare module 'eslint-plugin-jsx-a11y/lib/rules/click-events-have-key-events.js' { declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/click-events-have-key-events'>; } -declare module 'eslint-plugin-jsx-a11y/lib/rules/control-has-associated-label.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/control-has-associated-label'>; -} declare module 'eslint-plugin-jsx-a11y/lib/rules/heading-has-content.js' { declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/heading-has-content'>; } +declare module 'eslint-plugin-jsx-a11y/lib/rules/href-no-hash.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/href-no-hash'>; +} declare module 'eslint-plugin-jsx-a11y/lib/rules/html-has-lang.js' { declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/html-has-lang'>; } @@ -960,9 +1170,6 @@ declare module 'eslint-plugin-jsx-a11y/lib/rules/img-redundant-alt.js' { declare module 'eslint-plugin-jsx-a11y/lib/rules/interactive-supports-focus.js' { declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/interactive-supports-focus'>; } -declare module 'eslint-plugin-jsx-a11y/lib/rules/label-has-associated-control.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/label-has-associated-control'>; -} declare module 'eslint-plugin-jsx-a11y/lib/rules/label-has-for.js' { declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/label-has-for'>; } @@ -1020,12 +1227,6 @@ declare module 'eslint-plugin-jsx-a11y/lib/rules/tabindex-no-positive.js' { declare module 'eslint-plugin-jsx-a11y/lib/util/attributesComparator.js' { declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/attributesComparator'>; } -declare module 'eslint-plugin-jsx-a11y/lib/util/getComputedRole.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/getComputedRole'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/getExplicitRole.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/getExplicitRole'>; -} declare module 'eslint-plugin-jsx-a11y/lib/util/getImplicitRole.js' { declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/getImplicitRole'>; } @@ -1158,12 +1359,6 @@ declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/ul.js' { declare module 'eslint-plugin-jsx-a11y/lib/util/isAbstractRole.js' { declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/isAbstractRole'>; } -declare module 'eslint-plugin-jsx-a11y/lib/util/isDisabledElement.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/isDisabledElement'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/isDOMElement.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/isDOMElement'>; -} declare module 'eslint-plugin-jsx-a11y/lib/util/isHiddenFromScreenReader.js' { declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/isHiddenFromScreenReader'>; } @@ -1179,21 +1374,9 @@ declare module 'eslint-plugin-jsx-a11y/lib/util/isNonInteractiveElement.js' { declare module 'eslint-plugin-jsx-a11y/lib/util/isNonInteractiveRole.js' { declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/isNonInteractiveRole'>; } -declare module 'eslint-plugin-jsx-a11y/lib/util/isNonLiteralProperty.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/isNonLiteralProperty'>; -} declare module 'eslint-plugin-jsx-a11y/lib/util/isPresentationRole.js' { declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/isPresentationRole'>; } -declare module 'eslint-plugin-jsx-a11y/lib/util/isSemanticRoleElement.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/isSemanticRoleElement'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/mayContainChildComponent.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/mayContainChildComponent'>; -} -declare module 'eslint-plugin-jsx-a11y/lib/util/mayHaveAccessibleLabel.js' { - declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/mayHaveAccessibleLabel'>; -} declare module 'eslint-plugin-jsx-a11y/lib/util/schemas.js' { declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/schemas'>; } @@ -1212,3 +1395,267 @@ declare module 'eslint-plugin-jsx-a11y/scripts/boilerplate/test.js' { declare module 'eslint-plugin-jsx-a11y/scripts/create-rule.js' { declare module.exports: $Exports<'eslint-plugin-jsx-a11y/scripts/create-rule'>; } +declare module 'eslint-plugin-jsx-a11y/src/index' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src'>; +} +declare module 'eslint-plugin-jsx-a11y/src/index.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src'>; +} +declare module 'eslint-plugin-jsx-a11y/src/rules/accessible-emoji.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/accessible-emoji'>; +} +declare module 'eslint-plugin-jsx-a11y/src/rules/alt-text.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/alt-text'>; +} +declare module 'eslint-plugin-jsx-a11y/src/rules/anchor-has-content.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/anchor-has-content'>; +} +declare module 'eslint-plugin-jsx-a11y/src/rules/anchor-is-valid.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/anchor-is-valid'>; +} +declare module 'eslint-plugin-jsx-a11y/src/rules/aria-activedescendant-has-tabindex.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/aria-activedescendant-has-tabindex'>; +} +declare module 'eslint-plugin-jsx-a11y/src/rules/aria-props.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/aria-props'>; +} +declare module 'eslint-plugin-jsx-a11y/src/rules/aria-proptypes.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/aria-proptypes'>; +} +declare module 'eslint-plugin-jsx-a11y/src/rules/aria-role.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/aria-role'>; +} +declare module 'eslint-plugin-jsx-a11y/src/rules/aria-unsupported-elements.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/aria-unsupported-elements'>; +} +declare module 'eslint-plugin-jsx-a11y/src/rules/click-events-have-key-events.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/click-events-have-key-events'>; +} +declare module 'eslint-plugin-jsx-a11y/src/rules/heading-has-content.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/heading-has-content'>; +} +declare module 'eslint-plugin-jsx-a11y/src/rules/href-no-hash.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/href-no-hash'>; +} +declare module 'eslint-plugin-jsx-a11y/src/rules/html-has-lang.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/html-has-lang'>; +} +declare module 'eslint-plugin-jsx-a11y/src/rules/iframe-has-title.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/iframe-has-title'>; +} +declare module 'eslint-plugin-jsx-a11y/src/rules/img-redundant-alt.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/img-redundant-alt'>; +} +declare module 'eslint-plugin-jsx-a11y/src/rules/interactive-supports-focus.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/interactive-supports-focus'>; +} +declare module 'eslint-plugin-jsx-a11y/src/rules/label-has-for.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/label-has-for'>; +} +declare module 'eslint-plugin-jsx-a11y/src/rules/lang.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/lang'>; +} +declare module 'eslint-plugin-jsx-a11y/src/rules/media-has-caption.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/media-has-caption'>; +} +declare module 'eslint-plugin-jsx-a11y/src/rules/mouse-events-have-key-events.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/mouse-events-have-key-events'>; +} +declare module 'eslint-plugin-jsx-a11y/src/rules/no-access-key.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/no-access-key'>; +} +declare module 'eslint-plugin-jsx-a11y/src/rules/no-autofocus.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/no-autofocus'>; +} +declare module 'eslint-plugin-jsx-a11y/src/rules/no-distracting-elements.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/no-distracting-elements'>; +} +declare module 'eslint-plugin-jsx-a11y/src/rules/no-interactive-element-to-noninteractive-role.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/no-interactive-element-to-noninteractive-role'>; +} +declare module 'eslint-plugin-jsx-a11y/src/rules/no-noninteractive-element-interactions.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/no-noninteractive-element-interactions'>; +} +declare module 'eslint-plugin-jsx-a11y/src/rules/no-noninteractive-element-to-interactive-role.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/no-noninteractive-element-to-interactive-role'>; +} +declare module 'eslint-plugin-jsx-a11y/src/rules/no-noninteractive-tabindex.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/no-noninteractive-tabindex'>; +} +declare module 'eslint-plugin-jsx-a11y/src/rules/no-onchange.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/no-onchange'>; +} +declare module 'eslint-plugin-jsx-a11y/src/rules/no-redundant-roles.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/no-redundant-roles'>; +} +declare module 'eslint-plugin-jsx-a11y/src/rules/no-static-element-interactions.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/no-static-element-interactions'>; +} +declare module 'eslint-plugin-jsx-a11y/src/rules/role-has-required-aria-props.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/role-has-required-aria-props'>; +} +declare module 'eslint-plugin-jsx-a11y/src/rules/role-supports-aria-props.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/role-supports-aria-props'>; +} +declare module 'eslint-plugin-jsx-a11y/src/rules/scope.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/scope'>; +} +declare module 'eslint-plugin-jsx-a11y/src/rules/tabindex-no-positive.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/tabindex-no-positive'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/attributesComparator.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/attributesComparator'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/getImplicitRole.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/getImplicitRole'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/getSuggestion.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/getSuggestion'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/getTabIndex.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/getTabIndex'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/hasAccessibleChild.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/hasAccessibleChild'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/a.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/a'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/area.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/area'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/article.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/article'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/aside.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/aside'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/body.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/body'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/button.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/button'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/datalist.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/datalist'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/details.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/details'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/dialog.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/dialog'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/dl.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/dl'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/form.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/form'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/h1.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/h1'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/h2.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/h2'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/h3.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/h3'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/h4.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/h4'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/h5.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/h5'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/h6.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/h6'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/hr.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/hr'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/img.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/img'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/index' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/index.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/input.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/input'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/li.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/li'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/link.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/link'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/menu.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/menu'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/menuitem.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/menuitem'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/meter.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/meter'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/nav.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/nav'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/ol.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/ol'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/option.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/option'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/output.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/output'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/progress.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/progress'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/section.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/section'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/select.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/select'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/tbody.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/tbody'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/textarea.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/textarea'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/tfoot.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/tfoot'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/thead.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/thead'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/ul.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/ul'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/isAbstractRole.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/isAbstractRole'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/isHiddenFromScreenReader.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/isHiddenFromScreenReader'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/isInteractiveElement.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/isInteractiveElement'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/isInteractiveRole.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/isInteractiveRole'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/isNonInteractiveElement.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/isNonInteractiveElement'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/isNonInteractiveRole.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/isNonInteractiveRole'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/isPresentationRole.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/isPresentationRole'>; +} +declare module 'eslint-plugin-jsx-a11y/src/util/schemas.js' { + declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/schemas'>; +} diff --git a/flow-typed/npm/redux-batched-actions_vx.x.x.js b/flow-typed/npm/redux-batched-actions_vx.x.x.js index f030ad90a1..1e488a055c 100644 --- a/flow-typed/npm/redux-batched-actions_vx.x.x.js +++ b/flow-typed/npm/redux-batched-actions_vx.x.x.js @@ -1,5 +1,5 @@ -// flow-typed signature: b9821dd34bb3912dfc680df323d57797 -// flow-typed version: <>/redux-batched-actions_v^0.2.1/flow_v0.127.0 +// flow-typed signature: bd5b24ba26368448c462385aa7a15cd0 +// flow-typed version: <>/redux-batched-actions_v^0.5.0/flow_v0.127.0 /** * This is an autogenerated libdef stub for: @@ -22,6 +22,10 @@ declare module 'redux-batched-actions' { * require those files directly. Feel free to delete any files that aren't * needed. */ +declare module 'redux-batched-actions/dist' { + declare module.exports: any; +} + declare module 'redux-batched-actions/lib' { declare module.exports: any; } @@ -31,6 +35,12 @@ declare module 'redux-batched-actions/test/index-test' { } // Filename aliases +declare module 'redux-batched-actions/dist/index' { + declare module.exports: $Exports<'redux-batched-actions/dist'>; +} +declare module 'redux-batched-actions/dist/index.js' { + declare module.exports: $Exports<'redux-batched-actions/dist'>; +} declare module 'redux-batched-actions/lib/index' { declare module.exports: $Exports<'redux-batched-actions/lib'>; } diff --git a/flow-typed/npm/redux-observable_vx.x.x.js b/flow-typed/npm/redux-observable_vx.x.x.js index 4b08952f9e..bfbaa4e6c7 100644 --- a/flow-typed/npm/redux-observable_vx.x.x.js +++ b/flow-typed/npm/redux-observable_vx.x.x.js @@ -1,5 +1,5 @@ -// flow-typed signature: 6e40d75d7800af5aaef8ed2087cf196b -// flow-typed version: <>/redux-observable_v^0.18.0/flow_v0.127.0 +// flow-typed signature: 8c3c4d89c44582c730b6c1da455689d8 +// flow-typed version: <>/redux-observable_v^1.2.0/flow_v0.127.0 /** * This is an autogenerated libdef stub for: @@ -42,15 +42,15 @@ declare module 'redux-observable/lib/cjs/createEpicMiddleware' { declare module.exports: any; } -declare module 'redux-observable/lib/cjs/EPIC_END' { +declare module 'redux-observable/lib/cjs' { declare module.exports: any; } -declare module 'redux-observable/lib/cjs' { +declare module 'redux-observable/lib/cjs/operators' { declare module.exports: any; } -declare module 'redux-observable/lib/cjs/operators' { +declare module 'redux-observable/lib/cjs/StateObservable' { declare module.exports: any; } @@ -70,15 +70,15 @@ declare module 'redux-observable/lib/esm/createEpicMiddleware' { declare module.exports: any; } -declare module 'redux-observable/lib/esm/EPIC_END' { +declare module 'redux-observable/lib/esm' { declare module.exports: any; } -declare module 'redux-observable/lib/esm' { +declare module 'redux-observable/lib/esm/operators' { declare module.exports: any; } -declare module 'redux-observable/lib/esm/operators' { +declare module 'redux-observable/lib/esm/StateObservable' { declare module.exports: any; } @@ -102,9 +102,6 @@ declare module 'redux-observable/lib/cjs/combineEpics.js' { declare module 'redux-observable/lib/cjs/createEpicMiddleware.js' { declare module.exports: $Exports<'redux-observable/lib/cjs/createEpicMiddleware'>; } -declare module 'redux-observable/lib/cjs/EPIC_END.js' { - declare module.exports: $Exports<'redux-observable/lib/cjs/EPIC_END'>; -} declare module 'redux-observable/lib/cjs/index' { declare module.exports: $Exports<'redux-observable/lib/cjs'>; } @@ -114,6 +111,9 @@ declare module 'redux-observable/lib/cjs/index.js' { declare module 'redux-observable/lib/cjs/operators.js' { declare module.exports: $Exports<'redux-observable/lib/cjs/operators'>; } +declare module 'redux-observable/lib/cjs/StateObservable.js' { + declare module.exports: $Exports<'redux-observable/lib/cjs/StateObservable'>; +} declare module 'redux-observable/lib/cjs/utils/console.js' { declare module.exports: $Exports<'redux-observable/lib/cjs/utils/console'>; } @@ -126,9 +126,6 @@ declare module 'redux-observable/lib/esm/combineEpics.js' { declare module 'redux-observable/lib/esm/createEpicMiddleware.js' { declare module.exports: $Exports<'redux-observable/lib/esm/createEpicMiddleware'>; } -declare module 'redux-observable/lib/esm/EPIC_END.js' { - declare module.exports: $Exports<'redux-observable/lib/esm/EPIC_END'>; -} declare module 'redux-observable/lib/esm/index' { declare module.exports: $Exports<'redux-observable/lib/esm'>; } @@ -138,6 +135,9 @@ declare module 'redux-observable/lib/esm/index.js' { declare module 'redux-observable/lib/esm/operators.js' { declare module.exports: $Exports<'redux-observable/lib/esm/operators'>; } +declare module 'redux-observable/lib/esm/StateObservable.js' { + declare module.exports: $Exports<'redux-observable/lib/esm/StateObservable'>; +} declare module 'redux-observable/lib/esm/utils/console.js' { declare module.exports: $Exports<'redux-observable/lib/esm/utils/console'>; } diff --git a/flow-typed/npm/rxjs_v5.0.x.js b/flow-typed/npm/rxjs_v5.0.x.js deleted file mode 100644 index 583054c134..0000000000 --- a/flow-typed/npm/rxjs_v5.0.x.js +++ /dev/null @@ -1,1652 +0,0 @@ -// flow-typed signature: 9f6489ad61e0a20a036bd8ec80ff6b03 -// flow-typed version: c6154227d1/rxjs_v5.0.x/flow_>=v0.104.x - -type rxjs$PartialObserver<-T> = - | { - +next: (value: T) => mixed, - +error?: (error: any) => mixed, - +complete?: () => mixed, - ... -} - | { - +next?: (value: T) => mixed, - +error: (error: any) => mixed, - +complete?: () => mixed, - ... -} - | { - +next?: (value: T) => mixed, - +error?: (error: any) => mixed, - +complete: () => mixed, - ... -}; - -declare interface rxjs$ISubscription { - unsubscribe(): void; -} - -type rxjs$TeardownLogic = rxjs$ISubscription | (() => void); - -type rxjs$EventListenerOptions = - | { - capture?: boolean, - passive?: boolean, - once?: boolean, - ... -} - | boolean; - -type rxjs$ObservableInput = rxjs$Observable | Promise | Iterable; - -type rxjs$OperatorFunction = (rxjs$Observable) => rxjs$Observable; -type rxjs$OperatorFunctionLast> = ( - rxjs$Observable -) => R; - -declare class rxjs$Observable<+T> { - static bindCallback( - callbackFunc: (callback: (_: void) => any) => any, - selector?: void, - scheduler?: rxjs$SchedulerClass - ): () => rxjs$Observable; - static bindCallback( - callbackFunc: (callback: (result: U) => any) => any, - selector?: void, - scheduler?: rxjs$SchedulerClass - ): () => rxjs$Observable; - static bindCallback( - callbackFunc: (v1: T, callback: (result: U) => any) => any, - selector?: void, - scheduler?: rxjs$SchedulerClass - ): (v1: T) => rxjs$Observable; - static bindCallback( - callbackFunc: (v1: T, v2: T2, callback: (result: U) => any) => any, - selector?: void, - scheduler?: rxjs$SchedulerClass - ): (v1: T, v2: T2) => rxjs$Observable; - static bindCallback( - callbackFunc: (v1: T, v2: T2, v3: T3, callback: (result: U) => any) => any, - selector?: void, - scheduler?: rxjs$SchedulerClass - ): (v1: T, v2: T2, v3: T3) => rxjs$Observable; - static bindCallback( - callbackFunc: ( - v1: T, - v2: T2, - v3: T3, - v4: T4, - callback: (result: U) => any - ) => any, - selector?: void, - scheduler?: rxjs$SchedulerClass - ): (v1: T, v2: T2, v3: T3, v4: T4) => rxjs$Observable; - static bindCallback( - callbackFunc: ( - v1: T, - v2: T2, - v3: T3, - v4: T4, - v5: T5, - callback: (result: U) => any - ) => any, - selector?: void, - scheduler?: rxjs$SchedulerClass - ): (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => rxjs$Observable; - static bindCallback( - callbackFunc: ( - v1: T, - v2: T2, - v3: T3, - v4: T4, - v5: T5, - v6: T6, - callback: (result: U) => any - ) => any, - selector?: void, - scheduler?: rxjs$SchedulerClass - ): (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6) => rxjs$Observable; - static bindCallback( - callbackFunc: (callback: (...args: Array) => any) => any, - selector: (...args: Array) => U, - scheduler?: rxjs$SchedulerClass - ): () => rxjs$Observable; - static bindCallback( - callbackFunc: (v1: T, callback: (...args: Array) => any) => any, - selector: (...args: Array) => U, - scheduler?: rxjs$SchedulerClass - ): (v1: T) => rxjs$Observable; - static bindCallback( - callbackFunc: ( - v1: T, - v2: T2, - callback: (...args: Array) => any - ) => any, - selector: (...args: Array) => U, - scheduler?: rxjs$SchedulerClass - ): (v1: T, v2: T2) => rxjs$Observable; - static bindCallback( - callbackFunc: ( - v1: T, - v2: T2, - v3: T3, - callback: (...args: Array) => any - ) => any, - selector: (...args: Array) => U, - scheduler?: rxjs$SchedulerClass - ): (v1: T, v2: T2, v3: T3) => rxjs$Observable; - static bindCallback( - callbackFunc: ( - v1: T, - v2: T2, - v3: T3, - v4: T4, - callback: (...args: Array) => any - ) => any, - selector: (...args: Array) => U, - scheduler?: rxjs$SchedulerClass - ): (v1: T, v2: T2, v3: T3, v4: T4) => rxjs$Observable; - static bindCallback( - callbackFunc: ( - v1: T, - v2: T2, - v3: T3, - v4: T4, - v5: T5, - callback: (...args: Array) => any - ) => any, - selector: (...args: Array) => U, - scheduler?: rxjs$SchedulerClass - ): (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => rxjs$Observable; - static bindCallback( - callbackFunc: ( - v1: T, - v2: T2, - v3: T3, - v4: T4, - v5: T5, - v6: T6, - callback: (...args: Array) => any - ) => any, - selector: (...args: Array) => U, - scheduler?: rxjs$SchedulerClass - ): (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6) => rxjs$Observable; - static bindCallback( - callbackFunc: Function, - selector?: void, - scheduler?: rxjs$SchedulerClass - ): (...args: Array) => rxjs$Observable; - static bindCallback( - callbackFunc: Function, - selector?: (...args: Array) => T, - scheduler?: rxjs$SchedulerClass - ): (...args: Array) => rxjs$Observable; - - static bindNodeCallback( - callbackFunc: (callback: (err: any, result: U) => any) => any, - selector?: void, - scheduler?: rxjs$SchedulerClass - ): () => rxjs$Observable; - static bindNodeCallback( - callbackFunc: (v1: T, callback: (err: any, result: U) => any) => any, - selector?: void, - scheduler?: rxjs$SchedulerClass - ): (v1: T) => rxjs$Observable; - static bindNodeCallback( - callbackFunc: ( - v1: T, - v2: T2, - callback: (err: any, result: U) => any - ) => any, - selector?: void, - scheduler?: rxjs$SchedulerClass - ): (v1: T, v2: T2) => rxjs$Observable; - static bindNodeCallback( - callbackFunc: ( - v1: T, - v2: T2, - v3: T3, - callback: (err: any, result: U) => any - ) => any, - selector?: void, - scheduler?: rxjs$SchedulerClass - ): (v1: T, v2: T2, v3: T3) => rxjs$Observable; - static bindNodeCallback( - callbackFunc: ( - v1: T, - v2: T2, - v3: T3, - v4: T4, - callback: (err: any, result: U) => any - ) => any, - selector?: void, - scheduler?: rxjs$SchedulerClass - ): (v1: T, v2: T2, v3: T3, v4: T4) => rxjs$Observable; - static bindNodeCallback( - callbackFunc: ( - v1: T, - v2: T2, - v3: T3, - v4: T4, - v5: T5, - callback: (err: any, result: U) => any - ) => any, - selector?: void, - scheduler?: rxjs$SchedulerClass - ): (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => rxjs$Observable; - static bindNodeCallback( - callbackFunc: ( - v1: T, - v2: T2, - v3: T3, - v4: T4, - v5: T5, - v6: T6, - callback: (err: any, result: U) => any - ) => any, - selector?: void, - scheduler?: rxjs$SchedulerClass - ): (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6) => rxjs$Observable; - static bindNodeCallback( - callbackFunc: Function, - selector?: void, - scheduler?: rxjs$SchedulerClass - ): (...args: Array) => rxjs$Observable; - static bindNodeCallback( - callbackFunc: Function, - selector?: (...args: Array) => T, - scheduler?: rxjs$SchedulerClass - ): (...args: Array) => rxjs$Observable; - - static concat(...sources: rxjs$Observable[]): rxjs$Observable; - - static create( - subscribe: ( - observer: rxjs$Observer - ) => rxjs$ISubscription | Function | void - ): rxjs$Observable; - - static defer( - observableFactory: () => rxjs$Observable | Promise - ): rxjs$Observable; - - static from( - input: rxjs$ObservableInput, - scheduler?: rxjs$SchedulerClass - ): rxjs$Observable; - - static fromEvent( - element: any, - eventName: string, - ...none: Array - ): rxjs$Observable; - static fromEvent( - element: any, - eventName: string, - options: rxjs$EventListenerOptions, - ...none: Array - ): rxjs$Observable; - static fromEvent( - element: any, - eventName: string, - selector: () => T, - ...none: Array - ): rxjs$Observable; - static fromEvent( - element: any, - eventName: string, - options: rxjs$EventListenerOptions, - selector: () => T - ): rxjs$Observable; - - static fromEventPattern( - addHandler: (handler: (item: T) => void) => void, - removeHandler: (handler: (item: T) => void) => void, - selector?: () => T - ): rxjs$Observable; - - static fromPromise(promise: Promise): rxjs$Observable; - - static empty(): rxjs$Observable; - - static interval(period: number): rxjs$Observable; - - static timer( - initialDelay: number | Date, - period?: number, - scheduler?: rxjs$SchedulerClass - ): rxjs$Observable; - - static merge( - source0: rxjs$Observable, - source1: rxjs$Observable - ): rxjs$Observable; - static merge( - source0: rxjs$Observable, - source1: rxjs$Observable, - source2: rxjs$Observable - ): rxjs$Observable; - static merge(...sources: rxjs$Observable[]): rxjs$Observable; - - static never(): rxjs$Observable; - - static of(...values: T[]): rxjs$Observable; - - static race(...sources: rxjs$Observable[]): rxjs$Observable; - - static range( - start?: number, - count?: number, - scheduler?: rxjs$SchedulerClass - ): rxjs$Observable; - - static throw(error: any): rxjs$Observable; - - audit( - durationSelector: (value: T) => rxjs$Observable | Promise - ): rxjs$Observable; - - auditTime( - duration: number, - scheduler?: rxjs$SchedulerClass - ): rxjs$Observable; - - race(other: rxjs$Observable): rxjs$Observable; - - repeat(count?: number): rxjs$Observable; - - buffer(bufferBoundaries: rxjs$Observable): rxjs$Observable>; - - bufferCount( - bufferSize: number, - startBufferEvery?: number - ): rxjs$Observable>; - - bufferTime( - bufferTimeSpan: number, - bufferCreationInterval?: number, - maxBufferSize?: number, - scheduler?: rxjs$SchedulerClass - ): rxjs$Observable>; - - bufferToggle( - openings: rxjs$Observable | Promise, - closingSelector: (value: U) => rxjs$Observable | Promise - ): rxjs$Observable>; - - bufferWhen( - closingSelector: () => rxjs$Observable - ): rxjs$Observable>; - - catch( - selector: (err: any, caught: rxjs$Observable) => rxjs$Observable - ): rxjs$Observable; - - concat(...sources: rxjs$Observable[]): rxjs$Observable; - - concatAll(): rxjs$Observable; - - concatMap( - f: (value: T, index: number) => rxjs$ObservableInput, - _: void - ): rxjs$Observable; - concatMap( - f: (value: T, index: number) => rxjs$ObservableInput, - resultSelector: ( - outerValue: T, - innerValue: U, - outerIndex: number, - innerIndex: number - ) => V - ): rxjs$Observable; - - debounceTime( - dueTime: number, - scheduler?: rxjs$SchedulerClass - ): rxjs$Observable; - - defaultIfEmpty(defaultValue: U): rxjs$Observable; - - delay(dueTime: number, scheduler?: rxjs$SchedulerClass): rxjs$Observable; - - delayWhen( - delayDurationSelector: (value: T) => rxjs$Observable, - subscriptionDelay?: rxjs$Observable - ): rxjs$Observable; - - distinctUntilChanged(compare?: (x: T, y: T) => boolean): rxjs$Observable; - - distinct( - keySelector?: (value: T) => U, - flushes?: rxjs$Observable - ): rxjs$Observable; - - distinctUntilKeyChanged( - key: string, - compare?: (x: mixed, y: mixed) => boolean - ): rxjs$Observable; - - elementAt(index: number, defaultValue?: T): rxjs$Observable; - - exhaustMap( - project: (value: T, index: number) => rxjs$ObservableInput, - _: void - ): rxjs$Observable; - exhaustMap( - project: (value: T, index: number) => rxjs$ObservableInput, - resultSelector: ( - outerValue: T, - innerValue: U, - outerIndex: number, - innerIndex: number - ) => V - ): rxjs$Observable; - - expand( - project: (value: T, index: number) => rxjs$Observable, - concurrent?: number, - scheduler?: rxjs$SchedulerClass - ): rxjs$Observable; - - filter(predicate: typeof Boolean): rxjs$Observable<$NonMaybeType>; - filter( - predicate: (value: T, index: number) => boolean, - thisArg?: any - ): rxjs$Observable; - - finally(f: () => mixed): rxjs$Observable; - - first( - predicate?: (value: T, index: number, source: rxjs$Observable) => boolean - ): rxjs$Observable; - first( - predicate: ?( - value: T, - index: number, - source: rxjs$Observable - ) => boolean, - resultSelector: (value: T, index: number) => U - ): rxjs$Observable; - first( - predicate: ?( - value: T, - index: number, - source: rxjs$Observable - ) => boolean, - resultSelector: ?(value: T, index: number) => U, - defaultValue: U - ): rxjs$Observable; - - groupBy( - keySelector: (value: T) => K, - _: void - ): rxjs$Observable>; - groupBy( - keySelector: (value: T) => K, - elementSelector: (value: T) => V, - durationSelector?: ( - grouped: rxjs$GroupedObservable - ) => rxjs$Observable - ): rxjs$Observable>; - - ignoreElements(): rxjs$Observable; - - last( - predicate?: (value: T, index: number, source: rxjs$Observable) => boolean - ): rxjs$Observable; - last( - predicate: ?( - value: T, - index: number, - source: rxjs$Observable - ) => boolean, - resultSelector: (value: T, index: number) => U - ): rxjs$Observable; - last( - predicate: ?( - value: T, - index: number, - source: rxjs$Observable - ) => boolean, - resultSelector: ?(value: T, index: number) => U, - defaultValue: U - ): rxjs$Observable; - - let( - project: (self: rxjs$Observable) => rxjs$Observable - ): rxjs$Observable; - - // Alias for `let` - letBind( - project: (self: rxjs$Observable) => rxjs$Observable - ): rxjs$Observable; - - switch(): T; // assumption: T is Observable - - // Alias for `mergeMap` - flatMap( - project: (value: T, index: number) => rxjs$ObservableInput, - concurrency?: number - ): rxjs$Observable; - flatMap( - project: (value: T, index: number) => rxjs$ObservableInput, - resultSelector: ( - outerValue: T, - innerValue: U, - outerIndex: number, - innerIndex: number - ) => V, - concurrency?: number - ): rxjs$Observable; - - flatMapTo(innerObservable: rxjs$Observable): rxjs$Observable; - - flatMapTo( - innerObservable: rxjs$Observable, - resultSelector: ( - outerValue: T, - innerValue: U, - outerIndex: number, - innerIndex: number - ) => V, - concurrent?: number - ): rxjs$Observable; - - switchMap( - project: (value: T, index: number) => rxjs$ObservableInput, - _: void - ): rxjs$Observable; - switchMap( - project: (value: T, index: number) => rxjs$ObservableInput, - resultSelector: ( - outerValue: T, - innerValue: U, - outerIndex: number, - innerIndex: number - ) => V - ): rxjs$Observable; - - switchMapTo(innerObservable: rxjs$Observable): rxjs$Observable; - - map(f: (value: T, index: number) => U, thisArg?: any): rxjs$Observable; - - mapTo(value: U): rxjs$Observable; - - merge(other: rxjs$Observable): rxjs$Observable; - - mergeAll(): rxjs$Observable; - - mergeMap( - project: (value: T, index: number) => rxjs$ObservableInput, - concurrency?: number - ): rxjs$Observable; - mergeMap( - project: (value: T, index: number) => rxjs$ObservableInput, - resultSelector: ( - outerValue: T, - innerValue: U, - outerIndex: number, - innerIndex: number - ) => V, - concurrency?: number - ): rxjs$Observable; - - mergeMapTo(innerObservable: rxjs$Observable): rxjs$Observable; - - mergeMapTo( - innerObservable: rxjs$Observable, - resultSelector: ( - outerValue: T, - innerValue: U, - outerIndex: number, - innerIndex: number - ) => V, - concurrent?: number - ): rxjs$Observable; - - multicast( - subjectOrSubjectFactory: rxjs$Subject | (() => rxjs$Subject) - ): rxjs$ConnectableObservable; - - observeOn(scheduler: rxjs$SchedulerClass): rxjs$Observable; - - pairwise(): rxjs$Observable<[T, T]>; - - partition( - predicate: (value: T, index: number) => boolean, - thisArg: any - ): [rxjs$Observable, rxjs$Observable]; - - pipe(): rxjs$Observable; - - pipe(op1: rxjs$OperatorFunctionLast): A; - - pipe( - op1: rxjs$OperatorFunction, - op2: rxjs$OperatorFunctionLast - ): B; - - pipe( - op1: rxjs$OperatorFunction, - op2: rxjs$OperatorFunction, - op3: rxjs$OperatorFunctionLast - ): C; - - pipe( - op1: rxjs$OperatorFunction, - op2: rxjs$OperatorFunction, - op3: rxjs$OperatorFunction, - op4: rxjs$OperatorFunctionLast - ): D; - - pipe( - op1: rxjs$OperatorFunction, - op2: rxjs$OperatorFunction, - op3: rxjs$OperatorFunction, - op4: rxjs$OperatorFunction, - op5: rxjs$OperatorFunctionLast - ): E; - - publish(): rxjs$ConnectableObservable; - - publishLast(): rxjs$ConnectableObservable; - - reduce( - accumulator: ( - acc: U, - currentValue: T, - index: number, - source: rxjs$Observable - ) => U, - seed: U - ): rxjs$Observable; - - sample(notifier: rxjs$Observable): rxjs$Observable; - - sampleTime( - delay: number, - scheduler?: rxjs$SchedulerClass - ): rxjs$Observable; - - publishReplay( - bufferSize?: number, - windowTime?: number, - scheduler?: rxjs$SchedulerClass - ): rxjs$ConnectableObservable; - - retry(retryCount: ?number): rxjs$Observable; - - retryWhen( - notifier: (errors: rxjs$Observable) => rxjs$Observable - ): rxjs$Observable; - - scan(f: (acc: U, value: T) => U, initialValue: U): rxjs$Observable; - - share(): rxjs$Observable; - - skip(count: number): rxjs$Observable; - - skipUntil(other: rxjs$Observable | Promise): rxjs$Observable; - - skipWhile( - predicate: (value: T, index: number) => boolean - ): rxjs$Observable; - - startWith(...values: Array): rxjs$Observable; - - subscribeOn(scheduler: rxjs$SchedulerClass): rxjs$Observable; - - take(count: number): rxjs$Observable; - - takeUntil(other: rxjs$Observable): rxjs$Observable; - - takeWhile( - predicate: (value: T, index: number) => boolean - ): rxjs$Observable; - - do( - onNext?: (value: T) => mixed, - onError?: (error: any) => mixed, - onCompleted?: () => mixed - ): rxjs$Observable; - do(observer: { - next?: (value: T) => mixed, - error?: (error: any) => mixed, - complete?: () => mixed, - ... - }): rxjs$Observable; - - throttleTime(duration: number): rxjs$Observable; - - timeout(due: number | Date, _: void): rxjs$Observable; - - timeoutWith( - due: number | Date, - withObservable: rxjs$Observable, - scheduler?: rxjs$SchedulerClass - ): rxjs$Observable; - - toArray(): rxjs$Observable; - - toPromise(): Promise; - - subscribe(observer: rxjs$PartialObserver): rxjs$Subscription; - subscribe( - onNext: ?(value: T) => mixed, - onError: ?(error: any) => mixed, - onCompleted: ?() => mixed - ): rxjs$Subscription; - - combineAll(): rxjs$Observable; - combineAll(project: (...values: any[]) => U): rxjs$Observable; - - static combineLatest( - a: rxjs$Observable, - resultSelector: (a: A) => B - ): rxjs$Observable; - - static combineLatest( - a: rxjs$Observable, - b: rxjs$Observable, - resultSelector: (a: A, b: B) => C - ): rxjs$Observable; - - static combineLatest( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - resultSelector: (a: A, b: B, c: C) => D - ): rxjs$Observable; - - static combineLatest( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - resultSelector: (a: A, b: B, c: C, d: D) => E - ): rxjs$Observable; - - static combineLatest( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - e: rxjs$Observable, - resultSelector: (a: A, b: B, c: C, d: D, e: E) => F - ): rxjs$Observable; - - static combineLatest( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - e: rxjs$Observable, - f: rxjs$Observable, - resultSelector: (a: A, b: B, c: C, d: D, e: E, f: F) => G - ): rxjs$Observable; - - static combineLatest( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - e: rxjs$Observable, - f: rxjs$Observable, - g: rxjs$Observable, - resultSelector: (a: A, b: B, c: C, d: D, e: E, f: F, g: G) => H - ): rxjs$Observable; - - static combineLatest(a: rxjs$Observable, _: void): rxjs$Observable<[A]>; - - static combineLatest( - a: rxjs$Observable, - b: rxjs$Observable, - _: void - ): rxjs$Observable<[A, B]>; - - static combineLatest( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - _: void - ): rxjs$Observable<[A, B, C]>; - - static combineLatest( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - _: void - ): rxjs$Observable<[A, B, C, D]>; - - static combineLatest( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - e: rxjs$Observable, - _: void - ): rxjs$Observable<[A, B, C, D, E]>; - - static combineLatest( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - e: rxjs$Observable, - f: rxjs$Observable, - _: void - ): rxjs$Observable<[A, B, C, D, E, F]>; - - static combineLatest( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - e: rxjs$Observable, - f: rxjs$Observable, - g: rxjs$Observable, - _: void - ): rxjs$Observable<[A, B, C, D, E, F, G]>; - - static combineLatest( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - e: rxjs$Observable, - f: rxjs$Observable, - g: rxjs$Observable, - h: rxjs$Observable, - _: void - ): rxjs$Observable<[A, B, C, D, E, F, G, H]>; - - combineLatest( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - e: rxjs$Observable, - f: rxjs$Observable, - g: rxjs$Observable, - resultSelector: (t: T, a: A, b: B, c: C, d: D, e: E, f: F, g: G) => H - ): rxjs$Observable; - - combineLatest( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - e: rxjs$Observable, - f: rxjs$Observable, - resultSelector: (t: T, a: A, b: B, c: C, d: D, e: E, f: F) => G - ): rxjs$Observable; - - combineLatest( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - e: rxjs$Observable, - resultSelector: (t: T, a: A, b: B, c: C, d: D, e: E) => F - ): rxjs$Observable; - - combineLatest( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - resultSelector: (t: T, a: A, b: B, c: C, d: D) => E - ): rxjs$Observable; - - combineLatest( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - resultSelector: (t: T, a: A, b: B, c: C) => D - ): rxjs$Observable; - - combineLatest( - a: rxjs$Observable, - b: rxjs$Observable, - resultSelector: (t: T, a: A, b: B) => C - ): rxjs$Observable; - - combineLatest( - a: rxjs$Observable, - resultSelector: (t: T, a: A) => B - ): rxjs$Observable; - - combineLatest( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - e: rxjs$Observable, - f: rxjs$Observable, - g: rxjs$Observable, - _: void - ): rxjs$Observable<[T, A, B, C, D, E, E, F, G]>; - - combineLatest( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - e: rxjs$Observable, - f: rxjs$Observable, - _: void - ): rxjs$Observable<[T, A, B, C, D, E, F]>; - - combineLatest( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - e: rxjs$Observable, - _: void - ): rxjs$Observable<[T, A, B, C, D, E]>; - - combineLatest( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - _: void - ): rxjs$Observable<[T, A, B, C, D]>; - - combineLatest( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - _: void - ): rxjs$Observable<[T, A, B, C]>; - - combineLatest( - a: rxjs$Observable, - b: rxjs$Observable, - _: void - ): rxjs$Observable<[T, A, B]>; - - combineLatest(a: rxjs$Observable, _: void): rxjs$Observable<[T, A]>; - - static zip( - a: rxjs$Observable, - resultSelector: (a: A) => B - ): rxjs$Observable; - - static zip( - a: rxjs$Observable, - b: rxjs$Observable, - resultSelector: (a: A, b: B) => C - ): rxjs$Observable; - - static zip( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - resultSelector: (a: A, b: B, c: C) => D - ): rxjs$Observable; - - static zip( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - resultSelector: (a: A, b: B, c: C, d: D) => E - ): rxjs$Observable; - - static zip( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - e: rxjs$Observable, - resultSelector: (a: A, b: B, c: C, d: D, e: E) => F - ): rxjs$Observable; - - static zip( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - e: rxjs$Observable, - f: rxjs$Observable, - resultSelector: (a: A, b: B, c: C, d: D, e: E, f: F) => G - ): rxjs$Observable; - - static zip( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - e: rxjs$Observable, - f: rxjs$Observable, - g: rxjs$Observable, - resultSelector: (a: A, b: B, c: C, d: D, e: E, f: F, g: G) => H - ): rxjs$Observable; - - static zip(a: rxjs$Observable, _: void): rxjs$Observable<[A]>; - - static zip( - a: rxjs$Observable, - b: rxjs$Observable, - _: void - ): rxjs$Observable<[A, B]>; - - static zip( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - _: void - ): rxjs$Observable<[A, B, C]>; - - static zip( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - _: void - ): rxjs$Observable<[A, B, C, D]>; - - static zip( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - e: rxjs$Observable, - _: void - ): rxjs$Observable<[A, B, C, D, E]>; - - static zip( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - e: rxjs$Observable, - f: rxjs$Observable, - _: void - ): rxjs$Observable<[A, B, C, D, E, F]>; - - static zip( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - e: rxjs$Observable, - f: rxjs$Observable, - g: rxjs$Observable, - _: void - ): rxjs$Observable<[A, B, C, D, E, F, G]>; - - static zip( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - e: rxjs$Observable, - f: rxjs$Observable, - g: rxjs$Observable, - h: rxjs$Observable, - _: void - ): rxjs$Observable<[A, B, C, D, E, F, G, H]>; - - zip( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - e: rxjs$Observable, - f: rxjs$Observable, - g: rxjs$Observable, - resultSelector: (t: T, a: A, b: B, c: C, d: D, e: E, f: F, g: G) => H - ): rxjs$Observable; - - zip( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - e: rxjs$Observable, - f: rxjs$Observable, - resultSelector: (t: T, a: A, b: B, c: C, d: D, e: E, f: F) => G - ): rxjs$Observable; - - zip( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - e: rxjs$Observable, - resultSelector: (t: T, a: A, b: B, c: C, d: D, e: E) => F - ): rxjs$Observable; - - zip( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - resultSelector: (t: T, a: A, b: B, c: C, d: D) => E - ): rxjs$Observable; - - zip( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - resultSelector: (t: T, a: A, b: B, c: C) => D - ): rxjs$Observable; - - zip( - a: rxjs$Observable, - b: rxjs$Observable, - resultSelector: (t: T, a: A, b: B) => C - ): rxjs$Observable; - - zip( - a: rxjs$Observable, - resultSelector: (t: T, a: A) => B - ): rxjs$Observable; - - zip( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - e: rxjs$Observable, - f: rxjs$Observable, - g: rxjs$Observable, - _: void - ): rxjs$Observable<[T, A, B, C, D, E, E, F, G]>; - - zip( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - e: rxjs$Observable, - f: rxjs$Observable, - _: void - ): rxjs$Observable<[T, A, B, C, D, E, F]>; - - zip( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - e: rxjs$Observable, - _: void - ): rxjs$Observable<[T, A, B, C, D, E]>; - - zip( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - _: void - ): rxjs$Observable<[T, A, B, C, D]>; - - zip( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - _: void - ): rxjs$Observable<[T, A, B, C]>; - - zip( - a: rxjs$Observable, - b: rxjs$Observable, - _: void - ): rxjs$Observable<[T, A, B]>; - - zip(a: rxjs$Observable, _: void): rxjs$Observable<[T, A]>; - - static forkJoin( - a: rxjs$Observable, - resultSelector: (a: A) => B - ): rxjs$Observable; - - static forkJoin( - a: rxjs$Observable, - b: rxjs$Observable, - resultSelector: (a: A, b: B) => C - ): rxjs$Observable; - - static forkJoin( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - resultSelector: (a: A, b: B, c: C) => D - ): rxjs$Observable; - - static forkJoin( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - resultSelector: (a: A, b: B, c: C, d: D) => E - ): rxjs$Observable; - - static forkJoin( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - e: rxjs$Observable, - resultSelector: (a: A, b: B, c: C, d: D, e: E) => F - ): rxjs$Observable; - - static forkJoin( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - e: rxjs$Observable, - f: rxjs$Observable, - resultSelector: (a: A, b: B, c: C, d: D, e: E, f: F) => G - ): rxjs$Observable; - - static forkJoin( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - e: rxjs$Observable, - f: rxjs$Observable, - g: rxjs$Observable, - resultSelector: (a: A, b: B, c: C, d: D, e: E, f: F, g: G) => H - ): rxjs$Observable; - - static forkJoin( - a: rxjs$Observable, - b: rxjs$Observable, - _: void - ): rxjs$Observable<[A, B]>; - - static forkJoin( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - _: void - ): rxjs$Observable<[A, B, C]>; - - static forkJoin( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - _: void - ): rxjs$Observable<[A, B, C, D]>; - - static forkJoin( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - e: rxjs$Observable, - _: void - ): rxjs$Observable<[A, B, C, D, E]>; - - static forkJoin( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - e: rxjs$Observable, - f: rxjs$Observable, - _: void - ): rxjs$Observable<[A, B, C, D, E, F]>; - - static forkJoin( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - e: rxjs$Observable, - f: rxjs$Observable, - g: rxjs$Observable, - _: void - ): rxjs$Observable<[A, B, C, D, E, F, G]>; - - static forkJoin( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - e: rxjs$Observable, - f: rxjs$Observable, - g: rxjs$Observable, - h: rxjs$Observable, - _: void - ): rxjs$Observable<[A, B, C, D, E, F, G, H]>; - - static forkJoin( - a: Array>, - _: void - ): rxjs$Observable>; - - static forkJoin( - a: Array>, - _: void - ): rxjs$Observable; - - static forkJoin( - a: Array>, - resultSelector: (...values: Array) => B - ): rxjs$Observable; - - static forkJoin( - a: Array>, - resultSelector: (...values: Array) => A - ): rxjs$Observable; - - window( - windowBoundaries: rxjs$Observable - ): rxjs$Observable>; - windowCount( - windowSize: number, - startWindowEvery?: number - ): rxjs$Observable>; - windowToggle( - openings: rxjs$Observable, - closingSelector: (value: A) => rxjs$Observable - ): rxjs$Observable>; - windowWhen( - closingSelector: () => rxjs$Observable - ): rxjs$Observable>; - - withLatestFrom( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - e: rxjs$Observable, - f: rxjs$Observable, - g: rxjs$Observable, - resultSelector: (t: T, a: A, b: B, c: C, d: D, e: E, f: F, g: G) => H - ): rxjs$Observable; - - withLatestFrom( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - e: rxjs$Observable, - f: rxjs$Observable, - resultSelector: (t: T, a: A, b: B, c: C, d: D, e: E, f: F) => G - ): rxjs$Observable; - - withLatestFrom( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - e: rxjs$Observable, - resultSelector: (t: T, a: A, b: B, c: C, d: D, e: E) => F - ): rxjs$Observable; - - withLatestFrom( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - resultSelector: (t: T, a: A, b: B, c: C, d: D) => E - ): rxjs$Observable; - - withLatestFrom( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - resultSelector: (t: T, a: A, b: B, c: C) => D - ): rxjs$Observable; - - withLatestFrom( - a: rxjs$Observable, - b: rxjs$Observable, - resultSelector: (t: T, a: A, b: B) => C - ): rxjs$Observable; - - withLatestFrom( - a: rxjs$Observable, - resultSelector: (t: T, a: A) => B - ): rxjs$Observable; - - withLatestFrom( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - e: rxjs$Observable, - f: rxjs$Observable, - g: rxjs$Observable, - _: void - ): rxjs$Observable<[T, A, B, C, D, E, E, F, G]>; - - withLatestFrom( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - e: rxjs$Observable, - f: rxjs$Observable, - _: void - ): rxjs$Observable<[T, A, B, C, D, E, F]>; - - withLatestFrom( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - e: rxjs$Observable, - _: void - ): rxjs$Observable<[T, A, B, C, D, E]>; - - withLatestFrom( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - d: rxjs$Observable, - _: void - ): rxjs$Observable<[T, A, B, C, D]>; - - withLatestFrom( - a: rxjs$Observable, - b: rxjs$Observable, - c: rxjs$Observable, - _: void - ): rxjs$Observable<[T, A, B, C]>; - - withLatestFrom( - a: rxjs$Observable, - b: rxjs$Observable, - _: void - ): rxjs$Observable<[T, A, B]>; - - withLatestFrom(a: rxjs$Observable, _: void): rxjs$Observable<[T, A]>; - - static using( - resourceFactory: () => ?R, - observableFactory: (resource: R) => rxjs$Observable | Promise | void - ): rxjs$Observable; - - _subscribe(observer: rxjs$Subscriber): rxjs$Subscription; - - _isScalar: boolean; - source: ?rxjs$Observable; - operator: ?rxjs$Operator; -} - -declare class rxjs$ConnectableObservable extends rxjs$Observable { - connect(): rxjs$Subscription; - refCount(): rxjs$Observable; -} - -declare class rxjs$GroupedObservable extends rxjs$Observable { - key: K; -} - -declare class rxjs$Observer<-T> { - next(value: T): mixed; - error(error: any): mixed; - complete(): mixed; -} - -declare interface rxjs$Operator { - call(subscriber: rxjs$Subscriber, source: any): rxjs$TeardownLogic; -} - -declare class rxjs$Subject mixins rxjs$Observable, rxjs$Observer { - static create( - destination: rxjs$Observer, - source: rxjs$Observable - ): rxjs$AnonymousSubject; - - asObservable(): rxjs$Observable; - observers: Array>; - unsubscribe(): void; - - // For use in subclasses only: - _next(value: T): void; -} - -declare class rxjs$AnonymousSubject extends rxjs$Subject { - source: ?rxjs$Observable; - destination: ?rxjs$Observer; - - constructor( - destination?: rxjs$Observer, - source?: rxjs$Observable - ): void; -} - -declare class rxjs$BehaviorSubject extends rxjs$Subject { - constructor(initialValue: T): void; - - getValue(): T; -} - -declare class rxjs$ReplaySubject extends rxjs$Subject { - constructor( - bufferSize?: number, - windowTime?: number, - scheduler?: rxjs$SchedulerClass - ): void; -} - -declare class rxjs$Subscription { - unsubscribe(): void; - add(teardown: rxjs$TeardownLogic): rxjs$Subscription; -} - -declare class rxjs$Subscriber extends rxjs$Subscription { - static create( - next?: (x?: T) => void, - error?: (e?: any) => void, - complete?: () => void - ): rxjs$Subscriber; - - constructor( - destinationOrNext?: rxjs$PartialObserver | ((value: T) => void), - error?: (e?: any) => void, - complete?: () => void - ): void; - next(value?: T): void; - error(err?: any): void; - complete(): void; - unsubscribe(): void; -} - -declare class rxjs$SchedulerClass { - schedule( - work: (state?: T) => void, - delay?: number, - state?: T - ): rxjs$Subscription; -} - -declare class rxjs$ArgumentOutOfRangeError extends Error {} -declare class rxjs$EmptyError extends Error {} -declare class rxjs$ObjectUnsubscribedError extends Error {} -declare class rxjs$TimeoutError extends Error {} -declare class rxjs$UnsubscriptionError extends Error {} - -declare module "rxjs" { - declare module.exports: { - Observable: typeof rxjs$Observable, - Observer: typeof rxjs$Observer, - ConnectableObservable: typeof rxjs$ConnectableObservable, - Subject: typeof rxjs$Subject, - Subscriber: typeof rxjs$Subscriber, - AnonymousSubject: typeof rxjs$AnonymousSubject, - BehaviorSubject: typeof rxjs$BehaviorSubject, - ReplaySubject: typeof rxjs$ReplaySubject, - Scheduler: { - asap: rxjs$SchedulerClass, - queue: rxjs$SchedulerClass, - animationFrame: rxjs$SchedulerClass, - async: rxjs$SchedulerClass, - ... - }, - Subscription: typeof rxjs$Subscription, - ArgumentOutOfRangeError: typeof rxjs$ArgumentOutOfRangeError, - EmptyError: typeof rxjs$EmptyError, - ObjectUnsubscribedError: typeof rxjs$ObjectUnsubscribedError, - TimeoutError: typeof rxjs$TimeoutError, - UnsubscriptionError: typeof rxjs$UnsubscriptionError, - ... - }; -} - -declare module "rxjs/Observable" { - declare module.exports: { Observable: typeof rxjs$Observable, ... }; -} - -declare module "rxjs/Observer" { - declare module.exports: { Observer: typeof rxjs$Observer, ... }; -} - -declare module "rxjs/BehaviorSubject" { - declare module.exports: { BehaviorSubject: typeof rxjs$BehaviorSubject, ... }; -} - -declare module "rxjs/ReplaySubject" { - declare module.exports: { ReplaySubject: typeof rxjs$ReplaySubject, ... }; -} - -declare module "rxjs/Subject" { - declare module.exports: { - Subject: typeof rxjs$Subject, - AnonymousSubject: typeof rxjs$AnonymousSubject, - ... - }; -} - -declare module "rxjs/Subscriber" { - declare module.exports: { Subscriber: typeof rxjs$Subscriber, ... }; -} - -declare module "rxjs/Subscription" { - declare module.exports: { Subscription: typeof rxjs$Subscription, ... }; -} - -declare module "rxjs/testing/TestScheduler" { - declare module.exports: { TestScheduler: typeof rxjs$SchedulerClass, ... }; -} - -declare module "rxjs/util/ArgumentOutOfRangeError" { - declare module.exports: { ArgumentOutOfRangeError: typeof rxjs$ArgumentOutOfRangeError, ... }; -} - -declare module "rxjs/util/EmptyError" { - declare module.exports: { EmptyError: typeof rxjs$EmptyError, ... }; -} - -declare module "rxjs/util/ObjectUnsubscribedError" { - declare module.exports: { ObjectUnsubscribedError: typeof rxjs$ObjectUnsubscribedError, ... }; -} - -declare module "rxjs/util/TimeoutError" { - declare module.exports: { TimeoutError: typeof rxjs$TimeoutError, ... }; -} - -declare module "rxjs/util/UnsubscriptionError" { - declare module.exports: { UnsubscriptionError: typeof rxjs$UnsubscriptionError, ... }; -} diff --git a/flow/rxjs.js b/flow/rxjs.js deleted file mode 100644 index 3bb22dabd8..0000000000 --- a/flow/rxjs.js +++ /dev/null @@ -1,25 +0,0 @@ -// @flow - -declare module 'rxjs/add/operator/concatMap' { - declare module.exports: any; -} - -declare module 'rxjs/add/operator/switchMap' { - declare module.exports: any; -} - -declare module 'rxjs/add/operator/filter' { - declare module.exports: any; -} - -declare module 'rxjs/add/operator/map' { - declare module.exports: any; -} - -declare module 'rxjs/add/operator/takeUntil' { - declare module.exports: any; -} - -declare module 'rxjs/observable/fromPromise' { - declare module.exports: any; -} diff --git a/package.json b/package.json index 3ec295f236..6fd9c95ac0 100644 --- a/package.json +++ b/package.json @@ -56,9 +56,9 @@ "redux": "^4.0.5", "redux-batched-actions": "^0.5.0", "redux-logger": "^3.0.6", - "redux-observable": "^0.18.0", + "redux-observable": "^1.2.0", "reselect": "^3.0.1", - "rxjs": "^5.5.10", + "rxjs": "^6.5.5", "typeface-roboto": "^0.0.54", "uuid": "^3.3.2" }, diff --git a/src/components/AppLoader/AppLoader.component.js b/src/components/AppLoader/AppLoader.component.js index cf18235754..5cc18117be 100644 --- a/src/components/AppLoader/AppLoader.component.js +++ b/src/components/AppLoader/AppLoader.component.js @@ -8,7 +8,7 @@ import { DisplayException } from 'capture-core/utils/exceptions'; import { environments } from 'capture-core/constants'; import type { HashHistory } from 'history/createHashHistory'; import { initializeAsync } from './init'; -import getStore from '../../store/getStore'; +import { getStore } from '../../store/getStore'; type Props = { onRunApp: (store: ReduxStore, history: HashHistory) => void, @@ -32,7 +32,7 @@ const AppLoader = (props: Props) => { try { await initializeAsync(onCacheExpired, dataEngine.query.bind(dataEngine)); const history = createHistory(); - // $FlowFixMe[incompatible-variance] automated comment + // $FlowFixMe[prop-missing] automated comment const store = getStore(history, () => onRunApp(store, history)); } catch (error) { let message = 'The application could not be loaded.'; diff --git a/src/core_modules/capture-core/cleanUp/cleanUp.js b/src/core_modules/capture-core/cleanUp/cleanUp.js index 1863b3dcc3..e09c050185 100644 --- a/src/core_modules/capture-core/cleanUp/cleanUp.js +++ b/src/core_modules/capture-core/cleanUp/cleanUp.js @@ -11,7 +11,7 @@ function getActionToCleanUpInLoadingList(state: ReduxState) { export default function cleanUp(store: ReduxStore) { const cleanUpActions = [ - getActionToCleanUpInLoadingList(store.getState()), + getActionToCleanUpInLoadingList(store.value), ] .filter(value => value); diff --git a/src/core_modules/capture-core/components/Connectivity/connectivity.epics.js b/src/core_modules/capture-core/components/Connectivity/connectivity.epics.js index 45af82cd2e..6336adb264 100644 --- a/src/core_modules/capture-core/components/Connectivity/connectivity.epics.js +++ b/src/core_modules/capture-core/components/Connectivity/connectivity.epics.js @@ -1,23 +1,25 @@ // @flow import { batchActions } from 'redux-batched-actions'; +import { ofType } from 'redux-observable'; +import { map, filter } from 'rxjs/operators'; + import { getEventListOnReconnect, goingOnlineExecuted, batchActionTypes } from './connectivity.actions'; const OFFLINE_STATUS_CHANGED = 'Offline/STATUS_CHANGED'; export const goingOnlineEpic = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(OFFLINE_STATUS_CHANGED) - .filter((action) => { + action$.pipe( + ofType(OFFLINE_STATUS_CHANGED), + filter((action) => { const online = !!action.payload.online; return online; - }) - .map(() => { + }), + map(() => { let actions = [ goingOnlineExecuted(), ]; - const state = store.getState(); + const state = store.value; const isSelectionsComplete = !!state.currentSelections.complete; if (isSelectionsComplete) { actions = [ @@ -27,4 +29,4 @@ export const goingOnlineEpic = (action$: InputObservable, store: ReduxStore) => } return batchActions(actions, batchActionTypes.GOING_ONLINE_EXECUTED_BATCH); - }); + })); diff --git a/src/core_modules/capture-core/components/D2Form/asyncHandlerHOC/asyncField.epics.js b/src/core_modules/capture-core/components/D2Form/asyncHandlerHOC/asyncField.epics.js index 9c7537a72d..5e33fbfd91 100644 --- a/src/core_modules/capture-core/components/D2Form/asyncHandlerHOC/asyncField.epics.js +++ b/src/core_modules/capture-core/components/D2Form/asyncHandlerHOC/asyncField.epics.js @@ -1,5 +1,8 @@ // @flow import log from 'loglevel'; +import { concatMap } from 'rxjs/operators'; +import { ofType } from 'redux-observable'; + import i18n from '@dhis2/d2-i18n'; import { errorCreator } from 'capture-core-utils'; import getErrorMessageAndDetails from '../../../utils/errors/getErrorMessageAndDetails'; @@ -11,10 +14,9 @@ import { // epic for handlng async field updates, e.g. file and image export const asyncUpdateFieldEpic = (action$: InputObservable) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(actionTypes.START_UPDATE_FIELD_ASYNC) - .concatMap((action) => { + action$.pipe( + ofType(actionTypes.START_UPDATE_FIELD_ASYNC), + concatMap((action) => { const payload = action.payload; const { elementId, formBuilderId, formId, callback, uid, onSuccess, onError } = payload; @@ -44,4 +46,4 @@ export const asyncUpdateFieldEpic = (action$: InputObservable) => asyncUpdateFieldFailed(errorMessage, uiState, elementId, formBuilderId, formId, uid); return onError ? onError(innerErrorAction) : innerErrorAction; }); - }); + })); diff --git a/src/core_modules/capture-core/components/D2Form/field/Components/OrgUnitField/orgUnitFieldForForms.epics.js b/src/core_modules/capture-core/components/D2Form/field/Components/OrgUnitField/orgUnitFieldForForms.epics.js index 87e4c1d75f..0a1cfa4883 100644 --- a/src/core_modules/capture-core/components/D2Form/field/Components/OrgUnitField/orgUnitFieldForForms.epics.js +++ b/src/core_modules/capture-core/components/D2Form/field/Components/OrgUnitField/orgUnitFieldForForms.epics.js @@ -1,7 +1,9 @@ // @flow import log from 'loglevel'; import getD2 from 'capture-core/d2/d2Instance'; -import { fromPromise } from 'rxjs/observable/fromPromise'; +import { from } from 'rxjs'; +import { map, concatMap, takeUntil, filter } from 'rxjs/operators'; +import { ofType } from 'redux-observable'; import isArray from 'd2-utilizr/lib/isArray'; import { errorCreator } from 'capture-core-utils'; import getOrgUnitRootsKey from './getOrgUnitRootsKey'; @@ -35,11 +37,11 @@ const cancelActionFilter = (action: Object, formId: string, elementId: string) = }; export const filterFormFieldOrgUnitsEpic = (action$: InputObservable) => - // $FlowFixMe[prop-missing] automated comment - action$.ofType(actionTypes.REQUEST_FILTER_FORM_FIELD_ORG_UNITS) - .concatMap((action) => { + action$.pipe( + ofType(actionTypes.REQUEST_FILTER_FORM_FIELD_ORG_UNITS), + concatMap((action) => { const { formId, elementId, searchText } = action.payload; - return fromPromise(getD2() + return from(getD2() .models .organisationUnits .list({ @@ -52,9 +54,11 @@ export const filterFormFieldOrgUnitsEpic = (action$: InputObservable) => withinUserSearchHierarchy: true, }) .then(orgUnitCollection => ({ orgUnitArray: orgUnitCollection.toArray(), searchText, formId, elementId })) - .catch(error => ({ error, formId, elementId }))).takeUntil(action$.filter(a => cancelActionFilter(a, formId, elementId))); - }) - .map((resultContainer) => { + .catch(error => ({ error, formId, elementId }))).pipe( + takeUntil(action$.pipe(filter(a => cancelActionFilter(a, formId, elementId)))), + ); + }), + map((resultContainer) => { if (resultContainer.error) { log.error(errorCreator(FILTER_RETRIEVE_ERROR)( { error: resultContainer.error, method: 'FilterOrgUnitRootsEpic' }), @@ -71,4 +75,4 @@ export const filterFormFieldOrgUnitsEpic = (action$: InputObservable) => displayName: unit.displayName, })); return filteredFormFieldOrgUnitsRetrieved(formId, elementId, orgUnits); - }); + })); diff --git a/src/core_modules/capture-core/components/DataEntries/Enrollment/epics/enrollment.epics.js b/src/core_modules/capture-core/components/DataEntries/Enrollment/epics/enrollment.epics.js index 9fc738ef56..3c9072ee66 100644 --- a/src/core_modules/capture-core/components/DataEntries/Enrollment/epics/enrollment.epics.js +++ b/src/core_modules/capture-core/components/DataEntries/Enrollment/epics/enrollment.epics.js @@ -1,5 +1,7 @@ // @flow import log from 'loglevel'; +import { ofType } from 'redux-observable'; +import { map } from 'rxjs/operators'; import { errorCreator } from 'capture-core-utils'; import { batchActionTypes, runRulesOnUpdateFieldBatch } from '../actions/enrollment.actionBatchs'; import { actionTypes } from '../actions/enrollment.actions'; @@ -23,7 +25,7 @@ type Context = { const runRulesOnEnrollmentUpdate = (store: ReduxStore, context: Context, fieldData?: ?FieldData, searchActions?: any = []) => { - const state = store.getState(); + const state = store.value; const { programId, dataEntryId, itemId, orgUnit, uid } = context; const formId = getDataEntryKey(dataEntryId, itemId); let trackerProgram: TrackerProgram; @@ -82,12 +84,11 @@ const runRulesOnEnrollmentUpdate = export const runRulesOnEnrollmentDataEntryFieldUpdateEpic = (action$: InputObservable, store: ReduxStore) => -// $FlowSuppress - // $FlowFixMe[prop-missing] automated comment - action$.ofType(batchActionTypes.UPDATE_DATA_ENTRY_FIELD_NEW_ENROLLMENT_ACTION_BATCH) - .map(actionBatch => - actionBatch.payload.find(action => action.type === actionTypes.START_RUN_RULES_ON_UPDATE)) - .map((action) => { + action$.pipe( + ofType(batchActionTypes.UPDATE_DATA_ENTRY_FIELD_NEW_ENROLLMENT_ACTION_BATCH), + map(actionBatch => + actionBatch.payload.find(action => action.type === actionTypes.START_RUN_RULES_ON_UPDATE)), + map((action) => { const { uid, programId, @@ -107,15 +108,14 @@ export const runRulesOnEnrollmentDataEntryFieldUpdateEpic = (action$: InputObser programId, orgUnit, }); - }); + })); export const runRulesOnEnrollmentFieldUpdateEpic = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(batchActionTypes.UPDATE_FIELD_NEW_ENROLLMENT_ACTION_BATCH) - .map(actionBatch => - actionBatch.payload.find(action => action.type === actionTypes.START_RUN_RULES_ON_UPDATE)) - .map((action) => { + action$.pipe( + ofType(batchActionTypes.UPDATE_FIELD_NEW_ENROLLMENT_ACTION_BATCH), + map(actionBatch => + actionBatch.payload.find(action => action.type === actionTypes.START_RUN_RULES_ON_UPDATE)), + map((action) => { const { innerPayload: payload, searchActions, uid, programId, orgUnit } = action.payload; const { dataEntryId, itemId, elementId, value, uiState } = payload; @@ -132,4 +132,5 @@ export const runRulesOnEnrollmentFieldUpdateEpic = (action$: InputObservable, st itemId, uid, }, fieldData, searchActions); - }); + }), + ); diff --git a/src/core_modules/capture-core/components/DataEntry/epics/searchGroups.epics.js b/src/core_modules/capture-core/components/DataEntry/epics/searchGroups.epics.js index 20a2370970..869c5124bf 100644 --- a/src/core_modules/capture-core/components/DataEntry/epics/searchGroups.epics.js +++ b/src/core_modules/capture-core/components/DataEntry/epics/searchGroups.epics.js @@ -2,11 +2,10 @@ // epics for handling search group searches import log from 'loglevel'; import i18n from '@dhis2/d2-i18n'; -import { pipe, errorCreator } from 'capture-core-utils'; -import { fromPromise } from 'rxjs/observable/fromPromise'; -import { of } from 'rxjs/observable/of'; -import { race } from 'rxjs/observable/race'; -import { ActionsObservable } from 'redux-observable'; +import { ofType, ActionsObservable } from 'redux-observable'; +import { map, filter, takeUntil, catchError, mergeMap, mergeAll } from 'rxjs/operators'; +import { race, of, from } from 'rxjs'; +import { pipe as pipeD2, errorCreator } from 'capture-core-utils'; import { InputSearchGroup, RenderFoundation } from '../../../metaData'; import { convertFormToClient, convertClientToServer } from '../../../converters'; import { @@ -28,7 +27,7 @@ function getServerValues( updatedFormValues: Object, foundation: RenderFoundation, ) { - const convertFn = pipe( + const convertFn = pipeD2( convertFormToClient, convertClientToServer, ); @@ -103,9 +102,9 @@ function searchHasUpdatedValues(searchGroup: InputSearchGroup, values: Object, p export const getFilterSearchGroupForSearchEpic = (triggerBatches: Array) => (action$: ActionsObservable, store: ReduxStore) => - action$ - .ofType(...triggerBatches) - .map((actionBatch) => { + action$.pipe( + ofType(...triggerBatches), + map((actionBatch) => { const potentialSearchActions = actionBatch.payload.filter( action => action.type === searchActionTypes.FILTER_SEARCH_GROUP_FOR_COUNT_SEARCH, @@ -117,7 +116,7 @@ export const getFilterSearchGroupForSearchEpic = const outputActions = potentialSearchActions .map((sa) => { const { dataEntryKey, searchGroup } = sa.payload; - const state = store.getState(); + const state = store.value; const formValues = state.formsValues[dataEntryKey] || {}; const previousValues = (state.dataEntriesSearchGroupsPreviousValues[dataEntryKey] && state.dataEntriesSearchGroupsPreviousValues[dataEntryKey][searchGroup.id]) || {}; @@ -166,7 +165,7 @@ export const getFilterSearchGroupForSearchEpic = } const { dataEntryKey, searchGroup, uid, contextProps } = sa.payload; - const state = store.getState(); + const state = store.value; const values = state.formsValues[dataEntryKey]; return startSearchGroupCountSearch( searchGroup, @@ -178,23 +177,23 @@ export const getFilterSearchGroupForSearchEpic = ); }); return outputActions; - }) - .filter(searchActions => searchActions && searchActions.length > 0) - .map(searchActions => filteredSearchActionsForSearchBatch(searchActions)); + }), + filter(searchActions => searchActions && searchActions.length > 0), + map(searchActions => filteredSearchActionsForSearchBatch(searchActions))); export const getExecuteSearchForSearchGroupEpic = (cancelBatches: Array) => (action$: ActionsObservable, store: ReduxStore) => - action$ - .ofType(searchBatchActionTypes.FILTERED_SEARCH_ACTIONS_FOR_SEARCH_BATCH) - .map((actionBatch) => { + action$.pipe( + ofType(searchBatchActionTypes.FILTERED_SEARCH_ACTIONS_FOR_SEARCH_BATCH), + map((actionBatch) => { const actions = actionBatch.payload; return actions.filter(action => action.type === searchActionTypes.START_SEARCH_GROUP_COUNT_SEARCH); - }) - .filter(actions => actions && actions.length > 0) - .mergeMap(searchActions => searchActions.map((searchAction) => { + }), + filter(actions => actions && actions.length > 0), + mergeMap(searchActions => searchActions.map((searchAction) => { const { dataEntryKey, contextProps, searchGroup, uid } = searchAction.payload; - const formValues = store.getState().formsValues[dataEntryKey]; + const formValues = store.value.formsValues[dataEntryKey]; if (!saveWaitUids[dataEntryKey]) { saveWaitUids[dataEntryKey] = {}; } @@ -204,50 +203,51 @@ export const getExecuteSearchForSearchGroupEpic = saveWaitUids[dataEntryKey][searchGroup.id].push(uid); return race( - fromPromise(executeSearch(searchGroup, formValues, contextProps)) - .takeUntil( - action$ - .ofType(searchBatchActionTypes.FILTERED_SEARCH_ACTIONS_FOR_SEARCH_BATCH) - .filter(ab => - ab.payload.find(a => - [ - searchActionTypes.START_SEARCH_GROUP_COUNT_SEARCH, - searchActionTypes.ABORT_SEARCH_GROUP_COUNT_SEARCH, - ].includes(a.type) && + from(executeSearch(searchGroup, formValues, contextProps)) + .pipe( + takeUntil( + action$.pipe( + ofType(searchBatchActionTypes.FILTERED_SEARCH_ACTIONS_FOR_SEARCH_BATCH), + filter(ab => + ab.payload.find(a => + [ + searchActionTypes.START_SEARCH_GROUP_COUNT_SEARCH, + searchActionTypes.ABORT_SEARCH_GROUP_COUNT_SEARCH, + ].includes(a.type) && a.payload.searchGroup === searchGroup)), - ) - .map((count) => { - const currentlyActiveUids = saveWaitUids[dataEntryKey][searchGroup.id]; - cleanUpUidsAfterSearch(dataEntryKey, searchGroup.id); - return searchGroupResultCountRetrieved( - count, dataEntryKey, searchGroup.id, currentlyActiveUids, - ); - }) - .catch((error) => { - log.error(errorCreator(error)({ dataEntryKey, searchGroupId: searchGroup.id })); - const currentlyActiveUids = saveWaitUids[dataEntryKey][searchGroup.id]; - cleanUpUidsAfterSearch(dataEntryKey, searchGroup.id); - return of( - searchGroupResultCountRetrievalFailed( - i18n.t('search group result could not be retrieved'), - dataEntryKey, - searchGroup.id, - currentlyActiveUids, - ), - ); - }), - action$ - .ofType(...cancelBatches) - .filter(ab => + )), + map((count) => { + const currentlyActiveUids = saveWaitUids[dataEntryKey][searchGroup.id]; + cleanUpUidsAfterSearch(dataEntryKey, searchGroup.id); + return searchGroupResultCountRetrieved( + count, dataEntryKey, searchGroup.id, currentlyActiveUids, + ); + }), + catchError((error) => { + log.error(errorCreator(error)({ dataEntryKey, searchGroupId: searchGroup.id })); + const currentlyActiveUids = saveWaitUids[dataEntryKey][searchGroup.id]; + cleanUpUidsAfterSearch(dataEntryKey, searchGroup.id); + return of( + searchGroupResultCountRetrievalFailed( + i18n.t('search group result could not be retrieved'), + dataEntryKey, + searchGroup.id, + currentlyActiveUids, + ), + ); + })), + action$.pipe( + ofType(...cancelBatches), + filter(ab => ab.payload.find(a => a.type === (loadNewActionTypes.LOAD_NEW_DATA_ENTRY || loadEditActionTypes.LOAD_EDIT_DATA_ENTRY) && - a.payload.key === dataEntryKey)) - .map(() => { + a.payload.key === dataEntryKey)), + map(() => { saveWaitUids[dataEntryKey] = null; return null; - }), + })), ); - })) - .mergeAll() - .filter(action => action); + })), + mergeAll(), + filter(action => action)); diff --git a/src/core_modules/capture-core/components/LockedSelector/LockedSelector.epics.js b/src/core_modules/capture-core/components/LockedSelector/LockedSelector.epics.js index cbe6c0c5e5..44c65bdfbb 100644 --- a/src/core_modules/capture-core/components/LockedSelector/LockedSelector.epics.js +++ b/src/core_modules/capture-core/components/LockedSelector/LockedSelector.epics.js @@ -1,6 +1,8 @@ // @flow import i18n from '@dhis2/d2-i18n'; import { push } from 'connected-react-router'; +import { ofType } from 'redux-observable'; +import { filter, map, switchMap } from 'rxjs/operators'; import { lockedSelectorActionTypes, lockedSelectorBatchActionTypes, @@ -29,31 +31,31 @@ const exactUrl = (page: string, programId: string, orgUnitId: string) => { }; export const updateUrlViaLockedSelectorEpic = (action$: InputObservable, store: ReduxStore) => - // $FlowFixMe[prop-missing] automated comment - action$.ofType( - lockedSelectorActionTypes.ORG_UNIT_ID_SET, - lockedSelectorActionTypes.PROGRAM_ID_SET, - lockedSelectorBatchActionTypes.PROGRAM_ID_RESET_BATCH, - lockedSelectorBatchActionTypes.ORG_UNIT_ID_RESET_BATCH, - ) - .map(() => { + action$.pipe( + ofType( + lockedSelectorActionTypes.ORG_UNIT_ID_SET, + lockedSelectorActionTypes.PROGRAM_ID_SET, + lockedSelectorBatchActionTypes.PROGRAM_ID_RESET_BATCH, + lockedSelectorBatchActionTypes.ORG_UNIT_ID_RESET_BATCH, + ), + map(() => { const { currentSelections: { programId, orgUnitId }, app: { page }, - } = store.getState(); + } = store.value; return push(exactUrl(page, programId, orgUnitId)); - }); + })); export const startAgainEpic = (action$: InputObservable) => - // $FlowFixMe[prop-missing] automated comment - action$.ofType(lockedSelectorBatchActionTypes.AGAIN_START) - .map(() => push('/')); + action$.pipe( + ofType(lockedSelectorBatchActionTypes.AGAIN_START), + map(() => push('/'))); export const getOrgUnitDataBasedOnUrlUpdateEpic = (action$: InputObservable) => - // $FlowFixMe[prop-missing] automated comment - action$.ofType(lockedSelectorActionTypes.SELECTIONS_FROM_URL_UPDATE) - .filter(action => action.payload.nextProps.orgUnitId) - .switchMap(action => getApi() + action$.pipe( + ofType(lockedSelectorActionTypes.SELECTIONS_FROM_URL_UPDATE), + filter(action => action.payload.nextProps.orgUnitId), + switchMap(action => getApi() .get(`organisationUnits/${action.payload.nextProps.orgUnitId}`) .then(response => setCurrentOrgUnitBasedOnUrl({ id: response.id, @@ -63,21 +65,23 @@ export const getOrgUnitDataBasedOnUrlUpdateEpic = (action$: InputObservable) => .catch(() => errorRetrievingOrgUnitBasedOnUrl(i18n.t('Could not get organisation unit')), ), - ); + )); export const setOrgUnitDataEmptyBasedOnUrlUpdateEpic = (action$: InputObservable) => - // $FlowFixMe[prop-missing] automated comment - action$.ofType(lockedSelectorActionTypes.SELECTIONS_FROM_URL_UPDATE) - .filter(action => !action.payload.nextProps.orgUnitId) - .map(() => setEmptyOrgUnitBasedOnUrl()); + action$.pipe( + ofType(lockedSelectorActionTypes.SELECTIONS_FROM_URL_UPDATE), + filter(action => !action.payload.nextProps.orgUnitId), + map(() => setEmptyOrgUnitBasedOnUrl())); export const validateSelectionsBasedOnUrlUpdateEpic = (action$: InputObservable, store: ReduxStore) => - // $FlowFixMe[prop-missing] automated comment - action$.ofType( - lockedSelectorActionTypes.BASED_ON_URL_ORG_UNIT_SET, - lockedSelectorActionTypes.BASED_ON_URL_ORG_UNIT_EMPTY_SET) - .map(() => { - const { programId, orgUnitId } = store.getState().currentSelections; + + action$.pipe( + ofType( + lockedSelectorActionTypes.BASED_ON_URL_ORG_UNIT_SET, + lockedSelectorActionTypes.BASED_ON_URL_ORG_UNIT_EMPTY_SET, + ), + map(() => { + const { programId, orgUnitId } = store.value.currentSelections; if (programId) { const program = programCollection.get(programId); @@ -91,4 +95,4 @@ export const validateSelectionsBasedOnUrlUpdateEpic = (action$: InputObservable, } return validSelectionsFromUrl(); - }); + })); diff --git a/src/core_modules/capture-core/components/LockedSelector/QuickSelector/epics/orgUnitList.epics.js b/src/core_modules/capture-core/components/LockedSelector/QuickSelector/epics/orgUnitList.epics.js index 19c90978e8..77db036378 100644 --- a/src/core_modules/capture-core/components/LockedSelector/QuickSelector/epics/orgUnitList.epics.js +++ b/src/core_modules/capture-core/components/LockedSelector/QuickSelector/epics/orgUnitList.epics.js @@ -1,6 +1,8 @@ // @flow import log from 'loglevel'; -import { fromPromise } from 'rxjs/observable/fromPromise'; +import { map, switchMap, takeUntil } from 'rxjs/operators'; +import { ofType } from 'redux-observable'; +import { from } from 'rxjs'; import getD2 from 'capture-core/d2/d2Instance'; import { errorCreator } from 'capture-core-utils'; import { @@ -16,9 +18,9 @@ const RETRIEVE_ERROR = 'Could not retrieve registering unit list'; // get organisation units based on search criteria export const searchRegisteringUnitListEpic = (action$: InputObservable) => - // $FlowFixMe[prop-missing] automated comment - action$.ofType(orgUnitListActions.SEARCH_ORG_UNITS) - .switchMap((action) => { + action$.pipe( + ofType(orgUnitListActions.SEARCH_ORG_UNITS), + switchMap((action) => { const searchText = action.payload.searchText; return getD2() .models @@ -35,8 +37,8 @@ export const searchRegisteringUnitListEpic = (action$: InputObservable) => }) .then(orgUnitCollection => ({ regUnitArray: orgUnitCollection.toArray(), searchText })) .catch(error => ({ error })); - }) - .map((resultContainer) => { + }), + map((resultContainer) => { if (resultContainer.error) { log.error(errorCreator(RETRIEVE_ERROR)( { error: resultContainer.error, method: 'searchRegisteringUnitListEpic' }), @@ -53,19 +55,22 @@ export const searchRegisteringUnitListEpic = (action$: InputObservable) => displayName: unit.displayName, })); return setSearchRoots(regUnits, resultContainer.searchText); - }); + })); // show loading indicator if api-request is not resolved when timeout expires export const showRegisteringUnitListIndicatorEpic = (action$: InputObservable) => - // $FlowFixMe[prop-missing] automated comment - action$.ofType(orgUnitListActions.SEARCH_ORG_UNITS) - .switchMap(() => - fromPromise(new Promise((resolve) => { + action$.pipe( + ofType(orgUnitListActions.SEARCH_ORG_UNITS), + switchMap(() => + from(new Promise((resolve) => { setTimeout(() => resolve(), LOADING_INDICATOR_TIMEOUT); })) - // $FlowFixMe[prop-missing] automated comment - .takeUntil(action$.ofType( - orgUnitListActions.SET_SEARCH_ROOTS, - orgUnitListActions.SET_SEARCH_ROOTS_FAILED)), - ) - .map(() => showLoadingIndicator()); + .pipe( + takeUntil(action$.pipe( + ofType( + orgUnitListActions.SET_SEARCH_ROOTS, + orgUnitListActions.SET_SEARCH_ROOTS_FAILED)), + ), + ), + ), + map(() => showLoadingIndicator())); diff --git a/src/core_modules/capture-core/components/LockedSelector/QuickSelector/epics/setSelection.epics.js b/src/core_modules/capture-core/components/LockedSelector/QuickSelector/epics/setSelection.epics.js index 1c476bf00d..48fd8caf4e 100644 --- a/src/core_modules/capture-core/components/LockedSelector/QuickSelector/epics/setSelection.epics.js +++ b/src/core_modules/capture-core/components/LockedSelector/QuickSelector/epics/setSelection.epics.js @@ -1,5 +1,7 @@ // @flow import { push } from 'connected-react-router'; +import { ofType } from 'redux-observable'; +import { map } from 'rxjs/operators'; import { actionTypes as selectionActionTypes, } from '../actions/QuickSelector.actions'; @@ -18,33 +20,31 @@ const getArguments = (programId: string, orgUnitId: string) => { export const setOrgUnit = (action$: InputObservable, store: ReduxStore) => - // $FlowFixMe[prop-missing] automated comment - action$.ofType(selectionActionTypes.SET_ORG_UNIT_ID) - .map(() => { - const state = store.getState(); + action$.pipe( + ofType(selectionActionTypes.SET_ORG_UNIT_ID), + map(() => { + const state = store.value; const { programId, orgUnitId } = state.currentSelections; const args = getArguments(programId, orgUnitId); return push(`/${args}`); - }); + })); export const setProgram = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(selectionActionTypes.SET_PROGRAM_ID) - .map(() => { - const state = store.getState(); + action$.pipe( + ofType(selectionActionTypes.SET_PROGRAM_ID), + map(() => { + const state = store.value; const { programId, orgUnitId } = state.currentSelections; const args = getArguments(programId, orgUnitId); return push(`/${args}`); - }); + })); export const goBackToListContext = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(selectionActionTypes.GO_BACK_TO_LIST_CONTEXT) - .map(() => { - const state = store.getState(); + action$.pipe( + ofType(selectionActionTypes.GO_BACK_TO_LIST_CONTEXT), + map(() => { + const state = store.value; const { programId, orgUnitId } = state.currentSelections; const args = getArguments(programId, orgUnitId); return push(`/${args}`); - }); + })); diff --git a/src/core_modules/capture-core/components/NetworkStatusBadge/NetworkStatusBadge.epics.js b/src/core_modules/capture-core/components/NetworkStatusBadge/NetworkStatusBadge.epics.js index a86ec23109..2b7076f15b 100644 --- a/src/core_modules/capture-core/components/NetworkStatusBadge/NetworkStatusBadge.epics.js +++ b/src/core_modules/capture-core/components/NetworkStatusBadge/NetworkStatusBadge.epics.js @@ -1,17 +1,12 @@ // @flow -import 'rxjs/add/observable/of'; -import 'rxjs/add/operator/switchMap'; -import 'rxjs/add/operator/filter'; - +import { ofType } from 'redux-observable'; +import { map } from 'rxjs/operators'; import { OFFLINE_STATUS_CHANGED } from '@redux-offline/redux-offline/lib/constants'; import { networkStatusChange } from './NetworkStatusBadge.actions'; -type InputObservable = rxjs$Observable>; export const networkMonitorStatusEpic = (action$: InputObservable) => - - action$ - // $FlowFixMe[prop-missing] automated comment - .ofType(OFFLINE_STATUS_CHANGED) - .map(action => networkStatusChange(action.payload.online)); - + action$.pipe( + ofType(OFFLINE_STATUS_CHANGED), + map(action => networkStatusChange(action.payload.online)), + ); diff --git a/src/core_modules/capture-core/components/Pages/EditEvent/DataEntry/epics/addNoteForEditSingleEvent.epics.js b/src/core_modules/capture-core/components/Pages/EditEvent/DataEntry/epics/addNoteForEditSingleEvent.epics.js index ff8407b956..d0715f6fa5 100644 --- a/src/core_modules/capture-core/components/Pages/EditEvent/DataEntry/epics/addNoteForEditSingleEvent.epics.js +++ b/src/core_modules/capture-core/components/Pages/EditEvent/DataEntry/epics/addNoteForEditSingleEvent.epics.js @@ -1,5 +1,7 @@ // @flow import { batchActions } from 'redux-batched-actions'; +import { ofType } from 'redux-observable'; +import { map } from 'rxjs/operators'; import uuid from 'd2-utilizr/lib/uuid'; import moment from 'capture-core-utils/moment/momentResolver'; import { convertValue as convertListValue } from '../../../../../converters/clientToList'; @@ -22,11 +24,10 @@ import { import { getCurrentUser } from '../../../../../d2/d2Instance'; export const addNoteForEditSingleEventEpic = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(editEventDataEntryActionTypes.REQUEST_ADD_NOTE_FOR_EDIT_SINGLE_EVENT) - .map((action) => { - const state = store.getState(); + action$.pipe( + ofType(editEventDataEntryActionTypes.REQUEST_ADD_NOTE_FOR_EDIT_SINGLE_EVENT), + map((action) => { + const state = store.value; const payload = action.payload; const eventId = state.dataEntries[payload.dataEntryId].eventId; // $FlowFixMe[prop-missing] automated comment @@ -52,16 +53,15 @@ export const addNoteForEditSingleEventEpic = (action$: InputObservable, store: R addNote(payload.dataEntryId, payload.itemId, formNote), addEventNote(eventId, clientNote), ], editEventDataEntryBatchActionTypes.ADD_NOTE_FOR_EDIT_SINGLE_EVENT_BATCH); - }); + })); export const removeNoteForEditSingleEventEpic = (action$: InputObservable) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(editEventDataEntryActionTypes.ADD_NOTE_FAILED_FOR_EDIT_SINGLE_EVENT) - .map((action) => { + action$.pipe( + ofType(editEventDataEntryActionTypes.ADD_NOTE_FAILED_FOR_EDIT_SINGLE_EVENT), + map((action) => { const context = action.meta.context; return batchActions([ removeNote(context.dataEntryId, context.itemId, context.noteClientId), removeEventNote(context.eventId, context.noteClientId), ], editEventDataEntryBatchActionTypes.REMOVE_NOTE_FOR_EDIT_SINGLE_EVENT_BATCH); - }); + })); diff --git a/src/core_modules/capture-core/components/Pages/EditEvent/DataEntry/epics/cancelEditSingleEvent.epics.js b/src/core_modules/capture-core/components/Pages/EditEvent/DataEntry/epics/cancelEditSingleEvent.epics.js index 995dd97d6f..a264246351 100644 --- a/src/core_modules/capture-core/components/Pages/EditEvent/DataEntry/epics/cancelEditSingleEvent.epics.js +++ b/src/core_modules/capture-core/components/Pages/EditEvent/DataEntry/epics/cancelEditSingleEvent.epics.js @@ -1,5 +1,8 @@ // @flow import { push } from 'connected-react-router'; +import { ofType } from 'redux-observable'; +import { map } from 'rxjs/operators'; + import { actionTypes as editEventDataEntryActionTypes, noWorkingListUpdateNeededAfterUpdateCancelled, @@ -9,11 +12,10 @@ import { import isSelectionsEqual from '../../../../App/isSelectionsEqual'; export const cancelEditEventEpic = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(editEventDataEntryActionTypes.START_CANCEL_SAVE_RETURN_TO_MAIN_PAGE) - .map(() => { - const state = store.getState(); + action$.pipe( + ofType(editEventDataEntryActionTypes.START_CANCEL_SAVE_RETURN_TO_MAIN_PAGE), + map(() => { + const state = store.value; if (!state.offline.online) { return noWorkingListUpdateNeededAfterUpdateCancelled(); @@ -28,15 +30,14 @@ export const cancelEditEventEpic = (action$: InputObservable, store: ReduxStore) return updateWorkingListAfterUpdateCancelled(); } return noWorkingListUpdateNeededAfterUpdateCancelled(); - }); + })); export const cancelEditEventLocationChangeEpic = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(editEventDataEntryActionTypes.START_CANCEL_SAVE_RETURN_TO_MAIN_PAGE) - .map(() => { - const state = store.getState(); + action$.pipe( + ofType(editEventDataEntryActionTypes.START_CANCEL_SAVE_RETURN_TO_MAIN_PAGE), + map(() => { + const state = store.value; const programId = state.currentSelections.programId; const orgUnitId = state.currentSelections.orgUnitId; return push(`/programId=${programId}&orgUnitId=${orgUnitId}`); - }); + })); diff --git a/src/core_modules/capture-core/components/Pages/EditEvent/DataEntry/epics/editEventDataEntry.epics.js b/src/core_modules/capture-core/components/Pages/EditEvent/DataEntry/epics/editEventDataEntry.epics.js index 03c041f365..84e4ca9178 100644 --- a/src/core_modules/capture-core/components/Pages/EditEvent/DataEntry/epics/editEventDataEntry.epics.js +++ b/src/core_modules/capture-core/components/Pages/EditEvent/DataEntry/epics/editEventDataEntry.epics.js @@ -1,5 +1,7 @@ // @flow import log from 'loglevel'; +import { ofType } from 'redux-observable'; +import { map } from 'rxjs/operators'; import { batchActions } from 'redux-batched-actions'; import { errorCreator } from 'capture-core-utils'; import { rulesExecutedPostUpdateField } from '../../../../DataEntry/actions/dataEntry.actions'; @@ -22,19 +24,19 @@ import { import type { FieldData } from '../../../../../rules/actionsCreator'; import getDataEntryKey from '../../../../DataEntry/common/getDataEntryKey'; + const errorMessages = { COULD_NOT_GET_EVENT_FROM_STATE: 'Could not get event from state', }; export const openEditEventInDataEntryEpic = (action$: InputObservable) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType( - editEventActionTypes.ORG_UNIT_RETRIEVED_ON_URL_UPDATE, - editEventActionTypes.ORG_UNIT_RETRIEVAL_FAILED_ON_URL_UPDATE, - editEventActionTypes.START_OPEN_EVENT_FOR_EDIT, - ) - .map((action) => { + action$.pipe( + ofType( + editEventActionTypes.ORG_UNIT_RETRIEVED_ON_URL_UPDATE, + editEventActionTypes.ORG_UNIT_RETRIEVAL_FAILED_ON_URL_UPDATE, + editEventActionTypes.START_OPEN_EVENT_FOR_EDIT, + ), + map((action) => { const eventContainer = action.payload.eventContainer; const orgUnit = action.payload.orgUnit; @@ -47,11 +49,11 @@ export const openEditEventInDataEntryEpic = (action$: InputObservable) => return batchActions(openEventForEditInDataEntry(eventContainer, orgUnit, foundation, program)); - }); + })); const runRulesForEditSingleEvent = (store: ReduxStore, dataEntryId: string, itemId: string, uid: string, fieldData?: ?FieldData) => { - const state = store.getState(); + const state = store.value; const formId = getDataEntryKey(dataEntryId, itemId); const eventId = state.dataEntries[dataEntryId].eventId; const event = state.events[eventId]; @@ -101,20 +103,20 @@ const runRulesForEditSingleEvent = (store: ReduxStore, dataEntryId: string, item export const runRulesOnUpdateDataEntryFieldForEditSingleEventEpic = (action$: InputObservable, store: ReduxStore) => // $FlowSuppress - // $FlowFixMe[prop-missing] automated comment - action$.ofType(editEventDataEntryBatchActionTypes.UPDATE_DATA_ENTRY_FIELD_EDIT_SINGLE_EVENT_ACTION_BATCH) - .map(actionBatch => actionBatch.payload.find(action => action.type === editEventDataEntryActionTypes.START_RUN_RULES_ON_UPDATE)) - .map((action) => { + action$.pipe( + ofType(editEventDataEntryBatchActionTypes.UPDATE_DATA_ENTRY_FIELD_EDIT_SINGLE_EVENT_ACTION_BATCH), + map(actionBatch => actionBatch.payload.find(action => action.type === editEventDataEntryActionTypes.START_RUN_RULES_ON_UPDATE)), + map((action) => { const { dataEntryId, itemId, uid } = action.payload; return runRulesForEditSingleEvent(store, dataEntryId, itemId, uid); - }); + })); export const runRulesOnUpdateFieldForEditSingleEventEpic = (action$: InputObservable, store: ReduxStore) => // $FlowSuppress - // $FlowFixMe[prop-missing] automated comment - action$.ofType(editEventDataEntryBatchActionTypes.UPDATE_FIELD_EDIT_SINGLE_EVENT_ACTION_BATCH) - .map(actionBatch => actionBatch.payload.find(action => action.type === editEventDataEntryActionTypes.START_RUN_RULES_ON_UPDATE)) - .map((action) => { + action$.pipe( + ofType(editEventDataEntryBatchActionTypes.UPDATE_FIELD_EDIT_SINGLE_EVENT_ACTION_BATCH), + map(actionBatch => actionBatch.payload.find(action => action.type === editEventDataEntryActionTypes.START_RUN_RULES_ON_UPDATE)), + map((action) => { const { elementId, value, uiState, dataEntryId, itemId, uid } = action.payload; const fieldData: FieldData = { elementId, @@ -122,5 +124,5 @@ export const runRulesOnUpdateFieldForEditSingleEventEpic = (action$: InputObserv valid: uiState.valid, }; return runRulesForEditSingleEvent(store, dataEntryId, itemId, uid, fieldData); - }); + })); diff --git a/src/core_modules/capture-core/components/Pages/EditEvent/DataEntry/epics/saveEditSingleEvent.epics.js b/src/core_modules/capture-core/components/Pages/EditEvent/DataEntry/epics/saveEditSingleEvent.epics.js index 5fea1974a5..a783c75508 100644 --- a/src/core_modules/capture-core/components/Pages/EditEvent/DataEntry/epics/saveEditSingleEvent.epics.js +++ b/src/core_modules/capture-core/components/Pages/EditEvent/DataEntry/epics/saveEditSingleEvent.epics.js @@ -1,5 +1,7 @@ // @flow import { push } from 'connected-react-router'; +import { ofType } from 'redux-observable'; +import { map } from 'rxjs/operators'; import { moment } from 'capture-core-utils/moment'; import { getFormattedStringFromMomentUsingEuropeanGlyphs } from 'capture-core-utils/date'; import { @@ -13,11 +15,10 @@ import { convertValue as convertToServerValue } from '../../../../../converters/ import { convertMainEventClientToServer } from '../../../../../events/mainConverters'; export const saveEditEventEpic = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(editEventDataEntryActionTypes.REQUEST_SAVE_RETURN_TO_MAIN_PAGE) - .map((action) => { - const state = store.getState(); + action$.pipe( + ofType(editEventDataEntryActionTypes.REQUEST_SAVE_RETURN_TO_MAIN_PAGE), + map((action) => { + const state = store.value; const payload = action.payload; const dataEntryKey = getDataEntryKey(payload.dataEntryId, payload.itemId); const eventId = state.dataEntries[payload.dataEntryId].eventId; @@ -55,15 +56,14 @@ export const saveEditEventEpic = (action$: InputObservable, store: ReduxStore) = }; return startSaveEditEventAfterReturnedToMainPage(eventId, serverData, state.currentSelections); - }); + })); export const saveEditEventLocationChangeEpic = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(editEventDataEntryActionTypes.REQUEST_SAVE_RETURN_TO_MAIN_PAGE) - .map(() => { - const state = store.getState(); + action$.pipe( + ofType(editEventDataEntryActionTypes.REQUEST_SAVE_RETURN_TO_MAIN_PAGE), + map(() => { + const state = store.value; const programId = state.currentSelections.programId; const orgUnitId = state.currentSelections.orgUnitId; return push(`/programId=${programId}&orgUnitId=${orgUnitId}`); - }); + })); diff --git a/src/core_modules/capture-core/components/Pages/EditEvent/editEvent.epics.js b/src/core_modules/capture-core/components/Pages/EditEvent/editEvent.epics.js index ab169a6d89..46c6fcd3ba 100644 --- a/src/core_modules/capture-core/components/Pages/EditEvent/editEvent.epics.js +++ b/src/core_modules/capture-core/components/Pages/EditEvent/editEvent.epics.js @@ -3,6 +3,8 @@ import log from 'loglevel'; import { push } from 'connected-react-router'; import i18n from '@dhis2/d2-i18n'; import { errorCreator } from 'capture-core-utils'; +import { ofType } from 'redux-observable'; +import { map, switchMap } from 'rxjs/operators'; import getErrorMessageAndDetails from '../../../utils/errors/getErrorMessageAndDetails'; import { getApi } from '../../../d2'; import { @@ -17,12 +19,11 @@ import { actionTypes as eventListActionTypes } from '../MainPage/EventsList/even import { getEvent } from '../../../events/eventRequests'; export const getEventOpeningFromEventListEpic = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(eventListActionTypes.OPEN_EDIT_EVENT_PAGE) - .map((action) => { + action$.pipe( + ofType(eventListActionTypes.OPEN_EDIT_EVENT_PAGE), + map((action) => { const eventId = action.payload; - const state = store.getState(); + const state = store.value; const event = state.events[eventId]; const values = state.eventsValues[eventId]; const eventContainer = { @@ -32,15 +33,14 @@ export const getEventOpeningFromEventListEpic = (action$: InputObservable, store }; const orgUnit = state.organisationUnits[event.orgUnitId]; return startOpenEventForEditInDataEntry(eventContainer, orgUnit); - }); + })); export const getEventFromUrlEpic = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(editEventActionTypes.EDIT_EVENT_FROM_URL) - .switchMap((action) => { + action$.pipe( + ofType(editEventActionTypes.EDIT_EVENT_FROM_URL), + switchMap((action) => { const eventId = action.payload.eventId; - const prevProgramId = store.getState().currentSelections.programId; // used to clear columns and filters in eventlist if program id is changed + const prevProgramId = store.value.currentSelections.programId; // used to clear columns and filters in eventlist if program id is changed return getEvent(eventId) .then((eventContainer) => { if (!eventContainer) { @@ -58,13 +58,12 @@ export const getEventFromUrlEpic = (action$: InputObservable, store: ReduxStore) return eventFromUrlCouldNotBeRetrieved( i18n.t('Event could not be loaded. Are you sure it exists?')); }); - }); + })); export const getOrgUnitOnUrlUpdateEpic = (action$: InputObservable) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(editEventActionTypes.EVENT_FROM_URL_RETRIEVED) - .switchMap((action) => { + action$.pipe( + ofType(editEventActionTypes.EVENT_FROM_URL_RETRIEVED), + switchMap((action) => { const eventContainer = action.payload.eventContainer; return getApi().get(`organisationUnits/${eventContainer.event.orgUnitId}`) .then(orgUnit => orgUnitRetrievedOnUrlUpdate(orgUnit, eventContainer)) @@ -75,12 +74,11 @@ export const getOrgUnitOnUrlUpdateEpic = (action$: InputObservable) => i18n.t('Organisation unit could not be loaded'))(details)); return orgUnitCouldNotBeRetrievedOnUrlUpdate(eventContainer); }); - }); + })); export const openEditPageLocationChangeEpic = (action$: InputObservable) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(eventListActionTypes.OPEN_EDIT_EVENT_PAGE) - .map(action => + action$.pipe( + ofType(eventListActionTypes.OPEN_EDIT_EVENT_PAGE), + map(action => push(`/editEvent/${action.payload}`), - ); + )); diff --git a/src/core_modules/capture-core/components/Pages/EditEvent/epics/editEvent.epics.js b/src/core_modules/capture-core/components/Pages/EditEvent/epics/editEvent.epics.js index 11b663d06b..698e2ab2b8 100644 --- a/src/core_modules/capture-core/components/Pages/EditEvent/epics/editEvent.epics.js +++ b/src/core_modules/capture-core/components/Pages/EditEvent/epics/editEvent.epics.js @@ -1,5 +1,7 @@ // @flow import log from 'loglevel'; +import { ofType } from 'redux-observable'; +import { map, switchMap } from 'rxjs/operators'; import { push } from 'connected-react-router'; import i18n from '@dhis2/d2-i18n'; import { errorCreator } from 'capture-core-utils'; @@ -17,12 +19,11 @@ import { actionTypes as eventListActionTypes } from '../../MainPage/EventsList/e import { getEvent } from '../../../../events/eventRequests'; export const getEventOpeningFromEventListEpic = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(eventListActionTypes.OPEN_EDIT_EVENT_PAGE) - .map((action) => { + action$.pipe( + ofType(eventListActionTypes.OPEN_EDIT_EVENT_PAGE), + map((action) => { const eventId = action.payload; - const state = store.getState(); + const state = store.value; const event = state.events[eventId]; const values = state.eventsValues[eventId]; const eventContainer = { @@ -32,15 +33,14 @@ export const getEventOpeningFromEventListEpic = (action$: InputObservable, store }; const orgUnit = state.organisationUnits[event.orgUnitId]; return startOpenEventForEditInDataEntry(eventContainer, orgUnit); - }); + })); export const getEventFromUrlEpic = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(editEventActionTypes.EDIT_EVENT_FROM_URL) - .switchMap((action) => { + action$.pipe( + ofType(editEventActionTypes.EDIT_EVENT_FROM_URL), + switchMap((action) => { const eventId = action.payload.eventId; - const prevProgramId = store.getState().currentSelections.programId; // used to clear columns and filters in eventlist if program id is changed + const prevProgramId = store.value.currentSelections.programId; // used to clear columns and filters in eventlist if program id is changed return getEvent(eventId) .then((eventContainer) => { if (!eventContainer) { @@ -58,13 +58,12 @@ export const getEventFromUrlEpic = (action$: InputObservable, store: ReduxStore) return eventFromUrlCouldNotBeRetrieved( i18n.t('Event could not be loaded. Are you sure it exists?')); }); - }); + })); export const getOrgUnitOnUrlUpdateEpic = (action$: InputObservable) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(editEventActionTypes.EVENT_FROM_URL_RETRIEVED) - .switchMap((action) => { + action$.pipe( + ofType(editEventActionTypes.EVENT_FROM_URL_RETRIEVED), + switchMap((action) => { const eventContainer = action.payload.eventContainer; return getApi().get(`organisationUnits/${eventContainer.event.orgUnitId}`) .then(orgUnit => orgUnitRetrievedOnUrlUpdate(orgUnit, eventContainer)) @@ -75,12 +74,11 @@ export const getOrgUnitOnUrlUpdateEpic = (action$: InputObservable) => i18n.t('Organisation unit could not be loaded'))(details)); return orgUnitCouldNotBeRetrievedOnUrlUpdate(eventContainer); }); - }); + })); export const openEditPageLocationChangeEpic = (action$: InputObservable) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(eventListActionTypes.OPEN_EDIT_EVENT_PAGE) - .map(action => + action$.pipe( + ofType(eventListActionTypes.OPEN_EDIT_EVENT_PAGE), + map(action => push(`/editEvent/${action.payload}`), - ); + )); diff --git a/src/core_modules/capture-core/components/Pages/MainPage/EventsList/FilterSelectors/filterSelector.epics.js b/src/core_modules/capture-core/components/Pages/MainPage/EventsList/FilterSelectors/filterSelector.epics.js index 35c520ebde..996cb54316 100644 --- a/src/core_modules/capture-core/components/Pages/MainPage/EventsList/FilterSelectors/filterSelector.epics.js +++ b/src/core_modules/capture-core/components/Pages/MainPage/EventsList/FilterSelectors/filterSelector.epics.js @@ -1,16 +1,17 @@ // @flow +import { ofType } from 'redux-observable'; +import { map } from 'rxjs/operators'; import { actionTypes as columnSelectorActionTypes, } from '../ListWrapper/actions/columnSelectorDialog.actions'; import { updateIncludedFiltersAfterColumnSorting } from './filterSelector.actions'; export const includeFiltersWithValueAfterColumnSortingEpic = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(columnSelectorActionTypes.UPDATE_WORKINGLIST_ORDER) + action$.pipe( + ofType(columnSelectorActionTypes.UPDATE_WORKINGLIST_ORDER), // eslint-disable-next-line complexity - .map(() => { - const state = store.getState(); + map(() => { + const state = store.value; const listId = state.workingListsTemplates.eventList.currentListId; const appliedFilters = ( state.workingListsMeta && @@ -48,4 +49,4 @@ export const includeFiltersWithValueAfterColumnSortingEpic = (action$: InputObse }, {}); return updateIncludedFiltersAfterColumnSorting(filtersToInclude, listId); - }); + })); diff --git a/src/core_modules/capture-core/components/Pages/MainPage/WorkingLists/epics/eventList.epics.js b/src/core_modules/capture-core/components/Pages/MainPage/WorkingLists/epics/eventList.epics.js index bb6915a107..92ef5a586e 100644 --- a/src/core_modules/capture-core/components/Pages/MainPage/WorkingLists/epics/eventList.epics.js +++ b/src/core_modules/capture-core/components/Pages/MainPage/WorkingLists/epics/eventList.epics.js @@ -1,5 +1,7 @@ // @flow -import { fromPromise } from 'rxjs/observable/fromPromise'; +import { from } from 'rxjs'; +import { ofType } from 'redux-observable'; +import { takeUntil, filter, concatMap } from 'rxjs/operators'; import log from 'loglevel'; import { errorCreator } from 'capture-core-utils'; import { @@ -13,12 +15,12 @@ import { updateEventWorkingListAsync } from './updateEventWorkingList'; import { getApi } from '../../../../../d2'; export const initEventListEpic = (action$: InputObservable, store: ReduxStore) => - // $FlowFixMe[prop-missing] automated comment - action$.ofType( - actionTypes.EVENT_LIST_INIT, - ) - .concatMap((action) => { - const state = store.getState(); + action$.pipe( + ofType( + actionTypes.EVENT_LIST_INIT, + ), + concatMap((action) => { + const state = store.value; const { programId, orgUnitId, categories } = state.currentSelections; const lastTransaction = state.offline.lastTransaction; const { selectedTemplate, defaultConfig, listId } = action.payload; @@ -35,60 +37,61 @@ export const initEventListEpic = (action$: InputObservable, store: ReduxStore) = listId, lastTransaction, }); - return fromPromise(initialPromise) - .takeUntil( - action$ - // $FlowFixMe[prop-missing] automated comment - .ofType(actionTypes.EVENT_LIST_INIT_CANCEL) - .filter(cancelAction => cancelAction.payload.listId === listId), - ); - }); + return from(initialPromise).pipe( + + takeUntil( + action$.pipe( + ofType(actionTypes.EVENT_LIST_INIT_CANCEL), + filter(cancelAction => cancelAction.payload.listId === listId), + ), + ), + ); + })); export const updateEventListEpic = (action$: InputObservable, store: ReduxStore) => - // $FlowFixMe[prop-missing] automated comment - action$.ofType( - actionTypes.EVENT_LIST_UPDATE, - ) - .concatMap((action) => { - const state = store.getState(); + action$.pipe( + ofType( + actionTypes.EVENT_LIST_UPDATE, + ), + concatMap((action) => { + const state = store.value; const { listId, queryArgs } = action.payload; const updatePromise = updateEventWorkingListAsync(listId, queryArgs, state); - return fromPromise(updatePromise) - .takeUntil( - action$ - // $FlowFixMe[prop-missing] automated comment - .ofType(actionTypes.EVENT_LIST_UPDATE_CANCEL) - .filter(cancelAction => cancelAction.payload.listId === listId), - ) - .takeUntil( - action$ - // $FlowFixMe[prop-missing] automated comment - .ofType(actionTypes.EVENT_LIST_INIT_CANCEL) - .filter(cancelAction => cancelAction.payload.listId === listId), - ); - }); + return from(updatePromise).pipe( + takeUntil( + action$.pipe( + ofType(actionTypes.EVENT_LIST_UPDATE_CANCEL), + filter(cancelAction => cancelAction.payload.listId === listId), + ), + ), + takeUntil( + action$.pipe( + ofType(actionTypes.EVENT_LIST_INIT_CANCEL), + filter(cancelAction => cancelAction.payload.listId === listId), + ), + )); + })); // TODO: --------------------------------- REFACTOR ----------------------------------- export const requestDeleteEventEpic = (action$: InputObservable) => - // $FlowFixMe[prop-missing] automated comment - action$.ofType( - eventListActionTypes.REQUEST_DELETE_EVENT, - ).concatMap((action) => { - const eventId = action.payload.eventId; - const listId = 'eventList'; - const deletePromise = getApi() - .delete(`events/${eventId}`) - .then(() => deleteEventSuccess(eventId, listId)) - .catch((error) => { - log.error(errorCreator('Could not delete event')({ error, eventId })); - return deleteEventError(); - }); + action$.pipe( + ofType(eventListActionTypes.REQUEST_DELETE_EVENT), + concatMap((action) => { + const eventId = action.payload.eventId; + const listId = 'eventList'; + const deletePromise = getApi() + .delete(`events/${eventId}`) + .then(() => deleteEventSuccess(eventId, listId)) + .catch((error) => { + log.error(errorCreator('Could not delete event')({ error, eventId })); + return deleteEventError(); + }); - return fromPromise(deletePromise) - .takeUntil( - action$ - // $FlowFixMe[prop-missing] automated comment - .ofType(actionTypes.CONTEXT_UNLOADING) - .filter(cancelAction => cancelAction.payload.listId === listId), - ); - }); + return from(deletePromise).pipe( + takeUntil( + action$.pipe( + ofType(actionTypes.CONTEXT_UNLOADING), + filter(cancelAction => cancelAction.payload.listId === listId), + ), + )); + })); diff --git a/src/core_modules/capture-core/components/Pages/MainPage/WorkingLists/epics/templates.epics.js b/src/core_modules/capture-core/components/Pages/MainPage/WorkingLists/epics/templates.epics.js index c38ffe145c..d714a7354b 100644 --- a/src/core_modules/capture-core/components/Pages/MainPage/WorkingLists/epics/templates.epics.js +++ b/src/core_modules/capture-core/components/Pages/MainPage/WorkingLists/epics/templates.epics.js @@ -1,9 +1,11 @@ // @flow import { batchActions } from 'redux-batched-actions'; -import { fromPromise } from 'rxjs/observable/fromPromise'; import i18n from '@dhis2/d2-i18n'; import log from 'loglevel'; import { errorCreator } from 'capture-core-utils'; +import { ofType } from 'redux-observable'; +import { concatMap, filter, takeUntil } from 'rxjs/operators'; +import { from } from 'rxjs'; import { actionTypes, batchActionTypes, @@ -21,14 +23,12 @@ import { getTemplatesAsync } from './templatesFetcher'; import { getApi } from '../../../../../d2'; export const retrieveTemplatesEpic = (action$: InputObservable, store: ReduxStore) => - // $FlowFixMe[prop-missing] automated comment - action$.ofType( - actionTypes.TEMPLATES_FETCH, - ) - .concatMap((action) => { + action$.pipe( + ofType(actionTypes.TEMPLATES_FETCH), + concatMap((action) => { const listId = action.payload.listId; - const programId = store.getState().currentSelections.programId; - const promise = getTemplatesAsync(store.getState()) + const programId = store.value.currentSelections.programId; + const promise = getTemplatesAsync(store.value) .then(container => batchActions([ selectTemplate(container.default.id, listId), fetchTemplatesSuccess(container.workingListConfigs, programId, listId), @@ -40,20 +40,20 @@ export const retrieveTemplatesEpic = (action$: InputObservable, store: ReduxStor return fetchTemplatesError(i18n.t('an error occurred loading working lists'), listId); }); - return fromPromise(promise) - .takeUntil( - // $FlowFixMe[prop-missing] automated comment - action$.ofType(actionTypes.TEMPLATES_FETCH_CANCEL) - .filter(cancelAction => cancelAction.payload.listId === listId), - ); - }); + return from(promise).pipe( + takeUntil( + action$.pipe( + ofType(actionTypes.TEMPLATES_FETCH_CANCEL), + filter(cancelAction => cancelAction.payload.listId === listId), + ), + ), + ); + })); export const updateTemplateEpic = (action$: InputObservable, store: ReduxStore) => - // $FlowFixMe[prop-missing] automated comment - action$.ofType( - actionTypes.TEMPLATE_UPDATE, - ) - .concatMap((action) => { + action$.pipe( + ofType(actionTypes.TEMPLATE_UPDATE), + concatMap((action) => { const { template, eventQueryCriteria, @@ -89,7 +89,7 @@ export const updateTemplateEpic = (action$: InputObservable, store: ReduxStore) })) .then(() => { const isActiveTemplate = - store.getState().workingListsTemplates[listId].selectedTemplateId === template.id; + store.value.workingListsTemplates[listId].selectedTemplateId === template.id; return updateTemplateSuccess( template.id, eventQueryCriteria, { @@ -105,7 +105,7 @@ export const updateTemplateEpic = (action$: InputObservable, store: ReduxStore) }), ); const isActiveTemplate = - store.getState().workingListsTemplates[listId].selectedTemplateId === template.id; + store.value.workingListsTemplates[listId].selectedTemplateId === template.id; return updateTemplateError( template.id, eventQueryCriteria, { @@ -114,96 +114,95 @@ export const updateTemplateEpic = (action$: InputObservable, store: ReduxStore) }); }); - return fromPromise(requestPromise) - .takeUntil( - action$ - // $FlowFixMe[prop-missing] automated comment - .ofType(actionTypes.TEMPLATE_UPDATE) - .filter(cancelAction => cancelAction.payload.template.id === template.id), - ) - .takeUntil( - action$ - // $FlowFixMe[prop-missing] automated comment - .ofType(actionTypes.CONTEXT_UNLOADING) - .filter(cancelAction => cancelAction.payload.listId === listId), - ); - }); + return from(requestPromise).pipe( + takeUntil( + action$.pipe( + ofType(actionTypes.TEMPLATE_UPDATE), + filter(cancelAction => cancelAction.payload.template.id === template.id), + ), + ), + takeUntil( + action$.pipe( + ofType(actionTypes.CONTEXT_UNLOADING), + filter(cancelAction => cancelAction.payload.listId === listId), + ), + ), + ); + })); export const addTemplateEpic = (action$: InputObservable, store: ReduxStore) => - // $FlowFixMe[prop-missing] automated comment - action$.ofType( + action$.pipe(ofType( actionTypes.TEMPLATE_ADD, - ) - .concatMap((action) => { - const { - name, - eventQueryCriteria, - clientId, - programId, - listId, - } = action.payload; + ), + concatMap((action) => { + const { + name, + eventQueryCriteria, + clientId, + programId, + listId, + } = action.payload; - const eventFilterData = { - name, - program: programId, - eventQueryCriteria, - }; + const eventFilterData = { + name, + program: programId, + eventQueryCriteria, + }; - const api = getApi(); + const api = getApi(); - const requestPromise = api - .post('eventFilters', eventFilterData) - .then((result) => { - const templateId = result.response.uid; - return api - .post(`sharing?type=eventFilter&id=${templateId}`, { - object: { - publicAccess: '--------', - externalAccess: false, - }, - }) - .catch((error) => { - log.error( - errorCreator('could not set sharing settings for template')({ - error, - eventFilterData, - templateId, - }), - ); - }) - .then(() => { - const isActiveTemplate = - store.getState().workingListsTemplates[listId].selectedTemplateId === clientId; - return addTemplateSuccess(result.response.uid, clientId, { listId, isActiveTemplate }); - }); - }) - .catch((error) => { - log.error( - errorCreator('could not add template')({ - error, - eventFilterData, - }), - ); - const isActiveTemplate = - store.getState().workingListsTemplates[listId].selectedTemplateId === clientId; - return addTemplateError(clientId, { listId, isActiveTemplate }); - }); - - return fromPromise(requestPromise) - .takeUntil( - action$ - // $FlowFixMe[prop-missing] automated comment - .ofType(actionTypes.CONTEXT_UNLOADING) - .filter(cancelAction => cancelAction.payload.listId === listId), + const requestPromise = api + .post('eventFilters', eventFilterData) + .then((result) => { + const templateId = result.response.uid; + return api + .post(`sharing?type=eventFilter&id=${templateId}`, { + object: { + publicAccess: '--------', + externalAccess: false, + }, + }) + .catch((error) => { + log.error( + errorCreator('could not set sharing settings for template')({ + error, + eventFilterData, + templateId, + }), + ); + }) + .then(() => { + const isActiveTemplate = + store.value.workingListsTemplates[listId].selectedTemplateId === clientId; + return addTemplateSuccess(result.response.uid, clientId, { listId, isActiveTemplate }); + }); + }) + .catch((error) => { + log.error( + errorCreator('could not add template')({ + error, + eventFilterData, + }), ); - }); + const isActiveTemplate = + store.value.workingListsTemplates[listId].selectedTemplateId === clientId; + return addTemplateError(clientId, { listId, isActiveTemplate }); + }); + + return from(requestPromise).pipe( + takeUntil( + action$.pipe( + ofType(actionTypes.CONTEXT_UNLOADING), + filter(cancelAction => cancelAction.payload.listId === listId), + ), + ), + ); + })); export const deleteTemplateEpic = (action$: InputObservable) => - // $FlowFixMe[prop-missing] automated comment - action$.ofType( - actionTypes.TEMPLATE_DELETE, - ) - .concatMap((action) => { + action$.pipe( + ofType(actionTypes.TEMPLATE_DELETE), + concatMap((action) => { const { template, listId, @@ -222,17 +221,18 @@ export const deleteTemplateEpic = (action$: InputObservable) => return deleteTemplateError(template, listId); }); - return fromPromise(requestPromise) - .takeUntil( - action$ - // $FlowFixMe[prop-missing] automated comment - .ofType(actionTypes.TEMPLATE_DELETE) - .filter(cancelAction => cancelAction.payload.template.id === template.id), - ) - .takeUntil( - action$ - // $FlowFixMe[prop-missing] automated comment - .ofType(actionTypes.CONTEXT_UNLOADING) - .filter(cancelAction => cancelAction.payload.listId === listId), - ); - }); + return from(requestPromise).pipe( + takeUntil( + action$.pipe( + ofType(actionTypes.TEMPLATE_DELETE), + filter(cancelAction => cancelAction.payload.template.id === template.id), + ), + ), + takeUntil( + action$.pipe( + ofType(actionTypes.CONTEXT_UNLOADING), + filter(cancelAction => cancelAction.payload.listId === listId), + ), + ), + ); + })); diff --git a/src/core_modules/capture-core/components/Pages/NewEnrollment/DataEntry/epics/dataEntry.epics.js b/src/core_modules/capture-core/components/Pages/NewEnrollment/DataEntry/epics/dataEntry.epics.js index 41f1b84774..52dea98206 100644 --- a/src/core_modules/capture-core/components/Pages/NewEnrollment/DataEntry/epics/dataEntry.epics.js +++ b/src/core_modules/capture-core/components/Pages/NewEnrollment/DataEntry/epics/dataEntry.epics.js @@ -1,5 +1,7 @@ // @flow import log from 'loglevel'; +import { ofType } from 'redux-observable'; +import { switchMap } from 'rxjs/operators'; import { errorCreator } from 'capture-core-utils'; import { actionTypes as urlActionTypes } from '../../actions/url.actions'; import { @@ -17,13 +19,12 @@ const errorMessages = { }; export const openNewEnrollmentInDataEntryEpic = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType( - urlActionTypes.VALID_SELECTIONS_FROM_URL, - ) - .switchMap(() => { - const state = store.getState(); + action$.pipe( + ofType( + urlActionTypes.VALID_SELECTIONS_FROM_URL, + ), + switchMap(() => { + const state = store.value; const selectionsComplete = state.currentSelections.complete; if (!selectionsComplete) { return selectionsNotCompleteOpeningNewEnrollment(); @@ -63,4 +64,4 @@ export const openNewEnrollmentInDataEntryEpic = (action$: InputObservable, store [], state.generatedUniqueValuesCache[dataEntryId], ); - }); + })); diff --git a/src/core_modules/capture-core/components/Pages/NewEnrollment/DataEntry/epics/saveDataEntry.epics.js b/src/core_modules/capture-core/components/Pages/NewEnrollment/DataEntry/epics/saveDataEntry.epics.js index d1f38c40f3..d4298323d9 100644 --- a/src/core_modules/capture-core/components/Pages/NewEnrollment/DataEntry/epics/saveDataEntry.epics.js +++ b/src/core_modules/capture-core/components/Pages/NewEnrollment/DataEntry/epics/saveDataEntry.epics.js @@ -1,15 +1,16 @@ // @flow +import { ofType } from 'redux-observable'; +import { map } from 'rxjs/operators'; import { getTrackerProgramThrowIfNotFound } from '../../../../../metaData/helpers'; import { actionTypes, startSaveNewEnrollmentAfterReturnedToMainPage } from '../actions/dataEntry.actions'; import getDataEntryKey from '../../../../DataEntry/common/getDataEntryKey'; import { buildServerDataForEnrollmentDataEntry } from '../../../../DataEntries'; export const saveNewEnrollmentEpic = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(actionTypes.REQUEST_SAVE_RETURN_TO_MAIN_PAGE) - .map((action) => { - const state = store.getState(); + action$.pipe( + ofType(actionTypes.REQUEST_SAVE_RETURN_TO_MAIN_PAGE), + map((action) => { + const state = store.value; const payload = action.payload; const dataEntryKey = getDataEntryKey(payload.dataEntryId, payload.itemId); const programId = state.currentSelections.programId; @@ -30,4 +31,4 @@ export const saveNewEnrollmentEpic = (action$: InputObservable, store: ReduxStor {}, ); return startSaveNewEnrollmentAfterReturnedToMainPage(serverData, state.currentSelections); - }); + })); diff --git a/src/core_modules/capture-core/components/Pages/NewEnrollment/epics/urlSelections.epics.js b/src/core_modules/capture-core/components/Pages/NewEnrollment/epics/urlSelections.epics.js index f1ab9638fe..4d87ccb4ac 100644 --- a/src/core_modules/capture-core/components/Pages/NewEnrollment/epics/urlSelections.epics.js +++ b/src/core_modules/capture-core/components/Pages/NewEnrollment/epics/urlSelections.epics.js @@ -1,5 +1,7 @@ // @flow import i18n from '@dhis2/d2-i18n'; +import { ofType } from 'redux-observable'; +import { map, filter, switchMap } from 'rxjs/operators'; import { getApi } from '../../../../d2/d2Instance'; import { actionTypes, @@ -13,11 +15,10 @@ import { programCollection } from '../../../../metaDataMemoryStores'; import { TrackerProgram } from '../../../../metaData'; export const getOrgUnitDataForNewEnrollmentUrlUpdateEpic = (action$: InputObservable) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(actionTypes.UPDATE_SELECTIONS_FROM_URL) - .filter(action => action.payload.nextProps.orgUnitId) - .switchMap(action => getApi() + action$.pipe( + ofType(actionTypes.UPDATE_SELECTIONS_FROM_URL), + filter(action => action.payload.nextProps.orgUnitId), + switchMap(action => getApi() .get(`organisationUnits/${action.payload.nextProps.orgUnitId}`) .then(({ id, displayName: name, code }) => setCurrentOrgUnitBasedOnUrl({ id, name, code }), @@ -25,21 +26,19 @@ export const getOrgUnitDataForNewEnrollmentUrlUpdateEpic = (action$: InputObserv .catch(() => errorRetrievingOrgUnitBasedOnUrl(i18n.t('Could not get organisation unit')), ), - ); + )); export const emptyOrgUnitForNewEnrollmentUrlUpdateEpic = (action$: InputObservable) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(actionTypes.UPDATE_SELECTIONS_FROM_URL) - .filter(action => !action.payload.nextProps.orgUnitId) - .map(() => setEmptyOrgUnitBasedOnUrl()); + action$.pipe( + ofType(actionTypes.UPDATE_SELECTIONS_FROM_URL), + filter(action => !action.payload.nextProps.orgUnitId), + map(() => setEmptyOrgUnitBasedOnUrl())); export const validationForNewEnrollmentUrlUpdateEpic = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(actionTypes.SET_ORG_UNIT_BASED_ON_URL, actionTypes.SET_EMPTY_ORG_UNIT_BASED_ON_URL) - .map(() => { - const { programId, orgUnitId } = store.getState().currentSelections; + action$.pipe( + ofType(actionTypes.SET_ORG_UNIT_BASED_ON_URL, actionTypes.SET_EMPTY_ORG_UNIT_BASED_ON_URL), + map(() => { + const { programId, orgUnitId } = store.value.currentSelections; if (programId) { const program = programCollection.get(programId); @@ -59,4 +58,4 @@ export const validationForNewEnrollmentUrlUpdateEpic = (action$: InputObservable } return validSelectionsFromUrl(); - }); + })); diff --git a/src/core_modules/capture-core/components/Pages/NewEvent/DataEntry/epics/addNoteForNewSingleEvent.epics.js b/src/core_modules/capture-core/components/Pages/NewEvent/DataEntry/epics/addNoteForNewSingleEvent.epics.js index ea950b9209..53d2e2cc4a 100644 --- a/src/core_modules/capture-core/components/Pages/NewEvent/DataEntry/epics/addNoteForNewSingleEvent.epics.js +++ b/src/core_modules/capture-core/components/Pages/NewEvent/DataEntry/epics/addNoteForNewSingleEvent.epics.js @@ -1,5 +1,7 @@ // @flow import uuid from 'd2-utilizr/lib/uuid'; +import { ofType } from 'redux-observable'; +import { map } from 'rxjs/operators'; import moment from 'capture-core-utils/moment/momentResolver'; import { convertValue as convertListValue } from '../../../../../converters/clientToList'; import elementTypes from '../../../../../metaData/DataElement/elementTypes'; @@ -13,10 +15,9 @@ import { import { getCurrentUser } from '../../../../../d2/d2Instance'; export const addNoteForNewSingleEventEpic = (action$: InputObservable) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(newEventDataEntryActionTypes.ADD_NEW_EVENT_NOTE) - .map((action) => { + action$.pipe( + ofType(newEventDataEntryActionTypes.ADD_NEW_EVENT_NOTE), + map((action) => { const payload = action.payload; // $FlowFixMe[prop-missing] automated comment const userName = getCurrentUser().username; @@ -31,4 +32,4 @@ export const addNoteForNewSingleEventEpic = (action$: InputObservable) => }; return addNote(payload.dataEntryId, payload.itemId, note); - }); + })); diff --git a/src/core_modules/capture-core/components/Pages/NewEvent/DataEntry/epics/addRelationshipForNewSingleEvent.epics.js b/src/core_modules/capture-core/components/Pages/NewEvent/DataEntry/epics/addRelationshipForNewSingleEvent.epics.js index dd6fc4f22c..b62c026cf1 100644 --- a/src/core_modules/capture-core/components/Pages/NewEvent/DataEntry/epics/addRelationshipForNewSingleEvent.epics.js +++ b/src/core_modules/capture-core/components/Pages/NewEvent/DataEntry/epics/addRelationshipForNewSingleEvent.epics.js @@ -1,5 +1,7 @@ // @flow import uuid from 'd2-utilizr/lib/uuid'; +import { ofType } from 'redux-observable'; +import { map } from 'rxjs/operators'; import i18n from '@dhis2/d2-i18n'; import { batchActions } from 'redux-batched-actions'; @@ -33,17 +35,15 @@ const itemId = 'newEvent'; const dataEntryKey = getDataEntryKey(dataEntryId, itemId); export const openRelationshipForNewSingleEventEpic = (action$: InputObservable) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(newEventDataEntryActionTypes.NEW_EVENT_OPEN_NEW_RELATIONSHIP) - .map(() => initializeNewRelationship()); + action$.pipe( + ofType(newEventDataEntryActionTypes.NEW_EVENT_OPEN_NEW_RELATIONSHIP), + map(() => initializeNewRelationship())); export const addRelationshipForNewSingleEventEpic = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(newEventNewRelationshipActionTypes.ADD_NEW_EVENT_RELATIONSHIP) - .map((action) => { - const state = store.getState(); + action$.pipe( + ofType(newEventNewRelationshipActionTypes.ADD_NEW_EVENT_RELATIONSHIP), + map((action) => { + const state = store.value; const existingRelationships = state.dataEntriesRelationships[dataEntryKey] || []; const payload = action.payload; const entity = payload.entity; @@ -87,7 +87,7 @@ export const addRelationshipForNewSingleEventEpic = (action$: InputObservable, s recentlyAddedRelationship(newRelationship.clientId), addRelationship(dataEntryId, itemId, newRelationship, newToEntity), ], newEventNewRelationshipBatchActionTypes.ADD_RELATIONSHIP_BATCH); - }); + })); const saveNewEventRelationships = (relationshipData, selections, triggerAction) => { const relationship = relationshipData.find(rd => rd.to.data); @@ -105,10 +105,9 @@ const saveNewEventRelationships = (relationshipData, selections, triggerAction) export const saveNewEventRelationshipsIfExistsEpic = (action$: InputObservable) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(newEventDataEntryActionTypes.SAVE_NEW_EVENT_RELATIONSHIPS_IF_EXISTS) - .map((action) => { + action$.pipe( + ofType(newEventDataEntryActionTypes.SAVE_NEW_EVENT_RELATIONSHIPS_IF_EXISTS), + map((action) => { const meta = action.meta; if (meta.relationshipData) { const eventId = action.payload.response.importSummaries[0].reference; @@ -132,17 +131,16 @@ export const saveNewEventRelationshipsIfExistsEpic = (action$: InputObservable) } return null; - }); + })); export const saveNewEventRelationshipFinishedEpic = (action$: InputObservable) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType( - newEventDataEntryActionTypes.NEW_EVENT_RELATIONSHIPS_SAVED, - newEventDataEntryActionTypes.SAVE_FAILED_FOR_NEW_EVENT_RELATIONSHIPS, - newEventDataEntryActionTypes.SAVE_FAILED_FOR_NEW_EVENT_RELATIONSHIPS_TEI, - ) - .map((action) => { + action$.pipe( + ofType( + newEventDataEntryActionTypes.NEW_EVENT_RELATIONSHIPS_SAVED, + newEventDataEntryActionTypes.SAVE_FAILED_FOR_NEW_EVENT_RELATIONSHIPS, + newEventDataEntryActionTypes.SAVE_FAILED_FOR_NEW_EVENT_RELATIONSHIPS_TEI, + ), + map((action) => { const meta = action.meta; if (meta.triggerAction === newEventDataEntryActionTypes.START_SAVE_AFTER_RETURNED_TO_MAIN_PAGE) { return newEventSavedAfterReturnedToMainPage(meta.selections); @@ -151,19 +149,18 @@ export const saveNewEventRelationshipFinishedEpic = (action$: InputObservable) = return newEventSavedAddAnother(meta.selections); } return null; - }); + })); export const teiForNewEventRelationshipSavedEpic = (action$: InputObservable) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType( - newEventDataEntryActionTypes.TEI_FOR_NEW_EVENT_RELATIONSHIPS_SAVED, - ) - .map((action) => { + action$.pipe( + ofType( + newEventDataEntryActionTypes.TEI_FOR_NEW_EVENT_RELATIONSHIPS_SAVED, + ), + map((action) => { const teiId = action.payload.response.importSummaries[0].reference; const { relationshipData, relationshipClientId, selections, triggerAction } = action.meta; const relationship = relationshipData.find(rd => rd.clientId === relationshipClientId); relationship.to.id = teiId; relationship.to.data = null; return saveNewEventRelationships(relationshipData, selections, triggerAction); - }); + })); diff --git a/src/core_modules/capture-core/components/Pages/NewEvent/DataEntry/epics/cancelNewSingleEvent.epics.js b/src/core_modules/capture-core/components/Pages/NewEvent/DataEntry/epics/cancelNewSingleEvent.epics.js index 4b03376fca..bf76f31a2a 100644 --- a/src/core_modules/capture-core/components/Pages/NewEvent/DataEntry/epics/cancelNewSingleEvent.epics.js +++ b/src/core_modules/capture-core/components/Pages/NewEvent/DataEntry/epics/cancelNewSingleEvent.epics.js @@ -1,5 +1,7 @@ // @flow import { push } from 'connected-react-router'; +import { ofType } from 'redux-observable'; +import { map } from 'rxjs/operators'; import { actionTypes as newEventDataEntryActionTypes, cancelNewEventNoWorkingListUpdateNeeded, @@ -10,11 +12,10 @@ import { import isSelectionsEqual from '../../../../App/isSelectionsEqual'; export const cancelNewEventEpic = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(newEventDataEntryActionTypes.START_CANCEL_SAVE_RETURN_TO_MAIN_PAGE) - .map(() => { - const state = store.getState(); + action$.pipe( + ofType(newEventDataEntryActionTypes.START_CANCEL_SAVE_RETURN_TO_MAIN_PAGE), + map(() => { + const state = store.value; if (!state.offline.online) { return cancelNewEventNoWorkingListUpdateNeeded(); } @@ -36,15 +37,14 @@ export const cancelNewEventEpic = (action$: InputObservable, store: ReduxStore) return cancelNewEventUpdateWorkingList(); } return cancelNewEventNoWorkingListUpdateNeeded(); - }); + })); export const cancelNewEventLocationChangeEpic = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(newEventDataEntryActionTypes.START_CANCEL_SAVE_RETURN_TO_MAIN_PAGE) - .map(() => { - const state = store.getState(); + action$.pipe( + ofType(newEventDataEntryActionTypes.START_CANCEL_SAVE_RETURN_TO_MAIN_PAGE), + map(() => { + const state = store.value; const programId = state.currentSelections.programId; const orgUnitId = state.currentSelections.orgUnitId; return push(`/programId=${programId}&orgUnitId=${orgUnitId}`); - }); + })); diff --git a/src/core_modules/capture-core/components/Pages/NewEvent/DataEntry/epics/newEventDataEntry.epics.js b/src/core_modules/capture-core/components/Pages/NewEvent/DataEntry/epics/newEventDataEntry.epics.js index 7ffc002835..4b65de3ec4 100644 --- a/src/core_modules/capture-core/components/Pages/NewEvent/DataEntry/epics/newEventDataEntry.epics.js +++ b/src/core_modules/capture-core/components/Pages/NewEvent/DataEntry/epics/newEventDataEntry.epics.js @@ -1,5 +1,7 @@ // @flow import log from 'loglevel'; +import { ofType } from 'redux-observable'; +import { map, filter } from 'rxjs/operators'; import { batchActions } from 'redux-batched-actions'; import { errorCreator } from 'capture-core-utils'; import { rulesExecutedPostUpdateField } from '../../../../DataEntry/actions/dataEntry.actions'; @@ -45,11 +47,10 @@ const errorMessages = { export const resetDataEntryForNewEventEpic = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(newEventDataEntryBatchActionTypes.SAVE_NEW_EVENT_ADD_ANOTHER_BATCH) - .map(() => { - const state = store.getState(); + action$.pipe( + ofType(newEventDataEntryBatchActionTypes.SAVE_NEW_EVENT_ADD_ANOTHER_BATCH), + map(() => { + const state = store.value; const programId = state.currentSelections.programId; // cancel if tracker program @@ -76,24 +77,23 @@ export const resetDataEntryForNewEventEpic = (action$: InputObservable, store: R [...resetDataEntry(metadataContainer.program, foundation, orgUnit)], batchActionTypes.RESET_DATA_ENTRY_ACTIONS_BATCH, ); - }); + })); export const openNewEventInDataEntryEpic = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType( - lockedSelectorActionTypes.NEW_EVENT_OPEN, - lockedSelectorActionTypes.PROGRAM_ID_SET, - lockedSelectorActionTypes.CATEGORY_OPTION_SET, - lockedSelectorActionTypes.SELECTIONS_FROM_URL_VALID, - crossPageActionTypes.SELECTIONS_COMPLETENESS_CALCULATED, - ) - .filter(() => { - const { app: { page } } = store.getState(); + action$.pipe( + ofType( + lockedSelectorActionTypes.NEW_EVENT_OPEN, + lockedSelectorActionTypes.PROGRAM_ID_SET, + lockedSelectorActionTypes.CATEGORY_OPTION_SET, + lockedSelectorActionTypes.SELECTIONS_FROM_URL_VALID, + crossPageActionTypes.SELECTIONS_COMPLETENESS_CALCULATED, + ), + filter(() => { + const { app: { page } } = store.value; return page === 'newEvent'; - }) - .filter((action) => { + }), + filter((action) => { const type = action.type; const triggeringActionType = action.payload && action.payload.triggeringActionType; if (type === crossPageActionTypes.SELECTIONS_COMPLETENESS_CALCULATED) { @@ -102,9 +102,9 @@ export const openNewEventInDataEntryEpic = (action$: InputObservable, store: Red ].includes(triggeringActionType); } return true; - }) - .map(() => { - const state = store.getState(); + }), + map(() => { + const state = store.value; const selectionsComplete = state.currentSelections.complete; if (!selectionsComplete) { return cancelOpenNewEventInDataEntry(); @@ -133,23 +133,22 @@ export const openNewEventInDataEntryEpic = (action$: InputObservable, store: Red [...openNewEventInDataEntry(metadataContainer.program, foundation, orgUnit)], batchActionTypes.OPEN_NEW_EVENT_IN_DATA_ENTRY_ACTIONS_BATCH, ); - }); + })); export const resetRecentlyAddedEventsWhenNewEventInDataEntryEpic = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType( - lockedSelectorActionTypes.SELECTIONS_FROM_URL_VALID, - lockedSelectorActionTypes.NEW_EVENT_OPEN, - lockedSelectorActionTypes.CATEGORY_OPTION_SET, - lockedSelectorActionTypes.PROGRAM_ID_SET, - crossPageActionTypes.SELECTIONS_COMPLETENESS_CALCULATED, - ) - .filter(() => { - const { app: { page } } = store.getState(); + action$.pipe( + ofType( + lockedSelectorActionTypes.SELECTIONS_FROM_URL_VALID, + lockedSelectorActionTypes.NEW_EVENT_OPEN, + lockedSelectorActionTypes.CATEGORY_OPTION_SET, + lockedSelectorActionTypes.PROGRAM_ID_SET, + crossPageActionTypes.SELECTIONS_COMPLETENESS_CALCULATED, + ), + filter(() => { + const { app: { page } } = store.value; return page === 'newEvent'; - }) - .filter((action) => { + }), + filter((action) => { // cancel if triggered by SELECTIONS_COMPLETENESS_CALCULATED and the underlying action is not SET_ORG_UNIT const type = action.type; if (type === crossPageActionTypes.SELECTIONS_COMPLETENESS_CALCULATED) { @@ -160,7 +159,7 @@ export const resetRecentlyAddedEventsWhenNewEventInDataEntryEpic = (action$: Inp } // cancel if selections are incomplete - const state = store.getState(); + const state = store.value; if (!state.currentSelections.complete) { return false; } @@ -169,20 +168,20 @@ export const resetRecentlyAddedEventsWhenNewEventInDataEntryEpic = (action$: Inp const programId = state.currentSelections.programId; const program = getProgramFromProgramIdThrowIfNotFound(programId); return !(program instanceof TrackerProgram); - }) - .map(() => { - const state = store.getState(); + }), + map(() => { + const state = store.value; const newEventsMeta = { sortById: 'created', sortByDirection: 'desc' }; const stageContainer = getStageForEventProgram(state.currentSelections.programId); // $FlowFixMe[incompatible-call] automated comment // $FlowFixMe[incompatible-use] automated comment const columnConfig = [...getDefaultMainColumnConfig(stageContainer.stage), ...getColumnMetaDataConfig(stageContainer.stage.stageForm)]; return resetList(listId, columnConfig, newEventsMeta, state.currentSelections); - }); + })); const runRulesForNewSingleEvent = (store: ReduxStore, dataEntryId: string, itemId: string, uid: string, fieldData?: ?FieldData) => { - const state = store.getState(); + const state = store.value; const formId = getDataEntryKey(dataEntryId, itemId); const programId = state.currentSelections.programId; const metadataContainer = getProgramAndStageFromProgramId(programId); @@ -226,23 +225,21 @@ const runRulesForNewSingleEvent = (store: ReduxStore, dataEntryId: string, itemI }; export const runRulesOnUpdateDataEntryFieldForSingleEventEpic = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(batchActionTypes.UPDATE_DATA_ENTRY_FIELD_NEW_SINGLE_EVENT_ACTION_BATCH) - .map(actionBatch => - actionBatch.payload.find(action => action.type === newEventDataEntryActionTypes.START_RUN_RULES_ON_UPDATE)) - .map((action) => { + action$.pipe( + ofType(batchActionTypes.UPDATE_DATA_ENTRY_FIELD_NEW_SINGLE_EVENT_ACTION_BATCH), + map(actionBatch => + actionBatch.payload.find(action => action.type === newEventDataEntryActionTypes.START_RUN_RULES_ON_UPDATE)), + map((action) => { const { dataEntryId, itemId, uid } = action.payload; return runRulesForNewSingleEvent(store, dataEntryId, itemId, uid); - }); + })); export const runRulesOnUpdateFieldForSingleEventEpic = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(batchActionTypes.UPDATE_FIELD_NEW_SINGLE_EVENT_ACTION_BATCH) - .map(actionBatch => - actionBatch.payload.find(action => action.type === newEventDataEntryActionTypes.START_RUN_RULES_ON_UPDATE)) - .map((action) => { + action$.pipe( + ofType(batchActionTypes.UPDATE_FIELD_NEW_SINGLE_EVENT_ACTION_BATCH), + map(actionBatch => + actionBatch.payload.find(action => action.type === newEventDataEntryActionTypes.START_RUN_RULES_ON_UPDATE)), + map((action) => { const { dataEntryId, itemId, uid, elementId, value, uiState } = action.payload; const fieldData: FieldData = { elementId, @@ -250,4 +247,4 @@ export const runRulesOnUpdateFieldForSingleEventEpic = (action$: InputObservable valid: uiState.valid, }; return runRulesForNewSingleEvent(store, dataEntryId, itemId, uid, fieldData); - }); + })); diff --git a/src/core_modules/capture-core/components/Pages/NewEvent/DataEntry/epics/saveNewSingleEvent.epics.js b/src/core_modules/capture-core/components/Pages/NewEvent/DataEntry/epics/saveNewSingleEvent.epics.js index 7517754e9c..1eb3b19604 100644 --- a/src/core_modules/capture-core/components/Pages/NewEvent/DataEntry/epics/saveNewSingleEvent.epics.js +++ b/src/core_modules/capture-core/components/Pages/NewEvent/DataEntry/epics/saveNewSingleEvent.epics.js @@ -1,5 +1,7 @@ // @flow import { push } from 'connected-react-router'; +import { ofType } from 'redux-observable'; +import { map } from 'rxjs/operators'; import { actionTypes as newEventDataEntryActionTypes, startSaveNewEventAfterReturnedToMainPage, @@ -9,11 +11,10 @@ import getDataEntryKey from '../../../../DataEntry/common/getDataEntryKey'; import { getNewEventServerData, getNewEventClientValues } from './getConvertedNewSingleEvent'; export const saveNewEventEpic = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(newEventDataEntryActionTypes.REQUEST_SAVE_RETURN_TO_MAIN_PAGE) - .map((action) => { - const state = store.getState(); + action$.pipe( + ofType(newEventDataEntryActionTypes.REQUEST_SAVE_RETURN_TO_MAIN_PAGE), + map((action) => { + const state = store.value; const payload = action.payload; const dataEntryKey = getDataEntryKey(payload.dataEntryId, payload.eventId); const formFoundation = payload.formFoundation; @@ -22,15 +23,14 @@ export const saveNewEventEpic = (action$: InputObservable, store: ReduxStore) => const serverData = getNewEventServerData(state, formFoundation, formClientValues, mainDataClientValues); const relationshipData = state.dataEntriesRelationships[dataEntryKey]; return startSaveNewEventAfterReturnedToMainPage(serverData, relationshipData, state.currentSelections); - }); + })); export const saveNewEventLocationChangeEpic = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(newEventDataEntryActionTypes.REQUEST_SAVE_RETURN_TO_MAIN_PAGE) - .map(() => { - const state = store.getState(); + action$.pipe( + ofType(newEventDataEntryActionTypes.REQUEST_SAVE_RETURN_TO_MAIN_PAGE), + map(() => { + const state = store.value; const programId = state.currentSelections.programId; const orgUnitId = state.currentSelections.orgUnitId; return push(`/programId=${programId}&orgUnitId=${orgUnitId}`); - }); + })); diff --git a/src/core_modules/capture-core/components/Pages/NewEvent/DataEntry/epics/saveNewSingleEventAddAnother.epics.js b/src/core_modules/capture-core/components/Pages/NewEvent/DataEntry/epics/saveNewSingleEventAddAnother.epics.js index ae95289aee..bbea02c972 100644 --- a/src/core_modules/capture-core/components/Pages/NewEvent/DataEntry/epics/saveNewSingleEventAddAnother.epics.js +++ b/src/core_modules/capture-core/components/Pages/NewEvent/DataEntry/epics/saveNewSingleEventAddAnother.epics.js @@ -1,5 +1,7 @@ // @flow import { batchActions } from 'redux-batched-actions'; +import { ofType } from 'redux-observable'; +import { map } from 'rxjs/operators'; import uuid from 'd2-utilizr/lib/uuid'; import moment from 'capture-core-utils/moment/momentResolver'; import { @@ -22,11 +24,10 @@ import { getNewEventServerData, getNewEventClientValues } from './getConvertedNe import { listId } from '../../RecentlyAddedEventsList/RecentlyAddedEventsList.const'; export const saveNewEventAddAnotherEpic = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(newEventDataEntryActionTypes.REQUEST_SAVE_NEW_EVENT_ADD_ANOTHER) - .map((action) => { - const state = store.getState(); + action$.pipe( + ofType(newEventDataEntryActionTypes.REQUEST_SAVE_NEW_EVENT_ADD_ANOTHER), + map((action) => { + const state = store.value; const payload = action.payload; const formFoundation = payload.formFoundation; const dataEntryKey = getDataEntryKey(payload.dataEntryId, payload.eventId); @@ -48,13 +49,12 @@ export const saveNewEventAddAnotherEpic = (action$: InputObservable, store: Redu newRecentlyAddedEvent(clientEvent, clientEventValues), prependListItem(listId, clientEvent.eventId), ], newEventDataEntryBatchActionTypes.SAVE_NEW_EVENT_ADD_ANOTHER_BATCH); - }); + })); export const saveNewEventAddAnotherFailedEpic = (action$: InputObservable) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(newEventDataEntryActionTypes.SAVE_FAILED_FOR_NEW_EVENT_ADD_ANOTHER) - .map((action) => { + action$.pipe( + ofType(newEventDataEntryActionTypes.SAVE_FAILED_FOR_NEW_EVENT_ADD_ANOTHER), + map((action) => { const clientId = action.meta.clientId; return removeListItem(listId, clientId); - }); + })); diff --git a/src/core_modules/capture-core/components/Pages/NewEvent/epics/cancelNewSingleEventSelectionsIncomplete.epics.js b/src/core_modules/capture-core/components/Pages/NewEvent/epics/cancelNewSingleEventSelectionsIncomplete.epics.js index 8806a577b9..1208a646e7 100644 --- a/src/core_modules/capture-core/components/Pages/NewEvent/epics/cancelNewSingleEventSelectionsIncomplete.epics.js +++ b/src/core_modules/capture-core/components/Pages/NewEvent/epics/cancelNewSingleEventSelectionsIncomplete.epics.js @@ -1,5 +1,7 @@ // @flow import { push } from 'connected-react-router'; +import { ofType } from 'redux-observable'; +import { map } from 'rxjs/operators'; import { actionTypes as dataEntrySelectionsIncompleteActionTypes, } from '../SelectionsIncomplete/dataEntrySelectionsIncomplete.actions'; @@ -17,12 +19,11 @@ const getArguments = (programId: string, orgUnitId: string) => { }; export const cancelNewEventIncompleteSelectionsLocationChangeEpic = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(dataEntrySelectionsIncompleteActionTypes.CANCEL_NEW_EVENT_FROM_INCOMPLETE_SELECTIONS_RETURN_TO_MAIN_PAGE) - .map(() => { - const state = store.getState(); + action$.pipe( + ofType(dataEntrySelectionsIncompleteActionTypes.CANCEL_NEW_EVENT_FROM_INCOMPLETE_SELECTIONS_RETURN_TO_MAIN_PAGE), + map(() => { + const state = store.value; const { programId, orgUnitId } = state.currentSelections; const args = getArguments(programId, orgUnitId); return push(`/${args}`); - }); + })); diff --git a/src/core_modules/capture-core/components/Pages/NewEvent/epics/newEvent.epics.js b/src/core_modules/capture-core/components/Pages/NewEvent/epics/newEvent.epics.js index 723f3db9b0..992c40b9fd 100644 --- a/src/core_modules/capture-core/components/Pages/NewEvent/epics/newEvent.epics.js +++ b/src/core_modules/capture-core/components/Pages/NewEvent/epics/newEvent.epics.js @@ -1,5 +1,7 @@ // @flow import { push } from 'connected-react-router'; +import { ofType } from 'redux-observable'; +import { map } from 'rxjs/operators'; import { lockedSelectorActionTypes } from '../../../LockedSelector/LockedSelector.actions'; const getArguments = (programId: string, orgUnitId: string) => { @@ -15,12 +17,11 @@ const getArguments = (programId: string, orgUnitId: string) => { }; export const openNewEventPageLocationChangeEpic = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(lockedSelectorActionTypes.NEW_EVENT_OPEN) - .map(() => { - const state = store.getState(); + action$.pipe( + ofType(lockedSelectorActionTypes.NEW_EVENT_OPEN), + map(() => { + const state = store.value; const { programId, orgUnitId } = state.currentSelections; const args = getArguments(programId, orgUnitId); return push(`/newEvent/${args}`); - }); + })); diff --git a/src/core_modules/capture-core/components/Pages/NewRelationship/RegisterTei/DataEntry/dataEntry.epics.js b/src/core_modules/capture-core/components/Pages/NewRelationship/RegisterTei/DataEntry/dataEntry.epics.js index 435f72cfa1..ae6fb6b894 100644 --- a/src/core_modules/capture-core/components/Pages/NewRelationship/RegisterTei/DataEntry/dataEntry.epics.js +++ b/src/core_modules/capture-core/components/Pages/NewRelationship/RegisterTei/DataEntry/dataEntry.epics.js @@ -1,5 +1,7 @@ // @flow -import { fromPromise } from 'rxjs/observable/fromPromise'; +import { from } from 'rxjs'; +import { ofType } from 'redux-observable'; +import { takeUntil, switchMap } from 'rxjs/operators'; import log from 'loglevel'; import i18n from '@dhis2/d2-i18n'; import { errorCreator } from 'capture-core-utils'; @@ -19,15 +21,14 @@ import { } from '../../../../../metaData'; export const openNewRelationshipRegisterTeiDataEntryEpic = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType( - registrationSectionActionTypes.PROGRAM_CHANGE, - registrationSectionActionTypes.ORG_UNIT_CHANGE, - registrationSectionActionTypes.PROGRAM_FILTER_CLEAR, - ) - .switchMap(() => { - const state = store.getState(); + action$.pipe( + ofType( + registrationSectionActionTypes.PROGRAM_CHANGE, + registrationSectionActionTypes.ORG_UNIT_CHANGE, + registrationSectionActionTypes.PROGRAM_FILTER_CLEAR, + ), + switchMap(() => { + const state = store.value; const { programId, orgUnit } = state.newRelationshipRegisterTei; const TETTypeId = state.newRelationship.selectedRelationshipType.to.trackedEntityTypeId; @@ -52,9 +53,9 @@ export const openNewRelationshipRegisterTeiDataEntryEpic = (action$: InputObserv state.generatedUniqueValuesCache[DATA_ENTRY_ID], ); - return fromPromise(openEnrollmentPromise) - // $FlowFixMe[prop-missing] automated comment - .takeUntil(action$.ofType(newRelationshipActionTypes.SELECT_FIND_MODE)); + return from(openEnrollmentPromise).pipe( + takeUntil(action$.pipe(ofType(newRelationshipActionTypes.SELECT_FIND_MODE))), + ); } if (orgUnit) { @@ -76,10 +77,10 @@ export const openNewRelationshipRegisterTeiDataEntryEpic = (action$: InputObserv state.generatedUniqueValuesCache[DATA_ENTRY_ID], ); - return fromPromise(openTeiPromise) - // $FlowFixMe[prop-missing] automated comment - .takeUntil(action$.ofType(newRelationshipActionTypes.SELECT_FIND_MODE)); + return from(openTeiPromise).pipe( + takeUntil(action$.pipe(ofType(newRelationshipActionTypes.SELECT_FIND_MODE))), + ); } return Promise.resolve(openDataEntryCancelled()); - }); + })); diff --git a/src/core_modules/capture-core/components/Pages/NewRelationship/RegisterTei/GeneralOutput/WarningsSection/SearchGroupDuplicate/searchGroupDuplicate.epics.js b/src/core_modules/capture-core/components/Pages/NewRelationship/RegisterTei/GeneralOutput/WarningsSection/SearchGroupDuplicate/searchGroupDuplicate.epics.js index 571302677d..6cf2e66866 100644 --- a/src/core_modules/capture-core/components/Pages/NewRelationship/RegisterTei/GeneralOutput/WarningsSection/SearchGroupDuplicate/searchGroupDuplicate.epics.js +++ b/src/core_modules/capture-core/components/Pages/NewRelationship/RegisterTei/GeneralOutput/WarningsSection/SearchGroupDuplicate/searchGroupDuplicate.epics.js @@ -1,5 +1,7 @@ // @flow -import { pipe } from 'capture-core-utils'; +import { pipe as pipeD2 } from 'capture-core-utils'; +import { ofType } from 'redux-observable'; +import { switchMap } from 'rxjs/operators'; import { getApi } from '../../../../../../../d2/d2Instance'; import { actionTypes, @@ -43,15 +45,14 @@ const getFormMetadata = (programId: ?string, tetId: string) => (programId ? getEnrollmentForm(programId) : getTETForm(tetId)); export const loadSearchGroupDuplicatesForReviewEpic = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(actionTypes.DUPLICATES_REVIEW, actionTypes.DUPLICATES_REVIEW_CHANGE_PAGE) - .switchMap((action) => { + action$.pipe( + ofType(actionTypes.DUPLICATES_REVIEW, actionTypes.DUPLICATES_REVIEW_CHANGE_PAGE), + switchMap((action) => { const isChangePage = action.type === actionTypes.DUPLICATES_REVIEW_CHANGE_PAGE; const requestPage = isChangePage ? action.payload.page : 1; const dataEntryId = 'relationship'; - const state = store.getState(); + const state = store.value; const { programId, orgUnit } = state.newRelationshipRegisterTei; const tetId = state.newRelationship.selectedRelationshipType.to.trackedEntityTypeId; const dataEntryKey = getDataEntryKey(dataEntryId, state.dataEntries[dataEntryId].itemId); @@ -72,7 +73,7 @@ export const loadSearchGroupDuplicatesForReviewEpic = (action$: InputObservable, return null; } - const serverValue = element.convertValue(value, pipe(convertFormToClient, convertClientToServer)); + const serverValue = element.convertValue(value, pipeD2(convertFormToClient, convertClientToServer)); return `${element.id}:LIKE:${serverValue}`; }) .filter(f => f); @@ -136,4 +137,4 @@ export const loadSearchGroupDuplicatesForReviewEpic = (action$: InputObservable, }) .catch(() => duplicatesForReviewRetrievalFailed()); - }); + })); diff --git a/src/core_modules/capture-core/components/Pages/NewRelationship/RegisterTei/open.epics.js b/src/core_modules/capture-core/components/Pages/NewRelationship/RegisterTei/open.epics.js index bff9814716..76bb9d8ccc 100644 --- a/src/core_modules/capture-core/components/Pages/NewRelationship/RegisterTei/open.epics.js +++ b/src/core_modules/capture-core/components/Pages/NewRelationship/RegisterTei/open.epics.js @@ -1,5 +1,7 @@ // @flow -import { fromPromise } from 'rxjs/observable/fromPromise'; +import { from } from 'rxjs'; +import { ofType } from 'redux-observable'; +import { filter, switchMap, takeUntil } from 'rxjs/operators'; import log from 'loglevel'; import i18n from '@dhis2/d2-i18n'; import { errorCreator } from 'capture-core-utils'; @@ -50,12 +52,11 @@ function getOrgUnitId(suggestedOrgUnitId: string, trackerProgram: ?TrackerProgra } export const openNewRelationshipRegisterTeiEpic = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(newRelationshipActionTypes.SELECT_FIND_MODE) - .filter(action => action.payload.findMode && action.payload.findMode === findModes.TEI_REGISTER) - .switchMap((action) => { // eslint-disable-line - const state = store.getState(); + action$.pipe( + ofType(newRelationshipActionTypes.SELECT_FIND_MODE), + filter(action => action.payload.findMode && action.payload.findMode === findModes.TEI_REGISTER), + switchMap((action) => { // eslint-disable-line + const state = store.value; const selectedRelationshipType = state.newRelationship.selectedRelationshipType; const { programId: suggestedProgramId, trackedEntityTypeId } = selectedRelationshipType.to; const { orgUnitId: suggestedOrgUnitId } = state.currentSelections; @@ -89,9 +90,8 @@ export const openNewRelationshipRegisterTeiEpic = (action$: InputObservable, sto state.generatedUniqueValuesCache[DATA_ENTRY_ID], ); - return fromPromise(openEnrollmentPromise) - // $FlowFixMe[prop-missing] automated comment - .takeUntil(action$.ofType(newRelationshipActionTypes.SELECT_FIND_MODE)); + return from(openEnrollmentPromise) + .takeUntil(action$.pipe(ofType(newRelationshipActionTypes.SELECT_FIND_MODE))); } // tei (tet attribues) form @@ -113,7 +113,7 @@ export const openNewRelationshipRegisterTeiEpic = (action$: InputObservable, sto state.generatedUniqueValuesCache[DATA_ENTRY_ID], ); - return fromPromise(openTeiPromise) - // $FlowFixMe[prop-missing] automated comment - .takeUntil(action$.ofType(newRelationshipActionTypes.SELECT_FIND_MODE)); - }); + return from(openTeiPromise).pipe( + takeUntil(action$.pipe(ofType(newRelationshipActionTypes.SELECT_FIND_MODE))), + ); + })); diff --git a/src/core_modules/capture-core/components/Pages/NewRelationship/TeiRelationship/teiRelationship.epics.js b/src/core_modules/capture-core/components/Pages/NewRelationship/TeiRelationship/teiRelationship.epics.js index 0ef8277f4e..fa0cb76c91 100644 --- a/src/core_modules/capture-core/components/Pages/NewRelationship/TeiRelationship/teiRelationship.epics.js +++ b/src/core_modules/capture-core/components/Pages/NewRelationship/TeiRelationship/teiRelationship.epics.js @@ -1,6 +1,8 @@ // @flow import { batchActions } from 'redux-batched-actions'; +import { ofType } from 'redux-observable'; +import { map, filter } from 'rxjs/operators'; import { batchActionTypes, } from './teiRelationship.actions'; @@ -27,12 +29,11 @@ import getSearchGroups from '../../../TeiSearch/getSearchGroups'; const searchId = 'relationshipTeiSearch'; export const openRelationshipTeiSearchEpic = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(newRelationshipActionTypes.SELECT_FIND_MODE) - .filter(action => action.payload.findMode && action.payload.findMode === 'TEI_SEARCH') - .map(() => { - const state = store.getState(); + action$.pipe( + ofType(newRelationshipActionTypes.SELECT_FIND_MODE), + filter(action => action.payload.findMode && action.payload.findMode === 'TEI_SEARCH'), + map(() => { + const state = store.value; const selectedRelationshipType = state.newRelationship.selectedRelationshipType; const { programId, trackedEntityTypeId } = selectedRelationshipType.to; @@ -50,21 +51,19 @@ export const openRelationshipTeiSearchEpic = (action$: InputObservable, store: R ...addFormDataActions, initializeTeiSearch(searchId, programId, trackedEntityTypeId), ], batchActionTypes.BATCH_OPEN_TEI_SEARCH); - }); + })); export const requestRelationshipTeiSearchEpic = (action$: InputObservable) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(teiSearchActionTypes.REQUEST_SEARCH_TEI) - .filter(action => action.payload.searchId && action.payload.searchId === searchId) - .map(() => setSearching()); + action$.pipe( + ofType(teiSearchActionTypes.REQUEST_SEARCH_TEI), + filter(action => action.payload.searchId && action.payload.searchId === searchId), + map(() => setSearching())); export const TeiRelationshipNewOrEditSearchEpic = (action$: InputObservable) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType( - teiSearchActionTypes.TEI_NEW_SEARCH, - teiSearchActionTypes.TEI_EDIT_SEARCH, - ) - .filter(action => action.payload.searchId && action.payload.searchId === searchId) - .map(() => unsetSearching()); + action$.pipe( + ofType( + teiSearchActionTypes.TEI_NEW_SEARCH, + teiSearchActionTypes.TEI_EDIT_SEARCH, + ), + filter(action => action.payload.searchId && action.payload.searchId === searchId), + map(() => unsetSearching())); diff --git a/src/core_modules/capture-core/components/Pages/ViewEvent/EventDetailsSection/EditEventDataEntry/editEventDataEntry.epics.js b/src/core_modules/capture-core/components/Pages/ViewEvent/EventDetailsSection/EditEventDataEntry/editEventDataEntry.epics.js index 7495e1703c..7586e78c3e 100644 --- a/src/core_modules/capture-core/components/Pages/ViewEvent/EventDetailsSection/EditEventDataEntry/editEventDataEntry.epics.js +++ b/src/core_modules/capture-core/components/Pages/ViewEvent/EventDetailsSection/EditEventDataEntry/editEventDataEntry.epics.js @@ -1,5 +1,6 @@ // @flow -import { ActionsObservable } from 'redux-observable'; +import { ActionsObservable, ofType } from 'redux-observable'; +import { map, filter } from 'rxjs/operators'; import { batchActions } from 'redux-batched-actions'; import { moment } from 'capture-core-utils/moment'; import { getFormattedStringFromMomentUsingEuropeanGlyphs } from 'capture-core-utils/date'; @@ -28,9 +29,10 @@ import { export const loadEditEventDataEntryEpic = (action$: ActionsObservable, store: ReduxStore) => - action$.ofType(eventDetailsActionTypes.START_SHOW_EDIT_EVENT_DATA_ENTRY) - .map(() => { - const state = store.getState(); + action$.pipe( + ofType(eventDetailsActionTypes.START_SHOW_EDIT_EVENT_DATA_ENTRY), + map(() => { + const state = store.value; const loadedValues = state.viewEventPage.loadedValues; const eventContainer = loadedValues.eventContainer; const orgUnit = state.organisationUnits[eventContainer.event.orgUnitId]; @@ -46,14 +48,13 @@ export const loadEditEventDataEntryEpic = (action$: ActionsObservable, store: Re showEditEventDataEntry(), ...openEventForEditInDataEntry(loadedValues, orgUnit, foundation, program), ]); - }); + })); export const saveEditedEventEpic = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(actionTypes.REQUEST_SAVE_EDIT_EVENT_DATA_ENTRY) - .map((action) => { - const state = store.getState(); + action$.pipe( + ofType(actionTypes.REQUEST_SAVE_EDIT_EVENT_DATA_ENTRY), + map((action) => { + const state = store.value; const payload = action.payload; const dataEntryKey = getDataEntryKey(payload.dataEntryId, payload.itemId); const eventId = state.dataEntries[payload.dataEntryId].eventId; @@ -107,23 +108,22 @@ export const saveEditedEventEpic = (action$: InputObservable, store: ReduxStore) updateEventContainer(eventContainer, orgUnit), startSaveEditEventDataEntry(eventId, serverData, state.currentSelections), ], batchActionTypes.START_SAVE_EDIT_EVENT_DATA_ENTRY_BATCH); - }); + })); export const saveEditedEventFailedEpic = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(actionTypes.SAVE_EDIT_EVENT_DATA_ENTRY_FAILED) - .filter((action) => { + action$.pipe( + ofType(actionTypes.SAVE_EDIT_EVENT_DATA_ENTRY_FAILED), + filter((action) => { // Check if current view event is failed event - const state = store.getState(); + const state = store.value; const viewEventPage = state.viewEventPage || {}; return viewEventPage.eventId && viewEventPage.eventId === action.meta.eventId; - }) - .map(() => { + }), + map(() => { // Revert event container if previous exists - const state = store.getState(); + const state = store.value; const viewEventPage = state.viewEventPage; const eventContainer = viewEventPage.loadedValues.eventContainer; const orgUnit = state.organisationUnits[eventContainer.event.orgUnitId]; return updateEventContainer(eventContainer, orgUnit); - }); + })); diff --git a/src/core_modules/capture-core/components/Pages/ViewEvent/EventDetailsSection/ViewEventDataEntry/viewEventDataEntry.epics.js b/src/core_modules/capture-core/components/Pages/ViewEvent/EventDetailsSection/ViewEventDataEntry/viewEventDataEntry.epics.js index 0dc8757f91..39e909f7a7 100644 --- a/src/core_modules/capture-core/components/Pages/ViewEvent/EventDetailsSection/ViewEventDataEntry/viewEventDataEntry.epics.js +++ b/src/core_modules/capture-core/components/Pages/ViewEvent/EventDetailsSection/ViewEventDataEntry/viewEventDataEntry.epics.js @@ -1,5 +1,7 @@ // @flow import { batchActions } from 'redux-batched-actions'; +import { ofType } from 'redux-observable'; +import { map, filter, switchMap } from 'rxjs/operators'; import { filterByInnerAction, mapToInnerAction, @@ -19,37 +21,36 @@ import { import { getProgramAndStageFromEvent } from '../../../../../metaData'; export const loadViewEventDataEntryEpic = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType( - viewEventPageActionTypes.ORG_UNIT_RETRIEVED_ON_URL_UPDATE, - viewEventPageActionTypes.ORG_UNIT_RETRIEVAL_FAILED_ON_URL_UPDATE, - viewEventPageActionTypes.START_OPEN_EVENT_FOR_VIEW, - viewEventPageActionTypes.UPDATE_EVENT_CONTAINER, - editEventDataEntryBatchActionTypes.START_SAVE_EDIT_EVENT_DATA_ENTRY_BATCH, - ) - .filter(action => + action$.pipe( + ofType( + viewEventPageActionTypes.ORG_UNIT_RETRIEVED_ON_URL_UPDATE, + viewEventPageActionTypes.ORG_UNIT_RETRIEVAL_FAILED_ON_URL_UPDATE, + viewEventPageActionTypes.START_OPEN_EVENT_FOR_VIEW, + viewEventPageActionTypes.UPDATE_EVENT_CONTAINER, + editEventDataEntryBatchActionTypes.START_SAVE_EDIT_EVENT_DATA_ENTRY_BATCH, + ), + filter(action => filterByInnerAction( action, editEventDataEntryBatchActionTypes.START_SAVE_EDIT_EVENT_DATA_ENTRY_BATCH, viewEventPageActionTypes.UPDATE_EVENT_CONTAINER, ), - ) - .map(action => + ), + map(action => mapToInnerAction( action, editEventDataEntryBatchActionTypes.START_SAVE_EDIT_EVENT_DATA_ENTRY_BATCH, viewEventPageActionTypes.UPDATE_EVENT_CONTAINER, ), - ) - .filter((action) => { + ), + filter((action) => { // Check if current view event is container event. Also check if in view mode. const eventId = action.payload.eventContainer.id; - const state = store.getState(); + const state = store.value; const viewEventPage = state.viewEventPage || {}; return viewEventPage.eventId === eventId && !viewEventPage.showEditEvent; - }) - .switchMap(async (action) => { + }), + switchMap(async (action) => { const eventContainer = action.payload.eventContainer; const orgUnit = action.payload.orgUnit; const metadataContainer = getProgramAndStageFromEvent(eventContainer.event); @@ -60,4 +61,4 @@ export const loadViewEventDataEntryEpic = (action$: InputObservable, store: Redu const program = metadataContainer.program; return batchActions((await loadViewEventDataEntry(eventContainer, orgUnit, foundation, program))); - }); + })); diff --git a/src/core_modules/capture-core/components/Pages/ViewEvent/Notes/viewEventNotes.epics.js b/src/core_modules/capture-core/components/Pages/ViewEvent/Notes/viewEventNotes.epics.js index f32eb21394..d8974f6b14 100644 --- a/src/core_modules/capture-core/components/Pages/ViewEvent/Notes/viewEventNotes.epics.js +++ b/src/core_modules/capture-core/components/Pages/ViewEvent/Notes/viewEventNotes.epics.js @@ -1,5 +1,7 @@ // @flow import { batchActions } from 'redux-batched-actions'; +import { ofType } from 'redux-observable'; +import { map } from 'rxjs/operators'; import { getCurrentUser } from 'capture-core/d2/d2Instance'; import uuid from 'd2-utilizr/lib/uuid'; import moment from 'capture-core-utils/moment/momentResolver'; @@ -24,14 +26,13 @@ import { const noteKey = 'viewEvent'; export const loadNotesForViewEventEpic = (action$: InputObservable) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType( - viewEventActionTypes.ORG_UNIT_RETRIEVED_ON_URL_UPDATE, - viewEventActionTypes.ORG_UNIT_RETRIEVAL_FAILED_ON_URL_UPDATE, - viewEventActionTypes.START_OPEN_EVENT_FOR_VIEW, - ) - .map((action) => { + action$.pipe( + ofType( + viewEventActionTypes.ORG_UNIT_RETRIEVED_ON_URL_UPDATE, + viewEventActionTypes.ORG_UNIT_RETRIEVAL_FAILED_ON_URL_UPDATE, + viewEventActionTypes.START_OPEN_EVENT_FOR_VIEW, + ), + map((action) => { const eventContainer = action.payload.eventContainer; const notes = (eventContainer && eventContainer.event && eventContainer.event.notes) || []; const convertedNotes = notes.map(note => ({ @@ -45,14 +46,13 @@ export const loadNotesForViewEventEpic = (action$: InputObservable) => eventNotesLoaded(), setNotes(noteKey, convertedNotes), ], viewEventNotesBatchActionTypes.LOAD_EVENT_NOTES_BATCH); - }); + })); export const addNoteForViewEventEpic = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(viewEventNotesActionTypes.REQUEST_SAVE_EVENT_NOTE) - .map((action) => { - const state = store.getState(); + action$.pipe( + ofType(viewEventNotesActionTypes.REQUEST_SAVE_EVENT_NOTE), + map((action) => { + const state = store.value; const payload = action.payload; const eventId = state.viewEventPage.eventId; @@ -76,10 +76,9 @@ export const addNoteForViewEventEpic = (action$: InputObservable, store: ReduxSt // $FlowFixMe[incompatible-call] automated comment addNote(noteKey, clientNote), ], viewEventNotesBatchActionTypes.SAVE_EVENT_NOTE_BATCH); - }); + })); export const saveNoteForViewEventFailedEpic = (action$: InputObservable) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(viewEventNotesActionTypes.SAVE_EVENT_NOTE_FAILED) - .map(action => removeNote(noteKey, action.meta.clientId)); + action$.pipe( + ofType(viewEventNotesActionTypes.SAVE_EVENT_NOTE_FAILED), + map(action => removeNote(noteKey, action.meta.clientId))); diff --git a/src/core_modules/capture-core/components/Pages/ViewEvent/Relationship/ViewEventRelationships.epics.js b/src/core_modules/capture-core/components/Pages/ViewEvent/Relationship/ViewEventRelationships.epics.js index 1e772a2033..5aecf13cdf 100644 --- a/src/core_modules/capture-core/components/Pages/ViewEvent/Relationship/ViewEventRelationships.epics.js +++ b/src/core_modules/capture-core/components/Pages/ViewEvent/Relationship/ViewEventRelationships.epics.js @@ -1,7 +1,8 @@ // @flow import { batchActions } from 'redux-batched-actions'; +import { ofType, ActionsObservable } from 'redux-observable'; +import { map, switchMap } from 'rxjs/operators'; import i18n from '@dhis2/d2-i18n'; -import { ActionsObservable } from 'redux-observable'; import uuid from 'd2-utilizr/lib/uuid'; import { addRelationship, @@ -31,12 +32,13 @@ import { getRelationshipNewTei } from '../../NewRelationship/RegisterTei'; const relationshipKey = 'viewEvent'; export const loadRelationshipsForViewEventEpic = (action$: ActionsObservable) => - action$.ofType( - viewEventActionTypes.ORG_UNIT_RETRIEVED_ON_URL_UPDATE, - viewEventActionTypes.ORG_UNIT_RETRIEVAL_FAILED_ON_URL_UPDATE, - viewEventActionTypes.START_OPEN_EVENT_FOR_VIEW, - ) - .switchMap((action) => { + action$.pipe( + ofType( + viewEventActionTypes.ORG_UNIT_RETRIEVED_ON_URL_UPDATE, + viewEventActionTypes.ORG_UNIT_RETRIEVAL_FAILED_ON_URL_UPDATE, + viewEventActionTypes.START_OPEN_EVENT_FOR_VIEW, + ), + switchMap((action) => { // Load event relationships const event = action.payload.eventContainer.event; return getRelationshipsForEvent(event.eventId, event.programId) @@ -44,27 +46,30 @@ export const loadRelationshipsForViewEventEpic = (action$: ActionsObservable) => eventRelationshipsLoaded(), setRelationships(relationshipKey, relationships || []), ], viewEventRelationshipsBatchActionTypes.LOAD_EVENT_RELATIONSHIPS_BATCH)); - }); + })); export const deleteRelationshipForViewEventEpic = (action$: ActionsObservable, store: ReduxStore) => - action$.ofType( - viewEventRelationshipsActionTypes.REQUEST_DELETE_EVENT_RELATIONSHIP, - ).map((action) => { - const clientId = action.payload.clientId; - const state = store.getState(); - const relationship = state.relationships.viewEvent.find(r => r.clientId === clientId); + action$.pipe( + ofType( + viewEventRelationshipsActionTypes.REQUEST_DELETE_EVENT_RELATIONSHIP, + ), + map((action) => { + const clientId = action.payload.clientId; + const state = store.value; + const relationship = state.relationships.viewEvent.find(r => r.clientId === clientId); - return batchActions([ - removeRelationship(relationshipKey, clientId), - startDeleteEventRelationship(relationship.id, clientId, state.currentSelections), - ], viewEventRelationshipsBatchActionTypes.DELETE_EVENT_RELATIONSHIP_BATCH); - }); + return batchActions([ + removeRelationship(relationshipKey, clientId), + startDeleteEventRelationship(relationship.id, clientId, state.currentSelections), + ], viewEventRelationshipsBatchActionTypes.DELETE_EVENT_RELATIONSHIP_BATCH); + })); export const addRelationshipForViewEventEpic = (action$: ActionsObservable, store: ReduxStore) => - action$.ofType(viewEventRelationshipsActionTypes.REQUEST_ADD_EVENT_RELATIONSHIP) - .map((action) => { - const state = store.getState(); + action$.pipe( + ofType(viewEventRelationshipsActionTypes.REQUEST_ADD_EVENT_RELATIONSHIP), + map((action) => { + const state = store.value; const eventId = state.viewEventPage.eventId; const existingRelationships = state.dataEntriesRelationships[relationshipKey] || []; const payload = action.payload; @@ -117,11 +122,12 @@ export const addRelationshipForViewEventEpic = (action$: ActionsObservable, stor addRelationship(relationshipKey, clientRelationship), saveAction, ], viewEventRelationshipsBatchActionTypes.SAVE_EVENT_RELATIONSHIP_BATCH); - }); + })); export const saveRelationshipAfterSavingTeiForViewEventEpic = (action$: ActionsObservable) => - action$.ofType(viewEventRelationshipsActionTypes.EVENT_RELATIONSHIP_NEW_TEI_SAVE_SUCCESS) - .map((action) => { + action$.pipe( + ofType(viewEventRelationshipsActionTypes.EVENT_RELATIONSHIP_NEW_TEI_SAVE_SUCCESS), + map((action) => { const teiId = action.payload.response.importSummaries[0].reference; const { clientData, selections, clientId } = action.meta; const to = clientData.to; @@ -132,20 +138,23 @@ export const saveRelationshipAfterSavingTeiForViewEventEpic = (action$: ActionsO relationships: [convertClientRelationshipToServer(clientData)], }; return startSaveEventRelationship(serverRelationshipData, selections, clientId); - }); + })); export const handleViewEventRelationshipSaveTeiFailedEpic = (action$: ActionsObservable) => - action$.ofType(viewEventRelationshipsActionTypes.EVENT_RELATIONSHIP_NEW_TEI_SAVE_FAILED) - .map(action => removeRelationship(relationshipKey, action.meta.clientId)); + action$.pipe( + ofType(viewEventRelationshipsActionTypes.EVENT_RELATIONSHIP_NEW_TEI_SAVE_FAILED), + map(action => removeRelationship(relationshipKey, action.meta.clientId))); export const saveRelationshipFailedForViewEventEpic = (action$: ActionsObservable) => - action$.ofType(viewEventRelationshipsActionTypes.SAVE_FAILED_FOR_EVENT_RELATIONSHIP) - .map(action => removeRelationship(relationshipKey, action.meta.clientId)); + action$.pipe( + ofType(viewEventRelationshipsActionTypes.SAVE_FAILED_FOR_EVENT_RELATIONSHIP), + map(action => removeRelationship(relationshipKey, action.meta.clientId))); export const relationshipSavedForViewEventEpic = (action$: ActionsObservable, store: ReduxStore) => - action$.ofType(viewEventRelationshipsActionTypes.EVENT_RELATIONSHIP_SAVED) - .map((action) => { - const state = store.getState(); + action$.pipe( + ofType(viewEventRelationshipsActionTypes.EVENT_RELATIONSHIP_SAVED), + map((action) => { + const state = store.value; const relationship = state.relationships[relationshipKey].find(r => r.clientId === action.meta.clientId); const relationshipId = action.payload.response.importSummaries[0].reference; @@ -154,5 +163,5 @@ export const relationshipSavedForViewEventEpic = (action$: ActionsObservable, st id: relationshipId, }; return updateRelationship(relationshipKey, updatedRelationship); - }); + })); diff --git a/src/core_modules/capture-core/components/Pages/ViewEvent/RightColumn/AssigneeSection/saveAssignee.epic.js b/src/core_modules/capture-core/components/Pages/ViewEvent/RightColumn/AssigneeSection/saveAssignee.epic.js index f798fbb53d..f8cde11736 100644 --- a/src/core_modules/capture-core/components/Pages/ViewEvent/RightColumn/AssigneeSection/saveAssignee.epic.js +++ b/src/core_modules/capture-core/components/Pages/ViewEvent/RightColumn/AssigneeSection/saveAssignee.epic.js @@ -1,15 +1,16 @@ // @flow +import { ofType } from 'redux-observable'; +import { map } from 'rxjs/operators'; import { actionTypes, saveAssignee } from './assigneeSection.actions'; import { getEventProgramThrowIfNotFound } from '../../../../../metaData'; import { convertValue as convertToServerValue } from '../../../../../converters/clientToServer'; import { convertMainEventClientToServer } from '../../../../../events/mainConverters'; export const saveAssigneeEpic = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(actionTypes.VIEW_EVENT_ASSIGNEE_SET) - .map(() => { - const state = store.getState(); + action$.pipe( + ofType(actionTypes.VIEW_EVENT_ASSIGNEE_SET), + map(() => { + const state = store.value; const eventId = state.viewEventPage.eventId; const eventContainer = state.viewEventPage.loadedValues.eventContainer; const { event: clientMainValues, values: clientValues } = eventContainer; @@ -31,4 +32,4 @@ export const saveAssigneeEpic = (action$: InputObservable, store: ReduxStore) => const currentSelectionSet = state.currentSelections; return saveAssignee(eventId, serverData, currentSelectionSet); - }); + })); diff --git a/src/core_modules/capture-core/components/Pages/ViewEvent/epics/viewEvent.epics.js b/src/core_modules/capture-core/components/Pages/ViewEvent/epics/viewEvent.epics.js index bd5e28f42d..b06a104aca 100644 --- a/src/core_modules/capture-core/components/Pages/ViewEvent/epics/viewEvent.epics.js +++ b/src/core_modules/capture-core/components/Pages/ViewEvent/epics/viewEvent.epics.js @@ -1,5 +1,7 @@ // @flow import log from 'loglevel'; +import { ofType } from 'redux-observable'; +import { map, switchMap } from 'rxjs/operators'; import { push } from 'connected-react-router'; import i18n from '@dhis2/d2-i18n'; import { errorCreator } from 'capture-core-utils'; @@ -29,11 +31,10 @@ import { getCategoriesDataFromEventAsync } from './getCategoriesDataFromEvent'; export const getEventOpeningFromEventListEpic = (action$: InputObservable, store: ReduxStore) => - // $FlowSuppress - // $FlowFixMe[prop-missing] automated comment - action$.ofType(eventListActionTypes.OPEN_VIEW_EVENT_PAGE) - .switchMap((action) => { - const state = store.getState(); + action$.pipe( + ofType(eventListActionTypes.OPEN_VIEW_EVENT_PAGE), + switchMap((action) => { + const state = store.value; const eventId = action.payload; return getEvent(eventId) .then((eventContainer) => { @@ -53,15 +54,14 @@ export const getEventOpeningFromEventListEpic = (action$: InputObservable, store return openViewEventPageFailed( i18n.t('Event could not be loaded. Are you sure it exists?')); }); - }); + })); export const getEventFromUrlEpic = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(viewEventActionTypes.VIEW_EVENT_FROM_URL) - .switchMap((action) => { + action$.pipe( + ofType(viewEventActionTypes.VIEW_EVENT_FROM_URL), + switchMap((action) => { const eventId = action.payload.eventId; - const prevProgramId = store.getState().currentSelections.programId; // used to clear columns and filters in eventlist if program id is changed + const prevProgramId = store.value.currentSelections.programId; // used to clear columns and filters in eventlist if program id is changed return getEvent(eventId) .then((eventContainer) => { if (!eventContainer) { @@ -81,13 +81,12 @@ export const getEventFromUrlEpic = (action$: InputObservable, store: ReduxStore) return eventFromUrlCouldNotBeRetrieved( i18n.t('Event could not be loaded. Are you sure it exists?')); }); - }); + })); export const getOrgUnitOnUrlUpdateEpic = (action$: InputObservable) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(viewEventActionTypes.EVENT_FROM_URL_RETRIEVED) - .switchMap((action) => { + action$.pipe( + ofType(viewEventActionTypes.EVENT_FROM_URL_RETRIEVED), + switchMap((action) => { const eventContainer = action.payload.eventContainer; return getApi() .get(`organisationUnits/${eventContainer.event.orgUnitId}`) @@ -99,23 +98,19 @@ export const getOrgUnitOnUrlUpdateEpic = (action$: InputObservable) => i18n.t('Organisation unit could not be loaded'))(details)); return orgUnitCouldNotBeRetrievedOnUrlUpdate(eventContainer); }); - }); + })); export const openViewPageLocationChangeEpic = (action$: InputObservable) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(eventListActionTypes.OPEN_VIEW_EVENT_PAGE) - .map(action => - push(`/viewEvent/${action.payload}`), - ); + action$.pipe( + ofType(eventListActionTypes.OPEN_VIEW_EVENT_PAGE), + map(action => push(`/viewEvent/${action.payload}`))); export const backToMainPageEpic = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(viewEventActionTypes.START_GO_BACK_TO_MAIN_PAGE) + action$.pipe( + ofType(viewEventActionTypes.START_GO_BACK_TO_MAIN_PAGE), // eslint-disable-next-line complexity - .map(() => { - const state = store.getState(); + map(() => { + const state = store.value; if (!state.offline.online) { return noWorkingListUpdateNeededOnBackToMainPage(); @@ -139,21 +134,19 @@ export const backToMainPageEpic = (action$: InputObservable, store: ReduxStore) } return noWorkingListUpdateNeededOnBackToMainPage(); - }); + })); export const backToMainPageLocationChangeEpic = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(viewEventActionTypes.START_GO_BACK_TO_MAIN_PAGE) - .map(() => { - const state = store.getState(); + action$.pipe( + ofType(viewEventActionTypes.START_GO_BACK_TO_MAIN_PAGE), + map(() => { + const state = store.value; const programId = state.currentSelections.programId; const orgUnitId = state.currentSelections.orgUnitId; return push(`/programId=${programId}&orgUnitId=${orgUnitId}`); - }); + })); export const openAddRelationshipForViewEventEpic = (action$: InputObservable) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(viewEventActionTypes.VIEW_EVENT_OPEN_NEW_RELATIONSHIP) - .map(() => initializeNewRelationship()); + action$.pipe( + ofType(viewEventActionTypes.VIEW_EVENT_OPEN_NEW_RELATIONSHIP), + map(() => initializeNewRelationship())); diff --git a/src/core_modules/capture-core/components/Pages/epics/calculateSelectionsCompleteness.epic.js b/src/core_modules/capture-core/components/Pages/epics/calculateSelectionsCompleteness.epic.js index d65e4fffa4..04bf35f05e 100644 --- a/src/core_modules/capture-core/components/Pages/epics/calculateSelectionsCompleteness.epic.js +++ b/src/core_modules/capture-core/components/Pages/epics/calculateSelectionsCompleteness.epic.js @@ -1,5 +1,7 @@ // @flow import programs from 'capture-core/metaDataMemoryStores/programCollection/programCollection'; +import { ofType } from 'redux-observable'; +import { map } from 'rxjs/operators'; import { urlActionTypes as newEnrollmentUrlActionTypes, } from '../NewEnrollment'; @@ -33,22 +35,20 @@ const calculateCompleteStatus = (state: CurrentSelectionsState) => { return true; }; -// todo file not used! export const calculateSelectionsCompletenessEpic = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType( - lockedSelectorActionTypes.PROGRAM_ID_SET, - lockedSelectorActionTypes.CATEGORY_OPTION_SET, - lockedSelectorActionTypes.SELECTIONS_FROM_URL_VALID, - newEnrollmentUrlActionTypes.VALID_SELECTIONS_FROM_URL, - crossPageActionTypes.AFTER_SETTING_ORG_UNIT_SKIP_CATEGORIES_RESET, - crossPageActionTypes.AFTER_SETTING_ORG_UNIT_DO_CATEGORIES_RESET, - ) - .map((action) => { - const isComplete = calculateCompleteStatus(store.getState().currentSelections); + action$.pipe( + ofType( + lockedSelectorActionTypes.PROGRAM_ID_SET, + lockedSelectorActionTypes.CATEGORY_OPTION_SET, + lockedSelectorActionTypes.SELECTIONS_FROM_URL_VALID, + newEnrollmentUrlActionTypes.VALID_SELECTIONS_FROM_URL, + crossPageActionTypes.AFTER_SETTING_ORG_UNIT_SKIP_CATEGORIES_RESET, + crossPageActionTypes.AFTER_SETTING_ORG_UNIT_DO_CATEGORIES_RESET, + ), + map((action) => { + const isComplete = calculateCompleteStatus(store.value.currentSelections); return selectionsCompletenessCalculated( isComplete, (action.payload && action.payload.triggeringActionType) || action.type, ); - }); + })); diff --git a/src/core_modules/capture-core/components/Pages/epics/resetCategoriesAfterSettingOrgUnitIfApplicable.epic.js b/src/core_modules/capture-core/components/Pages/epics/resetCategoriesAfterSettingOrgUnitIfApplicable.epic.js index f9adcb4b4e..2004f28608 100644 --- a/src/core_modules/capture-core/components/Pages/epics/resetCategoriesAfterSettingOrgUnitIfApplicable.epic.js +++ b/src/core_modules/capture-core/components/Pages/epics/resetCategoriesAfterSettingOrgUnitIfApplicable.epic.js @@ -1,4 +1,6 @@ // @flow +import { ofType } from 'redux-observable'; +import { switchMap } from 'rxjs/operators'; import { resetCategoriesAfterSettingOrgUnit, skipCategoriesResetAfterSettingOrgUnit, @@ -19,13 +21,11 @@ async function isOptionAssociatedWithOrganisationUnit(categoryOptionId: string, } export const resetCategoriesAfterSettingOrgUnitIfApplicableEpic = (action$: InputObservable, store: ReduxStore) => - action$ - - // $FlowFixMe[prop-missing] automated comment - .ofType(lockedSelectorActionTypes.ORG_UNIT_ID_SET) - .switchMap((action) => { + action$.pipe( + ofType(lockedSelectorActionTypes.ORG_UNIT_ID_SET), + switchMap((action) => { const orgUnitId = action.payload.id; - const selectedCategories = store.getState().currentSelections.categories; + const selectedCategories = store.value.currentSelections.categories; if (!selectedCategories) { return Promise.resolve(skipCategoriesResetAfterSettingOrgUnit(action.type)); } @@ -63,5 +63,5 @@ export const resetCategoriesAfterSettingOrgUnitIfApplicableEpic = (action$: Inpu return resetCategoriesAfterSettingOrgUnit(notAssociated, action.type); }); - }); + })); diff --git a/src/core_modules/capture-core/components/Pages/epics/resetProgramAfterSettingOrgUnitIfApplicable.epic.js b/src/core_modules/capture-core/components/Pages/epics/resetProgramAfterSettingOrgUnitIfApplicable.epic.js index cc87ba88c6..36ceb1c9b6 100644 --- a/src/core_modules/capture-core/components/Pages/epics/resetProgramAfterSettingOrgUnitIfApplicable.epic.js +++ b/src/core_modules/capture-core/components/Pages/epics/resetProgramAfterSettingOrgUnitIfApplicable.epic.js @@ -1,5 +1,7 @@ // @flow import programs from 'capture-core/metaDataMemoryStores/programCollection/programCollection'; +import { ofType } from 'redux-observable'; +import { map, filter } from 'rxjs/operators'; import { resetProgramIdBase, } from '../../LockedSelector/QuickSelector/actions/QuickSelector.actions'; @@ -23,14 +25,12 @@ const programShouldReset = (orgUnitId, currentlySelectedProgramId) => { }; export const resetProgramAfterSettingOrgUnitIfApplicableEpic = (action$: InputObservable, store: ReduxStore) => - action$ - - // $FlowFixMe[prop-missing] automated comment - .ofType(lockedSelectorActionTypes.ORG_UNIT_ID_SET) - .filter((action) => { + action$.pipe( + ofType(lockedSelectorActionTypes.ORG_UNIT_ID_SET), + filter((action) => { const orgUnitId = action.payload.id; - const currentlySelectedProgramId = store.getState().currentSelections.programId; + const currentlySelectedProgramId = store.value.currentSelections.programId; return programShouldReset(orgUnitId, currentlySelectedProgramId); - }) - .map(() => resetProgramIdBase()); + }), + map(() => resetProgramIdBase())); diff --git a/src/core_modules/capture-core/components/TeiSearch/SearchOrgUnitSelector/searchOrgUnitSelector.epics.js b/src/core_modules/capture-core/components/TeiSearch/SearchOrgUnitSelector/searchOrgUnitSelector.epics.js index f4848db1e2..37eff97179 100644 --- a/src/core_modules/capture-core/components/TeiSearch/SearchOrgUnitSelector/searchOrgUnitSelector.epics.js +++ b/src/core_modules/capture-core/components/TeiSearch/SearchOrgUnitSelector/searchOrgUnitSelector.epics.js @@ -1,10 +1,11 @@ // @flow import log from 'loglevel'; import isArray from 'd2-utilizr/lib/isArray'; -import { fromPromise } from 'rxjs/observable/fromPromise'; +import { from } from 'rxjs'; import getD2 from 'capture-core/d2/d2Instance'; import { errorCreator } from 'capture-core-utils'; - +import { ofType } from 'redux-observable'; +import { map, concatMap, takeUntil, filter } from 'rxjs/operators'; import { actionTypes as teiSearchActionTypes, } from '../actions/teiSearch.actions'; @@ -22,11 +23,11 @@ const RETRIEVE_ERROR = 'Could not retrieve registering unit list'; const isInitializeTeiSearch = (action: Object, searchId: string) => action.type === teiSearchActionTypes.INITIALIZE_TEI_SEARCH && - action.payload.searchId === searchId; + action.payload.searchId === searchId; const isRequestFilterOrgUnits = (action: Object, searchId: string) => action.type === searchOrgUnitActionTypes.TEI_SEARCH_REQUEST_FILTER_ORG_UNITS && - action.payload.searchId === searchId; + action.payload.searchId === searchId; const cancelActionFilter = (action: Object, searchId: string) => { @@ -38,13 +39,13 @@ const cancelActionFilter = (action: Object, searchId: string) => { // get organisation units based on search criteria export const teiSearchFilterOrgUnitsEpic = (action$: InputObservable) => - // $FlowFixMe - action$.ofType(searchOrgUnitActionTypes.TEI_SEARCH_REQUEST_FILTER_ORG_UNITS) - .concatMap((action) => { + action$.pipe( + ofType(searchOrgUnitActionTypes.TEI_SEARCH_REQUEST_FILTER_ORG_UNITS), + concatMap((action) => { const searchText = action.payload.searchText; const searchId = action.payload.searchId; - return fromPromise(getD2() + return from(getD2() .models .organisationUnits .list({ @@ -59,10 +60,9 @@ export const teiSearchFilterOrgUnitsEpic = (action$: InputObservable) => }) .then(orgUnitCollection => ({ regUnitArray: orgUnitCollection.toArray(), searchText, searchId })) .catch(error => ({ error, searchId })), - ) - .takeUntil(action$.filter(a => cancelActionFilter(a, searchId))); - }) - .map((resultContainer) => { + ).pipe(takeUntil(action$.pipe(filter(a => cancelActionFilter(a, searchId))))); + }), + map((resultContainer) => { if (resultContainer.error) { log.error(errorCreator(RETRIEVE_ERROR)( { error: resultContainer.error, method: 'searchRegisteringUnitListEpic' }), @@ -79,4 +79,4 @@ export const teiSearchFilterOrgUnitsEpic = (action$: InputObservable) => displayName: unit.displayName, })); return filteredOrgUnitsRetrieved(resultContainer.searchId, regUnits, resultContainer.searchText); - }); + })); diff --git a/src/core_modules/capture-core/components/TeiSearch/epics/teiSearch.epics.js b/src/core_modules/capture-core/components/TeiSearch/epics/teiSearch.epics.js index 49af10f228..b677d7ef9a 100644 --- a/src/core_modules/capture-core/components/TeiSearch/epics/teiSearch.epics.js +++ b/src/core_modules/capture-core/components/TeiSearch/epics/teiSearch.epics.js @@ -1,6 +1,8 @@ // @flow -import isArray from 'd2-utilizr/lib/isArray'; -import { fromPromise } from 'rxjs/observable/fromPromise'; +import isArray from 'd2-utilizr/src/isArray'; +import { from } from 'rxjs'; +import { ofType } from 'redux-observable'; +import { map, takeUntil, switchMap, filter } from 'rxjs/operators'; import { batchActions } from 'redux-batched-actions'; import { convertValue as convertToClient } from '../../../converters/formToClient'; import { convertValue as convertToServer } from '../../../converters/clientToServer'; @@ -89,10 +91,10 @@ const searchTei = (state: ReduxState, searchId: string, formId: string, searchGr }; export const teiSearchChangePageEpic = (action$: InputObservable, store: ReduxStore) => - // $FlowFixMe[prop-missing] automated comment - action$.ofType(actionTypes.TEI_SEARCH_RESULTS_CHANGE_PAGE) - .switchMap((action) => { - const state = store.getState(); + action$.pipe( + ofType(actionTypes.TEI_SEARCH_RESULTS_CHANGE_PAGE), + switchMap((action) => { + const state = store.value; const { pageNumber, searchId } = action.payload; const currentTeiSearch = state.teiSearch[searchId]; const searchTeiPromise = searchTei( @@ -102,42 +104,43 @@ export const teiSearchChangePageEpic = (action$: InputObservable, store: ReduxSt currentTeiSearch.searchResults.searchGroupId, pageNumber, ); - return fromPromise(searchTeiPromise) - // $FlowFixMe[prop-missing] automated comment - .takeUntil(action$.ofType( - actionTypes.REQUEST_SEARCH_TEI, - actionTypes.TEI_SEARCH_RESULTS_CHANGE_PAGE, - )) - .takeUntil( - action$.filter(ab => - isArray(ab.payload) && ab.payload.some(a => a.type === actionTypes.INITIALIZE_TEI_SEARCH))); - }); + return from(searchTeiPromise).pipe( + takeUntil( + action$.pipe(ofType( + actionTypes.REQUEST_SEARCH_TEI, + actionTypes.TEI_SEARCH_RESULTS_CHANGE_PAGE, + ))), + takeUntil( + action$.pipe( + filter(ab => + isArray(ab.payload) && ab.payload.some(a => a.type === actionTypes.INITIALIZE_TEI_SEARCH)))), + ); + })); export const teiSearchEpic = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(actionTypes.REQUEST_SEARCH_TEI) - .switchMap((action) => { - const state = store.getState(); + action$.pipe( + ofType(actionTypes.REQUEST_SEARCH_TEI), + switchMap((action) => { + const state = store.value; const { formId, searchGroupId, searchId } = action.payload; const searchTeiPromise = searchTei(state, searchId, formId, searchGroupId); - return fromPromise(searchTeiPromise) - // $FlowFixMe[prop-missing] automated comment - .takeUntil(action$.ofType( - actionTypes.REQUEST_SEARCH_TEI, - actionTypes.TEI_SEARCH_RESULTS_CHANGE_PAGE, - )) - .takeUntil( - action$.filter(ab => - isArray(ab.payload) && ab.payload.some(a => a.type === actionTypes.INITIALIZE_TEI_SEARCH))); - }); + return from(searchTeiPromise).pipe( + takeUntil(action$.pipe( + ofType( + actionTypes.REQUEST_SEARCH_TEI, + actionTypes.TEI_SEARCH_RESULTS_CHANGE_PAGE, + ))), + takeUntil( + action$.pipe( + filter(ab => + isArray(ab.payload) && ab.payload.some(a => a.type === actionTypes.INITIALIZE_TEI_SEARCH))))); + })); export const teiSearchSetProgramEpic = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(programSelectorActionTypes.TEI_SEARCH_START_SET_PROGRAM) - .map((action) => { - const state = store.getState(); + action$.pipe( + ofType(programSelectorActionTypes.TEI_SEARCH_START_SET_PROGRAM), + map((action) => { + const state = store.value; const searchId = action.payload.searchId; const programId = action.payload.programId; let trackedEntityTypeId = state.teiSearch[searchId].selectedTrackedEntityTypeId; @@ -160,14 +163,13 @@ export const teiSearchSetProgramEpic = (action$: InputObservable, store: ReduxSt ...addFormDataActions, setProgramAndTrackedEntityType(searchId, programId, trackedEntityTypeId), ], batchActionTypes.BATCH_SET_TEI_SEARCH_PROGRAM_AND_TET); - }); + })); export const teiNewSearchEpic = (action$: InputObservable, store: ReduxStore) => - - // $FlowFixMe[prop-missing] automated comment - action$.ofType(actionTypes.TEI_NEW_SEARCH) - .map((action) => { - const state = store.getState(); + action$.pipe( + ofType(actionTypes.TEI_NEW_SEARCH), + map((action) => { + const state = store.value; const searchId = action.payload.searchId; const currentTeiSearch = state.teiSearch[searchId]; @@ -183,4 +185,4 @@ export const teiNewSearchEpic = (action$: InputObservable, store: ReduxStore) => return batchActions([ ...addFormDataActions, ], batchActionTypes.RESET_SEARCH_FORMS); - }); + })); diff --git a/src/core_modules/capture-core/flow/typeDeclarations.js b/src/core_modules/capture-core/flow/typeDeclarations.js index 4a1c02a666..f24b6d5d41 100644 --- a/src/core_modules/capture-core/flow/typeDeclarations.js +++ b/src/core_modules/capture-core/flow/typeDeclarations.js @@ -37,7 +37,7 @@ declare type ReduxDispatch = (action: { }) => void; declare type ReduxStore = { - getState: () => ReduxState, + value: ReduxState, dispatch: ReduxDispatch } diff --git a/src/core_modules/capture-core/init/init.epics.js b/src/core_modules/capture-core/init/init.epics.js index c749dfdad1..daf7b00447 100644 --- a/src/core_modules/capture-core/init/init.epics.js +++ b/src/core_modules/capture-core/init/init.epics.js @@ -1,12 +1,14 @@ // @flow +import { ofType } from 'redux-observable'; +import { concatMap } from 'rxjs/operators'; import { actionTypes, loadCoreFailed } from './init.actions'; import getOrgUnitRootsActions from './getOrgUnitRootsActions'; import { loadCoreSuccessBatch } from './init.actionBatches'; // $FlowFixMe[cannot-resolve-name] automated comment export const loadCoreEpic = (action$: ActionsObservable) => - action$ - .ofType(actionTypes.CORE_LOAD) - .concatMap(() => getOrgUnitRootsActions() + action$.pipe( + ofType(actionTypes.CORE_LOAD), + concatMap(() => getOrgUnitRootsActions() .then(rootsActions => loadCoreSuccessBatch(rootsActions)) - .catch(error => loadCoreFailed(error))); + .catch(error => loadCoreFailed(error)))); diff --git a/src/entry/addRxjsOperators.js b/src/entry/addRxjsOperators.js deleted file mode 100644 index 90d3a59f13..0000000000 --- a/src/entry/addRxjsOperators.js +++ /dev/null @@ -1,8 +0,0 @@ -// @flow -import 'rxjs/add/operator/map'; -import 'rxjs/add/operator/switchMap'; -import 'rxjs/add/operator/concatMap'; -import 'rxjs/add/operator/filter'; -import 'rxjs/add/operator/takeUntil'; -import 'rxjs/add/operator/catch'; -import 'rxjs/add/operator/mergeAll'; diff --git a/src/entry/entry.epics.js b/src/entry/entry.epics.js index 5b2599e4e4..f5041680e7 100644 --- a/src/entry/entry.epics.js +++ b/src/entry/entry.epics.js @@ -1,24 +1,29 @@ // @flow import log from 'loglevel'; +import { ofType } from 'redux-observable'; +import { map } from 'rxjs/operators'; import { errorCreator } from 'capture-core-utils'; import { loadCore, actionTypes as coreActionTypes, batchActionTypes as coreBatchActionTypes } from 'capture-core/init'; import { loadAppSuccess, loadAppFailed, actionTypes } from './entry.actions'; // $FlowFixMe[cannot-resolve-name] automated comment export const triggerLoadCoreEpic = (action$: ActionsObservable) => - action$.ofType(actionTypes.APP_LOAD) - .map(() => loadCore()); + action$.pipe( + ofType(actionTypes.APP_LOAD), + map(() => loadCore())); export const loadAppEpic = (action$: ActionsObservable) => - action$.ofType(coreBatchActionTypes.CORE_LOAD_SUCCESS_BATCH) - .map(() => loadAppSuccess({ + action$.pipe( + ofType(coreBatchActionTypes.CORE_LOAD_SUCCESS_BATCH), + map(() => loadAppSuccess({ headerBarHeight: 48, - })); + }))); export const loadCoreFailedEpic = (action$: ActionsObservable) => - action$.ofType(coreActionTypes.CORE_LOAD_FAILED) - .map((action) => { + action$.pipe( + ofType(coreActionTypes.CORE_LOAD_FAILED), + map((action) => { const { error } = action.payload; log.error(errorCreator('load core failed')({ error })); return loadAppFailed('APP FAILED TO LOAD. SEE LOG FOR DETAILS'); - }); + })); diff --git a/src/entry/entry.js b/src/entry/entry.js index 28f7ea7037..d0a8684ac9 100644 --- a/src/entry/entry.js +++ b/src/entry/entry.js @@ -11,7 +11,6 @@ import JssProvider from 'react-jss/lib/JssProvider'; import { create } from 'jss'; import { createGenerateClassName, jssPreset } from '@material-ui/core/styles'; import type { HashHistory } from 'history/createHashHistory'; -import './addRxjsOperators'; import { AppLoader } from '../components/AppLoader'; import { App } from '../components/App'; import { loadApp } from './entry.actions'; diff --git a/src/store/getStore.js b/src/store/getStore.js index 33ed52307a..6d6cbe80c8 100644 --- a/src/store/getStore.js +++ b/src/store/getStore.js @@ -6,27 +6,19 @@ import { composeWithDevTools } from 'redux-devtools-extension/developmentOnly'; import { enableBatching } from 'redux-batched-actions'; import { createLogger } from 'redux-logger'; import { connectRouter, routerMiddleware } from 'connected-react-router'; +import { buildReducersFromDescriptions } from 'capture-core/trackerRedux/trackerReducer'; +import environments from 'capture-core/constants/environments'; import type { BrowserHistory } from 'history/createBrowserHistory'; import type { HashHistory } from 'history/createHashHistory'; import { createOffline } from '@redux-offline/redux-offline'; import offlineConfig from '@redux-offline/redux-offline/lib/defaults'; -import { buildReducersFromDescriptions } from 'capture-core/trackerRedux/trackerReducer'; -import environments from 'capture-core/constants/environments'; import { effectConfig, discardConfig, queueConfig } from 'capture-core/trackerOffline/trackerOfflineConfig'; import getPersistOptions from './persist/persistOptionsGetter'; import reducerDescriptions from '../reducers/descriptions/trackerCapture.reducerDescriptions'; import epics from '../epics/trackerCapture.epics'; -export default function getStore(history: BrowserHistory | HashHistory, onRehydrated: () => void) { - const middleWares = [createEpicMiddleware(epics), routerMiddleware(history)]; - - if (process.env.NODE_ENV !== environments.prod) { - middleWares.push( - createLogger({ }), - ); - } - +export function getStore(history: BrowserHistory | HashHistory, onRehydrated: () => void) { const reducersFromDescriptions = buildReducersFromDescriptions(reducerDescriptions); const rootReducer = combineReducers({ @@ -34,6 +26,7 @@ export default function getStore(history: BrowserHistory | HashHistory, onRehydr router: connectRouter(history), }); + // https://github.com/redux-offline/redux-offline/blob/32e4c98ec782672347b42a7936631df5c6340b77/docs/api/config.md const { middleware: offlineMiddleware, enhanceReducer: offlineEnhanceReducer, @@ -47,16 +40,25 @@ export default function getStore(history: BrowserHistory | HashHistory, onRehydr persistOptions: getPersistOptions(), }); + const epicMiddleware = createEpicMiddleware({ + dependencies: {}, + }); + + const middleware = [epicMiddleware, routerMiddleware(history), offlineMiddleware]; + + if (process.env.NODE_ENV !== environments.prod) { + middleware.push(createLogger({})); + } + // $FlowFixMe[missing-annot] automated comment - return createStore( - enableBatching(offlineEnhanceReducer(rootReducer)), composeWithDevTools( - compose( - offlineEnhanceStore, - applyMiddleware( - ...middleWares, - offlineMiddleware, - ), - ), + const store = createStore( + enableBatching(offlineEnhanceReducer(rootReducer)), + composeWithDevTools( + compose(offlineEnhanceStore, applyMiddleware(...middleware)), ), ); + + epicMiddleware.run(epics); + + return store; } diff --git a/src/unload/addBeforeUnloadEventListener.js b/src/unload/addBeforeUnloadEventListener.js index 6a4c395ce0..39a6d68273 100644 --- a/src/unload/addBeforeUnloadEventListener.js +++ b/src/unload/addBeforeUnloadEventListener.js @@ -7,7 +7,7 @@ export default function addBeforeUnloadEventListener(store: ReduxStore) { cleanUpCommon(store); // cleanUp(store); // should move clean up from core to app! - if (store.getState().offline.outbox.length > 0) { + if (store.value.offline.outbox.length > 0) { const msg = 'Unsaved events!'; e.returnValue = msg; return msg; diff --git a/yarn.lock b/yarn.lock index db047b1b5b..eb750acbae 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7586,10 +7586,6 @@ gherkin@^5.0.0, gherkin@^5.1.0: resolved "https://registry.yarnpkg.com/gherkin/-/gherkin-5.1.0.tgz#684bbb03add24eaf7bdf544f58033eb28fb3c6d5" integrity sha1-aEu7A63STq9731RPWAM+so+zxtU= -gitbook-plugin-github@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/gitbook-plugin-github/-/gitbook-plugin-github-2.0.0.tgz#5166e763cfcc402d432880b7a6c85c1c54b56a8d" - glob-base@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" @@ -13354,11 +13350,10 @@ redux-logger@^3.0.6: dependencies: deep-diff "^0.3.5" -redux-observable@^0.18.0: - version "0.18.0" - resolved "https://registry.yarnpkg.com/redux-observable/-/redux-observable-0.18.0.tgz#48de1f35554b7ba23a88b18379ca1c93f5124197" - dependencies: - gitbook-plugin-github "^2.0.0" +redux-observable@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/redux-observable/-/redux-observable-1.2.0.tgz#ff51b6c6be2598e9b5e89fc36639186bb0e669c7" + integrity sha512-yeR90RP2WzZzCxxnQPlh2uFzyfFLsfXu8ROh53jGDPXVqj71uNDMmvi/YKQkd9ofiVoO4OYb1snbowO49tCEMg== redux-persist@^4.6.0: version "4.10.2" @@ -13878,7 +13873,7 @@ rx@^4.1.0: resolved "https://registry.yarnpkg.com/rx/-/rx-4.1.0.tgz#a5f13ff79ef3b740fe30aa803fb09f98805d4782" integrity sha1-pfE/957zt0D+MKqAP7CfmIBdR4I= -rxjs@^5.5.10, rxjs@^5.5.7: +rxjs@^5.5.7: version "5.5.12" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.5.12.tgz#6fa61b8a77c3d793dbaf270bee2f43f652d741cc" integrity sha512-xx2itnL5sBbqeeiVgNPVuQQ1nC8Jp2WfNJhXWHmElW9YmrpS9UVnNzhP3EH3HFqexO5Tlp8GhYY+WEcqcVMvGw== @@ -14926,6 +14921,7 @@ svgo@^1.2.2: symbol-observable@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.1.tgz#8340fc4702c3122df5d22288f88283f513d3fdd4" + integrity sha1-g0D8RwLDEi310iKI+IKD9RPT/dQ= symbol-observable@1.2.0, symbol-observable@^1.0.4, symbol-observable@^1.1.0, symbol-observable@^1.2.0: version "1.2.0"