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
e9b95131
Commit
e9b95131
authored
7 years ago
by
kevalbhatt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-2244 : UI - Basic Search Table not using referredEntities to render entity details
parent
3b9ea1dd
master
No related merge requests found
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
13 deletions
+19
-13
Utils.js
dashboardv2/public/js/utils/Utils.js
+11
-2
SearchResultLayoutView.js
dashboardv2/public/js/views/search/SearchResultLayoutView.js
+8
-11
No files found.
dashboardv2/public/js/utils/Utils.js
View file @
e9b95131
...
...
@@ -510,15 +510,24 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
titleBoxEl
.
fadeIn
();
}
Utils
.
findAndMergeRefEntity
=
function
(
attributeObject
,
referredEntities
)
{
var
megeObject
=
function
(
obj
)
{
if
(
obj
)
{
if
(
obj
.
attributes
)
{
Utils
.
findAndMergeRefEntity
(
obj
.
attributes
,
referredEntities
);
}
else
if
(
referredEntities
[
obj
.
guid
])
{
_
.
extend
(
obj
,
referredEntities
[
obj
.
guid
]);
}
}
}
if
(
attributeObject
&&
referredEntities
)
{
_
.
each
(
attributeObject
,
function
(
obj
,
key
)
{
if
(
_
.
isObject
(
obj
))
{
if
(
_
.
isArray
(
obj
))
{
_
.
each
(
obj
,
function
(
value
)
{
_
.
extend
(
value
,
referredEntities
[
value
.
guid
]
);
megeObject
(
value
);
});
}
else
{
_
.
extend
(
obj
,
referredEntities
[
obj
.
guid
]
);
megeObject
(
obj
);
}
}
});
...
...
This diff is collapsed.
Click to expand it.
dashboardv2/public/js/views/search/SearchResultLayoutView.js
View file @
e9b95131
...
...
@@ -241,7 +241,7 @@ define(['require',
}
this
.
triggerUrl
();
var
attributes
=
this
.
searchCollection
.
filterObj
.
attributes
;
if
(
excludeDefaultColumn
&&
attributes
&&
excludeDefaultColumn
.
length
>
attributes
.
length
)
{
if
(
(
excludeDefaultColumn
&&
attributes
)
&&
(
excludeDefaultColumn
.
length
>
attributes
.
length
||
_
.
difference
(
excludeDefaultColumn
,
attributes
).
length
)
)
{
this
.
fetchCollection
(
this
.
value
);
}
}
...
...
@@ -410,10 +410,12 @@ define(['require',
return
;
}
if
(
isPostMethod
)
{
that
.
searchCollection
.
referredEntities
=
dataOrCollection
.
rnoRecordFoeferredEntities
;
that
.
searchCollection
.
referredEntities
=
dataOrCollection
.
referredEntities
;
Utils
.
findAndMergeRefEntity
(
dataOrCollection
.
entities
,
dataOrCollection
.
referredEntities
);
that
.
searchCollection
.
reset
(
dataOrCollection
.
entities
,
{
silent
:
true
});
}
/*Next button check.
It's outside of Previous button else condition
because when user comes from 2 page to 1 page than we need to check next button.*/
...
...
@@ -712,17 +714,14 @@ define(['require',
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
);
};
tempObj
.
valueObject
[
key
]
=
modelObj
.
attributes
[
key
];
return
CommonViewFunction
.
propertyTable
(
tempObj
);
}
}
...
...
@@ -770,10 +769,8 @@ define(['require',
// 'attributeDefs':
'valueObject'
:
{},
'isTable'
:
false
}
tempObj
.
valueObject
[
key
]
=
modelObj
[
key
]
Utils
.
findAndMergeRefEntity
(
tempObj
.
valueObject
,
that
.
searchCollection
.
referredEntities
);
};
tempObj
.
valueObject
[
key
]
=
modelObj
[
key
];
return
CommonViewFunction
.
propertyTable
(
tempObj
);
}
}
...
...
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