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
f6ea040a
Commit
f6ea040a
authored
Apr 28, 2017
by
kevalbhatt
Committed by
Madhan Neethiraj
May 01, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-1760: UI update to render property value per attribute type in entity definition
Signed-off-by:
Madhan Neethiraj
<
madhan@apache.org
>
parent
e8a73821
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
42 deletions
+28
-42
CommonViewFunction.js
dashboardv2/public/js/utils/CommonViewFunction.js
+9
-33
AuditTableLayoutView.js
dashboardv2/public/js/views/audit/AuditTableLayoutView.js
+3
-3
CreateAuditTableLayoutView.js
...ardv2/public/js/views/audit/CreateAuditTableLayoutView.js
+2
-2
DetailPageLayoutView.js
...ardv2/public/js/views/detail_page/DetailPageLayoutView.js
+12
-2
EntityDetailTableLayoutView.js
...dv2/public/js/views/entity/EntityDetailTableLayoutView.js
+2
-2
No files found.
dashboardv2/public/js/utils/CommonViewFunction.js
View file @
f6ea040a
...
@@ -88,13 +88,10 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
...
@@ -88,13 +88,10 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
}
}
});
});
}
}
CommonViewFunction
.
propertyTable
=
function
(
valueObject
,
scope
,
searchTable
)
{
CommonViewFunction
.
propertyTable
=
function
(
scope
,
valueObject
,
entityDef
)
{
var
table
=
""
,
var
table
=
""
,
fetchInputOutputValue
=
function
(
id
)
{
fetchInputOutputValue
=
function
(
id
)
{
var
that
=
this
;
var
that
=
this
;
if
(
searchTable
)
{
++
scope
.
fetchList
}
scope
.
entityModel
.
getEntity
(
id
,
{
scope
.
entityModel
.
getEntity
(
id
,
{
success
:
function
(
serverData
)
{
success
:
function
(
serverData
)
{
var
value
=
""
,
var
value
=
""
,
...
@@ -118,19 +115,19 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
...
@@ -118,19 +115,19 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
scope
.
$
(
'td div[data-id="'
+
id
+
'"]'
).
append
(
deleteButton
);
scope
.
$
(
'td div[data-id="'
+
id
+
'"]'
).
append
(
deleteButton
);
}
}
},
},
complete
:
function
()
{
complete
:
function
()
{}
if
(
searchTable
)
{
--
scope
.
fetchList
;
scope
.
checkTableFetch
();
}
}
});
});
}
}
_
.
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
],
valueOfArray
=
[];
valueOfArray
=
[];
if
(
_
.
isObject
(
keyValue
))
{
var
defEntity
=
_
.
find
(
entityDef
,
{
name
:
key
});
if
(
defEntity
)
{
var
defEntityType
=
defEntity
.
typeName
.
toLocaleLowerCase
();
if
(
defEntityType
===
'date'
||
defEntityType
===
'time'
)
{
table
+=
'<tr><td>'
+
_
.
escape
(
key
)
+
'</td><td>'
+
new
Date
(
keyValue
)
+
'</td></tr>'
;
}
else
if
(
_
.
isObject
(
keyValue
))
{
if
(
!
_
.
isArray
(
keyValue
)
&&
_
.
isObject
(
keyValue
))
{
if
(
!
_
.
isArray
(
keyValue
)
&&
_
.
isObject
(
keyValue
))
{
keyValue
=
[
keyValue
];
keyValue
=
[
keyValue
];
}
}
...
@@ -200,33 +197,12 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
...
@@ -200,33 +197,12 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
if
(
valueOfArray
.
length
)
{
if
(
valueOfArray
.
length
)
{
subLink
=
valueOfArray
.
join
(
', '
);
subLink
=
valueOfArray
.
join
(
', '
);
}
}
if
(
searchTable
)
{
table
=
subLink
;
}
else
{
table
+=
'<tr><td>'
+
_
.
escape
(
key
)
+
'</td><td>'
+
subLink
+
'</td></tr>'
;
table
+=
'<tr><td>'
+
_
.
escape
(
key
)
+
'</td><td>'
+
subLink
+
'</td></tr>'
;
}
}
else
{
var
tempVarfor$check
=
key
.
toString
();
if
(
tempVarfor$check
.
indexOf
(
"$"
)
==
-
1
)
{
if
(
key
.
indexOf
(
"Time"
)
!==
-
1
||
key
==
"retention"
)
{
if
(
searchTable
)
{
table
=
new
Date
(
valueObject
[
key
]);
}
else
{
table
+=
'<tr><td>'
+
_
.
escape
(
key
)
+
'</td><td>'
+
new
Date
(
valueObject
[
key
])
+
'</td></tr>'
;
}
}
else
{
if
(
searchTable
)
{
if
(
_
.
isBoolean
(
valueObject
[
key
]))
{
table
=
valueObject
[
key
].
toString
();
}
else
{
table
=
valueObject
[
key
];
}
}
else
{
}
else
{
table
+=
'<tr><td>'
+
_
.
escape
(
key
)
+
'</td><td>'
+
_
.
escape
(
valueObject
[
key
])
+
'</td></tr>'
;
table
+=
'<tr><td>'
+
_
.
escape
(
key
)
+
'</td><td>'
+
_
.
escape
(
valueObject
[
key
])
+
'</td></tr>'
;
}
}
}
}
}
}
});
});
return
table
;
return
table
;
}
}
...
...
dashboardv2/public/js/views/audit/AuditTableLayoutView.js
View file @
f6ea040a
...
@@ -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'
));
_
.
extend
(
this
,
_
.
pick
(
options
,
'guid'
,
'entity'
,
'entityName'
,
'entityDef'
));
this
.
entityCollection
=
new
VEntityList
();
this
.
entityCollection
=
new
VEntityList
();
this
.
count
=
26
;
this
.
count
=
26
;
this
.
entityCollection
.
url
=
UrlLinks
.
entityCollectionaudit
(
this
.
guid
);
this
.
entityCollection
.
url
=
UrlLinks
.
entityCollectionaudit
(
this
.
guid
);
...
@@ -227,9 +227,9 @@ define(['require',
...
@@ -227,9 +227,9 @@ define(['require',
'views/audit/CreateAuditTableLayoutView'
,
'views/audit/CreateAuditTableLayoutView'
,
],
function
(
Modal
,
CreateAuditTableLayoutView
)
{
],
function
(
Modal
,
CreateAuditTableLayoutView
)
{
that
.
action
=
$
(
e
.
target
).
data
(
"action"
);
that
.
action
=
$
(
e
.
target
).
data
(
"action"
);
var
eventModel
=
that
.
entityCollection
.
findWhere
({
'eventKey'
:
$
(
e
.
currentTarget
).
data
(
'modalid'
)
}).
toJSON
(),
var
eventModel
=
that
.
entityCollection
.
f
ullCollection
.
f
indWhere
({
'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
});
view
=
new
CreateAuditTableLayoutView
({
guid
:
that
.
guid
,
entityModel
:
collectionModel
,
action
:
that
.
action
,
entity
:
that
.
entity
,
entityName
:
that
.
entityName
,
entityDef
:
that
.
entityDef
});
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 @
f6ea040a
...
@@ -54,7 +54,7 @@ define(['require',
...
@@ -54,7 +54,7 @@ define(['require',
* @constructs
* @constructs
*/
*/
initialize
:
function
(
options
)
{
initialize
:
function
(
options
)
{
_
.
extend
(
this
,
_
.
pick
(
options
,
'guid'
,
'entityModel'
,
'action'
,
'entity'
,
'entityName'
));
_
.
extend
(
this
,
_
.
pick
(
options
,
'guid'
,
'entityModel'
,
'action'
,
'entity'
,
'entityName'
,
'entityDef'
));
},
},
bindEvents
:
function
()
{},
bindEvents
:
function
()
{},
onRender
:
function
()
{
onRender
:
function
()
{
...
@@ -85,7 +85,7 @@ define(['require',
...
@@ -85,7 +85,7 @@ define(['require',
}
else
if
(
parseDetailsObject
&&
parseDetailsObject
.
values
)
{
}
else
if
(
parseDetailsObject
&&
parseDetailsObject
.
values
)
{
this
.
ui
.
auditHeaderValue
.
html
(
'<th>Key</th><th>New Value</th>'
);
this
.
ui
.
auditHeaderValue
.
html
(
'<th>Key</th><th>New Value</th>'
);
//CommonViewFunction.findAndmergeRefEntity(attributeObject, that.referredEntities);
//CommonViewFunction.findAndmergeRefEntity(attributeObject, that.referredEntities);
table
=
CommonViewFunction
.
propertyTable
(
values
,
this
);
table
=
CommonViewFunction
.
propertyTable
(
this
,
values
,
this
.
entityDef
);
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 @
f6ea040a
...
@@ -173,8 +173,7 @@ define(['require',
...
@@ -173,8 +173,7 @@ define(['require',
entityDefCollection
:
this
.
entityDefCollection
,
entityDefCollection
:
this
.
entityDefCollection
,
fetchCollection
:
this
.
fetchCollection
.
bind
(
that
)
fetchCollection
:
this
.
fetchCollection
.
bind
(
that
)
}
}
this
.
renderEntityDetailTableLayoutView
(
obj
);
this
.
getEntityDef
(
obj
);
this
.
renderAuditTableLayoutView
(
obj
);
this
.
renderTagTableLayoutView
(
obj
);
this
.
renderTagTableLayoutView
(
obj
);
this
.
renderTermTableLayoutView
(
_
.
extend
({},
obj
,
{
term
:
true
}));
this
.
renderTermTableLayoutView
(
_
.
extend
({},
obj
,
{
term
:
true
}));
// To render Schema check attribute "schemaElementsAttribute"
// To render Schema check attribute "schemaElementsAttribute"
...
@@ -240,6 +239,17 @@ define(['require',
...
@@ -240,6 +239,17 @@ define(['require',
fetchCollection
:
function
()
{
fetchCollection
:
function
()
{
this
.
collection
.
fetch
({
reset
:
true
});
this
.
collection
.
fetch
({
reset
:
true
});
},
},
getEntityDef
:
function
(
obj
)
{
var
data
=
this
.
entityDefCollection
.
fullCollection
.
findWhere
({
name
:
obj
.
entity
.
typeName
}).
toJSON
();
var
entityDef
=
Utils
.
getNestedSuperTypeObj
({
data
:
data
,
attrMerge
:
true
,
collection
:
this
.
entityDefCollection
});
obj
[
'entityDef'
]
=
entityDef
;
this
.
renderEntityDetailTableLayoutView
(
obj
);
this
.
renderAuditTableLayoutView
(
obj
);
},
onClickTagCross
:
function
(
e
)
{
onClickTagCross
:
function
(
e
)
{
var
tagName
=
$
(
e
.
currentTarget
).
parent
().
text
(),
var
tagName
=
$
(
e
.
currentTarget
).
parent
().
text
(),
tagOrTerm
=
$
(
e
.
target
).
data
(
"type"
),
tagOrTerm
=
$
(
e
.
target
).
data
(
"type"
),
...
...
dashboardv2/public/js/views/entity/EntityDetailTableLayoutView.js
View file @
f6ea040a
...
@@ -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'
));
_
.
extend
(
this
,
_
.
pick
(
options
,
'entity'
,
'referredEntities'
,
'typeHeaders'
,
'entityDef'
));
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
(
attributeObject
,
this
);
var
table
=
CommonViewFunction
.
propertyTable
(
this
,
attributeObject
,
this
.
entityDef
);
that
.
ui
.
detailValue
.
append
(
table
);
that
.
ui
.
detailValue
.
append
(
table
);
}
}
});
});
...
...
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