Display "options" parameter as "string" if options could not be loaded

This commit is contained in:
Jan Oberhauser 2020-04-06 10:15:46 +02:00
parent 7e17486383
commit 931b73e1bd

View file

@ -2,7 +2,7 @@
<div @keydown.stop :class="parameterInputClasses"> <div @keydown.stop :class="parameterInputClasses">
<expression-edit :dialogVisible="expressionEditDialogVisible" :value="value" :parameter="parameter" :path="path" @closeDialog="closeExpressionEditDialog" @valueChanged="expressionUpdated"></expression-edit> <expression-edit :dialogVisible="expressionEditDialogVisible" :value="value" :parameter="parameter" :path="path" @closeDialog="closeExpressionEditDialog" @valueChanged="expressionUpdated"></expression-edit>
<div class="parameter-input ignore-key-press" :style="parameterInputWrapperStyle"> <div class="parameter-input ignore-key-press" :style="parameterInputWrapperStyle">
<div v-if="['json', 'string'].includes(parameter.type)"> <div v-if="['json', 'string'].includes(parameter.type) || remoteParameterOptionsLoadingIssues !== null">
<code-edit :dialogVisible="codeEditDialogVisible" :value="value" :parameter="parameter" @closeDialog="closeCodeEditDialog" @valueChanged="expressionUpdated"></code-edit> <code-edit :dialogVisible="codeEditDialogVisible" :value="value" :parameter="parameter" @closeDialog="closeCodeEditDialog" @valueChanged="expressionUpdated"></code-edit>
<text-edit :dialogVisible="textEditDialogVisible" :value="value" :parameter="parameter" @closeDialog="closeTextEditDialog" @valueChanged="expressionUpdated"></text-edit> <text-edit :dialogVisible="textEditDialogVisible" :value="value" :parameter="parameter" @closeDialog="closeTextEditDialog" @valueChanged="expressionUpdated"></text-edit>
@ -259,9 +259,7 @@ export default mixins(
return title; return title;
}, },
displayValue (): string | number | boolean | null { displayValue (): string | number | boolean | null {
if (this.remoteParameterOptionsLoadingIssues !== null) { if (this.remoteParameterOptionsLoading === true) {
return 'Error loading...';
} else if (this.remoteParameterOptionsLoading === true) {
// If it is loading options from server display // If it is loading options from server display
// to user that the data is loading. If not it would // to user that the data is loading. If not it would
// display the user the key instead of the value it // display the user the key instead of the value it