From 92c9b786f4145f58a78e51c18a6038d6f5e540d1 Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Tue, 20 Jun 2017 17:27:23 -0400 Subject: [PATCH 1/3] Removed copy/move in favor of associate and disassociate. Re-organized the inventories directory. --- .../factories/build-anchor.factory.js | 6 +- awx/ui/client/src/app.js | 4 +- .../hosts/edit/host-edit.controller.js | 6 +- .../hosts/edit/main.js | 0 .../hosts/host.form.js | 0 .../hosts/host.list.js | 0 .../hosts/hosts.partial.html | 0 .../hosts/list/host-list.controller.js | 8 +- .../hosts/list/main.js | 0 .../src/inventories-hosts/hosts/main.js | 112 ++++++++++ .../hosts-related-groups-associate.route.js | 33 +++ .../hosts-related-groups.controller.js} | 16 +- .../groups/hosts-related-groups.list.js} | 2 +- .../groups/hosts-related-groups.partial.html} | 5 +- .../groups/hosts-related-groups.route.js} | 22 +- .../hosts/related/groups/main.js | 14 ++ .../adhoc/adhoc-credential.route.js | 0 .../inventories/adhoc/adhoc.controller.js | 0 .../inventories/adhoc/adhoc.form.js | 0 .../inventories/adhoc/adhoc.partial.html | 0 .../inventories/adhoc/adhoc.route.js | 6 +- .../inventories/adhoc/main.js | 0 .../inventories/insights/insights.block.less | 2 +- .../insights/insights.controller.js | 0 .../insights/insights.partial.html | 0 .../inventories/insights/insights.route.js | 6 +- .../inventories/insights/insights.service.js | 0 .../inventories/insights/main.js | 0 .../inventories/insights/plan-filter.js | 0 .../inventories/inventories.block.less | 0 .../inventories/inventories.partial.html | 1 - .../inventories/inventories.route.js | 6 +- .../inventories/inventory.list.js | 0 .../host-summary-popover.block.less | 0 .../host-summary-popover.controller.js | 0 .../host-summary-popover.directive.js | 2 +- .../host-summary-popover.partial.html | 0 .../list/host-summary-popover/main.js | 0 .../list/inventory-list.controller.js | 0 .../inventories/list/main.js | 0 .../list/source-summary-popover/main.js | 0 .../source-summary-popover.controller.js | 0 .../source-summary-popover.directive.js | 2 +- .../source-summary-popover.partial.html | 0 .../inventories/main.js | 204 ++++-------------- .../completed-jobs/completed-jobs.list.js} | 0 .../completed-jobs/completed-jobs.route.js} | 2 +- .../related/completed-jobs}/main.js | 2 +- .../groups/add/groups-add.controller.js | 8 +- .../related}/groups/add/groups-add.route.js | 2 +- .../inventories/related}/groups/add/main.js | 0 .../groups/edit/groups-edit.controller.js | 6 +- .../related}/groups/edit/groups-edit.route.js | 4 +- .../inventories/related}/groups/edit/main.js | 0 .../factories/get-hosts-status-msg.factory.js | 0 .../related}/groups/groups.form.js | 0 .../related}/groups/groups.list.js | 39 +--- .../groups/list/groups-list.controller.js | 14 +- .../groups/list/groups-list.partial.html | 0 .../related}/groups/list/groups-list.route.js | 10 +- .../inventories/related}/groups/list/main.js | 0 .../inventories/related}/groups/main.js | 8 +- .../group-nested-groups-add.controller.js} | 8 +- .../group-nested-groups-add.route.js} | 2 +- .../group-nested-groups-associate.route.js | 33 +++ ...up-nested-groups-disassociate.partial.html | 35 +++ .../group-nested-groups-list.controller.js} | 52 ++++- .../group-nested-groups.form.js} | 0 .../group-nested-groups.list.js} | 61 ++---- .../group-nested-groups.route.js} | 28 ++- .../groups/related}/nested-groups/main.js | 10 +- .../group-nested-hosts-add.controller.js | 52 +++++ .../group-nested-hosts-add.route.js} | 4 +- .../group-nested-hosts-associate.route.js | 33 +++ ...oup-nested-hosts-disassociate.partial.html | 35 +++ .../group-nested-hosts-list.controller.js} | 77 +++---- .../nested-hosts/group-nested-hosts.form.js} | 7 - .../nested-hosts/group-nested-hosts.list.js} | 49 +++-- .../nested-hosts/group-nested-hosts.route.js} | 17 +- .../groups/related}/nested-hosts/main.js | 8 +- .../related/hosts}/add/host-add.controller.js | 15 +- .../related/hosts}/add/host-add.route.js | 2 +- .../inventories/related/hosts}/add/main.js | 0 .../hosts}/edit/host-edit.controller.js | 6 +- .../related/hosts}/edit/host-edit.route.js | 9 +- .../inventories/related/hosts}/edit/main.js | 0 .../hosts}/list/host-list.controller.js | 14 +- .../inventories/related/hosts}/list/main.js | 0 .../inventories/related/hosts}/main.js | 4 +- .../hosts}/related-groups-labels/main.js | 0 .../relatedGroupsLabelsList.block.less | 0 .../relatedGroupsLabelsList.directive.js | 2 +- .../relatedGroupsLabelsList.partial.html | 0 .../related/hosts}/related-host.form.js | 0 .../related/hosts}/related-host.list.js | 7 - .../related/hosts}/related-host.route.js | 12 +- .../host-nested-groups-associate.route.js | 33 +++ ...st-nested-groups-disassociate.partial.html | 35 +++ .../host-nested-groups-list.controller.js | 122 +++++++++++ .../nested-groups/host-nested-groups.list.js | 107 +++++++++ .../nested-groups/host-nested-groups.route.js | 79 +++++++ .../hosts/related/nested-groups/main.js | 13 ++ .../inventories/related}/sources/add/main.js | 0 .../sources/add/sources-add.controller.js | 4 +- .../related}/sources/add/sources-add.route.js | 6 +- .../inventories/related}/sources/edit/main.js | 0 .../sources/edit/sources-edit.controller.js | 4 +- .../sources/edit/sources-edit.route.js | 6 +- .../edit/sources-notifications.route.js | 2 +- .../factories/cancel-source-update.factory.js | 0 .../get-source-type-options.factory.js | 0 .../factories/get-sync-status-msg.factory.js | 0 .../factories/view-update-status.factory.js | 0 .../inventories/related}/sources/list/main.js | 0 .../schedule/sources-schedule-add.route.js | 4 +- .../schedule/sources-schedule-edit.route.js | 2 +- .../list/schedule/sources-schedule.route.js | 2 +- .../sources/list/sources-list.controller.js | 0 .../sources/list/sources-list.partial.html | 0 .../sources/list/sources-list.route.js | 14 +- .../lookup/sources-lookup-credential.route.js | 0 .../sources-lookup-inventory-script.route.js | 6 +- .../lookup/sources-lookup-project.route.js | 0 .../inventories/related}/sources/main.js | 0 .../related}/sources/sources.form.js | 0 .../related}/sources/sources.list.js | 7 - .../related}/sources/sources.service.js | 0 .../inventories/smart-inventory/add/main.js | 0 .../add/smart-inventory-add.controller.js | 0 .../inventories/smart-inventory/edit/main.js | 0 .../edit/smart-inventory-edit.controller.js | 0 .../inventories/smart-inventory/main.js | 0 .../host-filter-modal.block.less | 2 +- .../host-filter-modal.directive.js | 2 +- .../host-filter-modal.partial.html | 0 .../smart-inventory-host-filter.controller.js | 0 .../smart-inventory-host-filter.directive.js | 2 +- .../smart-inventory-host-filter.partial.html | 0 .../smart-inventory-hosts.route.js | 10 +- .../smart-inventory/smart-inventory.form.js | 0 .../add/inventory-add.controller.js | 0 .../standard-inventory}/add/main.js | 0 .../edit/inventory-edit.controller.js | 0 .../standard-inventory}/edit/main.js | 0 .../standard-inventory}/inventory.form.js | 0 .../inventories/standard-inventory}/main.js | 0 awx/ui/client/src/inventories-hosts/main.js | 16 ++ .../ansible-facts.controller.js} | 0 .../ansible-facts/ansible-facts.partial.html} | 0 .../ansible-facts/ansible-facts.route.js} | 6 +- .../shared/ansible-facts}/main.js | 2 +- .../associate-groups.block.less} | 4 +- .../associate-groups.controller.js} | 25 +-- .../associate-groups.directive.js | 60 ++++++ .../associate-groups.partial.html} | 8 +- .../associate-hosts.block.less | 14 ++ .../associate-hosts.controller.js | 106 +++++++++ .../associate-hosts.directive.js} | 18 +- .../associate-hosts.partial.html | 21 ++ .../factories}/set-enabled-msg.factory.js | 0 .../shared/factories}/set-status.factory.js | 0 .../shared}/groups.service.js | 18 ++ .../shared}/hosts.service.js | 31 +-- .../shared/inventories.service.js} | 0 .../src/inventories-hosts/shared/main.js | 26 +++ .../copy-move/copy-move-groups.controller.js | 78 ------- .../copy-move/copy-move-groups.list.js | 24 --- .../copy-move/copy-move-hosts.controller.js | 67 ------ .../copy-move/copy-move.block.less | 33 --- .../copy-move/copy-move.partial.html | 21 -- .../inventories/copy-move/copy-move.route.js | 98 --------- .../client/src/inventories/copy-move/main.js | 15 -- .../nested-hosts/nested-hosts-edit.route.js | 27 --- .../host-groups-associate.route.js | 46 ---- .../src/inventories/host-groups/main.js | 15 -- awx/ui/client/src/inventories/hosts/main.js | 25 --- awx/ui/client/src/shared/directives.js | 127 ----------- .../src/shared/stateDefinitions.factory.js | 6 +- .../manage/inventory-manage.service-test.js | 14 +- 179 files changed, 1393 insertions(+), 1154 deletions(-) rename awx/ui/client/src/{inventories => inventories-hosts}/hosts/edit/host-edit.controller.js (94%) rename awx/ui/client/src/{inventories => inventories-hosts}/hosts/edit/main.js (100%) rename awx/ui/client/src/{inventories => inventories-hosts}/hosts/host.form.js (100%) rename awx/ui/client/src/{inventories => inventories-hosts}/hosts/host.list.js (100%) rename awx/ui/client/src/{inventories => inventories-hosts}/hosts/hosts.partial.html (100%) rename awx/ui/client/src/{inventories => inventories-hosts}/hosts/list/host-list.controller.js (95%) rename awx/ui/client/src/{inventories => inventories-hosts}/hosts/list/main.js (100%) create mode 100644 awx/ui/client/src/inventories-hosts/hosts/main.js create mode 100644 awx/ui/client/src/inventories-hosts/hosts/related/groups/hosts-related-groups-associate.route.js rename awx/ui/client/src/{inventories/host-groups/host-groups.controller.js => inventories-hosts/hosts/related/groups/hosts-related-groups.controller.js} (83%) rename awx/ui/client/src/{inventories/host-groups/host-groups.list.js => inventories-hosts/hosts/related/groups/hosts-related-groups.list.js} (97%) rename awx/ui/client/src/{inventories/host-groups/host-groups.partial.html => inventories-hosts/hosts/related/groups/hosts-related-groups.partial.html} (88%) rename awx/ui/client/src/{inventories/host-groups/host-groups.route.js => inventories-hosts/hosts/related/groups/hosts-related-groups.route.js} (64%) create mode 100644 awx/ui/client/src/inventories-hosts/hosts/related/groups/main.js rename awx/ui/client/src/{ => inventories-hosts}/inventories/adhoc/adhoc-credential.route.js (100%) rename awx/ui/client/src/{ => inventories-hosts}/inventories/adhoc/adhoc.controller.js (100%) rename awx/ui/client/src/{ => inventories-hosts}/inventories/adhoc/adhoc.form.js (100%) rename awx/ui/client/src/{ => inventories-hosts}/inventories/adhoc/adhoc.partial.html (100%) rename awx/ui/client/src/{ => inventories-hosts}/inventories/adhoc/adhoc.route.js (72%) rename awx/ui/client/src/{ => inventories-hosts}/inventories/adhoc/main.js (100%) rename awx/ui/client/src/{ => inventories-hosts}/inventories/insights/insights.block.less (97%) rename awx/ui/client/src/{ => inventories-hosts}/inventories/insights/insights.controller.js (100%) rename awx/ui/client/src/{ => inventories-hosts}/inventories/insights/insights.partial.html (100%) rename awx/ui/client/src/{ => inventories-hosts}/inventories/insights/insights.route.js (91%) rename awx/ui/client/src/{ => inventories-hosts}/inventories/insights/insights.service.js (100%) rename awx/ui/client/src/{ => inventories-hosts}/inventories/insights/main.js (100%) rename awx/ui/client/src/{ => inventories-hosts}/inventories/insights/plan-filter.js (100%) rename awx/ui/client/src/{ => inventories-hosts}/inventories/inventories.block.less (100%) rename awx/ui/client/src/{ => inventories-hosts}/inventories/inventories.partial.html (96%) rename awx/ui/client/src/{ => inventories-hosts}/inventories/inventories.route.js (91%) rename awx/ui/client/src/{ => inventories-hosts}/inventories/inventory.list.js (100%) rename awx/ui/client/src/{ => inventories-hosts}/inventories/list/host-summary-popover/host-summary-popover.block.less (100%) rename awx/ui/client/src/{ => inventories-hosts}/inventories/list/host-summary-popover/host-summary-popover.controller.js (100%) rename awx/ui/client/src/{ => inventories-hosts}/inventories/list/host-summary-popover/host-summary-popover.directive.js (97%) rename awx/ui/client/src/{ => inventories-hosts}/inventories/list/host-summary-popover/host-summary-popover.partial.html (100%) rename awx/ui/client/src/{ => inventories-hosts}/inventories/list/host-summary-popover/main.js (100%) rename awx/ui/client/src/{ => inventories-hosts}/inventories/list/inventory-list.controller.js (100%) rename awx/ui/client/src/{ => inventories-hosts}/inventories/list/main.js (100%) rename awx/ui/client/src/{ => inventories-hosts}/inventories/list/source-summary-popover/main.js (100%) rename awx/ui/client/src/{ => inventories-hosts}/inventories/list/source-summary-popover/source-summary-popover.controller.js (100%) rename awx/ui/client/src/{ => inventories-hosts}/inventories/list/source-summary-popover/source-summary-popover.directive.js (97%) rename awx/ui/client/src/{ => inventories-hosts}/inventories/list/source-summary-popover/source-summary-popover.partial.html (100%) rename awx/ui/client/src/{ => inventories-hosts}/inventories/main.js (59%) rename awx/ui/client/src/{inventories/completed_jobs/completed_jobs.list.js => inventories-hosts/inventories/related/completed-jobs/completed-jobs.list.js} (100%) rename awx/ui/client/src/{inventories/completed_jobs/completed_jobs.route.js => inventories-hosts/inventories/related/completed-jobs/completed-jobs.route.js} (98%) rename awx/ui/client/src/{inventories/completed_jobs => inventories-hosts/inventories/related/completed-jobs}/main.js (86%) rename awx/ui/client/src/{inventories => inventories-hosts/inventories/related}/groups/add/groups-add.controller.js (86%) rename awx/ui/client/src/{inventories => inventories-hosts/inventories/related}/groups/add/groups-add.route.js (92%) rename awx/ui/client/src/{inventories => inventories-hosts/inventories/related}/groups/add/main.js (100%) rename awx/ui/client/src/{inventories => inventories-hosts/inventories/related}/groups/edit/groups-edit.controller.js (86%) rename awx/ui/client/src/{inventories => inventories-hosts/inventories/related}/groups/edit/groups-edit.route.js (74%) rename awx/ui/client/src/{inventories => inventories-hosts/inventories/related}/groups/edit/main.js (100%) rename awx/ui/client/src/{inventories => inventories-hosts/inventories/related}/groups/factories/get-hosts-status-msg.factory.js (100%) rename awx/ui/client/src/{inventories => inventories-hosts/inventories/related}/groups/groups.form.js (100%) rename awx/ui/client/src/{inventories => inventories-hosts/inventories/related}/groups/groups.list.js (67%) rename awx/ui/client/src/{inventories => inventories-hosts/inventories/related}/groups/list/groups-list.controller.js (91%) rename awx/ui/client/src/{inventories => inventories-hosts/inventories/related}/groups/list/groups-list.partial.html (100%) rename awx/ui/client/src/{inventories => inventories-hosts/inventories/related}/groups/list/groups-list.route.js (86%) rename awx/ui/client/src/{inventories => inventories-hosts/inventories/related}/groups/list/main.js (100%) rename awx/ui/client/src/{inventories => inventories-hosts/inventories/related}/groups/main.js (75%) rename awx/ui/client/src/{inventories/groups/nested-groups/nested-groups-add.controller.js => inventories-hosts/inventories/related/groups/related/nested-groups/group-nested-groups-add.controller.js} (85%) rename awx/ui/client/src/{inventories/groups/nested-groups/nested-groups-add.route.js => inventories-hosts/inventories/related/groups/related/nested-groups/group-nested-groups-add.route.js} (96%) create mode 100644 awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-groups/group-nested-groups-associate.route.js create mode 100644 awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-groups/group-nested-groups-disassociate.partial.html rename awx/ui/client/src/{inventories/groups/nested-groups/nested-groups-list.controller.js => inventories-hosts/inventories/related/groups/related/nested-groups/group-nested-groups-list.controller.js} (61%) rename awx/ui/client/src/{inventories/groups/nested-groups/nested-groups.form.js => inventories-hosts/inventories/related/groups/related/nested-groups/group-nested-groups.form.js} (100%) rename awx/ui/client/src/{inventories/groups/nested-groups/nested-groups.list.js => inventories-hosts/inventories/related/groups/related/nested-groups/group-nested-groups.list.js} (63%) rename awx/ui/client/src/{inventories/groups/nested-groups/nested-groups.route.js => inventories-hosts/inventories/related/groups/related/nested-groups/group-nested-groups.route.js} (71%) rename awx/ui/client/src/{inventories/groups => inventories-hosts/inventories/related/groups/related}/nested-groups/main.js (64%) create mode 100644 awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-hosts/group-nested-hosts-add.controller.js rename awx/ui/client/src/{inventories/groups/nested-hosts/nested-hosts-add.route.js => inventories-hosts/inventories/related/groups/related/nested-hosts/group-nested-hosts-add.route.js} (92%) create mode 100644 awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-hosts/group-nested-hosts-associate.route.js create mode 100644 awx/ui/client/src/inventories-hosts/inventories/related/groups/related/nested-hosts/group-nested-hosts-disassociate.partial.html rename awx/ui/client/src/{inventories/groups/nested-hosts/nested-hosts-list.controller.js => inventories-hosts/inventories/related/groups/related/nested-hosts/group-nested-hosts-list.controller.js} (64%) rename awx/ui/client/src/{inventories/groups/nested-hosts/nested-hosts.form.js => inventories-hosts/inventories/related/groups/related/nested-hosts/group-nested-hosts.form.js} (94%) rename awx/ui/client/src/{inventories/groups/nested-hosts/nested-hosts.list.js => inventories-hosts/inventories/related/groups/related/nested-hosts/group-nested-hosts.list.js} (76%) rename awx/ui/client/src/{inventories/groups/nested-hosts/nested-hosts.route.js => inventories-hosts/inventories/related/groups/related/nested-hosts/group-nested-hosts.route.js} (77%) rename awx/ui/client/src/{inventories/groups => inventories-hosts/inventories/related/groups/related}/nested-hosts/main.js (56%) rename awx/ui/client/src/{inventories/related-hosts => inventories-hosts/inventories/related/hosts}/add/host-add.controller.js (68%) rename awx/ui/client/src/{inventories/related-hosts => inventories-hosts/inventories/related/hosts}/add/host-add.route.js (93%) rename awx/ui/client/src/{inventories/related-hosts => inventories-hosts/inventories/related/hosts}/add/main.js (100%) rename awx/ui/client/src/{inventories/related-hosts => inventories-hosts/inventories/related/hosts}/edit/host-edit.controller.js (93%) rename awx/ui/client/src/{inventories/related-hosts => inventories-hosts/inventories/related/hosts}/edit/host-edit.route.js (65%) rename awx/ui/client/src/{inventories/related-hosts => inventories-hosts/inventories/related/hosts}/edit/main.js (100%) rename awx/ui/client/src/{inventories/related-hosts => inventories-hosts/inventories/related/hosts}/list/host-list.controller.js (93%) rename awx/ui/client/src/{inventories/related-hosts => inventories-hosts/inventories/related/hosts}/list/main.js (100%) rename awx/ui/client/src/{inventories/related-hosts => inventories-hosts/inventories/related/hosts}/main.js (86%) rename awx/ui/client/src/{inventories/related-hosts => inventories-hosts/inventories/related/hosts}/related-groups-labels/main.js (100%) rename awx/ui/client/src/{inventories/related-hosts => inventories-hosts/inventories/related/hosts}/related-groups-labels/relatedGroupsLabelsList.block.less (100%) rename awx/ui/client/src/{inventories/related-hosts => inventories-hosts/inventories/related/hosts}/related-groups-labels/relatedGroupsLabelsList.directive.js (97%) rename awx/ui/client/src/{inventories/related-hosts => inventories-hosts/inventories/related/hosts}/related-groups-labels/relatedGroupsLabelsList.partial.html (100%) rename awx/ui/client/src/{inventories/related-hosts => inventories-hosts/inventories/related/hosts}/related-host.form.js (100%) rename awx/ui/client/src/{inventories/related-hosts => inventories-hosts/inventories/related/hosts}/related-host.list.js (95%) rename awx/ui/client/src/{inventories/related-hosts => inventories-hosts/inventories/related/hosts}/related-host.route.js (85%) create mode 100644 awx/ui/client/src/inventories-hosts/inventories/related/hosts/related/nested-groups/host-nested-groups-associate.route.js create mode 100644 awx/ui/client/src/inventories-hosts/inventories/related/hosts/related/nested-groups/host-nested-groups-disassociate.partial.html create mode 100644 awx/ui/client/src/inventories-hosts/inventories/related/hosts/related/nested-groups/host-nested-groups-list.controller.js create mode 100644 awx/ui/client/src/inventories-hosts/inventories/related/hosts/related/nested-groups/host-nested-groups.list.js create mode 100644 awx/ui/client/src/inventories-hosts/inventories/related/hosts/related/nested-groups/host-nested-groups.route.js create mode 100644 awx/ui/client/src/inventories-hosts/inventories/related/hosts/related/nested-groups/main.js rename awx/ui/client/src/{inventories => inventories-hosts/inventories/related}/sources/add/main.js (100%) rename awx/ui/client/src/{inventories => inventories-hosts/inventories/related}/sources/add/sources-add.controller.js (98%) rename awx/ui/client/src/{inventories => inventories-hosts/inventories/related}/sources/add/sources-add.route.js (74%) rename awx/ui/client/src/{inventories => inventories-hosts/inventories/related}/sources/edit/main.js (100%) rename awx/ui/client/src/{inventories => inventories-hosts/inventories/related}/sources/edit/sources-edit.controller.js (99%) rename awx/ui/client/src/{inventories => inventories-hosts/inventories/related}/sources/edit/sources-edit.route.js (79%) rename awx/ui/client/src/{inventories => inventories-hosts/inventories/related}/sources/edit/sources-notifications.route.js (98%) rename awx/ui/client/src/{inventories => inventories-hosts/inventories/related}/sources/factories/cancel-source-update.factory.js (100%) rename awx/ui/client/src/{inventories => inventories-hosts/inventories/related}/sources/factories/get-source-type-options.factory.js (100%) rename awx/ui/client/src/{inventories => inventories-hosts/inventories/related}/sources/factories/get-sync-status-msg.factory.js (100%) rename awx/ui/client/src/{inventories => inventories-hosts/inventories/related}/sources/factories/view-update-status.factory.js (100%) rename awx/ui/client/src/{inventories => inventories-hosts/inventories/related}/sources/list/main.js (100%) rename awx/ui/client/src/{inventories => inventories-hosts/inventories/related}/sources/list/schedule/sources-schedule-add.route.js (71%) rename awx/ui/client/src/{inventories => inventories-hosts/inventories/related}/sources/list/schedule/sources-schedule-edit.route.js (79%) rename awx/ui/client/src/{inventories => inventories-hosts/inventories/related}/sources/list/schedule/sources-schedule.route.js (98%) rename awx/ui/client/src/{inventories => inventories-hosts/inventories/related}/sources/list/sources-list.controller.js (100%) rename awx/ui/client/src/{inventories => inventories-hosts/inventories/related}/sources/list/sources-list.partial.html (100%) rename awx/ui/client/src/{inventories => inventories-hosts/inventories/related}/sources/list/sources-list.route.js (80%) rename awx/ui/client/src/{inventories => inventories-hosts/inventories/related}/sources/lookup/sources-lookup-credential.route.js (100%) rename awx/ui/client/src/{inventories => inventories-hosts/inventories/related}/sources/lookup/sources-lookup-inventory-script.route.js (86%) rename awx/ui/client/src/{inventories => inventories-hosts/inventories/related}/sources/lookup/sources-lookup-project.route.js (100%) rename awx/ui/client/src/{inventories => inventories-hosts/inventories/related}/sources/main.js (100%) rename awx/ui/client/src/{inventories => inventories-hosts/inventories/related}/sources/sources.form.js (100%) rename awx/ui/client/src/{inventories => inventories-hosts/inventories/related}/sources/sources.list.js (94%) rename awx/ui/client/src/{inventories => inventories-hosts/inventories/related}/sources/sources.service.js (100%) rename awx/ui/client/src/{ => inventories-hosts}/inventories/smart-inventory/add/main.js (100%) rename awx/ui/client/src/{ => inventories-hosts}/inventories/smart-inventory/add/smart-inventory-add.controller.js (100%) rename awx/ui/client/src/{ => inventories-hosts}/inventories/smart-inventory/edit/main.js (100%) rename awx/ui/client/src/{ => inventories-hosts}/inventories/smart-inventory/edit/smart-inventory-edit.controller.js (100%) rename awx/ui/client/src/{ => inventories-hosts}/inventories/smart-inventory/main.js (100%) rename awx/ui/client/src/{ => inventories-hosts}/inventories/smart-inventory/smart-inventory-host-filter/host-filter-modal/host-filter-modal.block.less (53%) rename awx/ui/client/src/{ => inventories-hosts}/inventories/smart-inventory/smart-inventory-host-filter/host-filter-modal/host-filter-modal.directive.js (95%) rename awx/ui/client/src/{ => inventories-hosts}/inventories/smart-inventory/smart-inventory-host-filter/host-filter-modal/host-filter-modal.partial.html (100%) rename awx/ui/client/src/{ => inventories-hosts}/inventories/smart-inventory/smart-inventory-host-filter/smart-inventory-host-filter.controller.js (100%) rename awx/ui/client/src/{ => inventories-hosts}/inventories/smart-inventory/smart-inventory-host-filter/smart-inventory-host-filter.directive.js (84%) rename awx/ui/client/src/{ => inventories-hosts}/inventories/smart-inventory/smart-inventory-host-filter/smart-inventory-host-filter.partial.html (100%) rename awx/ui/client/src/{ => inventories-hosts}/inventories/smart-inventory/smart-inventory-hosts.route.js (82%) rename awx/ui/client/src/{ => inventories-hosts}/inventories/smart-inventory/smart-inventory.form.js (100%) rename awx/ui/client/src/{inventories/standard => inventories-hosts/inventories/standard-inventory}/add/inventory-add.controller.js (100%) rename awx/ui/client/src/{inventories/standard => inventories-hosts/inventories/standard-inventory}/add/main.js (100%) rename awx/ui/client/src/{inventories/standard => inventories-hosts/inventories/standard-inventory}/edit/inventory-edit.controller.js (100%) rename awx/ui/client/src/{inventories/standard => inventories-hosts/inventories/standard-inventory}/edit/main.js (100%) rename awx/ui/client/src/{inventories/standard => inventories-hosts/inventories/standard-inventory}/inventory.form.js (100%) rename awx/ui/client/src/{inventories/standard => inventories-hosts/inventories/standard-inventory}/main.js (100%) create mode 100644 awx/ui/client/src/inventories-hosts/main.js rename awx/ui/client/src/{inventories/ansible_facts/ansible_facts.controller.js => inventories-hosts/shared/ansible-facts/ansible-facts.controller.js} (100%) rename awx/ui/client/src/{inventories/ansible_facts/ansible_facts.partial.html => inventories-hosts/shared/ansible-facts/ansible-facts.partial.html} (100%) rename awx/ui/client/src/{inventories/ansible_facts/ansible_facts.route.js => inventories-hosts/shared/ansible-facts/ansible-facts.route.js} (75%) rename awx/ui/client/src/{inventories/ansible_facts => inventories-hosts/shared/ansible-facts}/main.js (83%) rename awx/ui/client/src/{inventories/host-groups/host-groups-associate/host-groups-associate.block.less => inventories-hosts/shared/associate-groups/associate-groups.block.less} (76%) rename awx/ui/client/src/{inventories/host-groups/host-groups-associate/host-groups-associate.controller.js => inventories-hosts/shared/associate-groups/associate-groups.controller.js} (81%) create mode 100644 awx/ui/client/src/inventories-hosts/shared/associate-groups/associate-groups.directive.js rename awx/ui/client/src/{inventories/host-groups/host-groups-associate/host-groups-associate.partial.html => inventories-hosts/shared/associate-groups/associate-groups.partial.html} (64%) create mode 100644 awx/ui/client/src/inventories-hosts/shared/associate-hosts/associate-hosts.block.less create mode 100644 awx/ui/client/src/inventories-hosts/shared/associate-hosts/associate-hosts.controller.js rename awx/ui/client/src/{inventories/host-groups/host-groups-associate/host-groups-associate.directive.js => inventories-hosts/shared/associate-hosts/associate-hosts.directive.js} (70%) create mode 100644 awx/ui/client/src/inventories-hosts/shared/associate-hosts/associate-hosts.partial.html rename awx/ui/client/src/{inventories/hosts => inventories-hosts/shared/factories}/set-enabled-msg.factory.js (100%) rename awx/ui/client/src/{inventories/hosts => inventories-hosts/shared/factories}/set-status.factory.js (100%) rename awx/ui/client/src/{inventories/groups => inventories-hosts/shared}/groups.service.js (85%) rename awx/ui/client/src/{inventories/hosts => inventories-hosts/shared}/hosts.service.js (65%) rename awx/ui/client/src/{inventories/inventory-manage.service.js => inventories-hosts/shared/inventories.service.js} (100%) create mode 100644 awx/ui/client/src/inventories-hosts/shared/main.js delete mode 100644 awx/ui/client/src/inventories/copy-move/copy-move-groups.controller.js delete mode 100644 awx/ui/client/src/inventories/copy-move/copy-move-groups.list.js delete mode 100644 awx/ui/client/src/inventories/copy-move/copy-move-hosts.controller.js delete mode 100644 awx/ui/client/src/inventories/copy-move/copy-move.block.less delete mode 100644 awx/ui/client/src/inventories/copy-move/copy-move.partial.html delete mode 100644 awx/ui/client/src/inventories/copy-move/copy-move.route.js delete mode 100644 awx/ui/client/src/inventories/copy-move/main.js delete mode 100644 awx/ui/client/src/inventories/groups/nested-hosts/nested-hosts-edit.route.js delete mode 100644 awx/ui/client/src/inventories/host-groups/host-groups-associate/host-groups-associate.route.js delete mode 100644 awx/ui/client/src/inventories/host-groups/main.js delete mode 100644 awx/ui/client/src/inventories/hosts/main.js diff --git a/awx/ui/client/src/activity-stream/factories/build-anchor.factory.js b/awx/ui/client/src/activity-stream/factories/build-anchor.factory.js index f3ccd0b9b0..914b22c53a 100644 --- a/awx/ui/client/src/activity-stream/factories/build-anchor.factory.js +++ b/awx/ui/client/src/activity-stream/factories/build-anchor.factory.js @@ -20,14 +20,14 @@ export default function BuildAnchor($log, $filter) { if (activity.operation === 'create' || activity.operation === 'delete'){ // the API formats the changes.inventory field as str 'myInventoryName-PrimaryKey' var inventory_id = _.last(activity.changes.inventory.split('-')); - url += 'inventories/' + inventory_id + '/manage?group=' + activity.changes.id; + url += 'inventories/' + inventory_id + '/groups/edit/' + activity.changes.id; } else { - url += 'inventories/' + activity.summary_fields.inventory[0].id + '/manage?group=' + (activity.changes.id || activity.changes.object1_pk); + url += 'inventories/' + activity.summary_fields.inventory[0].id + '/groups/edit/' + (activity.changes.id || activity.changes.object1_pk); } break; case 'host': - url += 'home/hosts/' + obj.id; + url += 'hosts/' + obj.id; break; case 'job': url += 'jobs/' + obj.id; diff --git a/awx/ui/client/src/app.js b/awx/ui/client/src/app.js index e367c4d935..ccbf9b04ef 100644 --- a/awx/ui/client/src/app.js +++ b/awx/ui/client/src/app.js @@ -39,7 +39,7 @@ if ($basePath) { // Modules import portalMode from './portal-mode/main'; import systemTracking from './system-tracking/main'; -import inventories from './inventories/main'; +import inventoriesHosts from './inventories-hosts/main'; import inventoryScripts from './inventory-scripts/main'; import credentials from './credentials/main'; import credentialTypes from './credential-types/main'; @@ -104,7 +104,7 @@ var tower = angular.module('Tower', [ browserData.name, configuration.name, systemTracking.name, - inventories.name, + inventoriesHosts.name, inventoryScripts.name, credentials.name, credentialTypes.name, diff --git a/awx/ui/client/src/inventories/hosts/edit/host-edit.controller.js b/awx/ui/client/src/inventories-hosts/hosts/edit/host-edit.controller.js similarity index 94% rename from awx/ui/client/src/inventories/hosts/edit/host-edit.controller.js rename to awx/ui/client/src/inventories-hosts/hosts/edit/host-edit.controller.js index f467e8c62f..3cd6a00c28 100644 --- a/awx/ui/client/src/inventories/hosts/edit/host-edit.controller.js +++ b/awx/ui/client/src/inventories-hosts/hosts/edit/host-edit.controller.js @@ -5,8 +5,8 @@ *************************************************/ export default - ['$scope', '$state', '$stateParams', 'GenerateForm', 'ParseTypeChange', 'HostManageService', 'host', '$rootScope', - function($scope, $state, $stateParams, GenerateForm, ParseTypeChange, HostManageService, host, $rootScope){ + ['$scope', '$state', '$stateParams', 'GenerateForm', 'ParseTypeChange', 'HostsService', 'host', '$rootScope', + function($scope, $state, $stateParams, GenerateForm, ParseTypeChange, HostsService, host, $rootScope){ $scope.parseType = 'yaml'; $scope.formCancel = function(){ $state.go('^', null, {reload: true}); @@ -32,7 +32,7 @@ description: $scope.description, enabled: $scope.host.enabled }; - HostManageService.put(host).then(function(){ + HostsService.put(host).then(function(){ $state.go('.', null, {reload: true}); }); diff --git a/awx/ui/client/src/inventories/hosts/edit/main.js b/awx/ui/client/src/inventories-hosts/hosts/edit/main.js similarity index 100% rename from awx/ui/client/src/inventories/hosts/edit/main.js rename to awx/ui/client/src/inventories-hosts/hosts/edit/main.js diff --git a/awx/ui/client/src/inventories/hosts/host.form.js b/awx/ui/client/src/inventories-hosts/hosts/host.form.js similarity index 100% rename from awx/ui/client/src/inventories/hosts/host.form.js rename to awx/ui/client/src/inventories-hosts/hosts/host.form.js diff --git a/awx/ui/client/src/inventories/hosts/host.list.js b/awx/ui/client/src/inventories-hosts/hosts/host.list.js similarity index 100% rename from awx/ui/client/src/inventories/hosts/host.list.js rename to awx/ui/client/src/inventories-hosts/hosts/host.list.js diff --git a/awx/ui/client/src/inventories/hosts/hosts.partial.html b/awx/ui/client/src/inventories-hosts/hosts/hosts.partial.html similarity index 100% rename from awx/ui/client/src/inventories/hosts/hosts.partial.html rename to awx/ui/client/src/inventories-hosts/hosts/hosts.partial.html diff --git a/awx/ui/client/src/inventories/hosts/list/host-list.controller.js b/awx/ui/client/src/inventories-hosts/hosts/list/host-list.controller.js similarity index 95% rename from awx/ui/client/src/inventories/hosts/list/host-list.controller.js rename to awx/ui/client/src/inventories-hosts/hosts/list/host-list.controller.js index d88bfadeb3..3853d80462 100644 --- a/awx/ui/client/src/inventories/hosts/list/host-list.controller.js +++ b/awx/ui/client/src/inventories-hosts/hosts/list/host-list.controller.js @@ -7,7 +7,7 @@ function HostsList($scope, HostsList, $rootScope, GetBasePath, rbacUiControlService, Dataset, $state, $filter, Prompt, Wait, - HostManageService, SetStatus, canAdd) { + HostsService, SetStatus, canAdd) { let list = HostsList; @@ -73,7 +73,7 @@ function HostsList($scope, HostsList, $rootScope, GetBasePath, var action = function(){ delete $rootScope.promptActionBtnClass; Wait('start'); - HostManageService.delete(id).then(() => { + HostsService.delete(id).then(() => { $('#prompt-modal').modal('hide'); if (parseInt($state.params.host_id) === id) { $state.go("hosts", null, {reload: true}); @@ -102,7 +102,7 @@ function HostsList($scope, HostsList, $rootScope, GetBasePath, host.enabled = !host.enabled; - HostManageService.put(host).then(function(){ + HostsService.put(host).then(function(){ $state.go($state.current, null, {reload: true}); }); }; @@ -139,5 +139,5 @@ function HostsList($scope, HostsList, $rootScope, GetBasePath, export default ['$scope', 'HostsList', '$rootScope', 'GetBasePath', 'rbacUiControlService', 'Dataset', '$state', '$filter', 'Prompt', 'Wait', - 'HostManageService', 'SetStatus', 'canAdd', HostsList + 'HostsService', 'SetStatus', 'canAdd', HostsList ]; diff --git a/awx/ui/client/src/inventories/hosts/list/main.js b/awx/ui/client/src/inventories-hosts/hosts/list/main.js similarity index 100% rename from awx/ui/client/src/inventories/hosts/list/main.js rename to awx/ui/client/src/inventories-hosts/hosts/list/main.js diff --git a/awx/ui/client/src/inventories-hosts/hosts/main.js b/awx/ui/client/src/inventories-hosts/hosts/main.js new file mode 100644 index 0000000000..09a368a825 --- /dev/null +++ b/awx/ui/client/src/inventories-hosts/hosts/main.js @@ -0,0 +1,112 @@ +/************************************************* + * Copyright (c) 2017 Ansible, Inc. + * + * All Rights Reserved + *************************************************/ + + import hostEdit from './edit/main'; + import hostList from './list/main'; + import HostsList from './host.list'; + import HostsForm from './host.form'; + import { templateUrl } from '../../shared/template-url/template-url.factory'; + import { N_ } from '../../i18n'; + import ansibleFactsRoute from '../shared/ansible-facts/ansible-facts.route'; + import insightsRoute from '../inventories/insights/insights.route'; + import hostGroupsRoute from './related/groups/hosts-related-groups.route'; + import hostGroupsAssociateRoute from './related/groups/hosts-related-groups-associate.route'; + import hostGroups from './related/groups/main'; + +export default +angular.module('host', [ + hostEdit.name, + hostList.name, + hostGroups.name + ]) + .factory('HostsForm', HostsForm) + .factory('HostsList', HostsList) + .config(['$stateProvider', 'stateDefinitionsProvider', '$stateExtenderProvider', + function($stateProvider, stateDefinitionsProvider, $stateExtenderProvider) { + let stateDefinitions = stateDefinitionsProvider.$get(), + stateExtender = $stateExtenderProvider.$get(); + + let generateHostStates = function(){ + let hostTree = stateDefinitions.generateTree({ + parent: 'hosts', // top-most node in the generated tree (will replace this state definition) + modes: ['edit'], + list: 'HostsList', + form: 'HostsForm', + controllers: { + edit: 'HostEditController' + }, + breadcrumbs: { + edit: '{{breadcrumb.host_name}}' + }, + urls: { + list: '/hosts' + }, + data: { + activityStream: true, + activityStreamTarget: 'host' + }, + resolve: { + edit: { + host: ['Rest', '$stateParams', 'GetBasePath', + function(Rest, $stateParams, GetBasePath) { + let path = GetBasePath('hosts') + $stateParams.host_id; + Rest.setUrl(path); + return Rest.get(); + } + ] + }, + list: { + canAdd: ['rbacUiControlService', function(rbacUiControlService) { + return rbacUiControlService.canAdd('hosts') + .then(function(res) { + return res.canAdd; + }) + .catch(function() { + return false; + }); + }] + } + }, + views: { + '@': { + templateUrl: templateUrl('inventories-hosts/hosts/hosts'), + controller: 'HostListController' + } + }, + ncyBreadcrumb: { + label: N_('HOSTS') + } + }); + + let hostAnsibleFacts = _.cloneDeep(ansibleFactsRoute); + hostAnsibleFacts.name = 'hosts.edit.ansible_facts'; + + let hostInsights = _.cloneDeep(insightsRoute); + hostInsights.name = 'hosts.edit.insights'; + + return Promise.all([ + hostTree + ]).then((generated) => { + return { + states: _.reduce(generated, (result, definition) => { + return result.concat(definition.states); + }, [ + stateExtender.buildDefinition(hostAnsibleFacts), + stateExtender.buildDefinition(hostInsights), + stateExtender.buildDefinition(hostGroupsRoute), + stateExtender.buildDefinition(hostGroupsAssociateRoute) + ]) + }; + }); + }; + + $stateProvider.state({ + name: 'hosts', + url: '/hosts', + lazyLoad: () => generateHostStates() + }); + } + ]); diff --git a/awx/ui/client/src/inventories-hosts/hosts/related/groups/hosts-related-groups-associate.route.js b/awx/ui/client/src/inventories-hosts/hosts/related/groups/hosts-related-groups-associate.route.js new file mode 100644 index 0000000000..169a9d6b7a --- /dev/null +++ b/awx/ui/client/src/inventories-hosts/hosts/related/groups/hosts-related-groups-associate.route.js @@ -0,0 +1,33 @@ +export default { + name: 'hosts.edit.groups.associate', + squashSearchUrl: true, + url: '/associate?inventory_id', + ncyBreadcrumb:{ + skip:true + }, + views: { + 'modal@hosts.edit': { + templateProvider: function() { + return ``; + }, + controller: function($scope, $q, GroupsService, $state){ + $scope.associateGroups = function(selectedItems){ + var deferred = $q.defer(); + return $q.all( _.map(selectedItems, (id) => GroupsService.associateHost({id: parseInt($state.params.host_id)}, id)) ) + .then( () =>{ + deferred.resolve(); + }, (error) => { + deferred.reject(error); + }); + }; + } + } + }, + onExit: function($state) { + if ($state.transition) { + $('#associate-groups-modal').modal('hide'); + $('.modal-backdrop').remove(); + $('body').removeClass('modal-open'); + } + }, +}; diff --git a/awx/ui/client/src/inventories/host-groups/host-groups.controller.js b/awx/ui/client/src/inventories-hosts/hosts/related/groups/hosts-related-groups.controller.js similarity index 83% rename from awx/ui/client/src/inventories/host-groups/host-groups.controller.js rename to awx/ui/client/src/inventories-hosts/hosts/related/groups/hosts-related-groups.controller.js index 31fe1d236d..bd32646dcc 100644 --- a/awx/ui/client/src/inventories/host-groups/host-groups.controller.js +++ b/awx/ui/client/src/inventories-hosts/hosts/related/groups/hosts-related-groups.controller.js @@ -4,14 +4,14 @@ * All Rights Reserved *************************************************/ export default - ['$scope', '$rootScope', '$state', '$stateParams', 'HostGroupsList', 'InventoryUpdate', - 'HostManageService', 'CancelSourceUpdate', 'rbacUiControlService', 'GetBasePath', - 'GetHostsStatusMsg', 'Dataset', 'Find', 'QuerySet', 'inventoryData', 'host', - function($scope, $rootScope, $state, $stateParams, HostGroupsList, InventoryUpdate, - HostManageService, CancelSourceUpdate, rbacUiControlService, GetBasePath, - GetHostsStatusMsg, Dataset, Find, qs, inventoryData, host){ + ['$scope', '$rootScope', '$state', '$stateParams', 'HostsRelatedGroupsList', 'InventoryUpdate', + 'CancelSourceUpdate', 'rbacUiControlService', 'GetBasePath', + 'GetHostsStatusMsg', 'Dataset', 'Find', 'QuerySet', 'inventoryData', 'host', 'GroupsService', + function($scope, $rootScope, $state, $stateParams, HostsRelatedGroupsList, InventoryUpdate, + CancelSourceUpdate, rbacUiControlService, GetBasePath, + GetHostsStatusMsg, Dataset, Find, qs, inventoryData, host, GroupsService){ - let list = HostGroupsList; + let list = HostsRelatedGroupsList; init(); @@ -73,7 +73,7 @@ $state.go('.', null, {reload: true}); }); - HostManageService.disassociateGroup(host, $scope.disassociateGroup.id).then(() => { + GroupsService.disassociateHost(host.id, $scope.disassociateGroup.id).then(() => { $state.go($state.current, null, {reload: true}); $('#host-disassociate-modal').modal('hide'); $('body').removeClass('modal-open'); diff --git a/awx/ui/client/src/inventories/host-groups/host-groups.list.js b/awx/ui/client/src/inventories-hosts/hosts/related/groups/hosts-related-groups.list.js similarity index 97% rename from awx/ui/client/src/inventories/host-groups/host-groups.list.js rename to awx/ui/client/src/inventories-hosts/hosts/related/groups/hosts-related-groups.list.js index 5bb9c85ee3..103eeca93f 100644 --- a/awx/ui/client/src/inventories/host-groups/host-groups.list.js +++ b/awx/ui/client/src/inventories-hosts/hosts/related/groups/hosts-related-groups.list.js @@ -49,7 +49,7 @@ export default { ngClick: "associateGroup()", awToolTip: "Associate this host with a new group", actionClass: 'btn List-buttonSubmit', - buttonContent: '+ ADD GROUP', + buttonContent: '+ ASSOCIATE GROUP', ngShow: 'canAdd', dataPlacement: "top", } diff --git a/awx/ui/client/src/inventories/host-groups/host-groups.partial.html b/awx/ui/client/src/inventories-hosts/hosts/related/groups/hosts-related-groups.partial.html similarity index 88% rename from awx/ui/client/src/inventories/host-groups/host-groups.partial.html rename to awx/ui/client/src/inventories-hosts/hosts/related/groups/hosts-related-groups.partial.html index 81d3a90e85..35d250f4c2 100644 --- a/awx/ui/client/src/inventories/host-groups/host-groups.partial.html +++ b/awx/ui/client/src/inventories-hosts/hosts/related/groups/hosts-related-groups.partial.html @@ -5,7 +5,7 @@