From bd8b7b468c671ec3559a86e89e3cf1a587bf9133 Mon Sep 17 00:00:00 2001 From: Nikhil Kuriakose Date: Mon, 7 Jul 2025 10:49:26 +0200 Subject: [PATCH] fix(editor): Show escape characters in json view (#16930) --- cypress/e2e/5-ndv.cy.ts | 2 +- .../editor-ui/src/components/RunDataJson.vue | 16 ++++--- .../__snapshots__/RunDataJson.test.ts.snap | 42 ++++++++++++++++--- 3 files changed, 44 insertions(+), 16 deletions(-) diff --git a/cypress/e2e/5-ndv.cy.ts b/cypress/e2e/5-ndv.cy.ts index 66978e4b33..23223aa0bf 100644 --- a/cypress/e2e/5-ndv.cy.ts +++ b/cypress/e2e/5-ndv.cy.ts @@ -712,7 +712,7 @@ describe('NDV', () => { .outputDataContainer() .should( 'have.text', - '[{"body": " Introduction to XML John Doe 2020 1234567890 Data Science Basics Jane Smith 2019 0987654321 Programming in Python Bob Johnson 2021 5432109876 "}]', + '[{"body": " Introduction to XML John Doe 2020 1234567890 Data Science Basics Jane Smith 2019 0987654321 Programming in Python Bob Johnson 2021 5432109876 "}]', ); ndv.getters.outputDataContainer().find('mark').should('have.text', ' { }, 1000); // ensure dest data gets set if drop }; -const getContent = (value: unknown) => { +const formatKey = (value: unknown) => { return isString(value) ? `"${value}"` : JSON.stringify(value); }; +const formatValue = (value: unknown) => { + return JSON.stringify(value); +}; + const getListItemName = (path: string) => { return path.replace(/^(\["?\d"?]\.?)/g, ''); }; @@ -168,7 +172,7 @@ const getListItemName = (path: string) => { >