From 289835f01b0a24a6f772de0c11e6205952305778 Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Wed, 31 May 2017 10:54:51 -0700 Subject: [PATCH] adding insights credential to inventory form in order to create an insights inventory --- .../standard/edit/inventory-edit.controller.js | 1 + .../client/src/inventories/standard/inventory.form.js | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/awx/ui/client/src/inventories/standard/edit/inventory-edit.controller.js b/awx/ui/client/src/inventories/standard/edit/inventory-edit.controller.js index 205b483779..5b0c19195c 100644 --- a/awx/ui/client/src/inventories/standard/edit/inventory-edit.controller.js +++ b/awx/ui/client/src/inventories/standard/edit/inventory-edit.controller.js @@ -29,6 +29,7 @@ function InventoriesEdit($scope, $location, $scope = angular.extend($scope, inventoryData); + $scope.credential_name = (inventoryData.summary_fields.credential && inventoryData.summary_fields.credential.name) ? inventoryData.summary_fields.credential.name : null; $scope.organization_name = inventoryData.summary_fields.organization.name; $scope.inventory_variables = inventoryData.variables === null || inventoryData.variables === '' ? '---' : ParseVariableString(inventoryData.variables); $scope.parseType = 'yaml'; diff --git a/awx/ui/client/src/inventories/standard/inventory.form.js b/awx/ui/client/src/inventories/standard/inventory.form.js index 08e3d8df48..b6fa892974 100644 --- a/awx/ui/client/src/inventories/standard/inventory.form.js +++ b/awx/ui/client/src/inventories/standard/inventory.form.js @@ -68,6 +68,17 @@ function(i18n, InventoryCompletedJobsList) { ngDisabled: '!(inventory_obj.summary_fields.user_capabilities.edit || canAdd) || !canEditOrg', awLookupWhen: '(inventory_obj.summary_fields.user_capabilities.edit || canAdd) && canEditOrg' }, + insights_credential: { + label: i18n._('Insights Credential'), + type: 'lookup', + list: 'CredentialList', + basePath: 'credentials', + sourceModel: 'credential', + sourceField: 'name', + search: { + credential_type: 13 //insights + } + }, inventory_variables: { realName: 'variables', label: i18n._('Variables'),