mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 14:57:39 -02:30
Survey maker -> default password input replacement
turning the default password input on survey maker to use the new schema
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* All Rights Reserved
|
* All Rights Reserved
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ngdoc function
|
* @ngdoc function
|
||||||
* @name forms.function:Questions
|
* @name forms.function:Questions
|
||||||
@@ -274,17 +274,35 @@ export default
|
|||||||
default_password: {
|
default_password: {
|
||||||
realName: 'default_answer' ,
|
realName: 'default_answer' ,
|
||||||
type: 'custom' ,
|
type: 'custom' ,
|
||||||
control: '<div class="form-group" >'+
|
control: '<div class="form-group">'+
|
||||||
'<label for="default"><span class="label-text">Default Password</span></label>'+
|
'<label for="default_password"><span class="label-text">Default Answer</span></label>'+
|
||||||
'<div>'+
|
'<div>'+
|
||||||
'<input type="password" ng-model="default_password" name="default_password" id="default_password" class="form-control" ng-hide="pwcheckbox">'+
|
'<div class="input-group">'+
|
||||||
'<input type="text" ng-model="default_password" name="default_password" id="default_password" class="form-control" ng-show="pwcheckbox">'+
|
'<span class="input-group-btn">'+
|
||||||
'<label style="font-weight:normal"><input type="checkbox" ng-model="pwcheckbox" name="pwcheckbox" id="survey_question_pwcheckbox" ng-checked="false"> <span>Show Password</span></label>'+
|
'<button class="btn btn-default" id="default_password_show_input_button" aw-tool-tip="Toggle the display of plaintext." aw-tip-placement="top" ng-click="toggleInput("#default_password")" data-original-title="" title="">ABC</button>'+
|
||||||
'<div class="error ng-hide" id=survey_question-default-duplicate-error" ng-show="minTextError">The answer is shorter than the minimium length. Please make the answer longer. </div>' +
|
'</span>'+
|
||||||
'<div class="error ng-hide" id=survey_question-default-password-duplicate-error" ng-show="maxTextError">The answer is longer than the maximum length. Please make the answer shorter. </div>' +
|
'<input id="default_password" type="password" ng-model="default_password" name="default_password" class="form-control ng-pristine ng-valid-api-error ng-invalid ng-invalid-required" chk-pass="" required="" autocomplete="false">'+
|
||||||
'<div class="error api-error ng-binding" id="survey_question-default-password-api-error" ng-bind="default_api_error"></div>'+
|
'</div>'+
|
||||||
|
'<div class="error ng-hide" id="survey_question-default-duplicate-error"" ng-show="invalidChoice">'+
|
||||||
|
'Please enter an answer from the choices listed.</div><div class="error ng-hide" id="survey_question-default-duplicate-error"" ng-show="minTextError">'+
|
||||||
|
'The answer is shorter than the minimium length. Please make the answer longer.</div>'+
|
||||||
|
'<div class="error ng-hide" id="survey_question-default-duplicate-error"" ng-show="maxTextError">'+
|
||||||
|
'The answer is longer than the maximum length. Please make the answer shorter.</div>'+
|
||||||
|
'<div class="error api-error ng-binding" id="survey_question-default-api-error" ng-bind="default_api_error"></div>'+
|
||||||
'</div>'+
|
'</div>'+
|
||||||
'</div>',
|
'</div>',
|
||||||
|
|
||||||
|
// control: '<div class="form-group" >'+
|
||||||
|
// '<label for="default"><span class="label-text">Default Password</span></label>'+
|
||||||
|
// '<div>'+
|
||||||
|
// '<input type="password" ng-model="default_password" name="default_password" id="default_password" class="form-control" ng-hide="pwcheckbox">'+
|
||||||
|
// '<input type="text" ng-model="default_password" name="default_password" id="default_password" class="form-control" ng-show="pwcheckbox">'+
|
||||||
|
// '<label style="font-weight:normal"><input type="checkbox" ng-model="pwcheckbox" name="pwcheckbox" id="survey_question_pwcheckbox" ng-checked="false"> <span>Show Password</span></label>'+
|
||||||
|
// '<div class="error ng-hide" id=survey_question-default-duplicate-error" ng-show="minTextError">The answer is shorter than the minimium length. Please make the answer longer. </div>' +
|
||||||
|
// '<div class="error ng-hide" id=survey_question-default-password-duplicate-error" ng-show="maxTextError">The answer is longer than the maximum length. Please make the answer shorter. </div>' +
|
||||||
|
// '<div class="error api-error ng-binding" id="survey_question-default-password-api-error" ng-bind="default_api_error"></div>'+
|
||||||
|
// '</div>'+
|
||||||
|
// '</div>',
|
||||||
column: 2,
|
column: 2,
|
||||||
ngShow: 'type.type === "password" '
|
ngShow: 'type.type === "password" '
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* All Rights Reserved
|
* All Rights Reserved
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ngdoc function
|
* @ngdoc function
|
||||||
* @name helpers.function:Survey
|
* @name helpers.function:Survey
|
||||||
@@ -1027,5 +1027,19 @@ angular.module('SurveyHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper',
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//for toggling the input on password inputs
|
||||||
|
scope.toggleInput = function(id) {
|
||||||
|
var buttonId = id + "_show_input_button",
|
||||||
|
inputId = id,
|
||||||
|
buttonInnerHTML = $(buttonId).html();
|
||||||
|
if (buttonInnerHTML.indexOf("ABC") > -1) {
|
||||||
|
$(buttonId).html("<i class=\"fa fa-asterisk\"></i><i class=\"fa fa-asterisk\"></i><i class=\"fa fa-asterisk\"></i>");
|
||||||
|
$(inputId).attr("type", "text");
|
||||||
|
} else {
|
||||||
|
$(buttonId).html("ABC");
|
||||||
|
$(inputId).attr("type", "password");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
}]);
|
}]);
|
||||||
|
|||||||
Reference in New Issue
Block a user