mirror of
https://github.com/tiqi-group/pydase.git
synced 2025-04-20 00:10:03 +02:00
adds "display" web settings support to frontend
Components with a "display" equals false in the web settings will not be displayed in the frontend.
This commit is contained in:
parent
df42f41f53
commit
4a948f9155
@ -4,5 +4,6 @@ export const WebSettingsContext = createContext<Record<string, WebSetting>>({});
|
|||||||
|
|
||||||
export type WebSetting = {
|
export type WebSetting = {
|
||||||
displayName: string;
|
displayName: string;
|
||||||
|
display: boolean;
|
||||||
index: number;
|
index: number;
|
||||||
};
|
};
|
||||||
|
@ -62,9 +62,14 @@ export const GenericComponent = React.memo(
|
|||||||
const webSettings = useContext(WebSettingsContext);
|
const webSettings = useContext(WebSettingsContext);
|
||||||
let displayName = name;
|
let displayName = name;
|
||||||
|
|
||||||
if (webSettings[fullAccessPath] && webSettings[fullAccessPath].displayName) {
|
if (webSettings[fullAccessPath]) {
|
||||||
|
if (webSettings[fullAccessPath].display === false) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (webSettings[fullAccessPath].displayName) {
|
||||||
displayName = webSettings[fullAccessPath].displayName;
|
displayName = webSettings[fullAccessPath].displayName;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function changeCallback(
|
function changeCallback(
|
||||||
value: unknown,
|
value: unknown,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user