functional modal
This commit is contained in:
1 parent
48aae0bf98
commit
90d4fbf8f6
12 files changed
+80
-88
No files matched your search
@@ -19,7 +19,7 @@ export const ActionChooseState: OptionManager<ChooseAction> = {
|
||||
},
|
||||
renderOptionList: (state, setState) => {
|
||||
const update = updateActionData(state, setState);
|
||||
return <div className="state-manager-options">
|
||||
return <>
|
||||
<InputText
|
||||
label="Description"
|
||||
value={state.action_data.alias ?? ""}
|
||||
@@ -35,6 +35,6 @@ export const ActionChooseState: OptionManager<ChooseAction> = {
|
||||
value={state.action_data.default}
|
||||
onChange={d => update({ default: d })}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
}
|
||||
}
|
||||
@@ -32,7 +32,7 @@ export const ActionDeviceState: OptionManager<DeviceAction> = {
|
||||
),
|
||||
renderOptionList: (state, setState) => {
|
||||
const update = updateActionData(state, setState);
|
||||
return <div className="state-manager-options">
|
||||
return <>
|
||||
<InputText
|
||||
label="Description"
|
||||
value={state.action_data.alias ?? ""}
|
||||
@@ -56,6 +56,6 @@ export const ActionDeviceState: OptionManager<DeviceAction> = {
|
||||
value={state.action_data.entity_id ?? ""}
|
||||
onChange={entity_id => update({ entity_id, domain: entity_id.split('.')[0] })}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,7 @@ export const ActionEventState: OptionManager<FireEventAction> = {
|
||||
),
|
||||
renderOptionList: (state, setState) => {
|
||||
const update = updateActionData(state, setState);
|
||||
return <div className="state-manager-options">
|
||||
return <>
|
||||
<InputText
|
||||
label="Description"
|
||||
value={state.action_data.alias ?? ""}
|
||||
@@ -37,6 +37,6 @@ export const ActionEventState: OptionManager<FireEventAction> = {
|
||||
value={state.action_data.event_data}
|
||||
onChange={event_data => update({ event_data })}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,7 @@ export const ActionRepeatState: OptionManager<RepeatAction> = {
|
||||
),
|
||||
renderOptionList: (state, setState) => {
|
||||
const update = updateActionData(state, setState);
|
||||
return <div className="state-manager-options">
|
||||
return <>
|
||||
<InputText
|
||||
label="Description"
|
||||
value={state.action_data.alias ?? ""}
|
||||
@@ -42,6 +42,6 @@ export const ActionRepeatState: OptionManager<RepeatAction> = {
|
||||
value={state.action_data.repeat.sequence ?? []}
|
||||
onChange={sequence => update({ repeat: { ...state.action_data.repeat, sequence } })}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@ export const ActionCallServiceState: OptionManager<ServiceAction> = {
|
||||
renderOptionList: (state, setState) => {
|
||||
const { service, alias = "", target } = state.action_data;
|
||||
const update = updateActionData(state, setState);
|
||||
return <div className="state-manager-options">
|
||||
return <>
|
||||
<InputText
|
||||
label="Description"
|
||||
value={alias}
|
||||
@@ -40,6 +40,6 @@ export const ActionCallServiceState: OptionManager<ServiceAction> = {
|
||||
value={target}
|
||||
onChange={target => update({ target })}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
}
|
||||
}
|
||||
@@ -23,10 +23,10 @@ export const ActionWaitState: OptionManager<WaitAction> = {
|
||||
),
|
||||
renderOptionList: (state, setState) => {
|
||||
const update = updateActionData(state, setState);
|
||||
return <div className="state-manager-options">
|
||||
return <>
|
||||
<InputText
|
||||
label="Description"
|
||||
value={state.action_data.alias}
|
||||
value={state.action_data.alias ?? ""}
|
||||
onChange={alias => update({ alias })}
|
||||
/>
|
||||
<InputText
|
||||
@@ -45,6 +45,6 @@ export const ActionWaitState: OptionManager<WaitAction> = {
|
||||
value={state.action_data.continue_on_timeout ?? false}
|
||||
onChange={continue_on_timeout => update({ continue_on_timeout })}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
}
|
||||
}
|
||||
@@ -13,11 +13,9 @@ export const ConditionLogicState: OptionManager<AutomationCondition> = {
|
||||
}
|
||||
}),
|
||||
isReady: _ => true,
|
||||
renderOptionList: (state, setState) => <div className="state-manager-options">
|
||||
<ConditionEditor
|
||||
condition={state}
|
||||
onUpdate={setState}
|
||||
onDelete={() => { }}
|
||||
/>
|
||||
</div>
|
||||
renderOptionList: (state, setState) => <ConditionEditor
|
||||
condition={state}
|
||||
onUpdate={setState}
|
||||
onDelete={() => { }}
|
||||
/>
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import { OptionManager } from "./OptionManager";
|
||||
export const Generic: OptionManager<any> = {
|
||||
defaultState: () => ({}),
|
||||
isReady: _ => true,
|
||||
renderOptionList: () => <div className="state-manager-options">
|
||||
renderOptionList: () => <>
|
||||
<b>THIS IS NOT SUPPORTED YET!</b>
|
||||
</div>
|
||||
</>
|
||||
}
|
||||
@@ -17,6 +17,9 @@ export const useEditorNodeState = (node: AutomationNode) => {
|
||||
nodeType,
|
||||
subType,
|
||||
subTypes,
|
||||
get data() {
|
||||
return state
|
||||
},
|
||||
renderOptionList() {
|
||||
return optionManager.renderOptionList(state, setState);
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user