Commit f3b9ea43 by Mushtaq Ali

Send transcript credentials data to backend

Add Cielo Username

- EDUCATOR-1456
parent 6634b92c
...@@ -606,6 +606,7 @@ function($, Backbone, _, gettext, moment, ViewUtils, HtmlUtils, StringUtils, Tra ...@@ -606,6 +606,7 @@ function($, Backbone, _, gettext, moment, ViewUtils, HtmlUtils, StringUtils, Tra
validateOrganizationCredentials: function() { validateOrganizationCredentials: function() {
var $OrganizationApiSecretWrapperEl, var $OrganizationApiSecretWrapperEl,
$OrganizationUsernameWrapperEl,
isValid = true, isValid = true,
$OrganizationApiKeyWrapperEl = this.$el.find('.' + this.selectedProvider + '-api-key-wrapper'); $OrganizationApiKeyWrapperEl = this.$el.find('.' + this.selectedProvider + '-api-key-wrapper');
...@@ -630,6 +631,14 @@ function($, Backbone, _, gettext, moment, ViewUtils, HtmlUtils, StringUtils, Tra ...@@ -630,6 +631,14 @@ function($, Backbone, _, gettext, moment, ViewUtils, HtmlUtils, StringUtils, Tra
} else { } else {
this.clearPreferenceErrorState($OrganizationApiSecretWrapperEl); this.clearPreferenceErrorState($OrganizationApiSecretWrapperEl);
} }
} else {
$OrganizationUsernameWrapperEl = this.$el.find('.' + this.selectedProvider + '-username-wrapper');
if ($OrganizationUsernameWrapperEl.find('input').val() === '') {
isValid = false;
this.addErrorState($OrganizationUsernameWrapperEl);
} else {
this.clearPreferenceErrorState($OrganizationUsernameWrapperEl);
}
} }
return isValid; return isValid;
...@@ -673,14 +682,25 @@ function($, Backbone, _, gettext, moment, ViewUtils, HtmlUtils, StringUtils, Tra ...@@ -673,14 +682,25 @@ function($, Backbone, _, gettext, moment, ViewUtils, HtmlUtils, StringUtils, Tra
}, },
saveOrganizationCredentials: function() { saveOrganizationCredentials: function() {
var self = this; var self = this,
username,
apiSecret,
apiKey = this.$el.find('.' + this.selectedProvider + '-api-key').val();
// First clear response status if present already // First clear response status if present already
this.clearResponseStatus(); this.clearResponseStatus();
// TODO: Send actual organization credentials. if (this.selectedProvider === THREE_PLAY_MEDIA) {
apiSecret = this.$el.find('.' + this.selectedProvider + '-api-secret').val();
} else {
username = this.$el.find('.' + this.selectedProvider + '-username').val();
}
$.postJSON(self.transcriptCredentialsHandlerUrl, { $.postJSON(self.transcriptCredentialsHandlerUrl, {
provider: self.selectedProvider, provider: self.selectedProvider,
api_key: apiKey,
api_secret_key: apiSecret,
username: username,
global: false // Do not trigger global AJAX error handler global: false // Do not trigger global AJAX error handler
}, function() { }, function() {
self.$el.find('.organization-credentials-wrapper').hide(); self.$el.find('.organization-credentials-wrapper').hide();
......
...@@ -86,13 +86,10 @@ ...@@ -86,13 +86,10 @@
.organization-credentials-content { .organization-credentials-content {
margin-top: ($baseline*1.6); margin-top: ($baseline*1.6);
.org-credentials-wrapper input { .org-credentials-wrapper input {
width: 75%; width: 65%;
margin: ($baseline*0.8) 0; margin-top: ($baseline*0.8);
} display: inline-block;
.action-update-org-credentials {
margin-top: ($baseline*1.6);
} }
} }
.transcript-preferance-wrapper { .transcript-preferance-wrapper {
......
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