1
0
Fork 0
mirror of synced 2024-10-04 03:54:37 +13:00

styling / pr comments

This commit is contained in:
Peter Clement 2023-10-27 10:45:58 +01:00
parent 89a242f354
commit 8a7a2abd61
3 changed files with 39 additions and 20 deletions

View file

@ -23,7 +23,8 @@
$: automationName = stepNames?.[block.id] || block?.name || "" $: automationName = stepNames?.[block.id] || block?.name || ""
$: automationNameError = getAutomationNameError(automationName) $: automationNameError = getAutomationNameError(automationName)
$: status = updateStatus(testResult, isTrigger) $: status = updateStatus(testResult, isTrigger)
$: isTrigger = isTrigger || block.type === "TRIGGER" $: isHeaderTrigger = isTrigger || block.type === "TRIGGER"
$: { $: {
if (!testResult) { if (!testResult) {
testResult = $automationStore.testResults?.steps?.filter(step => testResult = $automationStore.testResults?.steps?.filter(step =>
@ -109,7 +110,7 @@
</svg> </svg>
{/if} {/if}
<div class="iconAlign"> <div class="iconAlign">
{#if isTrigger} {#if isHeaderTrigger}
<Body size="XS"><b>Trigger</b></Body> <Body size="XS"><b>Trigger</b></Body>
{:else} {:else}
<div style="margin-left: 2px;"> <div style="margin-left: 2px;">
@ -138,13 +139,21 @@
</div> </div>
<div class="blockTitle"> <div class="blockTitle">
{#if showTestStatus && testResult} {#if showTestStatus && testResult}
<div style="float: right;"> <div class="status-container">
<div style="float:right;">
<StatusLight <StatusLight
positive={status?.positive} positive={status?.positive}
yellow={status?.yellow} yellow={status?.yellow}
negative={status?.negative} negative={status?.negative}
><Body size="XS">{status?.message}</Body></StatusLight
> >
<Body size="XS">{status?.message}</Body>
</StatusLight>
</div>
<Icon
on:click={() => dispatch("toggle")}
hoverable
name={open ? "ChevronUp" : "ChevronDown"}
/>
</div> </div>
{/if} {/if}
<div <div
@ -155,7 +164,7 @@
}} }}
> >
{#if !showTestStatus} {#if !showTestStatus}
{#if !isTrigger && !loopBlock && (block?.features?.[Features.LOOPING] || !block.features)} {#if !isHeaderTrigger && !loopBlock && (block?.features?.[Features.LOOPING] || !block.features)}
<AbsTooltip type="info" text="Add looping"> <AbsTooltip type="info" text="Add looping">
<Icon on:click={addLooping} hoverable name="RotateCW" /> <Icon on:click={addLooping} hoverable name="RotateCW" />
</AbsTooltip> </AbsTooltip>
@ -164,11 +173,13 @@
<Icon on:click={deleteStep} hoverable name="DeleteOutline" /> <Icon on:click={deleteStep} hoverable name="DeleteOutline" />
</AbsTooltip> </AbsTooltip>
{/if} {/if}
{#if !showTestStatus}
<Icon <Icon
on:click={() => dispatch("toggle")} on:click={() => dispatch("toggle")}
hoverable hoverable
name={open ? "ChevronUp" : "ChevronDown"} name={open ? "ChevronUp" : "ChevronDown"}
/> />
{/if}
</div> </div>
{#if automationNameError} {#if automationNameError}
<div class="error-container"> <div class="error-container">
@ -184,10 +195,17 @@
</div> </div>
<style> <style>
.status-container {
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--spacing-m);
/* You can also add padding or margin to adjust the spacing between the text and the chevron if needed. */
}
.context-actions { .context-actions {
display: flex; display: flex;
gap: var(--spacing-l); gap: var(--spacing-l);
margin-left: 10px;
margin-bottom: var(--spacing-xs); margin-bottom: var(--spacing-xs);
} }
.center-items { .center-items {
@ -210,7 +228,6 @@
.blockTitle { .blockTitle {
display: flex; display: flex;
align-items: center;
} }
.hide-context-actions { .hide-context-actions {
@ -222,7 +239,7 @@
background-color: transparent; background-color: transparent;
border: 1px solid transparent; border: 1px solid transparent;
font-size: var(--spectrum-alias-font-size-default); font-size: var(--spectrum-alias-font-size-default);
width: 260px; width: 230px;
box-sizing: border-box; box-sizing: border-box;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;

View file

@ -197,6 +197,7 @@
let bindingName = let bindingName =
automation.stepNames?.[allSteps[bindingRank - loopBlockCount].id] automation.stepNames?.[allSteps[bindingRank - loopBlockCount].id]
console.log(bindings)
bindings = bindings.concat( bindings = bindings.concat(
outputs.map(([name, value]) => { outputs.map(([name, value]) => {
let runtimeName = isLoopBlock let runtimeName = isLoopBlock
@ -288,7 +289,8 @@
value.customType !== "row" && value.customType !== "row" &&
value.customType !== "code" && value.customType !== "code" &&
value.customType !== "queryParams" && value.customType !== "queryParams" &&
value.customType !== "cron" value.customType !== "cron" &&
value.customType !== "triggerSchema"
) )
} }

View file

@ -28,7 +28,7 @@
</script> </script>
<div class="schema-fields"> <div class="schema-fields">
<Label>Table</Label> <Label>Query</Label>
<div class="field-width"> <div class="field-width">
<Select <Select
on:change={onChangeQuery} on:change={onChangeQuery}