Merge pull request #17691 from drodil/remove_object_hash

fix: remove object-hash dependency from home plugin
This commit is contained in:
Johan Haals
2023-05-08 16:22:12 +02:00
committed by GitHub
5 changed files with 36 additions and 6 deletions
-1
View File
@@ -48,7 +48,6 @@
"@rjsf/validator-ajv8": "5.6.0",
"@types/react": "^16.13.1 || ^17.0.0",
"lodash": "^4.17.21",
"object-hash": "^3.0.0",
"react-grid-layout": "^1.3.4",
"react-resizable": "^3.0.4",
"react-use": "^17.2.4",
@@ -46,7 +46,6 @@ import { CardConfig } from '../../extensions';
// eslint-disable-next-line new-cap
const ResponsiveGrid = WidthProvider(Responsive);
const hash = require('object-hash');
const useStyles = makeStyles((theme: Theme) =>
createStyles({
@@ -336,14 +335,14 @@ export const CustomHomepageGrid = (props: CustomHomepageGridProps) => {
...widget.component.props,
...(w.settings ?? {}),
};
const propsHash = hash(widgetProps, {});
return (
<div
key={l.i}
className={`${styles.widgetWrapper} ${editMode && 'edit'}`}
>
<ErrorBoundary>
<widget.component.type key={propsHash} {...widgetProps} />
<widget.component.type {...widgetProps} />
</ErrorBoundary>
{editMode && (
<WidgetSettingsOverlay