From 7b9530ba4c588f8fff9331c6e337e5f9abf63309 Mon Sep 17 00:00:00 2001 From: Domagoj Kriskovic Date: Mon, 29 Nov 2021 14:51:05 +0100 Subject: [PATCH 1/2] fix: removed NameValidations to properly show default values --- src/components/shared/Validations.tsx | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/src/components/shared/Validations.tsx b/src/components/shared/Validations.tsx index 775c7224..4f1e9f3d 100644 --- a/src/components/shared/Validations.tsx +++ b/src/components/shared/Validations.tsx @@ -5,7 +5,6 @@ import capitalize from 'lodash/capitalize.js'; import keys from 'lodash/keys.js'; import omit from 'lodash/omit.js'; import pick from 'lodash/pick.js'; -import pickBy from 'lodash/pickBy.js'; import uniq from 'lodash/uniq.js'; import * as React from 'react'; @@ -108,13 +107,8 @@ function filterOutOasFormatValidations(format: string, values: Dictionary = ({ validations, hideExamples }) => { const numberValidations = pick(validations, numberValidationNames); - const booleanValidations = omit( - pickBy(validations, v => ['true', 'false'].includes(String(v))), - excludedValidations, - ); const keyValueValidations = omit(validations, [ ...keys(numberValidations), - ...keys(booleanValidations), ...excludedValidations, ...(hideExamples ? exampleValidationNames : []), ]); @@ -123,7 +117,6 @@ export const Validations: React.FunctionComponent = ({ validations <> - ); }; @@ -176,20 +169,6 @@ const KeyValueValidation = ({ name, values }: { name: string; values: string[] } ); }; -const NameValidations = ({ validations }: { validations: Dictionary }) => ( - <> - {keys(validations).length ? ( - - {keys(validations) - .filter(key => validations[key]) - .map(key => ( - - ))} - - ) : null} - -); - const Value = ({ name, className }: { name: string; className?: string }) => ( Date: Mon, 29 Nov 2021 14:57:46 +0100 Subject: [PATCH 2/2] chore: update snapshot --- src/__tests__/__snapshots__/index.spec.tsx.snap | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/__tests__/__snapshots__/index.spec.tsx.snap b/src/__tests__/__snapshots__/index.spec.tsx.snap index af09a013..208f8e89 100644 --- a/src/__tests__/__snapshots__/index.spec.tsx.snap +++ b/src/__tests__/__snapshots__/index.spec.tsx.snap @@ -3583,7 +3583,10 @@ exports[`HTML Output should match tickets.schema.json 1`] = ` -
examples
+
+ Example value: + true +