diff --git a/awx/ui/client/legacy-styles/ansible-ui.less b/awx/ui/client/legacy-styles/ansible-ui.less index b8f9032596..dfc996e990 100644 --- a/awx/ui/client/legacy-styles/ansible-ui.less +++ b/awx/ui/client/legacy-styles/ansible-ui.less @@ -36,6 +36,7 @@ @import "breadcrumbs.less"; @import "stdout.less"; @import "lists.less"; +@import "forms.less"; @import "dashboard.less"; @import "jPushMenu.less"; @import "survey-maker.less"; @@ -594,16 +595,6 @@ dd { margin-bottom: 10px; } -.aw-form-well { - border: 1px solid @grey; - padding: 9px; - border-radius: 4px; -} - -.form-group { - margin-bottom: 25px; -} - .form-cancel { float: right; margin-right: 10px; diff --git a/awx/ui/client/legacy-styles/forms.less b/awx/ui/client/legacy-styles/forms.less new file mode 100644 index 0000000000..1cd8059d7c --- /dev/null +++ b/awx/ui/client/legacy-styles/forms.less @@ -0,0 +1,124 @@ +/********************************************* + * Copyright (c) 2016 Ansible, Inc. + * + * lists.less + * + * custom styles for generated lists + * + */ + +@import "src/shared/branding/colors.default.less"; + +.Form{ + display:flex; + flex-wrap:wrap; + flex-direction: row; +} + +.Form-header{ + display: flex; +} + +.Form-title{ + flex: 1 0 auto; + text-transform: uppercase; + color: @list-header-txt; + font-size: 14px; + font-weight: bold; + white-space: nowrap; + padding-bottom: 20px; +} + +.Form-exitHolder{ + justify-content: flex-end; + display:flex; +} + +.Form-exit{ + cursor:pointer; + padding:0px; + border: none; + height:20px; + font-size: 20px; + background-color:@default-bg; + color:@default-second-border; + transition: color 0.2s; + line-height:1; +} + +.Form-exit:hover{ + color:@default-icon; +} + +.Form-formGroup { + flex: 1 0 auto; + margin-bottom: 25px; + width: 33%; + padding-right: 50px; +} + +.Form-inputLabel{ + text-transform: uppercase; + color: @default-interface-txt; + font-weight: normal; + font-size: small; +} + +.Form-buttons{ + height: 30px; + display: flex; + justify-content: flex-end; +} + +.Form-saveButton{ + background-color: @submit-button-bg; + margin-right: 20px; + color: @submit-button-text; + text-transform: uppercase; + transition: background-color 0.2s; + padding-left:15px; + padding-right: 15px; +} + +.Form-saveButton:disabled{ + background-color: @submit-button-bg-dis; +} + +.Form-saveButton:hover{ + background-color: @submit-button-bg-hov; + color: @submit-button-text; +} + +.Form-cancelButton{ + background-color: @default-bg; + color: @btn-txt; + text-transform: uppercase; + border-radius: 5px; + border: 1px solid @btn-bord; + transition: background-color 0.2s; + padding-left:15px; + padding-right: 15px; +} + +.Form-cancelButton:hover{ + background-color: @btn-bg-hov; + color: @btn-txt; +} + +@media only screen and (max-width: 650px) { + .Form-formGroup { + flex: 1 0 auto; + margin-bottom: 25px; + width: 100%; + padding-right: 50px; + } +} + +@media (min-width: 651px) and (max-width: 900px) { + .Form-formGroup { + flex: 1 0 auto; + margin-bottom: 25px; + width: 50%; + padding-right: 50px; + } +} diff --git a/awx/ui/client/src/app.js b/awx/ui/client/src/app.js index 96339eaafa..dbb86ae802 100644 --- a/awx/ui/client/src/app.js +++ b/awx/ui/client/src/app.js @@ -424,7 +424,7 @@ var tower = angular.module('Tower', [ state('projects.add', { url: '/add', - templateUrl: urlPrefix + 'partials/projects.add.html', + templateUrl: urlPrefix + 'partials/projects.html', controller: ProjectsAdd, ncyBreadcrumb: { parent: "projects", diff --git a/awx/ui/client/src/controllers/Credentials.js b/awx/ui/client/src/controllers/Credentials.js index 6124d92cdb..08dbe760bd 100644 --- a/awx/ui/client/src/controllers/Credentials.js +++ b/awx/ui/client/src/controllers/Credentials.js @@ -133,9 +133,11 @@ CredentialsList.$inject = ['$scope', '$rootScope', '$location', '$log', ]; -export function CredentialsAdd($scope, $rootScope, $compile, $location, $log, $stateParams, CredentialForm, GenerateForm, Rest, Alert, - ProcessErrors, ReturnToCaller, ClearScope, GenerateList, SearchInit, PaginateInit, LookUpInit, UserList, TeamList, - GetBasePath, GetChoices, Empty, KindChange, OwnerChange, FormSave) { +export function CredentialsAdd($scope, $rootScope, $compile, $location, $log, + $stateParams, CredentialForm, GenerateForm, Rest, Alert, ProcessErrors, + ReturnToCaller, ClearScope, GenerateList, SearchInit, PaginateInit, + LookUpInit, UserList, TeamList, GetBasePath, GetChoices, Empty, KindChange, + OwnerChange, FormSave, $state) { ClearScope(); @@ -248,10 +250,8 @@ export function CredentialsAdd($scope, $rootScope, $compile, $location, $log, $s OwnerChange({ scope: $scope }); }; - // Reset defaults - $scope.formReset = function () { - //DebugForm({ scope: $scope, form: CredentialForm }); - generator.reset(); + $scope.formCancel = function () { + $state.transitionTo('credentials'); }; // Password change @@ -296,15 +296,20 @@ export function CredentialsAdd($scope, $rootScope, $compile, $location, $log, $s } -CredentialsAdd.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$stateParams', 'CredentialForm', 'GenerateForm', - 'Rest', 'Alert', 'ProcessErrors', 'ReturnToCaller', 'ClearScope', 'generateList', 'SearchInit', 'PaginateInit', - 'LookUpInit', 'UserList', 'TeamList', 'GetBasePath', 'GetChoices', 'Empty', 'KindChange', 'OwnerChange', 'FormSave' +CredentialsAdd.$inject = ['$scope', '$rootScope', '$compile', '$location', + '$log', '$stateParams', 'CredentialForm', 'GenerateForm', 'Rest', 'Alert', + 'ProcessErrors', 'ReturnToCaller', 'ClearScope', 'generateList', + 'SearchInit', 'PaginateInit', 'LookUpInit', 'UserList', 'TeamList', + 'GetBasePath', 'GetChoices', 'Empty', 'KindChange', 'OwnerChange', + 'FormSave', '$state' ]; -export function CredentialsEdit($scope, $rootScope, $compile, $location, $log, $stateParams, CredentialForm, GenerateForm, Rest, Alert, - ProcessErrors, RelatedSearchInit, RelatedPaginateInit, ReturnToCaller, ClearScope, Prompt, GetBasePath, GetChoices, - KindChange, UserList, TeamList, LookUpInit, Empty, OwnerChange, FormSave, Stream, Wait) { +export function CredentialsEdit($scope, $rootScope, $compile, $location, $log, + $stateParams, CredentialForm, GenerateForm, Rest, Alert, ProcessErrors, + RelatedSearchInit, RelatedPaginateInit, ReturnToCaller, ClearScope, Prompt, + GetBasePath, GetChoices, KindChange, UserList, TeamList, LookUpInit, Empty, + OwnerChange, FormSave, Stream, Wait, $state) { ClearScope(); @@ -519,15 +524,8 @@ export function CredentialsEdit($scope, $rootScope, $compile, $location, $log, $ KindChange({ scope: $scope, form: form, reset: true }); }; - // Cancel - $scope.formReset = function () { - generator.reset(); - for (var fld in master) { - $scope[fld] = master[fld]; - } - setAskCheckboxes(); - KindChange({ scope: $scope, form: form, reset: false }); - OwnerChange({ scope: $scope }); + $scope.formCancel = function () { + $state.transitionTo('credentials'); }; // Related set: Add button @@ -614,8 +612,10 @@ export function CredentialsEdit($scope, $rootScope, $compile, $location, $log, $ } -CredentialsEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$stateParams', 'CredentialForm', - 'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'RelatedSearchInit', 'RelatedPaginateInit', - 'ReturnToCaller', 'ClearScope', 'Prompt', 'GetBasePath', 'GetChoices', 'KindChange', 'UserList', 'TeamList', 'LookUpInit', - 'Empty', 'OwnerChange', 'FormSave', 'Stream', 'Wait' +CredentialsEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', + '$log', '$stateParams', 'CredentialForm', 'GenerateForm', 'Rest', 'Alert', + 'ProcessErrors', 'RelatedSearchInit', 'RelatedPaginateInit', + 'ReturnToCaller', 'ClearScope', 'Prompt', 'GetBasePath', 'GetChoices', + 'KindChange', 'UserList', 'TeamList', 'LookUpInit', 'Empty', 'OwnerChange', + 'FormSave', 'Stream', 'Wait', '$state' ]; diff --git a/awx/ui/client/src/controllers/Inventories.js b/awx/ui/client/src/controllers/Inventories.js index 52869a3986..f87561d955 100644 --- a/awx/ui/client/src/controllers/Inventories.js +++ b/awx/ui/client/src/controllers/Inventories.js @@ -13,8 +13,8 @@ import '../job-templates/main'; export function InventoriesList($scope, $rootScope, $location, $log, - $stateParams, $compile, $filter, sanitizeFilter, Rest, Alert, InventoryList, generateList, - Prompt, SearchInit, PaginateInit, ReturnToCaller, + $stateParams, $compile, $filter, sanitizeFilter, Rest, Alert, InventoryList, + generateList, Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, GetBasePath, Wait, Stream, EditInventoryProperties, Find, Empty, LogViewer, $state) { @@ -371,9 +371,11 @@ InventoriesList.$inject = ['$scope', '$rootScope', '$location', '$log', '$stateP ]; -export function InventoriesAdd($scope, $rootScope, $compile, $location, $log, $stateParams, InventoryForm, GenerateForm, Rest, - Alert, ProcessErrors, ReturnToCaller, ClearScope, generateList, OrganizationList, SearchInit, PaginateInit, - LookUpInit, GetBasePath, ParseTypeChange, Wait, ToJSON) { +export function InventoriesAdd($scope, $rootScope, $compile, $location, $log, + $stateParams, InventoryForm, GenerateForm, Rest, Alert, ProcessErrors, + ReturnToCaller, ClearScope, generateList, OrganizationList, SearchInit, + PaginateInit, LookUpInit, GetBasePath, ParseTypeChange, Wait, ToJSON, + $state) { ClearScope(); @@ -443,21 +445,24 @@ export function InventoriesAdd($scope, $rootScope, $compile, $location, $log, $s }; - // Reset - $scope.formReset = function () { - generator.reset(); + $scope.formCancel = function () { + $state.transitionTo('inventories'); }; } -InventoriesAdd.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$stateParams', 'InventoryForm', 'GenerateForm', - 'Rest', 'Alert', 'ProcessErrors', 'ReturnToCaller', 'ClearScope', 'generateList', 'OrganizationList', 'SearchInit', - 'PaginateInit', 'LookUpInit', 'GetBasePath', 'ParseTypeChange', 'Wait', 'ToJSON' +InventoriesAdd.$inject = ['$scope', '$rootScope', '$compile', '$location', + '$log', '$stateParams', 'InventoryForm', 'GenerateForm', 'Rest', 'Alert', + 'ProcessErrors', 'ReturnToCaller', 'ClearScope', 'generateList', + 'OrganizationList', 'SearchInit', 'PaginateInit', 'LookUpInit', + 'GetBasePath', 'ParseTypeChange', 'Wait', 'ToJSON', '$state' ]; -export function InventoriesEdit($scope, $rootScope, $compile, $location, $log, $stateParams, InventoryForm, GenerateForm, Rest, - Alert, ProcessErrors, ReturnToCaller, ClearScope, generateList, OrganizationList, SearchInit, PaginateInit, - LookUpInit, GetBasePath, ParseTypeChange, Wait, ToJSON, ParseVariableString, Stream, RelatedSearchInit, RelatedPaginateInit, - Prompt, PlaybookRun, CreateDialog, deleteJobTemplate) { +export function InventoriesEdit($scope, $rootScope, $compile, $location, + $log, $stateParams, InventoryForm, GenerateForm, Rest, Alert, ProcessErrors, + ReturnToCaller, ClearScope, generateList, OrganizationList, SearchInit, + PaginateInit, LookUpInit, GetBasePath, ParseTypeChange, Wait, ToJSON, + ParseVariableString, Stream, RelatedSearchInit, RelatedPaginateInit, + Prompt, PlaybookRun, CreateDialog, deleteJobTemplate, $state) { ClearScope(); @@ -588,19 +593,8 @@ export function InventoriesEdit($scope, $rootScope, $compile, $location, $log, $ Stream({ scope: $scope }); }; - // Reset - $scope.formReset = function () { - generator.reset(); - for (var fld in master) { - $scope[fld] = master[fld]; - } - $scope.parseType = 'yaml'; - ParseTypeChange({ - scope: $scope, - variable: 'variables', - parse_variable: 'parseType', - field_id: 'inventory_variables' - }); + $scope.formCancel = function () { + $state.transitionTo('inventories'); }; $scope.addScanJob = function(){ @@ -775,10 +769,13 @@ export function InventoriesEdit($scope, $rootScope, $compile, $location, $log, $ } -InventoriesEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$stateParams', 'InventoryForm', 'GenerateForm', - 'Rest', 'Alert', 'ProcessErrors', 'ReturnToCaller', 'ClearScope', 'generateList', 'OrganizationList', 'SearchInit', - 'PaginateInit', 'LookUpInit', 'GetBasePath', 'ParseTypeChange', 'Wait', 'ToJSON', 'ParseVariableString', 'Stream', 'RelatedSearchInit', 'RelatedPaginateInit', - 'Prompt', 'PlaybookRun', 'CreateDialog', 'deleteJobTemplate' +InventoriesEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', + '$log', '$stateParams', 'InventoryForm', 'GenerateForm', 'Rest', 'Alert', + 'ProcessErrors', 'ReturnToCaller', 'ClearScope', 'generateList', + 'OrganizationList', 'SearchInit', 'PaginateInit', 'LookUpInit', + 'GetBasePath', 'ParseTypeChange', 'Wait', 'ToJSON', 'ParseVariableString', + 'Stream', 'RelatedSearchInit', 'RelatedPaginateInit', 'Prompt', + 'PlaybookRun', 'CreateDialog', 'deleteJobTemplate', '$state' ]; diff --git a/awx/ui/client/src/controllers/JobTemplates.js b/awx/ui/client/src/controllers/JobTemplates.js index 147c98da1b..1f17633399 100644 --- a/awx/ui/client/src/controllers/JobTemplates.js +++ b/awx/ui/client/src/controllers/JobTemplates.js @@ -245,10 +245,12 @@ JobTemplatesList.$inject = ['$scope', '$rootScope', '$location', '$log', '$state' ]; -export function JobTemplatesAdd($filter, $scope, $rootScope, $compile, $location, $log, $stateParams, JobTemplateForm, - GenerateForm, Rest, Alert, ProcessErrors, ReturnToCaller, ClearScope, GetBasePath, - InventoryList, CredentialList, ProjectList, LookUpInit, md5Setup, ParseTypeChange, Wait, Empty, ToJSON, - CallbackHelpInit, SurveyControllerInit, Prompt, GetChoices) { +export function JobTemplatesAdd($filter, $scope, $rootScope, $compile, + $location, $log, $stateParams, JobTemplateForm, GenerateForm, Rest, Alert, + ProcessErrors, ReturnToCaller, ClearScope, GetBasePath, InventoryList, + CredentialList, ProjectList, LookUpInit, md5Setup, ParseTypeChange, Wait, + Empty, ToJSON, CallbackHelpInit, SurveyControllerInit, Prompt, GetChoices, + $state) { ClearScope(); @@ -649,29 +651,28 @@ export function JobTemplatesAdd($filter, $scope, $rootScope, $compile, $location }; - // Reset - $scope.formReset = function () { - // Defaults - generator.reset(); - //$('#forks-slider').slider("option", "value", $scope.forks); - for (var fld in master) { - $scope[fld] = master[fld]; - } + $scope.formCancel = function () { + $state.transitionTo('jobTemplates'); }; } -JobTemplatesAdd.$inject = ['$filter', '$scope', '$rootScope', '$compile', '$location', '$log', '$stateParams', 'JobTemplateForm', - 'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'ReturnToCaller', 'ClearScope', - 'GetBasePath', 'InventoryList', 'CredentialList', 'ProjectList', 'LookUpInit', - 'md5Setup', 'ParseTypeChange', 'Wait', 'Empty', 'ToJSON', 'CallbackHelpInit', 'initSurvey', 'Prompt', 'GetChoices' +JobTemplatesAdd.$inject = ['$filter', '$scope', '$rootScope', '$compile', + '$location', '$log', '$stateParams', 'JobTemplateForm', 'GenerateForm', + 'Rest', 'Alert', 'ProcessErrors', 'ReturnToCaller', 'ClearScope', + 'GetBasePath', 'InventoryList', 'CredentialList', 'ProjectList', + 'LookUpInit', 'md5Setup', 'ParseTypeChange', 'Wait', 'Empty', 'ToJSON', + 'CallbackHelpInit', 'initSurvey', 'Prompt', 'GetChoices', '$state' ]; -export function JobTemplatesEdit($filter, $scope, $rootScope, $compile, $location, $log, $stateParams, JobTemplateForm, GenerateForm, Rest, - Alert, ProcessErrors, RelatedSearchInit, RelatedPaginateInit, ReturnToCaller, ClearScope, InventoryList, - CredentialList, ProjectList, LookUpInit, GetBasePath, md5Setup, ParseTypeChange, JobStatusToolTip, FormatDate, - Wait, Stream, Empty, Prompt, ParseVariableString, ToJSON, SchedulesControllerInit, JobsControllerInit, JobsListUpdate, - GetChoices, SchedulesListInit, SchedulesList, CallbackHelpInit, PlaybookRun, SurveyControllerInit){ +export function JobTemplatesEdit($filter, $scope, $rootScope, $compile, + $location, $log, $stateParams, JobTemplateForm, GenerateForm, Rest, Alert, + ProcessErrors, RelatedSearchInit, RelatedPaginateInit, ReturnToCaller, + ClearScope, InventoryList, CredentialList, ProjectList, LookUpInit, + GetBasePath, md5Setup, ParseTypeChange, JobStatusToolTip, FormatDate, Wait, + Stream, Empty, Prompt, ParseVariableString, ToJSON, SchedulesControllerInit, + JobsControllerInit, JobsListUpdate, GetChoices, SchedulesListInit, + SchedulesList, CallbackHelpInit, PlaybookRun, SurveyControllerInit, $state){ ClearScope(); @@ -1148,15 +1149,8 @@ export function JobTemplatesEdit($filter, $scope, $rootScope, $compile, $locatio }); }; - // Cancel - $scope.formReset = function () { - generator.reset(); - for (var fld in master) { - $scope[fld] = master[fld]; - } - $scope.parseType = 'yaml'; - ParseTypeChange({ scope: $scope, field_id: 'job_templates_variables', onChange: callback }); - $('#forks-slider').slider("option", "value", $scope.forks); + $scope.formCancel = function () { + $state.transitionTo('jobTemplates'); }; // Related set: Add button @@ -1232,10 +1226,14 @@ export function JobTemplatesEdit($filter, $scope, $rootScope, $compile, $locatio } -JobTemplatesEdit.$inject = ['$filter', '$scope', '$rootScope', '$compile', '$location', '$log', '$stateParams', 'JobTemplateForm', - 'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'RelatedSearchInit', 'RelatedPaginateInit', - 'ReturnToCaller', 'ClearScope', 'InventoryList', 'CredentialList', 'ProjectList', 'LookUpInit', - 'GetBasePath', 'md5Setup', 'ParseTypeChange', 'JobStatusToolTip', 'FormatDate', 'Wait', 'Stream', 'Empty', 'Prompt', - 'ParseVariableString', 'ToJSON', 'SchedulesControllerInit', 'JobsControllerInit', 'JobsListUpdate', 'GetChoices', - 'SchedulesListInit', 'SchedulesList', 'CallbackHelpInit', 'PlaybookRun' , 'initSurvey' +JobTemplatesEdit.$inject = ['$filter', '$scope', '$rootScope', '$compile', + '$location', '$log', '$stateParams', 'JobTemplateForm', 'GenerateForm', + 'Rest', 'Alert', 'ProcessErrors', 'RelatedSearchInit', + 'RelatedPaginateInit','ReturnToCaller', 'ClearScope', 'InventoryList', + 'CredentialList', 'ProjectList', 'LookUpInit', 'GetBasePath', 'md5Setup', + 'ParseTypeChange', 'JobStatusToolTip', 'FormatDate', 'Wait', 'Stream', + 'Empty', 'Prompt', 'ParseVariableString', 'ToJSON', + 'SchedulesControllerInit', 'JobsControllerInit', 'JobsListUpdate', + 'GetChoices', 'SchedulesListInit', 'SchedulesList', 'CallbackHelpInit', + 'PlaybookRun' , 'initSurvey', '$state' ]; diff --git a/awx/ui/client/src/controllers/Organizations.js b/awx/ui/client/src/controllers/Organizations.js index dbf7899b4b..3319addd64 100644 --- a/awx/ui/client/src/controllers/Organizations.js +++ b/awx/ui/client/src/controllers/Organizations.js @@ -101,9 +101,9 @@ OrganizationsList.$inject = ['$stateParams', '$scope', '$rootScope', ]; -export function OrganizationsAdd($scope, $rootScope, $compile, $location, $log, $stateParams, OrganizationForm, - GenerateForm, Rest, Alert, ProcessErrors, ClearScope, GetBasePath, - ReturnToCaller, Wait) { +export function OrganizationsAdd($scope, $rootScope, $compile, $location, $log, + $stateParams, OrganizationForm, GenerateForm, Rest, Alert, ProcessErrors, + ClearScope, GetBasePath, ReturnToCaller, Wait, $state) { ClearScope(); @@ -138,20 +138,22 @@ export function OrganizationsAdd($scope, $rootScope, $compile, $location, $log, }); }; - // Cancel - $scope.formReset = function () { - $rootScope.flashMessage = null; - generator.reset(); + $scope.formCancel = function () { + $state.transitionTo('organizations'); }; } -OrganizationsAdd.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$stateParams', 'OrganizationForm', - 'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'ClearScope', 'GetBasePath', 'ReturnToCaller', 'Wait' +OrganizationsAdd.$inject = ['$scope', '$rootScope', '$compile', '$location', + '$log', '$stateParams', 'OrganizationForm', 'GenerateForm', 'Rest', 'Alert', + 'ProcessErrors', 'ClearScope', 'GetBasePath', 'ReturnToCaller', 'Wait', + '$state' ]; -export function OrganizationsEdit($scope, $rootScope, $compile, $location, $log, $stateParams, OrganizationForm, GenerateForm, Rest, - Alert, ProcessErrors, RelatedSearchInit, RelatedPaginateInit, Prompt, ClearScope, GetBasePath, Wait, Stream) { +export function OrganizationsEdit($scope, $rootScope, $compile, $location, $log, + $stateParams, OrganizationForm, GenerateForm, Rest, Alert, ProcessErrors, + RelatedSearchInit, RelatedPaginateInit, Prompt, ClearScope, GetBasePath, + Wait, Stream, $state) { ClearScope(); @@ -241,13 +243,8 @@ export function OrganizationsEdit($scope, $rootScope, $compile, $location, $log, }); }; - // Reset the form - $scope.formReset = function () { - $rootScope.flashMessage = null; - generator.reset(); - for (var fld in master) { - $scope[fld] = master[fld]; - } + $scope.formCancel = function () { + $state.transitionTo('organizations'); }; // Related set: Add button @@ -291,7 +288,8 @@ export function OrganizationsEdit($scope, $rootScope, $compile, $location, $log, }; } -OrganizationsEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$stateParams', 'OrganizationForm', 'GenerateForm', - 'Rest', 'Alert', 'ProcessErrors', 'RelatedSearchInit', 'RelatedPaginateInit', 'Prompt', 'ClearScope', 'GetBasePath', - 'Wait', 'Stream' +OrganizationsEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', + '$log', '$stateParams', 'OrganizationForm', 'GenerateForm', 'Rest', 'Alert', + 'ProcessErrors', 'RelatedSearchInit', 'RelatedPaginateInit', 'Prompt', + 'ClearScope', 'GetBasePath', 'Wait', 'Stream', '$state' ]; diff --git a/awx/ui/client/src/controllers/Projects.js b/awx/ui/client/src/controllers/Projects.js index cdbdc7232b..6165c791b2 100644 --- a/awx/ui/client/src/controllers/Projects.js +++ b/awx/ui/client/src/controllers/Projects.js @@ -197,12 +197,10 @@ export function ProjectsList ($scope, $rootScope, $location, $log, $stateParams, }; $scope.addProject = function () { - // $location.path($location.path() + '/add'); $state.transitionTo('projects.add'); }; $scope.editProject = function (id) { - // $location.path($location.path() + '/' + id); $state.transitionTo('projects.edit', {id: id}); }; @@ -391,16 +389,19 @@ export function ProjectsList ($scope, $rootScope, $location, $log, $stateParams, }; } -ProjectsList.$inject = ['$scope', '$rootScope', '$location', '$log', '$stateParams', 'Rest', 'Alert', 'ProjectList', 'generateList', - 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', 'ProcessErrors', 'GetBasePath', - 'SelectionInit', 'ProjectUpdate', 'Refresh', 'Wait', 'Stream', 'GetChoices', 'Empty', 'Find', +ProjectsList.$inject = ['$scope', '$rootScope', '$location', '$log', + '$stateParams', 'Rest', 'Alert', 'ProjectList', 'generateList', 'Prompt', + 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', + 'ProcessErrors', 'GetBasePath', 'SelectionInit', 'ProjectUpdate', + 'Refresh', 'Wait', 'Stream', 'GetChoices', 'Empty', 'Find', 'LogViewer', 'GetProjectIcon', 'GetProjectToolTip', '$filter', '$state' ]; -export function ProjectsAdd($scope, $rootScope, $compile, $location, $log, $stateParams, ProjectsForm, GenerateForm, Rest, Alert, ProcessErrors, - ClearScope, GetBasePath, ReturnToCaller, GetProjectPath, LookUpInit, OrganizationList, - CredentialList, GetChoices, DebugForm, Wait) { +export function ProjectsAdd($scope, $rootScope, $compile, $location, $log, + $stateParams, ProjectsForm, GenerateForm, Rest, Alert, ProcessErrors, + ClearScope, GetBasePath, ReturnToCaller, GetProjectPath, LookUpInit, + OrganizationList, CredentialList, GetChoices, DebugForm, Wait, $state) { ClearScope(); @@ -524,29 +525,25 @@ export function ProjectsAdd($scope, $rootScope, $compile, $location, $log, $stat } }; - // Cancel - $scope.formReset = function () { - var fld; - $rootScope.flashMessage = null; - generator.reset(); - for (fld in master) { - $scope[fld] = master[fld]; - } - $scope.scmChange(); + $scope.formCancel = function () { + $state.transitionTo('projects'); }; } -ProjectsAdd.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$stateParams', 'ProjectsForm', - 'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'ClearScope', 'GetBasePath', - 'ReturnToCaller', 'GetProjectPath', 'LookUpInit', 'OrganizationList', 'CredentialList', 'GetChoices', - 'DebugForm', 'Wait' +ProjectsAdd.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', + '$stateParams', 'ProjectsForm', 'GenerateForm', 'Rest', 'Alert', + 'ProcessErrors', 'ClearScope', 'GetBasePath', 'ReturnToCaller', + 'GetProjectPath', 'LookUpInit', 'OrganizationList', 'CredentialList', + 'GetChoices', 'DebugForm', 'Wait', '$state' ]; -export function ProjectsEdit($scope, $rootScope, $compile, $location, $log, $stateParams, ProjectsForm, - GenerateForm, Rest, Alert, ProcessErrors, RelatedSearchInit, RelatedPaginateInit, Prompt, - ClearScope, GetBasePath, ReturnToCaller, GetProjectPath, Authorization, CredentialList, LookUpInit, GetChoices, - Empty, DebugForm, Wait, Stream, SchedulesControllerInit, SchedulesListInit, SchedulesList, ProjectUpdate) { +export function ProjectsEdit($scope, $rootScope, $compile, $location, $log, + $stateParams, ProjectsForm, GenerateForm, Rest, Alert, ProcessErrors, + RelatedSearchInit, RelatedPaginateInit, Prompt, ClearScope, GetBasePath, + ReturnToCaller, GetProjectPath, Authorization, CredentialList, LookUpInit, + GetChoices, Empty, DebugForm, Wait, Stream, SchedulesControllerInit, + SchedulesListInit, SchedulesList, ProjectUpdate, $state) { ClearScope('htmlTemplate'); @@ -829,19 +826,16 @@ export function ProjectsEdit($scope, $rootScope, $compile, $location, $log, $sta } }; - // Reset the form - $scope.formReset = function () { - $rootScope.flashMessage = null; - generator.reset(); - for (var fld in master) { - $scope[fld] = master[fld]; - } - $scope.scmChange(); + $scope.formCancel = function () { + $state.transitionTo('projects'); }; } -ProjectsEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$stateParams', 'ProjectsForm', 'GenerateForm', - 'Rest', 'Alert', 'ProcessErrors', 'RelatedSearchInit', 'RelatedPaginateInit', 'Prompt', 'ClearScope', - 'GetBasePath', 'ReturnToCaller', 'GetProjectPath', 'Authorization', 'CredentialList', 'LookUpInit', 'GetChoices', 'Empty', - 'DebugForm', 'Wait', 'Stream', 'SchedulesControllerInit', 'SchedulesListInit', 'SchedulesList', 'ProjectUpdate' +ProjectsEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', + '$stateParams', 'ProjectsForm', 'GenerateForm', 'Rest', 'Alert', + 'ProcessErrors', 'RelatedSearchInit', 'RelatedPaginateInit', 'Prompt', + 'ClearScope', 'GetBasePath', 'ReturnToCaller', 'GetProjectPath', + 'Authorization', 'CredentialList', 'LookUpInit', 'GetChoices', 'Empty', + 'DebugForm', 'Wait', 'Stream', 'SchedulesControllerInit', + 'SchedulesListInit', 'SchedulesList', 'ProjectUpdate', '$state' ]; diff --git a/awx/ui/client/src/controllers/Teams.js b/awx/ui/client/src/controllers/Teams.js index fa54f026e2..fbda9be487 100644 --- a/awx/ui/client/src/controllers/Teams.js +++ b/awx/ui/client/src/controllers/Teams.js @@ -114,9 +114,10 @@ TeamsList.$inject = ['$scope', '$rootScope', '$location', '$log', ]; -export function TeamsAdd($scope, $rootScope, $compile, $location, $log, $stateParams, TeamForm, GenerateForm, - Rest, Alert, ProcessErrors, ReturnToCaller, ClearScope, GenerateList, - OrganizationList, SearchInit, PaginateInit, GetBasePath, LookUpInit, Wait) { +export function TeamsAdd($scope, $rootScope, $compile, $location, $log, + $stateParams, TeamForm, GenerateForm, Rest, Alert, ProcessErrors, + ReturnToCaller, ClearScope, GenerateList, OrganizationList, SearchInit, + PaginateInit, GetBasePath, LookUpInit, Wait, $state) { ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior //$scope. @@ -161,22 +162,24 @@ export function TeamsAdd($scope, $rootScope, $compile, $location, $log, $statePa }); }; - // Reset - $scope.formReset = function () { - // Defaults - generator.reset(); + $scope.formCancel = function () { + $state.transitionTo('teams'); }; } -TeamsAdd.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$stateParams', 'TeamForm', 'GenerateForm', - 'Rest', 'Alert', 'ProcessErrors', 'ReturnToCaller', 'ClearScope', 'generateList', - 'OrganizationList', 'SearchInit', 'PaginateInit', 'GetBasePath', 'LookUpInit', 'Wait' +TeamsAdd.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', + '$stateParams', 'TeamForm', 'GenerateForm', 'Rest', 'Alert', + 'ProcessErrors', 'ReturnToCaller', 'ClearScope', 'generateList', + 'OrganizationList', 'SearchInit', 'PaginateInit', 'GetBasePath', + 'LookUpInit', 'Wait', '$state' ]; -export function TeamsEdit($scope, $rootScope, $compile, $location, $log, $stateParams, TeamForm, GenerateForm, Rest, Alert, ProcessErrors, - RelatedSearchInit, RelatedPaginateInit, ReturnToCaller, ClearScope, LookUpInit, Prompt, GetBasePath, CheckAccess, - OrganizationList, Wait, Stream, fieldChoices, fieldLabels, permissionsSearchSelect) { +export function TeamsEdit($scope, $rootScope, $compile, $location, $log, + $stateParams, TeamForm, GenerateForm, Rest, Alert, ProcessErrors, + RelatedSearchInit, RelatedPaginateInit, ReturnToCaller, ClearScope, + LookUpInit, Prompt, GetBasePath, CheckAccess, OrganizationList, Wait, + Stream, fieldChoices, fieldLabels, permissionsSearchSelect, $state) { ClearScope(); @@ -338,13 +341,8 @@ export function TeamsEdit($scope, $rootScope, $compile, $location, $log, $stateP }); }; - // Cancel - $scope.formReset = function () { - $rootScope.flashMessage = null; - generator.reset(); - for (var fld in master) { - $scope[fld] = master[fld]; - } + $scope.formCancel = function () { + $state.transitionTo('teams'); }; // Related set: Add button @@ -418,7 +416,10 @@ export function TeamsEdit($scope, $rootScope, $compile, $location, $log, $stateP }; } -TeamsEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$stateParams', 'TeamForm', - 'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'RelatedSearchInit', 'RelatedPaginateInit', - 'ReturnToCaller', 'ClearScope', 'LookUpInit', 'Prompt', 'GetBasePath', 'CheckAccess', 'OrganizationList', 'Wait', 'Stream', 'fieldChoices', 'fieldLabels', 'permissionsSearchSelect' +TeamsEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', + '$stateParams', 'TeamForm', 'GenerateForm', 'Rest', 'Alert', + 'ProcessErrors', 'RelatedSearchInit', 'RelatedPaginateInit', + 'ReturnToCaller', 'ClearScope', 'LookUpInit', 'Prompt', 'GetBasePath', + 'CheckAccess', 'OrganizationList', 'Wait', 'Stream', 'fieldChoices', + 'fieldLabels', 'permissionsSearchSelect', '$state' ]; diff --git a/awx/ui/client/src/controllers/Users.js b/awx/ui/client/src/controllers/Users.js index a36944ac41..1e5f9c06bc 100644 --- a/awx/ui/client/src/controllers/Users.js +++ b/awx/ui/client/src/controllers/Users.js @@ -104,8 +104,10 @@ UsersList.$inject = ['$scope', '$rootScope', '$location', '$log', ]; -export function UsersAdd($scope, $rootScope, $compile, $location, $log, $stateParams, UserForm, GenerateForm, Rest, Alert, ProcessErrors, - ReturnToCaller, ClearScope, GetBasePath, LookUpInit, OrganizationList, ResetForm, Wait) { +export function UsersAdd($scope, $rootScope, $compile, $location, $log, + $stateParams, UserForm, GenerateForm, Rest, Alert, ProcessErrors, + ReturnToCaller, ClearScope, GetBasePath, LookUpInit, OrganizationList, + ResetForm, Wait, $state) { ClearScope(); @@ -185,11 +187,8 @@ export function UsersAdd($scope, $rootScope, $compile, $location, $log, $statePa } }; - // Cancel - $scope.formReset = function () { - // Defaults - generator.reset(); - $scope.ldap_user = false; + $scope.formCancel = function () { + $state.transitionTo('users'); }; // Password change @@ -200,15 +199,18 @@ export function UsersAdd($scope, $rootScope, $compile, $location, $log, $statePa }; } -UsersAdd.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$stateParams', 'UserForm', 'GenerateForm', - 'Rest', 'Alert', 'ProcessErrors', 'ReturnToCaller', 'ClearScope', 'GetBasePath', 'LookUpInit', - 'OrganizationList', 'ResetForm', 'Wait' +UsersAdd.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', + '$stateParams', 'UserForm', 'GenerateForm', 'Rest', 'Alert', + 'ProcessErrors', 'ReturnToCaller', 'ClearScope', 'GetBasePath', + 'LookUpInit', 'OrganizationList', 'ResetForm', 'Wait', '$state' ]; -export function UsersEdit($scope, $rootScope, $compile, $location, $log, $stateParams, UserForm, GenerateForm, Rest, Alert, - ProcessErrors, RelatedSearchInit, RelatedPaginateInit, ReturnToCaller, ClearScope, GetBasePath, - Prompt, CheckAccess, ResetForm, Wait, Stream, fieldChoices, fieldLabels, permissionsSearchSelect) { +export function UsersEdit($scope, $rootScope, $compile, $location, $log, + $stateParams, UserForm, GenerateForm, Rest, Alert, ProcessErrors, + RelatedSearchInit, RelatedPaginateInit, ReturnToCaller, ClearScope, + GetBasePath, Prompt, CheckAccess, ResetForm, Wait, Stream, fieldChoices, + fieldLabels, permissionsSearchSelect, $state) { ClearScope(); @@ -377,14 +379,8 @@ export function UsersEdit($scope, $rootScope, $compile, $location, $log, $stateP Stream({ scope: $scope }); }; - // Cancel - $scope.formReset = function () { - $rootScope.flashMessage = null; - generator.reset(); - for (var fld in master) { - $scope[fld] = master[fld]; - } - $scope.password_confirm = $scope.password; + $scope.formCancel = function () { + $state.transitionTo('users'); }; // Password change @@ -526,7 +522,10 @@ export function UsersEdit($scope, $rootScope, $compile, $location, $log, $stateP }); } -UsersEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$stateParams', 'UserForm', 'GenerateForm', - 'Rest', 'Alert', 'ProcessErrors', 'RelatedSearchInit', 'RelatedPaginateInit', 'ReturnToCaller', 'ClearScope', - 'GetBasePath', 'Prompt', 'CheckAccess', 'ResetForm', 'Wait', 'Stream', 'fieldChoices', 'fieldLabels', 'permissionsSearchSelect' +UsersEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', + '$stateParams', 'UserForm', 'GenerateForm', 'Rest', 'Alert', + 'ProcessErrors', 'RelatedSearchInit', 'RelatedPaginateInit', + 'ReturnToCaller', 'ClearScope', 'GetBasePath', 'Prompt', 'CheckAccess', + 'ResetForm', 'Wait', 'Stream', 'fieldChoices', 'fieldLabels', + 'permissionsSearchSelect', '$state' ]; diff --git a/awx/ui/client/src/forms/Credentials.js b/awx/ui/client/src/forms/Credentials.js index c1d385eb87..2743d610bc 100644 --- a/awx/ui/client/src/forms/Credentials.js +++ b/awx/ui/client/src/forms/Credentials.js @@ -3,7 +3,7 @@ * * All Rights Reserved *************************************************/ - + /** * @ngdoc function * @name forms.function:Credentials @@ -357,9 +357,8 @@ export default ngClick: 'formSave()', //$scope.function to call on click, optional ngDisabled: true //Disable when $pristine or $invalid, optional }, - reset: { - ngClick: 'formReset()', - ngDisabled: true //Disabled when $pristine + cancel: { + ngClick: 'formCancel()', } }, diff --git a/awx/ui/client/src/forms/Inventories.js b/awx/ui/client/src/forms/Inventories.js index 35b685b402..9841da4dd2 100644 --- a/awx/ui/client/src/forms/Inventories.js +++ b/awx/ui/client/src/forms/Inventories.js @@ -3,7 +3,7 @@ * * All Rights Reserved *************************************************/ - + /** * @ngdoc function * @name forms.function:Inventories @@ -14,28 +14,14 @@ export default angular.module('InventoryFormDefinition', ['ScanJobsListDefinition']) .value('InventoryFormObject', { - addTitle: 'Create Inventory', + addTitle: 'New Inventory', editTitle: '{{ inventory_name }}', name: 'inventory', - well: true, collapse: true, collapseTitle: "Properties", collapseMode: 'edit', collapseOpen: true, - actions: { - stream: { - 'class': "btn-primary btn-xs activity-btn", - ngClick: "showActivity()", - awToolTip: "View Activity Stream", - awFeature: 'activity_streams', - dataPlacement: "top", - icon: "icon-comments-alt", - mode: 'edit', - iconSize: 'large' - } - }, - fields: { inventory_name: { realName: 'name', @@ -89,9 +75,8 @@ export default ngClick: 'formSave()', ngDisabled: true }, - reset: { - ngClick: 'formReset()', - ngDisabled: true + cancel: { + ngClick: 'formCancel()' } }, diff --git a/awx/ui/client/src/forms/JobTemplates.js b/awx/ui/client/src/forms/JobTemplates.js index 6bff4c4b86..be471aa946 100644 --- a/awx/ui/client/src/forms/JobTemplates.js +++ b/awx/ui/client/src/forms/JobTemplates.js @@ -15,36 +15,15 @@ export default .value ('JobTemplateFormObject', { - addTitle: 'Create Job Templates', + addTitle: 'New Job Template', editTitle: '{{ name }}', name: 'job_templates', - twoColumns: true, - well: true, base: 'job_templates', collapse: true, collapseTitle: "Properties", collapseMode: 'edit', collapseOpenFirst: true, //Always open first panel - actions: { - // submit: { - // ngClick: 'launch()', - // awToolTip: 'Start a job using this template', - // dataPlacement: 'top', - // mode: 'edit' - // }, - stream: { - 'class': "btn-primary btn-xs activity-btn", - ngClick: "showActivity()", - awToolTip: "View Activity Stream", - awFeature: 'activity_streams', - dataPlacement: "top", - icon: "icon-comments-alt", - mode: 'edit', - iconSize: 'large' - } - }, - fields: { name: { label: 'Name', @@ -326,9 +305,8 @@ export default ngClick: 'formSave()', //$scope.function to call on click, optional ngDisabled: "job_templates_form.$invalid || can_edit!==true"//true //Disable when $pristine or $invalid, optional and when can_edit = false, for permission reasons }, - reset: { - ngClick: 'formReset()', - ngDisabled: true //Disabled when $pristine + cancel: { + ngClick: 'formCancel()' } }, diff --git a/awx/ui/client/src/forms/Organizations.js b/awx/ui/client/src/forms/Organizations.js index 948f23ed2c..941774f45d 100644 --- a/awx/ui/client/src/forms/Organizations.js +++ b/awx/ui/client/src/forms/Organizations.js @@ -3,7 +3,7 @@ * * All Rights Reserved *************************************************/ - + /** * @ngdoc function * @name forms.function:Organizations @@ -14,28 +14,14 @@ export default angular.module('OrganizationFormDefinition', []) .value('OrganizationForm', { - addTitle: 'Create Organization', //Title in add mode + addTitle: 'New Organization', //Title in add mode editTitle: '{{ name }}', //Title in edit mode name: 'organization', //entity or model name in singular form - well: true, collapse: true, collapseTitle: "Properties", collapseMode: 'edit', collapseOpen: true, - actions: { - stream: { - 'class': "btn-primary btn-xs activity-btn", - ngClick: "showActivity()", - awToolTip: "View Activity Stream", - awFeature: 'activity_streams', - dataPlacement: "top", - icon: "icon-comments-alt", - mode: 'edit', - iconSize: 'large' - } - }, - fields: { name: { label: 'Name', @@ -57,9 +43,8 @@ export default ngClick: 'formSave()', //$scope.function to call on click, optional ngDisabled: true //Disable when $pristine or $invalid, optional }, - reset: { - ngClick: 'formReset()', - ngDisabled: true //Disabled when $pristine + cancel: { + ngClick: 'formCancel()' } }, diff --git a/awx/ui/client/src/forms/Projects.js b/awx/ui/client/src/forms/Projects.js index 19dcb21da8..610aa6cdb1 100644 --- a/awx/ui/client/src/forms/Projects.js +++ b/awx/ui/client/src/forms/Projects.js @@ -14,29 +14,15 @@ export default angular.module('ProjectFormDefinition', ['SchedulesListDefinition']) .value('ProjectsFormObject', { - addTitle: 'Create Project', + addTitle: 'New Project', editTitle: '{{ name }}', name: 'project', forceListeners: true, - well: true, collapse: true, collapseTitle: "Properties", collapseMode: 'edit', collapseOpen: true, - actions: { - stream: { - 'class': "btn-primary btn-xs activity-btn", - ngClick: "showActivity()", - awToolTip: "View Activity Stream", - awFeature: 'activity_streams', - dataPlacement: "top", - icon: "icon-comments-alt", - mode: 'edit', - iconSize: 'large' - } - }, - fields: { name: { label: 'Name', @@ -235,9 +221,8 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition']) ngClick: 'formSave()', ngDisabled: true }, - reset: { - ngClick: 'formReset()', - ngDisabled: true + cancel: { + ngClick: 'formCancel()' } }, diff --git a/awx/ui/client/src/forms/Teams.js b/awx/ui/client/src/forms/Teams.js index 195f783ede..1aec02fb32 100644 --- a/awx/ui/client/src/forms/Teams.js +++ b/awx/ui/client/src/forms/Teams.js @@ -3,7 +3,7 @@ * * All Rights Reserved *************************************************/ - + /** * @ngdoc function * @name forms.function:Teams @@ -14,28 +14,14 @@ export default angular.module('TeamFormDefinition', []) .value('TeamForm', { - addTitle: 'Create Team', //Legend in add mode + addTitle: 'New Team', //Legend in add mode editTitle: '{{ name }}', //Legend in edit mode name: 'team', - well: true, collapse: true, collapseTitle: "Properties", collapseMode: 'edit', collapseOpen: true, - actions: { - stream: { - 'class': "btn-primary btn-xs activity-btn", - ngClick: "showActivity()", - awToolTip: "View Activity Stream", - awFeature: 'activity_streams', - dataPlacement: "top", - icon: "icon-comments-alt", - mode: 'edit', - iconSize: 'large' - } - }, - fields: { name: { label: 'Name', @@ -68,9 +54,8 @@ export default ngClick: 'formSave()', ngDisabled: true }, - reset: { - ngClick: 'formReset()', - ngDisabled: true + cancel: { + ngClick: 'formCancel()' } }, diff --git a/awx/ui/client/src/forms/Users.js b/awx/ui/client/src/forms/Users.js index 8a5fbce7ce..5017bf5d07 100644 --- a/awx/ui/client/src/forms/Users.js +++ b/awx/ui/client/src/forms/Users.js @@ -3,7 +3,7 @@ * * All Rights Reserved *************************************************/ - + /** * @ngdoc function * @name forms.function:Users @@ -14,29 +14,15 @@ export default angular.module('UserFormDefinition', []) .value('UserForm', { - addTitle: 'Create User', + addTitle: 'New User', editTitle: '{{ username }}', name: 'user', - well: true, forceListeners: true, collapse: true, collapseTitle: "Properties", collapseMode: 'edit', collapseOpen: true, - actions: { - stream: { - 'class': "btn-primary btn-xs activity-btn", - ngClick: "showActivity()", - awToolTip: "View Activity Stream", - awFeature: 'activity_streams', - dataPlacement: "top", - icon: "icon-comments-alt", - mode: 'edit', - iconSize: 'large' - } - }, - fields: { first_name: { label: 'First Name', @@ -123,9 +109,8 @@ export default ngClick: 'formSave()', ngDisabled: true }, - reset: { - ngClick: 'formReset()', - ngDisabled: true + cancel: { + ngClick: 'formCancel()' } }, diff --git a/awx/ui/client/src/inventory-scripts/add/add.controller.js b/awx/ui/client/src/inventory-scripts/add/add.controller.js index 33aada3daa..32f4037318 100644 --- a/awx/ui/client/src/inventory-scripts/add/add.controller.js +++ b/awx/ui/client/src/inventory-scripts/add/add.controller.js @@ -58,9 +58,8 @@ export default }); }; - // Cancel - scope.formReset = function () { - generator.reset(); + scope.formCancel = function () { + $state.transitionTo('inventoryScripts'); }; } diff --git a/awx/ui/client/src/inventory-scripts/add/add.partial.html b/awx/ui/client/src/inventory-scripts/add/add.partial.html index aa722e6705..4fd493bc49 100644 --- a/awx/ui/client/src/inventory-scripts/add/add.partial.html +++ b/awx/ui/client/src/inventory-scripts/add/add.partial.html @@ -1,3 +1,3 @@
-
+
diff --git a/awx/ui/client/src/inventory-scripts/edit/edit.controller.js b/awx/ui/client/src/inventory-scripts/edit/edit.controller.js index a464338cd4..a24c9d1766 100644 --- a/awx/ui/client/src/inventory-scripts/edit/edit.controller.js +++ b/awx/ui/client/src/inventory-scripts/edit/edit.controller.js @@ -89,13 +89,8 @@ export default }); }; - $scope.formReset = function () { - generator.reset(); - for (var fld in master) { - $scope[fld] = master[fld]; - } - $scope.organization_name = master.organization_name; - + $scope.formCancel = function () { + $state.transitionTo('inventoryScripts'); }; } diff --git a/awx/ui/client/src/inventory-scripts/edit/edit.partial.html b/awx/ui/client/src/inventory-scripts/edit/edit.partial.html index 555ab2462d..ebe7183107 100644 --- a/awx/ui/client/src/inventory-scripts/edit/edit.partial.html +++ b/awx/ui/client/src/inventory-scripts/edit/edit.partial.html @@ -1,3 +1,3 @@
-
+
diff --git a/awx/ui/client/src/inventory-scripts/inventory-scripts.form.js b/awx/ui/client/src/inventory-scripts/inventory-scripts.form.js index f430dfe5d2..213a6cfcc6 100644 --- a/awx/ui/client/src/inventory-scripts/inventory-scripts.form.js +++ b/awx/ui/client/src/inventory-scripts/inventory-scripts.form.js @@ -13,10 +13,9 @@ export default function() { return { - // addTitle: 'Create Custom Inventory', - // editTitle: '{{ name }}', - // name: 'custom_inventory', - well: true, + addTitle: 'New Custom Inventory', + editTitle: '{{ name }}', + name: 'custom_inventory', showActions: true, fields: { @@ -66,9 +65,8 @@ export default function() { ngClick: 'formSave()', //$scope.function to call on click, optional ngDisabled: true //Disable when $pristine or $invalid, optional }, - reset: { - ngClick: 'formReset()', - ngDisabled: true //Disabled when $pristine + cancel: { + ngClick: 'formCancel()', } } }; diff --git a/awx/ui/client/src/inventory-scripts/list/list.partial.html b/awx/ui/client/src/inventory-scripts/list/list.partial.html index 9251ef810b..bcbea0d28d 100644 --- a/awx/ui/client/src/inventory-scripts/list/list.partial.html +++ b/awx/ui/client/src/inventory-scripts/list/list.partial.html @@ -1,4 +1,4 @@
-
+
diff --git a/awx/ui/client/src/partials/organizations.html b/awx/ui/client/src/partials/organizations.html index 6990db761f..5db1583d13 100644 --- a/awx/ui/client/src/partials/organizations.html +++ b/awx/ui/client/src/partials/organizations.html @@ -1,4 +1,4 @@
-
+
diff --git a/awx/ui/client/src/partials/projects.add.html b/awx/ui/client/src/partials/projects.add.html deleted file mode 100644 index 7d2a014836..0000000000 --- a/awx/ui/client/src/partials/projects.add.html +++ /dev/null @@ -1 +0,0 @@ -
diff --git a/awx/ui/client/src/shared/branding/colors.default.less b/awx/ui/client/src/shared/branding/colors.default.less index e9421c927b..34017ba341 100644 --- a/awx/ui/client/src/shared/branding/colors.default.less +++ b/awx/ui/client/src/shared/branding/colors.default.less @@ -82,6 +82,7 @@ @submit-button-text: @default-bg; @submit-button-bg: @default-succ; @submit-button-bg-hov: @default-succ-hov; +@submit-button-bg-dis: @default-second-border; // footer @copyright-text: @default-interface-txt; diff --git a/awx/ui/client/src/shared/form-generator.js b/awx/ui/client/src/shared/form-generator.js index 15b5d1b658..359d86ccaf 100644 --- a/awx/ui/client/src/shared/form-generator.js +++ b/awx/ui/client/src/shared/form-generator.js @@ -730,9 +730,9 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat html += "for=\"" + fld + '">\n'; html += (field.icon) ? Icon(field.icon) : ""; if (field.labelBind) { - html += "\t\t\n\t\t"; + html += "\t\t\n\t\t"; } else { - html += "\t\t\n\t\t\t" + field.label + "\n\t\t"; + html += "\t\t\n\t\t\t" + field.label + "\n\t\t"; } html += (field.awPopOver && !field.awPopOverRight) ? Attr(field, 'awPopOver', fld) : ""; html += (field.hintText) ? "\n\t\t\n\t\t\t\n\t\t\t\n\t\t\tHint: " + field.hintText + "\n\t\t" : ""; @@ -769,7 +769,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat } if ((!field.readonly) || (field.readonly && options.mode === 'edit')) { - html += "
"; + html += '' + field.label + ""; html += (field.awPopOver) ? this.attr(field, 'awPopOver', fld) : ""; html += "\n"; html += "
\n", action; - for (action in this.form.actions) { - if (this.form.actions[action].mode === 'all' || this.form.actions[action].mode === options.mode) { - html += this.button({ btn: this.form.actions[action], iconName: action, toolbar: true }); - } - } - html += "
\n"; - return html; - }, - - build: function (options) { // // Generate HTML. Do NOT call this function directly. Called by inject(). Returns an HTML @@ -1427,62 +1414,27 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat options.collapseAlreadyStarted = true; } - // Start the well - if (!this.modal && this.form.well) { - if ( !(this.form.collapse && this.form.collapseMode === options.mode)) { - html += "
\n"; - } - } - if ((options.showActions === undefined || options.showActions === true) && !this.modal && this.form.actions) { - html += this.getActions(options); - } + // title and exit button + html += "
"; + html += "
"; + html += (options.mode === 'edit') ? this.form.editTitle : this.form.addTitle; + html += "
\n"; - // Add a title and optionally a close button (used on Inventory->Groups) - /*if ((!options.modal) && this.form.showTitle) { - html += "
"; - html += (options.mode === 'edit') ? this.form.editTitle : this.form.addTitle; - if (this.has('titleActions')) { - html += "
\n"; - for (btn in this.form.titleActions) { - html += this.button({ - btn: this.form.titleActions[btn], - action: btn, - toolbar: true - }); - } - html += "
\n"; - } - html += "
\n"; - html += "
\n"; - }*/ + html += "
"; + html += "
\n"; - html += "
\n"; html += "
{{ flashMessage }}
\n"; - if (this.form.twoColumns) { - html += "
\n"; - html += "
\n"; - for (fld in this.form.fields) { - field = this.form.fields[fld]; - if (field.column === 1) { - html += this.buildField(fld, field, options, this.form); - } - } - html += "
\n"; - html += "
\n"; - for (fld in this.form.fields) { - field = this.form.fields[fld]; - if (field.column === 2) { - html += this.buildField(fld, field, options, this.form); - } - } - html += "
\n"; - html += "
\n"; - } else if (this.form.tabs) { + if (this.form.tabs) { html += "
    \n"; for (i = 0; i < this.form.tabs.length; i++) { tab = this.form.tabs[i]; @@ -1548,17 +1500,13 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat } } + html += "\n"; + //buttons if ((options.showButtons === undefined || options.showButtons === true) && !this.modal) { if (this.has('buttons')) { - if (this.form.twoColumns) { - html += "
    \n"; - html += "
    \n"; - html += "
    \n"; - } - - html += "
    \n"; } } @@ -1629,17 +1574,6 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat html += "
    \n"; } - if (this.form.twoColumns) { - html += "
    \n"; - html += "
    \n"; - } - } - } - html += "\n"; - - if (!this.modal && this.form.well) { - if ( !(this.form.collapse && this.form.collapseMode === options.mode)) { - html += "
\n"; } } diff --git a/awx/ui/client/src/shared/generator-helpers.js b/awx/ui/client/src/shared/generator-helpers.js index 40403d4d63..ece64c26aa 100644 --- a/awx/ui/client/src/shared/generator-helpers.js +++ b/awx/ui/client/src/shared/generator-helpers.js @@ -134,9 +134,6 @@ angular.module('GeneratorHelpers', [systemStatus.name]) case 'scm_update': icon = 'fa-cloud-download'; break; - case 'cancel': - icon = 'fa-minus-circle'; - break; case 'run': case 'rerun': case 'submit': @@ -157,7 +154,6 @@ angular.module('GeneratorHelpers', [systemStatus.name]) case 'close': icon = 'fa-arrow-left'; break; - case 'save': case 'form_submit': icon = 'fa-check-square-o'; break;