Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: configuration editor rendering #1839

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/hydra/reference/configuration-editor.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ title: Configuration editor
```mdx-code-block
import ConfigEditor from '@site/src/components/ConfigEditor';

<ConfigEditor url="https://raw.githubusercontent.com/ory/hydra/master/spec/config.json" />
<ConfigEditor url="https://raw.githubusercontent.com/ory/hydra/master/.schema/config.schema.json" />
```
7 changes: 5 additions & 2 deletions src/components/ConfigEditor/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import RefParser from "@apidevtools/json-schema-ref-parser"
import { ChakraProvider } from "@chakra-ui/react"
import { Theme as ChakraUITheme } from "@rjsf/chakra-ui"
import { withTheme } from "@rjsf/core"
import validator from "@rjsf/validator-ajv8"
Expand Down Expand Up @@ -27,8 +28,10 @@ export default function ConfigEditor(props: { url: any }) {
}

return (
<div className="bootstrap">
<Form schema={schema} liveValidate={true} validator={validator} />
<div className="config-editor">
<ChakraProvider>
<Form schema={schema} liveValidate={true} validator={validator} />
</ChakraProvider>
</div>
)
}
10 changes: 10 additions & 0 deletions src/css/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,13 @@ svg[class*="iconExternalLink"] {
margin-top: 1em;
}
}

.config-editor .unsupported-field pre {
max-width: 100%;
overflow: hidden;
white-space: pre-wrap;
}

.config-editor p {
margin: unset;
}
Loading