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
4e62a062
Commit
4e62a062
authored
Jul 11, 2017
by
kevalbhatt
Committed by
Madhan Neethiraj
Jul 12, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-1902: updated search UI to allow user to select columns in search result
Signed-off-by:
Madhan Neethiraj
<
madhan@apache.org
>
parent
ea1c3b68
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
206 additions
and
36 deletions
+206
-36
gruntfile.js
dashboardv2/gruntfile.js
+3
-0
package.json
dashboardv2/package.json
+1
-0
main.scss
dashboardv2/public/css/scss/main.scss
+1
-1
override.scss
dashboardv2/public/css/scss/override.scss
+20
-2
index.html
dashboardv2/public/index.html
+1
-0
main.js
dashboardv2/public/js/main.js
+4
-0
CommonViewFunction.js
dashboardv2/public/js/utils/CommonViewFunction.js
+9
-3
TableLayout.js
dashboardv2/public/js/utils/TableLayout.js
+24
-13
AuditTableLayoutView.js
dashboardv2/public/js/views/audit/AuditTableLayoutView.js
+2
-2
CreateAuditTableLayoutView.js
...ardv2/public/js/views/audit/CreateAuditTableLayoutView.js
+2
-2
DetailPageLayoutView.js
...ardv2/public/js/views/detail_page/DetailPageLayoutView.js
+2
-2
EntityDetailTableLayoutView.js
...dv2/public/js/views/entity/EntityDetailTableLayoutView.js
+2
-2
SearchLayoutView.js
dashboardv2/public/js/views/search/SearchLayoutView.js
+16
-4
SearchResultLayoutView.js
dashboardv2/public/js/views/search/SearchResultLayoutView.js
+119
-5
No files found.
dashboardv2/gruntfile.js
View file @
4e62a062
...
@@ -119,6 +119,7 @@ module.exports = function(grunt) {
...
@@ -119,6 +119,7 @@ module.exports = function(grunt) {
'backgrid-orderable-columns/js'
:
'backgrid-orderable-columns/backgrid-orderable-columns.js'
,
'backgrid-orderable-columns/js'
:
'backgrid-orderable-columns/backgrid-orderable-columns.js'
,
'backgrid-paginator/js'
:
'backgrid-paginator/backgrid-paginator.min.js'
,
'backgrid-paginator/js'
:
'backgrid-paginator/backgrid-paginator.min.js'
,
'backgrid-sizeable-columns/js'
:
'backgrid-sizeable-columns/backgrid-sizeable-columns.js'
,
'backgrid-sizeable-columns/js'
:
'backgrid-sizeable-columns/backgrid-sizeable-columns.js'
,
'backgrid-columnmanager/js'
:
'backgrid-columnmanager/src/Backgrid.ColumnManager.js'
,
'jquery-asBreadcrumbs/js'
:
'jquery-asBreadcrumbs/dist/jquery-asBreadcrumbs.min.js'
,
'jquery-asBreadcrumbs/js'
:
'jquery-asBreadcrumbs/dist/jquery-asBreadcrumbs.min.js'
,
'd3'
:
'd3/d3.min.js'
,
'd3'
:
'd3/d3.min.js'
,
'd3/'
:
'd3-tip/index.js'
,
'd3/'
:
'd3-tip/index.js'
,
...
@@ -144,6 +145,7 @@ module.exports = function(grunt) {
...
@@ -144,6 +145,7 @@ module.exports = function(grunt) {
'backgrid-orderable-columns/css'
:
'backgrid-orderable-columns/backgrid-orderable-columns.css'
,
'backgrid-orderable-columns/css'
:
'backgrid-orderable-columns/backgrid-orderable-columns.css'
,
'backgrid-paginator/css'
:
'backgrid-paginator/backgrid-paginator.css'
,
'backgrid-paginator/css'
:
'backgrid-paginator/backgrid-paginator.css'
,
'backgrid-sizeable-columns/css'
:
'backgrid-sizeable-columns/backgrid-sizeable-columns.css'
,
'backgrid-sizeable-columns/css'
:
'backgrid-sizeable-columns/backgrid-sizeable-columns.css'
,
'backgrid-columnmanager/css'
:
'backgrid-columnmanager/lib/Backgrid.ColumnManager.css'
,
'jquery-asBreadcrumbs/css'
:
'jquery-asBreadcrumbs/dist/css/asBreadcrumbs.min.css'
,
'jquery-asBreadcrumbs/css'
:
'jquery-asBreadcrumbs/dist/css/asBreadcrumbs.min.css'
,
'select2/css'
:
'select2/dist/css/select2.min.css'
,
'select2/css'
:
'select2/dist/css/select2.min.css'
,
'backgrid-select-all'
:
'backgrid-select-all/backgrid-select-all.min.css'
,
'backgrid-select-all'
:
'backgrid-select-all/backgrid-select-all.min.css'
,
...
@@ -172,6 +174,7 @@ module.exports = function(grunt) {
...
@@ -172,6 +174,7 @@ module.exports = function(grunt) {
'backgrid-orderable-columns'
:
'backgrid-orderable-columns/LICENSE-MIT'
,
'backgrid-orderable-columns'
:
'backgrid-orderable-columns/LICENSE-MIT'
,
'backgrid-paginator'
:
'backgrid-paginator/LICENSE-MIT'
,
'backgrid-paginator'
:
'backgrid-paginator/LICENSE-MIT'
,
'backgrid-sizeable-columns'
:
'backgrid-sizeable-columns/LICENSE-MIT'
,
'backgrid-sizeable-columns'
:
'backgrid-sizeable-columns/LICENSE-MIT'
,
'backgrid-columnmanager'
:
'backgrid-columnmanager/LICENSE'
,
'jquery-asBreadcrumbs'
:
'jquery-asBreadcrumbs/LICENSE'
,
'jquery-asBreadcrumbs'
:
'jquery-asBreadcrumbs/LICENSE'
,
'd3'
:
'd3/LICENSE'
,
'd3'
:
'd3/LICENSE'
,
'd3/'
:
'd3-tip/LICENSE'
,
'd3/'
:
'd3-tip/LICENSE'
,
...
...
dashboardv2/package.json
View file @
4e62a062
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
"backbone.paginator"
:
"2.0.5"
,
"backbone.paginator"
:
"2.0.5"
,
"backbone.wreqr"
:
"1.4.0"
,
"backbone.wreqr"
:
"1.4.0"
,
"backgrid"
:
"0.3.8"
,
"backgrid"
:
"0.3.8"
,
"backgrid-columnmanager"
:
"0.2.4"
,
"backgrid-filter"
:
"0.3.7"
,
"backgrid-filter"
:
"0.3.7"
,
"backgrid-orderable-columns"
:
"0.1.2"
,
"backgrid-orderable-columns"
:
"0.1.2"
,
"backgrid-paginator"
:
"0.3.9"
,
"backgrid-paginator"
:
"0.3.9"
,
...
...
dashboardv2/public/css/scss/main.scss
View file @
4e62a062
...
@@ -199,7 +199,7 @@ ul {
...
@@ -199,7 +199,7 @@ ul {
}
}
.termTableBreadcrumb
{
.termTableBreadcrumb
{
min-width
:
200px
;
/* min-width: 200px; */
/* width: 200px; */
/* width: 200px; */
/* display: inline-block; */
/* display: inline-block; */
i
{
i
{
...
...
dashboardv2/public/css/scss/override.scss
View file @
4e62a062
...
@@ -76,7 +76,7 @@
...
@@ -76,7 +76,7 @@
border-color
:
$color_jungle_green_approx
;
border-color
:
$color_jungle_green_approx
;
border-bottom-style
:
solid
;
border-bottom-style
:
solid
;
box-shadow
:
none
;
box-shadow
:
none
;
padding
:
20px
30
px
;
padding
:
20px
15
px
;
background-color
:
transparent
;
background-color
:
transparent
;
text-align
:
left
;
text-align
:
left
;
font-weight
:
800
;
font-weight
:
800
;
...
@@ -89,7 +89,7 @@
...
@@ -89,7 +89,7 @@
border-color
:
$color_gallery_approx
;
border-color
:
$color_gallery_approx
;
color
:
#333333
;
color
:
#333333
;
font-weight
:
100
;
font-weight
:
100
;
padding
:
1
5px
30
px
;
padding
:
1
0px
15
px
;
}
}
.backgrid-paginator
ul
>
li
>
a
:hover
,
.backgrid-paginator
ul
>
li
>
a
:hover
,
...
@@ -286,3 +286,21 @@
...
@@ -286,3 +286,21 @@
.query-builder
.rule-value-container
input
{
.query-builder
.rule-value-container
input
{
padding
:
6px
12px
!
important
;
padding
:
6px
12px
!
important
;
}
}
div
.columnmanager-visibilitycontrol
{
width
:
auto
;
margin-bottom
:
5px
;
}
.columnmanager-dropdown-container
>
li
>
span
.column-label
{
width
:
auto
;
}
div
.columnmanager-dropdown-container.open
{
overflow
:
auto
;
}
.columnmanager-visibilitycontrol.open
.btn-atlasAction
{
background-color
:
#37bb9b
;
color
:
#fff
;
}
dashboardv2/public/index.html
View file @
4e62a062
...
@@ -42,6 +42,7 @@
...
@@ -42,6 +42,7 @@
<link
rel=
"stylesheet"
href=
"js/libs/backgrid-paginator/css/backgrid-paginator.css"
>
<link
rel=
"stylesheet"
href=
"js/libs/backgrid-paginator/css/backgrid-paginator.css"
>
<link
rel=
"stylesheet"
href=
"js/libs/backgrid-orderable-columns/css/backgrid-orderable-columns.css"
>
<link
rel=
"stylesheet"
href=
"js/libs/backgrid-orderable-columns/css/backgrid-orderable-columns.css"
>
<link
rel=
"stylesheet"
href=
"js/libs/backgrid-sizeable-columns/css/backgrid-sizeable-columns.css"
>
<link
rel=
"stylesheet"
href=
"js/libs/backgrid-sizeable-columns/css/backgrid-sizeable-columns.css"
>
<link
rel=
"stylesheet"
href=
"js/libs/backgrid-columnmanager/css/Backgrid.ColumnManager.css"
>
<link
rel=
"stylesheet"
href=
"js/libs/select2/css/select2.min.css"
>
<link
rel=
"stylesheet"
href=
"js/libs/select2/css/select2.min.css"
>
<link
rel=
"stylesheet"
href=
"js/libs/bootstrap/css/bootstrap.min.css"
>
<link
rel=
"stylesheet"
href=
"js/libs/bootstrap/css/bootstrap.min.css"
>
<link
rel=
"stylesheet"
href=
"js/libs/jquery-asBreadcrumbs/css/asBreadcrumbs.min.css"
>
<link
rel=
"stylesheet"
href=
"js/libs/jquery-asBreadcrumbs/css/asBreadcrumbs.min.css"
>
...
...
dashboardv2/public/js/main.js
View file @
4e62a062
...
@@ -84,6 +84,9 @@ require.config({
...
@@ -84,6 +84,9 @@ require.config({
'backgrid-select-all'
:
{
'backgrid-select-all'
:
{
'deps'
:
[
'backbone'
,
'backgrid'
]
'deps'
:
[
'backbone'
,
'backgrid'
]
},
},
'backgrid-columnmanager'
:
{
'deps'
:
[
'backbone'
,
'backgrid'
],
},
'hbs'
:
{
'hbs'
:
{
'deps'
:
[
'underscore'
,
'handlebars'
]
'deps'
:
[
'underscore'
,
'handlebars'
]
},
},
...
@@ -126,6 +129,7 @@ require.config({
...
@@ -126,6 +129,7 @@ require.config({
'backgrid-orderable'
:
'libs/backgrid-orderable-columns/js/backgrid-orderable-columns'
,
'backgrid-orderable'
:
'libs/backgrid-orderable-columns/js/backgrid-orderable-columns'
,
'backgrid-paginator'
:
'libs/backgrid-paginator/js/backgrid-paginator.min'
,
'backgrid-paginator'
:
'libs/backgrid-paginator/js/backgrid-paginator.min'
,
'backgrid-sizeable'
:
'libs/backgrid-sizeable-columns/js/backgrid-sizeable-columns'
,
'backgrid-sizeable'
:
'libs/backgrid-sizeable-columns/js/backgrid-sizeable-columns'
,
'backgrid-columnmanager'
:
'libs/backgrid-columnmanager/js/Backgrid.ColumnManager'
,
'asBreadcrumbs'
:
'libs/jquery-asBreadcrumbs/js/jquery-asBreadcrumbs.min'
,
'asBreadcrumbs'
:
'libs/jquery-asBreadcrumbs/js/jquery-asBreadcrumbs.min'
,
'd3'
:
'libs/d3/d3.min'
,
'd3'
:
'libs/d3/d3.min'
,
'd3-tip'
:
'libs/d3/index'
,
'd3-tip'
:
'libs/d3/index'
,
...
...
dashboardv2/public/js/utils/CommonViewFunction.js
View file @
4e62a062
...
@@ -92,7 +92,8 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
...
@@ -92,7 +92,8 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
var
scope
=
options
.
scope
,
var
scope
=
options
.
scope
,
valueObject
=
options
.
valueObject
,
valueObject
=
options
.
valueObject
,
extractJSON
=
options
.
extractJSON
,
extractJSON
=
options
.
extractJSON
,
entityDef
=
options
.
entityDef
;
isTable
=
_
.
isUndefined
(
options
.
isTable
)
?
true
:
options
.
isTable
,
attributeDefs
=
options
.
attributeDefs
;
var
table
=
""
,
var
table
=
""
,
fetchInputOutputValue
=
function
(
id
)
{
fetchInputOutputValue
=
function
(
id
)
{
...
@@ -212,7 +213,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
...
@@ -212,7 +213,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
_
.
sortBy
(
_
.
keys
(
valueObject
)).
map
(
function
(
key
)
{
_
.
sortBy
(
_
.
keys
(
valueObject
)).
map
(
function
(
key
)
{
key
=
_
.
escape
(
key
);
key
=
_
.
escape
(
key
);
var
keyValue
=
valueObject
[
key
];
var
keyValue
=
valueObject
[
key
];
var
defEntity
=
_
.
find
(
entityDef
,
{
name
:
key
});
var
defEntity
=
_
.
find
(
attributeDefs
,
{
name
:
key
});
if
(
defEntity
&&
defEntity
.
typeName
)
{
if
(
defEntity
&&
defEntity
.
typeName
)
{
var
defEntityType
=
defEntity
.
typeName
.
toLocaleLowerCase
();
var
defEntityType
=
defEntity
.
typeName
.
toLocaleLowerCase
();
if
(
defEntityType
===
'date'
||
defEntityType
===
'time'
)
{
if
(
defEntityType
===
'date'
||
defEntityType
===
'time'
)
{
...
@@ -225,7 +226,12 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
...
@@ -225,7 +226,12 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
keyValue
=
extractObject
(
keyValue
)
keyValue
=
extractObject
(
keyValue
)
}
}
}
}
table
+=
'<tr><td>'
+
_
.
escape
(
key
)
+
'</td><td>'
+
(
_
.
isObject
(
valueObject
[
key
])
?
keyValue
:
_
.
escape
(
keyValue
))
+
'</td></tr>'
;
if
(
isTable
)
{
table
+=
'<tr><td>'
+
_
.
escape
(
key
)
+
'</td><td>'
+
(
_
.
isObject
(
valueObject
[
key
])
?
keyValue
:
_
.
escape
(
keyValue
))
+
'</td></tr>'
;
}
else
{
table
+=
'<div>'
+
(
_
.
isObject
(
valueObject
[
key
])
?
keyValue
:
_
.
escape
(
keyValue
))
+
'</div>'
;
}
});
});
return
table
;
return
table
;
}
}
...
...
dashboardv2/public/js/utils/TableLayout.js
View file @
4e62a062
...
@@ -26,7 +26,8 @@ define(['require',
...
@@ -26,7 +26,8 @@ define(['require',
'backgrid-paginator'
,
'backgrid-paginator'
,
'backgrid-sizeable'
,
'backgrid-sizeable'
,
'backgrid-orderable'
,
'backgrid-orderable'
,
'backgrid-select-all'
'backgrid-select-all'
,
'backgrid-columnmanager'
],
function
(
require
,
Backbone
,
FSTablelayoutTmpl
)
{
],
function
(
require
,
Backbone
,
FSTablelayoutTmpl
)
{
'use strict'
;
'use strict'
;
...
@@ -103,10 +104,13 @@ define(['require',
...
@@ -103,10 +104,13 @@ define(['require',
}
}
},
},
columnOpts
:
{
columnOpts
:
{
initialColumnsVisible
:
4
,
opts
:
{
// State settings
initialColumnsVisible
:
4
,
saveState
:
false
,
// State settings
loadStateOnInit
:
true
saveState
:
false
,
loadStateOnInit
:
true
},
visibilityControlOpts
:
{}
},
},
includePagination
:
true
,
includePagination
:
true
,
...
@@ -301,14 +305,20 @@ define(['require',
...
@@ -301,14 +305,20 @@ define(['require',
* ColumnManager for the table
* ColumnManager for the table
*/
*/
renderColumnManager
:
function
()
{
renderColumnManager
:
function
()
{
var
$el
=
this
.
$
(
"[data-id='control']"
);
var
that
=
this
,
var
colManager
=
new
Backgrid
.
Extension
.
ColumnManager
(
this
.
columns
,
this
.
columnOpts
);
$el
=
this
.
$
(
"[data-id='control']"
),
// Add control
colManager
=
new
Backgrid
.
Extension
.
ColumnManager
(
this
.
columns
,
this
.
columnOpts
.
opts
),
var
colVisibilityControl
=
new
Backgrid
.
Extension
.
ColumnManagerVisibilityControl
({
// Add control
col
umnManager
:
colManager
col
VisibilityControl
=
new
Backgrid
.
Extension
.
ColumnManagerVisibilityControl
(
_
.
extend
({
});
columnManager
:
colManager
,
},
this
.
columnOpts
.
visibilityControlOpts
));
$el
.
append
(
colVisibilityControl
.
render
().
el
);
$el
.
append
(
colVisibilityControl
.
render
().
el
);
colManager
.
on
(
"state-changed"
,
function
(
state
)
{
that
.
collection
.
trigger
(
"state-changed"
,
state
);
});
colManager
.
on
(
"state-saved"
,
function
()
{
that
.
collection
.
trigger
(
"state-changed"
);
});
},
},
renderSizeAbleColumns
:
function
()
{
renderSizeAbleColumns
:
function
()
{
...
@@ -323,7 +333,7 @@ define(['require',
...
@@ -323,7 +333,7 @@ define(['require',
// Add resize handlers
// Add resize handlers
var
sizeHandler
=
new
Backgrid
.
Extension
.
SizeAbleColumnsHandlers
({
var
sizeHandler
=
new
Backgrid
.
Extension
.
SizeAbleColumnsHandlers
({
sizeAbleColumns
:
sizeAbleCol
,
sizeAbleColumns
:
sizeAbleCol
,
grid
:
this
.
getGridObj
(),
//
grid: this.getGridObj(),
saveModelWidth
:
true
saveModelWidth
:
true
});
});
this
.
$
(
'thead'
).
before
(
sizeHandler
.
render
().
el
);
this
.
$
(
'thead'
).
before
(
sizeHandler
.
render
().
el
);
...
@@ -341,6 +351,7 @@ define(['require',
...
@@ -341,6 +351,7 @@ define(['require',
grid
:
this
.
getGridObj
(),
grid
:
this
.
getGridObj
(),
columns
:
this
.
columns
columns
:
this
.
columns
});
});
this
.
$
(
'thead'
).
before
(
sizeAbleCol
.
render
().
el
);
var
orderHandler
=
new
Backgrid
.
Extension
.
OrderableColumns
({
var
orderHandler
=
new
Backgrid
.
Extension
.
OrderableColumns
({
grid
:
this
.
getGridObj
(),
grid
:
this
.
getGridObj
(),
sizeAbleColumns
:
sizeAbleCol
sizeAbleColumns
:
sizeAbleCol
...
...
dashboardv2/public/js/views/audit/AuditTableLayoutView.js
View file @
4e62a062
...
@@ -57,7 +57,7 @@ define(['require',
...
@@ -57,7 +57,7 @@ define(['require',
* @constructs
* @constructs
*/
*/
initialize
:
function
(
options
)
{
initialize
:
function
(
options
)
{
_
.
extend
(
this
,
_
.
pick
(
options
,
'guid'
,
'entity'
,
'entityName'
,
'
entityDef
'
));
_
.
extend
(
this
,
_
.
pick
(
options
,
'guid'
,
'entity'
,
'entityName'
,
'
attributeDefs
'
));
this
.
entityCollection
=
new
VEntityList
();
this
.
entityCollection
=
new
VEntityList
();
this
.
limit
=
26
;
this
.
limit
=
26
;
this
.
entityCollection
.
url
=
UrlLinks
.
entityCollectionaudit
(
this
.
guid
);
this
.
entityCollection
.
url
=
UrlLinks
.
entityCollectionaudit
(
this
.
guid
);
...
@@ -239,7 +239,7 @@ define(['require',
...
@@ -239,7 +239,7 @@ define(['require',
that
.
action
=
$
(
e
.
target
).
data
(
"action"
);
that
.
action
=
$
(
e
.
target
).
data
(
"action"
);
var
eventModel
=
that
.
entityCollection
.
fullCollection
.
findWhere
({
'eventKey'
:
$
(
e
.
currentTarget
).
data
(
'modalid'
)
}).
toJSON
(),
var
eventModel
=
that
.
entityCollection
.
fullCollection
.
findWhere
({
'eventKey'
:
$
(
e
.
currentTarget
).
data
(
'modalid'
)
}).
toJSON
(),
collectionModel
=
new
that
.
entityCollection
.
model
(
eventModel
),
collectionModel
=
new
that
.
entityCollection
.
model
(
eventModel
),
view
=
new
CreateAuditTableLayoutView
({
guid
:
that
.
guid
,
entityModel
:
collectionModel
,
action
:
that
.
action
,
entity
:
that
.
entity
,
entityName
:
that
.
entityName
,
entityDef
:
that
.
entityDef
});
view
=
new
CreateAuditTableLayoutView
({
guid
:
that
.
guid
,
entityModel
:
collectionModel
,
action
:
that
.
action
,
entity
:
that
.
entity
,
entityName
:
that
.
entityName
,
attributeDefs
:
that
.
attributeDefs
});
var
modal
=
new
Modal
({
var
modal
=
new
Modal
({
title
:
that
.
action
,
title
:
that
.
action
,
content
:
view
,
content
:
view
,
...
...
dashboardv2/public/js/views/audit/CreateAuditTableLayoutView.js
View file @
4e62a062
...
@@ -55,7 +55,7 @@ define(['require',
...
@@ -55,7 +55,7 @@ define(['require',
* @constructs
* @constructs
*/
*/
initialize
:
function
(
options
)
{
initialize
:
function
(
options
)
{
_
.
extend
(
this
,
_
.
pick
(
options
,
'guid'
,
'entityModel'
,
'action'
,
'entity'
,
'entityName'
,
'
entityDef
'
));
_
.
extend
(
this
,
_
.
pick
(
options
,
'guid'
,
'entityModel'
,
'action'
,
'entity'
,
'entityName'
,
'
attributeDefs
'
));
},
},
bindEvents
:
function
()
{},
bindEvents
:
function
()
{},
onRender
:
function
()
{
onRender
:
function
()
{
...
@@ -84,7 +84,7 @@ define(['require',
...
@@ -84,7 +84,7 @@ define(['require',
var
tagHeader
=
((
name
?
name
:
this
.
entityName
));
var
tagHeader
=
((
name
?
name
:
this
.
entityName
));
this
.
ui
.
tagHeader
.
append
(
tagHeader
);
this
.
ui
.
tagHeader
.
append
(
tagHeader
);
this
.
ui
.
auditHeaderValue
.
html
(
'<th>Key</th><th>New Value</th>'
);
this
.
ui
.
auditHeaderValue
.
html
(
'<th>Key</th><th>New Value</th>'
);
table
=
CommonViewFunction
.
propertyTable
({
scope
:
this
,
valueObject
:
values
,
entityDef
:
this
.
entityDef
,
extractJSON
:
{
extractKey
:
'value'
}
});
table
=
CommonViewFunction
.
propertyTable
({
scope
:
this
,
valueObject
:
values
,
attributeDefs
:
this
.
attributeDefs
,
extractJSON
:
{
extractKey
:
'value'
}
});
if
(
table
.
length
)
{
if
(
table
.
length
)
{
this
.
ui
.
noData
.
hide
();
this
.
ui
.
noData
.
hide
();
this
.
ui
.
tableAudit
.
show
();
this
.
ui
.
tableAudit
.
show
();
...
...
dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js
View file @
4e62a062
...
@@ -242,12 +242,12 @@ define(['require',
...
@@ -242,12 +242,12 @@ define(['require',
},
},
getEntityDef
:
function
(
obj
)
{
getEntityDef
:
function
(
obj
)
{
var
data
=
this
.
entityDefCollection
.
fullCollection
.
findWhere
({
name
:
obj
.
entity
.
typeName
}).
toJSON
();
var
data
=
this
.
entityDefCollection
.
fullCollection
.
findWhere
({
name
:
obj
.
entity
.
typeName
}).
toJSON
();
var
entityDef
=
Utils
.
getNestedSuperTypeObj
({
var
attributeDefs
=
Utils
.
getNestedSuperTypeObj
({
data
:
data
,
data
:
data
,
attrMerge
:
true
,
attrMerge
:
true
,
collection
:
this
.
entityDefCollection
collection
:
this
.
entityDefCollection
});
});
obj
[
'
entityDef'
]
=
entityDef
;
obj
[
'
attributeDefs'
]
=
attributeDefs
;
this
.
renderEntityDetailTableLayoutView
(
obj
);
this
.
renderEntityDetailTableLayoutView
(
obj
);
this
.
renderAuditTableLayoutView
(
obj
);
this
.
renderAuditTableLayoutView
(
obj
);
},
},
...
...
dashboardv2/public/js/views/entity/EntityDetailTableLayoutView.js
View file @
4e62a062
...
@@ -48,7 +48,7 @@ define(['require',
...
@@ -48,7 +48,7 @@ define(['require',
* @constructs
* @constructs
*/
*/
initialize
:
function
(
options
)
{
initialize
:
function
(
options
)
{
_
.
extend
(
this
,
_
.
pick
(
options
,
'entity'
,
'referredEntities'
,
'typeHeaders'
,
'
entityDef
'
));
_
.
extend
(
this
,
_
.
pick
(
options
,
'entity'
,
'referredEntities'
,
'typeHeaders'
,
'
attributeDefs
'
));
this
.
entityModel
=
new
VEntity
({});
this
.
entityModel
=
new
VEntity
({});
},
},
bindEvents
:
function
()
{},
bindEvents
:
function
()
{},
...
@@ -65,7 +65,7 @@ define(['require',
...
@@ -65,7 +65,7 @@ define(['require',
});
});
attributeObject
.
columns
=
valueSorted
;
attributeObject
.
columns
=
valueSorted
;
}
}
var
table
=
CommonViewFunction
.
propertyTable
({
scope
:
this
,
valueObject
:
attributeObject
,
entityDef
:
this
.
entityDef
});
var
table
=
CommonViewFunction
.
propertyTable
({
scope
:
this
,
valueObject
:
attributeObject
,
attributeDefs
:
this
.
attributeDefs
});
that
.
ui
.
detailValue
.
append
(
table
);
that
.
ui
.
detailValue
.
append
(
table
);
}
}
});
});
...
...
dashboardv2/public/js/views/search/SearchLayoutView.js
View file @
4e62a062
...
@@ -403,16 +403,28 @@ define(['require',
...
@@ -403,16 +403,28 @@ define(['require',
},
},
triggerSearch
:
function
(
value
)
{
triggerSearch
:
function
(
value
)
{
this
.
query
[
this
.
type
].
query
=
value
||
null
;
this
.
query
[
this
.
type
].
query
=
value
||
null
;
var
params
=
{
searchType
:
this
.
type
,
dslChecked
:
this
.
ui
.
searchType
.
is
(
':checked'
)
}
this
.
query
[
this
.
type
].
type
=
this
.
ui
.
typeLov
.
select2
(
'val'
)
||
null
;
this
.
query
[
this
.
type
].
type
=
this
.
ui
.
typeLov
.
select2
(
'val'
)
||
null
;
if
(
!
this
.
dsl
)
{
if
(
!
this
.
dsl
)
{
this
.
query
[
this
.
type
].
tag
=
this
.
ui
.
tagLov
.
select2
(
'val'
)
||
null
;
this
.
query
[
this
.
type
].
tag
=
this
.
ui
.
tagLov
.
select2
(
'val'
)
||
null
;
}
}
if
(
this
.
dsl
)
{
params
[
'attributes'
]
=
null
;
}
else
{
var
columnList
=
JSON
.
parse
(
Utils
.
localStorage
.
getValue
(
'columnList'
));
if
(
columnList
)
{
params
[
'attributes'
]
=
columnList
[
this
.
query
[
this
.
type
].
type
];
}
else
{
params
[
'attributes'
]
=
null
;
}
}
Utils
.
setUrl
({
Utils
.
setUrl
({
url
:
'#!/search/searchResult'
,
url
:
'#!/search/searchResult'
,
urlParams
:
_
.
extend
(
this
.
query
[
this
.
type
],
{
urlParams
:
_
.
extend
(
this
.
query
[
this
.
type
],
params
),
searchType
:
this
.
type
,
dslChecked
:
this
.
ui
.
searchType
.
is
(
':checked'
)
}),
updateTabState
:
function
()
{
updateTabState
:
function
()
{
return
{
searchUrl
:
this
.
url
,
stateChanged
:
true
};
return
{
searchUrl
:
this
.
url
,
stateChanged
:
true
};
},
},
...
...
dashboardv2/public/js/views/search/SearchResultLayoutView.js
View file @
4e62a062
...
@@ -136,13 +136,22 @@ define(['require',
...
@@ -136,13 +136,22 @@ define(['require',
this
.
limit
=
25
;
this
.
limit
=
25
;
this
.
asyncFetchCounter
=
0
;
this
.
asyncFetchCounter
=
0
;
this
.
offset
=
0
;
this
.
offset
=
0
;
this
.
columnToShow
=
this
.
value
&&
this
.
value
.
attributes
?
this
.
value
.
attributes
.
split
(
','
)
:
[];
this
.
commonTableOptions
=
{
this
.
commonTableOptions
=
{
collection
:
this
.
searchCollection
,
collection
:
this
.
searchCollection
,
includeFilter
:
false
,
includePagination
:
false
,
includePagination
:
false
,
includePageSize
:
false
,
includeFooterRecords
:
false
,
includeFooterRecords
:
false
,
includeSizeAbleColumns
:
false
,
includeColumnManager
:
(
this
.
value
&&
this
.
value
.
searchType
===
"basic"
?
true
:
false
),
includeOrderAbleColumns
:
false
,
columnOpts
:
{
opts
:
{
initialColumnsVisible
:
null
,
saveState
:
false
},
visibilityControlOpts
:
{
buttonTemplate
:
_
.
template
(
"<button class='btn btn-atlasAction btn-atlas'>Columns <i class='fa fa-caret-down'></i></button>"
)
}
},
gridOpts
:
{
gridOpts
:
{
emptyText
:
'No Record found!'
,
emptyText
:
'No Record found!'
,
className
:
'table table-hover backgrid table-quickMenu'
className
:
'table table-hover backgrid table-quickMenu'
...
@@ -206,6 +215,25 @@ define(['require',
...
@@ -206,6 +215,25 @@ define(['require',
}
}
}
}
},
this
);
},
this
);
this
.
listenTo
(
this
.
searchCollection
,
"state-changed"
,
function
(
state
)
{
if
(
Utils
.
getUrlState
.
isSearchTab
())
{
this
.
updateColumnList
(
state
);
var
columnList
=
JSON
.
parse
(
Utils
.
localStorage
.
getValue
(
'columnList'
));
if
(
!
columnList
&&
this
.
value
.
type
)
{
columnList
=
{};
columnList
[
this
.
value
.
type
]
=
this
.
value
.
attributes
;
}
else
{
columnList
[
this
.
value
.
type
]
=
this
.
value
.
attributes
;
}
Utils
.
localStorage
.
setValue
(
'columnList'
,
JSON
.
stringify
(
columnList
));
Utils
.
setUrl
({
url
:
'#!/search/searchResult'
,
urlParams
:
this
.
value
,
mergeBrowserUrl
:
false
,
trigger
:
true
});
}
},
this
);
this
.
listenTo
(
this
.
searchVent
,
"search:refresh"
,
function
(
model
,
response
)
{
this
.
listenTo
(
this
.
searchVent
,
"search:refresh"
,
function
(
model
,
response
)
{
this
.
fetchCollection
();
this
.
fetchCollection
();
},
this
);
},
this
);
...
@@ -225,6 +253,7 @@ define(['require',
...
@@ -225,6 +253,7 @@ define(['require',
'searchType'
:
'basic'
'searchType'
:
'basic'
};
};
}
}
this
.
updateColumnList
();
this
.
fetchCollection
(
value
);
this
.
fetchCollection
(
value
);
$
(
'body'
).
click
(
function
(
e
)
{
$
(
'body'
).
click
(
function
(
e
)
{
var
iconEvnt
=
e
.
target
.
nodeName
;
var
iconEvnt
=
e
.
target
.
nodeName
;
...
@@ -242,6 +271,22 @@ define(['require',
...
@@ -242,6 +271,22 @@ define(['require',
}
}
this
.
showHideFilter
();
this
.
showHideFilter
();
},
},
updateColumnList
:
function
(
updatedList
)
{
if
(
updatedList
)
{
var
listOfColumns
=
[]
_
.
map
(
updatedList
,
function
(
obj
)
{
var
key
=
obj
.
name
;
if
(
key
==
"selected"
||
key
==
"displayText"
||
key
==
"description"
||
key
==
"typeName"
||
key
==
"owner"
||
key
==
"tag"
||
key
==
"terms"
)
{
return
;
}
if
(
obj
.
renderable
)
{
listOfColumns
.
push
(
obj
.
name
);
}
});
this
.
value
.
attributes
=
listOfColumns
.
length
?
listOfColumns
.
join
(
","
)
:
null
;
}
this
.
columnToShow
=
this
.
value
&&
this
.
value
.
attributes
?
this
.
value
.
attributes
.
split
(
','
)
:
[];
},
generateQueryOfFilter
:
function
()
{
generateQueryOfFilter
:
function
()
{
var
value
=
this
.
value
,
var
value
=
this
.
value
,
entityFilters
=
this
.
filterObj
&&
this
.
filterObj
.
entityFilters
?
this
.
filterObj
.
entityFilters
[
value
.
type
]
:
null
,
entityFilters
=
this
.
filterObj
&&
this
.
filterObj
.
entityFilters
?
this
.
filterObj
.
entityFilters
[
value
.
type
]
:
null
,
...
@@ -292,7 +337,8 @@ define(['require',
...
@@ -292,7 +337,8 @@ define(['require',
entityFilters
=
this
.
filterObj
&&
this
.
filterObj
.
entityFilters
?
this
.
filterObj
.
entityFilters
[
this
.
value
.
type
]
:
null
,
entityFilters
=
this
.
filterObj
&&
this
.
filterObj
.
entityFilters
?
this
.
filterObj
.
entityFilters
[
this
.
value
.
type
]
:
null
,
filterObj
=
{
filterObj
=
{
'entityFilters'
:
entityFilters
?
entityFilters
.
result
:
null
,
'entityFilters'
:
entityFilters
?
entityFilters
.
result
:
null
,
'tagFilters'
:
tagFilters
?
tagFilters
.
result
:
null
'tagFilters'
:
tagFilters
?
tagFilters
.
result
:
null
,
'attributes'
:
this
.
columnToShow
.
length
?
this
.
columnToShow
:
null
}
}
this
.
showLoader
();
this
.
showLoader
();
if
(
Globals
.
searchApiCallRef
&&
Globals
.
searchApiCallRef
.
readyState
===
1
)
{
if
(
Globals
.
searchApiCallRef
&&
Globals
.
searchApiCallRef
.
readyState
===
1
)
{
...
@@ -393,7 +439,21 @@ define(['require',
...
@@ -393,7 +439,21 @@ define(['require',
var
that
=
this
,
var
that
=
this
,
count
=
5
;
count
=
5
;
require
([
'utils/TableLayout'
],
function
(
TableLayout
)
{
require
([
'utils/TableLayout'
],
function
(
TableLayout
)
{
var
columns
=
new
Backgrid
.
Columns
(
that
.
getFixedDslColumn
());
var
columnCollection
=
Backgrid
.
Columns
.
extend
({
sortKey
:
"position"
,
comparator
:
function
(
item
)
{
return
item
.
get
(
this
.
sortKey
)
||
999
;
},
setPositions
:
function
()
{
_
.
each
(
this
.
models
,
function
(
model
,
index
)
{
model
.
set
(
"position"
,
index
+
1
,
{
silent
:
true
});
});
return
this
;
}
});
var
columns
=
new
columnCollection
(
that
.
getFixedDslColumn
());
columns
.
setPositions
().
sort
();
//var columns = new Backgrid.Columns(that.getFixedDslColumn());
that
.
REntityTableLayoutView
.
show
(
new
TableLayout
(
_
.
extend
({},
that
.
commonTableOptions
,
{
that
.
REntityTableLayoutView
.
show
(
new
TableLayout
(
_
.
extend
({},
that
.
commonTableOptions
,
{
columns
:
columns
columns
:
columns
})));
})));
...
@@ -438,6 +498,9 @@ define(['require',
...
@@ -438,6 +498,9 @@ define(['require',
cell
:
"html"
,
cell
:
"html"
,
editable
:
false
,
editable
:
false
,
sortable
:
false
,
sortable
:
false
,
resizeable
:
true
,
orderable
:
true
,
renderable
:
true
,
className
:
"searchTableName"
,
className
:
"searchTableName"
,
formatter
:
_
.
extend
({},
Backgrid
.
CellFormatter
.
prototype
,
{
formatter
:
_
.
extend
({},
Backgrid
.
CellFormatter
.
prototype
,
{
fromRaw
:
function
(
rawValue
,
model
)
{
fromRaw
:
function
(
rawValue
,
model
)
{
...
@@ -473,6 +536,9 @@ define(['require',
...
@@ -473,6 +536,9 @@ define(['require',
cell
:
"String"
,
cell
:
"String"
,
editable
:
false
,
editable
:
false
,
sortable
:
false
,
sortable
:
false
,
resizeable
:
true
,
orderable
:
true
,
renderable
:
true
,
formatter
:
_
.
extend
({},
Backgrid
.
CellFormatter
.
prototype
,
{
formatter
:
_
.
extend
({},
Backgrid
.
CellFormatter
.
prototype
,
{
fromRaw
:
function
(
rawValue
,
model
)
{
fromRaw
:
function
(
rawValue
,
model
)
{
var
obj
=
model
.
toJSON
();
var
obj
=
model
.
toJSON
();
...
@@ -487,6 +553,9 @@ define(['require',
...
@@ -487,6 +553,9 @@ define(['require',
cell
:
"Html"
,
cell
:
"Html"
,
editable
:
false
,
editable
:
false
,
sortable
:
false
,
sortable
:
false
,
resizeable
:
true
,
orderable
:
true
,
renderable
:
true
,
formatter
:
_
.
extend
({},
Backgrid
.
CellFormatter
.
prototype
,
{
formatter
:
_
.
extend
({},
Backgrid
.
CellFormatter
.
prototype
,
{
fromRaw
:
function
(
rawValue
,
model
)
{
fromRaw
:
function
(
rawValue
,
model
)
{
var
obj
=
model
.
toJSON
();
var
obj
=
model
.
toJSON
();
...
@@ -501,6 +570,9 @@ define(['require',
...
@@ -501,6 +570,9 @@ define(['require',
cell
:
"String"
,
cell
:
"String"
,
editable
:
false
,
editable
:
false
,
sortable
:
false
,
sortable
:
false
,
resizeable
:
true
,
orderable
:
true
,
renderable
:
true
,
formatter
:
_
.
extend
({},
Backgrid
.
CellFormatter
.
prototype
,
{
formatter
:
_
.
extend
({},
Backgrid
.
CellFormatter
.
prototype
,
{
fromRaw
:
function
(
rawValue
,
model
)
{
fromRaw
:
function
(
rawValue
,
model
)
{
var
obj
=
model
.
toJSON
();
var
obj
=
model
.
toJSON
();
...
@@ -515,7 +587,9 @@ define(['require',
...
@@ -515,7 +587,9 @@ define(['require',
cell
:
"Html"
,
cell
:
"Html"
,
editable
:
false
,
editable
:
false
,
sortable
:
false
,
sortable
:
false
,
resizeable
:
true
,
orderable
:
true
,
orderable
:
true
,
renderable
:
true
,
className
:
'searchTag'
,
className
:
'searchTag'
,
formatter
:
_
.
extend
({},
Backgrid
.
CellFormatter
.
prototype
,
{
formatter
:
_
.
extend
({},
Backgrid
.
CellFormatter
.
prototype
,
{
fromRaw
:
function
(
rawValue
,
model
)
{
fromRaw
:
function
(
rawValue
,
model
)
{
...
@@ -535,7 +609,9 @@ define(['require',
...
@@ -535,7 +609,9 @@ define(['require',
cell
:
"Html"
,
cell
:
"Html"
,
editable
:
false
,
editable
:
false
,
sortable
:
false
,
sortable
:
false
,
resizeable
:
true
,
orderable
:
true
,
orderable
:
true
,
renderable
:
true
,
className
:
'searchTerm'
,
className
:
'searchTerm'
,
formatter
:
_
.
extend
({},
Backgrid
.
CellFormatter
.
prototype
,
{
formatter
:
_
.
extend
({},
Backgrid
.
CellFormatter
.
prototype
,
{
fromRaw
:
function
(
rawValue
,
model
)
{
fromRaw
:
function
(
rawValue
,
model
)
{
...
@@ -553,6 +629,44 @@ define(['require',
...
@@ -553,6 +629,44 @@ define(['require',
})
})
};
};
}
}
if
(
this
.
value
&&
this
.
value
.
searchType
===
"basic"
)
{
var
def
=
this
.
entityDefCollection
.
fullCollection
.
find
({
name
:
this
.
value
.
type
});
if
(
def
)
{
var
attrObj
=
Utils
.
getNestedSuperTypeObj
({
data
:
def
.
toJSON
(),
collection
:
this
.
entityDefCollection
,
attrMerge
:
true
});
_
.
each
(
attrObj
,
function
(
obj
,
key
)
{
var
key
=
obj
.
name
,
isEenderable
=
that
.
columnToShow
.
length
?
_
.
contains
(
that
.
columnToShow
,
key
)
:
false
;
if
(
key
==
"name"
||
key
==
"description"
||
key
==
"owner"
)
{
return
;
}
col
[
obj
.
name
]
=
{
label
:
obj
.
name
.
capitalize
(),
cell
:
"Html"
,
editable
:
false
,
sortable
:
false
,
resizeable
:
true
,
orderable
:
true
,
renderable
:
isEenderable
,
formatter
:
_
.
extend
({},
Backgrid
.
CellFormatter
.
prototype
,
{
fromRaw
:
function
(
rawValue
,
model
)
{
var
modelObj
=
model
.
toJSON
();
if
(
modelObj
&&
modelObj
.
attributes
&&
!
_
.
isUndefined
(
modelObj
.
attributes
[
key
]))
{
var
tempObj
=
{
'scope'
:
that
,
'attributeDefs'
:
[
obj
],
'valueObject'
:
{},
'isTable'
:
false
}
tempObj
.
valueObject
[
key
]
=
modelObj
.
attributes
[
key
]
return
CommonViewFunction
.
propertyTable
(
tempObj
);
}
}
})
};
});
}
}
return
this
.
searchCollection
.
constructor
.
getTableCols
(
col
,
this
.
searchCollection
);
return
this
.
searchCollection
.
constructor
.
getTableCols
(
col
,
this
.
searchCollection
);
},
},
addTagModalView
:
function
(
guid
,
multiple
)
{
addTagModalView
:
function
(
guid
,
multiple
)
{
...
...
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