mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-24 09:28:31 +00:00
Feature: Remove event actions from widgets
This commit is contained in:
parent
8dcc327df8
commit
2db557ad24
1 changed files with 19 additions and 4 deletions
|
|
@ -48,6 +48,23 @@ export const EventSelector = ({
|
||||||
return modalOptions;
|
return modalOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function eventChanged(param, value, extraData) {
|
||||||
|
if(value === 'none') {
|
||||||
|
eventUpdated(param, null, null);
|
||||||
|
} else {
|
||||||
|
eventUpdated(param, value, extraData)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let actionOptions = ActionTypes.map((action) => {
|
||||||
|
return { name: action.name, value: action.id };
|
||||||
|
});
|
||||||
|
|
||||||
|
actionOptions.unshift({
|
||||||
|
name: 'None',
|
||||||
|
value: 'none'
|
||||||
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="field mb-3 mt-1 px-2">
|
<div className="field mb-3 mt-1 px-2">
|
||||||
<label className="form-label" role="button" onClick={() => setOpen(!open)}>
|
<label className="form-label" role="button" onClick={() => setOpen(!open)}>
|
||||||
|
|
@ -63,12 +80,10 @@ export const EventSelector = ({
|
||||||
<Collapse in={open}>
|
<Collapse in={open}>
|
||||||
<div id="collapse">
|
<div id="collapse">
|
||||||
<SelectSearch
|
<SelectSearch
|
||||||
options={ActionTypes.map((action) => {
|
options={actionOptions}
|
||||||
return { name: action.name, value: action.id };
|
|
||||||
})}
|
|
||||||
value={definition.actionId}
|
value={definition.actionId}
|
||||||
search={false}
|
search={false}
|
||||||
onChange={(value) => eventUpdated(param, value, extraData)}
|
onChange={(value) => eventChanged(param, value, extraData)}
|
||||||
filterOptions={fuzzySearch}
|
filterOptions={fuzzySearch}
|
||||||
placeholder="Select.."
|
placeholder="Select.."
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue