mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
fix(editor): Insights design review 3 (no-changelog) (#14520)
This commit is contained in:
committed by
GitHub
parent
5826ff2cec
commit
e54f450a9d
@@ -29,6 +29,7 @@ export const generateLineChartOptions = (
|
|||||||
{
|
{
|
||||||
responsive: true,
|
responsive: true,
|
||||||
maintainAspectRatio: false,
|
maintainAspectRatio: false,
|
||||||
|
animation: false,
|
||||||
plugins: {
|
plugins: {
|
||||||
legend: {
|
legend: {
|
||||||
display: false,
|
display: false,
|
||||||
@@ -115,6 +116,7 @@ export const generateBarChartOptions = (
|
|||||||
{
|
{
|
||||||
responsive: true,
|
responsive: true,
|
||||||
maintainAspectRatio: false,
|
maintainAspectRatio: false,
|
||||||
|
animation: false,
|
||||||
plugins: {
|
plugins: {
|
||||||
legend: {
|
legend: {
|
||||||
display: true,
|
display: true,
|
||||||
@@ -126,6 +128,7 @@ export const generateBarChartOptions = (
|
|||||||
boxHeight: 8,
|
boxHeight: 8,
|
||||||
borderRadius: 2,
|
borderRadius: 2,
|
||||||
useBorderRadius: true,
|
useBorderRadius: true,
|
||||||
|
color: colorTextLight.value,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ watch(
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div :class="$style.insightsView">
|
<div :class="$style.insightsView">
|
||||||
|
<div :class="$style.insightsContainer">
|
||||||
<N8nHeading bold tag="h2" size="xlarge">
|
<N8nHeading bold tag="h2" size="xlarge">
|
||||||
{{ i18n.baseText('insights.dashboard.title') }}
|
{{ i18n.baseText('insights.dashboard.title') }}
|
||||||
</N8nHeading>
|
</N8nHeading>
|
||||||
@@ -123,24 +124,31 @@ watch(
|
|||||||
<InsightsPaywall v-else data-test-id="insights-dashboard-unlicensed" />
|
<InsightsPaywall v-else data-test-id="insights-dashboard-unlicensed" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" module>
|
<style lang="scss" module>
|
||||||
.insightsView {
|
.insightsView {
|
||||||
padding: var(--spacing-l) var(--spacing-2xl);
|
|
||||||
flex: 1;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 30px;
|
gap: 30px;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.insightsContainer {
|
||||||
|
width: 100%;
|
||||||
max-width: var(--content-container-width);
|
max-width: var(--content-container-width);
|
||||||
|
padding: var(--spacing-l) var(--spacing-2xl);
|
||||||
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.insightsBanner {
|
.insightsBanner {
|
||||||
padding-bottom: 0;
|
padding-bottom: 0;
|
||||||
|
|
||||||
ul {
|
ul {
|
||||||
border-radius: 0;
|
border-bottom-left-radius: 0;
|
||||||
|
border-bottom-right-radius: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useI18n } from '@/composables/useI18n';
|
import { useI18n } from '@/composables/useI18n';
|
||||||
|
import { useTelemetry } from '@/composables/useTelemetry';
|
||||||
import { VIEWS } from '@/constants';
|
import { VIEWS } from '@/constants';
|
||||||
import {
|
import {
|
||||||
INSIGHT_IMPACT_TYPES,
|
INSIGHT_IMPACT_TYPES,
|
||||||
@@ -10,7 +11,6 @@ import type { InsightsSummary } from '@n8n/api-types';
|
|||||||
import { smartDecimal } from '@n8n/utils/number/smartDecimal';
|
import { smartDecimal } from '@n8n/utils/number/smartDecimal';
|
||||||
import { computed, ref, useCssModule } from 'vue';
|
import { computed, ref, useCssModule } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { useTelemetry } from '@/composables/useTelemetry';
|
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
summary: InsightsSummaryDisplay;
|
summary: InsightsSummaryDisplay;
|
||||||
@@ -62,8 +62,9 @@ const trackTabClick = (insightType: keyof InsightsSummary) => {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div :class="$style.insights">
|
<div :class="$style.insights">
|
||||||
|
<ul data-test-id="insights-summary-tabs">
|
||||||
<N8nLoading v-if="loading" :class="$style.loading" :cols="5" />
|
<N8nLoading v-if="loading" :class="$style.loading" :cols="5" />
|
||||||
<ul v-else data-test-id="insights-summary-tabs">
|
<template v-else>
|
||||||
<li
|
<li
|
||||||
v-for="{ id, value, deviation, deviationUnit, unit, to } in summaryWithRouteLocations"
|
v-for="{ id, value, deviation, deviationUnit, unit, to } in summaryWithRouteLocations"
|
||||||
:key="id"
|
:key="id"
|
||||||
@@ -105,7 +106,9 @@ const trackTabClick = (insightType: keyof InsightsSummary) => {
|
|||||||
<small v-if="deviation !== null" :class="getImpactStyle(id, deviation)">
|
<small v-if="deviation !== null" :class="getImpactStyle(id, deviation)">
|
||||||
<N8nIcon
|
<N8nIcon
|
||||||
:class="[$style.icon, getImpactStyle(id, deviation)]"
|
:class="[$style.icon, getImpactStyle(id, deviation)]"
|
||||||
:icon="deviation === 0 ? 'caret-right' : deviation > 0 ? 'caret-up' : 'caret-down'"
|
:icon="
|
||||||
|
deviation === 0 ? 'caret-right' : deviation > 0 ? 'caret-up' : 'caret-down'
|
||||||
|
"
|
||||||
/>
|
/>
|
||||||
<N8nTooltip placement="bottom" :disabled="id !== 'failureRate'">
|
<N8nTooltip placement="bottom" :disabled="id !== 'failureRate'">
|
||||||
<template #content>
|
<template #content>
|
||||||
@@ -117,6 +120,7 @@ const trackTabClick = (insightType: keyof InsightsSummary) => {
|
|||||||
</span>
|
</span>
|
||||||
</router-link>
|
</router-link>
|
||||||
</li>
|
</li>
|
||||||
|
</template>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -222,7 +226,6 @@ const trackTabClick = (insightType: keyof InsightsSummary) => {
|
|||||||
gap: var(--spacing-5xs);
|
gap: var(--spacing-5xs);
|
||||||
|
|
||||||
i {
|
i {
|
||||||
color: var(--color-text-light);
|
|
||||||
font-size: 22px;
|
font-size: 22px;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
}
|
}
|
||||||
@@ -268,13 +271,13 @@ const trackTabClick = (insightType: keyof InsightsSummary) => {
|
|||||||
|
|
||||||
.loading {
|
.loading {
|
||||||
display: flex;
|
display: flex;
|
||||||
min-height: 91px;
|
|
||||||
align-self: stretch;
|
align-self: stretch;
|
||||||
align-items: stretch;
|
align-items: stretch;
|
||||||
|
|
||||||
> div {
|
> div {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
height: auto;
|
height: auto;
|
||||||
|
border-radius: inherit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
import { useI18n } from '@/composables/useI18n';
|
||||||
|
import { generateBarChartOptions } from '@/features/insights/chartjs.utils';
|
||||||
|
import { DATE_FORMAT_MASK } from '@/features/insights/insights.constants';
|
||||||
|
import type { InsightsByTime, InsightsSummaryType } from '@n8n/api-types';
|
||||||
|
import { smartDecimal } from '@n8n/utils/number/smartDecimal';
|
||||||
|
import { useCssVar } from '@vueuse/core';
|
||||||
|
import type { ChartData } from 'chart.js';
|
||||||
|
import dateformat from 'dateformat';
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
import { Bar } from 'vue-chartjs';
|
import { Bar } from 'vue-chartjs';
|
||||||
import type { ChartData } from 'chart.js';
|
|
||||||
import { useCssVar } from '@vueuse/core';
|
|
||||||
import dateformat from 'dateformat';
|
|
||||||
import type { InsightsByTime, InsightsSummaryType } from '@n8n/api-types';
|
|
||||||
import { generateBarChartOptions } from '@/features/insights/chartjs.utils';
|
|
||||||
import { useI18n } from '@/composables/useI18n';
|
|
||||||
import { smartDecimal } from '@n8n/utils/number/smartDecimal';
|
|
||||||
import { DATE_FORMAT_MASK } from '@/features/insights/insights.constants';
|
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
data: InsightsByTime[];
|
data: InsightsByTime[];
|
||||||
@@ -46,7 +46,7 @@ const chartData = computed<ChartData<'bar'>>(() => {
|
|||||||
labels,
|
labels,
|
||||||
datasets: [
|
datasets: [
|
||||||
{
|
{
|
||||||
label: i18n.baseText('insights.banner.title.failed'),
|
label: i18n.baseText('insights.chart.failed'),
|
||||||
data,
|
data,
|
||||||
backgroundColor: colorPrimary.value,
|
backgroundColor: colorPrimary.value,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
import { useI18n } from '@/composables/useI18n';
|
||||||
|
import { generateBarChartOptions } from '@/features/insights/chartjs.utils';
|
||||||
|
import { DATE_FORMAT_MASK } from '@/features/insights/insights.constants';
|
||||||
|
import type { InsightsByTime, InsightsSummaryType } from '@n8n/api-types';
|
||||||
|
import { useCssVar } from '@vueuse/core';
|
||||||
|
import type { ChartData } from 'chart.js';
|
||||||
|
import dateformat from 'dateformat';
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
import { Bar } from 'vue-chartjs';
|
import { Bar } from 'vue-chartjs';
|
||||||
import type { ChartData } from 'chart.js';
|
|
||||||
import { useCssVar } from '@vueuse/core';
|
|
||||||
import dateformat from 'dateformat';
|
|
||||||
import type { InsightsByTime, InsightsSummaryType } from '@n8n/api-types';
|
|
||||||
import { generateBarChartOptions } from '@/features/insights/chartjs.utils';
|
|
||||||
import { useI18n } from '@/composables/useI18n';
|
|
||||||
import { DATE_FORMAT_MASK } from '@/features/insights/insights.constants';
|
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
data: InsightsByTime[];
|
data: InsightsByTime[];
|
||||||
@@ -21,8 +21,7 @@ const chartOptions = computed(() =>
|
|||||||
generateBarChartOptions({
|
generateBarChartOptions({
|
||||||
plugins: {
|
plugins: {
|
||||||
tooltip: {
|
tooltip: {
|
||||||
itemSort: (a) =>
|
itemSort: (a) => (a.dataset.label === i18n.baseText('insights.chart.succeeded') ? -1 : 1),
|
||||||
a.dataset.label === i18n.baseText('insights.banner.title.succeeded') ? -1 : 1,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
@@ -43,12 +42,12 @@ const chartData = computed<ChartData<'bar'>>(() => {
|
|||||||
labels,
|
labels,
|
||||||
datasets: [
|
datasets: [
|
||||||
{
|
{
|
||||||
label: i18n.baseText('insights.banner.title.failed'),
|
label: i18n.baseText('insights.chart.failed'),
|
||||||
data: failedData,
|
data: failedData,
|
||||||
backgroundColor: colorPrimary.value,
|
backgroundColor: colorPrimary.value,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: i18n.baseText('insights.banner.title.succeeded'),
|
label: i18n.baseText('insights.chart.succeeded'),
|
||||||
data: succeededData,
|
data: succeededData,
|
||||||
backgroundColor: '#3E999F',
|
backgroundColor: '#3E999F',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3083,12 +3083,13 @@
|
|||||||
"insights.banner.timeSaved.tooltip.link.text": "add time estimates",
|
"insights.banner.timeSaved.tooltip.link.text": "add time estimates",
|
||||||
"insights.banner.title.total": "Prod. executions",
|
"insights.banner.title.total": "Prod. executions",
|
||||||
"insights.banner.title.failed": "Failed prod. executions",
|
"insights.banner.title.failed": "Failed prod. executions",
|
||||||
"insights.banner.title.succeeded": "Successful prod. executions",
|
|
||||||
"insights.banner.title.failureRate": "Failure rate",
|
"insights.banner.title.failureRate": "Failure rate",
|
||||||
"insights.banner.title.timeSaved": "Time saved",
|
"insights.banner.title.timeSaved": "Time saved",
|
||||||
"insights.banner.title.timeSavedDailyAverage": "Time saved daily avg.",
|
"insights.banner.title.timeSavedDailyAverage": "Time saved daily avg.",
|
||||||
"insights.banner.title.averageRunTime": "Run time (avg.)",
|
"insights.banner.title.averageRunTime": "Run time (avg.)",
|
||||||
"insights.dashboard.title": "Insights",
|
"insights.dashboard.title": "Insights",
|
||||||
"insights.banner.title.timeSaved.tooltip": "Total time saved calculated from your estimated time savings per execution across all workflows",
|
"insights.banner.title.timeSaved.tooltip": "Total time saved calculated from your estimated time savings per execution across all workflows",
|
||||||
"insights.banner.failureRate.deviation.tooltip": "Percentage point change from previous period"
|
"insights.banner.failureRate.deviation.tooltip": "Percentage point change from previous period",
|
||||||
|
"insights.chart.failed": "Failed",
|
||||||
|
"insights.chart.succeeded": "Successful"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user