mirror of
https://github.com/ansible/awx.git
synced 2026-05-25 17:47:45 -02:30
AC-934: Hide license date and time remaining when AWS.
This commit is contained in:
@@ -9,8 +9,8 @@
|
||||
|
||||
angular.module('License', ['RestServices', 'Utilities', 'FormGenerator', 'PromptDialog'])
|
||||
.factory('ViewLicense', ['$location', '$rootScope', 'GenerateForm', 'Rest', 'Alert', 'GetBasePath', 'ProcessErrors',
|
||||
'FormatDate', 'Prompt',
|
||||
function($location, $rootScope, GenerateForm, Rest, Alert, GetBasePath, ProcessErrors, FormatDate, Prompt) {
|
||||
'FormatDate', 'Prompt', 'Empty',
|
||||
function($location, $rootScope, GenerateForm, Rest, Alert, GetBasePath, ProcessErrors, FormatDate, Prompt, Empty) {
|
||||
return function() {
|
||||
|
||||
var defaultUrl=GetBasePath('config');
|
||||
@@ -90,27 +90,20 @@ angular.module('License', ['RestServices', 'Utilities', 'FormGenerator', 'Prompt
|
||||
var base = $location.path().replace(/^\//,'').split('/')[0];
|
||||
|
||||
|
||||
function empty(x) {
|
||||
var result = false;
|
||||
if (x != 0 && (x === null || x === undefined || x == '') ) {
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// Retrieve detail record and prepopulate the form
|
||||
Rest.setUrl(defaultUrl);
|
||||
Rest.get()
|
||||
.success( function(data, status, headers, config) {
|
||||
|
||||
for (var fld in form.fields) {
|
||||
if (fld != 'time_remaining' && fld != 'license_status') {
|
||||
if (empty(data['license_info'][fld])) {
|
||||
if (Empty(data['license_info'][fld])) {
|
||||
delete form.fields[fld];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (empty(data['license_info']['license_date'])) {
|
||||
if (data['license_info']['is_aws'] || Empty(data['license_info']['license_date'])) {
|
||||
delete form.fields['license_date'];
|
||||
delete form.fields['time_remaining'];
|
||||
}
|
||||
@@ -125,10 +118,12 @@ angular.module('License', ['RestServices', 'Utilities', 'FormGenerator', 'Prompt
|
||||
scope.formModalActionLabel = 'OK';
|
||||
scope.formModalCancelShow = false;
|
||||
scope.formModalInfo = 'Purchase/Extend License';
|
||||
$('#form-modal .btn-success').removeClass('btn-success').addClass('btn-none');
|
||||
$('#form-modal').addClass('skinny-modal');
|
||||
scope.formModalHeader = 'AWX License';
|
||||
|
||||
//$('#form-modal .btn-success').removeClass('btn-success').addClass('btn-none');
|
||||
//$('#form-modal').addClass('skinny-modal');
|
||||
|
||||
|
||||
// Respond to license button
|
||||
scope.formModalInfoAction = function() {
|
||||
Prompt({
|
||||
@@ -145,7 +140,7 @@ angular.module('License', ['RestServices', 'Utilities', 'FormGenerator', 'Prompt
|
||||
}
|
||||
|
||||
for (var fld in form.fields) {
|
||||
if (data['license_info'][fld] !== undefined) {
|
||||
if (!Empty(data['license_info'][fld])) {
|
||||
scope[fld] = data['license_info'][fld];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user