mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-12 00:06:14 +00:00
fix(frontend): Make context clickable (#984)
* fix(frontend): Make context clickable * fix(frontend): Fix buttons
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { Button, type ButtonType } from '$lib/components/common'
|
||||
import type { InputsSpec } from '../../types'
|
||||
import AlignWrapper from '../helpers/AlignWrapper.svelte'
|
||||
import InputValue from '../helpers/InputValue.svelte'
|
||||
import RunnableComponent from '../helpers/RunnableComponent.svelte'
|
||||
|
||||
@@ -12,6 +13,9 @@
|
||||
export let componentInputs: InputsSpec
|
||||
export let extraQueryParams: Record<string, any> = {}
|
||||
|
||||
export let horizontalAlignment: 'left' | 'center' | 'right' | undefined = undefined
|
||||
export let verticalAlignment: 'top' | 'center' | 'bottom' | undefined = undefined
|
||||
|
||||
export const staticOutputs: string[] = ['loading', 'result']
|
||||
|
||||
let labelValue: string = 'Default label'
|
||||
@@ -34,14 +38,15 @@
|
||||
autoRefresh={false}
|
||||
{extraQueryParams}
|
||||
>
|
||||
<Button
|
||||
on:click={() => {
|
||||
runnableComponent?.runComponent()
|
||||
}}
|
||||
btnClasses="w-full h-full"
|
||||
{size}
|
||||
{color}
|
||||
<AlignWrapper {horizontalAlignment} {verticalAlignment}>
|
||||
<Button
|
||||
on:click={() => {
|
||||
runnableComponent?.runComponent()
|
||||
}}
|
||||
{size}
|
||||
{color}
|
||||
>
|
||||
{labelValue}
|
||||
</Button></AlignWrapper
|
||||
>
|
||||
{labelValue}
|
||||
</Button>
|
||||
</RunnableComponent>
|
||||
|
||||
@@ -36,6 +36,7 @@ const buttons: ComponentSet = {
|
||||
components: [
|
||||
{
|
||||
...defaultProps,
|
||||
...defaultAlignement,
|
||||
id: 'buttoncomponent',
|
||||
type: 'buttoncomponent',
|
||||
componentInputs: {
|
||||
|
||||
@@ -178,7 +178,15 @@
|
||||
<PanelSection title="Outputs">
|
||||
{#each Object.entries($staticOutputs) as [componentId, outputs], index}
|
||||
{#if outputs.length > 0 && $worldStore?.outputsById[componentId]}
|
||||
<Badge color="blue">Component: {componentId}</Badge>
|
||||
<Button
|
||||
btnClasses="bg-blue-100 text-blue-800 hover:bg-blue-200 !px-2 !py-1 text-xs focus:bg-blue-200"
|
||||
size="xs"
|
||||
spacingSize="xs"
|
||||
on:click={() => ($selectedComponent = componentId)}
|
||||
color="blue"
|
||||
>
|
||||
Component: {componentId}
|
||||
</Button>
|
||||
|
||||
<div
|
||||
class={classNames(
|
||||
|
||||
Reference in New Issue
Block a user