Skip to content

Commit

Permalink
merge: dev -> rn-1409 (#5897)
Browse files Browse the repository at this point in the history
* fix(tupaiaWeb): RN-1414: Fix dashboard item permission error (#5836)

Update ReportPermissionsChecker.js

* fix(adminPanel): RN-1289: update the entity associated with a survey resubmission (#5817)

* Initial update

* test updates

* Update importSurveyResponses.js

* Update importSurveyResponses.js

* Update importSurveyResponses.js

* Update SurveyResponseUpdatePersistor.js

* Delete ~$nonPeriodicUpdates.xlsx

* test updates

* review comments

* review updates

* addition of tests

---------

Co-authored-by: Andrew <vanbeekandrew@gmail.com>

* feat(datatrakWeb): RN-1243: resubmit surveys via Datatrak Web (#5638)

* WIP

* Rearrange routes

* Ability to resubmit

* Ability to upload images in resubmission

* Success screen

* Loading state

* Disable create new autocomplete abilities in resubmit (temp)

* tidy ups

* Remove unused import

* Fix imports

* Update SurveyResponsePage.tsx

* Fix tests

* Update packages/datatrak-web-server/src/routes/SingleSurveyResponseRoute.ts

Co-authored-by: Rohan Port <59544282+rohan-bes@users.noreply.github.com>

* feat(adminPanel): RN-1243: Resubmit survey response modal should link to Datatrak Web (#5640)

* WIP

* WIP

* WIP

* Styling

* WIP

* Error dismiss

* WIP

* Use updated entity country code if applicable

* Don't update user project/country if in resubmit mode

* Fix build

* Add REACT_APP_DATATRAK_WEB_URL to .env.example

* Build fixes

* Apply primary entity answer to resubmit

* Fix breaking data_time questions

* Fix build

* Fix survey responses with file uploads

* Display file name for saved file questions and fix remove file value

* Use dataTime for date questions

* fix permissions

* Send timezone through with resubmission

* Open up permissions

* feat(dataTrak): RN-1274: Keep 'outdated' historical survey responses when resubmitting (#5758)

* RN-1274: change route to `surveyResponses/:id/resubmit`

* RN-1274: Reworked ResubmitSurveyResponse route to create a new response and outdate the previous one

* RN-1274: Added resubmitSurveyResponse to the CentralApi

* RN-1274: Added ResubmitSurveyResponseRoute to datatrak-web-server

* RN-1274: Reworked survey response resubmission in datatrak to use the new backend routes

* Fix tests

* Edit survey response metadata

* Fix tests

* Edit survey response metadata

* Resubmit survey response with original data time and user ID

* PR fixes

* take 1

* feat(adminPanel): RN-1228: Link surveys to Datatrak Web (#5671)

* Make links

* Use projectId

* Update user preferences if project id is in url

* Add comment

* Allow country codes to be fetched for surveys

* Link directly to survey

* Default to DL and alphabetise the country codes

* Change tooltip text

* Update copy

* Hide button for surveys with no countries

---------

Co-authored-by: Andrew <vanbeekandrew@gmail.com>

* Fix dataTime timezone change

* Allow file questions to be viewed and changed

* feat(tupaiaWeb): RN-1367: Multiphotograph viz captions + restyle (#5769)

* Add `label` property to view data

* Preview display

* Display max 3

* WIP carousel

* WIP

* Working thumbnails

* Working carousel

* WiP

* Styling

* Add comments

* Update schemas.ts

* Adjust height and alignment

* Make images contained

* Fix responsive issue

---------

Co-authored-by: Andrew <vanbeekandrew@gmail.com>

* Fix issue

* Fix date of data

* Add outdated column to survey responses in admin panel

* Reset entity question values when filter questions change

* fix(datatrakWeb): Fix country code selector in reports export

* fix(adminPanel): RN-1375: update 'Add' project editor for consistency (#5816)

update editor column for consistency

* Handle existing file answers

* Use existing entity id if present

* Add pill styling for response status field

* Handle file names

* Change pill colours around

* Handle survey response file names

* Don't save file url in answer

* Fix tests

* Don't default dates on resubmit

* Handle when photo answer is a url

* Allow `null` default date for resubmission

* Save previous metadata on tracked entity

* Fix undefined models error

* Update project.pbxproj

* Hide survey resubmit button for outdated responses

* tweak(tupaiaWeb): RN-1394: Update tool tip for visualisation export (#5824)

Tool tip update

* tweak(adminPanel): RN-1399: Update icon and color as per Figma layouts (#5825)

Download Icon update

* tweak(adminPanel): RN-1274: Remove outdated survey responses and associated answers from DHIS via sync queue (#5827)

* Remove outdated survey responses and associated answers from dhis via sync queue

* Add tests

* Add answers back into queue when survey response is changed back to current

* Handle answers for outdated->current tests

* Fix tests

* Revert change to filter

* Ignore outdated surveys from exports

* Code question should be code generator type

* Fix tests

* Fix timezone issues

* Update processSurveyResponse.test.ts

* Get all answers for survey response

* Handle when photo includes a url

* Fix tests

* Fix crashing error

* Concert jpeg to jpg

* Keep existing survey response timezone

* fix(tupaiaWeb): RN-1414: Fix dashboard item permission error (#5836)

Update ReportPermissionsChecker.js

* Timezones

* fix(adminPanel): RN-1289: update the entity associated with a survey resubmission (#5817)

* Initial update

* test updates

* Update importSurveyResponses.js

* Update importSurveyResponses.js

* Update importSurveyResponses.js

* Update SurveyResponseUpdatePersistor.js

* Delete ~$nonPeriodicUpdates.xlsx

* test updates

* review comments

* review updates

* addition of tests

---------

Co-authored-by: Andrew <vanbeekandrew@gmail.com>

* Convert data_time to timezone date on server

* Fix tests

* Make dates/times zoneless so that they appear the same to everyone

* Fix tests

* Fix timezone offsets

* Handle timezones with DST

* Fixes

---------

Co-authored-by: alexd-bes <129009580+alexd-bes@users.noreply.github.com>
Co-authored-by: Salman <114740396+hrazasalman@users.noreply.github.com>
Co-authored-by: Andrew <vanbeekandrew@gmail.com>
Co-authored-by: Tom Caiger <caigertom@gmail.com>

---------

Co-authored-by: Rohan Port <59544282+rohan-bes@users.noreply.github.com>
Co-authored-by: Andrew <vanbeekandrew@gmail.com>
Co-authored-by: Salman <114740396+hrazasalman@users.noreply.github.com>
Co-authored-by: Tom Caiger <caigertom@gmail.com>

* fix(datatrakWeb): RN-1274: Remove check on autocomplete question for resubmit

* fix(adminPanel): RN-1424: Fix max payload error when saving map overlay records (#5846)

Create 20240818212910-removeMapOverlayConfigFromPgNotify-modifies-schema.js

* deps(security): RN-1096: Update version of `decode-uri-component` (#5850)

Update decide-uri-component

* deps(security): RN-1096: Update version of `jsonwebtoken` (#5851)

* Update json-web-token

* Update jsonwebtoken in auth package

* deps(security): RN-1096: Update XLSX version (#5849)

* Update xlsx

* xlsx fixes

* Handle xlsx blank rows and parsing

* tweak(types): RN-1418: Update EntityType type (#5871)

* Update config for entity type

* Types update

* Fix uses of EntityType

* tweak(adminPanel): RN-1393: Minor Admin panel updates (#5867)

* Scroll on profile pages

* Entity hierarchy export wording

* Handle single button action widths

* Bold active tabs

* Move survey questions to the top of add survey modal

* Fix input colours

* Fix sync logs tooltip

* PR fix

* deps(root): RN-1417: Update storybook version (#5878)

* Basic setup

* Add warmup script

* Update main.ts

* deps(uiChartComponents): RN-1417: Update storybook version PART 2 (#5879)

charts storybook

* deps(uiMapComponents): RN-1417: Update storybook version PART 3 (#5880)

* map components

* Fix tests

* deps(uiComponents): RN-1417: Update storybook version PART 4 (#5881)

* ui components storybook

* Fix tests

* deps(tupaiaWeb): RN-1417: Update storybook version PART 5 (#5882)

* tupaia web storybook

* Fix tests

* Fix build

* tweak(centralServer): RN-1351: Handle bad DHIS2 sync requests (#5887)

Throw an error and register bad requests on dhis sync queue

* tweak(datatrakWeb): RN-1438: Upgrade React Query to V4 (#5868)

* Bumping react-query

* Update render.tsx

* fixing Reports.test.tsx

* navigation bug fix

* removed logging

* tweak(adminPanel): RN-1439: Upgrade React Query to V4 (#5875)

* bumping to v4

* Update yarn.lock

* tweak(psss): RN-1442: Upgrade React Query to V4 (#5874)

* upgrade

* Update yarn.lock

* tweak(lesmis): RN-1441: Upgrade React Query to V4 (#5873)

* upgrade

* Update yarn.lock

* tweak(tupaiaWeb): RN-1440: Upgrade React Query to V4 (#5870)

* Bumping react-query

* Bumping react-query to v4

* Update render.tsx

* GitAction fix

* fixing Reports.test.tsx

* navigation bug fix

* review update

* removed logging

* Update yarn.lock

* Update yarn.lock

* Update VerifyEmailPage.tsx

* Update useReportPreview.js

* fix(adminPanel): Miscellaneous Bug fixes (Tiny) (#5891)

* bugfix

* update

* updates

* tweak(tupaiaWeb): RN-1437: Download files visual restyle (#5889)

* Common download files component

* PR fix

---------

Co-authored-by: Tom Caiger <caigertom@gmail.com>
Co-authored-by: Salman <114740396+hrazasalman@users.noreply.github.com>
Co-authored-by: Andrew <vanbeekandrew@gmail.com>
Co-authored-by: Rohan Port <59544282+rohan-bes@users.noreply.github.com>
  • Loading branch information
5 people authored Sep 12, 2024
1 parent 7051598 commit 7e4bd76
Show file tree
Hide file tree
Showing 416 changed files with 5,872 additions and 18,360 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
/*
* Tupaia
* Copyright (c) 2017 - 2023 Beyond Essential Systems Pty Ltd
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd
*/

import React from 'react';
import { MuiThemeProvider, StylesProvider } from '@material-ui/core/styles';
import { ThemeProvider } from 'styled-components';
import CssBaseline from '@material-ui/core/CssBaseline';
import PropTypes from 'prop-types';
import { lightTheme, darkTheme } from '../stories/theme';
import { lightTheme, darkTheme } from './theme';

export const AppProviders = ({ params, children }) => {
export const AppProviders = ({
params,
children,
}: {
params?: { theme?: 'light' | 'dark' };
children: React.ReactNode;
}) => {
const theme = params?.theme === 'dark' ? darkTheme : lightTheme;

return (
<StylesProvider injectFirst>
<MuiThemeProvider theme={theme}>
Expand All @@ -23,12 +29,3 @@ export const AppProviders = ({ params, children }) => {
</StylesProvider>
);
};

AppProviders.propTypes = {
params: PropTypes.object,
children: PropTypes.any.isRequired,
};

AppProviders.defaultProps = {
params: null,
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';
import { action } from '@storybook/addon-actions';
import { ReactNode } from 'react';
import { FormProvider, useForm } from 'react-hook-form';
import { Args } from '@storybook/react';
Expand Down
File renamed without changes.
62 changes: 62 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import fs from 'fs';
import path, { join, dirname } from 'path';
import type { StorybookConfig } from '@storybook/react-vite';

const getStoriesDir = () => {
const currentDir = process.cwd();
return join(currentDir, 'stories/**/*.stories.@(js|jsx|ts|tsx)');
};

const getStaticDir = () => {
const currentDir = process.cwd();
const publicPath = join(currentDir, 'public');

if (!fs.existsSync(publicPath)) return [];
return [publicPath];
};

const config: StorybookConfig = {
stories: [getStoriesDir()],
addons: ['@storybook/addon-essentials'],
framework: {
name: '@storybook/react-vite',
options: {},
},
typescript: {
reactDocgen: 'react-docgen-typescript',
},
core: {
builder: '@storybook/builder-vite',
},
staticDirs: getStaticDir(),
viteFinal: async (config, { configType }) => {
// Merge custom configuration into the default config
const { mergeConfig, loadEnv } = await import('vite');
// Load the environment variables, whether or not they are prefixed with REACT_APP_
const env = loadEnv(configType || 'DEVELOPMENT', process.cwd(), ['REACT_APP_', '']);

return mergeConfig(config, {
define: {
'process.env': env,
},
server: {
watch: {
// Ignore the .env files because for some reason vite is detecting changes in them and restarting the server multiple times
ignored: '**/.env*',
},
},
resolve: {
preserveSymlinks: true, // use the yarn workspace symlinks
alias: {
http: path.resolve(__dirname, '../moduleMock.js'),
winston: path.resolve(__dirname, '../moduleMock.js'),
jsonwebtoken: path.resolve(__dirname, '../moduleMock.js'),
'node-fetch': path.resolve(__dirname, '../moduleMock.js'),
// This is a workaround for us using react-16 in the monorepo
'@storybook/react-dom-shim': '@storybook/react-dom-shim/dist/react-16',
},
},
});
},
};
export default config;
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,600,700&display=swap"
/>

<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.1.0/leaflet.css"
/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.1.0/leaflet.css" />

<style>
html {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React from 'react';
import type { Preview } from '@storybook/react';
import { AppProviders } from '../src/AppProviders';
import { AppProviders } from './AppProviders';
import ReactRouterDecorator from './ReactRouterDecorator';
import ReactHookFormDecorator from './ReactHookFormDecorator';

const preview: Preview = {
parameters: {
backgrounds: {
default: 'Dark',
default: 'Light',
values: [
{ name: 'Dark', value: '#262834' },
{ name: 'Light', value: '#ffffff' },
Expand All @@ -24,9 +24,9 @@ const preview: Preview = {
decorators: [
ReactRouterDecorator,
ReactHookFormDecorator,
Story => {
(Story, { parameters }) => {
return (
<AppProviders>
<AppProviders params={parameters}>
<Story />
</AppProviders>
);
Expand Down
File renamed without changes.
29 changes: 29 additions & 0 deletions .storybook/theme/darkTheme.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Tupaia
* Copyright (c) 2017 - 2020 Beyond Essential Systems Pty Ltd
*
*/

import { createMuiTheme } from '@material-ui/core';

export const darkTheme = createMuiTheme({
palette: {
type: 'dark',
primary: {
main: '#1978D4', // Main blue (as seen on primary buttons)
},
secondary: {
main: '#ee6230',
},
background: {
default: '#262834', // Dark blue background
paper: '#262834', // Dark blue to match background
},
text: {
secondary: '#9ba0a6',
},
form: {
border: '#d9d9d9',
},
},
});
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import * as COLORS from './colors';

const themeName = 'Tupaia-Storybook';
const palette = {
type: 'light',
primary: {
main: COLORS.BLUE,
light: COLORS.LIGHT_BLUE,
Expand Down Expand Up @@ -44,9 +45,12 @@ const palette = {
600: COLORS.GREY_72,
},
background: {
default: 'transparent', // use background addon to switch colors
default: COLORS.WHITE,
paper: COLORS.WHITE,
},
form: {
border: COLORS.GREY_DE,
},
};
const typography = {
h1: {
Expand Down
28 changes: 18 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,28 +44,34 @@
"package:test:withdb": "cd $INIT_CWD && yarn workspace @tupaia/database check-test-database-exists && jest --runInBand",
"package:start:backend-start-dev": "cd $INIT_CWD && LOG_LEVEL=debug ../../scripts/bash/backendStartDev.sh",
"package:start:vite": "cd $INIT_CWD && vite --config \"../../vite.config.js\"",
"package:start-stack": "scripts/bash/pm2startInline.sh"
"package:start-stack": "scripts/bash/pm2startInline.sh",
"package:storybook:start": "cd $INIT_CWD && storybook dev -p 6006 -c ../../.storybook",
"package:storybook:build": "cd $INIT_CWD && storybook build -c .storybook"
},
"resolutions": {
"@typescript-eslint/eslint-plugin": "^4.18.0",
"@babel/types": "7.23.3"
"@babel/types": "7.25.6"
},
"devDependencies": {
"@babel/cli": "^7.11.6",
"@babel/core": "^7.23.3",
"@babel/node": "^7.10.5",
"@babel/cli": "^7.25.6",
"@babel/core": "^7.25.2",
"@babel/node": "^7.25.0",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-export-default-from": "^7.22.17",
"@babel/plugin-proposal-export-default-from": "^7.24.7",
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
"@babel/plugin-proposal-private-methods": "^7.18.6",
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@babel/plugin-transform-runtime": "^7.18.10",
"@babel/preset-env": "^7.23.3",
"@babel/preset-react": "^7.23.3",
"@babel/types": "^7.23.0",
"@babel/plugin-transform-runtime": "^7.25.4",
"@babel/preset-env": "^7.25.4",
"@babel/preset-react": "^7.24.7",
"@babel/types": "^7.25.6",
"@beyondessential/eslint-config-jest": "^1.0.0",
"@beyondessential/eslint-config-js": "^1.1.1",
"@beyondessential/eslint-config-ts": "^2.0.0",
"@storybook/addon-essentials": "^8.2.9",
"@storybook/builder-vite": "^8.2.9",
"@storybook/react": "^8.2.9",
"@storybook/react-vite": "^8.2.9",
"@vitejs/plugin-react": "^4.0.4",
"babel-eslint": "^10.1.0",
"babel-jest": "^29.7.0",
Expand All @@ -84,6 +90,8 @@
"nodemon": "^2.0.4",
"npm-package-json-lint": "5.1.0",
"pm2": "^5.3.0",
"react-docgen-typescript-plugin": "^1.0.8",
"storybook": "^8.2.9",
"ts-jest": "^29.1.2",
"ts-node": "^10.7.0",
"typescript": "^5.2.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/admin-panel-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"lodash": "^4.17.4",
"multer": "^1.4.3",
"winston": "^3.3.3",
"xlsx": "^0.10.9"
"xlsx": "^0.18.5"
},
"devDependencies": {
"@types/multer": "^1.4.7"
Expand Down
1 change: 1 addition & 0 deletions packages/admin-panel/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ REACT_APP_CLIENT_BASIC_AUTH_HEADER=
REACT_APP_VIZ_BUILDER_API_URL=
SKIP_PREFLIGHT_CHECK=
PARSE_LINK_HEADER_MAXLEN=
REACT_APP_DATATRAK_WEB_URL=
3 changes: 2 additions & 1 deletion packages/admin-panel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "^4.0.0-alpha.47",
"@material-ui/styles": "^4.9.10",
"@tanstack/react-query": "4.36.1",
"@tanstack/react-query-devtools": "4.36.1",
"@tupaia/access-policy": "workspace:*",
"@tupaia/types": "workspace:*",
"@tupaia/ui-chart-components": "workspace:*",
Expand Down Expand Up @@ -64,7 +66,6 @@
"react-hook-form": "^6.8.3",
"react-icons": "^2.2.7",
"react-password-strength-bar": "^0.3.2",
"react-query": "^3.19.0",
"react-redux": "^5.0.6",
"react-router": "6.3.0",
"react-router-dom": "6.3.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* Tupaia
* Copyright (c) 2017 - 2021 Beyond Essential Systems Pty Ltd
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd
*/

import { useMutation } from 'react-query';
import { useMutation } from '@tanstack/react-query';
import { download } from '../api';

export const useExportDashboardVisualisation = config =>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* Tupaia
* Copyright (c) 2017 - 2021 Beyond Essential Systems Pty Ltd
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd
*/

import { useMutation } from 'react-query';
import { useMutation } from '@tanstack/react-query';
import { download } from '../api';

export const useExportMapOverlayVisualisation = config =>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* Tupaia
* Copyright (c) 2017 - 20211Beyond Essential Systems Pty Ltd
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd
*
*/
import { useMutation } from 'react-query';
import { useMutation } from '@tanstack/react-query';
import { post, put } from '../api';

export const useSaveDashboardVisualisation = config =>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* Tupaia
* Copyright (c) 2017 - 20211Beyond Essential Systems Pty Ltd
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd
*
*/
import { useMutation } from 'react-query';
import { useMutation } from '@tanstack/react-query';
import { post, put } from '../api';

export const useSaveMapOverlayVisualisation = config =>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/**
* Tupaia
* Copyright (c) 2017 - 2021 Beyond Essential Systems Pty Ltd
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd
*/

import { useMutation } from 'react-query';
import { useMutation } from '@tanstack/react-query';
import { upload } from '../api';

// Must match the file name expected by the back-end
const FILE_NAME = 'testData';

export const useUploadTestData = () =>
useMutation('uploadTestData', file => upload('uploadTestData', {}, FILE_NAME, file));
useMutation(['uploadTestData'], file => upload('uploadTestData', {}, FILE_NAME, file));
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
* Tupaia
* Copyright (c) 2017 - 2021 Beyond Essential Systems Pty Ltd
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd
*/
import { useQuery } from 'react-query';
import { useQuery } from '@tanstack/react-query';
import { get } from '../api';
import { DEFAULT_REACT_QUERY_OPTIONS } from '../constants';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* Tupaia
* Copyright (c) 2017 - 2021 Beyond Essential Systems Pty Ltd
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd
*/

import { useQuery } from 'react-query';
import { useQuery } from '@tanstack/react-query';
import { get } from '../api';
import { DEFAULT_REACT_QUERY_OPTIONS } from '../constants';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* Tupaia
* Copyright (c) 2017 - 2023 Beyond Essential Systems Pty Ltd
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd
*/
import { useQuery } from 'react-query';
import { useQuery } from '@tanstack/react-query';
import { stringifyQuery } from '@tupaia/utils';
import { get } from '../api';
import { DEFAULT_REACT_QUERY_OPTIONS } from '../constants';
Expand All @@ -12,7 +12,7 @@ export const useEntities = search =>
['entities', search],
async () => {
const endpoint = stringifyQuery(undefined, `entities`, {
columns: JSON.stringify(['name', 'code', 'id']),
columns: JSON.stringify(['name', 'code', 'id', 'country_code']),
filter: JSON.stringify({
name: { comparator: 'ilike', comparisonValue: `%${search}%`, castAs: 'text' },
}),
Expand Down
Loading

0 comments on commit 7e4bd76

Please sign in to comment.