refactor(editor): Make null no longer conditionally displayed (#4993)

 Make `null` no longer conditionally displayed
This commit is contained in:
Iván Ovejero
2022-12-21 13:29:30 +01:00
committed by GitHub
parent 5db9c46043
commit 80e07f86ac

View File

@@ -119,14 +119,12 @@ export const expressionManager = mixins(workflowHelpers).extend({
* _part_ of the result, but displayed when they are the _entire_ result. * _part_ of the result, but displayed when they are the _entire_ result.
* *
* Example: * Example:
* - Expression `This is a {{ null }} test` is displayed as `This is a test`. * - Expression `This is a {{ [] }} test` is displayed as `This is a test`.
* - Expression `{{ null }}` is displayed as `[Object: null]`. * - Expression `{{ [] }}` is displayed as `[Array: []]`.
* *
* Conditionally displayed segments: * Conditionally displayed segments:
* - `[Object: null]`
* - `[Array: []]` * - `[Array: []]`
* - `[empty]` (from `''`, not from `undefined`) * - `[empty]` (from `''`, not from `undefined`)
* - `null` (from `NaN`)
* *
* Exceptionally, for two segments, display differs based on context: * Exceptionally, for two segments, display differs based on context:
* - Date is displayed as * - Date is displayed as
@@ -157,9 +155,8 @@ export const expressionManager = mixins(workflowHelpers).extend({
this.segments.length > 1 && this.segments.length > 1 &&
s.kind === 'resolvable' && s.kind === 'resolvable' &&
typeof s.resolved === 'string' && typeof s.resolved === 'string' &&
(['[Object: null]', '[Array: []]'].includes(s.resolved) || (s.resolved === '[Array: []]' ||
s.resolved === this.$locale.baseText('expressionModalInput.empty') || s.resolved === this.$locale.baseText('expressionModalInput.empty'))
s.resolved === this.$locale.baseText('expressionModalInput.null'))
) { ) {
return false; return false;
} }