Repository: ambari Updated Branches: refs/heads/branch-2.2 c99087729 -> 565b122c8
AMBARI-15598. Introduce "Copy Path to clipboard" feature for Files browser view UI (pallavkul) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/565b122c Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/565b122c Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/565b122c Branch: refs/heads/branch-2.2 Commit: 565b122c888a804ed3e3f58a43d4d80442865d14 Parents: c990877 Author: Pallav Kulshreshtha <[email protected]> Authored: Tue Mar 29 21:59:58 2016 +0530 Committer: Pallav Kulshreshtha <[email protected]> Committed: Tue Mar 29 21:59:58 2016 +0530 ---------------------------------------------------------------------- .../src/main/resources/ui/app/controllers/files.js | 14 ++++++++++++++ .../src/main/resources/ui/app/templates/files.hbs | 8 ++++++++ .../views/files/src/main/resources/ui/package.json | 1 + 3 files changed, 23 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/565b122c/contrib/views/files/src/main/resources/ui/app/controllers/files.js ---------------------------------------------------------------------- diff --git a/contrib/views/files/src/main/resources/ui/app/controllers/files.js b/contrib/views/files/src/main/resources/ui/app/controllers/files.js index 9fc11b6..8b5bb7b 100644 --- a/contrib/views/files/src/main/resources/ui/app/controllers/files.js +++ b/contrib/views/files/src/main/resources/ui/app/controllers/files.js @@ -83,6 +83,20 @@ export default Ember.Controller.extend({ return this.get('sortedContent'); }), + selectedFilePathsText: function () { + var entities = this.get('fileSelectionService.files'); + var multiplePaths = []; + + if (entities.length === 0) { + return this.get('path'); + } else { + multiplePaths = entities.map((entity) => { + return entity.get('path'); + }); + return multiplePaths.join(', '); + } + }.property('fileSelectionService.files.[]', 'path'), + actions: { sortFiles: function(sortColumn) { if (sortColumn['sortOrder'] !== 0) { http://git-wip-us.apache.org/repos/asf/ambari/blob/565b122c/contrib/views/files/src/main/resources/ui/app/templates/files.hbs ---------------------------------------------------------------------- diff --git a/contrib/views/files/src/main/resources/ui/app/templates/files.hbs b/contrib/views/files/src/main/resources/ui/app/templates/files.hbs index 3e178bc..63e0dd8 100644 --- a/contrib/views/files/src/main/resources/ui/app/templates/files.hbs +++ b/contrib/views/files/src/main/resources/ui/app/templates/files.hbs @@ -42,6 +42,14 @@ {{#if hasTrashPath}} {{#link-to 'files' (query-params path=trashPath) class="btn btn-sm btn-default"}}{{fa-icon "trash"}}{{/link-to}} {{/if}} + {{#copy-button + clipboardText=selectedFilePathsText + success="success" + error="error" + class="btn btn-sm btn-default" + }} + <i class="fa fa-clipboard"></i> + {{/copy-button}} <a href="#" {{action 'refreshCurrentRoute'}} class="btn btn-sm btn-default">{{fa-icon "refresh"}}</a> {{files-breadcrumb path=path}} </div> http://git-wip-us.apache.org/repos/asf/ambari/blob/565b122c/contrib/views/files/src/main/resources/ui/package.json ---------------------------------------------------------------------- diff --git a/contrib/views/files/src/main/resources/ui/package.json b/contrib/views/files/src/main/resources/ui/package.json index 8250489..d15c5c9 100644 --- a/contrib/views/files/src/main/resources/ui/package.json +++ b/contrib/views/files/src/main/resources/ui/package.json @@ -39,6 +39,7 @@ "ember-cli-release": "0.2.8", "ember-cli-sri": "^2.0.0", "ember-cli-uglify": "^1.2.0", + "ember-cli-clipboard": "^0.3.1", "ember-collection": "git://github.com/emberjs/ember-collection.git#bf752508a501161791e3f3b9a546c9b97d5c387a", "ember-data": "2.3.0", "ember-disable-proxy-controllers": "^1.0.1",
