diff --git a/web/pgadmin/browser/server_groups/servers/databases/static/js/database.ui.js b/web/pgadmin/browser/server_groups/servers/databases/static/js/database.ui.js
index c23c0ec0e..0715ea1b7 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/static/js/database.ui.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/static/js/database.ui.js
@@ -7,6 +7,7 @@
//
//////////////////////////////////////////////////////////////
+import _ from 'lodash';
import gettext from 'sources/gettext';
import BaseUISchema from 'sources/SchemaView/base_schema.ui';
import SecLabelSchema from '../../../static/js/sec_label.ui';
@@ -203,7 +204,7 @@ export default class DatabaseSchema extends BaseUISchema {
obj.informText = undefined;
}
- if(obj.origData.schema_res != state.schema_res) {
+ if(!_.isEqual(obj.origData.schema_res, state.schema_res)) {
obj.informText = gettext(
'Please refresh the Schemas node to make changes to the schema restriction take effect.'
);
diff --git a/web/pgadmin/static/js/SchemaView/index.jsx b/web/pgadmin/static/js/SchemaView/index.jsx
index 52ab97a30..11f2a0849 100644
--- a/web/pgadmin/static/js/SchemaView/index.jsx
+++ b/web/pgadmin/static/js/SchemaView/index.jsx
@@ -38,6 +38,7 @@ import FieldSetView from './FieldSetView';
import DataGridView from './DataGridView';
import { useIsMounted } from '../custom_hooks';
import Notify from '../helpers/Notifier';
+import ErrorBoundary from '../helpers/ErrorBoundary';
const useDialogStyles = makeStyles((theme)=>({
root: {
@@ -947,13 +948,17 @@ export default function SchemaView({formType, ...props}) {
if(formType === 'tab') {
return (
-
+
+
+
);
}
return (
-
+
+
+
);
}
diff --git a/web/pgadmin/static/js/components/FormComponents.jsx b/web/pgadmin/static/js/components/FormComponents.jsx
index 25ec140ef..9c2a8462e 100644
--- a/web/pgadmin/static/js/components/FormComponents.jsx
+++ b/web/pgadmin/static/js/components/FormComponents.jsx
@@ -767,7 +767,7 @@ export function InputSelect({
} else {
selectedVal = _.find(flatRes, (o)=>o.selected)?.value;
}
- if(!_.isUndefined(selectedVal)) {
+ if(!_.isUndefined(selectedVal) || (_.isArray(selectedVal) && selectedVal.length != 0)) {
onChange && onChange(selectedVal);
}
setFinalOptions([res || [], false]);
diff --git a/web/pgadmin/static/js/helpers/ErrorBoundary.jsx b/web/pgadmin/static/js/helpers/ErrorBoundary.jsx
new file mode 100644
index 000000000..220cdf6bf
--- /dev/null
+++ b/web/pgadmin/static/js/helpers/ErrorBoundary.jsx
@@ -0,0 +1,38 @@
+/////////////////////////////////////////////////////////////
+//
+// pgAdmin 4 - PostgreSQL Tools
+//
+// Copyright (C) 2013 - 2022, The pgAdmin Development Team
+// This software is released under the PostgreSQL Licence
+//
+//////////////////////////////////////////////////////////////
+
+/* https://reactjs.org/blog/2017/07/26/error-handling-in-react-16.html */
+import React from 'react';
+import CustomPropTypes from '../custom_prop_types';
+
+export default class ErrorBoundary extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = { hasError: false };
+ }
+
+ componentDidCatch(error, info) {
+ // Display fallback UI
+ this.setState({ hasError: true });
+ // You can also log the error to an error reporting service
+ console.error(error, info);
+ }
+
+ render() {
+ if (this.state.hasError) {
+ // You can render any custom fallback UI
+ return
Something went wrong.
;
+ }
+ return this.props.children;
+ }
+}
+
+ErrorBoundary.propTypes = {
+ children: CustomPropTypes.children,
+};