fix(editor): Fix notification rendering HTML as text (#10642)

This commit is contained in:
Raúl Gómez Morales 2024-09-03 10:41:59 +02:00 committed by GitHub
parent ce39933766
commit 5eba534319
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 24 additions and 13 deletions

View file

@ -0,0 +1,18 @@
<script lang="ts" setup>
import { useI18n } from '@/composables/useI18n';
const i18 = useI18n();
</script>
<template>
<div>
<a data-action="reload">{{ i18.baseText('nodeView.refresh') }}</a>
{{ i18.baseText('nodeView.toSeeTheLatestStatus') }}.
<br />
<a
href="https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.wait/"
target="_blank"
>
{{ i18.baseText('nodeView.moreInfo') }}
</a>
</div>
</template>

View file

@ -11,6 +11,7 @@ import {
ref, ref,
useCssModule, useCssModule,
watch, watch,
h,
} from 'vue'; } from 'vue';
import { useRoute, useRouter } from 'vue-router'; import { useRoute, useRouter } from 'vue-router';
import WorkflowCanvas from '@/components/canvas/WorkflowCanvas.vue'; import WorkflowCanvas from '@/components/canvas/WorkflowCanvas.vue';
@ -97,6 +98,7 @@ import type { PinDataSource } from '@/composables/usePinnedData';
import { useClipboard } from '@/composables/useClipboard'; import { useClipboard } from '@/composables/useClipboard';
import { useBeforeUnload } from '@/composables/useBeforeUnload'; import { useBeforeUnload } from '@/composables/useBeforeUnload';
import { getResourcePermissions } from '@/permissions'; import { getResourcePermissions } from '@/permissions';
import NodeViewUnfinishedWorkflowMessage from '@/components/NodeViewUnfinishedWorkflowMessage.vue';
const LazyNodeCreation = defineAsyncComponent( const LazyNodeCreation = defineAsyncComponent(
async () => await import('@/components/Node/NodeCreation.vue'), async () => await import('@/components/Node/NodeCreation.vue'),
@ -1062,11 +1064,7 @@ function onExecutionOpenedWithWaitTill(data: IExecutionResponse) {
if ((data as ExecutionSummary).waitTill) { if ((data as ExecutionSummary).waitTill) {
toast.showMessage({ toast.showMessage({
title: i18n.baseText('nodeView.thisExecutionHasntFinishedYet'), title: i18n.baseText('nodeView.thisExecutionHasntFinishedYet'),
message: `<a data-action="reload">${i18n.baseText('nodeView.refresh')}</a> ${i18n.baseText( message: h(NodeViewUnfinishedWorkflowMessage),
'nodeView.toSeeTheLatestStatus',
)}.<br/> <a href="https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.wait/" target="_blank">${i18n.baseText(
'nodeView.moreInfo',
)}</a>`,
type: 'warning', type: 'warning',
duration: 0, duration: 0,
}); });

View file

@ -1,5 +1,5 @@
<script lang="ts"> <script lang="ts">
import { defineAsyncComponent, defineComponent, nextTick, ref } from 'vue'; import { defineAsyncComponent, defineComponent, nextTick, ref, h } from 'vue';
import { mapStores, storeToRefs } from 'pinia'; import { mapStores, storeToRefs } from 'pinia';
import type { import type {
@ -182,6 +182,7 @@ import { usePostHog } from '@/stores/posthog.store';
import { useNpsSurveyStore } from '@/stores/npsSurvey.store'; import { useNpsSurveyStore } from '@/stores/npsSurvey.store';
import { getResourcePermissions } from '@/permissions'; import { getResourcePermissions } from '@/permissions';
import { useBeforeUnload } from '@/composables/useBeforeUnload'; import { useBeforeUnload } from '@/composables/useBeforeUnload';
import NodeViewUnfinishedWorkflowMessage from '@/components/NodeViewUnfinishedWorkflowMessage.vue';
interface AddNodeOptions { interface AddNodeOptions {
position?: XYPosition; position?: XYPosition;
@ -1063,13 +1064,7 @@ export default defineComponent({
if ((data as ExecutionSummary).waitTill) { if ((data as ExecutionSummary).waitTill) {
this.showMessage({ this.showMessage({
title: this.$locale.baseText('nodeView.thisExecutionHasntFinishedYet'), title: this.$locale.baseText('nodeView.thisExecutionHasntFinishedYet'),
message: `<a data-action="reload">${this.$locale.baseText( message: h(NodeViewUnfinishedWorkflowMessage),
'nodeView.refresh',
)}</a> ${this.$locale.baseText(
'nodeView.toSeeTheLatestStatus',
)}.<br/> <a href="https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.wait/" target="_blank">${this.$locale.baseText(
'nodeView.moreInfo',
)}</a>`,
type: 'warning', type: 'warning',
duration: 0, duration: 0,
}); });