http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/a05f752d/dashboard/public/modules/search/searchController.js ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/search/searchController.js b/dashboard/public/modules/search/searchController.js deleted file mode 100644 index 4e68d73..0000000 --- a/dashboard/public/modules/search/searchController.js +++ /dev/null @@ -1,317 +0,0 @@ -/* - * 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. - */ -'use strict'; - -angular.module('dgc.search').controller('searchController', ['$scope', '$location', '$http', '$state', '$stateParams', 'lodash', 'searchResource', 'detailsResource', 'notificationService', 'atlasConfig', - function($scope, $location, $http, $state, $stateParams, _, searchResource, detailsResource, notificationService, atlasConfig) { - - $scope.results = []; - $scope.resultCount = 0; - $scope.isCollapsed = true; - $scope.currentPage = 1; - $scope.itemsPerPage = 10; - $scope.filteredResults = []; - $scope.resultRows = []; - $scope.resultType = ''; - $scope.isObject = angular.isObject; - $scope.isString = angular.isString; - $scope.isArray = angular.isArray; - $scope.isNumber = angular.isNumber; - $scope.searchTypes = atlasConfig.SEARCH_TYPE; - $scope.mapAttr = ['guid', 'typeName', 'owner', 'description', 'createTime', '$traits$', '$id$', 'comment', 'dataType']; - - $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, type) { - $scope.results = []; - notificationService.reset(); - $scope.limit = 4; - $scope.searchMessage = 'load-gif'; - $scope.$parent.query = query; - searchResource.search({ - query: query, - searchType: type - }, function searchSuccess(response) { - $scope.resultCount = response.count; - $scope.results = response.results; - $scope.resultRows = ($scope.results && $scope.results.rows) ? $scope.results.rows : $scope.results; - - $scope.totalItems = $scope.resultCount; - $scope.transformedResults = {}; - $scope.dataTransitioned = false; - - $scope.showText = "Text"; - if ($scope.searchTypeModel === $scope.searchTypes.dsl.value) { - $scope.showText = "DSL"; - } - - if ($scope.results) { - if (response.dataType) { - $scope.resultType = response.dataType.typeName; - } else if (response.results.dataType) { - $scope.resultType = response.results.dataType.typeName; - } else if (typeof response.dataType === 'undefined') { - $scope.resultType = "full text"; - } - $scope.searchMessage = $scope.resultCount + ' results matching your ' + $scope.showText + ' search query ' + $scope.query + ' were found'; - } else { - $scope.searchMessage = '0 results matching your ' + $scope.showText + ' search query ' + $scope.query + ' were found'; - } - - if (response.dataType && response.dataType.typeName && response.dataType.typeName.toLowerCase().indexOf('table') === -1) { - $scope.dataTransitioned = true; - var attrDef = response.dataType.attributeDefinitions; - if (attrDef.length === 1) { - $scope.searchKey = attrDef[0].name; - } else { - angular.forEach(attrDef, function(value) { - if (value.dataTypeName === '__IdType') { - $scope.searchKey = value.name; - } - }); - if ($scope.searchKey === undefined || $scope.searchKey === '') { - $scope.searchKey = ''; - } - } - $scope.transformedResults = $scope.filterResults(); - } else if (typeof response.dataType === 'undefined') { - $scope.dataTransitioned = true; - $scope.searchKey = ''; - $scope.transformedResults = $scope.filterResults(); - } else if (response.dataType.typeName && response.dataType.typeName.toLowerCase().indexOf('table') !== -1) { - $scope.searchKey = "Table"; - $scope.transformedResults = $scope.resultRows; - } else if (response.results.dataType && response.results.dataType.typeName && response.results.dataType.typeName.toLowerCase().indexOf('table') !== -1) { - $scope.searchKey = "Table"; - $scope.transformedResults = $scope.resultRows; - } - - $scope.$watch('currentPage + itemsPerPage', function() { - $scope.initalPage(); - $scope.pageCount = function() { - return Math.ceil($scope.resultCount / $scope.itemsPerPage); - }; - if ($scope.results.length < 1) { - notificationService.error('No Result found', false); - } - }); - }, function searchError(err) { - if (($scope.searchTypeModel === $scope.searchTypes.dsl.value) && err.status === 400) { - $scope.searchMessageDsl = true; - $scope.searchMessage = false; - } else { - $scope.searchMessageDsl = false; - $scope.searchMessage = true; - $scope.searchMessage = '0 results matching your ' + $scope.showText + ' search query ' + $scope.query + ' were found'; - notificationService.error('Error occurred during executing search query, error status code = ' + err.status + ', status text = ' + err.statusText, false); - } - - }); - $state.go('search', { - query: query - }, { - location: 'replace' - }); - }; - - $scope.filterResults = function() { - var res = []; - - if ($scope.searchKey !== '') { - angular.forEach($scope.resultRows, function(value) { - var objVal = value[$scope.searchKey]; - res.push(objVal); - }); - } else { - angular.forEach($scope.resultRows, function(value) { - var objVal = {}, - curVal = value, - onlyId = false, - traits = false; - - if (curVal.name) { - objVal.name = curVal.name; - delete curVal.name; - } - angular.forEach(curVal, function(vl, ky) { - if ($scope.mapAttr.indexOf(ky) !== -1 || ky.indexOf('_col_') !== -1 || ky.toLowerCase().indexOf('name') !== -1) { - if (ky === '$id$') { - objVal.id = curVal[ky].id; - onlyId = true; - traits = true; - } else if (ky.indexOf('$') === -1) { - objVal[ky] = vl; - onlyId = false; - } - } - }); - - if (traits) { - objVal.$traits$ = curVal.$traits$ || {}; - objVal.Tools = objVal.id; - } - - if (onlyId) { - objVal.guid = objVal.id; - } - res.push(objVal); - }); - } - return res; - }; - - $scope.filterProperties = function() { - var results = $scope.transformedResults, - pro = []; - if (results && results.length > 0) { - var result = results[0]; - if (typeof result === 'object') { - angular.forEach(result, function(value, key) { - if (key.indexOf('$typeName$') === -1) { - pro.push(key); - } - }); - } else { - pro.push($scope.searchKey); - } - } - return pro; - }; - - $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 === '') { - return true; - } else { - return false; - } - }; - - $scope.getResourceDataHome = function(event, id) { - detailsResource.get({ - id: id - }, function(data) { - if ($scope.filteredResults !== null && Object.keys($scope.filteredResults).length > 0) { - angular.forEach($scope.filteredResults, function(obj, trait) { - if ((obj.$id$ && obj.$id$.id.indexOf(id) > -1) || (obj.id && obj.id.indexOf(id) > -1)) { - $scope.filteredResults[trait].$traits$ = data.traits; - } - }); - } - }); - }; - - $scope.$on('refreshResourceData', $scope.getResourceDataHome); - - $scope.filterSearchResults = function(items) { - var res = {}; - var count = 0; - items = _.omit(items, ['name', 'description', 'guid']); - angular.forEach(items, function(value, key) { - if (typeof value !== 'object' && (key.indexOf('$$') < 0)) { - res[key] = value; - count++; - } - }); - $scope.keyLength = count; - return res; - }; - - $scope.searchQuery = $location.search(); - $scope.searchTypeModel = $stateParams.searchType; - $scope.query = ($location.search()).query; - $stateParams.searchType = ($location.search()).searchType; - if ($scope.query && $stateParams.searchType) { - $scope.search($scope.query, $stateParams.searchType); - } - - $scope.searchTypeChanged = function() { - if ($scope.query) { - $state.go('search', { - query: $scope.query, - searchType: $scope.searchTypeModel - }, { - location: 'replace' - }); - } - }; - } -]);
http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/a05f752d/dashboard/public/modules/search/searchDirective.js ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/search/searchDirective.js b/dashboard/public/modules/search/searchDirective.js deleted file mode 100644 index 5c9fc48..0000000 --- a/dashboard/public/modules/search/searchDirective.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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. - */ - -'use strict'; - -angular.module('dgc.search').directive( - "myDirective", - function() { - return { - restrict: 'EA', - template: '<a href="javascript: void(0);" button-toggle toggle="isCollapsed" class="show-more" ng-click="isCollapsed = !isCollapsed">..show more</a>', - link: function($scope) { - $scope.isCollapsed = true; - console.log($scope.isCollapsed); - }, - transclude: true, - scope: {} - }; - }); http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/a05f752d/dashboard/public/modules/search/searchModule.js ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/search/searchModule.js b/dashboard/public/modules/search/searchModule.js deleted file mode 100644 index ac82e3e..0000000 --- a/dashboard/public/modules/search/searchModule.js +++ /dev/null @@ -1,21 +0,0 @@ -/* - * 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. - */ - -'use strict'; - -angular.module('dgc.search', ['dgc.details']); http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/a05f752d/dashboard/public/modules/search/searchResource.js ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/search/searchResource.js b/dashboard/public/modules/search/searchResource.js deleted file mode 100644 index bac9bd4..0000000 --- a/dashboard/public/modules/search/searchResource.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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. - */ - -'use strict'; - -angular.module('dgc.search').factory('searchResource', ['$resource', 'atlasConfig', function($resource, atlasConfig) { - return $resource(atlasConfig.API_ENDPOINTS.SEARCH+':searchType', {}, { - search: { - 'method': 'GET', - 'responseType': 'json', - 'transformResponse': function(data) { - return data; - } - } - }); - -}]); http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/a05f752d/dashboard/public/modules/search/searchRoutes.js ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/search/searchRoutes.js b/dashboard/public/modules/search/searchRoutes.js deleted file mode 100644 index 333648f..0000000 --- a/dashboard/public/modules/search/searchRoutes.js +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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. - */ -'use strict'; - -//Setting up route -angular.module('dgc.search').config(['$stateProvider', - function($stateProvider) { - $stateProvider.state('search', { - url: '/search?query&searchType', - params: {searchType: 'fulltext'}, - templateUrl: '/modules/search/views/search.html', - controller: 'searchController' - }); - $stateProvider.state('addTagHome', { - parent: 'search', - params: { - tId: null, - frm: 'search' - }, - onEnter: ['$stateParams', '$state', '$modal', 'navigationResource', function($stateParams, $state, $modal, navigationResource) { - $modal.open({ - templateUrl: '/modules/tags/instance/views/createTag.html', - controller: 'createTagController', - windowClass: 'create-tag-entity', - resolve: { - typesList: function() { - return navigationResource.get().$promise; - } - } - }).result.finally(function() { - $state.go('^'); - }); - }] - }); - } -]); http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/a05f752d/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 deleted file mode 100644 index 80116e9..0000000 --- a/dashboard/public/modules/search/views/search.html +++ /dev/null @@ -1,117 +0,0 @@ - - -<!-- - ~ 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. - --> -<div class="col-lg-10 paddingR0" xmlns="http://www.w3.org/1999/html"> - <div class=""> - <div class="row main-search"> - <form class="col-lg-12" name="form" novalidate> - <div class="col-lg-2 search-type-large"> - <select class="form-control" ng-model="searchTypeModel" ng-change="searchTypeChanged()"> - <option ng-selected = "{{searchTypeModel === searchTypes.dsl.value}}" value={{searchTypes.dsl.value}}>{{ searchTypes.dsl.displayText }}</option> - <option ng-selected = "{{searchTypeModel === searchTypes.fulltext.value}}" value={{searchTypes.fulltext.value}}>{{ searchTypes.fulltext.displayText }}</option> - </select> - </div> - <div class="input-group col-lg-10"> - <input type="text" class="form-control" placeholder={{searchTypes[searchTypeModel].placeholder}} data-ng-model="query" required> - </input> - <span class="input-group-btn"> - <button class="btn btn-success" type="submit" data-ng-disabled="form.$invalid" ui-sref="search({ query: query, searchType: searchTypeModel })"> - <i class="glyphicon glyphicon-search white "></i> - </button> - </span> - </div> - </form> - </div> - <div class="col-lg-12 padding0 search-results"> - <div ng-switch on="searchMessage"> - <div ng-switch-when="load-gif" class="search-spinner"><img src="../img/spinner.gif" align="middle" /></div> - <div ng-switch-default> - <h5 ng-show="searchMessage" title="{{searchMessage}}" class="tabsearch-result">{{searchMessage}}</h5> - <h5 ng-show="searchMessageDsl" title="{{searchMessage}}" class="tabsearch-result">Invalid DSL Syntax, Click<a ui-sref="search({ query: query, searchType: searchTypes.fulltext.value })"> here</a> to execute as a Text search.</h5> - </div> - </div> - <div class="panel panel-default" ng-show='resultCount > 0'> - <table class="table table-bordered datatable" > - <thead> - <tr ng-if="!isTag(resultType)"> - <th>Name</th> - <th>Description</th> - <th>Owner</th> - <th>Tags</th> - <th>Tools</th> - </tr> - <tr ng-if="isTag(resultType) && transformedProperties != undefined" > - <th ng-repeat="prop in transformedProperties" ng-if="prop !== 'id' && prop !== 'guid'"> - {{(prop != '$traits$') ? prop : 'Tags'}} - </th> - </tr> - </thead> - <tbody> - <tr ng-if="!isTag(resultType) && isObject(result)" ng-repeat="result in filteredResults track by $index"> - <td> - <a data-ui-sref="details({id:result['$id$'].id || result.guid})">{{result.name || result.guid}}</a> - </td> - <td> - {{result.description}} - </td> - <td> - <span ng-repeat="(key, value) in filterSearchResults(result)"> - <span ng-if="key =='owner'">{{value}}</span> - </span> - </td> - <td> - <div id="{{result['$id$'].id || result.guid}}" ng-show="!dataTransitioned" class="word-break"><a class="tab-search-tags" ng-repeat="(key, value) in result['$traits$']" data-ui-sref="search({query: key})" title="{{key}}">{{key}}<span> </span></a></div> - </td> - <td class="add-tag"><img ng-src="img/addTag.png" tooltip="Add Tag" ng-click="openAddTagHome(result['$id$'].id || result.guid)"></td> - </tr> - <tr ng-if="isTag(resultType)" ng-repeat="result in filteredResults track by $index"> - <td data-ng-if="isObject(result) && !isString(result) && res != 'id' && res != 'guid'" data-ng-repeat="res in transformedProperties track by $index"> - - <a data-ng-if="res == 'guid' && !result['name']" data-ui-sref="details({id:result[res]})">{{result[res]}}</a> - - <span data-ng-if="res != '$traits$' && res != 'Tools' && res != 'guid' && res.toLowerCase().indexOf('name') == -1 && res.toLowerCase().indexOf('time') == -1">{{result[res]}}</span> - - <span data-ng-if="res.toLowerCase().indexOf('time') != -1 && isNumber(result[res])">{{result[res] * 1000 | date:'yyyy-MM-dd HH:mm:ss'}} UTC</span> - - <a data-ng-if="res.toLowerCase().indexOf('name') != -1 && (result['id'] || result['guid']) " data-ui-sref="details({id:result['id']|| result['guid']})">{{result[res]}}</a> - - <span data-ng-if="res.toLowerCase().indexOf('name') != -1 && !result['id'] && !result['guid']">{{result[res]}}</span> - - <div data-ng-if="res == '$traits$'" class="word-break tags" id="{{result['id']|| result['guid']}}"> - <a class="tab-search-tags" ng-repeat="(key, value) in result[res]" data-ui-sref="search({query: key})" title="{{key}}">{{key}}<span> </span></a> - </div> - - <span data-ng-if="res == 'Tools'" class="add-tag"> <img ng-src="img/addTag.png" tooltip="Add Tag" ng-click="openAddTagHome(result['id']|| result['guid'])"> </span> - </td> - <td data-ng-if="isString(result) || result == false || result == true"> - <a data-ng-if="result.toLowerCase() == 'guid'" data-ui-sref="details({id:result})">{{result}}</a> - <span data-ng-if="result.toLowerCase() != 'guid'">{{result}}</span> - </td> - </tr> - </tbody> - </table> - </div> - <div class="pull-right" ng-show='resultCount > 0'> - <pagination total-items="totalItems" items-per-page="itemsPerPage" ng-model="currentPage" ng-change="pageChanged()"></pagination> - <p> - </div> - </div> - </div> -</div> - http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/a05f752d/dashboard/public/modules/search/views/searchResult.html ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/search/views/searchResult.html b/dashboard/public/modules/search/views/searchResult.html deleted file mode 100644 index 4638a27..0000000 --- a/dashboard/public/modules/search/views/searchResult.html +++ /dev/null @@ -1,43 +0,0 @@ -<!-- - ~ 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. - --> - -<h4 ng-show="searchMessage">{{searchMessage}}</h4> - -<ul class="list-unstyled"> - <li ng-repeat="result in filteredResults" class="search-results"> - <h4><a data-ui-sref="details({id:result['$id$'].id})">{{result.name}}</a></h4> - <p>{{result.description}}</p> - <span ng-repeat="(key, value) in filterSearchResults(result)" > - <span ng-show="$index < 4"><b>{{key}}: </b>{{value}}{{$index+1 === limit ? '' : ', '}}</span> - </span> - <div collapse="isCollapsed"> - <span ng-repeat="(key, value) in filterSearchResults(result)" > - <span ng-show="$index > 4"><b>{{key}}: </b>{{value}}{{$last ? '' : ', '}}</span> - </span> - </div> - <a href ng-show="isCollapsed && (keyLength > 4)" ng-click="doToggle($event,isCollapsed)">..show more</a> - <a href ng-show="!isCollapsed" ng-click="doToggle($event,isCollapsed)">..show less</a> - - <h5>Tags : <a ng-repeat="(key, value) in result['$traits$']" data-ui-sref="search.results({query: key})">{{key}}</a> </h5> - <div data-ng-if="!searchTypesAvailable" data-ng-include="'/modules/search/views/types/guid.html'"></div> - </li> -</ul> -<div class="resultsPagination" ng-show='filteredResults.length > 0'> - <pagination total-items="totalItems" items-per-page="itemsPerPage" ng-model="currentPage" ng-change="pageChanged()"></pagination> - <p> -</div> http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/a05f752d/dashboard/public/modules/search/views/types/column.html ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/search/views/types/column.html b/dashboard/public/modules/search/views/types/column.html deleted file mode 100644 index 3bbb6c0..0000000 --- a/dashboard/public/modules/search/views/types/column.html +++ /dev/null @@ -1,21 +0,0 @@ -<!-- - ~ 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. - --> - -<h4><a data-ui-sref="details({id:result['$id$'].id})">{{result.name}}</a></h4> -<p><b>Comment:</b> {{result.comment}}, <b>DataType:</b> {{result.dataType}},<b>Table:</b> {{result.table}}</p> -<h5>Tags : <a ng-repeat="(key, value) in result['$traits$']" data-ui-sref="search.results({query: key})">{{key}}</a> </h5> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/a05f752d/dashboard/public/modules/search/views/types/db.html ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/search/views/types/db.html b/dashboard/public/modules/search/views/types/db.html deleted file mode 100644 index 28467b0..0000000 --- a/dashboard/public/modules/search/views/types/db.html +++ /dev/null @@ -1,22 +0,0 @@ -<!-- - ~ 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. - --> - -<h4><a data-ui-sref="details({id:result['$id$'].id})">{{result.name}}</a></h4> -<p>{{result.description}}</p> -<p><b>locationUri:</b> {{result.locationUri}}, <b>Owner: </b>{{result.owner}}</p> -<h5>Tags : <a ng-repeat="(key, value) in result['$traits$']" data-ui-sref="search.results({query: key})">{{key}}</a> </h5> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/a05f752d/dashboard/public/modules/search/views/types/guid.html ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/search/views/types/guid.html b/dashboard/public/modules/search/views/types/guid.html deleted file mode 100644 index 483ca80..0000000 --- a/dashboard/public/modules/search/views/types/guid.html +++ /dev/null @@ -1,21 +0,0 @@ -<!-- - ~ 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. - --> - -<h4><a data-ui-sref="details({id:result.instanceInfo.guid})">{{result.instanceInfo.guid}}</a></h4> -<p><b>TypeName: </b>{{result.instanceInfo.typeName}}</p> -<h5>Tags : <a ng-repeat="(key, value) in result['$traits$']" data-ui-sref="search.results({query: key})">{{key}}</a> </h5> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/a05f752d/dashboard/public/modules/search/views/types/hiveLineage.html ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/search/views/types/hiveLineage.html b/dashboard/public/modules/search/views/types/hiveLineage.html deleted file mode 100644 index b150722..0000000 --- a/dashboard/public/modules/search/views/types/hiveLineage.html +++ /dev/null @@ -1,19 +0,0 @@ -<!-- - ~ 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. - --> - -<a data-ui-sref="details({id:result.guid})">{{result.guid}}</a> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/a05f752d/dashboard/public/modules/search/views/types/hive_table.html ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/search/views/types/hive_table.html b/dashboard/public/modules/search/views/types/hive_table.html deleted file mode 100644 index 84b747e..0000000 --- a/dashboard/public/modules/search/views/types/hive_table.html +++ /dev/null @@ -1,19 +0,0 @@ -<!-- - ~ 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. - --> - -<a data-ui-sref="details({id:result.guid})">{{result["hive_table.name"]}}</a> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/a05f752d/dashboard/public/modules/search/views/types/loadprocess.html ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/search/views/types/loadprocess.html b/dashboard/public/modules/search/views/types/loadprocess.html deleted file mode 100644 index 652cd97..0000000 --- a/dashboard/public/modules/search/views/types/loadprocess.html +++ /dev/null @@ -1,22 +0,0 @@ -<!-- - ~ 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. - --> - -<h4><a data-ui-sref="details({id:result['$id$'].id})">{{result.name}}</a></h4> -<p>{{result.description}}</p> -<p><b>inputTables: </b>{{result.inputTables['id']}},<b>queryText: </b>{{result.queryText}},<b>startTime: </b>{{result.startTime | date:'medium'}},<b>endTime: </b> {{result.endTime | date:'medium'}}</p> -<h5>Tags : <a ng-repeat="(key, value) in result['$traits$']" data-ui-sref="search.results({query: key})">{{key}}</a> </h5> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/a05f752d/dashboard/public/modules/search/views/types/storagedesc.html ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/search/views/types/storagedesc.html b/dashboard/public/modules/search/views/types/storagedesc.html deleted file mode 100644 index 0587f26..0000000 --- a/dashboard/public/modules/search/views/types/storagedesc.html +++ /dev/null @@ -1,21 +0,0 @@ -<!-- - ~ 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. - --> - -<h4><a data-ui-sref="details({id:result['$id$'].id})">{{result.name}}</a></h4> -<p><b>compressed: </b>{{result.compressed}},<b>outputFormat: </b>{{result.outputFormat}},<b>location: </b>{{result.location}}, <b>inputFormat: </b>{{result.inputFormat}}</p> -<h5>Tags : <a ng-repeat="(key, value) in result['$traits$']" data-ui-sref="search.results({query: key})">{{key}}</a> </h5> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/a05f752d/dashboard/public/modules/search/views/types/table.html ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/search/views/types/table.html b/dashboard/public/modules/search/views/types/table.html deleted file mode 100644 index a678ff9..0000000 --- a/dashboard/public/modules/search/views/types/table.html +++ /dev/null @@ -1,22 +0,0 @@ -<!-- - ~ 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. - --> - -<h4><a data-ui-sref="details({id:result['$id$'].id})">{{result.name}}</a></h4> -<p>{{result.description}}</p> -<p><b>owner: </b>{{result.owner}}, <b>createTime: </b>{{result.createTime}}</p> -<h5>Tags : <a ng-repeat="(key, value) in result['$traits$']" data-ui-sref="search.results({query: key})">{{key}}</a> </h5> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/a05f752d/dashboard/public/modules/search/views/types/view.html ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/search/views/types/view.html b/dashboard/public/modules/search/views/types/view.html deleted file mode 100644 index 1bf6fc7..0000000 --- a/dashboard/public/modules/search/views/types/view.html +++ /dev/null @@ -1,21 +0,0 @@ -<!-- - ~ 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. - --> - -<h4><a data-ui-sref="details({id:result['$id$'].id})">{{result.name}}</a></h4> -<p><b>inputTables: </b><a ng-repeat="inputs in result.inputTables" data-ui-sref="details({id: inputs.id})">{{ inputs.id}}</a></p> -<h5>Tags : <a ng-repeat="(key, value) in result['$traits$']" data-ui-sref="search.results({query: key})">{{key}}</a> </h5> http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/a05f752d/dashboard/public/modules/tags/definition/definitionTagsController.js ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/tags/definition/definitionTagsController.js b/dashboard/public/modules/tags/definition/definitionTagsController.js deleted file mode 100755 index 40f77bc..0000000 --- a/dashboard/public/modules/tags/definition/definitionTagsController.js +++ /dev/null @@ -1,80 +0,0 @@ -/* - * 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. - */ -'use strict'; - -angular.module('dgc.tags.definition').controller('definitionTagsController', ['$scope', '$resource', '$state', '$stateParams', 'lodash', 'attributeDefinition', 'tagClasses', 'tagsResource', 'notificationService', 'navigationResource', '$cacheFactory', 'atlasConfig', - function($scope, $resource, $state, $stateParams, _, attributeDefinition, categories, tagsResource, notificationService, navigationResource, $cacheFactory, atlasConfig) { - $scope.categoryList = categories; - $scope.category = 'TRAIT'; - $scope.tagModel = { - typeName: null, - typeDescription: null, - superTypes: [], - attributeDefinitions: [] - }; - $scope.typesList = navigationResource.get(); - $scope.newtagModel = angular.copy($scope.tagModel); - $scope.addAttribute = function addAttribute() { - $scope.tagModel.attributeDefinitions.push(attributeDefinition.getModel()); - }; - - $scope.removeAttribute = function(index) { - $scope.tagModel.attributeDefinitions.splice(index, 1); - }; - - $scope.categoryChange = function categorySwitched() { - $scope.categoryInst = categories[$scope.category].clearTags(); - }; - - $scope.reset = function() { - $scope.tagModel = angular.copy($scope.newtagModel); - $scope.selectedParent = undefined; - }; - - $scope.refreshTags = function() { - var httpDefaultCache = $cacheFactory.get('$http'); - httpDefaultCache.remove(atlasConfig.API_ENDPOINTS.TRAITS_LIST); - $scope.typesList = navigationResource.get(); - }; - - $scope.save = function saveTag(form) { - $scope.savedTag = null; - if (form.$valid) { - $scope.tagModel.superTypes = $scope.selectedParent; - $scope.categoryInst = categories[$scope.category]; - $scope.categoryInst.clearTags().addTag($scope.tagModel); - - notificationService.reset(); - $scope.saving = true; - - tagsResource.save($scope.categoryInst.toJson()).$promise - .then(function tagCreateSuccess() { - notificationService.info('"' + $scope.tagModel.typeName + '" has been created', false); - var httpDefaultCache = $cacheFactory.get('$http'); - httpDefaultCache.remove(atlasConfig.API_ENDPOINTS.TRAITS_LIST); - $scope.typesList = navigationResource.get(); - $scope.reset(); - }).catch(function tagCreateFailed(error) { - notificationService.error(error.data.error, false); - }).finally(function() { - $scope.saving = false; - }); - } - }; - } -]); http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/a05f752d/dashboard/public/modules/tags/definition/definitionTagsModule.js ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/tags/definition/definitionTagsModule.js b/dashboard/public/modules/tags/definition/definitionTagsModule.js deleted file mode 100644 index eb2059f..0000000 --- a/dashboard/public/modules/tags/definition/definitionTagsModule.js +++ /dev/null @@ -1,21 +0,0 @@ -/* - * 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. - */ - -'use strict'; - -angular.module('dgc.tags.definition', []); http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/a05f752d/dashboard/public/modules/tags/definition/tagAttributeDefinition.js ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/tags/definition/tagAttributeDefinition.js b/dashboard/public/modules/tags/definition/tagAttributeDefinition.js deleted file mode 100644 index d0d34e3..0000000 --- a/dashboard/public/modules/tags/definition/tagAttributeDefinition.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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. - */ - -'use strict'; - -angular.module('dgc.tags.definition').service('attributeDefinition', function attribute() { - this.getModel = function getJson() { - return { - name: null, - dataTypeName: 'string', - multiplicity: 'optional', - isComposite: false, - isUnique: false, - isIndexable: true, - reverseAttributeName: null - }; - }; -}); http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/a05f752d/dashboard/public/modules/tags/definition/views/add.html ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/tags/definition/views/add.html b/dashboard/public/modules/tags/definition/views/add.html deleted file mode 100755 index 40d8d48..0000000 --- a/dashboard/public/modules/tags/definition/views/add.html +++ /dev/null @@ -1,146 +0,0 @@ -<!-- - ~ 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. - --> -<div class="row"> - <div class="app-form col-lg-12" data-ng-controller="definitionTagsController"> - <div class="panel panel-default"> - <div class="panel-heading"><h4>Tag Definition</h4></div> - <div class="panel-body inputs"> - <form data-name="tagForm" class="form-horizontal" novalidate role="form"> - <fieldset data-ng-disabled="saving"> - - <div class="form-group hide"> - <label for="category" class="col-sm-2 control-label">Category</label> - - <div class="col-sm-10"> - <select class="form-control" id="category" name="category" data-ng-model="category" data-ng-change="categoryChange()" required> - <option value="{{key}}" data-ng-repeat="(key, value) in categoryList" ng-selected="{{key===category}}">{{key}}</option> - </select> - </div> - </div> - <div class="form-group" > - <label for="typeName" class="col-sm-2 control-label">Tag Name</label> - - <div class="col-sm-10"> - <input type="text" class="form-control" name="typeName" id="typeName" placeholder="Tag Name" data-ng-model="tagModel.typeName" required/> - </div> - </div> - <div class="form-group"> - <label class="control-label col-sm-2" for="ParentTag">Parent Tag</label> - <div class="col-sm-5 mrt-8"> - <select ng-model="selectedParent" class="form-control h160" id="ParentTag" name="ParentTag" multiple> - <option ng-repeat="data in typesList" title="{{data}}">{{data}}</option> - </select> - </div> - <div class="mtop3"> - <a href ng-click="refreshTags()" class="pull-left"> - <img src="../img/refresh.png" title="Refreh parent tag list"> - </a> - </div> - </div> - <ng-form name="attributeForm"> - <div class="form-group" - data-ng-repeat-start="attribute in tagModel.attributeDefinitions"> - <label for="attributeId_{{$index}}" class="col-sm-2 control-label">Attribute name</label> - - <div class="col-sm-10"> - <!-- <div class="input-group"> --> - <input type="text" class="form-control" name="name" id="attributeId_{{$index}}" placeholder="Attribute name" data-ng-model="attribute.name" - required/> - <button class="remove" ng-click="removeAttribute($index)"><i class="fa fa-times"></i></button> - <!-- <i class="input-group-addon fa fa-2x" data-ng-class="{'fa-angle-double-down':!attribute.$$show, 'fa-angle-double-up':attribute.$$show}" - data-ng-click="attribute.$$show=!attribute.$$show"></i> --> - <!-- </div> --> - </div> - </div> - <div class="form-group" data-ng-class="{'has-error': attributeForm.name.$invalid && attributeForm.name.$dirty}" data-ng-show="attribute.$$show"> - <label for="attributeDatatype_{{$index}}" class="col-sm-2 control-label">Data Type </label> - - <div class="col-sm-10"> - <input type="text" class="form-control" name="name" id="attributeDatatype_{{$index}}" placeholder="dataTypeName" - data-ng-model="attribute.dataTypeName"/> - </div> - </div> - <div class="form-group" data-ng-class="{'has-error': attributeForm.name.$invalid && attributeForm.name.$dirty}" data-ng-show="attribute.$$show"> - <label for="attributeMultiplicity_{{$index}}" class="col-sm-2 control-label">Multiplicity</label> - - <div class="col-sm-10"> - <input type="text" class="form-control" name="name" id="attributeMultiplicity_{{$index}}" placeholder="multiplicity" - data-ng-model="attribute.multiplicity"/> - </div> - </div> - - <div class="form-group" data-ng-class="{'has-error': attributeForm.name.$invalid && attributeForm.name.$dirty}" data-ng-show="attribute.$$show"> - <label for="attributeIscomposite_{{$index}}" class="col-sm-2 control-label">isComposite</label> - - <div class="col-sm-10"> - <span class ="btn-toggle"> - <a class="btn-sm " ng-class="{true: 'btn-primary'}[attribute.isComposite]" ng-click="attribute.isComposite = true">true </a> - <a class="btn-sm " ng-class="{false: 'btn-danger'}[attribute.isComposite]" ng-click="attribute.isComposite = false"> false </a> - - </span> - </div> - </div> - <div class="form-group" data-ng-class="{'has-error': attributeForm.name.$invalid && attributeForm.name.$dirty}" data-ng-show="attribute.$$show"> - <label for="attributeIsunique_{{$index}}" class="col-sm-2 control-label">isUnique</label> - - <div class="col-sm-10"> - <span class ="btn-toggle"> - <a class="btn-sm " ng-class="{true: 'btn-primary'}[attribute.isUnique]" ng-click="attribute.isUnique = true">true </a> - <a class="btn-sm " ng-class="{false: 'btn-danger'}[attribute.isUnique]" ng-click="attribute.isUnique = false"> false </a> - - </span> - </div> - </div> - <div class="form-group" data-ng-class="{'has-error': attributeForm.name.$invalid && attributeForm.name.$dirty}" data-ng-show="attribute.$$show"> - <label for="attributeIndexable_{{$index}}" class="col-sm-2 control-label">isIndexable</label> - - <div class="col-sm-10"> - <span class ="btn-toggle"> - <a class="btn-sm " ng-class="{true: 'btn-primary'}[attribute.isIndexable]" ng-click="attribute.isIndexable = true">true </a> - <a class="btn-sm " ng-class="{false: 'btn-danger'}[attribute.isIndexable]" ng-click="attribute.isIndexable = false"> false </a> - - </span> - </div> - </div> - <div class="form-group" data-ng-class="{'has-error': attributeForm.name.$invalid && attributeForm.name.$dirty}" data-ng-show="attribute.$$show" - data-ng-repeat-end> - <label for="attributeReverseName_{{$index}}" class="col-sm-2 control-label">reverseAttributeName</label> - - <div class="col-sm-10"> - <input type="text" class="form-control" name="reverseName" id="attributeReverseName_{{$index}}" placeholder="reverseAttributeName" - data-ng-model="attribute.reverseAttributeName"/> - </div> - </div> - </ng-form> - <div class="form-group text-right"> - <div class="col-sm-offset-2 col-sm-10"> - - <button data-ng-click="addAttribute()" class="btn btn-default addAttr"><i class="fa fa-plus"></i> Add Attribute</button> - </div> - </div> - <div class="form-group panel-footer"> - <div class="col-sm-12 text-right padding0"> - <button type="submit" data-ng-click="save(tagForm)" data-ng-disabled="tagForm.$invalid" class="btn btn-primary saveAttr">Save</button> - </div> - </div> - </fieldset> - </form> - </div> - </div> - </div> -</div> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/a05f752d/dashboard/public/modules/tags/instance/createTagController.js ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/tags/instance/createTagController.js b/dashboard/public/modules/tags/instance/createTagController.js deleted file mode 100644 index c16e08e..0000000 --- a/dashboard/public/modules/tags/instance/createTagController.js +++ /dev/null @@ -1,96 +0,0 @@ -/* - * 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. - */ -'use strict'; - -angular.module('dgc.tags.instance').controller('createTagController', ['$scope', 'detailsResource', '$modalInstance', 'typesList', 'lodash', 'tagsResource', '$stateParams', '$rootScope', 'tagClasses', 'notificationService', - function($scope, detailsResource, $modalInstance, typesList, _, tagsResource, $stateParams, $rootScope, categories) { - if (typesList) { - $scope.typesList = typesList; - } - var $$ = angular.element; - $scope.categoryList = categories; - $scope.category = 'TRAIT'; - $scope.isSuccess = false; - $scope.getAttributeDefinations = function() { - $scope.propertiesList = {}; - $scope.isRequired = {}; - $scope.getAttributeApi($scope.selectedType); - }; - - $scope.getAttributeApi = function(tagName) { - tagsResource.get({ - id: tagName - }, function(data) { - var instanceType = categories[$scope.category].instanceInfo(); - if (instanceType) { - var traitTypes = angular.fromJson(data.definition)[instanceType]; - - for (var t = 0; t < traitTypes.length; t++) { - if (traitTypes[t]) { - for (var indx = 0; indx < traitTypes[t].attributeDefinitions.length; indx++) { - var attrDefn = traitTypes[t].attributeDefinitions[indx]; - $scope.propertiesList[attrDefn.name] = ''; - $scope.isRequired[attrDefn.name] = attrDefn.isRequired; - } - } - - if (traitTypes[t].superTypes && traitTypes[t].superTypes.length > 0) { - for (var s = 0; s < traitTypes[t].superTypes.length; s++) { - $scope.getAttributeApi(traitTypes[t].superTypes[s]); - } - } - } - } - }); - }; - $scope.ok = function($event, tagDefinitionform) { - $scope.isSuccess = false; - if (tagDefinitionform.$valid) { - var requestObject = { - "jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Struct", - "typeName": $scope.selectedType, - "values": $scope.propertiesList - }; - detailsResource.saveTag({ - id: $stateParams.tId - }, requestObject).$promise.then(function(data) { - if (data.requestId !== undefined && data.GUID === $stateParams.tId) { - var tagName = $$("#tagDefinition").val(); - if ($stateParams.frm && $stateParams.frm !== 'details') { - $rootScope.updateTags(true, { - added: $scope.selectedType - }); - $$("#" + $stateParams.tId).append("<a class='tab-search-tags ng-binding ng-scope' data-ui-sref='search({query: " + tagName + "})' title='" + tagName + "' href='#!/search?query=" + tagName + "'>" + tagName + "<span> </span></a>"); - } else if ($stateParams.frm === 'details') { - $$("#" + $stateParams.tId + "_schema").append("<a class='tab-search-tags ng-binding ng-scope' data-ui-sref='search({query: " + tagName + "})' title='" + tagName + "' href='#!/search?query=" + tagName + "'>" + tagName + "<span> </span></a>"); - } - } - $scope.successmessage = 'Tag "' + $scope.selectedType + '" has been added to entity'; - $scope.isSuccess = true; - }).catch(function(err) { - $scope.isError = true; - $scope.error = err.data.error; - }); - } - }; - - $scope.cancel = function() { - $modalInstance.dismiss('cancel'); - }; - } -]); http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/a05f752d/dashboard/public/modules/tags/instance/instanceTagsController.js ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/tags/instance/instanceTagsController.js b/dashboard/public/modules/tags/instance/instanceTagsController.js deleted file mode 100644 index 75414ab..0000000 --- a/dashboard/public/modules/tags/instance/instanceTagsController.js +++ /dev/null @@ -1,98 +0,0 @@ -/* - * 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. - */ -'use strict'; - -angular.module('dgc.tags.instance').controller('instanceTagController', ['$scope', 'detailsResource', '$stateParams', '$state', - function($scope, detailsResource, $stateParams, $state) { - $scope.id = $stateParams.id; - var $$ = angular.element; - - function getResourceData() { - detailsResource.get({ - id: $stateParams.id - }, function(data) { - - angular.forEach(data.traits, function(obj, trait) { - var pair_arr = []; - if (obj.values !== null && Object.keys(obj.values).length > 0) { - angular.forEach(obj.values, function(value, key) { - var pair = key + ":" + value; - pair_arr.push(pair); - }); - data.traits[trait].values = pair_arr.join(" , "); - } else { - data.traits[trait].values = 'NA'; - } - }); - - $scope.traitsList = data.traits; - if ($.isEmptyObject($scope.traitsList)) { - $scope.noTags = true; - } - }); - } - - $scope.$on('add_Tag', function(evt, obj) { - $scope.traitsList[obj.added] = { - typeName: obj.added - }; - if ($.isEmptyObject($scope.traitsList)) { - $scope.noTags = true; - } else { - $scope.noTags = false; - } - }); - - $scope.openAddTag = function() { - $state.go('addTag', { - tId: $scope.id - }); - }; - - $scope.detachTag = function($event, name) { - $scope.displayName = name; - }; - - $scope.removeTag = function() { - $$("#myModal").modal(); - var name = $scope.displayName; - detailsResource.detachTag({ - id: $stateParams.id, - tagName: name - }, function(data) { - - if (data.requestId !== undefined && data.GUID === $stateParams.id && data.traitName === name) { - $$("#" + name).remove(); - delete $scope.traitsList[name]; - if ($.isEmptyObject($scope.traitsList)) { - $scope.noTags = true; - } else { - $scope.noTags = false; - } - } - }); - }; - - $scope.cancel = function() { - $$(".modal-backdrop").remove(); - }; - - getResourceData(); - $scope.$on('refreshResourceData', getResourceData); - } -]); http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/a05f752d/dashboard/public/modules/tags/instance/instanceTagsModule.js ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/tags/instance/instanceTagsModule.js b/dashboard/public/modules/tags/instance/instanceTagsModule.js deleted file mode 100644 index 5f7083d..0000000 --- a/dashboard/public/modules/tags/instance/instanceTagsModule.js +++ /dev/null @@ -1,21 +0,0 @@ -/* - * 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. - */ - -'use strict'; - -angular.module('dgc.tags.instance', []); http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/a05f752d/dashboard/public/modules/tags/instance/views/createTag.html ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/tags/instance/views/createTag.html b/dashboard/public/modules/tags/instance/views/createTag.html deleted file mode 100644 index 5937fb5..0000000 --- a/dashboard/public/modules/tags/instance/views/createTag.html +++ /dev/null @@ -1,64 +0,0 @@ -<!-- - ~ 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. - --> -<div class="modal-header"> - <h4 class="modal-title">Add tag - <button type="button" class="close" data-dismiss="modal" ng-click="cancel()">×</button> - </h4> -</div> -<div class="modal-body"> - <div class="form-group"> - <div align="center" class="error col-sm-12 tabsearch-result pointer" title="{{error}}" ng-show="isError"> - {{error}} - </div> - <div class="alert alert-success" ng-if="isSuccess" > - {{successmessage}} - </div> - </div> - <form name="tagDefinitionform" class="css-form" novalidate> - <div class="form-group hide"> - <label for="category" class="col-sm-4 control-label">Category</label> - <div class="col-sm-8 input-spacing"> - <select class="form-control" id="category" name="category" - ng-model="category" ng-change="categoryChange()" required> - <option value="{{key}}" - ng-repeat="(key, value) in categoryList" - ng-selected="{{key===category}}">{{key}}</option> - </select> - </div> - </div> - <div class="form-group" ng-class="{'has-error': (tagDefinitionform.tagDefinition.$invalid && tagDefinitionform.tagDefinition.$dirty)}"> - <label class="control-label col-sm-4" for="tagDefinition">Tag definition</label> - <div class="col-sm-8 input-spacing"> - <select ng-model="selectedType" class="form-control" id="tagDefinition" name="tagDefinition" - ng-change="getAttributeDefinations(); isError =false; isSuccess=false;" required> - <option ng-repeat="data in typesList " title="{{data}}">{{data}}</option> - </select> - </div> - </div> - <div class="form-group" ng-repeat="(key, value) in propertiesList" ng-class="{'has-error': (tagDefinitionform.propertyId_{{$index}}.$invalid && tagDefinitionform.propertyId_{{$index}}.$dirty)}"> - <label class="control-label col-sm-4" for="propertyId_{{$index}}">{{key}}</label> - <div class="col-sm-8 input-spacing"> - <input type="text" class="form-control" id="propertyId_{{$index}}" name="propertyId_{{$index}}" ng-model="propertiesList[key]" ng-required="isRequired[key]"/> - </div> - </div> - <div class="modal-footer"> - <button class="btn btn-success" type="submit" ng-click="ok($event, tagDefinitionform)" ng-disabled="tagDefinitionform.$invalid">Save</button> - <button class="btn btn-warning" type="button" ng-click="cancel()">Cancel</button> - </div> - </form> -</div> http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/a05f752d/dashboard/public/modules/tags/instance/views/tags.html ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/tags/instance/views/tags.html b/dashboard/public/modules/tags/instance/views/tags.html deleted file mode 100644 index 77eb273..0000000 --- a/dashboard/public/modules/tags/instance/views/tags.html +++ /dev/null @@ -1,66 +0,0 @@ - - -<!-- - ~ 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. - --> -<div data-ng-controller="instanceTagController" > - <div> - <a ng-click="openAddTag()" class="add-tag btn btn-primary pull-right">Add Tag</a> - </div> - <table class="table table-bordered"> - <thead> - <tr> - <th>Tag</th> - <th>Attributes</th> - <th>Tools</th> - </tr> - </thead> - <tbody> - <tr ng-repeat="trait in traitsList" class="pointer" ng-if="!noTags" id="{{trait.typeName}}"> - <td class="col-lg-5" > - {{trait.typeName}} - </td> - <td class="col-lg-5 tag-attr" > - {{trait.values}} - </td> - <td class="col-lg-1 tag-align"> - <a href="" class="deleteTag confirm-delete" data-toggle="modal" data-target="#myModal" ><i class="fa fa-trash-o " ng-click="detachTag($event, trait.typeName)"></i></a> - </td> - </tr> - </tbody> - </table> - <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> - <div class="modal-dialog" role="document"> - <div class="modal-content"> - <div class="modal-header"> - <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> - <h4 class="modal-title" id="myModalLabel">Are you sure you want to delete ? </h4> - </div> - <div class="modal-body"> - <b> Tag : {{displayName}} </b> - </div> - <div class="modal-footer"> - <button type="button" class="btn btn-default" data-dismiss="modal" ng-click="cancel()">Close</button> - <button type="button" id="btnDelete" class="btn btn-primary" data-dismiss="modal" ng-click="removeTag()">Delete</button> - </div> - </div> - </div> - </div> - <div ng-if="noTags" class="no-tags"> - No tags to display - </div> -</div> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/a05f752d/dashboard/public/modules/tags/tagClasses.js ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/tags/tagClasses.js b/dashboard/public/modules/tags/tagClasses.js deleted file mode 100644 index 375d911..0000000 --- a/dashboard/public/modules/tags/tagClasses.js +++ /dev/null @@ -1,88 +0,0 @@ -/* - * 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. - */ - -'use strict'; - -angular.module('dgc.tags').factory('tagClasses', ['lodash', function classFactory(_) { - - function Tag(props) { - return _.merge({ - superTypes: [], - typeName: null, - typeDescription: null, - attributeDefinitions: [] - }, props); - } - - var classes = { - ENUM: 'org.apache.atlas.typesystem.types.EnumType', - TRAIT: 'org.apache.atlas.typesystem.types.TraitType', - STRUCT: 'org.apache.atlas.typesystem.types.StructType', - CLASS: 'org.apache.atlas.typesystem.types.ClassType' - }; - - var instanceRespons = { - ENUM: 'enumTypes', - STRUCT: 'structTypes', - TRAIT: 'traitTypes', - SUPER: 'superTypes' - }; - - function Class(classId, className) { - this.tags = []; - this.id = classId; - this.name = className; - - this.addTag = function addTag(props) { - var tag = new Tag(_.merge({ - hierarchicalMetaTypeName: className - }, props)); - - this.tags.push(tag); - return this; - }; - - this.clearTags = function removeTags() { - this.tags = []; - return this; - }; - - this.toJson = function createJson() { - var classTypeKey = (this.id.toLowerCase() + 'Types'), - output = {}; - - _.forEach(classes, function addTypesArray(className, classKey) { - output[classKey.toLowerCase() + 'Types'] = []; - }); - - output[classTypeKey] = this.tags; - return output; - }; - - this.instanceInfo = function() { - return instanceRespons[classId]; - }; - } - - return _.chain(classes) - .map(function createClass(className, classId) { - return new Class(classId, className); - }) - .indexBy('id') - .value(); -}]); http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/a05f752d/dashboard/public/modules/tags/tagsModule.js ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/tags/tagsModule.js b/dashboard/public/modules/tags/tagsModule.js deleted file mode 100755 index 6bed79d..0000000 --- a/dashboard/public/modules/tags/tagsModule.js +++ /dev/null @@ -1,21 +0,0 @@ -/* - * 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. - */ - -'use strict'; - -angular.module('dgc.tags', ['dgc.details']); http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/a05f752d/dashboard/public/modules/tags/tagsResource.js ---------------------------------------------------------------------- diff --git a/dashboard/public/modules/tags/tagsResource.js b/dashboard/public/modules/tags/tagsResource.js deleted file mode 100755 index 02c0481..0000000 --- a/dashboard/public/modules/tags/tagsResource.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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. - */ - -'use strict'; - -angular.module('dgc.tags').factory('tagsResource', ['$resource', 'atlasConfig', function($resource, atlasConfig) { - return $resource(atlasConfig.API_ENDPOINTS.CREATE_TRAIT + '/:id', {}, { - query: { - method: 'GET', - transformResponse: function(data) { - var categories = []; - if (data) { - angular.forEach(data.results, function(value) { - categories.push({ - text: value - }); - }); - } - return categories; - }, - responseType: 'json', - isArray: true - } - }); - -}]);
