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
e483712b
Commit
e483712b
authored
8 years ago
by
Kalyani
Committed by
nixonrodrigues
8 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-1810 : UI : Audit details of any tag event (Added,Updated) has only tag name and event.
Signed-off-by:
nixonrodrigues
<
nixon@apache.org
>
parent
d0e48cfd
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
119 additions
and
86 deletions
+119
-86
CreateAuditTableLayoutView_tmpl.html
...c/js/templates/audit/CreateAuditTableLayoutView_tmpl.html
+1
-0
CommonViewFunction.js
dashboardv2/public/js/utils/CommonViewFunction.js
+96
-73
Utils.js
dashboardv2/public/js/utils/Utils.js
+14
-2
CreateAuditTableLayoutView.js
...ardv2/public/js/views/audit/CreateAuditTableLayoutView.js
+7
-10
EntityDetailTableLayoutView.js
...dv2/public/js/views/entity/EntityDetailTableLayoutView.js
+1
-1
No files found.
dashboardv2/public/js/templates/audit/CreateAuditTableLayoutView_tmpl.html
View file @
e483712b
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
-->
-->
<h4>
Name:
<span
data-id=
"tagHeader"
></span></h4>
<table
class=
"table table-bordered table-striped"
data-id=
"tableAudit"
>
<table
class=
"table table-bordered table-striped"
data-id=
"tableAudit"
>
<thead>
<thead>
<tr
data-id=
"auditHeaderValue"
>
<tr
data-id=
"auditHeaderValue"
>
...
...
This diff is collapsed.
Click to expand it.
dashboardv2/public/js/utils/CommonViewFunction.js
View file @
e483712b
...
@@ -88,7 +88,12 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
...
@@ -88,7 +88,12 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
}
}
});
});
}
}
CommonViewFunction
.
propertyTable
=
function
(
scope
,
valueObject
,
entityDef
)
{
CommonViewFunction
.
propertyTable
=
function
(
options
)
{
var
scope
=
options
.
scope
,
valueObject
=
options
.
valueObject
,
extractJSON
=
options
.
extractJSON
,
entityDef
=
options
.
entityDef
;
var
table
=
""
,
var
table
=
""
,
fetchInputOutputValue
=
function
(
id
)
{
fetchInputOutputValue
=
function
(
id
)
{
var
that
=
this
;
var
that
=
this
;
...
@@ -117,92 +122,110 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
...
@@ -117,92 +122,110 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
},
},
complete
:
function
()
{}
complete
:
function
()
{}
});
});
}
},
_
.
sortBy
(
_
.
keys
(
valueObject
)).
map
(
function
(
key
)
{
extractObject
=
function
(
keyValue
)
{
key
=
_
.
escape
(
key
)
var
valueOfArray
=
[];
var
keyValue
=
valueObject
[
key
],
if
(
!
_
.
isArray
(
keyValue
)
&&
_
.
isObject
(
keyValue
))
{
valueOfArray
=
[];
keyValue
=
[
keyValue
];
var
defEntity
=
_
.
find
(
entityDef
,
{
name
:
key
});
}
if
(
defEntity
)
{
var
subLink
=
""
;
var
defEntityType
=
defEntity
.
typeName
.
toLocaleLowerCase
();
for
(
var
i
=
0
;
i
<
keyValue
.
length
;
i
++
)
{
if
(
defEntityType
===
'date'
||
defEntityType
===
'time'
)
{
var
inputOutputField
=
keyValue
[
i
],
table
+=
'<tr><td>'
+
_
.
escape
(
key
)
+
'</td><td>'
+
new
Date
(
keyValue
)
+
'</td></tr>'
;
id
=
inputOutputField
.
guid
||
(
_
.
isObject
(
inputOutputField
.
id
)
?
inputOutputField
.
id
.
id
:
inputOutputField
.
id
),
}
else
if
(
_
.
isObject
(
keyValue
))
{
tempLink
=
""
,
if
(
!
_
.
isArray
(
keyValue
)
&&
_
.
isObject
(
keyValue
))
{
status
=
inputOutputField
.
status
||
(
_
.
isObject
(
inputOutputField
.
id
)
?
inputOutputField
.
id
.
state
:
inputOutputField
.
state
),
keyValue
=
[
keyValue
];
readOnly
=
Enums
.
entityStateReadOnly
[
status
];
if
(
!
inputOutputField
.
attributes
&&
inputOutputField
.
values
)
{
inputOutputField
[
'attributes'
]
=
inputOutputField
.
values
;
}
}
var
subLink
=
""
;
if
(
_
.
isString
(
inputOutputField
)
||
_
.
isBoolean
(
inputOutputField
)
||
_
.
isNumber
(
inputOutputField
))
{
for
(
var
i
=
0
;
i
<
keyValue
.
length
;
i
++
)
{
var
tempVarfor$check
=
inputOutputField
.
toString
();
var
inputOutputField
=
keyValue
[
i
],
if
(
tempVarfor$check
.
indexOf
(
"$"
)
==
-
1
)
{
id
=
inputOutputField
.
guid
||
(
_
.
isObject
(
inputOutputField
.
id
)
?
inputOutputField
.
id
.
id
:
inputOutputField
.
id
),
valueOfArray
.
push
(
'<span>'
+
_
.
escape
(
inputOutputField
)
+
'</span>'
);
tempLink
=
""
,
status
=
inputOutputField
.
status
||
(
_
.
isObject
(
inputOutputField
.
id
)
?
inputOutputField
.
id
.
state
:
inputOutputField
.
state
),
readOnly
=
Enums
.
entityStateReadOnly
[
status
];
if
(
!
inputOutputField
.
attributes
&&
inputOutputField
.
values
)
{
inputOutputField
[
'attributes'
]
=
inputOutputField
.
values
;
}
}
if
(
_
.
isString
(
inputOutputField
)
||
_
.
isBoolean
(
inputOutputField
)
||
_
.
isNumber
(
inputOutputField
))
{
}
else
if
(
_
.
isObject
(
inputOutputField
)
&&
!
id
)
{
var
tempVarfor$check
=
inputOutputField
.
toString
();
var
attributesList
=
inputOutputField
;
if
(
tempVarfor$check
.
indexOf
(
"$"
)
==
-
1
)
{
if
(
scope
.
typeHeaders
&&
inputOutputField
.
typeName
)
{
valueOfArray
.
push
(
'<span>'
+
_
.
escape
(
inputOutputField
)
+
'</span>'
);
var
typeNameCategory
=
scope
.
typeHeaders
.
fullCollection
.
findWhere
({
name
:
inputOutputField
.
typeName
});
if
(
attributesList
.
attributes
&&
typeNameCategory
&&
typeNameCategory
.
get
(
'category'
)
===
'STRUCT'
)
{
attributesList
=
attributesList
.
attributes
;
}
}
}
else
if
(
_
.
isObject
(
inputOutputField
)
&&
!
id
)
{
}
var
attributesList
=
inputOutputField
;
_
.
each
(
attributesList
,
function
(
objValue
,
objKey
)
{
if
(
scope
.
typeHeaders
&&
inputOutputField
.
typeName
)
{
var
value
=
objValue
,
var
typeNameCategory
=
scope
.
typeHeaders
.
fullCollection
.
findWhere
({
name
:
inputOutputField
.
typeName
});
tempVarfor$check
=
objKey
.
toString
();
if
(
attributesList
.
attributes
&&
typeNameCategory
&&
typeNameCategory
.
get
(
'category'
)
===
'STRUCT'
)
{
if
(
tempVarfor$check
.
indexOf
(
"$"
)
==
-
1
)
{
attributesList
=
attributesList
.
attributes
;
if
(
_
.
isObject
(
value
))
{
value
=
JSON
.
stringify
(
value
);
}
}
}
if
(
extractJSON
)
{
_
.
each
(
attributesList
,
function
(
objValue
,
objKey
)
{
if
(
extractJSON
&&
extractJSON
.
extractKey
)
{
var
value
=
objValue
,
if
(
_
.
isObject
(
extractJSON
.
extractKey
))
{
tempVarfor$check
=
objKey
.
toString
();
_
.
each
(
extractJSON
.
extractKey
,
function
(
extractKey
)
{
if
(
tempVarfor$check
.
indexOf
(
"$"
)
==
-
1
)
{
if
(
objKey
===
extractKey
)
{
if
(
_
.
isObject
(
value
))
{
valueOfArray
.
push
(
'<span>'
+
_
.
escape
(
objKey
)
+
':'
+
_
.
escape
(
value
)
+
'</span>'
);
value
=
JSON
.
stringify
(
value
);
}
});
}
else
if
(
_
.
isString
(
extractJSON
.
extractKey
)
&&
extractJSON
.
extractKey
===
objKey
)
{
valueOfArray
.
push
(
_
.
escape
(
value
));
}
}
}
}
else
{
valueOfArray
.
push
(
'<span>'
+
_
.
escape
(
objKey
)
+
':'
+
_
.
escape
(
value
)
+
'</span>'
);
valueOfArray
.
push
(
'<span>'
+
_
.
escape
(
objKey
)
+
':'
+
_
.
escape
(
value
)
+
'</span>'
);
}
}
});
}
if
(
id
&&
inputOutputField
)
{
var
name
=
Utils
.
getName
(
inputOutputField
);
if
(
name
===
"-"
||
name
===
id
)
{
var
fetch
=
true
;
var
fetchId
=
(
_
.
isObject
(
id
)
?
id
.
id
:
id
);
fetchInputOutputValue
(
fetchId
);
tempLink
+=
'<div data-id="'
+
fetchId
+
'"></div>'
;
}
else
{
tempLink
+=
'<a href="#!/detailPage/'
+
id
+
'">'
+
name
+
'</a>'
}
}
}
});
if
(
readOnly
)
{
}
if
(
!
fetch
)
{
if
(
id
&&
inputOutputField
)
{
tempLink
+=
'<button title="Deleted" class="btn btn-atlasAction btn-atlas deleteBtn"><i class="fa fa-trash"></i></button>'
;
var
name
=
Utils
.
getName
(
inputOutputField
);
subLink
+=
'<div class="block readOnlyLink">'
+
tempLink
+
'</div>'
;
if
(
name
===
"-"
||
name
===
id
)
{
}
else
{
var
fetch
=
true
;
fetch
=
false
;
var
fetchId
=
(
_
.
isObject
(
id
)
?
id
.
id
:
id
);
subLink
+=
tempLink
;
fetchInputOutputValue
(
fetchId
);
}
tempLink
+=
'<div data-id="'
+
fetchId
+
'"></div>'
;
}
else
{
}
else
{
if
(
tempLink
.
search
(
'href'
)
!=
-
1
)
{
tempLink
+=
'<a href="#!/detailPage/'
+
id
+
'">'
+
name
+
'</a>'
subLink
+=
'<div>'
+
tempLink
+
'</div>'
}
else
if
(
tempLink
.
length
)
{
subLink
+=
tempLink
}
}
}
}
}
if
(
valueOfArray
.
length
)
{
if
(
readOnly
)
{
subLink
=
valueOfArray
.
join
(
', '
);
if
(
!
fetch
)
{
}
tempLink
+=
'<button title="Deleted" class="btn btn-atlasAction btn-atlas deleteBtn"><i class="fa fa-trash"></i></button>'
;
table
+=
'<tr><td>'
+
_
.
escape
(
key
)
+
'</td><td>'
+
subLink
+
'</td></tr>'
;
subLink
+=
'<div class="block readOnlyLink">'
+
tempLink
+
'</div>'
;
}
else
{
fetch
=
false
;
subLink
+=
tempLink
;
}
}
else
{
}
else
{
table
+=
'<tr><td>'
+
_
.
escape
(
key
)
+
'</td><td>'
+
_
.
escape
(
valueObject
[
key
])
+
'</td></tr>'
;
if
(
tempLink
.
search
(
'href'
)
!=
-
1
)
{
subLink
+=
'<div>'
+
tempLink
+
'</div>'
}
else
if
(
tempLink
.
length
)
{
subLink
+=
tempLink
}
}
}
if
(
valueOfArray
.
length
)
{
subLink
=
valueOfArray
.
join
(
', '
);
}
return
subLink
;
}
_
.
sortBy
(
_
.
keys
(
valueObject
)).
map
(
function
(
key
)
{
key
=
_
.
escape
(
key
);
var
keyValue
=
valueObject
[
key
];
var
defEntity
=
_
.
find
(
entityDef
,
{
name
:
key
});
if
(
defEntity
&&
defEntity
.
typeName
)
{
var
defEntityType
=
defEntity
.
typeName
.
toLocaleLowerCase
();
if
(
defEntityType
===
'date'
||
defEntityType
===
'time'
)
{
keyValue
=
new
Date
(
keyValue
);
}
else
if
(
_
.
isObject
(
keyValue
))
{
keyValue
=
extractObject
(
keyValue
);
}
}
else
{
if
(
_
.
isObject
(
keyValue
))
{
keyValue
=
extractObject
(
keyValue
)
}
}
}
}
table
+=
'<tr><td>'
+
_
.
escape
(
key
)
+
'</td><td>'
+
(
_
.
isObject
(
valueObject
[
key
])
?
keyValue
:
_
.
escape
(
keyValue
))
+
'</td></tr>'
;
});
});
return
table
;
return
table
;
}
}
...
...
This diff is collapsed.
Click to expand it.
dashboardv2/public/js/utils/Utils.js
View file @
e483712b
...
@@ -401,7 +401,13 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'pnotify.button
...
@@ -401,7 +401,13 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'pnotify.button
return
returnObj
;
return
returnObj
;
}
}
if
(
collectionJSON
.
attributes
.
id
)
{
if
(
collectionJSON
.
attributes
.
id
)
{
returnObj
.
name
=
_
.
escape
(
collectionJSON
.
attributes
.
id
);
if
(
_
.
isObject
(
collectionJSON
.
attributes
.
id
))
{
if
(
collectionJSON
.
id
.
id
)
{
returnObj
.
name
=
_
.
escape
(
collectionJSON
.
attributes
.
id
.
id
);
}
}
else
{
returnObj
.
name
=
_
.
escape
(
collectionJSON
.
attributes
.
id
);
}
returnObj
.
key
=
'id'
;
returnObj
.
key
=
'id'
;
return
returnObj
;
return
returnObj
;
}
}
...
@@ -427,7 +433,13 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'pnotify.button
...
@@ -427,7 +433,13 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'pnotify.button
return
returnObj
;
return
returnObj
;
}
}
if
(
collectionJSON
.
id
)
{
if
(
collectionJSON
.
id
)
{
returnObj
.
name
=
_
.
escape
(
collectionJSON
.
id
);
if
(
_
.
isObject
(
collectionJSON
.
id
))
{
if
(
collectionJSON
.
id
.
id
)
{
returnObj
.
name
=
_
.
escape
(
collectionJSON
.
id
.
id
);
}
}
else
{
returnObj
.
name
=
_
.
escape
(
collectionJSON
.
id
);
}
returnObj
.
key
=
'id'
;
returnObj
.
key
=
'id'
;
return
returnObj
;
return
returnObj
;
}
}
...
...
This diff is collapsed.
Click to expand it.
dashboardv2/public/js/views/audit/CreateAuditTableLayoutView.js
View file @
e483712b
...
@@ -41,7 +41,8 @@ define(['require',
...
@@ -41,7 +41,8 @@ define(['require',
auditCreate
:
"[data-id='auditCreate']"
,
auditCreate
:
"[data-id='auditCreate']"
,
noData
:
"[data-id='noData']"
,
noData
:
"[data-id='noData']"
,
tableAudit
:
"[data-id='tableAudit']"
,
tableAudit
:
"[data-id='tableAudit']"
,
auditHeaderValue
:
"[data-id='auditHeaderValue']"
auditHeaderValue
:
"[data-id='auditHeaderValue']"
,
tagHeader
:
"[data-id='tagHeader']"
},
},
/** ui events hash */
/** ui events hash */
events
:
function
()
{
events
:
function
()
{
...
@@ -79,13 +80,11 @@ define(['require',
...
@@ -79,13 +80,11 @@ define(['require',
}
}
}
}
var
values
=
parseDetailsObject
.
values
;
var
values
=
parseDetailsObject
.
values
;
if
(
this
.
action
&&
(
Enums
.
auditAction
.
ENTITY_CREATE
!==
this
.
action
&&
Enums
.
auditAction
.
ENTITY_UPDATE
!==
this
.
action
)
&&
name
)
{
if
(
parseDetailsObject
&&
parseDetailsObject
.
values
)
{
this
.
ui
.
auditHeaderValue
.
html
(
'<th>'
+
this
.
action
+
'</th>'
);
var
tagHeader
=
((
name
?
name
:
this
.
entityName
));
this
.
ui
.
auditValue
.
html
(
"<tr><td>"
+
(
name
?
name
:
this
.
entityName
)
+
"</td></tr>"
);
this
.
ui
.
tagHeader
.
append
(
tagHeader
);
}
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);
table
=
CommonViewFunction
.
propertyTable
({
scope
:
this
,
valueObject
:
values
,
entityDef
:
this
.
entityDef
,
extractJSON
:
{
extractKey
:
'value'
}
});
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
();
...
@@ -94,9 +93,7 @@ define(['require',
...
@@ -94,9 +93,7 @@ define(['require',
this
.
ui
.
noData
.
show
();
this
.
ui
.
noData
.
show
();
this
.
ui
.
tableAudit
.
hide
();
this
.
ui
.
tableAudit
.
hide
();
}
}
}
}
else
{
}
else
{
if
(
Enums
.
auditAction
.
ENTITY_DELETE
===
this
.
action
)
{
this
.
ui
.
auditHeaderValue
.
html
(
'<th>'
+
this
.
action
+
'</th>'
);
this
.
ui
.
auditHeaderValue
.
html
(
'<th>'
+
this
.
action
+
'</th>'
);
this
.
ui
.
auditValue
.
html
(
"<tr><td>"
+
(
name
?
name
:
this
.
entityName
)
+
"</td></tr>"
);
this
.
ui
.
auditValue
.
html
(
"<tr><td>"
+
(
name
?
name
:
this
.
entityName
)
+
"</td></tr>"
);
}
}
...
...
This diff is collapsed.
Click to expand it.
dashboardv2/public/js/views/entity/EntityDetailTableLayoutView.js
View file @
e483712b
...
@@ -65,7 +65,7 @@ define(['require',
...
@@ -65,7 +65,7 @@ define(['require',
});
});
attributeObject
.
columns
=
valueSorted
;
attributeObject
.
columns
=
valueSorted
;
}
}
var
table
=
CommonViewFunction
.
propertyTable
(
this
,
attributeObject
,
this
.
entityDef
);
var
table
=
CommonViewFunction
.
propertyTable
(
{
scope
:
this
,
valueObject
:
attributeObject
,
entityDef
:
this
.
entityDef
}
);
that
.
ui
.
detailValue
.
append
(
table
);
that
.
ui
.
detailValue
.
append
(
table
);
}
}
});
});
...
...
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