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
84c6d52d
Commit
84c6d52d
authored
Jul 14, 2017
by
kevalbhatt
Committed by
Madhan Neethiraj
Jul 14, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-1952: UI optimization to use searchResult.referredEntity to render object type attributes
Signed-off-by:
Madhan Neethiraj
<
madhan@apache.org
>
parent
bcec42e3
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
21 deletions
+33
-21
VSearchList.js
dashboardv2/public/js/collection/VSearchList.js
+3
-1
CommonViewFunction.js
dashboardv2/public/js/utils/CommonViewFunction.js
+3
-15
Utils.js
dashboardv2/public/js/utils/Utils.js
+17
-1
EntityDetailTableLayoutView.js
...dv2/public/js/views/entity/EntityDetailTableLayoutView.js
+5
-3
SearchResultLayoutView.js
dashboardv2/public/js/views/search/SearchResultLayoutView.js
+5
-1
No files found.
dashboardv2/public/js/collection/VSearchList.js
View file @
84c6d52d
...
@@ -37,6 +37,7 @@ define(['require',
...
@@ -37,6 +37,7 @@ define(['require',
parseRecords
:
function
(
resp
,
options
)
{
parseRecords
:
function
(
resp
,
options
)
{
this
.
queryType
=
resp
.
queryType
;
this
.
queryType
=
resp
.
queryType
;
this
.
queryText
=
resp
.
queryText
;
this
.
queryText
=
resp
.
queryText
;
this
.
referredEntities
=
resp
.
referredEntities
;
return
resp
.
entities
?
resp
.
entities
:
[];
return
resp
.
entities
?
resp
.
entities
:
[];
},
},
getBasicRearchResult
:
function
(
options
)
{
getBasicRearchResult
:
function
(
options
)
{
...
@@ -62,4 +63,4 @@ define(['require',
...
@@ -62,4 +63,4 @@ define(['require',
}
}
);
);
return
VSearchList
;
return
VSearchList
;
});
});
\ No newline at end of file
dashboardv2/public/js/utils/CommonViewFunction.js
View file @
84c6d52d
...
@@ -75,19 +75,6 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
...
@@ -75,19 +75,6 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
}
}
});
});
};
};
CommonViewFunction
.
findAndmergeRefEntity
=
function
(
attributeObject
,
referredEntities
)
{
_
.
each
(
attributeObject
,
function
(
obj
,
key
)
{
if
(
_
.
isObject
(
obj
))
{
if
(
_
.
isArray
(
obj
))
{
_
.
each
(
obj
,
function
(
value
)
{
_
.
extend
(
value
,
referredEntities
[
value
.
guid
]);
});
}
else
{
_
.
extend
(
obj
,
referredEntities
[
obj
.
guid
]);
}
}
});
}
CommonViewFunction
.
propertyTable
=
function
(
options
)
{
CommonViewFunction
.
propertyTable
=
function
(
options
)
{
var
scope
=
options
.
scope
,
var
scope
=
options
.
scope
,
valueObject
=
options
.
valueObject
,
valueObject
=
options
.
valueObject
,
...
@@ -179,7 +166,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
...
@@ -179,7 +166,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
}
}
if
(
id
&&
inputOutputField
)
{
if
(
id
&&
inputOutputField
)
{
var
name
=
Utils
.
getName
(
inputOutputField
);
var
name
=
Utils
.
getName
(
inputOutputField
);
if
(
name
===
"-"
||
name
===
id
)
{
if
(
(
name
===
"-"
||
name
===
id
)
&&
!
inputOutputField
.
attributes
)
{
var
fetch
=
true
;
var
fetch
=
true
;
var
fetchId
=
(
_
.
isObject
(
id
)
?
id
.
id
:
id
);
var
fetchId
=
(
_
.
isObject
(
id
)
?
id
.
id
:
id
);
fetchInputOutputValue
(
fetchId
);
fetchInputOutputValue
(
fetchId
);
...
@@ -474,4 +461,4 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
...
@@ -474,4 +461,4 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
}
}
}
}
return
CommonViewFunction
;
return
CommonViewFunction
;
});
});
\ No newline at end of file
dashboardv2/public/js/utils/Utils.js
View file @
84c6d52d
...
@@ -454,6 +454,21 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'pnotify.button
...
@@ -454,6 +454,21 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'pnotify.button
loaderEl
.
hide
();
loaderEl
.
hide
();
titleBoxEl
.
fadeIn
();
titleBoxEl
.
fadeIn
();
}
}
Utils
.
findAndMergeRefEntity
=
function
(
attributeObject
,
referredEntities
)
{
if
(
attributeObject
&&
referredEntities
)
{
_
.
each
(
attributeObject
,
function
(
obj
,
key
)
{
if
(
_
.
isObject
(
obj
))
{
if
(
_
.
isArray
(
obj
))
{
_
.
each
(
obj
,
function
(
value
)
{
_
.
extend
(
value
,
referredEntities
[
value
.
guid
]);
});
}
else
{
_
.
extend
(
obj
,
referredEntities
[
obj
.
guid
]);
}
}
});
}
}
Utils
.
getNestedSuperTypeObj
=
function
(
options
)
{
Utils
.
getNestedSuperTypeObj
=
function
(
options
)
{
var
flag
=
0
,
var
flag
=
0
,
data
=
options
.
data
,
data
=
options
.
data
,
...
@@ -539,4 +554,4 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'pnotify.button
...
@@ -539,4 +554,4 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'pnotify.button
});
});
return
Utils
;
return
Utils
;
});
});
\ No newline at end of file
dashboardv2/public/js/views/entity/EntityDetailTableLayoutView.js
View file @
84c6d52d
...
@@ -21,7 +21,8 @@ define(['require',
...
@@ -21,7 +21,8 @@ define(['require',
'hbs!tmpl/entity/EntityDetailTableLayoutView_tmpl'
,
'hbs!tmpl/entity/EntityDetailTableLayoutView_tmpl'
,
'utils/CommonViewFunction'
,
'utils/CommonViewFunction'
,
'models/VEntity'
,
'models/VEntity'
,
],
function
(
require
,
Backbone
,
EntityDetailTableLayoutView_tmpl
,
CommonViewFunction
,
VEntity
)
{
'utils/Utils'
],
function
(
require
,
Backbone
,
EntityDetailTableLayoutView_tmpl
,
CommonViewFunction
,
VEntity
,
Utils
)
{
'use strict'
;
'use strict'
;
var
EntityDetailTableLayoutView
=
Backbone
.
Marionette
.
LayoutView
.
extend
(
var
EntityDetailTableLayoutView
=
Backbone
.
Marionette
.
LayoutView
.
extend
(
...
@@ -58,7 +59,7 @@ define(['require',
...
@@ -58,7 +59,7 @@ define(['require',
entityTableGenerate
:
function
()
{
entityTableGenerate
:
function
()
{
var
that
=
this
,
var
that
=
this
,
attributeObject
=
this
.
entity
.
attributes
;
attributeObject
=
this
.
entity
.
attributes
;
CommonViewFunction
.
findAndm
ergeRefEntity
(
attributeObject
,
that
.
referredEntities
);
Utils
.
findAndM
ergeRefEntity
(
attributeObject
,
that
.
referredEntities
);
if
(
attributeObject
&&
attributeObject
.
columns
)
{
if
(
attributeObject
&&
attributeObject
.
columns
)
{
var
valueSorted
=
_
.
sortBy
(
attributeObject
.
columns
,
function
(
val
)
{
var
valueSorted
=
_
.
sortBy
(
attributeObject
.
columns
,
function
(
val
)
{
return
val
.
attributes
.
position
return
val
.
attributes
.
position
...
@@ -70,4 +71,4 @@ define(['require',
...
@@ -70,4 +71,4 @@ define(['require',
}
}
});
});
return
EntityDetailTableLayoutView
;
return
EntityDetailTableLayoutView
;
});
});
\ No newline at end of file
dashboardv2/public/js/views/search/SearchResultLayoutView.js
View file @
84c6d52d
...
@@ -352,6 +352,7 @@ define(['require',
...
@@ -352,6 +352,7 @@ define(['require',
return
;
return
;
}
}
if
(
isPostMethod
)
{
if
(
isPostMethod
)
{
that
.
searchCollection
.
referredEntities
=
model
.
referredEntities
;
that
.
searchCollection
.
reset
(
model
.
entities
);
that
.
searchCollection
.
reset
(
model
.
entities
);
}
}
if
(
that
.
searchCollection
.
models
.
length
===
0
&&
that
.
offset
>
that
.
limit
)
{
if
(
that
.
searchCollection
.
models
.
length
===
0
&&
that
.
offset
>
that
.
limit
)
{
...
@@ -658,7 +659,9 @@ define(['require',
...
@@ -658,7 +659,9 @@ define(['require',
'valueObject'
:
{},
'valueObject'
:
{},
'isTable'
:
false
'isTable'
:
false
}
}
tempObj
.
valueObject
[
key
]
=
modelObj
.
attributes
[
key
]
tempObj
.
valueObject
[
key
]
=
modelObj
.
attributes
[
key
]
Utils
.
findAndMergeRefEntity
(
tempObj
.
valueObject
,
that
.
searchCollection
.
referredEntities
);
return
CommonViewFunction
.
propertyTable
(
tempObj
);
return
CommonViewFunction
.
propertyTable
(
tempObj
);
}
}
}
}
...
@@ -862,4 +865,4 @@ define(['require',
...
@@ -862,4 +865,4 @@ define(['require',
}
}
});
});
return
SearchResultLayoutView
;
return
SearchResultLayoutView
;
});
});
\ No newline at end of file
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