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
1decc731
Commit
1decc731
authored
May 03, 2017
by
Kalyani
Committed by
nixonrodrigues
May 10, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-1759 : UI - Add checkbox to exclude deleted entities in schema table.
parent
96d9a0ec
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
20 deletions
+60
-20
SchemaTableLayoutView_tmpl.html
...ublic/js/templates/schema/SchemaTableLayoutView_tmpl.html
+6
-1
SchemaLayoutView.js
dashboardv2/public/js/views/schema/SchemaLayoutView.js
+54
-19
No files found.
dashboardv2/public/js/templates/schema/SchemaTableLayoutView_tmpl.html
View file @
1decc731
...
...
@@ -16,9 +16,14 @@
-->
<div>
<div
class=
"tableOverlay"
></div>
<div
style=
"margin-left: 20px"
data-id=
"checkDeletedEntity"
>
<label
class=
"checkbox"
>
<input
type=
"checkbox"
class=
"input"
name=
"queryType"
value=
"text"
name=
"check"
value=
"1"
/>
Include historical entities
</label>
</div>
<div
class=
"clearfix"
>
<a
href=
"javascript:void(0)"
class=
"inputAssignTag multiSelectTerm btnAssign"
style=
"display:none"
data-id=
"addTerm"
><i
class=
"fa fa-folder-o"
></i>
Assign Term
</a>
<a
href=
"javascript:void(0)"
class=
"inputAssignTag multiSelectTag assignTag btnAssign"
style=
"display:none"
data-id=
"addAssignTag"
><i
class=
"fa fa-plus"
></i>
Assign Tag
</a>
</div>
<div
id=
"r_schemaTableLayoutView"
></div>
<div
id=
"r_schemaTableLayoutView"
>
</div>
</div>
dashboardv2/public/js/views/schema/SchemaLayoutView.js
View file @
1decc731
...
...
@@ -47,7 +47,9 @@ define(['require',
addTerm
:
'[data-id="addTerm"]'
,
showMoreLess
:
'[data-id="showMoreLess"]'
,
showMoreLessTerm
:
'[data-id="showMoreLessTerm"]'
,
addAssignTag
:
"[data-id='addAssignTag']"
addAssignTag
:
"[data-id='addAssignTag']"
,
checkDeletedEntity
:
"[data-id='checkDeletedEntity']"
,
},
/** ui events hash */
events
:
function
()
{
...
...
@@ -84,6 +86,8 @@ define(['require',
$
(
e
.
currentTarget
).
find
(
'span'
).
text
(
'Show less'
);
}
};
events
[
"click "
+
this
.
ui
.
checkDeletedEntity
]
=
'onCheckDeletedEntity'
;
return
events
;
},
/**
...
...
@@ -142,20 +146,36 @@ define(['require',
});
},
onRender
:
function
()
{
var
that
=
this
;
_
.
each
(
this
.
attribute
,
function
(
obj
)
{
var
defObj
=
that
.
entityDefCollection
.
fullCollection
.
find
({
name
:
obj
.
typeName
});
this
.
generateTableData
();
},
generateTableData
:
function
(
checkedDelete
)
{
var
that
=
this
,
newModel
;
this
.
activeObj
=
[];
this
.
deleteObj
=
[];
this
.
schemaTableAttribute
=
null
;
if
(
this
.
attribute
&&
this
.
attribute
[
0
])
{
var
firstColumn
=
this
.
attribute
[
0
],
defObj
=
that
.
entityDefCollection
.
fullCollection
.
find
({
name
:
firstColumn
.
typeName
});
if
(
defObj
&&
defObj
.
get
(
'options'
)
&&
defObj
.
get
(
'options'
).
schemaAttributes
)
{
try
{
var
mapObj
=
JSON
.
parse
(
defObj
.
get
(
'options'
).
schemaAttributes
);
var
newModel
=
that
.
referredEntities
[
obj
.
guid
];
newModel
.
schemaTableAttribute
=
_
.
pick
(
newModel
.
attributes
,
mapObj
);
if
(
newModel
.
attributes
[
'position'
])
{
newModel
[
'position'
]
=
newModel
.
attributes
[
'position'
];
}
that
.
schemaCollection
.
push
(
newModel
);
}
catch
(
e
)
{}
if
(
firstColumn
)
{
try
{
var
mapObj
=
JSON
.
parse
(
defObj
.
get
(
'options'
).
schemaAttributes
);
that
.
schemaTableAttribute
=
_
.
pick
(
firstColumn
.
attributes
,
mapObj
);
}
catch
(
e
)
{}
}
}
}
_
.
each
(
this
.
attribute
,
function
(
obj
)
{
newModel
=
that
.
referredEntities
[
obj
.
guid
];
if
(
newModel
.
attributes
[
'position'
])
{
newModel
[
'position'
]
=
newModel
.
attributes
[
'position'
];
}
if
(
!
Enums
.
entityStateReadOnly
[
newModel
.
status
])
{
that
.
activeObj
.
push
(
newModel
);
that
.
schemaCollection
.
push
(
newModel
);
}
else
if
(
Enums
.
entityStateReadOnly
[
newModel
.
status
])
{
that
.
deleteObj
.
push
(
newModel
);
}
});
$
(
'body'
).
click
(
function
(
e
)
{
...
...
@@ -167,6 +187,13 @@ define(['require',
that
.
$
(
'.popover.popoverTag'
).
hide
();
}
});
if
(
this
.
schemaCollection
.
length
===
0
&&
this
.
deleteObj
.
length
)
{
this
.
ui
.
checkDeletedEntity
.
find
(
"input"
).
prop
(
'checked'
,
true
);
this
.
schemaCollection
.
reset
(
this
.
deleteObj
,
{
silent
:
true
});
}
if
(
this
.
activeObj
.
length
===
0
&&
this
.
deleteObj
.
length
===
0
)
{
this
.
ui
.
checkDeletedEntity
.
hide
();
}
this
.
renderTableLayoutView
();
},
showLoader
:
function
()
{
...
...
@@ -177,7 +204,7 @@ define(['require',
this
.
$
(
'.fontLoader'
).
hide
();
this
.
$
(
'.tableOverlay'
).
hide
();
},
renderTableLayoutView
:
function
()
{
renderTableLayoutView
:
function
(
deleteEnity
)
{
var
that
=
this
;
require
([
'utils/TableLayout'
],
function
(
TableLayout
)
{
var
columnCollection
=
Backgrid
.
Columns
.
extend
({
...
...
@@ -222,7 +249,6 @@ define(['require',
},
getSchemaTableColumns
:
function
()
{
var
that
=
this
,
schemaFirstmodel
=
this
.
schemaCollection
.
first
(),
col
=
{
Check
:
{
name
:
"selected"
,
...
...
@@ -231,8 +257,8 @@ define(['require',
headerCell
:
"select-all"
}
}
if
(
schemaFirstmodel
)
{
_
.
each
(
_
.
keys
(
schemaFirstmodel
.
get
(
'schemaTableAttribute'
)
),
function
(
key
)
{
if
(
this
.
schemaTableAttribute
)
{
_
.
each
(
_
.
keys
(
this
.
schemaTableAttribute
),
function
(
key
)
{
if
(
key
!==
"position"
)
{
col
[
key
]
=
{
label
:
key
,
...
...
@@ -242,7 +268,7 @@ define(['require',
className
:
"searchTableName"
,
formatter
:
_
.
extend
({},
Backgrid
.
CellFormatter
.
prototype
,
{
fromRaw
:
function
(
rawValue
,
model
)
{
var
value
=
model
.
get
(
'
schemaTableAttribute
'
)[
key
];
var
value
=
model
.
get
(
'
attributes
'
)[
key
];
if
(
key
===
"name"
&&
model
.
get
(
'guid'
))
{
var
nameHtml
=
'<a href="#!/detailPage/'
+
model
.
get
(
'guid'
)
+
'">'
+
value
+
'</a>'
;
if
(
model
.
get
(
'status'
)
&&
Enums
.
entityStateReadOnly
[
model
.
get
(
'status'
)])
{
...
...
@@ -410,6 +436,15 @@ define(['require',
that
.
fetchCollection
();
}
});
},
onCheckDeletedEntity
:
function
(
e
)
{
if
(
e
.
target
.
checked
)
{
if
(
this
.
deleteObj
.
length
)
{
this
.
schemaCollection
.
reset
(
this
.
activeObj
.
concat
(
this
.
deleteObj
));
}
}
else
{
this
.
schemaCollection
.
reset
(
this
.
activeObj
);
}
}
});
return
SchemaTableLayoutView
;
...
...
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