From 55fd7d954c650390328fc0a1e0edfc122beccc00 Mon Sep 17 00:00:00 2001 From: Mutasem Date: Wed, 27 Oct 2021 12:07:52 +0200 Subject: [PATCH] implement new states --- .../src/styleguide/border.stories.mdx | 2 +- packages/editor-ui/src/components/Node.vue | 69 ++++++++++++------- .../editor-ui/src/components/NodeIcon.vue | 19 ++--- .../src/components/mixins/nodeBase.ts | 9 --- 4 files changed, 51 insertions(+), 48 deletions(-) diff --git a/packages/design-system/src/styleguide/border.stories.mdx b/packages/design-system/src/styleguide/border.stories.mdx index d5a83e064d..05ffec4339 100644 --- a/packages/design-system/src/styleguide/border.stories.mdx +++ b/packages/design-system/src/styleguide/border.stories.mdx @@ -16,7 +16,7 @@ import VariableTable from './VariableTable.vue'; {{ - template: ``, + template: ``, components: { VariableTable, }, diff --git a/packages/editor-ui/src/components/Node.vue b/packages/editor-ui/src/components/Node.vue index 8f41c77f31..9b767d2201 100644 --- a/packages/editor-ui/src/components/Node.vue +++ b/packages/editor-ui/src/components/Node.vue @@ -7,9 +7,12 @@ - + + + {{ workflowDataItems }} + -
+
@@ -37,7 +40,7 @@
- +
@@ -70,6 +73,7 @@ import NodeIcon from '@/components/NodeIcon.vue'; import mixins from 'vue-typed-mixins'; import { get } from 'lodash'; +import { getStyleTokenValue } from './helpers'; export default mixins(externalHooks, nodeBase, nodeHelpers, workflowHelpers).extend({ name: 'Node', @@ -158,6 +162,25 @@ export default mixins(externalHooks, nodeBase, nodeHelpers, workflowHelpers).ext workflowRunning (): boolean { return this.$store.getters.isActionActive('workflowRunning'); }, + nodeStyle (): object { + let borderColor = getStyleTokenValue('--color-foreground-xdark'); + + if (this.hasIssues && this.workflowDataItems) { + // todo + borderColor = getStyleTokenValue('--color-danger'); + } + else if (this.workflowDataItems && !this.isExecuting) { + borderColor = getStyleTokenValue('--color-success'); + } + + const returnStyles: { + [key: string]: string; + } = { + 'border-color': borderColor, + }; + + return returnStyles; + }, }, watch: { isActive(newValue, oldValue) { @@ -261,12 +284,12 @@ export default mixins(externalHooks, nodeBase, nodeHelpers, workflowHelpers).ext width: 100%; height: 100%; background-color: #fff; - border-radius: 25px; + border-radius: var(--border-radius-large); text-align: center; z-index: 24; cursor: pointer; color: #444; - border: 1px dashed grey; + border: 2px solid var(--color-foreground-xdark); &.has-data { border-style: solid; @@ -315,39 +338,35 @@ export default mixins(externalHooks, nodeBase, nodeHelpers, workflowHelpers).ext .node-icon { position: absolute; - top: calc(50% - 30px); - left: calc(50% - 30px); + top: calc(50% - 20px); + left: calc(50% - 20px); } .node-info-icon { position: absolute; - top: -14px; - right: 12px; - z-index: 11; + bottom: 8px; + right: 8px; &.data-count { font-weight: 600; - top: -12px; + color: var(--color-success); + + * { + margin-left: 2px; + } } - &.waiting { - left: 10px; - top: -12px; + &.node-issues { + color: var(--color-danger); } } - .node-issues { - width: 25px; - height: 25px; - font-size: 20px; - color: #ff0000; - } - .waiting { - width: 25px; - height: 25px; - font-size: 20px; - color: #5e5efa; + color: var(--color-secondary); + + position: absolute; + left: 8px; + bottom: 8px; } .node-options { diff --git a/packages/editor-ui/src/components/NodeIcon.vue b/packages/editor-ui/src/components/NodeIcon.vue index 9bdc8fb4e6..7f259aa773 100644 --- a/packages/editor-ui/src/components/NodeIcon.vue +++ b/packages/editor-ui/src/components/NodeIcon.vue @@ -1,5 +1,5 @@