Skip to content

Commit 5d64b01

Browse files
committed
feat(ui): improve the design of blueprints outs - AB-103
1 parent 2b8ebc2 commit 5d64b01

File tree

2 files changed

+58
-14
lines changed

2 files changed

+58
-14
lines changed

src/ui/src/components/blueprints/abstract/BlueprintsNode.vue

Lines changed: 58 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@
4141
:key="fieldKey"
4242
class="BlueprintsNode__main__outputs"
4343
>
44-
<h4 v-if="def.fields?.[fieldKey]">
44+
<h4
45+
v-if="def.fields?.[fieldKey]"
46+
class="BlueprintsNode__main__outputs__title"
47+
>
4548
{{ def.fields[fieldKey].name }}
4649
</h4>
4750
<BlueprintsNodeOutput
@@ -55,14 +58,30 @@
5558
/>
5659
<div v-if="Object.keys(outs).length == 0">None configured.</div>
5760
</div>
58-
<div class="BlueprintsNode__main__outputs">
61+
<div
62+
v-if="Object.keys(staticOuts).length > 0"
63+
class="BlueprintsNode__main__outputs"
64+
:class="{
65+
'BlueprintsNode__main__outputs--float':
66+
hasOnlySuccessOut && !isTrigger,
67+
}"
68+
>
69+
<h4
70+
v-if="
71+
!hasOnlySuccessOut &&
72+
Object.keys(dynamicOuts).length > 0
73+
"
74+
class="BlueprintsNode__main__outputs__title"
75+
>
76+
THEN
77+
</h4>
5978
<BlueprintsNodeOutput
6079
v-for="(out, outId) in staticOuts"
6180
:key="outId"
6281
class="BlueprintsNode__main__outputs__output"
6382
:out-id="outId"
6483
:out="out"
65-
:display-label="displayStaticOutsLabel"
84+
:display-label="!hasOnlySuccessOut"
6685
@click="$emit('outMousedown', outId)"
6786
/>
6887
<BlueprintsNodeOutput
@@ -217,11 +236,11 @@ const shouldDisplayError = computed(() => {
217236
return forceDisplayErrorOut.value;
218237
});
219238
220-
const displayStaticOutsLabel = computed(() => {
221-
if (Object.keys(dynamicOuts.value ?? {}).length > 0) return true;
222-
if (Object.keys(unknownOuts.value ?? {}).length > 0) return true;
223-
if (Object.keys(staticOuts.value ?? {}).length > 1) return true;
224-
return false;
239+
const hasOnlySuccessOut = computed(() => {
240+
if (Object.keys(dynamicOuts.value ?? {}).length > 0) return false;
241+
if (Object.keys(unknownOuts.value ?? {}).length > 0) return false;
242+
if (Object.keys(staticOuts.value ?? {}).length > 1) return false;
243+
return true;
225244
});
226245
227246
const staticOuts = computed<WriterComponentDefinition["outs"]>(() => {
@@ -468,6 +487,11 @@ watch(isEngaged, () => {
468487
border-radius: 12px 12px 0 0;
469488
align-items: center;
470489
grid-template-columns: 24px 1fr auto;
490+
border-bottom: 1px solid var(--builderSeparatorColor);
491+
}
492+
493+
.BlueprintsNode--trigger .BlueprintsNode__main__title {
494+
border-bottom: unset;
471495
}
472496
.BlueprintsNode__main__title,
473497
.BlueprintsNode__main__footer {
@@ -509,14 +533,32 @@ watch(isEngaged, () => {
509533
510534
.BlueprintsNode__main__outputs {
511535
border-radius: 0 0 12px 12px;
512-
display: flex;
513-
flex-direction: column;
536+
display: grid;
537+
grid-template-columns: 1fr 1fr;
514538
gap: 8px;
515-
padding: 12px 0 12px 16px;
516-
border-top: 1px solid var(--builderSeparatorColor);
539+
padding-left: 6px;
540+
padding-top: 12px;
541+
padding-bottom: 12px;
517542
font-size: 12px;
518543
}
519544
545+
.BlueprintsNode__main__outputs__title {
546+
grid-column: 1;
547+
color: var(--wdsColorGray4);
548+
text-transform: uppercase;
549+
font-weight: 500;
550+
}
551+
.BlueprintsNode__main__outputs__output {
552+
grid-column: 2;
553+
}
554+
.BlueprintsNode__main__outputs--float {
555+
position: absolute;
556+
right: 0;
557+
bottom: 48px;
558+
padding: 0;
559+
border-top: none;
560+
}
561+
520562
.BlueprintsNode--trigger .BlueprintsNode__main__outputs {
521563
border: none;
522564
position: absolute;
@@ -531,6 +573,10 @@ watch(isEngaged, () => {
531573
.BlueprintsNode__main__footer {
532574
border-top: 1px solid var(--builderSeparatorColor);
533575
}
576+
.BlueprintsNode:has(.BlueprintsNode__main__outputs--float)
577+
.BlueprintsNode__main__footer {
578+
border-top: none;
579+
}
534580
535581
@keyframes spin {
536582
0% {

src/ui/src/components/blueprints/abstract/BlueprintsNodeActions.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,8 @@ const dropdownOptions = computed(() => {
119119

120120
<style scoped>
121121
.BlueprintsNodeActions {
122-
/* border-top: 1px solid var(--builderSeparatorColor); */
123122
display: flex;
124123
gap: 4px;
125-
126124
justify-content: flex-end;
127125
}
128126
</style>

0 commit comments

Comments
 (0)