diff --git a/awx/ui/client/src/access/add-rbac-user-team/rbac-selected-list.directive.js b/awx/ui/client/src/access/add-rbac-user-team/rbac-selected-list.directive.js index eb67bb30f5..f25d7463e1 100644 --- a/awx/ui/client/src/access/add-rbac-user-team/rbac-selected-list.directive.js +++ b/awx/ui/client/src/access/add-rbac-user-team/rbac-selected-list.directive.js @@ -42,7 +42,8 @@ export default ['$compile', 'i18n', 'generateList', name: list.fields.name, scm_type: list.fields.scm_type }; - list.fields.name.ngClick = 'linkoutResource("project", project)'; + delete list.fields.name.ngClick; + list.fields.name.ngHref = "#/projects/{{project.id}}"; list.fields.name.columnClass = 'col-md-5 col-sm-5 col-xs-10'; list.fields.scm_type.columnClass = 'col-md-5 col-sm-5 hidden-xs'; break; @@ -51,7 +52,8 @@ export default ['$compile', 'i18n', 'generateList', name: list.fields.name, organization: list.fields.organization }; - list.fields.name.ngClick = 'linkoutResource("inventory", inventory)'; + delete list.fields.name.ngClick; + list.fields.name.ngHref = '{{inventory.linkToDetails}}'; list.fields.name.columnClass = 'col-md-5 col-sm-5 col-xs-10'; list.fields.organization.columnClass = 'col-md-5 col-sm-5 hidden-xs'; break; @@ -62,7 +64,8 @@ export default ['$compile', 'i18n', 'generateList', name: list.fields.name }; list.fields.name.columnClass = 'col-md-5 col-sm-5 col-xs-10'; - list.fields.name.ngClick = 'linkoutResource("job_template", job_template)'; + delete list.fields.name.ngClick; + list.fields.name.ngHref = "#/templates/job_template/{{job_template.id}}"; break; case 'workflow_templates': list.name = 'workflow_job_templates'; @@ -71,20 +74,23 @@ export default ['$compile', 'i18n', 'generateList', name: list.fields.name }; list.fields.name.columnClass = 'col-md-5 col-sm-5 col-xs-10'; - list.fields.name.ngClick = 'linkoutResource("workflow_job_template", workflow_job_template)'; + delete list.fields.name.ngClick; + list.fields.name.ngHref = "#/templates/workflow_job_template/{{workflow_template.id}}"; break; case 'credentials': list.fields = { name: list.fields.name }; - list.fields.name.ngClick = 'linkoutResource("credential", credential)'; + delete list.fields.name.ngClick; + list.fields.name.ngHref = "#/credentials/{{credential.id}}"; list.fields.name.columnClass = 'col-md-5 col-sm-5 col-xs-10'; break; case 'organizations': list.fields = { name: list.fields.name }; - list.fields.name.ngClick = 'linkoutResource("organization", organization)'; + delete list.fields.name.ngClick; + list.fields.name.ngHref = "#/organizations/{{organization.id}}"; list.fields.name.columnClass = 'col-md-5 col-sm-5 col-xs-10'; break; } @@ -118,6 +124,24 @@ export default ['$compile', 'i18n', 'generateList', scope[list.name] = _.values(scope.collection); }); + scope.$watch(list.name, function(){ + if(scope.list.name === 'inventories') { + if (scope[list.name] !== undefined) { + scope[list.name].forEach(function(item, item_idx) { + var itm = scope[list.name][item_idx]; + + if(itm.kind && itm.kind === "smart") { + itm.linkToDetails = `#/inventories/smart/${itm.id}`; + } + else { + itm.linkToDetails = `#/inventories/inventory/${itm.id}`; + } + + }); + } + } + }); + scope.removeSelection = function(resource, type){ let multiselect_scope, deselectedIdx; diff --git a/awx/ui/client/src/access/rbac-multiselect/rbac-multiselect-list.directive.js b/awx/ui/client/src/access/rbac-multiselect/rbac-multiselect-list.directive.js index 5f1bbaf5a0..aa170576f7 100644 --- a/awx/ui/client/src/access/rbac-multiselect/rbac-multiselect-list.directive.js +++ b/awx/ui/client/src/access/rbac-multiselect/rbac-multiselect-list.directive.js @@ -46,7 +46,8 @@ export default ['addPermissionsTeamsList', 'addPermissionsUsersList', 'TemplateL name: list.fields.name, scm_type: list.fields.scm_type }; - list.fields.name.ngClick = 'linkoutResource("project", project)'; + delete list.fields.name.ngClick; + list.fields.name.ngHref = "#/projects/{{project.id}}"; list.fields.name.columnClass = 'col-md-6 col-sm-6 col-xs-11'; list.fields.scm_type.columnClass = 'col-md-5 col-sm-5 hidden-xs'; break; @@ -56,7 +57,8 @@ export default ['addPermissionsTeamsList', 'addPermissionsUsersList', 'TemplateL name: list.fields.name, organization: list.fields.organization }; - list.fields.name.ngClick = 'linkoutResource("inventory", inventory)'; + delete list.fields.name.ngClick; + list.fields.name.ngHref = '{{inventory.linkToDetails}}'; list.fields.name.columnClass = 'col-md-6 col-sm-6 col-xs-11'; list.fields.organization.columnClass = 'col-md-5 col-sm-5 hidden-xs'; delete list.disableRow; @@ -69,7 +71,8 @@ export default ['addPermissionsTeamsList', 'addPermissionsUsersList', 'TemplateL list.fields = { name: list.fields.name }; - list.fields.name.ngClick = 'linkoutResource("job_template", job_template)'; + delete list.fields.name.ngClick; + list.fields.name.ngHref = "#/templates/job_template/{{job_template.id}}"; list.fields.name.columnClass = 'col-md-6 col-sm-6 col-xs-11'; break; @@ -80,7 +83,8 @@ export default ['addPermissionsTeamsList', 'addPermissionsUsersList', 'TemplateL list.fields = { name: list.fields.name }; - list.fields.name.ngClick = 'linkoutResource("workflow_job_template", workflow_template)'; + delete list.fields.name.ngClick; + list.fields.name.ngHref = "#/templates/workflow_job_template/{{workflow_template.id}}"; list.fields.name.columnClass = 'col-md-6 col-sm-6 col-xs-11'; break; case 'Users': @@ -89,7 +93,8 @@ export default ['addPermissionsTeamsList', 'addPermissionsUsersList', 'TemplateL first_name: list.fields.first_name, last_name: list.fields.last_name }; - list.fields.username.ngClick = 'linkoutResource("user", user)'; + delete list.fields.username.ngClick; + list.fields.username.ngHref = "#/users/{{user.id}}"; list.fields.username.columnClass = 'col-md-5 col-sm-5 col-xs-11'; list.fields.first_name.columnClass = 'col-md-3 col-sm-3 hidden-xs'; list.fields.last_name.columnClass = 'col-md-3 col-sm-3 hidden-xs'; @@ -99,7 +104,8 @@ export default ['addPermissionsTeamsList', 'addPermissionsUsersList', 'TemplateL name: list.fields.name, organization: list.fields.organization, }; - list.fields.name.ngClick = 'linkoutResource("team", team)'; + delete list.fields.name.ngClick; + list.fields.name.ngHref = "#/teams/{{team.id}}"; list.fields.name.columnClass = 'col-md-6 col-sm-6 col-xs-11'; list.fields.organization.columnClass = 'col-md-5 col-sm-5 hidden-xs'; break; @@ -107,14 +113,16 @@ export default ['addPermissionsTeamsList', 'addPermissionsUsersList', 'TemplateL list.fields = { name: list.fields.name }; - list.fields.name.ngClick = 'linkoutResource("organization", organization)'; + delete list.fields.name.ngClick; + list.fields.name.ngHref = "#/organizations/{{organization.id}}"; list.fields.name.columnClass = 'col-md-6 col-sm-6 col-xs-11'; break; case 'Credentials': list.fields = { name: list.fields.name }; - list.fields.name.ngClick = 'linkoutResource("credential", credential)'; + delete list.fields.name.ngClick; + list.fields.name.ngHref = "#/credentials/{{credential.id}}"; list.fields.name.columnClass = 'col-md-6 col-sm-6 col-xs-11'; break; default: @@ -173,6 +181,20 @@ export default ['addPermissionsTeamsList', 'addPermissionsUsersList', 'TemplateL }); } } + else if(scope.list.name === 'inventories') { + if (scope[list.name] !== undefined) { + scope[list.name].forEach(function(item, item_idx) { + var itm = scope[list.name][item_idx]; + + if(itm.kind && itm.kind === "smart") { + itm.linkToDetails = `#/inventories/smart/${itm.id}`; + } + else { + itm.linkToDetails = `#/inventories/inventory/${itm.id}`; + } + }); + } + } } function isSelected(item){ @@ -184,6 +206,7 @@ export default ['addPermissionsTeamsList', 'addPermissionsUsersList', 'TemplateL }); return item; } + element.append(list_html); $compile(element.contents())(scope); diff --git a/awx/ui/client/src/inventories-hosts/hosts/hosts.partial.html b/awx/ui/client/src/inventories-hosts/hosts/hosts.partial.html index 3eef5ad07d..acc6f585cd 100644 --- a/awx/ui/client/src/inventories-hosts/hosts/hosts.partial.html +++ b/awx/ui/client/src/inventories-hosts/hosts/hosts.partial.html @@ -64,12 +64,12 @@
- {{host.name }} + {{host.name }}
- {{host.inventory_name }} + {{host.inventory_name}}
diff --git a/awx/ui/client/src/inventories-hosts/inventories/inventory.list.js b/awx/ui/client/src/inventories-hosts/inventories/inventory.list.js index 267dcc20ea..f675fd57ff 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/inventory.list.js +++ b/awx/ui/client/src/inventories-hosts/inventories/inventory.list.js @@ -49,7 +49,7 @@ export default ['i18n', function(i18n) { modalColumnClass: 'col-md-12', awToolTip: "{{ inventory.description | sanitize }}", awTipPlacement: "top", - ngClick: 'editInventory(inventory)' + uiSref: '{{inventory.linkToDetails}}' }, kind: { label: i18n._('Type'), diff --git a/awx/ui/client/src/inventories-hosts/inventories/list/inventory-list.controller.js b/awx/ui/client/src/inventories-hosts/inventories/list/inventory-list.controller.js index f55bd351e0..7031611f3a 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/list/inventory-list.controller.js +++ b/awx/ui/client/src/inventories-hosts/inventories/list/inventory-list.controller.js @@ -67,6 +67,8 @@ function InventoriesList($scope, } inventory.kind_label = inventory.kind === '' ? 'Inventory' : (inventory.kind === 'smart' ? i18n._('Smart Inventory'): i18n._('Inventory')); + + inventory.linkToDetails = (inventory.kind && inventory.kind === 'smart') ? `inventories.editSmartInventory({smartinventory_id:${inventory.id}})` : `inventories.edit({inventory_id:${inventory.id}})`; } $scope.editInventory = function (inventory) { diff --git a/awx/ui/client/src/inventories-hosts/inventories/related/completed-jobs/completed-jobs.list.js b/awx/ui/client/src/inventories-hosts/inventories/related/completed-jobs/completed-jobs.list.js index c0987adc2b..6b5e86d27c 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/related/completed-jobs/completed-jobs.list.js +++ b/awx/ui/client/src/inventories-hosts/inventories/related/completed-jobs/completed-jobs.list.js @@ -31,12 +31,12 @@ export default ['i18n', function(i18n) { dataTitle: "{{ completed_job.status_popover_title }}", icon: 'icon-job-{{ completed_job.status }}', iconOnly: true, - ngClick:"viewjobResults(completed_job)", + uiSref: '{{completed_job.linkToDetails}}', nosort: true }, id: { label: i18n._('ID'), - ngClick:"viewjobResults(completed_job)", + uiSref: '{{completed_job.linkToDetails}}', columnClass: 'col-lg-1 col-md-1 col-sm-2 col-xs-2 List-staticColumnAdjacent', awToolTip: "{{ completed_job.status_tip }}", dataPlacement: 'top' @@ -44,7 +44,7 @@ export default ['i18n', function(i18n) { name: { label: i18n._('Name'), columnClass: 'col-lg-4 col-md-4 col-sm-4 col-xs-6', - ngClick: "viewjobResults(completed_job)", + uiSref: '{{completed_job.linkToDetails}}', awToolTip: "{{ completed_job.name | sanitize }}", dataPlacement: 'top' }, diff --git a/awx/ui/client/src/inventories-hosts/inventories/related/groups/groups.list.js b/awx/ui/client/src/inventories-hosts/inventories/related/groups/groups.list.js index 1c71d327cb..5a5c048145 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/related/groups/groups.list.js +++ b/awx/ui/client/src/inventories-hosts/inventories/related/groups/groups.list.js @@ -31,7 +31,7 @@ name: { label: i18n._('Groups'), key: true, - ngClick: "goToGroupGroups(group.id)", + uiSref: "inventories.edit.groups.edit({group_id:group.id})", columnClass: 'col-lg-6 col-md-6 col-sm-6 col-xs-6', class: 'InventoryManage-breakWord', } diff --git a/awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-groups/group-nested-groups.list.js b/awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-groups/group-nested-groups.list.js index 8e738f1d37..cd920675cf 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-groups/group-nested-groups.list.js +++ b/awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-groups/group-nested-groups.list.js @@ -31,7 +31,7 @@ name: { label: i18n._('Groups'), key: true, - ngClick: "goToGroupGroups(nested_group.id)", + uiSref: "inventories.edit.groups.edit.nested_groups({group_id:nested_group.id)}", columnClass: 'col-lg-6 col-md-6 col-sm-6 col-xs-6', class: 'InventoryManage-breakWord', } diff --git a/awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-hosts/group-nested-hosts.list.js b/awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-hosts/group-nested-hosts.list.js index 1bf4c01fa5..c3a7aef417 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-hosts/group-nested-hosts.list.js +++ b/awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-hosts/group-nested-hosts.list.js @@ -55,7 +55,7 @@ export default ['i18n', function(i18n) { name: { key: true, label: i18n._('Hosts'), - ngClick: "editHost(nested_host.id)", + uiSref: "inventories.edit.hosts.edit({host_id: nested_host.id})", ngClass: "{ 'host-disabled-label': !nested_host.enabled }", columnClass: 'col-lg-6 col-md-8 col-sm-8 col-xs-7', dataHostId: "{{ nested_host.id }}", diff --git a/awx/ui/client/src/inventories-hosts/inventories/related/hosts/related-host.list.js b/awx/ui/client/src/inventories-hosts/inventories/related/hosts/related-host.list.js index 09fb976e35..24262c1017 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/related/hosts/related-host.list.js +++ b/awx/ui/client/src/inventories-hosts/inventories/related/hosts/related-host.list.js @@ -54,7 +54,7 @@ export default ['i18n', function(i18n) { name: { key: true, label: i18n._('Hosts'), - ngClick: "editHost(host)", + uiSref: ".edit({inventory_id: host.inventory_id,host_id: host.id})", ngClass: "{ 'host-disabled-label': !host.enabled }", columnClass: 'col-lg-6 col-md-8 col-sm-8 col-xs-7', dataHostId: "{{ host.id }}", diff --git a/awx/ui/client/src/inventories-hosts/inventories/related/sources/sources.list.js b/awx/ui/client/src/inventories-hosts/inventories/related/sources/sources.list.js index 5e23b595da..d2daa6b571 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/related/sources/sources.list.js +++ b/awx/ui/client/src/inventories-hosts/inventories/related/sources/sources.list.js @@ -33,7 +33,7 @@ name: { label: i18n._('Sources'), key: true, - ngClick: "editSource(inventory_source.id)", + uiSref: "inventories.edit.inventory_sources.edit({inventory_source_id:inventory_source.id})", columnClass: 'col-lg-4 col-md-4 col-sm-4 col-xs-4', class: 'InventoryManage-breakWord', }, diff --git a/awx/ui/client/src/jobs/all-jobs.list.js b/awx/ui/client/src/jobs/all-jobs.list.js index f0f3f4fe70..bc5b9e6657 100644 --- a/awx/ui/client/src/jobs/all-jobs.list.js +++ b/awx/ui/client/src/jobs/all-jobs.list.js @@ -28,12 +28,11 @@ export default ['i18n', function(i18n) { dataTitle: "{{ job.status_popover_title }}", icon: 'icon-job-{{ job.status }}', iconOnly: true, - ngClick:"viewjobResults(job)", + uiSref: '{{job.linkToDetails}}', nosort: true }, id: { label: 'ID', - ngClick:"viewjobResults(job)", columnClass: 'col-lg-1 col-md-1 col-sm-2 col-xs-2 List-staticColumnAdjacent', awToolTip: "{{ job.status_tip }}", dataPlacement: 'top', @@ -42,7 +41,7 @@ export default ['i18n', function(i18n) { name: { label: i18n._('Name'), columnClass: 'col-lg-2 col-md-3 col-sm-4 col-xs-6', - ngClick: "viewjobResults(job)", + uiSref: '{{job.linkToDetails}}', badgePlacement: 'right', badgeCustom: true, badgeIcon: `

- {{ card.name }} + + {{ card.name }} +