Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
atlas
Commits
21b403bb
Commit
21b403bb
authored
9 years ago
by
Anilsg
Committed by
Suma Shivaprasad
9 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-287: UI: GUID on table details page
Signed-off-by:
Suma Shivaprasad
<
sumasai.shivaprasad@gmail.com
>
parent
bd47628f
master
No related merge requests found
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
110 additions
and
26 deletions
+110
-26
detailsController.js
dashboard/public/modules/details/detailsController.js
+41
-9
details.html
dashboard/public/modules/details/views/details.html
+0
-0
searchController.js
dashboard/public/modules/search/searchController.js
+64
-12
search.html
dashboard/public/modules/search/views/search.html
+5
-5
No files found.
dashboard/public/modules/details/detailsController.js
View file @
21b403bb
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
dashboard/public/modules/details/views/details.html
View file @
21b403bb
This diff is collapsed.
Click to expand it.
dashboard/public/modules/search/searchController.js
View file @
21b403bb
...
...
@@ -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
);
}
}
...
...
This diff is collapsed.
Click to expand it.
dashboard/public/modules/search/views/search.html
View file @
21b403bb
...
...
@@ -49,7 +49,7 @@
<th>
Tools
</th>
</tr>
<tr
ng-if=
"isTag(resultType) && transformedProperties != undefined"
>
<th
ng-repeat=
"prop in transformedProperties"
ng-if=
"prop !== 'id'"
>
<th
ng-repeat=
"prop in transformedProperties"
ng-if=
"prop !== 'id'
&& prop !== 'guid'
"
>
{{(prop != '$traits$') ? prop : 'Tags'}}
</th>
</tr>
...
...
@@ -73,17 +73,17 @@
<td
class=
"addTag"
><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'
"
data-ng-repeat=
"res in transformedProperties track by $index"
class=
"wordBreak
"
>
<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'"
data-ui-sref=
"details({id:result[res]})"
>
{{result[res]}}
</a>
<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']
"
data-ui-sref=
"details({id:result['id']|| result['guid']})"
>
{{result[res]}}
</a>
<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[res]}}
</span>
<span
data-ng-if=
"res.toLowerCase().indexOf('name') != -1 && !result['id']
&& !result['guid']
"
>
{{result[res]}}
</span>
<div
data-ng-if=
"res == '$traits$'"
class=
"wordBreak tags"
id=
"{{result['id']|| result['guid']}}"
>
<a
class=
"tabsearchanchor"
ng-repeat=
"(key, value) in result[res]"
data-ui-sref=
"search({query: key})"
title=
"{{key}}"
>
{{key}}
<span>
</span></a>
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment