Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
136 changes: 53 additions & 83 deletions package-lock.json

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

3 changes: 1 addition & 2 deletions packages/smart-forms-renderer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"@fontsource/inter": "^5.2.8",
"@fontsource/material-icons": "^5.2.7",
"@fontsource/roboto": "^5.2.10",
"@hello-pangea/dnd": "^18.0.1",
"@mui/icons-material": "^7.1.1",
"@mui/lab": "^7.0.0-beta.13",
"@mui/material": "^7.1.1",
Expand All @@ -53,7 +54,6 @@
"lodash.differencewith": "^4.5.0",
"lodash.intersection": "^4.4.0",
"nanoid": "^5.1.5",
"react-beautiful-dnd": "^13.1.1",
"react-dnd": "^16.0.1",
"react-dnd-html5-backend": "^16.0.1",
"react-markdown": "^8.0.7",
Expand Down Expand Up @@ -84,7 +84,6 @@
"@types/lodash.differencewith": "^4.5.9",
"@types/lodash.intersection": "^4.4.9",
"@types/react": "^19.1.0",
"@types/react-beautiful-dnd": "^13.1.8",
"@types/react-dom": "^19.1.1",
"chokidar": "^4.0.3",
"concurrently": "^9.2.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4';
import type { GroupTableRowModel } from '../../../interfaces/groupTable.interface';
import type { PropsWithParentIsReadOnlyAttribute } from '../../../interfaces/renderProps.interface';
import GroupTableRow from './GroupTableRow';
import type { DropResult } from 'react-beautiful-dnd';
import { DragDropContext, Droppable } from 'react-beautiful-dnd';
import type { DropResult } from '@hello-pangea/dnd';
import { DragDropContext, Droppable } from '@hello-pangea/dnd';
import { reorderRows } from '../../../utils/groupTable';
import TableBody from '@mui/material/TableBody';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import type { GroupTableRowModel } from '../../../interfaces/groupTable.interfac
import DragIndicator from '@mui/icons-material/DragIndicator';
import TableCell from '@mui/material/TableCell';
import Box from '@mui/material/Box';
import { Draggable } from 'react-beautiful-dnd';
import { Draggable } from '@hello-pangea/dnd';
import { StyledGroupTableRow } from './Table.styles';

interface GroupTableRowProps extends PropsWithParentIsReadOnlyAttribute, TableRowProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,14 @@ import QuestionnaireTitleText from '../FormComponents/ItemParts/QuestionnaireTit
import dayjs from 'dayjs';
import localizedFormat from 'dayjs/plugin/localizedFormat';
import customParseFormat from 'dayjs/plugin/customParseFormat';
import {
silenceAutocompleteTextareaWarning,
silenceReactBeautifulDndError
} from '../../utils/silenceWarnings';
import { silenceAutocompleteTextareaWarning } from '../../utils/silenceWarnings';

// Setup DayJs extensions when BaseRenderer.tsx is called
dayjs.extend(localizedFormat);
dayjs.extend(customParseFormat);

// Silence warnings for MUI Autocomplete with Textarea and react-beautiful-dnd Droppable error
// Silence warnings for MUI Autocomplete with Textarea
silenceAutocompleteTextareaWarning();
silenceReactBeautifulDndError();

/**
* Main component of the form-rendering engine.
Expand Down
28 changes: 0 additions & 28 deletions packages/smart-forms-renderer/src/utils/silenceWarnings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,31 +39,3 @@ export function silenceAutocompleteTextareaWarning() {
originalWarn(...args);
};
}

/**
* This function monkey-patches `console.error` to silence a specific warning from react-beautiful-dnd about a soon to be deprecated feature.
* The project is sunsetted, so it is unlikely to be fixed.
*
* Monkey-patching console methods is not best practice as it hides important warnings/errors and make debugging harder.
*
* However, in this case:
* - The warning only appears in development.
* - The message cannot be actioned by us (it's internal to the library). See https://github.com/atlassian/react-beautiful-dnd/issues/2563
* - It clutters the console without providing useful information.
*/
export function silenceReactBeautifulDndError() {
const originalError = console.error;

console.error = (...args: any[]) => {
if (
typeof args[0] === 'string' &&
args[0].includes(
'Warning: Connect(Droppable): Support for defaultProps will be removed from memo components in a future major release.'
)
) {
// ignore this warning
return;
}
originalError(...args);
};
}
Loading