Merge pull request #1005 from leigh-johnson/AdhocInvFOrm

Moved adhoc form to inventoryManage view, fixed adhoc form's styles + undefined fields
This commit is contained in:
Leigh 2016-02-25 10:23:24 -05:00
commit 5d35563c92
9 changed files with 34 additions and 11 deletions

View File

@ -364,6 +364,16 @@ input[type='radio']:checked:before {
justify-content: flex-end;
}
.Form-button{
margin-left: 4px;
}
.Form-buttonDefault {
background-color: @default-bg;
color: @default-interface-txt;
border-color: @default-border;
}
.Form-saveButton{
background-color: @submit-button-bg;
margin-right: 20px;

View File

@ -91,6 +91,10 @@ body {
margin-top: 20px;
}
.btn{
text-transform: uppercase;
}
@media (max-width: 1075px) {
#main-menu-container {

View File

@ -1,5 +1,5 @@
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
* Copyright (c) 2016 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
@ -10,7 +10,7 @@
* @description This controller controls the adhoc form creation, command launching and navigating to standard out after command has been succesfully ran.
*/
function adhocController($q, $scope, $rootScope, $location, $stateParams,
CheckPasswords, PromptForPasswords, CreateLaunchDialog, adhocForm,
$state, CheckPasswords, PromptForPasswords, CreateLaunchDialog, adhocForm,
GenerateForm, Rest, ProcessErrors, ClearScope, GetBasePath, GetChoices,
KindChange, LookUpInit, CredentialList, Empty, Wait) {
@ -162,6 +162,10 @@ function adhocController($q, $scope, $rootScope, $location, $stateParams,
privateFn.initializeForm(id, urls, hostPattern);
$scope.formCancel = function(){
$state.go('inventoryManage');
}
// remove all data input into the form and reset the form back to defaults
$scope.formReset = function () {
GenerateForm.reset();
@ -291,7 +295,7 @@ function adhocController($q, $scope, $rootScope, $location, $stateParams,
}
export default ['$q', '$scope', '$rootScope', '$location', '$stateParams',
'CheckPasswords', 'PromptForPasswords', 'CreateLaunchDialog', 'adhocForm',
'$state', 'CheckPasswords', 'PromptForPasswords', 'CreateLaunchDialog', 'adhocForm',
'GenerateForm', 'Rest', 'ProcessErrors', 'ClearScope', 'GetBasePath',
'GetChoices', 'KindChange', 'LookUpInit', 'CredentialList', 'Empty', 'Wait',
adhocController];

View File

@ -12,7 +12,7 @@
export default function() {
return {
editTitle: 'Execute Command',
addTitle: 'Execute Command',
name: 'adhoc',
well: true,
forceListeners: true,
@ -125,13 +125,16 @@ export default function() {
buttons: {
launch: {
label: 'Launch',
label: 'Save',
ngClick: 'launchJob()',
ngDisabled: true
ngDisabled: true,
'class': 'Form-buttonDefault Form-button'
},
reset: {
ngClick: 'formReset()',
ngDisabled: true
ngDisabled: true,
label: 'Reset',
'class': 'Form-buttonDefault Form-button'
}
},

View File

@ -1,4 +1,4 @@
<div class="tab-pane" id="credentials">
<div class="Panel" id="adhoc">
<div ng-cloak id="htmlTemplate">
</div>
</div>

View File

@ -7,8 +7,8 @@
import {templateUrl} from '../shared/template-url/template-url.factory';
export default {
route: '/inventories/:inventory_id/adhoc',
name: 'inventoryAdhoc',
route: '/adhoc',
name: 'inventoryManage.adhoc',
templateUrl: templateUrl('adhoc/adhoc'),
controller: 'adhocController',
resolve: {

View File

@ -859,7 +859,7 @@ export function InventoriesManage ($log, $scope, $rootScope, $location,
}
}
$rootScope.hostPatterns = host_patterns;
$location.path('/inventories/' + $scope.inventory.id + '/adhoc');
$state.go('inventoryManage.adhoc');
};
$scope.refreshHostsOnGroupRefresh = false;

View File

@ -1,4 +1,5 @@
<div class="tab-pane" id="inventory_edit">
<div ui-view></div>
<div ng-cloak id="htmlTemplate">
<div class="row">

View File

@ -55,6 +55,7 @@ describe("adhoc.controller", function() {
$provide.value('Wait', waitCallback);
$provide.value('$stateExtender', stateExtenderCallback);
$provide.value('$stateParams', angular.noop);
$provide.value('$state', angular.noop);
}]));
beforeEach("put $q in scope", window.inject(['$q', function($q) {