From 96ae4baced8c3dec7ea8a0343e4333dfb4b49a7c Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Tue, 27 Jan 2015 17:53:21 -0500 Subject: [PATCH] Adding EULA text for fresh Tower install The EULA text needed to be added for when a new user needs to input a tower license for the first time. --- awx/ui/static/js/forms/LicenseUpdate.js | 4 +--- awx/ui/static/js/helpers/License.js | 13 ++++++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/awx/ui/static/js/forms/LicenseUpdate.js b/awx/ui/static/js/forms/LicenseUpdate.js index 55e18791fa..e4a91d3d1a 100644 --- a/awx/ui/static/js/forms/LicenseUpdate.js +++ b/awx/ui/static/js/forms/LicenseUpdate.js @@ -38,9 +38,7 @@ angular.module('LicenseUpdateFormDefinition', []) label: 'I agree to the End User License Agreement', type: 'checkbox', addRequired: true, - editRequird: true, - trueValue: 'true', - falseValue: 'false' + editRequird: true } }, buttons: { diff --git a/awx/ui/static/js/helpers/License.js b/awx/ui/static/js/helpers/License.js index c148713c2f..42d6b47d7b 100644 --- a/awx/ui/static/js/helpers/License.js +++ b/awx/ui/static/js/helpers/License.js @@ -199,7 +199,7 @@ function($rootScope, $compile, CreateDialog, Store, LicenseUpdateForm, GenerateF // Don't do anything when the license is valid if (!notify) { - return true; + return true; // if the license is valid it would exit 'test' here, otherwise it moves on to making the modal for the license } html = this.getHTML(license); @@ -209,8 +209,14 @@ function($rootScope, $compile, CreateDialog, Store, LicenseUpdateForm, GenerateF scope.parseType = 'json'; scope.removeLicenseDialogReady = scope.$on('LicenseDialogReady', function() { + // scope.eula_agreement = false; + $('#license_license_json').attr('ng-required' , 'true' ); + $('#license_eula_agreement_chbox').attr('ng-required' , 'true' ); + $('#license-submit-button').attr('ng-disabled' , "license_form.$invalid" ); var e = angular.element(document.getElementById('license-modal-dialog')); $compile(e)(scope); + e = angular.element(document.getElementById('license-submit-button')); + $compile(e)(scope); $('#license-modal-dialog').dialog('open'); }); @@ -245,14 +251,15 @@ function($rootScope, $compile, CreateDialog, Store, LicenseUpdateForm, GenerateF }]; } - height = (IsAdmin()) ? 600 : 350; + height = (IsAdmin()) ? 675 : 350; if (scope.removeLicenseReady) { scope.removeLicenseReady(); } scope.removeLicenseReady = scope.$on('LicenseReady', function(e, data) { - scope.license_json = " "; + scope.license_json = ""; + scope.eula = data.eula; if (data.license_info && data.license_info.valid_key !== undefined) { scope.license_json = JSON.stringify(data.license_info, null, ' '); }