From dfe543067f428b45ef438f839dfaf086d03f2a6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mose=20M=C3=BCller?= Date: Wed, 17 Apr 2024 09:07:24 +0200 Subject: [PATCH 1/4] fixes frontend button --- frontend/src/components/ButtonComponent.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/ButtonComponent.tsx b/frontend/src/components/ButtonComponent.tsx index fabdda3..473d74e 100644 --- a/frontend/src/components/ButtonComponent.tsx +++ b/frontend/src/components/ButtonComponent.tsx @@ -40,7 +40,13 @@ export const ButtonComponent = React.memo((props: ButtonComponentProps) => { }, [props.value]); const setChecked = (checked: boolean) => { - changeCallback(checked); + changeCallback({ + type: 'bool', + value: checked, + full_access_path: fullAccessPath, + readonly: readOnly, + doc: docString + }); }; return ( From f5e108bbe57170bcba645ca7bedcb1382ee380b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mose=20M=C3=BCller?= Date: Wed, 17 Apr 2024 09:11:33 +0200 Subject: [PATCH 2/4] fixes readonly coloured enum --- frontend/src/components/EnumComponent.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/EnumComponent.tsx b/frontend/src/components/EnumComponent.tsx index aaa23a5..6b5d6b9 100644 --- a/frontend/src/components/EnumComponent.tsx +++ b/frontend/src/components/EnumComponent.tsx @@ -69,7 +69,12 @@ export const EnumComponent = React.memo((props: EnumComponentProps) => { {readOnly ? ( // Display the Form.Control when readOnly is true From ec1f68ae4a9887ccab269c7bcdab03afcb64ed49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mose=20M=C3=BCller?= Date: Wed, 17 Apr 2024 09:21:02 +0200 Subject: [PATCH 3/4] using fullAccessPath as Form name for NumberComponent fixing cursor jumps --- frontend/src/components/NumberComponent.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/NumberComponent.tsx b/frontend/src/components/NumberComponent.tsx index 9bbf9dd..b53ebd7 100644 --- a/frontend/src/components/NumberComponent.tsx +++ b/frontend/src/components/NumberComponent.tsx @@ -174,7 +174,6 @@ export const NumberComponent = React.memo((props: NumberComponentProps) => { // Create a state for the input string const [inputString, setInputString] = useState(value.toString()); const renderCount = useRef(0); - const name = fullAccessPath.split('.').at(-1); const handleKeyDown = (event) => { const { key, target } = event; @@ -329,7 +328,9 @@ export const NumberComponent = React.memo((props: NumberComponentProps) => { useEffect(() => { // Set the cursor position after the component re-renders - const inputElement = document.getElementsByName(name)[0] as HTMLInputElement; + const inputElement = document.getElementsByName( + fullAccessPath + )[0] as HTMLInputElement; if (inputElement && cursorPosition !== null) { inputElement.setSelectionRange(cursorPosition, cursorPosition); } @@ -351,7 +352,7 @@ export const NumberComponent = React.memo((props: NumberComponentProps) => { type="text" value={inputString} disabled={readOnly} - name={name} + name={fullAccessPath} onKeyDown={handleKeyDown} onBlur={handleBlur} className={isInstantUpdate && !readOnly ? 'instantUpdate' : ''} From 8832c879a1451b15d9c68b1be0f15fffccf0c872 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mose=20M=C3=BCller?= Date: Wed, 17 Apr 2024 09:21:51 +0200 Subject: [PATCH 4/4] npm run build --- src/pydase/frontend/asset-manifest.json | 6 +++--- src/pydase/frontend/index.html | 2 +- .../static/js/{main.9c35da6c.js => main.27a065cb.js} | 6 +++--- ...9c35da6c.js.LICENSE.txt => main.27a065cb.js.LICENSE.txt} | 0 src/pydase/frontend/static/js/main.27a065cb.js.map | 1 + src/pydase/frontend/static/js/main.9c35da6c.js.map | 1 - 6 files changed, 8 insertions(+), 8 deletions(-) rename src/pydase/frontend/static/js/{main.9c35da6c.js => main.27a065cb.js} (72%) rename src/pydase/frontend/static/js/{main.9c35da6c.js.LICENSE.txt => main.27a065cb.js.LICENSE.txt} (100%) create mode 100644 src/pydase/frontend/static/js/main.27a065cb.js.map delete mode 100644 src/pydase/frontend/static/js/main.9c35da6c.js.map diff --git a/src/pydase/frontend/asset-manifest.json b/src/pydase/frontend/asset-manifest.json index 93ea852..351d762 100644 --- a/src/pydase/frontend/asset-manifest.json +++ b/src/pydase/frontend/asset-manifest.json @@ -1,13 +1,13 @@ { "files": { "main.css": "/static/css/main.7ef670d5.css", - "main.js": "/static/js/main.9c35da6c.js", + "main.js": "/static/js/main.27a065cb.js", "index.html": "/index.html", "main.7ef670d5.css.map": "/static/css/main.7ef670d5.css.map", - "main.9c35da6c.js.map": "/static/js/main.9c35da6c.js.map" + "main.27a065cb.js.map": "/static/js/main.27a065cb.js.map" }, "entrypoints": [ "static/css/main.7ef670d5.css", - "static/js/main.9c35da6c.js" + "static/js/main.27a065cb.js" ] } \ No newline at end of file diff --git a/src/pydase/frontend/index.html b/src/pydase/frontend/index.html index 03542b0..dcd4623 100644 --- a/src/pydase/frontend/index.html +++ b/src/pydase/frontend/index.html @@ -1 +1 @@ -pydase App
\ No newline at end of file +pydase App
\ No newline at end of file diff --git a/src/pydase/frontend/static/js/main.9c35da6c.js b/src/pydase/frontend/static/js/main.27a065cb.js similarity index 72% rename from src/pydase/frontend/static/js/main.9c35da6c.js rename to src/pydase/frontend/static/js/main.27a065cb.js index 3d266a4..a86e96d 100644 --- a/src/pydase/frontend/static/js/main.9c35da6c.js +++ b/src/pydase/frontend/static/js/main.27a065cb.js @@ -1,3 +1,3 @@ -/*! For license information please see main.9c35da6c.js.LICENSE.txt */ -(()=>{var e={694:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t{"use strict";e.exports=function(e,t,n,r,o,a,i,s){if(!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,a,i,s],u=0;(l=new Error(t.replace(/%s/g,(function(){return c[u++]})))).name="Invariant Violation"}throw l.framesToPop=1,l}}},888:(e,t,n)=>{"use strict";var r=n(47);function o(){}function a(){}a.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,a,i){if(i!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:o};return n.PropTypes=n,n}},7:(e,t,n)=>{e.exports=n(888)()},47:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},463:(e,t,n)=>{"use strict";var r=n(791),o=n(296);function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n