Add comments for method and minor refinements
This commit is contained in:
parent
4341801a41
commit
f57a4a945a
1 changed files with 7 additions and 2 deletions
|
@ -44,6 +44,9 @@ export default class IntegrationSettingsForm {
|
||||||
this.toggleServiceState($(e.currentTarget).is(':checked'));
|
this.toggleServiceState($(e.currentTarget).is(':checked'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Change Form's validation enforcement based on service status (active/inactive)
|
||||||
|
*/
|
||||||
toggleServiceState(serviceActive) {
|
toggleServiceState(serviceActive) {
|
||||||
this.toggleSubmitBtnLabel(serviceActive, this.canTestService);
|
this.toggleSubmitBtnLabel(serviceActive, this.canTestService);
|
||||||
if (serviceActive) {
|
if (serviceActive) {
|
||||||
|
@ -54,7 +57,7 @@ export default class IntegrationSettingsForm {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Toggle Submit button label based on Integration status
|
* Toggle Submit button label based on Integration status and ability to test service
|
||||||
*/
|
*/
|
||||||
toggleSubmitBtnLabel(serviceActive, canTestService) {
|
toggleSubmitBtnLabel(serviceActive, canTestService) {
|
||||||
this.$submitBtnLabel.text(
|
this.$submitBtnLabel.text(
|
||||||
|
@ -76,9 +79,11 @@ export default class IntegrationSettingsForm {
|
||||||
this.$submitBtnLoader.removeClass('hidden');
|
this.$submitBtnLoader.removeClass('hidden');
|
||||||
} else {
|
} else {
|
||||||
this.$submitBtn.enable();
|
this.$submitBtn.enable();
|
||||||
|
if (!this.$submitBtnLoader.hasClass('hidden')) {
|
||||||
this.$submitBtnLoader.addClass('hidden');
|
this.$submitBtnLoader.addClass('hidden');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* eslint-disable promise/catch-or-return, no-new */
|
/* eslint-disable promise/catch-or-return, no-new */
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue