mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 00:48:25 +00:00
[BugFix] Properly display and assign modal and tables on event manager (#1996)
This commit is contained in:
parent
cd71755c03
commit
be3100e63f
2 changed files with 8 additions and 8 deletions
|
|
@ -65,7 +65,7 @@ export const EventManager = ({
|
|||
if (components[key].component.component === componentType) {
|
||||
componentOptions.push({
|
||||
name: components[key].component.name,
|
||||
value: { name: components[key].component.name, id: key },
|
||||
value: key,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
@ -207,7 +207,7 @@ export const EventManager = ({
|
|||
<div className="col-9">
|
||||
<SelectSearch
|
||||
options={getComponentOptions('Modal')}
|
||||
value={event.model}
|
||||
value={event.modal?.id ?? event.modal}
|
||||
search={true}
|
||||
onChange={(value) => {
|
||||
handlerChanged(index, 'modal', value);
|
||||
|
|
@ -225,7 +225,7 @@ export const EventManager = ({
|
|||
<div className="col-9">
|
||||
<SelectSearch
|
||||
options={getComponentOptions('Modal')}
|
||||
value={event.model}
|
||||
value={event.modal?.id ?? event.modal}
|
||||
search={true}
|
||||
onChange={(value) => {
|
||||
handlerChanged(index, 'modal', value);
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ async function copyToClipboard(text) {
|
|||
}
|
||||
|
||||
function showModal(_ref, modal, show) {
|
||||
const modalId = modal.id;
|
||||
const modalId = modal?.id ?? modal;
|
||||
if (_.isEmpty(modalId)) {
|
||||
console.log('No modal is associated with this event.');
|
||||
return Promise.resolve();
|
||||
|
|
@ -683,15 +683,15 @@ export function runQuery(_ref, queryId, queryName, confirmed = undefined, mode)
|
|||
});
|
||||
}
|
||||
|
||||
function setTablePageIndex(_ref, table, index) {
|
||||
if (_.isEmpty(table.id)) {
|
||||
function setTablePageIndex(_ref, tableId, index) {
|
||||
if (_.isEmpty(tableId)) {
|
||||
console.log('No table is associated with this event.');
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
const tableMeta = _ref.state.currentState.components[table.name];
|
||||
const table = Object.entries(_ref.state.currentState.components).filter((entry) => entry[1].id === tableId)[0][1];
|
||||
const newPageIndex = resolveReferences(index, _ref.state.currentState);
|
||||
tableMeta.setPage(newPageIndex ?? 1);
|
||||
table.setPage(newPageIndex ?? 1);
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue