mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Changes include: - Simplify current SchemaView code - Add ability to reuse the schema data & state management implementation outside the SchemaDialogView component. - Further split components in small and manageable separate files. - Removed the 'DepListenerContext' context as there was no need for separate context. - Added a reload functionality in the 'useSchemaState' - Changes in feature tests.
35 lines
881 B
JavaScript
35 lines
881 B
JavaScript
/////////////////////////////////////////////////////////////
|
|
//
|
|
// pgAdmin 4 - PostgreSQL Tools
|
|
//
|
|
// Copyright (C) 2013 - 2024, The pgAdmin Development Team
|
|
// This software is released under the PostgreSQL Licence
|
|
//
|
|
//////////////////////////////////////////////////////////////
|
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import ErrorBoundary from 'sources/helpers/ErrorBoundary';
|
|
|
|
import SchemaDialogView from './SchemaDialogView';
|
|
import SchemaPropertiesView from './SchemaPropertiesView';
|
|
|
|
|
|
export default function SchemaView({formType, ...props}) {
|
|
/* Switch the view based on formType */
|
|
return (
|
|
<ErrorBoundary>
|
|
{
|
|
formType === 'tab' ?
|
|
<SchemaPropertiesView {...props}/> : <SchemaDialogView {...props}/>
|
|
}
|
|
</ErrorBoundary>
|
|
);
|
|
}
|
|
|
|
SchemaView.propTypes = {
|
|
formType: PropTypes.oneOf(['tab', 'dialog']),
|
|
};
|