Skip to content

Commit

Permalink
fix tab behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenfiszel committed May 17, 2023
1 parent 9e0c000 commit a387c62
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 10 deletions.
Expand Up @@ -243,13 +243,26 @@
{/if}

{#if componentSettings.item.data.type === 'tabscomponent'}
<GridTab bind:tabs={componentSettings.item.data.tabs} {component} />
<GridTab
bind:tabs={componentSettings.item.data.tabs}
bind:component={componentSettings.item.data}
/>
{:else if componentSettings.item.data.type === 'steppercomponent'}
<GridTab bind:tabs={componentSettings.item.data.tabs} {component} word="Step" />
<GridTab
bind:tabs={componentSettings.item.data.tabs}
bind:component={componentSettings.item.data}
word="Step"
/>
{:else if componentSettings.item.data.type === 'conditionalwrapper'}
<GridCondition bind:conditions={componentSettings.item.data.conditions} {component} />
<GridCondition
bind:conditions={componentSettings.item.data.conditions}
bind:component={componentSettings.item.data}
/>
{:else if componentSettings.item.data.type === 'verticalsplitpanescomponent' || componentSettings.item.data.type === 'horizontalsplitpanescomponent'}
<GridPane bind:panes={componentSettings.item.data.panes} {component} />
<GridPane
bind:panes={componentSettings.item.data.panes}
bind:component={componentSettings.item.data}
/>
{:else if componentSettings.item.data.type === 'tablecomponent' && Array.isArray(componentSettings.item.data.actionButtons)}
<TableActions id={component.id} bind:components={componentSettings.item.data.actionButtons} />
{/if}
Expand Down
Expand Up @@ -33,16 +33,15 @@
}
$app.subgrids[`${component.id}-${numberOfTabs}`] = []
component.numberOfSubgrids = items.length
items = [
...items,
{
value: `${word} ${items.length + 1}`,
id: generateRandomString(),
originalIndex: items.length - 1
originalIndex: items.length
}
]
component.numberOfSubgrids = items.length
}
function deleteSubgrid(index: number) {
Expand All @@ -54,6 +53,7 @@
}
}
$runnableComponents = $runnableComponents
for (let i = index; i < items.length - 1; i++) {
$app!.subgrids![`${component.id}-${i}`] = $app!.subgrids![`${component.id}-${i + 1}`]
}
Expand All @@ -62,12 +62,13 @@
items = items.filter((item) => item.originalIndex !== index)
component.numberOfSubgrids = items.length
$app = $app
// Update the originalIndex of the remaining items
items.forEach((item, i) => {
item.originalIndex = i
})
items = items
delete $app!.subgrids![items.length]
$app = $app
}
function handleConsider(e: CustomEvent): void {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/script_helpers.ts
Expand Up @@ -221,7 +221,7 @@ func main() (interface{}, error) {
}
`

export const DENO_INIT_CODE_APPROVAL = `import * as wmill from "https://deno.land/x/windmill@v1.41.0/mod.ts"
export const DENO_INIT_CODE_APPROVAL = `import * as wmill from "https://deno.land/x/windmill@v1.99.0/mod.ts"
export async function main(approver?: string) {
return wmill.getResumeEndpoints(approver)
Expand Down

0 comments on commit a387c62

Please sign in to comment.