From e6fd1f639dfbc825599a6e7156ccf92c0cc00c52 Mon Sep 17 00:00:00 2001 From: Marcell Toth Date: Fri, 26 Mar 2021 15:36:26 +0100 Subject: [PATCH 1/4] fix: align arrows --- src/components/SchemaRow/SchemaRow.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/SchemaRow/SchemaRow.tsx b/src/components/SchemaRow/SchemaRow.tsx index d2b4c60c..f4de633a 100644 --- a/src/components/SchemaRow/SchemaRow.tsx +++ b/src/components/SchemaRow/SchemaRow.tsx @@ -75,9 +75,10 @@ export const SchemaRow: React.FunctionComponent = ({ schemaNode, ...(!isBrokenRef && nestingLevel === 0 ? { position: 'relative', + left: -1 * SCHEMA_ROW_OFFSET, } : { - left: CARET_ICON_BOX_DIMENSION * -1 + SCHEMA_ROW_OFFSET / -2, + left: CARET_ICON_BOX_DIMENSION * -1 - SCHEMA_ROW_OFFSET, }), }} size={CARET_ICON_SIZE} From 572a723f7f9e75ac6b32f1656b095713b7d47e15 Mon Sep 17 00:00:00 2001 From: Marcell Toth Date: Fri, 26 Mar 2021 15:38:12 +0100 Subject: [PATCH 2/4] fix: symmetric margins --- src/components/JsonSchemaViewer.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/JsonSchemaViewer.tsx b/src/components/JsonSchemaViewer.tsx index 058f8415..ddbe7b80 100644 --- a/src/components/JsonSchemaViewer.tsx +++ b/src/components/JsonSchemaViewer.tsx @@ -66,7 +66,7 @@ const JsonSchemaViewerComponent: React.FC From a089100899205c39678b0fcec90464b65b4d10ac Mon Sep 17 00:00:00 2001 From: Marcell Toth Date: Fri, 26 Mar 2021 18:01:07 +0100 Subject: [PATCH 3/4] fix: let the description text break into new lines --- src/components/SchemaRow/SchemaRow.tsx | 6 +++--- src/components/shared/Description.tsx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/SchemaRow/SchemaRow.tsx b/src/components/SchemaRow/SchemaRow.tsx index f4de633a..1793cbe2 100644 --- a/src/components/SchemaRow/SchemaRow.tsx +++ b/src/components/SchemaRow/SchemaRow.tsx @@ -85,7 +85,7 @@ export const SchemaRow: React.FunctionComponent = ({ schemaNode, /> ) : null} -
+
{schemaNode.subpath.length > 0 && shouldShowPropertyName(schemaNode) && (
{last(schemaNode.subpath)}
)} @@ -111,7 +111,7 @@ export const SchemaRow: React.FunctionComponent = ({ schemaNode, ) : null} {schemaNode.subpath.length > 1 && schemaNode.subpath[0] === 'patternProperties' ? ( -
(pattern property)
+
(pattern property)
) : null} {choices.length > 1 && (
"`, + `"
"`, ); }); @@ -164,7 +164,7 @@ describe('Property component', () => { const wrapper = render(schema); expect(wrapper.html()).toMatchInlineSnapshot( - `"
array of objects
foo
bar
baz
"`, + `"
array of objects
foo
bar
baz
"`, ); }); @@ -199,12 +199,12 @@ describe('Property component', () => { let wrapper = render(schema, ['properties', 'array-all-objects', 'items', 'properties', 'foo']); expect(wrapper.html()).toMatchInlineSnapshot( - `"
foo
string
"`, + `"
foo
string
"`, ); wrapper = render(schema, ['properties', 'array-all-objects', 'items', 'properties', 'bar']); expect(wrapper.html()).toMatchInlineSnapshot( - `"
bar
string
"`, + `"
bar
string
"`, ); }); @@ -224,7 +224,7 @@ describe('Property component', () => { const wrapper = mount(); expect(wrapper.html()).toMatchInlineSnapshot( - `"
foo
object
"`, + `"
foo
object
"`, ); wrapper.unmount(); });