From d8384522c2ca8eccdea6bdbf4d9d9af65d8fe29e Mon Sep 17 00:00:00 2001 From: Marliana Lara Date: Thu, 6 Jul 2017 16:22:07 -0400 Subject: [PATCH] Remove Revisions directory --- awx/ui/client/lib/components/_index.less | 1 + .../components/truncate/_index.less} | 6 +-- .../components/truncate/truncate.directive.js | 7 +-- .../projects/list/projects-list.controller.js | 13 ------ awx/ui/client/src/projects/main.js | 3 +- awx/ui/client/src/projects/revisions/main.js | 11 ----- .../projects/revisions/revisions.directive.js | 46 ------------------- .../projects/revisions/revisions.partial.html | 7 --- 8 files changed, 8 insertions(+), 86 deletions(-) rename awx/ui/client/{src/projects/revisions/revisions.block.less => lib/components/truncate/_index.less} (66%) delete mode 100644 awx/ui/client/src/projects/revisions/main.js delete mode 100644 awx/ui/client/src/projects/revisions/revisions.directive.js delete mode 100644 awx/ui/client/src/projects/revisions/revisions.partial.html diff --git a/awx/ui/client/lib/components/_index.less b/awx/ui/client/lib/components/_index.less index 729d577b54..1902014e11 100644 --- a/awx/ui/client/lib/components/_index.less +++ b/awx/ui/client/lib/components/_index.less @@ -5,3 +5,4 @@ @import 'popover/_index'; @import 'tabs/_index'; @import 'utility/_index'; +@import 'truncate/_index'; diff --git a/awx/ui/client/src/projects/revisions/revisions.block.less b/awx/ui/client/lib/components/truncate/_index.less similarity index 66% rename from awx/ui/client/src/projects/revisions/revisions.block.less rename to awx/ui/client/lib/components/truncate/_index.less index 176a062bc1..29b006f149 100644 --- a/awx/ui/client/src/projects/revisions/revisions.block.less +++ b/awx/ui/client/lib/components/truncate/_index.less @@ -1,5 +1,3 @@ -@import "./client/src/shared/branding/colors.default.less"; - .RevisionHash { display: flex; align-items: center; @@ -10,12 +8,12 @@ } .RevisionHash-copy { - color: @b7grey; + color: @at-gray-dark-2x; cursor: pointer; margin-left: 10px; } .RevisionHash-copy:hover { - color: @default-link; + color: @at-blue; } \ No newline at end of file diff --git a/awx/ui/client/lib/components/truncate/truncate.directive.js b/awx/ui/client/lib/components/truncate/truncate.directive.js index fd0d496230..b13a853007 100644 --- a/awx/ui/client/lib/components/truncate/truncate.directive.js +++ b/awx/ui/client/lib/components/truncate/truncate.directive.js @@ -6,7 +6,7 @@ function atTruncateLink (scope, el, attr, ctrl) { truncateController.init(scope, string, maxlength); } -function AtTruncateController ($filter) { +function AtTruncateController ($filter, $scope) { let vm = this; vm.toolTipContent = 'Copy full revision to clipboard.'; @@ -55,8 +55,10 @@ function AtTruncateController ($filter) { } +AtTruncateController.$inject = ['$filter', '$scope' ]; -function atTruncate($filter, pathService) { + +function atTruncate(pathService) { return { restrict: 'EA', replace: true, @@ -73,7 +75,6 @@ function atTruncate($filter, pathService) { } atTruncate.$inject = [ - '$filter', 'PathService' ]; diff --git a/awx/ui/client/src/projects/list/projects-list.controller.js b/awx/ui/client/src/projects/list/projects-list.controller.js index 2a3682e77c..6a894530b0 100644 --- a/awx/ui/client/src/projects/list/projects-list.controller.js +++ b/awx/ui/client/src/projects/list/projects-list.controller.js @@ -93,19 +93,6 @@ export default ['$scope', '$rootScope', '$log', 'Rest', 'Alert', } } - $scope.$on('copied', function(e) { - // $scope.projects.map( (project) => { - // if (project.id === e.targetScope.project.id) { - // project.tooltipContent = 'Copied to clipboard.'; - // } - // else { - // project.tooltipContent = "Copy full revision to clipboard."; - // } - // }); - console.log('copied hi there'); - console.log(e); - }); - $scope.reloadList = function(){ let path = GetBasePath(list.basePath) || GetBasePath(list.name); qs.search(path, $state.params[`${list.iterator}_search`]) diff --git a/awx/ui/client/src/projects/main.js b/awx/ui/client/src/projects/main.js index 52fa7270b6..778cfab07a 100644 --- a/awx/ui/client/src/projects/main.js +++ b/awx/ui/client/src/projects/main.js @@ -13,10 +13,9 @@ import { N_ } from '../i18n'; import GetProjectPath from './factories/get-project-path.factory'; import GetProjectIcon from './factories/get-project-icon.factory'; import GetProjectToolTip from './factories/get-project-tool-tip.factory'; -import revisions from './revisions/main'; export default -angular.module('Projects', [revisions.name]) +angular.module('Projects', []) .controller('ProjectsList', ProjectsList) .controller('ProjectsAdd', ProjectsAdd) .controller('ProjectsEdit', ProjectsEdit) diff --git a/awx/ui/client/src/projects/revisions/main.js b/awx/ui/client/src/projects/revisions/main.js deleted file mode 100644 index 592cc2c976..0000000000 --- a/awx/ui/client/src/projects/revisions/main.js +++ /dev/null @@ -1,11 +0,0 @@ -/************************************************* - * Copyright (c) 2015 Ansible, Inc. - * - * All Rights Reserved - *************************************************/ - -import revisions from './revisions.directive'; - -export default - angular.module('revisions', []) - .directive('revisions', revisions); \ No newline at end of file diff --git a/awx/ui/client/src/projects/revisions/revisions.directive.js b/awx/ui/client/src/projects/revisions/revisions.directive.js deleted file mode 100644 index bcd95b2054..0000000000 --- a/awx/ui/client/src/projects/revisions/revisions.directive.js +++ /dev/null @@ -1,46 +0,0 @@ -export default - [ 'templateUrl', function(templateUrl) { - return { - restrict: 'E', - templateUrl: templateUrl('projects/revisions/revisions'), - link: function(scope) { - - scope.copy = function() { - scope.$emit('copied'); - - let full_revision = scope.project.scm_revision; - let textArea = document.createElement("textarea"); - - // Place in top-left corner of screen regardless of scroll position. - textArea.style.position = 'fixed'; - textArea.style.top = 0; - textArea.style.left = 0; - - // Ensure it has a small width and height. Setting to 1px / 1em - // doesn't work as this gives a negative w/h on some browsers. - textArea.style.width = '2em'; - textArea.style.height = '2em'; - - // We don't need padding, reducing the size if it does flash render. - textArea.style.padding = 0; - - // Clean up any borders. - textArea.style.border = 'none'; - textArea.style.outline = 'none'; - textArea.style.boxShadow = 'none'; - - // Avoid flash of white box if rendered for any reason. - textArea.style.background = 'transparent'; - - textArea.value = full_revision; - document.body.appendChild(textArea); - textArea.select(); - - document.execCommand('copy'); - - document.body.removeChild(textArea); - }; - } - }; - } - ]; \ No newline at end of file diff --git a/awx/ui/client/src/projects/revisions/revisions.partial.html b/awx/ui/client/src/projects/revisions/revisions.partial.html deleted file mode 100644 index 75b2887d58..0000000000 --- a/awx/ui/client/src/projects/revisions/revisions.partial.html +++ /dev/null @@ -1,7 +0,0 @@ -
- -
-
- -
\ No newline at end of file