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
f5508315
Commit
f5508315
authored
Sep 28, 2017
by
kevalbhatt
Committed by
Madhan Neethiraj
Sep 29, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-2111 : UI: Select query is not able to render the search table in Advance search
Signed-off-by:
Madhan Neethiraj
<
madhan@apache.org
>
parent
5746ec9d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
113 additions
and
48 deletions
+113
-48
VSearchList.js
dashboardv2/public/js/collection/VSearchList.js
+9
-3
SearchResultLayoutView.js
dashboardv2/public/js/views/search/SearchResultLayoutView.js
+104
-45
No files found.
dashboardv2/public/js/collection/VSearchList.js
View file @
f5508315
...
...
@@ -39,16 +39,22 @@ define(['require',
this
.
queryText
=
resp
.
queryText
;
this
.
referredEntities
=
resp
.
referredEntities
;
if
(
resp
.
attributes
)
{
this
.
dynamicTable
=
true
;
var
entities
=
[];
_
.
each
(
resp
.
attributes
.
values
,
function
(
obj
)
{
var
temp
=
{
attributes
:
{}
}
_
.
each
(
obj
,
function
(
val
,
key
)
{
temp
.
attributes
[
resp
.
attributes
.
name
[
key
]]
=
val
;
var
temp
=
{};
_
.
each
(
obj
,
function
(
val
,
index
)
{
var
key
=
resp
.
attributes
.
name
[
index
];
if
(
key
==
"__guid"
)
{
key
=
"guid"
}
temp
[
key
]
=
val
;
});
entities
.
push
(
temp
);
});
return
entities
;
}
else
{
this
.
dynamicTable
=
false
;
return
resp
.
entities
?
resp
.
entities
:
[];
}
},
...
...
dashboardv2/public/js/views/search/SearchResultLayoutView.js
View file @
f5508315
...
...
@@ -525,7 +525,8 @@ define(['require',
return
this
;
}
});
var
columns
=
new
columnCollection
(
that
.
getFixedDslColumn
());
that
.
bradCrumbList
=
[];
var
columns
=
new
columnCollection
((
that
.
searchCollection
.
dynamicTable
?
that
.
getDaynamicColumns
(
that
.
searchCollection
.
toJSON
())
:
that
.
getFixedDslColumn
()));
columns
.
setPositions
().
sort
();
that
.
REntityTableLayoutView
.
show
(
new
TableLayout
(
_
.
extend
({},
that
.
commonTableOptions
,
{
columns
:
columns
...
...
@@ -679,7 +680,109 @@ define(['require',
}
})
};
this
.
getTagTermCol
({
'col'
:
col
,
'columnToShow'
:
columnToShow
});
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
,
isRenderable
=
_
.
contains
(
columnToShow
,
key
)
if
(
key
==
"name"
||
key
==
"description"
||
key
==
"owner"
)
{
if
(
columnToShow
)
{
col
[
key
].
renderable
=
isRenderable
;
}
return
;
}
col
[
obj
.
name
]
=
{
label
:
obj
.
name
.
capitalize
(),
cell
:
"Html"
,
editable
:
false
,
sortable
:
false
,
resizeable
:
true
,
orderable
:
true
,
renderable
:
isRenderable
,
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
]
Utils
.
findAndMergeRefEntity
(
tempObj
.
valueObject
,
that
.
searchCollection
.
referredEntities
);
return
CommonViewFunction
.
propertyTable
(
tempObj
);
}
}
})
};
});
}
}
}
return
this
.
searchCollection
.
constructor
.
getTableCols
(
col
,
this
.
searchCollection
);
},
getDaynamicColumns
:
function
(
valueObj
)
{
var
that
=
this
,
col
=
{};
if
(
valueObj
&&
valueObj
.
length
)
{
var
firstObj
=
_
.
first
(
valueObj
);
_
.
each
(
_
.
keys
(
firstObj
),
function
(
key
)
{
if
(
key
!==
'guid'
)
{
col
[
key
]
=
{
label
:
key
.
capitalize
(),
cell
:
"Html"
,
editable
:
false
,
sortable
:
false
,
resizeable
:
true
,
orderable
:
true
,
formatter
:
_
.
extend
({},
Backgrid
.
CellFormatter
.
prototype
,
{
fromRaw
:
function
(
rawValue
,
model
)
{
var
modelObj
=
model
.
toJSON
();
if
(
key
==
"name"
)
{
var
nameHtml
=
""
,
name
=
modelObj
[
key
];
if
(
modelObj
.
guid
)
{
nameHtml
=
'<a title="'
+
name
+
'" href="#!/detailPage/'
+
modelObj
.
guid
+
'">'
+
name
+
'</a>'
;
}
else
{
nameHtml
=
'<span title="'
+
name
+
'">'
+
name
+
'</span>'
;
}
if
(
modelObj
.
status
&&
Enums
.
entityStateReadOnly
[
modelObj
.
status
])
{
nameHtml
+=
'<button type="button" title="Deleted" class="btn btn-action btn-md deleteBtn"><i class="fa fa-trash"></i></button>'
;
return
'<div class="readOnly readOnlyLink">'
+
nameHtml
+
'</div>'
;
}
return
nameHtml
;
}
else
if
(
modelObj
&&
!
_
.
isUndefined
(
modelObj
[
key
]))
{
var
tempObj
=
{
'scope'
:
that
,
// 'attributeDefs':
'valueObject'
:
{},
'isTable'
:
false
}
tempObj
.
valueObject
[
key
]
=
modelObj
[
key
]
Utils
.
findAndMergeRefEntity
(
tempObj
.
valueObject
,
that
.
searchCollection
.
referredEntities
);
return
CommonViewFunction
.
propertyTable
(
tempObj
);
}
}
})
};
}
});
}
return
this
.
searchCollection
.
constructor
.
getTableCols
(
col
,
this
.
searchCollection
);
},
getTagTermCol
:
function
(
options
)
{
var
that
=
this
,
columnToShow
=
options
.
columnToShow
,
col
=
options
.
col
;
if
(
col
)
{
col
[
'tag'
]
=
{
label
:
"Tags"
,
cell
:
"Html"
,
...
...
@@ -727,51 +830,7 @@ 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
,
isRenderable
=
_
.
contains
(
columnToShow
,
key
)
if
(
key
==
"name"
||
key
==
"description"
||
key
==
"owner"
)
{
if
(
columnToShow
)
{
col
[
key
].
renderable
=
isRenderable
;
}
return
;
}
col
[
obj
.
name
]
=
{
label
:
obj
.
name
.
capitalize
(),
cell
:
"Html"
,
editable
:
false
,
sortable
:
false
,
resizeable
:
true
,
orderable
:
true
,
renderable
:
isRenderable
,
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
]
Utils
.
findAndMergeRefEntity
(
tempObj
.
valueObject
,
that
.
searchCollection
.
referredEntities
);
return
CommonViewFunction
.
propertyTable
(
tempObj
);
}
}
})
};
});
}
}
}
return
this
.
searchCollection
.
constructor
.
getTableCols
(
col
,
this
.
searchCollection
);
},
addTagModalView
:
function
(
guid
,
multiple
)
{
var
that
=
this
;
...
...
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