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
8fc70a32
Commit
8fc70a32
authored
Mar 18, 2019
by
gutkaBinit
Committed by
Madhan Neethiraj
Mar 18, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-3076: UI: Relationship Tab improvements - #2
Signed-off-by:
Madhan Neethiraj
<
madhan@apache.org
>
parent
3d266b08
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
13 deletions
+17
-13
CommonViewFunction.js
dashboardv2/public/js/utils/CommonViewFunction.js
+11
-10
Statistics.js
dashboardv2/public/js/views/common/Statistics.js
+5
-2
RelationshipLayoutView.js
dashboardv2/public/js/views/graph/RelationshipLayoutView.js
+1
-1
No files found.
dashboardv2/public/js/utils/CommonViewFunction.js
View file @
8fc70a32
...
...
@@ -78,18 +78,20 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Glob
extractJSON
=
options
.
extractJSON
,
isTable
=
_
.
isUndefined
(
options
.
isTable
)
?
true
:
options
.
isTable
,
attributeDefs
=
options
.
attributeDefs
,
numberFormat
=
options
.
numberFormat
;
formatIntVal
=
options
.
formatIntVal
,
showListCount
=
options
.
showListCount
||
true
,
numberFormat
=
options
.
numberFormat
||
_
.
numberFormatWithComa
;
var
table
=
""
,
getValue
=
function
(
val
)
{
if
(
val
&&
numberFormat
)
{
if
(
_
.
isNumber
(
val
))
{
return
numberFormat
(
val
);
}
else
if
(
!
_
.
isNaN
(
parseInt
(
val
)))
{
if
(
val
)
{
if
((
_
.
isNumber
(
val
)
||
!
_
.
isNaN
(
parseInt
(
val
)))
&&
formatIntVal
)
{
return
numberFormat
(
val
);
}
else
{
return
val
;
}
}
else
{
return
val
||
"N/A"
;
return
"N/A"
;
}
},
fetchInputOutputValue
=
function
(
id
,
defEntity
)
{
...
...
@@ -226,8 +228,8 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Glob
if
(
key
==
"profileData"
)
{
return
;
}
var
keyValue
=
valueObject
[
key
]
;
var
count
=
_
.
isArray
(
keyValue
)
?
(
keyValue
.
length
)
:
0
;
var
keyValue
=
valueObject
[
key
]
,
listCount
=
showListCount
&&
_
.
isArray
(
keyValue
)
&&
keyValue
.
length
>
0
?
' ('
+
numberFormat
(
keyValue
.
length
)
+
')'
:
""
;
var
defEntity
=
_
.
find
(
attributeDefs
,
{
name
:
key
});
if
(
defEntity
&&
defEntity
.
typeName
)
{
var
defEntityType
=
defEntity
.
typeName
.
toLocaleLowerCase
();
...
...
@@ -264,8 +266,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Glob
htmlTag
=
'<pre class="shrink code-block '
+
(
isMatchJSONStringIsSingle
?
'fixed-height'
:
''
)
+
'">'
+
expandCollapseButton
+
'<code>'
+
val
+
'</code></pre>'
;
}
}
var
textToDisplay
=
count
>
0
?
' ('
+
getValue
(
count
)
+
')'
:
''
;
table
+=
'<tr><td>'
+
_
.
escape
(
key
)
+
textToDisplay
+
'</td><td>'
+
htmlTag
+
'</td></tr>'
;
table
+=
'<tr><td>'
+
(
_
.
escape
(
key
)
+
listCount
)
+
'</td><td>'
+
htmlTag
+
'</td></tr>'
;
}
else
{
table
+=
'<div>'
+
val
+
'</div>'
;
}
...
...
dashboardv2/public/js/views/common/Statistics.js
View file @
8fc70a32
...
...
@@ -70,8 +70,8 @@ define(['require',
success
:
function
(
data
)
{
var
data
=
_
.
first
(
data
.
toJSON
()),
no_records
=
'<tr class="empty text-center"><td colspan="2"><span>No records found!</span></td></tr>'
,
activeEntityTable
=
_
.
isEmpty
(
data
.
entity
.
entityActive
)
?
no_records
:
CommonViewFunction
.
propertyTable
({
scope
:
that
,
valueObject
:
data
.
entity
.
entityActive
,
numberFormat
:
_
.
numberFormatWithComa
}),
deleteEntityTable
=
_
.
isEmpty
(
data
.
entity
.
entityDeleted
)
?
no_records
:
CommonViewFunction
.
propertyTable
({
scope
:
that
,
valueObject
:
data
.
entity
.
entityDeleted
,
numberFormat
:
_
.
numberFormatWithComa
});
activeEntityTable
=
_
.
isEmpty
(
data
.
entity
.
entityActive
)
?
no_records
:
that
.
getTable
({
valueObject
:
data
.
entity
.
entityActive
}),
deleteEntityTable
=
_
.
isEmpty
(
data
.
entity
.
entityDeleted
)
?
no_records
:
that
.
getTable
({
valueObject
:
data
.
entity
.
entityDeleted
});
var
totalActive
=
0
,
totalDeleted
=
0
;
if
(
data
.
entity
&&
data
.
general
.
entityCount
)
{
...
...
@@ -88,6 +88,9 @@ define(['require',
that
.
ui
.
entityDeletedHeader
.
html
(
" ("
+
_
.
numberFormatWithComa
(
totalDeleted
)
+
")"
);
}
});
},
getTable
:
function
(
obj
)
{
return
CommonViewFunction
.
propertyTable
(
_
.
extend
({
scope
:
this
,
formatIntVal
:
true
},
obj
))
}
});
return
StatisticsView
;
...
...
dashboardv2/public/js/views/graph/RelationshipLayoutView.js
View file @
8fc70a32
...
...
@@ -460,7 +460,7 @@ define(['require',
},
createTable
:
function
()
{
this
.
entityModel
=
new
VEntity
({});
var
table
=
CommonViewFunction
.
propertyTable
({
scope
:
this
,
valueObject
:
this
.
entity
.
relationshipAttributes
,
attributeDefs
:
this
.
attributeDefs
,
numberFormat
:
_
.
numberFormatWithComa
});
var
table
=
CommonViewFunction
.
propertyTable
({
scope
:
this
,
valueObject
:
this
.
entity
.
relationshipAttributes
,
attributeDefs
:
this
.
attributeDefs
});
this
.
ui
.
relationshipDetailValue
.
html
(
table
);
},
relationshipViewToggle
:
function
(
checked
)
{
...
...
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