From dad11d45399599fa66235bfe47768af9ab11cb5b Mon Sep 17 00:00:00 2001 From: Milorad Filipovic Date: Thu, 21 Dec 2023 15:12:28 +0100 Subject: [PATCH 1/8] feat(editor): Add node execution status indicator to output panel --- .../src/components/N8nInfoTip/InfoTip.vue | 64 ++++++++++++------- .../src/components/N8nTooltip/Tooltip.vue | 2 +- .../editor-ui/src/components/OutputPanel.vue | 4 +- packages/editor-ui/src/components/RunInfo.vue | 22 ++++++- .../editor-ui/src/mixins/executionsHelpers.ts | 3 +- .../editor-ui/src/mixins/genericHelpers.ts | 8 --- .../src/plugins/i18n/locales/en.json | 2 + .../src/utils/formatters/dateFormatter.ts | 12 ++++ 8 files changed, 81 insertions(+), 36 deletions(-) create mode 100644 packages/editor-ui/src/utils/formatters/dateFormatter.ts diff --git a/packages/design-system/src/components/N8nInfoTip/InfoTip.vue b/packages/design-system/src/components/N8nInfoTip/InfoTip.vue index 7a81cbb0fd003..90b99e89e6793 100644 --- a/packages/design-system/src/components/N8nInfoTip/InfoTip.vue +++ b/packages/design-system/src/components/N8nInfoTip/InfoTip.vue @@ -10,11 +10,11 @@ - - + + - + @@ -48,7 +48,7 @@ export default defineComponent({ type: String, default: 'info', validator: (value: string): boolean => - ['info', 'info-light', 'warning', 'danger'].includes(value), + ['info', 'info-light', 'warning', 'danger', 'success'].includes(value), }, type: { type: String, @@ -64,6 +64,42 @@ export default defineComponent({ default: 'top', }, }, + computed: { + iconData(): { icon: string; color: string } { + switch (this.theme) { + case 'info': + return { + icon: 'info-circle', + color: '--color-text-light)', + }; + case 'info-light': + return { + icon: 'info-circle', + color: 'var(--color-foreground-dark)', + }; + case 'warning': + return { + icon: 'exclamation-triangle', + color: 'var(--color-warning)', + }; + case 'danger': + return { + icon: 'exclamation-triangle', + color: 'var(--color-danger)', + }; + case 'success': + return { + icon: 'check-circle', + color: 'var(--color-success)', + }; + default: + return { + icon: 'info-circle', + color: '--color-text-light)', + }; + } + }, + }, }); @@ -92,7 +128,7 @@ export default defineComponent({ } } -.tooltip { +.tooltipPopper { composes: base; display: inline-flex; } @@ -101,20 +137,4 @@ export default defineComponent({ display: inline-flex; align-items: flex-start; } - -.info-light { - color: var(--color-foreground-dark); -} - -.info { - color: var(--color-text-light); -} - -.warning { - color: var(--color-warning); -} - -.danger { - color: var(--color-danger); -} diff --git a/packages/design-system/src/components/N8nTooltip/Tooltip.vue b/packages/design-system/src/components/N8nTooltip/Tooltip.vue index ee8c53683a4c6..c49df4118457b 100644 --- a/packages/design-system/src/components/N8nTooltip/Tooltip.vue +++ b/packages/design-system/src/components/N8nTooltip/Tooltip.vue @@ -1,5 +1,5 @@