From 481369ced0b6ed5b88cd2be329d915e0282780fa 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 Fixes #3 --- .../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 6f7b54e..2049209 100644 --- a/src/main/java/com/flowingcode/vaadin/addons/markdown/BaseMarkdownComponent.java +++ b/src/main/java/com/flowingcode/vaadin/addons/markdown/BaseMarkdownComponent.java @@ -42,11 +42,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}; private String content; @@ -99,6 +107,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 44870cd..9783097 100644 --- a/src/test/java/com/flowingcode/vaadin/addons/markdown/MarkdownEditorDemo.java +++ b/src/test/java/com/flowingcode/vaadin/addons/markdown/MarkdownEditorDemo.java @@ -52,7 +52,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);