Commit 425890c6 authored by Justin Ho's avatar Justin Ho

Move form ref to be a method

Defer fetching of Jira issueTypes until mounted to avoid
$refs not defined on the form.
parent 6b1db60e
......@@ -80,28 +80,28 @@ export default {
disableButtons() {
return Boolean(this.isSaving || this.isResetting || this.isTesting);
},
form() {
return this.$refs.integrationForm?.$el;
},
},
methods: {
...mapActions(['setOverride', 'requestJiraIssueTypes']),
form() {
return this.$refs.integrationForm.$el;
},
setIsValidated() {
this.isValidated = true;
},
onSaveClick() {
this.isSaving = true;
if (this.integrationActive && !this.form.checkValidity()) {
if (this.integrationActive && !this.form().checkValidity()) {
this.isSaving = false;
this.setIsValidated();
return;
}
this.form.submit();
this.form().submit();
},
onTestClick() {
if (!this.form.checkValidity()) {
if (!this.form().checkValidity()) {
this.setIsValidated();
return;
}
......@@ -146,7 +146,7 @@ export default {
this.requestJiraIssueTypes(this.getFormData());
},
getFormData() {
return new FormData(this.form);
return new FormData(this.form());
},
onToggleIntegrationState(integrationActive) {
this.integrationActive = integrationActive;
......
......@@ -113,7 +113,7 @@ export default {
return '';
},
},
created() {
mounted() {
if (this.initialIsEnabled) {
this.requestJiraIssueTypes();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment