diff --git a/openmetadata-ui/src/main/resources/ui/src/components/APIEndpoint/APIEndpointSchema/APIEndpointSchema.tsx b/openmetadata-ui/src/main/resources/ui/src/components/APIEndpoint/APIEndpointSchema/APIEndpointSchema.tsx index 51a8fdacadd..08b8b4adb02 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/APIEndpoint/APIEndpointSchema/APIEndpointSchema.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/APIEndpoint/APIEndpointSchema/APIEndpointSchema.tsx @@ -10,7 +10,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { Col, Radio, RadioChangeEvent, Row, Tooltip, Typography } from 'antd'; +import { Col, Row, Segmented, Tooltip, Typography } from 'antd'; import { ColumnsType } from 'antd/lib/table'; import classNames from 'classnames'; import { cloneDeep, groupBy, isEmpty, isUndefined, uniqBy } from 'lodash'; @@ -90,6 +90,16 @@ const APIEndpointSchema: FC = ({ onUpdate: onApiEndpointUpdate, } = useGenericContext(); + const viewTypeOptions = [ + { + label: t('label.request'), + value: SchemaViewType.REQUEST_SCHEMA, + }, + { + label: t('label.response'), + value: SchemaViewType.RESPONSE_SCHEMA, + }, + ]; const { requestSchemaAllRowKeys, responseSchemaAllRowKeys, @@ -182,10 +192,6 @@ const APIEndpointSchema: FC = ({ return activeSchemaDiff?.schemaFields ?? []; }, [activeSchema, apiEndpointDetails]); - const handleViewChange = (e: RadioChangeEvent) => { - setViewType(e.target.value); - }; - const handleExpandedRowsChange = (keys: readonly Key[]) => { setExpandedRowKeys(keys as string[]); }; @@ -405,14 +411,13 @@ const APIEndpointSchema: FC = ({ }} extraTableFilters={
- - - {t('label.request')} - - - {t('label.response')} - - + setViewType(value as SchemaViewType)} + /> + { - setView(e.target.value)} + onChange={(value) => setView(value as PIPELINE_EXECUTION_TABS)} /> +