@balena/ui-shared-components 11.2.5-build-update-react-query-aaecdd817cebf229b16631529fef2e345bab1da7-1 → 11.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { useQuery } from '@tanstack/react-query';
1
+ import { useQuery } from 'react-query';
2
2
  export const LOADING_DISABLED_REASON = 'Loading';
3
3
  // This component sole purpose is to have the useQuery being called exactly once per item,
4
4
  // so that it satisfies React hooks assumption that the number of hook calls inside each component
@@ -4,7 +4,7 @@ import { parseDescriptionProperty } from '../schemaOps';
4
4
  import get from 'lodash/get';
5
5
  import { useTranslation } from '../../../hooks/useTranslations';
6
6
  import { closeSnackbar, enqueueSnackbar } from 'notistack';
7
- import { useQuery } from '@tanstack/react-query';
7
+ import { useQuery } from 'react-query';
8
8
  import { Spinner } from '../../Spinner';
9
9
  import { TagManagementDialog } from '../../TagManagementDialog';
10
10
  export const Tags = ({ selected, rjstContext, schema, setIsBusyMessage, refresh, onDone, }) => {
@@ -57,6 +57,7 @@ export const Update = ({ model, rjstContext, selected, hasOngoingAction, onActio
57
57
  : undefined,
58
58
  disabled: !!disabledActionReason,
59
59
  section: action.section,
60
+ 'data-test': `rjst-action-${action.type}${action.type === 'update' ? `__${action.title}` : ''}`,
60
61
  };
61
62
  });
