From bfdb4f965ec380a5e6463bc27c7638210374d1c1 Mon Sep 17 00:00:00 2001 From: Martin Lopez Date: Thu, 17 Oct 2024 17:56:19 -0300 Subject: [PATCH] deprecate: correct typo on DataColorMode enum value --- .../addons/markdown/BaseMarkdownComponent.java | 13 +++++++++++-- .../vaadin/addons/markdown/MarkdownEditorDemo.java | 2 +- .../vaadin/addons/markdown/MarkdownViewerDemo.java | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/flowingcode/vaadin/addons/markdown/BaseMarkdownComponent.java b/src/main/java/com/flowingcode/vaadin/addons/markdown/BaseMarkdownComponent.java index 97c8d9b..f27f7c0 100644 --- a/src/main/java/com/flowingcode/vaadin/addons/markdown/BaseMarkdownComponent.java +++ b/src/main/java/com/flowingcode/vaadin/addons/markdown/BaseMarkdownComponent.java @@ -41,11 +41,19 @@ public class BaseMarkdownComponent extends ReactAdapterComponent implements HasS * * */ - public enum DataColorMode {DARK,LIGTH,AUTO}; + public enum DataColorMode { + DARK, + LIGHT, + /** + * @deprecated Use LIGHT instead + */ + @Deprecated + LIGTH, + AUTO}; /** * Base constructor that receives the content of the markdown component. @@ -85,6 +93,7 @@ public void setDataColorMode(DataColorMode mode) { getElement().setAttribute("data-color-mode", "dark"); break; case LIGTH: + case LIGHT: getElement().setAttribute("data-color-mode", "light"); break; case AUTO: diff --git a/src/test/java/com/flowingcode/vaadin/addons/markdown/MarkdownEditorDemo.java b/src/test/java/com/flowingcode/vaadin/addons/markdown/MarkdownEditorDemo.java index 61ad7cd..6c7d944 100644 --- a/src/test/java/com/flowingcode/vaadin/addons/markdown/MarkdownEditorDemo.java +++ b/src/test/java/com/flowingcode/vaadin/addons/markdown/MarkdownEditorDemo.java @@ -49,7 +49,7 @@ public MarkdownEditorDemo() { mde.setDataColorMode(DataColorMode.DARK); break; case "Light": - mde.setDataColorMode(DataColorMode.LIGTH); + mde.setDataColorMode(DataColorMode.LIGHT); break; case "Automatic": mde.setDataColorMode(DataColorMode.AUTO); diff --git a/src/test/java/com/flowingcode/vaadin/addons/markdown/MarkdownViewerDemo.java b/src/test/java/com/flowingcode/vaadin/addons/markdown/MarkdownViewerDemo.java index 31a8c40..f60ec19 100644 --- a/src/test/java/com/flowingcode/vaadin/addons/markdown/MarkdownViewerDemo.java +++ b/src/test/java/com/flowingcode/vaadin/addons/markdown/MarkdownViewerDemo.java @@ -212,7 +212,7 @@ public MarkdownViewerDemo() { mdv.setDataColorMode(DataColorMode.DARK); break; case "Light": - mdv.setDataColorMode(DataColorMode.LIGTH); + mdv.setDataColorMode(DataColorMode.LIGHT); break; case "Automatic": mdv.setDataColorMode(DataColorMode.AUTO);