mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-21 07:59:01 +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;
|
||||
}
|
||||
|
||||
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 (
|
||||
<div className="field mb-3 mt-1 px-2">
|
||||
<label className="form-label" role="button" onClick={() => setOpen(!open)}>
|
||||
|
|
@ -63,12 +80,10 @@ export const EventSelector = ({
|
|||
<Collapse in={open}>
|
||||
<div id="collapse">
|
||||
<SelectSearch
|
||||
options={ActionTypes.map((action) => {
|
||||
return { name: action.name, value: action.id };
|
||||
})}
|
||||
options={actionOptions}
|
||||
value={definition.actionId}
|
||||
search={false}
|
||||
onChange={(value) => eventUpdated(param, value, extraData)}
|
||||
onChange={(value) => eventChanged(param, value, extraData)}
|
||||
filterOptions={fuzzySearch}
|
||||
placeholder="Select.."
|
||||
/>
|
||||
|
|
|
|||
Loading…
Reference in a new issue