mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 18:41:14 +00:00
fix(editor): Render dates correctly in parameter hint (#9089)
This commit is contained in:
@@ -71,7 +71,7 @@ import type { EventBus } from 'n8n-design-system/utils';
|
||||
import { createEventBus } from 'n8n-design-system/utils';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useWorkflowHelpers } from '@/composables/useWorkflowHelpers';
|
||||
import { getExpressionErrorMessage, getResolvableState } from '@/utils/expressions';
|
||||
import { stringifyExpressionResult } from '@/utils/expressions';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'ParameterInputWrapper',
|
||||
@@ -197,12 +197,13 @@ export default defineComponent({
|
||||
isInputParentOfActiveNode(): boolean {
|
||||
return this.ndvStore.isInputParentOfActiveNode;
|
||||
},
|
||||
evaluatedExpression(): Result<unknown, unknown> {
|
||||
evaluatedExpression(): Result<unknown, Error> {
|
||||
const value = isResourceLocatorValue(this.modelValue)
|
||||
? this.modelValue.value
|
||||
: this.modelValue;
|
||||
|
||||
if (!this.activeNode || !this.isValueExpression || typeof value !== 'string') {
|
||||
return { ok: false, error: '' };
|
||||
return { ok: false, error: new Error() };
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -227,28 +228,7 @@ export default defineComponent({
|
||||
return evaluated.ok ? evaluated.result : null;
|
||||
},
|
||||
evaluatedExpressionString(): string | null {
|
||||
const evaluated = this.evaluatedExpression;
|
||||
|
||||
if (!evaluated.ok) {
|
||||
if (getResolvableState(evaluated.error) !== 'invalid') {
|
||||
return null;
|
||||
}
|
||||
|
||||
return `[${this.$locale.baseText('parameterInput.error')}: ${getExpressionErrorMessage(
|
||||
evaluated.error as Error,
|
||||
)}]`;
|
||||
}
|
||||
|
||||
if (evaluated.result === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (typeof evaluated.result === 'string' && evaluated.result.length === 0) {
|
||||
return this.$locale.baseText('parameterInput.emptyString');
|
||||
}
|
||||
return typeof evaluated.result === 'string'
|
||||
? evaluated.result
|
||||
: JSON.stringify(evaluated.result);
|
||||
return stringifyExpressionResult(this.evaluatedExpression);
|
||||
},
|
||||
expressionOutput(): string | null {
|
||||
if (this.isValueExpression && this.evaluatedExpressionString) {
|
||||
|
||||
Reference in New Issue
Block a user