diff --git a/ui/src/tempVars/components/TemplateVariableEditor.tsx b/ui/src/tempVars/components/TemplateVariableEditor.tsx index 296c3fb23c..724f758af5 100644 --- a/ui/src/tempVars/components/TemplateVariableEditor.tsx +++ b/ui/src/tempVars/components/TemplateVariableEditor.tsx @@ -100,7 +100,9 @@ class TemplateVariableEditor extends PureComponent { return (
-

Edit Template Variable

+

+ {isNew ? 'Create' : 'Edit'} Template Variable +

@@ -277,6 +279,24 @@ class TemplateVariableEditor extends PureComponent { ) } + private get saveButtonText(): string { + const {isNew} = this.state + + if (this.isSaving && isNew) { + return 'Creating...' + } + + if (this.isSaving && !isNew) { + return 'Saving...' + } + + if (!this.isSaving && isNew) { + return 'Create' + } + + return 'Save' + } + private handleDelete = (): void => { const {onDelete} = this.props