1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 16:51:11 +03:00

Remove Revisions directory

This commit is contained in:
Marliana Lara 2017-07-06 16:22:07 -04:00
parent 3d5f7057c3
commit d8384522c2
8 changed files with 8 additions and 86 deletions

View File

@ -5,3 +5,4 @@
@import 'popover/_index';
@import 'tabs/_index';
@import 'utility/_index';
@import 'truncate/_index';

View File

@ -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;
}

View File

@ -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'
];

View File

@ -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`])

View File

@ -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)

View File

@ -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);

View File

@ -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);
};
}
};
}
];

View File

@ -1,7 +0,0 @@
<div class="RevisionHash-tag">
<span at-truncate="{{project.scm_revision}}" maxLength="7" class="RevisionHash-name"></span>
</div>
<div class="RevisionHash-copy" aw-tool-tip="{{project.tooltipContent}}" data-tip-watch="project.tooltipContent"
data-placement="top" ng-click="copy()">
<i class="fa fa-clone"></i>
</div>