Return-Path: X-Original-To: apmail-atlas-commits-archive@minotaur.apache.org Delivered-To: apmail-atlas-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A03B1185D4 for ; Thu, 4 Feb 2016 21:46:46 +0000 (UTC) Received: (qmail 2787 invoked by uid 500); 4 Feb 2016 21:46:46 -0000 Delivered-To: apmail-atlas-commits-archive@atlas.apache.org Received: (qmail 2752 invoked by uid 500); 4 Feb 2016 21:46:46 -0000 Mailing-List: contact commits-help@atlas.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@atlas.incubator.apache.org Delivered-To: mailing list commits@atlas.incubator.apache.org Received: (qmail 2743 invoked by uid 99); 4 Feb 2016 21:46:46 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Feb 2016 21:46:46 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 0E339C0052 for ; Thu, 4 Feb 2016 21:46:46 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.451 X-Spam-Level: X-Spam-Status: No, score=0.451 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.429, URIBL_SBL=4, URIBL_SBL_A=0.1] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 6WwMjEOLWjnE for ; Thu, 4 Feb 2016 21:46:41 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with SMTP id 39D7824E24 for ; Thu, 4 Feb 2016 21:46:40 +0000 (UTC) Received: (qmail 2015 invoked by uid 99); 4 Feb 2016 21:46:39 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Feb 2016 21:46:39 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 5EE5ADFCE4; Thu, 4 Feb 2016 21:46:39 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sumasai@apache.org To: commits@atlas.incubator.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: incubator-atlas git commit: ATLAS-287: UI: GUID on table details page Date: Thu, 4 Feb 2016 21:46:39 +0000 (UTC) Repository: incubator-atlas Updated Branches: refs/heads/master bd47628fe -> 21b403bb7 ATLAS-287: UI: GUID on table details page Signed-off-by: Suma Shivaprasad Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/21b403bb Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/21b403bb Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/21b403bb Branch: refs/heads/master Commit: 21b403bb72ceaaa11ad1d46b103d13de18e4ab80 Parents: bd47628 Author: Anilsg Authored: Sat Jan 30 09:28:18 2016 +0530 Committer: Suma Shivaprasad Committed: Thu Feb 4 13:46:22 2016 -0800 ---------------------------------------------------------------------- .../public/modules/details/detailsController.js | 50 ++++- .../public/modules/details/views/details.html | 190 +++++++++---------- .../public/modules/search/searchController.js | 76 ++++++-- .../public/modules/search/views/search.html | 10 +- 4 files changed, 201 insertions(+), 125 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/21b403bb/dashboard/public/modules/details/detailsController.js ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/details/detailsController.js b/dashboard/public/modules/details/detailsController.js index cc6bb2d..606b971 100644 --- a/dashboard/public/modules/details/detailsController.js +++ b/dashboard/public/modules/details/detailsController.js @@ -23,16 +23,49 @@ angular.module('dgc.details').controller('DetailsController', ['$window', '$scop $scope.tableName = false; $scope.isTable = false; $scope.isLineage = false; - + DetailsResource.get({ id: $stateParams.id }, function(data) { - $scope.details = data; + $scope.tableName = data.values.name; $scope.onActivate('io'); $scope.isTags = (typeof data.traits !== 'undefined' && typeof data.traits === 'object') ? true : false; + if (data && data.values) { + var getName = function(aaa, attr) { + DetailsResource.get({ + id: attr.id + }, function(data1) { + if (data1.values && data1.values.name) { + attr.name = data1.values.name; + } + }); + }; + + for (var aaa in data.values) { + if (typeof data.values[aaa] === 'object' && data.values[aaa] !== null && data.values[aaa].id && typeof data.values[aaa].id === 'string') { + data.values[aaa].name = data.values[aaa].id; + getName(aaa, data.values[aaa]); + } + if (typeof data.values[aaa] === 'object' && data.values[aaa] !== null && data.values[aaa].id && typeof data.values[aaa].id === 'object') { + data.values[aaa].id.name = data.values[aaa].id.id; + getName(aaa, data.values[aaa].id); + } + if (typeof data.values[aaa] === 'object' && angular.isArray(data.values[aaa]) === true) { + var arrObj = data.values[aaa]; + for(var a=0; a < arrObj.length; a++){ + if(typeof arrObj[a].id === 'string'){ + arrObj[a].name = arrObj[a].id; + getName(arrObj[a], arrObj[a]); + } + } + } + } + } + + $scope.details = data; if (data && data.values && data.values.name && data.values.name !== "") { SchemaResource.get({ tableName: data.values.name @@ -42,15 +75,15 @@ angular.module('dgc.details').controller('DetailsController', ['$window', '$scop $scope.isSchema = (data1.results.rows && data1.results.rows.length > 0) ? true : false; for (var t = 0; t < data1.results.rows.length; t++) { if (data1.results.rows[t].$id$) { - $scope.isTraitId = true; + $scope.isTraitId = true; } if (data1.results.rows[t].type) { - $scope.isHiveSchema = true; - } - if($scope.isTraitId && $scope.isHiveSchema){ + $scope.isHiveSchema = true; + } + if ($scope.isTraitId && $scope.isHiveSchema) { break; } - } + } } }); } @@ -68,7 +101,7 @@ angular.module('dgc.details').controller('DetailsController', ['$window', '$scop $scope.$broadcast('render-lineage', { type: tabname, tableName: $scope.tableName, - guid : $stateParams.id + guid: $stateParams.id }); }; @@ -78,7 +111,6 @@ angular.module('dgc.details').controller('DetailsController', ['$window', '$scop }); }; - $scope.goDetails = function(id) { $state.go("details", { id: id http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/21b403bb/dashboard/public/modules/details/views/details.html ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/details/views/details.html b/dashboard/public/modules/details/views/details.html index 37fcaad..93208fa 100644 --- a/dashboard/public/modules/details/views/details.html +++ b/dashboard/public/modules/details/views/details.html @@ -1,101 +1,93 @@ - - + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, Version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + -->
-
- -
-
-
-

- Name: {{details.values.name}}

-

Description: {{details.values.description}}

-

- Lineage - -

-
- - - - - - - - - - - - - - - - - - - - - - -
KeyValue
{{key}} - {{ value.id }} - {{ value.id.id }} - - {{ key2 }} : {{ value2 }}, - -
- {{ value2.id }} - -
- - - {{ value1.id }} - - - - - - -
-
-
-
- -
-
-
-
-
{{key3}}: {{value3}}
-
{{key1}} : {{value1 | date:'medium'}} UTC
-
-
{{value * 1000 | date:'yyyy-MM-dd HH:mm:ss'}} UTC{{value}}
-
- - - - - - -
-
-
\ No newline at end of file +
+ +
+
+
+

+ Name: {{details.values.name}}

+

Description: {{details.values.description}}

+

+ Lineage + +

+
+ + + + + + + + + + + + + + + + + + + + + + +
KeyValue
{{key}} + {{ value.name }} + {{ value.id.name }} + + {{ key2 }} : {{ value2 }}, + + + +
+ +
+
+
+
+
{{key3}}: {{value3}}
+
{{key1}} : {{value1 | date:'medium'}} UTC
+
+
{{value | date:'yyyy-MM-dd HH:mm:ss'}} UTC{{value}}
+
+ + + + + + +
+
+ + http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/21b403bb/dashboard/public/modules/search/searchController.js ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/search/searchController.js b/dashboard/public/modules/search/searchController.js index c7d5728..32744a4 100644 --- a/dashboard/public/modules/search/searchController.js +++ b/dashboard/public/modules/search/searchController.js @@ -37,6 +37,58 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio $scope.setPage = function(pageNo) { $scope.currentPage = pageNo; }; + + $scope.initalPage = function() { + var begin = (($scope.currentPage - 1) * $scope.itemsPerPage), + end = begin + $scope.itemsPerPage, + currentRowData = [], + res = [], + count = 0, + firstRowId = 0; + + if ($scope.transformedResults && $scope.transformedResults.length > 0) { + currentRowData = $scope.transformedResults.slice(begin, end); + } + + var getName = function(gid, obj) { + DetailsResource.get({ + id: gid + }, function(data) { + if (data.values && data.values.name) { + obj.name = data.values.name; + } else { + obj.name = gid; + } + res.push(obj); + count++; + + $scope.filteredResults = res; + if (!$scope.transformedProperties && firstRowId === gid) { + $scope.transformedProperties = $scope.filterProperties(); + } + }); + }; + + angular.forEach(currentRowData, function(value) { + var objVal = value; + + if (objVal.guid && !objVal.name) { + if (!firstRowId) { + firstRowId = objVal.guid; + } + getName(objVal.guid, objVal); + } else { + res.push(objVal); + count++; + + $scope.filteredResults = res; + if (!$scope.transformedProperties) { + $scope.transformedProperties = $scope.filterProperties(); + } + } + }); + }; + $scope.search = function(query) { $scope.results = []; NotificationService.reset(); @@ -46,7 +98,6 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio SearchResource.search({ query: query }, function searchSuccess(response) { - $scope.resultCount = response.count; $scope.results = response.results; $scope.resultRows = ($scope.results && $scope.results.rows) ? $scope.results.rows : $scope.results; @@ -84,13 +135,10 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio } } $scope.transformedResults = $scope.filterResults(); - $scope.transformedProperties = $scope.filterProperties(); - } else if (typeof response.dataType === 'undefined') { $scope.dataTransitioned = true; $scope.searchKey = ''; $scope.transformedResults = $scope.filterResults(); - $scope.transformedProperties = $scope.filterProperties(); } else if (response.dataType.typeName && response.dataType.typeName.toLowerCase().indexOf('table') !== -1) { $scope.searchKey = "Table"; $scope.transformedResults = $scope.resultRows; @@ -100,11 +148,7 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio } $scope.$watch('currentPage + itemsPerPage', function() { - var begin = (($scope.currentPage - 1) * $scope.itemsPerPage), - end = begin + $scope.itemsPerPage; - if ($scope.transformedResults) { - $scope.filteredResults = $scope.transformedResults.slice(begin, end); - } + $scope.initalPage(); $scope.pageCount = function() { return Math.ceil($scope.resultCount / $scope.itemsPerPage); }; @@ -125,9 +169,11 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio $scope.filterResults = function() { var res = []; + if ($scope.searchKey !== '') { angular.forEach($scope.resultRows, function(value) { - res.push(value[$scope.searchKey]); + var objVal = value[$scope.searchKey]; + res.push(objVal); }); } else { angular.forEach($scope.resultRows, function(value) { @@ -161,7 +207,6 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio if (onlyId) { objVal.guid = objVal.id; } - res.push(objVal); }); } @@ -189,11 +234,13 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio $scope.doToggle = function($event, el) { this.isCollapsed = !el; }; + $scope.openAddTagHome = function(traitId) { $state.go('addTagHome', { tId: traitId }); }; + $scope.isTag = function(typename) { if (typename.indexOf("__tempQueryResultStruct") > -1 || $scope.searchKey === '') { @@ -202,6 +249,7 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio return false; } }; + $scope.getResourceDataHome = function(event, id) { DetailsResource.get({ id: id @@ -215,7 +263,9 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio } }); }; + $scope.$on('refreshResourceData', $scope.getResourceDataHome); + $scope.filterSearchResults = function(items) { var res = {}; var count = 0; @@ -229,10 +279,12 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio $scope.keyLength = count; return res; }; + $scope.searchQuery = $location.search(); + $scope.query = ($location.search()).query; - if ($scope.query) { + if ($scope.query) { $scope.search($scope.query); } } http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/21b403bb/dashboard/public/modules/search/views/search.html ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/search/views/search.html b/dashboard/public/modules/search/views/search.html index 306fb27..733fe16 100644 --- a/dashboard/public/modules/search/views/search.html +++ b/dashboard/public/modules/search/views/search.html @@ -49,7 +49,7 @@ Tools - + {{(prop != '$traits$') ? prop : 'Tags'}} @@ -73,17 +73,17 @@ - + - {{result[res]}} + {{result[res]}} {{result[res]}} {{result[res] * 1000 | date:'yyyy-MM-dd HH:mm:ss'}} UTC - {{result[res]}} + {{result[res]}} - {{result[res]}} + {{result[res]}}