mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-24 09:28:31 +00:00
fixes: calendar and form widgets (#7735)
This commit is contained in:
parent
30452d94d5
commit
277e616180
3 changed files with 12 additions and 4 deletions
|
|
@ -81,7 +81,7 @@ export const Calendar = function ({
|
|||
action,
|
||||
};
|
||||
|
||||
fireEvent('onCalendarSlotSelect', { selectedSlots });
|
||||
fireEvent('onCalendarSlotSelect', { component, selectedSlots });
|
||||
};
|
||||
|
||||
function popoverClosed() {
|
||||
|
|
@ -153,7 +153,7 @@ export const Calendar = function ({
|
|||
min={startTime}
|
||||
max={endTime}
|
||||
onSelectEvent={(calendarEvent, e) => {
|
||||
fireEvent('onCalendarEventSelect', { calendarEvent });
|
||||
fireEvent('onCalendarEventSelect', { component, calendarEvent });
|
||||
if (properties.showPopOverOnEventClick)
|
||||
setEventPopoverOptions({
|
||||
...eventPopoverOptions,
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import { Box } from '@/Editor/Box';
|
|||
import { generateUIComponents } from './FormUtils';
|
||||
import { useMounted } from '@/_hooks/use-mount';
|
||||
import { removeFunctionObjects } from '@/_helpers/appUtils';
|
||||
import { useAppInfo } from '@/_stores/appDataStore';
|
||||
export const Form = function Form(props) {
|
||||
const {
|
||||
id,
|
||||
|
|
@ -28,6 +29,10 @@ export const Form = function Form(props) {
|
|||
dataCy,
|
||||
paramUpdated,
|
||||
} = props;
|
||||
|
||||
const { events: allAppEvents } = useAppInfo();
|
||||
|
||||
const formEvents = allAppEvents.filter((event) => event.target === 'component' && event.sourceId === id);
|
||||
const { visibility, disabledState, borderRadius, borderColor, boxShadow } = styles;
|
||||
const { buttonToSubmit, loadingState, advanced, JSONSchema } = properties;
|
||||
const backgroundColor =
|
||||
|
|
@ -57,7 +62,7 @@ export const Form = function Form(props) {
|
|||
});
|
||||
setExposedVariable('submitForm', async function () {
|
||||
if (isValid) {
|
||||
onEvent('onSubmit', { component }).then(() => resetComponent());
|
||||
onEvent('onSubmit', formEvents).then(() => resetComponent());
|
||||
} else {
|
||||
fireEvent('onInvalid');
|
||||
}
|
||||
|
|
@ -167,7 +172,7 @@ export const Form = function Form(props) {
|
|||
};
|
||||
const fireSubmissionEvent = () => {
|
||||
if (isValid) {
|
||||
onEvent('onSubmit', { component }).then(() => resetComponent());
|
||||
onEvent('onSubmit', formEvents).then(() => resetComponent());
|
||||
} else {
|
||||
fireEvent('onInvalid');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -639,6 +639,7 @@ export async function onEvent(_ref, eventName, events, options = {}, mode = 'edi
|
|||
|
||||
if (eventName === 'onCalendarEventSelect') {
|
||||
const { component, calendarEvent } = options;
|
||||
|
||||
useCurrentStateStore.getState().actions.setCurrentState({
|
||||
components: {
|
||||
...getCurrentState().components,
|
||||
|
|
@ -648,6 +649,7 @@ export async function onEvent(_ref, eventName, events, options = {}, mode = 'edi
|
|||
},
|
||||
},
|
||||
});
|
||||
|
||||
executeActionsForEventId(_ref, 'onCalendarEventSelect', events, mode, customVariables);
|
||||
}
|
||||
|
||||
|
|
@ -662,6 +664,7 @@ export async function onEvent(_ref, eventName, events, options = {}, mode = 'edi
|
|||
},
|
||||
},
|
||||
});
|
||||
|
||||
executeActionsForEventId(_ref, 'onCalendarSlotSelect', events, mode, customVariables);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue