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
2b9aa84d
Commit
2b9aa84d
authored
6 years ago
by
Abhishek Kadam
Committed by
Sarath Subramanian
6 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-2970: UI: Show counts besides the Type and Classification dropdown list in search
Signed-off-by:
Sarath Subramanian
<
ssubramanian@hortonworks.com
>
parent
ed795dc4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
15 deletions
+42
-15
main.js
dashboardv2/public/js/main.js
+15
-2
Router.js
dashboardv2/public/js/router/Router.js
+3
-2
UrlLinks.js
dashboardv2/public/js/utils/UrlLinks.js
+3
-0
SearchLayoutView.js
dashboardv2/public/js/views/search/SearchLayoutView.js
+21
-11
No files found.
dashboardv2/public/js/main.js
View file @
2b9aa84d
...
...
@@ -200,7 +200,7 @@ require(['App',
'select2'
],
function
(
App
,
Router
,
CommonViewFunction
,
Globals
,
UrlLinks
,
VEntityList
,
VTagList
)
{
var
that
=
this
;
this
.
asyncFetchCounter
=
5
;
this
.
asyncFetchCounter
=
6
;
this
.
entityDefCollection
=
new
VEntityList
();
this
.
entityDefCollection
.
url
=
UrlLinks
.
entitiesDefApiUrl
();
this
.
typeHeaders
=
new
VTagList
();
...
...
@@ -209,12 +209,16 @@ require(['App',
this
.
enumDefCollection
.
url
=
UrlLinks
.
enumDefApiUrl
();
this
.
enumDefCollection
.
modelAttrName
=
"enumDefs"
;
this
.
classificationDefCollection
=
new
VTagList
();
this
.
entityCountCollection
=
new
VTagList
();
this
.
entityCountCollection
.
url
=
UrlLinks
.
entityCountApi
();
this
.
entityCountCollection
.
modelAttrName
=
"data"
;
App
.
appRouter
=
new
Router
({
entityDefCollection
:
this
.
entityDefCollection
,
typeHeaders
:
this
.
typeHeaders
,
enumDefCollection
:
this
.
enumDefCollection
,
classificationDefCollection
:
this
.
classificationDefCollection
classificationDefCollection
:
this
.
classificationDefCollection
,
entityCountCollection
:
this
.
entityCountCollection
});
var
startApp
=
function
()
{
...
...
@@ -293,4 +297,12 @@ require(['App',
startApp
();
}
});
this
.
entityCountCollection
.
fetch
({
skipDefaultError
:
true
,
complete
:
function
()
{
--
that
.
asyncFetchCounter
;
startApp
();
}
});
});
\ No newline at end of file
This diff is collapsed.
Click to expand it.
dashboardv2/public/js/router/Router.js
View file @
2b9aa84d
...
...
@@ -42,7 +42,7 @@ define([
'*actions'
:
'defaultAction'
},
initialize
:
function
(
options
)
{
_
.
extend
(
this
,
_
.
pick
(
options
,
'entityDefCollection'
,
'typeHeaders'
,
'enumDefCollection'
,
'classificationDefCollection'
));
_
.
extend
(
this
,
_
.
pick
(
options
,
'entityDefCollection'
,
'typeHeaders'
,
'enumDefCollection'
,
'classificationDefCollection'
,
'entityCountCollection'
));
this
.
showRegions
();
this
.
bindCommonEvents
();
this
.
listenTo
(
this
,
'route'
,
this
.
postRouteExecute
,
this
);
...
...
@@ -57,7 +57,8 @@ define([
'typeHeaders'
:
this
.
typeHeaders
,
'enumDefCollection'
:
this
.
enumDefCollection
,
'classificationDefCollection'
:
this
.
classificationDefCollection
,
'glossaryCollection'
:
this
.
glossaryCollection
'glossaryCollection'
:
this
.
glossaryCollection
,
'entityCountCollection'
:
this
.
entityCountCollection
}
this
.
sharedObj
=
{
searchTableColumns
:
{},
...
...
This diff is collapsed.
Click to expand it.
dashboardv2/public/js/utils/UrlLinks.js
View file @
2b9aa84d
...
...
@@ -40,6 +40,9 @@ define(['require', 'utils/Enums', 'utils/Utils', 'underscore'], function(require
enumDefApiUrl
:
function
(
name
)
{
return
this
.
getDefApiUrl
(
'enum'
,
name
);
},
entityCountApi
:
function
(){
return
this
.
baseUrl
+
'/admin/metrics'
},
getDefApiUrl
:
function
(
type
,
name
)
{
var
defApiUrl
=
this
.
typedefsUrl
(),
defUrl
;
if
(
name
)
{
...
...
This diff is collapsed.
Click to expand it.
dashboardv2/public/js/views/search/SearchLayoutView.js
View file @
2b9aa84d
...
...
@@ -89,8 +89,9 @@ define(['require',
* @constructs
*/
initialize
:
function
(
options
)
{
_
.
extend
(
this
,
_
.
pick
(
options
,
'value'
,
'typeHeaders'
,
'searchVent'
,
'entityDefCollection'
,
'enumDefCollection'
,
'classificationDefCollection'
,
'searchTableColumns'
,
'searchTableFilters'
));
_
.
extend
(
this
,
_
.
pick
(
options
,
'value'
,
'typeHeaders'
,
'searchVent'
,
'entityDefCollection'
,
'enumDefCollection'
,
'classificationDefCollection'
,
'searchTableColumns'
,
'searchTableFilters'
,
'entityCountCollection'
));
this
.
type
=
"basic"
;
this
.
entityCountObj
=
_
.
first
(
this
.
entityCountCollection
.
toJSON
());
var
param
=
Utils
.
getUrlState
.
getQueryParams
();
this
.
query
=
{
dsl
:
{
...
...
@@ -258,7 +259,7 @@ define(['require',
isTermEl
=
$el
.
data
(
'id'
)
==
"termLOV"
,
isTypeEl
=
$el
.
data
(
'id'
)
==
"typeLOV"
;
if
(
e
.
type
==
"change"
&&
$el
.
select2
(
'data'
))
{
var
value
=
$
el
.
val
(
),
var
value
=
$
(
$el
).
find
(
':selected'
).
data
(
'name'
),
key
=
"tag"
,
filterType
=
'tagFilters'
,
value
=
value
&&
value
.
length
?
value
:
null
;
...
...
@@ -310,9 +311,9 @@ define(['require',
}
}
var
that
=
this
,
value
=
this
.
ui
.
searchInput
.
val
()
||
this
.
ui
.
typeLov
.
val
(
);
value
=
this
.
ui
.
searchInput
.
val
()
||
$
(
this
.
ui
.
typeLov
).
find
(
':selected'
).
data
(
'name'
);
if
(
!
this
.
dsl
&&
!
value
)
{
value
=
this
.
ui
.
tagLov
.
val
()
||
this
.
ui
.
termLov
.
val
();
value
=
$
(
this
.
ui
.
tagLov
).
find
(
':selected'
).
data
(
'name'
)
||
$
(
this
.
ui
.
termLov
).
find
(
':selected'
).
data
(
'name'
)
}
if
(
value
&&
value
.
length
)
{
this
.
ui
.
searchBtn
.
removeAttr
(
"disabled"
);
...
...
@@ -445,10 +446,12 @@ define(['require',
this
.
typeHeaders
.
fullCollection
.
each
(
function
(
model
)
{
var
name
=
Utils
.
getName
(
model
.
toJSON
(),
'name'
);
if
(
model
.
get
(
'category'
)
==
'ENTITY'
)
{
typeStr
+=
'<option>'
+
(
name
)
+
'</option>'
;
var
entityCount
=
(
that
.
entityCountObj
.
entity
.
entityActive
[
name
]
+
(
that
.
entityCountObj
.
entity
.
entityDeleted
[
name
]
?
that
.
entityCountObj
.
entity
.
entityDeleted
[
name
]
:
0
));
typeStr
+=
'<option value="'
+
(
name
)
+
'" data-name="'
+
(
name
)
+
'">'
+
(
name
)
+
' '
+
(
entityCount
?
"("
+
entityCount
+
")"
:
''
)
+
'</option>'
;
}
if
(
model
.
get
(
'category'
)
==
'CLASSIFICATION'
)
{
tagStr
+=
'<option>'
+
(
name
)
+
'</option>'
;
var
tagEntityCount
=
that
.
entityCountObj
.
tag
.
tagEntities
[
name
];
tagStr
+=
'<option value="'
+
(
name
)
+
'" data-name="'
+
(
name
)
+
'">'
+
(
name
)
+
' '
+
(
tagEntityCount
?
"("
+
tagEntityCount
+
")"
:
''
)
+
'</option>'
;
}
});
//to insert extra classification list
...
...
@@ -459,7 +462,11 @@ define(['require',
that
.
ui
.
tagLov
.
html
(
tagStr
);
this
.
ui
.
typeLov
.
select2
({
placeholder
:
"Select Type"
,
allowClear
:
true
allowClear
:
true
,
templateSelection
:
function
(
data
,
container
)
{
$
(
data
.
element
).
attr
(
'data-name'
,
data
.
customValue
);
return
data
.
text
;
}
});
this
.
ui
.
tagLov
.
select2
({
placeholder
:
"Select Classification"
,
...
...
@@ -580,11 +587,14 @@ define(['require',
dslChecked
:
this
.
ui
.
searchType
.
is
(
':checked'
),
tagFilters
:
null
,
entityFilters
:
null
}
params
[
'type'
]
=
this
.
ui
.
typeLov
.
select2
(
'val'
)
||
null
;
},
typeLovValue
=
this
.
ui
.
typeLov
.
find
(
':selected'
).
data
(
'name'
),
tagLovValue
=
this
.
ui
.
tagLov
.
find
(
':selected'
).
data
(
'name'
),
termLovValue
=
this
.
ui
.
termLov
.
select2
(
'val'
)
params
[
'type'
]
=
typeLovValue
||
null
;
if
(
!
this
.
dsl
)
{
params
[
'tag'
]
=
t
his
.
ui
.
tagLov
.
select2
(
'val'
)
||
null
;
params
[
'term'
]
=
t
his
.
ui
.
termLov
.
select2
(
'val'
)
||
null
;
params
[
'tag'
]
=
t
agLovValue
||
null
;
params
[
'term'
]
=
t
ermLovValue
||
null
;
var
entityFilterObj
=
this
.
searchTableFilters
[
'entityFilters'
],
tagFilterObj
=
this
.
searchTableFilters
[
'tagFilters'
];
if
(
this
.
value
.
tag
)
{
...
...
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