mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-29 16:15:51 +00:00
fix(frontend): Correctly handle undefined actions
This commit is contained in:
@@ -198,7 +198,7 @@
|
||||
|
||||
function actionRenderer(params) {
|
||||
const { rowIndex, data: row } = params
|
||||
if (rowIndex === -1 || actions == undefined || actions.length == 0) {
|
||||
if (rowIndex === -1 || actions == undefined || actions?.length == 0) {
|
||||
return null
|
||||
}
|
||||
|
||||
|
||||
@@ -90,8 +90,8 @@
|
||||
}
|
||||
|
||||
if (
|
||||
parent.data.type === 'aggridcomponent' ||
|
||||
(parent.data.type === 'aggridcomponentee' && Array.isArray(parent.data.actions))
|
||||
(parent.data.type === 'aggridcomponent' || parent.data.type === 'aggridcomponentee') &&
|
||||
Array.isArray(parent.data.actions)
|
||||
) {
|
||||
parent.data.actions = parent.data.actions.filter(
|
||||
(x) => x.id !== tableActionSettings?.item.id
|
||||
|
||||
@@ -517,7 +517,10 @@ export function getAllGridItems(app: App): GridItem[] {
|
||||
.map((x) => {
|
||||
if (x?.data?.type === 'tablecomponent') {
|
||||
return [x, ...x?.data?.actionButtons?.map((x) => ({ data: x, id: x.id }))]
|
||||
} else if (x?.data?.type === 'aggridcomponent' || x?.data?.type === 'aggridcomponentee') {
|
||||
} else if (
|
||||
(x?.data?.type === 'aggridcomponent' || x?.data?.type === 'aggridcomponentee') &&
|
||||
Array.isArray(x?.data?.actions)
|
||||
) {
|
||||
return [x, ...x?.data?.actions?.map((x) => ({ data: x, id: x.id }))]
|
||||
} else if (x?.data?.type === 'menucomponent') {
|
||||
return [x, ...x?.data?.menuItems?.map((x) => ({ data: x, id: x.id }))]
|
||||
|
||||
+2
-2
@@ -34,8 +34,8 @@
|
||||
{/each}
|
||||
{/if}
|
||||
|
||||
{#if gridItem?.data?.type === 'aggridcomponent' || (gridItem?.data?.type === 'aggridcomponentee' && Array.isArray(gridItem.data.actions))}
|
||||
{#each gridItem.data.actions ?? [] as actionButton, index (index)}
|
||||
{#if (gridItem?.data?.type === 'aggridcomponent' || gridItem?.data?.type === 'aggridcomponentee') && Array.isArray(gridItem.data.actions)}
|
||||
{#each gridItem.data.actions as actionButton, index (index)}
|
||||
{#if actionButton?.id === $selectedComponentInEditor || actionButton?.id + '_transformer' === $selectedComponentInEditor}
|
||||
<InlineScriptEditorPanel
|
||||
on:createScriptFromInlineScript
|
||||
|
||||
Reference in New Issue
Block a user