62
63
  }, [
@@ -80,7 +81,7 @@ export const Update = ({ model, rjstContext, selected, hasOngoingAction, onActio
80
81
  const disabledUpdateReason = (_a = rjstGetDisabledReason(selected, checkedState, hasOngoingAction, action.type, t)) !== null && _a !== void 0 ? _a : disabledReasonsByAction[action.title];
81
82
  return (_jsx(Box, { alignSelf: "flex-start", children: _jsx(Tooltip, { title: typeof disabledUpdateReason === 'string'
82
83
  ? disabledUpdateReason
83
- : undefined, children: _jsx(Button, { "data-action": `${action.type}-${model.resource}`, onClick: () => {
84
+ : undefined, children: _jsx(Button, { "data-action": `${action.type}-${model.resource}`, "data-test": `rjst-action-${action.type}${action.type === 'update' ? `__${action.title}` : ''}`, onClick: () => {
84
85
  onActionTriggered({
85
86
  action,
86
87
  schema: action.type === 'delete'
@@ -93,5 +94,5 @@ export const Update = ({ model, rjstContext, selected, hasOngoingAction, onActio
93
94
  }, children: _jsxs(Box, { display: "flex", justifyContent: "space-between", children: [action.title, _jsx(Spinner, { sx: { ml: 2 }, show: disabledUpdateReason === LOADING_DISABLED_REASON })] }) }) }, action.title) }) }));
94
95
  }
95
96
  const disabledReason = rjstGetDisabledReason(selected, checkedState, hasOngoingAction, null, t);
96
- return (_jsx(Tooltip, { title: disabledReason, children: _jsx(DropDownButton, { items: actionHandlers, disabled: !!disabledReason, startIcon: _jsx(FontAwesomeIcon, { icon: faPenToSquare }), color: "secondary", groupByProp: "section", children: t('labels.modify') }) }));
97
+ return (_jsx(Tooltip, { title: disabledReason, children: _jsx(DropDownButton, { items: actionHandlers, disabled: !!disabledReason, startIcon: _jsx(FontAwesomeIcon, { icon: faPenToSquare }), color: "secondary", groupByProp: "section", "data-test": "rjst-action-modify", children: t('labels.modify') }) }));
97
98
  };
@@ -19,7 +19,7 @@ export const Summary = ({ filters, showSaveView, dark, onClearFilters, onSaveVie
19
19
  const { t } = useTranslation();
20
20
  const [showViewForm, setShowViewForm] = React.useState(false);
21
21
  const [viewData, setViewData] = React.useState();
22
- return (_jsxs(Box, { display: "flex", flexDirection: "column", my: 2, children: [_jsxs(Box, { display: "flex", justifyContent: "space-between", alignItems: "center", children: [_jsxs(Box, { display: "flex", gap: 1, alignItems: "center", sx: { color: dark ? 'white' : 'primary' }, children: [_jsx(Typography, { sx: { fontWeight: 'bold' }, children: t('labels.filter_other') }), _jsxs(Typography, { children: ["(", filters.length, ")"] }), _jsx(Button, { variant: "text", onClick: onClearFilters, children: t('actions.clear_all') })] }), showSaveView && (_jsx(Button, { variant: "text", onClick: () => {
22
+ return (_jsxs(Box, { display: "flex", flexDirection: "column", my: 2, children: [_jsxs(Box, { display: "flex", justifyContent: "space-between", alignItems: "center", children: [_jsxs(Box, { display: "flex", gap: 1, alignItems: "center", sx: { color: dark ? 'white' : 'primary' }, children: [_jsx(Typography, { sx: { fontWeight: 'bold' }, children: t('labels.filter_other') }), _jsxs(Typography, { children: ["(", filters.length, ")"] }), _jsx(Button, { variant: "text", onClick: onClearFilters, "data-test": "filters__clear-all-filters", children: t('actions.clear_all') })] }), showSaveView && (_jsx(Button, { variant: "text", onClick: () => {
23
23
  setShowViewForm(true);
24
24
  }, children: t('actions.save_view') }))] }), _jsx(Box, { display: "flex", flexWrap: "wrap", children: filters.map((filter, index) => {
25
25
  var _a;
@@ -3,7 +3,7 @@ import { useMemo, useState } from 'react';
3
3
  import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
4
4
  import { faPlus } from '@fortawesome/free-solid-svg-icons/faPlus';
5
5
  import uniq from 'lodash/uniq';
6
- import { useQuery } from '@tanstack/react-query';
6
+ import { useQuery } from 'react-query';
7
7
  import { Stack } from '@mui/material';
8
8
  export function useTagActions(rjstContext, data) {
9
9
  var _a;
package/dist/index.d.ts CHANGED
@@ -93,4 +93,3 @@ export * as MaterialDataGrid from '@mui/x-data-grid';
93
93
  export { enqueueSnackbar, closeSnackbar } from 'notistack';
94
94
  export { useRandomUUID } from './hooks/useRandomUUID';
95
95
  export * as designTokens from '@balena/design-tokens';
96
- export * as ReactQuery from '@tanstack/react-query';
package/dist/index.js CHANGED
@@ -53,4 +53,3 @@ export * as MaterialDataGrid from '@mui/x-data-grid';
53
53
  export { enqueueSnackbar, closeSnackbar } from 'notistack';
54
54
  export { useRandomUUID } from './hooks/useRandomUUID';
55
55
  export * as designTokens from '@balena/design-tokens';
56
- export * as ReactQuery from '@tanstack/react-query';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@balena/ui-shared-components",
3
- "version": "11.2.5-build-update-react-query-aaecdd817cebf229b16631529fef2e345bab1da7-1",
3
+ "version": "11.2.5",
4
4
  "main": "./dist/index.js",
5
5
  "sideEffects": false,
6
6
  "files": [
@@ -25,7 +25,6 @@
25
25
  "@rjsf/mui": "^5.24.1",
26
26
  "@rjsf/utils": "^5.24.1",
27
27
  "@rjsf/validator-ajv8": "^5.24.1",
28
- "@tanstack/react-query": "^5.64.2",
29
28
  "@types/jest": "^29.5.14",
30
29
  "ajv": "^8.17.1",
31
30
  "ajv-formats": "^3.0.1",
@@ -42,6 +41,7 @@
42
41
  "react-dropzone": "^14.2.3",
43
42
  "react-helmet": "^6.1.0",
44
43
  "react-markdown": "^9.0.1",
44
+ "react-query": "^4.0.0-beta.23",
45
45
  "react-router-dom": "^6.28.0",
46
46
  "remark-breaks": "^4.0.0",
47
47
  "remark-gfm": "^4.0.0",
@@ -137,6 +137,6 @@
137
137
  },
138
138
  "homepage": "https://github.com/balena-io/ui-shared-components#readme",
139
139
  "versionist": {
140
- "publishedAt": "2025-02-13T15:14:15.332Z"
140
+ "publishedAt": "2025-02-07T15:30:05.142Z"
141
141
  }
142
142
  }