From 0b6d47086a27117ceb0a1da107e5fcfbe11e0cd4 Mon Sep 17 00:00:00 2001 From: Csaba Tuncsik Date: Tue, 13 Dec 2022 14:00:20 +0100 Subject: [PATCH] fix(editor): Schema view render empty data (#4902) * fix(editor): Schema view render empty data * fix(editor): Schema view switch n8n-alert with n8n-info-tip * Revert "fix(editor): Schema view render empty data" This reverts commit 0294b5e8 for Alert component * chore(editor): code styling fix * fix(editor): Table view empty data hint * Revert "fix(editor): Table view empty data hint" This reverts commit d42dabf2c5064ee09b3cfb267cadfd2bc0515eab. --- packages/editor-ui/src/__tests__/setup.ts | 2 + .../src/components/RunDataSchema.test.ts | 7 --- .../src/components/RunDataSchema.vue | 7 ++- .../src/components/RunDataSchemaItem.vue | 2 +- .../editor-ui/src/components/RunDataTable.vue | 2 +- .../__snapshots__/RunDataSchema.test.ts.snap | 56 +++++++++---------- .../src/plugins/i18n/locales/en.json | 1 + 7 files changed, 38 insertions(+), 39 deletions(-) diff --git a/packages/editor-ui/src/__tests__/setup.ts b/packages/editor-ui/src/__tests__/setup.ts index 01855f1dd7799..8e151db291931 100644 --- a/packages/editor-ui/src/__tests__/setup.ts +++ b/packages/editor-ui/src/__tests__/setup.ts @@ -1,6 +1,7 @@ import '@testing-library/jest-dom'; import Vue from 'vue'; import '../plugins'; +import { I18nPlugin } from '@/plugins/i18n'; Vue.config.productionTip = false; Vue.config.devtools = false; @@ -9,4 +10,5 @@ Vue.config.devtools = false; // Without having this 3rd party library imported like this, any component test using 'vue-json-pretty' fail with: // [Vue warn]: Failed to mount component: template or render function not defined. Vue.component('vue-json-pretty', require('vue-json-pretty').default); +Vue.use((vue) => I18nPlugin(vue)); diff --git a/packages/editor-ui/src/components/RunDataSchema.test.ts b/packages/editor-ui/src/components/RunDataSchema.test.ts index 80acccc806445..a37a626597de4 100644 --- a/packages/editor-ui/src/components/RunDataSchema.test.ts +++ b/packages/editor-ui/src/components/RunDataSchema.test.ts @@ -42,13 +42,6 @@ describe('RunDataJsonSchema.vue', () => { }, data: [{}], }, - mocks: { - $locale: { - baseText() { - return ''; - }, - }, - }, }; beforeEach(cleanup); diff --git a/packages/editor-ui/src/components/RunDataSchema.vue b/packages/editor-ui/src/components/RunDataSchema.vue index 8010a748424c7..ccacb4d2d4549 100644 --- a/packages/editor-ui/src/components/RunDataSchema.vue +++ b/packages/editor-ui/src/components/RunDataSchema.vue @@ -9,6 +9,7 @@ import { runExternalHook } from "@/mixins/externalHooks"; import { telemetry } from "@/plugins/telemetry"; import { IDataObject } from "n8n-workflow"; import { getSchema, isEmpty, mergeDeep } from "@/utils"; +import { i18n } from '@/plugins/i18n'; type Props = { data: IDataObject[] @@ -71,7 +72,7 @@ const onDragEnd = (el: HTMLElement) => {