Commit 69330a5d by kevalbhatt Committed by Madhan Neethiraj

ATLAS-2295: UI updates for classifications

parent ca04aead
...@@ -112,6 +112,9 @@ td { ...@@ -112,6 +112,9 @@ td {
td { td {
white-space: normal; white-space: normal;
} }
.select-all-header-cell{
width : 42px;
}
} }
.backgrid-paginator ul { .backgrid-paginator ul {
......
...@@ -23,35 +23,54 @@ ...@@ -23,35 +23,54 @@
height: 150px; height: 150px;
overflow-y: auto; overflow-y: auto;
} }
.child>li,
>li { >li {
list-style: none; list-style: none;
cursor: pointer; cursor: pointer;
&.parent-node { &.parent-node {
position: relative; position: relative;
margin-top: 5px;
/* margin-bottom: 5px; */
border-radius: 4px;
&:hover {
background-color: $color_star_dust_approx;
}
&.active { &.active {
&>div {
background-color: $color_jungle_green_approx; background-color: $color_jungle_green_approx;
border: none; border: none;
.tools { .tools {
display: block display: block
} }
}
>ul>li {
line-height: 30px;
margin-left: -20px;
text-indent: 20px;
&:hover { &:hover {
background-color: $color_keppel_approx; background-color: $color_jungle_green_approx;
} }
&.selected {
background-color: $color_keppel_approx;
} }
ul.child {
&:after {
height: 4px;
top: -5px;
} }
}
}
&>div {
position: relative;
margin-top: 5px;
/* margin-bottom: 5px; */
border-radius: 4px;
&:hover {
background-color: $color_star_dust_approx;
}
>.fa.toggleArrow {
position: absolute;
left: 0;
padding: 8px;
cursor: pointer;
} // >ul>li {
// line-height: 30px;
// margin-left: -20px;
// text-indent: 20px;
// &:hover {
// background-color: $color_keppel_approx;
// }
// &.selected {
// background-color: $color_keppel_approx;
// }
// }
.tools { .tools {
display: none; display: none;
position: absolute; position: absolute;
...@@ -59,7 +78,6 @@ ...@@ -59,7 +78,6 @@
color: $white; color: $white;
padding: 5px 10px; padding: 5px 10px;
} }
}
>a, >a,
>div>a { >div>a {
display: block; display: block;
...@@ -74,13 +92,42 @@ ...@@ -74,13 +92,42 @@
text-decoration: none !important; text-decoration: none !important;
} }
} }
>i+a {
padding: 5px 25px;
}
}
>ul.child {
margin-left: 11px;
padding-left: 10px;
border-left: 1px dotted gray;
position: relative;
&:after {
position: absolute;
content: "";
height: 13px;
width: 11px;
top: -14px;
left: -1px;
border-left: 1px dotted gray;
}
li {
&.parent-node {
&:after {
position: absolute;
content: "";
height: 2px;
width: 14px;
top: 16px;
left: -9px;
border-top: 1px dotted gray;
}
&.active:after {
width: 9px;
}
}
}
} }
>ul {
padding-left: 20px;
li {}
} }
.tagAsset {
display: none;
} }
} }
......
...@@ -145,6 +145,11 @@ a { ...@@ -145,6 +145,11 @@ a {
} }
} }
.cursor-default,
.cursor-default a {
cursor: default;
}
.blue-link { .blue-link {
color: $color_havelock_blue_approx; color: $color_havelock_blue_approx;
&:focus { &:focus {
......
...@@ -160,7 +160,7 @@ require.config({ ...@@ -160,7 +160,7 @@ require.config({
'daterangepicker': 'libs/bootstrap-daterangepicker/js/daterangepicker', 'daterangepicker': 'libs/bootstrap-daterangepicker/js/daterangepicker',
'nvd3': 'libs/nvd3/nv.d3.min', 'nvd3': 'libs/nvd3/nv.d3.min',
'sparkline': 'libs/sparkline/jquery.sparkline.min', 'sparkline': 'libs/sparkline/jquery.sparkline.min',
'table-dragger' : 'libs/table-dragger/table-dragger' 'table-dragger': 'libs/table-dragger/table-dragger'
}, },
/** /**
...@@ -237,6 +237,10 @@ require(['App', ...@@ -237,6 +237,10 @@ require(['App',
this.entityDefCollection.fetch({ this.entityDefCollection.fetch({
skipDefaultError: true, skipDefaultError: true,
complete: function() { complete: function() {
that.entityDefCollection.fullCollection.comparator = function(model) {
return model.get('name').toLowerCase();
};
that.entityDefCollection.fullCollection.sort({ silent: true });
--that.asyncFetchCounter; --that.asyncFetchCounter;
startApp(); startApp();
} }
...@@ -244,6 +248,10 @@ require(['App', ...@@ -244,6 +248,10 @@ require(['App',
this.typeHeaders.fetch({ this.typeHeaders.fetch({
skipDefaultError: true, skipDefaultError: true,
complete: function() { complete: function() {
that.typeHeaders.fullCollection.comparator = function(model) {
return model.get('name').toLowerCase();
}
that.typeHeaders.fullCollection.sort({ silent: true });
--that.asyncFetchCounter; --that.asyncFetchCounter;
startApp(); startApp();
} }
...@@ -251,6 +259,10 @@ require(['App', ...@@ -251,6 +259,10 @@ require(['App',
this.enumDefCollection.fetch({ this.enumDefCollection.fetch({
skipDefaultError: true, skipDefaultError: true,
complete: function() { complete: function() {
that.enumDefCollection.fullCollection.comparator = function(model) {
return model.get('name').toLowerCase();
};
that.enumDefCollection.fullCollection.sort({ silent: true });
--that.asyncFetchCounter; --that.asyncFetchCounter;
startApp(); startApp();
} }
...@@ -258,6 +270,10 @@ require(['App', ...@@ -258,6 +270,10 @@ require(['App',
this.classificationDefCollection.fetch({ this.classificationDefCollection.fetch({
skipDefaultError: true, skipDefaultError: true,
complete: function() { complete: function() {
that.classificationDefCollection.fullCollection.comparator = function(model) {
return model.get('name').toLowerCase();
};
that.classificationDefCollection.fullCollection.sort({ silent: true });
--that.asyncFetchCounter; --that.asyncFetchCounter;
startApp(); startApp();
} }
......
...@@ -139,7 +139,8 @@ define([ ...@@ -139,7 +139,8 @@ define([
} }
App.rSideNav.show(new SideNavLayoutView( App.rSideNav.show(new SideNavLayoutView(
_.extend({ _.extend({
'tag': tagName 'tag': tagName,
'value': paramObj
}, that.preFetchedCollectionLists, that.sharedObj) }, that.preFetchedCollectionLists, that.sharedObj)
)); ));
} else { } else {
...@@ -150,7 +151,7 @@ define([ ...@@ -150,7 +151,7 @@ define([
updateTabState: true updateTabState: true
}); });
} }
App.rSideNav.currentView.RTagLayoutView.currentView.manualRender(tagName); App.rSideNav.currentView.RTagLayoutView.currentView.manualRender(_.extend({}, paramObj, { 'tagName': tagName }));
App.rSideNav.currentView.selectTab(); App.rSideNav.currentView.selectTab();
} }
if (tagName) { if (tagName) {
......
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
* limitations under the License. * limitations under the License.
--> -->
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-sm-4">
<div class="col-md-8 subContent"> <div class="col-sm-8 subContent">
<p data-id="atlasVersion"></p> <p data-id="atlasVersion"></p>
<br> <br>
<p class="text-info">Get involved!</p> <p class="text-info">Get involved!</p>
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
</div> </div>
{{#if includePagination}} {{#if includePagination}}
<div class="row clearfix banded pagination-box"> <div class="row clearfix banded pagination-box">
<div class="col-md-offset-4 col-md-8"> <div class="col-sm-offset-4 col-sm-8">
<div class="inline-content-fr"> <div class="inline-content-fr">
<div data-id="r_pagination" class="inline"></div> <div data-id="r_pagination" class="inline"></div>
{{#if includePageSize}} {{#if includePageSize}}
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<div class="fontLoader"> <div class="fontLoader">
<i class="fa fa-refresh fa-spin-custom"></i> <i class="fa fa-refresh fa-spin-custom"></i>
</div> </div>
<div class="entityDetail form-horizontal col-md-12"> <div class="entityDetail form-horizontal col-sm-12">
<div class="row"> <div class="row">
<a href="javascript:void(0);" data-id="backButton"><i class="fa fa-chevron-left"></i> Back To Results</a> <a href="javascript:void(0);" data-id="backButton"><i class="fa fa-chevron-left"></i> Back To Results</a>
</div> </div>
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
</div> </div>
<div class="panel-body"> <div class="panel-body">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-sm-12">
<ul class="nav nav-tabs "> <ul class="nav nav-tabs ">
<li role="properties" class="tab active"><a href="#tab-details" aria-controls="tab-details" role="tab" data-toggle="tab">Properties</a></li> <li role="properties" class="tab active"><a href="#tab-details" aria-controls="tab-details" role="tab" data-toggle="tab">Properties</a></li>
<li role="tags"><a href="#tab-tagTable" aria-controls="tab-tagTable" role="tab" data-toggle="tab">Tags</a></li> <li role="tags"><a href="#tab-tagTable" aria-controls="tab-tagTable" role="tab" data-toggle="tab">Tags</a></li>
......
...@@ -19,15 +19,15 @@ ...@@ -19,15 +19,15 @@
<div class="col-sm-12 form-group"> <div class="col-sm-12 form-group">
<div class="row"> <div class="row">
{{#if guid}} {{#if guid}}
<div class="col-md-8"> <div class="col-sm-8">
<label class="col-md-6 row-margin-bottom" data-id="assetName"></label> <label class="col-sm-6 row-margin-bottom" data-id="assetName"></label>
</div> </div>
{{else}} {{else}}
<div class="col-md-8"> <div class="col-sm-8">
<select class="form-control col-md-6 row-margin-bottom" data-id="entityList"></select> <select class="form-control col-sm-6 row-margin-bottom" data-id="entityList"></select>
</div> </div>
{{/if}} {{/if}}
<div class="col-md-4"> <div class="col-sm-4">
<span class="pull-left">Required</span> <span class="pull-left">Required</span>
<label class="switch pull-left"> <label class="switch pull-left">
<input type="checkbox" class="switch-input" name="toggleRequired" value="text"> <input type="checkbox" class="switch-input" name="toggleRequired" value="text">
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-12 entityInputData" data-id="entityInputData"></div> <div class="col-sm-12 entityInputData" data-id="entityInputData"></div>
</div> </div>
</form> </form>
<div class="fontLoader-relative entityLoader" style="display:none"> <div class="fontLoader-relative entityLoader" style="display:none">
......
...@@ -16,15 +16,15 @@ ...@@ -16,15 +16,15 @@
--> -->
<div class="row"> <div class="row">
<div class=""> <div class="">
<div class="col-md-3 rowValue"> <div class="col-sm-3 rowValue">
<div><span class="graphkey">Rows</span></div> <div><span class="graphkey">Rows</span></div>
<div><span class="graphval"><div class="value-loader"></div></span></div> <div><span class="graphval"><div class="value-loader"></div></span></div>
</div> </div>
<div class="col-md-3 table_created"> <div class="col-sm-3 table_created">
<div><span class="graphkey">Date Created</span></div> <div><span class="graphkey">Date Created</span></div>
<div><span class="graphval"><div class="value-loader"></div></span></div> <div><span class="graphval"><div class="value-loader"></div></span></div>
</div> </div>
<div class="col-md-6 table_name"> <div class="col-sm-6 table_name">
<div><span class="graphkey">Table</span></div> <div><span class="graphkey">Table</span></div>
<div><span class="graphval"><div class="value-loader"></div></span></div> <div><span class="graphval"><div class="value-loader"></div></span></div>
</div> </div>
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
</div> </div>
<hr/> <hr/>
<div class="row"> <div class="row">
<h4 class="col-md-12">{{typeObject.label}}</h4> <h4 class="col-sm-12">{{typeObject.label}}</h4>
</div> </div>
<div class="row"> <div class="row">
<a href="javascript:void(0);" data-id="backToYear" style="display: none"><i class="fa fa-chevron-left"></i> Back To Year</a> <a href="javascript:void(0);" data-id="backToYear" style="display: none"><i class="fa fa-chevron-left"></i> Back To Year</a>
...@@ -40,10 +40,10 @@ ...@@ -40,10 +40,10 @@
</br> </br>
<div class="row"> <div class="row">
<div class=""> <div class="">
<div class="col-md-10"> <div class="col-sm-10">
<svg class="graph" width="100%" height="250px"></svg> <svg class="graph" width="100%" height="250px"></svg>
</div> </div>
<div class="col-md-2 profileGraphDetail"> <div class="col-sm-2 profileGraphDetail">
{{#if profileData}} {{#if profileData}}
<div class=""> <div class="">
<div><span class="graphkey">Cardinality</span></div> <div><span class="graphkey">Cardinality</span></div>
......
...@@ -16,19 +16,19 @@ ...@@ -16,19 +16,19 @@
--> -->
<div class="row"> <div class="row">
<div class=""> <div class="">
<div class="col-md-3 rowValue"> <div class="col-sm-3 rowValue">
<div><span class="graphkey">Rows</span></div> <div><span class="graphkey">Rows</span></div>
<div><span class="graphval"><div class="value-loader"></div></span></div> <div><span class="graphval"><div class="value-loader"></div></span></div>
</div> </div>
<div class="col-md-3 table_created"> <div class="col-sm-3 table_created">
<div><span class="graphkey">Date Created</span></div> <div><span class="graphkey">Date Created</span></div>
<div><span class="graphval"><div class="value-loader"></div></span></div> <div><span class="graphval"><div class="value-loader"></div></span></div>
</div> </div>
<div class="col-md-3 table_name"> <div class="col-sm-3 table_name">
<div><span class="graphkey">Table</span></div> <div><span class="graphkey">Table</span></div>
<div><span class="graphval"><div class="value-loader"></div></span></div> <div><span class="graphval"><div class="value-loader"></div></span></div>
</div> </div>
<div class="col-md-3 db_name"> <div class="col-sm-3 db_name">
<div><span class="graphkey">DB</span></div> <div><span class="graphkey">DB</span></div>
<div><span class="graphval"><div class="value-loader"></div></span></div> <div><span class="graphval"><div class="value-loader"></div></span></div>
</div> </div>
......
...@@ -25,10 +25,10 @@ ...@@ -25,10 +25,10 @@
<div class="searchTable"> <div class="searchTable">
<div class="row well"> <div class="row well">
<div class="row form-group pagination-box" style="display: none;"> <div class="row form-group pagination-box" style="display: none;">
<div class="col-md-4"> <div class="col-sm-4">
<span class="labelShowRecord pull-left" data-id="pageRecordText"> </span> <span class="labelShowRecord pull-left" data-id="pageRecordText"> </span>
</div> </div>
<div class="col-md-8 inline-content-fr"> <div class="col-sm-8 inline-content-fr">
<div class="inline" data-id="colManager"></div> <div class="inline" data-id="colManager"></div>
<div class="inline" data-id="containerCheckBox" style="display: none;"> <div class="inline" data-id="containerCheckBox" style="display: none;">
<label class="checkbox-inline btn" for="inputLabel"> <label class="checkbox-inline btn" for="inputLabel">
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
{{/if}} {{/if}}
</div> </div>
<div class="row pagination-box" style="display: none"> <div class="row pagination-box" style="display: none">
<div class="col-md-offset-4 col-md-8"> <div class="col-sm-offset-4 col-sm-8">
<div class="inline-content-fr"> <div class="inline-content-fr">
<div class="backgrid-paginator inline"> <div class="backgrid-paginator inline">
<ul class="" data-id="paginationDiv" style="display:none"> <ul class="" data-id="paginationDiv" style="display:none">
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
</li> </li>
</ul> </ul>
</div> </div>
<div class="inline col-md-4" data-id="paginationDiv"> <div class="inline col-sm-4" data-id="paginationDiv">
<div class="input-group" data-id="goToPageDiv"> <div class="input-group" data-id="goToPageDiv">
<input type="text" class="form-control number-input" data-id="gotoPage" placeholder="Goto Page" /> <input type="text" class="form-control number-input" data-id="gotoPage" placeholder="Goto Page" />
<span class="input-group-btn"> <span class="input-group-btn">
......
...@@ -14,12 +14,6 @@ ...@@ -14,12 +14,6 @@
* 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.
--> -->
<!-- <div class="row">
<div class="col-md-10"><span>{{name}}</span></div>
<div class="col-md-2">
<button type="button" class="btn btn-danger btn-sm closeInput" data-id="close"><i class="fa fa-times"></i></button>
</div>
</div> -->
<div data-id="{{guid}}" class="item"> <div data-id="{{guid}}" class="item">
<div class="tools"> <div class="tools">
<i class="fa fa-ellipsis-h saveSearchPopover" data-original-title="" title="" data-id=""></i> <i class="fa fa-ellipsis-h saveSearchPopover" data-original-title="" title="" data-id=""></i>
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
</div> </div>
{{#if create}} {{#if create}}
<div class="form-group"> <div class="form-group">
<div class="col-md-12"> <div class="col-sm-12">
<label>Select tags to inherit attributes(optional)</label> <label>Select tags to inherit attributes(optional)</label>
<p class="text-gray">Attributes define additional properties for the tag</p> <p class="text-gray">Attributes define additional properties for the tag</p>
<select class="form-control" data-id="parentTagList" multiple="multiple"></select> <select class="form-control" data-id="parentTagList" multiple="multiple"></select>
......
...@@ -18,13 +18,23 @@ ...@@ -18,13 +18,23 @@
<div class="fontLoader"> <div class="fontLoader">
<i class="fa fa-refresh fa-spin-custom"></i> <i class="fa fa-refresh fa-spin-custom"></i>
</div> </div>
<div class="tagDetail clearfix form-horizontal col-md-12"> <div class="tagDetail clearfix form-horizontal col-sm-12">
<h1 class="form-group"><span data-id="title"></span></h1> <h1 class="form-group"><span data-id="title"></span></h1>
<button type="button" data-id="editButton" class="btn btn-sm btn-action pull-right"><i class="fa fa-pencil"></i></button> <button type="button" data-id="editButton" class="btn btn-sm btn-action pull-right"><i class="fa fa-pencil"></i></button>
<p class="form-group" data-id="description"></p> <p class="form-group" data-id="description"></p>
<div class="superType form-group" style="display:none"> <div class="superType form-group" style="display:none">
<label class="control-label-sm-pr pull-left">Derived From:</label> <label class="control-label-sm-pr pull-left">Direct super-tags:</label>
<div data-id="showSuperType" class="btn-inline"> <div data-id="superType" class="btn-inline">
</div>
</div>
<div class="subType form-group" style="display:none">
<label class="control-label-sm-pr pull-left">Direct sub-tags:</label>
<div data-id="subType" class="btn-inline">
</div>
</div>
<div class="entityType form-group cursor-default" style="display:none">
<label class="control-label-sm-pr pull-left">Entity-types:</label>
<div data-id="entityType" class="btn-inline">
</div> </div>
</div> </div>
<div class="attributes form-group"> <div class="attributes form-group">
......
...@@ -15,11 +15,11 @@ ...@@ -15,11 +15,11 @@
* limitations under the License. * limitations under the License.
--> -->
<div class="form-group clearfix"> <div class="form-group clearfix">
<div class="col-md-7"> <div class="col-sm-7">
<input class="form-control attributeInput" data-id="attributeInput" placeholder="Attribute name"> <input class="form-control attributeInput" data-id="attributeInput" placeholder="Attribute name">
</input> </input>
</div> </div>
<div class="col-md-3"> <div class="col-sm-3">
<select class="form-control dataTypeSelector" data-id="dataTypeSelector"> <select class="form-control dataTypeSelector" data-id="dataTypeSelector">
<option selected="selected">string</option> <option selected="selected">string</option>
<option>boolean</option> <option>boolean</option>
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<option>date</option> <option>date</option>
</select> </select>
</div> </div>
<div class="col-md-2 attributePlusData" align="right"> <div class="col-sm-2 attributePlusData" align="right">
<button type="button" class="btn btn-danger btn-sm closeInput" data-id="close"><i class="fa fa-times"></i></button> <button type="button" class="btn btn-danger btn-sm closeInput" data-id="close"><i class="fa fa-times"></i></button>
</div> </div>
</div> </div>
\ No newline at end of file
...@@ -14,10 +14,36 @@ ...@@ -14,10 +14,36 @@
* 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.
--> -->
<div class="clearfix add-seperator"> <div class="col-sm-12 add-seperator">
<button type="button" class="btn btn-action btn-md pull-left" data-id="createTag" type="button"><i class="fa fa-plus"></i> Create Tag</button> <div class="row">
<div class="col-sm-6 no-padding" style="margin-top: 5px;">
<span class="pull-left">Flat</span>
<label class="switch pull-left">
<input type="checkbox" class="switch-input" name="tagView" value="text" />
<span class="switch-slider"></span>
</label>
<span class="pull-left">Tree</span>
</div>
<div class="col-sm-6 no-padding-right">
<button type="button" class="btn btn-action btn-md pull-right" title="Refresh" data-id="refreshTag" onclick="this.blur();" type="button"><i class="fa fa-refresh"></i></button> <button type="button" class="btn btn-action btn-md pull-right" title="Refresh" data-id="refreshTag" onclick="this.blur();" type="button"><i class="fa fa-refresh"></i></button>
<button type="button" class="btn btn-action btn-md pull-right" data-id="createTag" type="button"><i class="fa fa-plus"></i></button>
</div>
</div>
</div>
<!-- <div class="clearfix add-seperator">
<button type="button" class="btn btn-action btn-md pull-left" data-id="createTag" type="button"><i class="fa fa-plus"></i> Create Tag</button>
</div> -->
<div class="row">
<div class="list-view col-sm-12">
<input type="text" class="form-control" data-id="offlineSearchTag" placeholder="Search Tags">
<ul class="tag-tree" data-id="tagsList">
</ul>
</div>
<div class="tree-view col-sm-12" style="display: none;">
<div class="treeLov">
<select class="form-control" data-id="treeLov"></select>
</div>
<ul class="tag-tree" data-id="tagsParent">
</ul>
</div>
</div> </div>
\ No newline at end of file
<input type="text" class="form-control" data-id="offlineSearchTag" placeholder="Search Tags">
<ul class="tag-tree" data-id="tagsParent">
</ul>
\ No newline at end of file
...@@ -304,16 +304,17 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums', ...@@ -304,16 +304,17 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
} }
}, },
isInitial: function() { isInitial: function() {
return this.getQueryUrl().firstValue == undefined ? true : false; return this.getQueryUrl().firstValue == undefined;
}, },
isTagTab: function(url) { isTagTab: function(url) {
return this.getQueryUrl(url).firstValue == "tag" ? true : false; var quey = this.getQueryUrl(url);
return quey.firstValue == "tag" || quey.queyParams[0] == "#!/tag";
}, },
isSearchTab: function(url) { isSearchTab: function(url) {
return this.getQueryUrl(url).firstValue == "search" ? true : false; return this.getQueryUrl(url).firstValue == "search";
}, },
isDetailPage: function(url) { isDetailPage: function(url) {
return this.getQueryUrl(url).firstValue == "detailPage" ? true : false; return this.getQueryUrl(url).firstValue == "detailPage";
}, },
getLastValue: function() { getLastValue: function() {
return this.getQueryUrl().lastValue; return this.getQueryUrl().lastValue;
......
...@@ -328,6 +328,7 @@ define(['require', ...@@ -328,6 +328,7 @@ define(['require',
}, },
showLoader: that.showLoader.bind(that), showLoader: that.showLoader.bind(that),
hideLoader: that.hideLoader.bind(that), hideLoader: that.hideLoader.bind(that),
collection: that.classificationDefCollection,
enumDefCollection: that.enumDefCollection enumDefCollection: that.enumDefCollection
}); });
view.modal.on('ok', function() { view.modal.on('ok', function() {
......
...@@ -234,10 +234,7 @@ define(['require', ...@@ -234,10 +234,7 @@ define(['require',
} }
} else { } else {
var str = '<option disabled="disabled" selected>--Select entity-type--</option>'; var str = '<option disabled="disabled" selected>--Select entity-type--</option>';
this.entityDefCollection.fullCollection.comparator = function(model) { this.entityDefCollection.fullCollection.each(function(val) {
return model.get('name');
}
this.entityDefCollection.fullCollection.sort().each(function(val) {
var name = Utils.getName(val.toJSON()); var name = Utils.getName(val.toJSON());
if (Globals.entityTypeConfList) { if (Globals.entityTypeConfList) {
if (_.isEmptyArray(Globals.entityTypeConfList)) { if (_.isEmptyArray(Globals.entityTypeConfList)) {
...@@ -400,9 +397,9 @@ define(['require', ...@@ -400,9 +397,9 @@ define(['require',
}, },
getContainer: function(value) { getContainer: function(value) {
var entityLabel = this.capitalize(value.name); var entityLabel = this.capitalize(value.name);
return '<div class="row form-group ' + value.isOptional + '"><span class="col-md-3">' + return '<div class="row form-group ' + value.isOptional + '"><span class="col-sm-3">' +
'<label><span class="' + (value.isOptional ? 'true' : 'false required') + '">' + entityLabel + '</span><span class="center-block ellipsis text-gray" title="Data Type : ' + value.typeName + '">' + '(' + Utils.escapeHtml(value.typeName) + ')' + '</span></label></span>' + '<label><span class="' + (value.isOptional ? 'true' : 'false required') + '">' + entityLabel + '</span><span class="center-block ellipsis text-gray" title="Data Type : ' + value.typeName + '">' + '(' + Utils.escapeHtml(value.typeName) + ')' + '</span></label></span>' +
'<span class="col-md-9">' + (this.getElement(value)) + '<span class="col-sm-9">' + (this.getElement(value)) +
'</input></span></div>'; '</input></span></div>';
}, },
getFieldSet: function(name, alloptional, attributeInput) { getFieldSet: function(name, alloptional, attributeInput) {
......
...@@ -73,7 +73,7 @@ define(['require', ...@@ -73,7 +73,7 @@ define(['require',
* @constructs * @constructs
*/ */
initialize: function(options) { initialize: function(options) {
_.extend(this, _.pick(options, 'guid', 'entityDefCollection', 'attribute', 'fetchCollection', 'enumDefCollection')); _.extend(this, _.pick(options, 'guid', 'classificationDefCollection', 'entityDefCollection', 'attribute', 'fetchCollection', 'enumDefCollection'));
this.schemaCollection = new VSchemaList([], {}); this.schemaCollection = new VSchemaList([], {});
this.commonTableOptions = { this.commonTableOptions = {
collection: this.schemaCollection, collection: this.schemaCollection,
...@@ -274,6 +274,7 @@ define(['require', ...@@ -274,6 +274,7 @@ define(['require',
}, },
hideLoader: that.hideLoader.bind(that), hideLoader: that.hideLoader.bind(that),
showLoader: that.showLoader.bind(that), showLoader: that.showLoader.bind(that),
collection: that.classificationDefCollection,
enumDefCollection: that.enumDefCollection enumDefCollection: that.enumDefCollection
}); });
}); });
......
...@@ -43,7 +43,7 @@ define(['require', ...@@ -43,7 +43,7 @@ define(['require',
* @constructs * @constructs
*/ */
initialize: function(options) { initialize: function(options) {
_.extend(this, _.pick(options, 'value', 'initialView', 'entityDefCollection', 'typeHeaders', 'searchVent', 'enumDefCollection', 'searchTableColumns')); _.extend(this, _.pick(options, 'value', 'initialView', 'classificationDefCollection', 'entityDefCollection', 'typeHeaders', 'searchVent', 'enumDefCollection', 'searchTableColumns'));
}, },
bindEvents: function() {}, bindEvents: function() {},
onRender: function() { onRender: function() {
......
...@@ -184,18 +184,14 @@ define(['require', ...@@ -184,18 +184,14 @@ define(['require',
}, },
bindEvents: function(param) { bindEvents: function(param) {
this.listenTo(this.typeHeaders, "reset", function(value) { this.listenTo(this.typeHeaders, "reset", function(value) {
this.initializeValues();
}, this);
},
initializeValues: function() {
this.renderTypeTagList(); this.renderTypeTagList();
this.setValues(); this.setValues();
this.ui.typeLov.select2({
placeholder: "Select",
allowClear: true
});
this.ui.tagLov.select2({
placeholder: "Select",
allowClear: true
});
this.checkForButtonVisiblity(); this.checkForButtonVisiblity();
}, this); this.renderSaveSearch();
}, },
makeFilterButtonActive: function(filtertypeParam) { makeFilterButtonActive: function(filtertypeParam) {
var filtertype = ['entityFilters', 'tagFilters'], var filtertype = ['entityFilters', 'tagFilters'],
...@@ -306,17 +302,7 @@ define(['require', ...@@ -306,17 +302,7 @@ define(['require',
}, },
onRender: function() { onRender: function() {
// array of tags which is coming from url // array of tags which is coming from url
this.renderTypeTagList(); this.initializeValues();
this.setValues();
this.ui.typeLov.select2({
placeholder: "Select",
allowClear: true
});
this.ui.tagLov.select2({
placeholder: "Select",
allowClear: true
});
this.renderSaveSearch();
}, },
updateQueryObject: function(param) { updateQueryObject: function(param) {
if (param && param.searchType) { if (param && param.searchType) {
...@@ -420,10 +406,7 @@ define(['require', ...@@ -420,10 +406,7 @@ define(['require',
this.ui.typeLov.empty(); this.ui.typeLov.empty();
var typeStr = '<option></option>', var typeStr = '<option></option>',
tagStr = typeStr; tagStr = typeStr;
this.typeHeaders.fullCollection.comparator = function(model) { this.typeHeaders.fullCollection.each(function(model) {
return Utils.getName(model.toJSON(), 'name').toLowerCase();
}
this.typeHeaders.fullCollection.sort().each(function(model) {
var name = Utils.getName(model.toJSON(), 'name'); var name = Utils.getName(model.toJSON(), 'name');
if (model.get('category') == 'ENTITY') { if (model.get('category') == 'ENTITY') {
typeStr += '<option>' + (name) + '</option>'; typeStr += '<option>' + (name) + '</option>';
...@@ -434,6 +417,14 @@ define(['require', ...@@ -434,6 +417,14 @@ define(['require',
}); });
that.ui.typeLov.html(typeStr); that.ui.typeLov.html(typeStr);
that.ui.tagLov.html(tagStr); that.ui.tagLov.html(tagStr);
this.ui.typeLov.select2({
placeholder: "Select",
allowClear: true
});
this.ui.tagLov.select2({
placeholder: "Select",
allowClear: true
});
}, },
setValues: function(paramObj) { setValues: function(paramObj) {
var arr = [], var arr = [],
......
...@@ -120,14 +120,13 @@ define(['require', ...@@ -120,14 +120,13 @@ define(['require',
* @constructs * @constructs
*/ */
initialize: function(options) { initialize: function(options) {
_.extend(this, _.pick(options, 'value', 'initialView', 'isTypeTagNotExists', 'entityDefCollection', 'typeHeaders', 'searchVent', 'enumDefCollection', 'tagCollection', 'searchTableColumns')); _.extend(this, _.pick(options, 'value', 'initialView', 'isTypeTagNotExists', 'classificationDefCollection', 'entityDefCollection', 'typeHeaders', 'searchVent', 'enumDefCollection', 'tagCollection', 'searchTableColumns'));
this.entityModel = new VEntity(); this.entityModel = new VEntity();
this.searchCollection = new VSearchList(); this.searchCollection = new VSearchList();
this.limit = 25; this.limit = 25;
this.asyncFetchCounter = 0; this.asyncFetchCounter = 0;
this.offset = 0; this.offset = 0;
this.bindEvents(); this.bindEvents();
this.bradCrumbList = [];
this.arr = []; this.arr = [];
this.searchType = 'Basic Search'; this.searchType = 'Basic Search';
this.columnOrder = null; this.columnOrder = null;
...@@ -501,7 +500,6 @@ define(['require', ...@@ -501,7 +500,6 @@ define(['require',
return this; return this;
} }
}); });
that.bradCrumbList = [];
var columns = new columnCollection((that.searchCollection.dynamicTable ? that.getDaynamicColumns(that.searchCollection.toJSON()) : that.getFixedDslColumn())); var columns = new columnCollection((that.searchCollection.dynamicTable ? that.getDaynamicColumns(that.searchCollection.toJSON()) : that.getFixedDslColumn()));
columns.setPositions().sort(); columns.setPositions().sort();
that.REntityTableLayoutView.show(new TableLayout(_.extend({}, that.commonTableOptions, { that.REntityTableLayoutView.show(new TableLayout(_.extend({}, that.commonTableOptions, {
...@@ -791,6 +789,7 @@ define(['require', ...@@ -791,6 +789,7 @@ define(['require',
tagList: that.getTagList(guid, multiple), tagList: that.getTagList(guid, multiple),
showLoader: that.showLoader.bind(that), showLoader: that.showLoader.bind(that),
hideLoader: that.hideLoader.bind(that), hideLoader: that.hideLoader.bind(that),
collection: that.classificationDefCollection,
enumDefCollection: that.enumDefCollection enumDefCollection: that.enumDefCollection
}); });
}); });
......
...@@ -28,9 +28,8 @@ define(['require', ...@@ -28,9 +28,8 @@ define(['require',
template: tmpl, template: tmpl,
regions: { regions: {
RBusinessCatalogLayoutView: "#r_businessCatalogLayoutView",
RTagLayoutView: "#r_tagLayoutView", RTagLayoutView: "#r_tagLayoutView",
RSearchLayoutView: "#r_searchLayoutView", RSearchLayoutView: "#r_searchLayoutView"
}, },
ui: { ui: {
tabs: '.tabs li a', tabs: '.tabs li a',
...@@ -92,6 +91,7 @@ define(['require', ...@@ -92,6 +91,7 @@ define(['require',
collection: that.classificationDefCollection, collection: that.classificationDefCollection,
tag: that.tag, tag: that.tag,
value: that.value, value: that.value,
enumDefCollection: that.enumDefCollection,
typeHeaders: that.typeHeaders typeHeaders: that.typeHeaders
})); }));
}); });
......
...@@ -61,27 +61,17 @@ define(['require', ...@@ -61,27 +61,17 @@ define(['require',
return events; return events;
}, },
initialize: function(options) { initialize: function(options) {
// this.parentView = options.parentView; _.extend(this, _.pick(options, 'enumDefCollection'));
this.collection = new Backbone.Collection(); this.collection = new Backbone.Collection();
this.typeEnum = new VTagList(); this.collectionAttribute();
this.typeEnum.url = UrlLinks.typedefsUrl().defs;
this.typeEnum.modelAttrName = "enumDefs";
}, },
onRender: function() { onRender: function() {
var that = this; var that = this;
this.$('.fontLoader').show();
this.ui.addAttributeDiv.find('.closeInput').hide(); this.ui.addAttributeDiv.find('.closeInput').hide();
if (!('placeholder' in HTMLInputElement.prototype)) { if (!('placeholder' in HTMLInputElement.prototype)) {
this.ui.addAttributeDiv.find('input,textarea').placeholder(); this.ui.addAttributeDiv.find('input,textarea').placeholder();
} }
that.typeEnum.fetch({
reset: true,
complete: function(model, response) {
that.collectionAttribute();
that.$('.fontLoader').hide();
that.$('.hide').removeClass('hide'); that.$('.hide').removeClass('hide');
}
});
}, },
bindEvents: function() {}, bindEvents: function() {},
collectionAttribute: function() { collectionAttribute: function() {
......
...@@ -53,8 +53,7 @@ define(['require', ...@@ -53,8 +53,7 @@ define(['require',
* @constructs * @constructs
*/ */
initialize: function(options) { initialize: function(options) {
_.extend(this, _.pick(options, 'modalCollection', 'guid', 'callback', 'multiple', 'showLoader', 'hideLoader', 'tagList', 'tagModel', 'enumDefCollection')); _.extend(this, _.pick(options, 'collection', 'modalCollection', 'guid', 'callback', 'multiple', 'showLoader', 'hideLoader', 'tagList', 'tagModel', 'enumDefCollection'));
this.collection = new VTagList();
this.commonCollection = new VTagList(); this.commonCollection = new VTagList();
var that = this, var that = this,
modalObj = { modalObj = {
...@@ -184,18 +183,13 @@ define(['require', ...@@ -184,18 +183,13 @@ define(['require',
onRender: function() { onRender: function() {
var that = this; var that = this;
$.extend(this.collection.queryParams, { type: 'classification' });
this.hideAttributeBox(); this.hideAttributeBox();
this.collection.fetch({ this.tagsCollection();
reset: true, if (this.tagModel) {
complete: function() { this.fetchTagSubData(that.tagModel.typeName);
if (that.tagModel) {
that.fetchTagSubData(that.tagModel.typeName);
} }
that.showAttributeBox(); that.showAttributeBox();
}, },
});
},
bindEvents: function() { bindEvents: function() {
var that = this; var that = this;
this.enumArr = []; this.enumArr = [];
...@@ -207,13 +201,9 @@ define(['require', ...@@ -207,13 +201,9 @@ define(['require',
}, this); }, this);
}, },
tagsCollection: function() { tagsCollection: function() {
var that = this; var that = this,
this.collection.fullCollection.comparator = function(model) { str = '<option selected="selected" disabled="disabled">-- Select a tag from the dropdown list --</option>';
return Utils.getName(model.toJSON(), 'name').toLowerCase(); this.collection.fullCollection.each(function(obj, key) {
}
var str = '<option selected="selected" disabled="disabled">-- Select a tag from the dropdown list --</option>';
this.collection.fullCollection.sort().each(function(obj, key) {
var name = Utils.getName(obj.toJSON(), 'name'); var name = Utils.getName(obj.toJSON(), 'name');
// using obj.get('name') insted of name variable because if html is presen in name then escaped name will not found in tagList. // using obj.get('name') insted of name variable because if html is presen in name then escaped name will not found in tagList.
if (_.indexOf(that.tagList, obj.get('name')) === -1) { if (_.indexOf(that.tagList, obj.get('name')) === -1) {
......
...@@ -74,16 +74,13 @@ define(['require', ...@@ -74,16 +74,13 @@ define(['require',
* @constructs * @constructs
*/ */
initialize: function(options) { initialize: function(options) {
_.extend(this, _.pick(options, 'tagCollection', 'model', 'tag', 'descriptionData')); _.extend(this, _.pick(options, 'tagCollection', 'enumDefCollection', 'model', 'tag', 'descriptionData', 'selectedTag'));
if (this.model) { if (this.model) {
this.description = this.model.get('description'); this.description = this.model.get('description');
} else { } else {
this.create = true; this.create = true;
} }
this.collection = new Backbone.Collection(); this.collection = new Backbone.Collection();
this.typeEnum = new VTagList();
this.typeEnum.url = UrlLinks.typedefsUrl().defs;
this.typeEnum.modelAttrName = "enumDefs";
}, },
bindEvents: function() {}, bindEvents: function() {},
onRender: function() { onRender: function() {
...@@ -97,12 +94,7 @@ define(['require', ...@@ -97,12 +94,7 @@ define(['require',
if (!('placeholder' in HTMLInputElement.prototype)) { if (!('placeholder' in HTMLInputElement.prototype)) {
this.ui.createTagForm.find('input,textarea').placeholder(); this.ui.createTagForm.find('input,textarea').placeholder();
} }
that.typeEnum.fetch({
reset: true,
complete: function(model, response) {
that.hideLoader(); that.hideLoader();
}
});
}, },
tagCollectionList: function() { tagCollectionList: function() {
var that = this, var that = this,
...@@ -110,7 +102,7 @@ define(['require', ...@@ -110,7 +102,7 @@ define(['require',
this.ui.parentTag.empty(); this.ui.parentTag.empty();
this.tagCollection.fullCollection.each(function(val) { this.tagCollection.fullCollection.each(function(val) {
var name = Utils.getName(val.toJSON()); var name = Utils.getName(val.toJSON());
str += '<option>' + (name) + '</option>'; str += '<option ' + (name == that.selectedTag ? 'selected' : '') + '>' + (name) + '</option>';
}); });
that.ui.parentTag.html(str); that.ui.parentTag.html(str);
// IE9 support // IE9 support
......
...@@ -44,7 +44,9 @@ define(['require', ...@@ -44,7 +44,9 @@ define(['require',
addAttribute: '[data-id="addAttribute"]', addAttribute: '[data-id="addAttribute"]',
description: '[data-id="description"]', description: '[data-id="description"]',
publishButton: '[data-id="publishButton"]', publishButton: '[data-id="publishButton"]',
showSuperType: "[data-id='showSuperType']" superType: "[data-id='superType']",
subType: "[data-id='subType']",
entityType: "[data-id='entityType']"
}, },
/** ui events hash */ /** ui events hash */
events: function() { events: function() {
...@@ -58,7 +60,7 @@ define(['require', ...@@ -58,7 +60,7 @@ define(['require',
* @constructs * @constructs
*/ */
initialize: function(options) { initialize: function(options) {
_.extend(this, _.pick(options, 'tag', 'collection')); _.extend(this, _.pick(options, 'tag', 'collection', 'enumDefCollection'));
}, },
bindEvents: function() { bindEvents: function() {
this.listenTo(this.collection, 'reset', function() { this.listenTo(this.collection, 'reset', function() {
...@@ -98,10 +100,21 @@ define(['require', ...@@ -98,10 +100,21 @@ define(['require',
this.ui.publishButton.prop('disabled', true); this.ui.publishButton.prop('disabled', true);
}, },
renderTagDetail: function() { renderTagDetail: function() {
var attributeData = "", var that = this,
supertypeData = "", attributeData = "",
attributeDefs = this.model.get("attributeDefs"), attributeDefs = this.model.get("attributeDefs"),
superTypeArr = this.model.get('superTypes'); genrateType = function(options) {
var data = options.data;
_.each(data, function(value, key) {
var str = "",
el = that.ui[key];
_.each(value, function(name) {
el.parents("." + key).show();
str += ' <a class="btn btn-action btn-sm" href="' + (key === "entityType" ? "javascript:void(0)" : "#!/tag/tagAttribute/" + name) + '">' + name + '</a>';
});
el.html(str);
});
}
this.ui.title.html('<span>' + (Utils.getName(this.model.toJSON())) + '</span>'); this.ui.title.html('<span>' + (Utils.getName(this.model.toJSON())) + '</span>');
if (this.model.get("description")) { if (this.model.get("description")) {
this.ui.description.text(this.model.get("description")); this.ui.description.text(this.model.get("description"));
...@@ -115,13 +128,14 @@ define(['require', ...@@ -115,13 +128,14 @@ define(['require',
}); });
this.ui.showAttribute.html(attributeData); this.ui.showAttribute.html(attributeData);
} }
if (superTypeArr.length > 0) {
this.$(".superType").show(); genrateType({
_.each(superTypeArr, function(value, key) { data: {
supertypeData += ' <a class="btn btn-action btn-sm" href="#!/tag/tagAttribute/' + value + '">' + value + '</a>'; superType: this.model.get('superTypes'),
}); subType: this.model.get('subTypes'),
this.ui.showSuperType.html(supertypeData); entityType: this.model.get('entityTypes'),
} }
});
Utils.hideTitleLoader(this.$('.fontLoader'), this.$('.tagDetail')); Utils.hideTitleLoader(this.$('.fontLoader'), this.$('.tagDetail'));
}, },
onSaveButton: function(saveObject, message) { onSaveButton: function(saveObject, message) {
...@@ -174,7 +188,9 @@ define(['require', ...@@ -174,7 +188,9 @@ define(['require',
'modules/Modal' 'modules/Modal'
], ],
function(AddTagAttributeView, Modal) { function(AddTagAttributeView, Modal) {
var view = new AddTagAttributeView(); var view = new AddTagAttributeView({
"enumDefCollection": that.enumDefCollection
});
that.modal = new Modal({ that.modal = new Modal({
title: 'Add Attribute', title: 'Add Attribute',
content: view, content: view,
...@@ -274,7 +290,7 @@ define(['require', ...@@ -274,7 +290,7 @@ define(['require',
'views/tag/CreateTagLayoutView', 'views/tag/CreateTagLayoutView',
'modules/Modal' 'modules/Modal'
], function(CreateTagLayoutView, Modal) { ], function(CreateTagLayoutView, Modal) {
var view = new CreateTagLayoutView({ 'tagCollection': that.collection, 'model': that.model, 'tag': that.tag }); var view = new CreateTagLayoutView({ 'tagCollection': that.collection, 'model': that.model, 'tag': that.tag, 'enumDefCollection': enumDefCollection });
that.modal = new Modal({ that.modal = new Modal({
title: 'Edit Tag', title: 'Edit Tag',
content: view, content: view,
......
...@@ -60,8 +60,8 @@ define(['require', ...@@ -60,8 +60,8 @@ define(['require',
}, },
onRender: function() { onRender: function() {
var that = this; var that = this;
_.each(this.parentView.typeEnum.models, function(objValue) { this.parentView.enumDefCollection.fullCollection.each(function(model) {
that.ui.dataTypeSelector.append("<option>" + objValue.attributes.name + "</option>"); that.ui.dataTypeSelector.append("<option>" + model.get('name') + "</option>");
}); });
}, },
onCloseButton: function() { onCloseButton: function() {
......
...@@ -76,7 +76,8 @@ define(['require', ...@@ -76,7 +76,8 @@ define(['require',
if (that.RTagAttributeDetailLayoutView) { if (that.RTagAttributeDetailLayoutView) {
that.RTagAttributeDetailLayoutView.show(new TagAttributeDetailLayoutView({ that.RTagAttributeDetailLayoutView.show(new TagAttributeDetailLayoutView({
tag: that.tag, tag: that.tag,
collection: that.collection collection: that.collection,
enumDefCollection: that.enumDefCollection
})); }));
} }
}); });
......
...@@ -172,6 +172,7 @@ define(['require', ...@@ -172,6 +172,7 @@ define(['require',
var view = new AddTagModalView({ var view = new AddTagModalView({
guid: that.guid, guid: that.guid,
modalCollection: that.collection, modalCollection: that.collection,
collection: that.classificationDefCollection,
enumDefCollection: that.enumDefCollection enumDefCollection: that.enumDefCollection
}); });
}); });
...@@ -224,10 +225,11 @@ define(['require', ...@@ -224,10 +225,11 @@ define(['require',
], function(AddTagModalView) { ], function(AddTagModalView) {
var view = new AddTagModalView({ var view = new AddTagModalView({
'tagModel': tagModel, 'tagModel': tagModel,
callback: function() { 'callback': function() {
that.fetchCollection(); that.fetchCollection();
}, },
guid: that.guid, 'guid': that.guid,
'collection': that.classificationDefCollection,
'enumDefCollection': that.enumDefCollection 'enumDefCollection': that.enumDefCollection
}); });
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment