From ad5cebcdb27c95d7bd6415319a8bb9e8c4e7a845 Mon Sep 17 00:00:00 2001 From: Herbert Gainor Date: Thu, 1 Sep 2022 20:50:21 -0600 Subject: [PATCH 1/5] Change text and icons in dashboard editmode - Change 'Markdown' to 'Text' in edit mode sidebar - Change default text in markdown editor --- .../src/dashboard/components/gridComponents/Markdown.jsx | 8 ++++---- .../components/gridComponents/new/NewMarkdown.jsx | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/superset-frontend/src/dashboard/components/gridComponents/Markdown.jsx b/superset-frontend/src/dashboard/components/gridComponents/Markdown.jsx index 31fae65c462af..79fccfadc9761 100644 --- a/superset-frontend/src/dashboard/components/gridComponents/Markdown.jsx +++ b/superset-frontend/src/dashboard/components/gridComponents/Markdown.jsx @@ -69,13 +69,13 @@ const propTypes = { const defaultProps = {}; -const MARKDOWN_PLACE_HOLDER = `# ✨Markdown -## ✨Markdown -### ✨Markdown +const MARKDOWN_PLACE_HOLDER = `# ✨Header 1 +## ✨Header 2 +### ✨Header 3
-Click here to edit [markdown](https://bit.ly/1dQOfRK)`; +Click here to learn more about [markdown formatting](https://bit.ly/1dQOfRK)`; const MARKDOWN_ERROR_MESSAGE = t('This markdown component has an error.'); diff --git a/superset-frontend/src/dashboard/components/gridComponents/new/NewMarkdown.jsx b/superset-frontend/src/dashboard/components/gridComponents/new/NewMarkdown.jsx index f16b4b55f42d3..236b52f3b2a5d 100644 --- a/superset-frontend/src/dashboard/components/gridComponents/new/NewMarkdown.jsx +++ b/superset-frontend/src/dashboard/components/gridComponents/new/NewMarkdown.jsx @@ -27,8 +27,8 @@ export default function DraggableNewDivider() { ); } From 6fc59c811f520486414e560ca2d495d0ce638c81 Mon Sep 17 00:00:00 2001 From: Herbert Gainor Date: Sun, 25 Sep 2022 23:47:23 -0600 Subject: [PATCH 2/5] Adjust Cypress Test --- .../cypress-base/cypress/integration/dashboard/editmode.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/editmode.test.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/editmode.test.ts index c7b5f312880ea..078234e11ae82 100644 --- a/superset-frontend/cypress-base/cypress/integration/dashboard/editmode.test.ts +++ b/superset-frontend/cypress-base/cypress/integration/dashboard/editmode.test.ts @@ -240,7 +240,7 @@ describe('Dashboard edit', () => { cy.get('[data-test="dashboard-markdown-editor"]') .should( 'have.text', - '✨Markdown✨Markdown✨MarkdownClick here to edit markdown', + '✨Header 1✨Header 2✨Header 3Click here to learn more about', ) .click(); From f9624116802b9c65853fa2244ab7a88fa73b69dc Mon Sep 17 00:00:00 2001 From: Herbert Gainor Date: Wed, 28 Sep 2022 11:51:15 -0600 Subject: [PATCH 3/5] Fix cypress test --- .../cypress/integration/dashboard/editmode.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/editmode.test.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/editmode.test.ts index 078234e11ae82..2b65fced6ef02 100644 --- a/superset-frontend/cypress-base/cypress/integration/dashboard/editmode.test.ts +++ b/superset-frontend/cypress-base/cypress/integration/dashboard/editmode.test.ts @@ -235,7 +235,7 @@ describe('Dashboard edit', () => { .click(); // add new markdown component - dragComponent('Markdown', 'new-component'); + dragComponent('Text', 'new-component'); cy.get('[data-test="dashboard-markdown-editor"]') .should( @@ -245,7 +245,7 @@ describe('Dashboard edit', () => { .click(); cy.getBySel('dashboard-component-chart-holder').contains( - 'Click here to edit [markdown](https://bit.ly/1dQOfRK)', + 'Click here to learn more about [markdown formatting](https://bit.ly/1dQOfRK)', ); cy.getBySel('dashboard-markdown-editor').click().type('Test resize'); From d529598097f608cb7e86159b67ffd4a66c58d791 Mon Sep 17 00:00:00 2001 From: Herbert Gainor Date: Wed, 28 Sep 2022 11:51:15 -0600 Subject: [PATCH 4/5] Fix cypress test --- .../cypress/integration/dashboard/editmode.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/editmode.test.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/editmode.test.ts index 078234e11ae82..2b65fced6ef02 100644 --- a/superset-frontend/cypress-base/cypress/integration/dashboard/editmode.test.ts +++ b/superset-frontend/cypress-base/cypress/integration/dashboard/editmode.test.ts @@ -235,7 +235,7 @@ describe('Dashboard edit', () => { .click(); // add new markdown component - dragComponent('Markdown', 'new-component'); + dragComponent('Text', 'new-component'); cy.get('[data-test="dashboard-markdown-editor"]') .should( @@ -245,7 +245,7 @@ describe('Dashboard edit', () => { .click(); cy.getBySel('dashboard-component-chart-holder').contains( - 'Click here to edit [markdown](https://bit.ly/1dQOfRK)', + 'Click here to learn more about [markdown formatting](https://bit.ly/1dQOfRK)', ); cy.getBySel('dashboard-markdown-editor').click().type('Test resize'); From 5b3d61de255d7c35d3f4ec6da831c167dc57409e Mon Sep 17 00:00:00 2001 From: geido Date: Thu, 29 Sep 2022 17:35:40 +0300 Subject: [PATCH 5/5] Update click coordinates --- .../cypress/integration/dashboard/editmode.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/editmode.test.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/editmode.test.ts index 18b0d16c3dd02..d15bcc06c5976 100644 --- a/superset-frontend/cypress-base/cypress/integration/dashboard/editmode.test.ts +++ b/superset-frontend/cypress-base/cypress/integration/dashboard/editmode.test.ts @@ -237,12 +237,12 @@ describe('Dashboard edit', () => { // add new markdown component dragComponent('Text', 'new-component'); - cy.get('[data-test="dashboard-markdown-editor"]') + cy.getBySel('dashboard-markdown-editor') .should( 'have.text', '✨Header 1✨Header 2✨Header 3Click here to learn more about markdown formatting', ) - .click(); + .click(10, 10); cy.getBySel('dashboard-component-chart-holder').contains( 'Click here to learn more about [markdown formatting](https://bit.ly/1dQOfRK)',