WIP
This commit is contained in:
@@ -9,7 +9,6 @@ import sourceConfigsData from "@site/src/data/source-configs-dereferenced.json";
|
||||
import styles from "./SourceConfiguration.module.css";
|
||||
import { useState, useMemo } from "react";
|
||||
|
||||
|
||||
/**
|
||||
* Component to display configuration fields based on selected source type
|
||||
* Uses OpenAPI plugin classnames for perfect visual consistency
|
||||
@@ -88,6 +87,7 @@ export const SourceConfiguration = ({ endpointData }) => {
|
||||
const [fieldValues, setFieldValues] = useState({});
|
||||
|
||||
// Filter sources based on search query
|
||||
console.log("Source configs data:", endpointData);
|
||||
const filteredSources = useMemo(() => {
|
||||
if (!searchQuery.trim()) {
|
||||
return sourceConfigs;
|
||||
@@ -108,19 +108,6 @@ export const SourceConfiguration = ({ endpointData }) => {
|
||||
<>
|
||||
{endpointData?.configurationSchema && (
|
||||
<>
|
||||
{/* Show oneOf badge inline with configuration name */}
|
||||
<div style={{ display: "flex", alignItems: "center", gap: "0.5rem", marginBottom: "0.75rem" }}>
|
||||
<span className="openapi-schema__property" style={{ fontWeight: 600 }}>
|
||||
configuration
|
||||
</span>
|
||||
<span className="openapi-schema__name">SourceConfiguration</span>
|
||||
{endpointData.configurationSchema.oneOf && (
|
||||
<span className="badge badge--info" style={{ marginBottom: 0 }}>
|
||||
oneOf
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Combobox for source selection */}
|
||||
<Combobox
|
||||
immediate
|
||||
@@ -180,27 +167,14 @@ export const SourceConfiguration = ({ endpointData }) => {
|
||||
</Combobox>
|
||||
|
||||
{/* Display configuration schema properties for selected source */}
|
||||
<div style={{ marginTop: "1rem" }}>
|
||||
{endpointData.configurationSchema.description && (
|
||||
<p
|
||||
style={{
|
||||
fontSize: "0.9rem",
|
||||
lineHeight: "1.4",
|
||||
marginBottom: "0.5rem",
|
||||
}}
|
||||
>
|
||||
{endpointData.configurationSchema.description}
|
||||
</p>
|
||||
)}
|
||||
|
||||
{/* Display required properties for selected source */}
|
||||
{selectedSource && endpointData.configurationSchema.oneOf && (
|
||||
<ConfigurationFields
|
||||
selectedSourceId={selectedSource.id}
|
||||
configSchema={endpointData.configurationSchema}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
{/* Display required properties for selected source */}
|
||||
{selectedSource && endpointData.configurationSchema.oneOf && (
|
||||
<ConfigurationFields
|
||||
selectedSourceId={selectedSource.id}
|
||||
configSchema={endpointData.configurationSchema}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user