From 94144cdb8e45cad3a3f0b667736ee3da3d0421fb Mon Sep 17 00:00:00 2001 From: Florian Schaupp Date: Tue, 20 May 2025 13:38:47 +0200 Subject: [PATCH 1/5] debounce UIButton klick to mitigate DoS --- src/main/components/buttons/button/UIButton.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/components/buttons/button/UIButton.tsx b/src/main/components/buttons/button/UIButton.tsx index 280c6cc79..ddddcce51 100644 --- a/src/main/components/buttons/button/UIButton.tsx +++ b/src/main/components/buttons/button/UIButton.tsx @@ -35,6 +35,7 @@ import IBaseComponent from "../../../util/types/IBaseComponent"; import { IComponentConstants } from "../../BaseComponent"; import { IEditorCheckBox, handleCheckboxOnChange } from "../../editors/checkbox/UIEditorCheckbox"; import CELLEDITOR_CLASSNAMES from "../../editors/CELLEDITOR_CLASSNAMES"; +import _ from "underscore"; // If the Buttons text contains HTML, render it in a span, because the button on its own isn't able to render HTML. export const RenderButtonHTML: FC<{ text:string }> = (props) => { @@ -105,7 +106,7 @@ const UIButton: FC { + const onButtonPress = useMemo(() => _.debounce((event: any) => { if (!isCheckboxCellEditor(props)) { // ReactUI as lib, execute given event if (props.onClick) { @@ -135,7 +136,7 @@ const UIButton: FC { From 573fe8a8a3ba69aed8af0d402e24b033c5db111c Mon Sep 17 00:00:00 2001 From: Florian Schaupp Date: Tue, 20 May 2025 13:38:47 +0200 Subject: [PATCH 2/5] debounce UIButton klick to mitigate DoS --- src/main/components/buttons/button/UIButton.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/components/buttons/button/UIButton.tsx b/src/main/components/buttons/button/UIButton.tsx index 280c6cc79..ddddcce51 100644 --- a/src/main/components/buttons/button/UIButton.tsx +++ b/src/main/components/buttons/button/UIButton.tsx @@ -35,6 +35,7 @@ import IBaseComponent from "../../../util/types/IBaseComponent"; import { IComponentConstants } from "../../BaseComponent"; import { IEditorCheckBox, handleCheckboxOnChange } from "../../editors/checkbox/UIEditorCheckbox"; import CELLEDITOR_CLASSNAMES from "../../editors/CELLEDITOR_CLASSNAMES"; +import _ from "underscore"; // If the Buttons text contains HTML, render it in a span, because the button on its own isn't able to render HTML. export const RenderButtonHTML: FC<{ text:string }> = (props) => { @@ -105,7 +106,7 @@ const UIButton: FC { + const onButtonPress = useMemo(() => _.debounce((event: any) => { if (!isCheckboxCellEditor(props)) { // ReactUI as lib, execute given event if (props.onClick) { @@ -135,7 +136,7 @@ const UIButton: FC { From 1e6081bcaa81fafa2e4a50aeae7422e125224a2b Mon Sep 17 00:00:00 2001 From: Florian Schaupp Date: Thu, 15 May 2025 13:22:31 +0200 Subject: [PATCH 3/5] set background-color of the tabs Setting the background-color on the TabsetPanel had no effect on the tabs. ```java UITabsetPanel tp = new UITabsetPanel(); tp.setBackground(UIColor.red); ``` --- src/main/components/panels/tabsetpanel/TabsetPanelImpl.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/components/panels/tabsetpanel/TabsetPanelImpl.tsx b/src/main/components/panels/tabsetpanel/TabsetPanelImpl.tsx index ef2518976..141065d11 100644 --- a/src/main/components/panels/tabsetpanel/TabsetPanelImpl.tsx +++ b/src/main/components/panels/tabsetpanel/TabsetPanelImpl.tsx @@ -186,7 +186,7 @@ const TabsetPanelImpl: FC = (props) => { style={props.screen_modal_ || props.content_modal_ ? { height: (prefSize?.height as number), width: prefSize?.width } : { ...props.layoutStyle, ...props.compStyle }}> props.onTabChange(event.index)} onBeforeTabClose={event => props.onTabClose(event.index)} From 93488777e481f6ddc806ea7873628eecab245f73 Mon Sep 17 00:00:00 2001 From: Florian Schaupp Date: Thu, 15 May 2025 13:22:31 +0200 Subject: [PATCH 4/5] set background-color of the tabs Setting the background-color on the TabsetPanel had no effect on the tabs. ```java UITabsetPanel tp = new UITabsetPanel(); tp.setBackground(UIColor.red); ``` --- src/main/components/panels/tabsetpanel/TabsetPanelImpl.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/components/panels/tabsetpanel/TabsetPanelImpl.tsx b/src/main/components/panels/tabsetpanel/TabsetPanelImpl.tsx index 056b4698c..19baefd54 100644 --- a/src/main/components/panels/tabsetpanel/TabsetPanelImpl.tsx +++ b/src/main/components/panels/tabsetpanel/TabsetPanelImpl.tsx @@ -186,7 +186,7 @@ const TabsetPanelImpl: FC = (props) => { style={props.screen_modal_ || props.content_modal_ ? { height: (prefSize?.height as number), width: prefSize?.width } : { ...props.layoutStyle, ...props.compStyle }}> props.onTabChange(event.index)} onBeforeTabClose={event => props.onTabClose(event.index)} From 8cc1043e4c8ce127d01d36755ab3d80c11d69a21 Mon Sep 17 00:00:00 2001 From: Florian Schaupp Date: Mon, 21 Jul 2025 13:45:29 +0200 Subject: [PATCH 5/5] revert IIG-Change from master --- src/main/components/buttons/button/UIButton.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/components/buttons/button/UIButton.tsx b/src/main/components/buttons/button/UIButton.tsx index ddddcce51..280c6cc79 100644 --- a/src/main/components/buttons/button/UIButton.tsx +++ b/src/main/components/buttons/button/UIButton.tsx @@ -35,7 +35,6 @@ import IBaseComponent from "../../../util/types/IBaseComponent"; import { IComponentConstants } from "../../BaseComponent"; import { IEditorCheckBox, handleCheckboxOnChange } from "../../editors/checkbox/UIEditorCheckbox"; import CELLEDITOR_CLASSNAMES from "../../editors/CELLEDITOR_CLASSNAMES"; -import _ from "underscore"; // If the Buttons text contains HTML, render it in a span, because the button on its own isn't able to render HTML. export const RenderButtonHTML: FC<{ text:string }> = (props) => { @@ -106,7 +105,7 @@ const UIButton: FC _.debounce((event: any) => { + const onButtonPress = (event:any) => { if (!isCheckboxCellEditor(props)) { // ReactUI as lib, execute given event if (props.onClick) { @@ -136,7 +135,7 @@ const UIButton: FC {