diff --git a/packages/page-storage/src/Query.tsx b/packages/page-storage/src/Query.tsx index 047ba97b6e..4ecfcf5d8c 100644 --- a/packages/page-storage/src/Query.tsx +++ b/packages/page-storage/src/Query.tsx @@ -131,7 +131,7 @@ function getCachedComponent (registry: Registry, query: QueryTypes): CacheInstan const defaultProps = { className: 'ui--output' }; const Component = renderHelper( // By default we render a simple div node component with the query results in it - (value: unknown) =>
{valueToText(type, value as null)}
, + (value: unknown) =>
{valueToText(type, value as null, undefined, true)}
, defaultProps ); diff --git a/packages/react-params/src/valueToText.tsx b/packages/react-params/src/valueToText.tsx index ad38f01f5d..c6f1e3af36 100644 --- a/packages/react-params/src/valueToText.tsx +++ b/packages/react-params/src/valueToText.tsx @@ -33,12 +33,12 @@ function formatKeys (keys: [ValidatorId, Keys][]): string { ); } -function toHuman (value: Codec | Codec[]): unknown { +function toHuman (value: Codec | Codec[], isExtended?: boolean, disableAscii?: boolean): unknown { // eslint-disable-next-line @typescript-eslint/unbound-method return isFunction((value as Codec).toHuman) - ? (value as Codec).toHuman() + ? (value as Codec).toHuman(isExtended, disableAscii) : Array.isArray(value) - ? value.map((v) => toHuman(v)) + ? value.map((v) => toHuman(v, isExtended, disableAscii)) : value.toString(); } @@ -50,7 +50,7 @@ export function toHumanJson (value: unknown): string { .replace(/\],\[/g, '],\n['); } -export default function valueToText (type: string, value: Codec | undefined | null): React.ReactNode { +export default function valueToText (type: string, value: Codec | undefined | null, isExtended?: boolean, disableAscii?: boolean): React.ReactNode { if (isNull(value) || isUndefined(value)) { const { cName, key, values } = div({}, ''); @@ -78,7 +78,7 @@ export default function valueToText (type: string, value: Codec | undefined | nu : value.toString() : (value instanceof Option) && value.isNone ? '' - : toHumanJson(toHuman(value)) + : toHumanJson(toHuman(value, isExtended, disableAscii)) ); const { cName, key, values } = div({}, renderedValue);