Skip to content

Commit

Permalink
tweak(lesmis): RN-1441: Upgrade React Query to V4 (#5873)
Browse files Browse the repository at this point in the history
* upgrade

* Update yarn.lock
  • Loading branch information
hrazasalman authored Sep 10, 2024
1 parent 72329be commit 7834a55
Show file tree
Hide file tree
Showing 21 changed files with 23 additions and 22 deletions.
3 changes: 2 additions & 1 deletion packages/lesmis/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "^4.0.0-alpha.57",
"@material-ui/styles": "^4.9.10",
"@tanstack/react-query": "4.36.1",
"@tanstack/react-query-devtools": "4.36.1",
"@tupaia/access-policy": "workspace:*",
"@tupaia/admin-panel": "workspace:*",
"@tupaia/ui-chart-components": "workspace:*",
Expand All @@ -49,7 +51,6 @@
"react-hook-form": "^6.15.1",
"react-leaflet": "^3.2.1",
"react-password-strength-bar": "^0.3.3",
"react-query": "^3.19.0",
"react-redux": "^5.0.6",
"react-router": "6.3.0",
"react-router-dom": "6.3.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/lesmis/src/AppProviders.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/
import React from 'react';
import PropTypes from 'prop-types';
import { QueryClient, QueryClientProvider } from 'react-query';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { MuiThemeProvider, StylesProvider } from '@material-ui/core/styles';
import { ThemeProvider } from 'styled-components';
import CssBaseline from '@material-ui/core/CssBaseline';
Expand Down
2 changes: 1 addition & 1 deletion packages/lesmis/src/api/mutations/useLogin.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright (c) 2017 - 2020 Beyond Essential Systems Pty Ltd
*
*/
import { useMutation, useQueryClient } from 'react-query';
import { useMutation, useQueryClient } from '@tanstack/react-query';
import { useLocation, useNavigate } from 'react-router-dom';
import { post } from '../api';
import { useUser } from '../queries';
Expand Down
2 changes: 1 addition & 1 deletion packages/lesmis/src/api/mutations/useLogout.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright (c) 2017 - 2020 Beyond Essential Systems Pty Ltd
*
*/
import { useMutation, useQueryClient } from 'react-query';
import { useMutation, useQueryClient } from '@tanstack/react-query';
import { post } from '../api';
import { useHomeUrl } from '../../utils/useHomeUrl';

Expand Down
2 changes: 1 addition & 1 deletion packages/lesmis/src/api/mutations/useRegisterUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright (c) 2017 - 2020 Beyond Essential Systems Pty Ltd
*
*/
import { useMutation } from 'react-query';
import { useMutation } from '@tanstack/react-query';
import { post } from '../api';

export const useRegisterUser = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Tupaia
* Copyright (c) 2017 - 2022 Beyond Essential Systems Pty Ltd
*/
import { useMutation, useQueryClient } from 'react-query';
import { useMutation, useQueryClient } from '@tanstack/react-query';
import { post } from '../api';

const updateExistingDashboardData = async (queryClient, { entityCode }) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/lesmis/src/api/queries/useDashboardData.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright (c) 2017 - 2020 Beyond Essential Systems Pty Ltd
*
*/
import { useQuery } from 'react-query';
import { useQuery } from '@tanstack/react-query';
import { get } from '../api';
import { QUERY_OPTIONS } from './constants';

Expand Down
2 changes: 1 addition & 1 deletion packages/lesmis/src/api/queries/useDashboardReportData.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright (c) 2017 - 2020 Beyond Essential Systems Pty Ltd
*
*/
import { useQuery } from 'react-query';
import { useQuery } from '@tanstack/react-query';
import { get } from '../api';
import { useDashboardData } from './useDashboardData';
import { combineQueries } from './utils';
Expand Down
2 changes: 1 addition & 1 deletion packages/lesmis/src/api/queries/useEmailVerification.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Tupaia
* Copyright (c) 2017 - 2021 Beyond Essential Systems Pty Ltd
*/
import { useQuery } from 'react-query';
import { useQuery } from '@tanstack/react-query';
import { useUrlSearchParams } from '../../utils/useUrlSearchParams';
import { get } from '../api';

Expand Down
2 changes: 1 addition & 1 deletion packages/lesmis/src/api/queries/useEntitiesData.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright (c) 2017 - 2020 Beyond Essential Systems Pty Ltd
*
*/
import { useQuery } from 'react-query';
import { useQuery } from '@tanstack/react-query';
import keyBy from 'lodash.keyby';
import { get } from '../api';
import { PROJECT_CODE } from '../../constants';
Expand Down
2 changes: 1 addition & 1 deletion packages/lesmis/src/api/queries/useEntityData.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright (c) 2017 - 2020 Beyond Essential Systems Pty Ltd
*
*/
import { useQuery } from 'react-query';
import { useQuery } from '@tanstack/react-query';
import { get } from '../api';
import { useValidatedQuery } from './useValidatedQuery';

Expand Down
2 changes: 1 addition & 1 deletion packages/lesmis/src/api/queries/useMapOverlayReportData.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import { useState, useEffect, useCallback } from 'react';
import { useQuery } from 'react-query';
import { useQuery } from '@tanstack/react-query';
import camelCase from 'camelcase';
import {
autoAssignColors,
Expand Down
2 changes: 1 addition & 1 deletion packages/lesmis/src/api/queries/useMapOverlaysData.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright (c) 2017 - 2020 Beyond Essential Systems Pty Ltd
*
*/
import { useQuery } from 'react-query';
import { useQuery } from '@tanstack/react-query';
import camelCase from 'camelcase';
import { get } from '../api';
import { useEntitiesData } from './useEntitiesData';
Expand Down
2 changes: 1 addition & 1 deletion packages/lesmis/src/api/queries/useUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright (c) 2017 - 2020 Beyond Essential Systems Pty Ltd
*
*/
import { useQuery } from 'react-query';
import { useQuery } from '@tanstack/react-query';
import { get } from '../api';

export const useUser = options => {
Expand Down
2 changes: 1 addition & 1 deletion packages/lesmis/src/api/queries/useVitalsData.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright (c) 2017 - 2020 Beyond Essential Systems Pty Ltd
*
*/
import { useQuery } from 'react-query';
import { useQuery } from '@tanstack/react-query';
import { utcMoment } from '@tupaia/utils';
import { post } from '../api';
import { useProjectEntitiesData } from './useEntitiesData';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright (c) 2017 - 2022 Beyond Essential Systems Pty Ltd
*/
import React, { useState } from 'react';
import { useIsFetching } from 'react-query';
import { useIsFetching } from '@tanstack/react-query';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import DownloadIcon from '@material-ui/icons/GetApp';
Expand Down
2 changes: 1 addition & 1 deletion packages/lesmis/src/components/LocaleMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
*/
import React, { useState } from 'react';
import { useQueryClient } from 'react-query';
import { useQueryClient } from '@tanstack/react-query';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import { generatePath, useNavigate, useLocation } from 'react-router-dom';
Expand Down
3 changes: 1 addition & 2 deletions packages/lesmis/src/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/
import React from 'react';
import { render as renderReactApp } from 'react-dom';
import { ReactQueryDevtools } from 'react-query/devtools';
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
import { EnvBanner } from '@tupaia/ui-components';
import { App } from './App';
import { AppProviders } from './AppProviders';
Expand All @@ -21,4 +21,3 @@ const render = () => {
};

render(App);

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Tupaia
* Copyright (c) 2017 - 2021 Beyond Essential Systems Pty Ltd
*/
import { useMutation } from 'react-query';
import { useMutation } from '@tanstack/react-query';

export const useApproveSurveyResponseStatus = api =>
useMutation(id => api.post(`surveyResponse/${id}/resubmit`, {}, { approval_status: 'approved' }));
Expand Down
2 changes: 1 addition & 1 deletion packages/lesmis/src/views/DashboardView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import { useIsFetching } from 'react-query';
import { useIsFetching } from '@tanstack/react-query';
import { Select } from '@tupaia/ui-components';
import MuiBox from '@material-ui/core/Box';
import { VitalsView } from './VitalsView';
Expand Down
3 changes: 2 additions & 1 deletion yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7834a55

Please sign in to comment.