Skip to content

Commit

Permalink
fix(frontend): simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
fatonramadani committed Oct 4, 2023
1 parent eae3d08 commit 3aab7fd
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 9 deletions.
3 changes: 3 additions & 0 deletions frontend/src/lib/components/FlowBuilder.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
copilotInfo,
enterpriseLicense,
hubScripts,
tutorialsToDo,
userStore,
workspaceStore
} from '$lib/stores'
Expand Down Expand Up @@ -861,6 +862,8 @@
if (tutorial) {
flowTutorials?.runTutorialById(tutorial)
} else if ($tutorialsToDo.includes(0)) {
flowTutorials?.runTutorialById('action')
}
}
</script>
Expand Down
7 changes: 6 additions & 1 deletion frontend/src/lib/components/FlowBuilderTutorials.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,12 @@
</ButtonDropdown>
</button>

<FlowTutorials bind:this={flowTutorials} />
<FlowTutorials
bind:this={flowTutorials}
on:error={({ detail }) => {
targetTutorial = detail.detail
}}
/>

<ConfirmationModal
open={targetTutorial !== undefined}
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/lib/components/FlowTutorials.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
}
</script>

<FlowBuilderTutorialSimpleFlow bind:this={flowBuilderTutorialSimpleFlow} />
<FlowBuilderTutorialsForLoop bind:this={flowBuilderTutorialsForLoop} />
<FlowBranchOne bind:this={flowBranchOne} />
<FlowBranchAll bind:this={flowBranchAll} />
<FlowBuilderTutorialSimpleFlow bind:this={flowBuilderTutorialSimpleFlow} on:error />
<FlowBuilderTutorialsForLoop bind:this={flowBuilderTutorialsForLoop} on:error />
<FlowBranchOne bind:this={flowBranchOne} on:error />
<FlowBranchAll bind:this={flowBranchAll} on:error />
2 changes: 1 addition & 1 deletion frontend/src/lib/components/tutorials/FlowBranchAll.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
$flowStore.value.modules.length > 0 ||
Object.keys($flowStore?.schema?.properties).length > 0
) {
dispatch('error')
dispatch('error', { detail: 'branchall' })
return
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/components/tutorials/FlowBranchOne.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
$flowStore.value.modules.length > 0 ||
Object.keys($flowStore?.schema?.properties).length > 0
) {
dispatch('error')
dispatch('error', { detail: 'branchone' })
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
$flowStore.value.modules.length > 0 ||
Object.keys($flowStore?.schema?.properties).length > 0
) {
dispatch('error')
dispatch('error', { detail: 'action' })
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
$flowStore.value.modules.length > 0 ||
Object.keys($flowStore?.schema?.properties).length > 0
) {
dispatch('error')
dispatch('error', { detail: 'forloop' })
return
}
Expand Down

0 comments on commit 3aab7fd

Please sign in to comment.