Merge pull request #1891 from kensible/1830-credentialsAudit

Credential UX audit cleanup
This commit is contained in:
kensible
2016-05-16 11:17:09 -04:00
8 changed files with 50 additions and 20 deletions

View File

@@ -422,6 +422,19 @@ textarea.allowresize {
max-width: 325px; max-width: 325px;
background-color: @default-interface-txt; background-color: @default-interface-txt;
color: @default-bg; //white color: @default-bg; //white
code {
color: @default-data-txt;
background-color: @default-white-button-bord;
line-height: 18px;
}
a {
color: @default-warning;
&:hover {
color: @default-warning-hov;
}
}
} }
.popover.right>.arrow:after { .popover.right>.arrow:after {
border-right-color: @default-interface-txt; border-right-color: @default-interface-txt;

View File

@@ -201,6 +201,11 @@
.Form-textAreaLabel{ .Form-textAreaLabel{
width:100%; width:100%;
order: 1;
}
.Form-formGroup.Form-textAreaLabel {
max-width: 100%;
} }
.Form-textArea{ .Form-textArea{

View File

@@ -422,6 +422,10 @@ var tower = angular.module('Tower', [
controller: CredentialsEdit, controller: CredentialsEdit,
data: { data: {
activityStreamId: 'credential_id' activityStreamId: 'credential_id'
},
ncyBreadcrumb: {
parent: "credentials",
label: "EDIT CREDENTIAL"
} }
}). }).
@@ -742,12 +746,12 @@ var tower = angular.module('Tower', [
// remove any lingering intervals // remove any lingering intervals
// except on jobDetails.* states // except on jobDetails.* states
var jobDetailStates = [ var jobDetailStates = [
'jobDetail', 'jobDetail',
'jobDetail.host-summary', 'jobDetail.host-summary',
'jobDetail.host-event.details', 'jobDetail.host-event.details',
'jobDetail.host-event.json', 'jobDetail.host-event.json',
'jobDetail.host-events', 'jobDetail.host-events',
'jobDetail.host-event.stdout' 'jobDetail.host-event.stdout'
]; ];
if ($rootScope.jobDetailInterval && !_.includes(jobDetailStates, next.name) ) { if ($rootScope.jobDetailInterval && !_.includes(jobDetailStates, next.name) ) {
window.clearInterval($rootScope.jobDetailInterval); window.clearInterval($rootScope.jobDetailInterval);

View File

@@ -15,7 +15,6 @@ export function CredentialsList($scope, $rootScope, $location, $log,
$stateParams, Rest, Alert, CredentialList, GenerateList, Prompt, SearchInit, $stateParams, Rest, Alert, CredentialList, GenerateList, Prompt, SearchInit,
PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, GetBasePath, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, GetBasePath,
SelectionInit, GetChoices, Wait, $state) { SelectionInit, GetChoices, Wait, $state) {
ClearScope(); ClearScope();
Wait('start'); Wait('start');
@@ -33,7 +32,6 @@ export function CredentialsList($scope, $rootScope, $location, $log,
$scope.credentialLoading = true; $scope.credentialLoading = true;
url = GetBasePath(base) + ( (base === 'users') ? $stateParams.user_id + '/credentials/' : $stateParams.team_id + '/credentials/' ); url = GetBasePath(base) + ( (base === 'users') ? $stateParams.user_id + '/credentials/' : $stateParams.team_id + '/credentials/' );
if (mode === 'select') { if (mode === 'select') {
SelectionInit({ scope: $scope, list: list, url: url, returnToCaller: 1 }); SelectionInit({ scope: $scope, list: list, url: url, returnToCaller: 1 });
} }
@@ -119,13 +117,15 @@ export function CredentialsList($scope, $rootScope, $location, $log,
actionText: 'DELETE' actionText: 'DELETE'
}); });
}; };
$scope.$emit('choicesReadyCredential');
} }
CredentialsList.$inject = ['$scope', '$rootScope', '$location', '$log', CredentialsList.$inject = ['$scope', '$rootScope', '$location', '$log',
'$stateParams', 'Rest', 'Alert', 'CredentialList', 'generateList', 'Prompt', '$stateParams', 'Rest', 'Alert', 'CredentialList', 'generateList', 'Prompt',
'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope',
'ProcessErrors', 'GetBasePath', 'SelectionInit', 'GetChoices', 'Wait', 'ProcessErrors', 'GetBasePath', 'SelectionInit', 'GetChoices', 'Wait',
'$state' '$state',
]; ];
@@ -320,10 +320,12 @@ export function CredentialsEdit($scope, $rootScope, $compile, $location, $log,
$stateParams, CredentialForm, GenerateForm, Rest, Alert, ProcessErrors, $stateParams, CredentialForm, GenerateForm, Rest, Alert, ProcessErrors,
RelatedSearchInit, RelatedPaginateInit, ReturnToCaller, ClearScope, Prompt, RelatedSearchInit, RelatedPaginateInit, ReturnToCaller, ClearScope, Prompt,
GetBasePath, GetChoices, KindChange, OrganizationList, LookUpInit, Empty, GetBasePath, GetChoices, KindChange, OrganizationList, LookUpInit, Empty,
OwnerChange, FormSave, Wait, $state, CreateSelect2) { OwnerChange, FormSave, Wait, $state, CreateSelect2, Authorization) {
if (!$rootScope.current_user) {
Authorization.restoreUserInfo();
}
ClearScope(); ClearScope();
var defaultUrl = GetBasePath('credentials'), var defaultUrl = GetBasePath('credentials'),
generator = GenerateForm, generator = GenerateForm,
form = CredentialForm, form = CredentialForm,
@@ -331,7 +333,6 @@ export function CredentialsEdit($scope, $rootScope, $compile, $location, $log,
master = {}, master = {},
id = $stateParams.credential_id, id = $stateParams.credential_id,
relatedSets = {}; relatedSets = {};
generator.inject(form, { mode: 'edit', related: true, scope: $scope }); generator.inject(form, { mode: 'edit', related: true, scope: $scope });
generator.reset(); generator.reset();
$scope.id = id; $scope.id = id;
@@ -672,5 +673,5 @@ CredentialsEdit.$inject = ['$scope', '$rootScope', '$compile', '$location',
'ProcessErrors', 'RelatedSearchInit', 'RelatedPaginateInit', 'ProcessErrors', 'RelatedSearchInit', 'RelatedPaginateInit',
'ReturnToCaller', 'ClearScope', 'Prompt', 'GetBasePath', 'GetChoices', 'ReturnToCaller', 'ClearScope', 'Prompt', 'GetBasePath', 'GetChoices',
'KindChange', 'OrganizationList', 'LookUpInit', 'Empty', 'OwnerChange', 'KindChange', 'OrganizationList', 'LookUpInit', 'Empty', 'OwnerChange',
'FormSave', 'Wait', '$state', 'CreateSelect2' 'FormSave', 'Wait', '$state', 'CreateSelect2', 'Authorization'
]; ];

View File

@@ -39,7 +39,7 @@ angular.module('CredentialsHelper', ['Utilities'])
scope.project_required = false; scope.project_required = false;
scope.subscription_required = false; scope.subscription_required = false;
scope.key_description = "Paste the contents of the SSH private key file.<div class=\"popover-footer\"><span class=\"key\">esc</span> or click to close</div>"; scope.key_description = "Paste the contents of the SSH private key file.<div class=\"popover-footer\"><span class=\"key\">esc</span> or click to close</div>";
scope.key_hint= "drag and drop an SSH private key file on the field below"; scope.key_hint= "paste or drag and drop an SSH private key file on the field below";
scope.host_required = false; scope.host_required = false;
scope.password_required = false; scope.password_required = false;
scope.hostLabel = ''; scope.hostLabel = '';
@@ -65,7 +65,7 @@ angular.module('CredentialsHelper', ['Utilities'])
scope.domain_required = false; scope.domain_required = false;
scope.subscription_required = false; scope.subscription_required = false;
scope.key_description = "Paste the contents of the SSH private key file."; scope.key_description = "Paste the contents of the SSH private key file.";
scope.key_hint= "drag and drop an SSH private key file on the field below"; scope.key_hint= "paste or drag and drop an SSH private key file on the field below";
scope.host_required = false; scope.host_required = false;
scope.password_required = false; scope.password_required = false;
scope.hostLabel = ''; scope.hostLabel = '';
@@ -75,7 +75,6 @@ angular.module('CredentialsHelper', ['Utilities'])
scope.passwordLabel = 'Password (API Key)'; scope.passwordLabel = 'Password (API Key)';
scope.projectPopOver = "<p>The project value</p>"; scope.projectPopOver = "<p>The project value</p>";
scope.hostPopOver = "<p>The host value</p>"; scope.hostPopOver = "<p>The host value</p>";
if (!Empty(scope.kind)) { if (!Empty(scope.kind)) {
// Apply kind specific settings // Apply kind specific settings
switch (scope.kind.value) { switch (scope.kind.value) {
@@ -131,6 +130,7 @@ angular.module('CredentialsHelper', ['Utilities'])
scope.password_required = true; scope.password_required = true;
scope.hostLabel = "vCenter Host"; scope.hostLabel = "vCenter Host";
scope.passwordLabel = 'Password'; scope.passwordLabel = 'Password';
scope.hostPopOver = "Enter the hostname or IP address which corresponds to your VMware vCenter.";
break; break;
case 'openstack': case 'openstack':
scope.hostLabel = "Host (Authentication URL)"; scope.hostLabel = "Host (Authentication URL)";
@@ -152,6 +152,8 @@ angular.module('CredentialsHelper', ['Utilities'])
scope.passwordLabel = 'Password'; scope.passwordLabel = 'Password';
scope.host_required = true; scope.host_required = true;
scope.hostLabel = "Satellite 6 Host"; scope.hostLabel = "Satellite 6 Host";
scope.hostPopOver = "Enter the hostname or IP address name which <br />" +
"corresponds to your Red Hat Satellite 6 server.";
break; break;
case 'cloudforms': case 'cloudforms':
scope.username_required = true; scope.username_required = true;
@@ -159,6 +161,8 @@ angular.module('CredentialsHelper', ['Utilities'])
scope.passwordLabel = 'Password'; scope.passwordLabel = 'Password';
scope.host_required = true; scope.host_required = true;
scope.hostLabel = "CloudForms Host"; scope.hostLabel = "CloudForms Host";
scope.hostPopOver = "Enter the hostname or IP address for the virtual <br />" +
" machine which is hosting the CloudForm appliance.";
break; break;
case 'net': case 'net':
scope.username_required = true; scope.username_required = true;
@@ -222,8 +226,8 @@ angular.module('CredentialsHelper', ['Utilities'])
} }
]) ])
.factory('FormSave', ['$rootScope', 'Refresh', '$location', 'Alert', 'Rest', 'ProcessErrors', 'Empty', 'GetBasePath', 'CredentialForm', 'ReturnToCaller', 'Wait', .factory('FormSave', ['$rootScope', 'Refresh', '$location', 'Alert', 'Rest', 'ProcessErrors', 'Empty', 'GetBasePath', 'CredentialForm', 'ReturnToCaller', 'Wait', '$state',
function ($rootScope, Refresh, $location, Alert, Rest, ProcessErrors, Empty, GetBasePath, CredentialForm, ReturnToCaller, Wait) { function ($rootScope, Refresh, $location, Alert, Rest, ProcessErrors, Empty, GetBasePath, CredentialForm, ReturnToCaller, Wait, $state) {
return function (params) { return function (params) {
var scope = params.scope, var scope = params.scope,
mode = params.mode, mode = params.mode,
@@ -293,6 +297,8 @@ angular.module('CredentialsHelper', ['Utilities'])
else { else {
ReturnToCaller(1); ReturnToCaller(1);
} }
$state.go('credentials.edit', {credential_id: data.id}, {reload: true});
}) })
.error(function (data, status) { .error(function (data, status) {
Wait('stop'); Wait('stop');
@@ -314,6 +320,7 @@ angular.module('CredentialsHelper', ['Utilities'])
else { else {
ReturnToCaller(1); ReturnToCaller(1);
} }
}) })
.error(function (data, status) { .error(function (data, status) {
Wait('stop'); Wait('stop');

View File

@@ -48,7 +48,7 @@ export default
organization: scope.organization, organization: scope.organization,
script: scope.script script: scope.script
}) })
.success(function (data) { .success(function () {
$state.go('inventoryScripts', {}, {reload: true}); $state.go('inventoryScripts', {}, {reload: true});
Wait('stop'); Wait('stop');
}) })

View File

@@ -17,10 +17,10 @@
if (typeof value === 'object'){return false;} if (typeof value === 'object'){return false;}
else {return true;} else {return true;}
}; };
//var CodeMirror;
var codeMirror = function(el, json){ var codeMirror = function(el, json){
var container = $(el)[0]; var container = $(el)[0];
var editor = CodeMirror.fromTextArea(container, { var editor = codeMirror.fromTextArea(container, {
lineNumbers: true, lineNumbers: true,
mode: {name: "javascript", json: true} mode: {name: "javascript", json: true}
}); });

View File

@@ -1,5 +1,5 @@
<div class="TagSearch row"> <div class="TagSearch row">
<div ng-class="listConfig.searchSize || 'col-lg-4 col-md-8 col-sm-12 col-xs-12'"> <div ng-class="listConfig.searchSize || 'col-lg-4 col-md-12 col-sm-12 col-xs-12'">
<div class="TagSearch-bar"> <div class="TagSearch-bar">
<div class="TagSearch-typeDropdown" <div class="TagSearch-typeDropdown"
ng-click="toggleTypeDropdown()" ng-click="toggleTypeDropdown()"