Commit 37be53bb by kevalbhatt

ATLAS-2217 : Remove all taxonomy reference from UI

parent e9b95131
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* breadcrumb.scss */
.breadcrumb {
padding: 8px 25px;
background-color: transparent;
margin-bottom: 0;
font-weight: 600;
line-height: 44px;
>li {
display: inline-block;
+li:before {
padding: 0 10px;
font-family: $font_2;
color: $color_ironside_gray_approx;
content: "\f105";
}
}
}
.breadcrumb-menu,
.breadcrumb-dropdown+li:before,
.breadcrumb-ellipsis+li:before {
display: none;
}
.dropdown .fa-ellipsis-h {
position: relative;
top: 4px;
}
.breadcrumb-ellipsis {
color: #359f89;
cursor: pointer;
display: none !important;
}
#new-header .breadcrumb-dropdown .popover.bottom {
margin-top: 45px !important;
}
.breadcrumb>li:last-child a {
color: #b4b7bc;
}
\ No newline at end of file
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* business-catlog.scss */
.main-search {
.form-control {
border: none;
border-left: 1px $color_mystic_approx solid; //Instead of the line below you could use @include border-radius($radius, $vertical-radius)
border-radius: 0; //Instead of the line below you could use @include box-shadow($shadow-1, $shadow-2, $shadow-3, $shadow-4, $shadow-5, $shadow-6, $shadow-7, $shadow-8, $shadow-9, $shadow-10)
box-shadow: none;
height: 60px;
font-size: 18px;
font-style: italic;
}
.input-group-addon {
font-size: 20px;
color: $color_bombay_approx;
background: none;
border: none;
}
}
.arrowPosition {
left: -75px;
}
.sidebar-item.active i {
display: block !important;
}
.dropdown-menu>li>a {
color: $color_jungle_green_approx;
padding: 6px 20px;
max-width: 276px;
@include ellipsis();
}
.branchListParent {
.parentActive {
background: none;
}
.fa {
line-height: 40px;
}
}
ul[data-id=branchList] {
.fa {
line-height: 40px;
}
li {
padding-left: 50px;
}
}
.branchChildDiv {
padding-left: 15px;
}
.branchListParentInput {
padding-bottom: 18px;
display: list-item;
.form-control {
border-right: none; //Instead of the line below you could use @include box-shadow($shadow-1, $shadow-2, $shadow-3, $shadow-4, $shadow-5, $shadow-6, $shadow-7, $shadow-8, $shadow-9, $shadow-10)
box-shadow: none; //Instead of the line below you could use @include border-radius($radius, $vertical-radius)
border-radius: 4px;
}
.input-group-addon {
background-color: $white;
}
}
.listTerm {
padding-bottom: 5px;
}
.termNote {
padding-top: 10px;
}
.termTableBreadcrumb {
>div {
@include clearfix();
display: block;
width: 100%;
}
.hide {
opacity: 0;
overflow: hidden;
height: 0px;
display: block !important;
}
.show {
opacity: 1;
overflow: visible;
height: auto;
}
.liContent {
float: left;
line-height: 21px !important;
padding: 0px 10px 0px 0px !important;
}
>div a {
.fa-trash,
.fa-ellipsis-h {
color: $tag_color;
cursor: pointer;
}
}
}
\ No newline at end of file
...@@ -41,9 +41,6 @@ ...@@ -41,9 +41,6 @@
&[data-id="edit"] { &[data-id="edit"] {
display: none; display: none;
} }
&.btn[data-id="addTerm"] {
display: none;
}
&.btn[data-id="tagClick"] { &.btn[data-id="tagClick"] {
span { span {
display: block; display: block;
......
...@@ -25,12 +25,8 @@ ...@@ -25,12 +25,8 @@
@import "panel.scss"; @import "panel.scss";
@import "loader.scss"; @import "loader.scss";
@import "graph.scss"; @import "graph.scss";
@import "breadcrumb.scss";
//@import "login.scss";
@import "business-catlog.scss";
@import "old-style.scss"; @import "old-style.scss";
@import "theme.scss"; @import "theme.scss";
@import "tree.scss";
@import "tag.scss"; @import "tag.scss";
@import "search.scss"; @import "search.scss";
@import "profile-table.scss"; @import "profile-table.scss";
......
...@@ -184,14 +184,6 @@ hr[size="10"] { ...@@ -184,14 +184,6 @@ hr[size="10"] {
} }
} }
.table-quickMenu>tbody>tr>td {
&.searchTerm {
overflow: visible;
}
&.searchTag {}
}
.card { .card {
background: $white none repeat scroll 0 0; //Instead of the line below you could use @include box-shadow($shadow-1, $shadow-2, $shadow-3, $shadow-4, $shadow-5, $shadow-6, $shadow-7, $shadow-8, $shadow-9, $shadow-10) background: $white none repeat scroll 0 0; //Instead of the line below you could use @include box-shadow($shadow-1, $shadow-2, $shadow-3, $shadow-4, $shadow-5, $shadow-6, $shadow-7, $shadow-8, $shadow-9, $shadow-10)
box-shadow: 0 1px 3px $black_30; box-shadow: 0 1px 3px $black_30;
......
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* tree.scss */
.jstree-container-ul {
padding-left: 0px;
position: relative;
list-style: none;
.jstree-node {
white-space: nowrap;
position: relative;
cursor: pointer;
padding: 4px 0;
margin: 0;
margin-top: 5px;
margin-bottom: 5px;
}
ul {
list-style: none;
padding: 0;
text-indent: 30px;
}
li a {
// color: $white;
display: block;
}
}
.taxonomyTree {
padding: 0;
position: relative;
li {
position: relative;
border-radius: 4px;
margin-top: 5px;
&.parent {
width: 100%;
a {
max-width: 93%;
}
}
&.parentChild {
>ul {
padding-left: 9%;
}
li {
&.children {
width: 91%;
}
a {
max-width: 90%;
}
}
}
&.children {
&:hover {
background-color: $color_star_dust_approx;
}
}
&.listTerm {
a {
display: inline;
}
}
&.active {
background-color: $color_jungle_green_approx !important;
border: none;
.tools {
display: block;
.fa {
cursor: pointer;
padding: 0px 3px;
}
}
}
a {
display: block;
color: $concrete;
white-space: nowrap;
padding: 5px 25px;
@include ellipsis();
cursor: pointer;
}
.tools {
background: $color_jungle_green_approx;
display: none;
position: absolute;
right: 2px;
padding: 5px;
}
}
}
.termMoveDiv {
width: 550px;
height: 200px;
margin: 10px;
}
.toggleArrow {
position: absolute;
left: 0px;
padding: 8px;
cursor: pointer;
}
.addTermDisable {
border-color: $red !important;
}
.alertTerm {
color: $red !important;
}
/**Css changes**/
.modal-body {
.add-seperator {
border: none;
}
.taxonomyTree li {
.children {
text-indent: 20px;
}
&.parentChild {
ul {
padding-left: 0px;
}
li {
&.children {
width: 100%;
}
a {
max-width: 100%;
}
}
}
&.active {
color: $concrete;
a {
color: $concrete;
}
}
a {
color: #6C6C6C;
}
&.children:hover {
a {
color: $concrete;
}
background-color: #ABABAB;
color: $white;
}
.tools {
text-indent: 0px;
background: none;
}
}
}
.popoverTerm {
text-align: center;
margin-top: 25px !important;
}
\ No newline at end of file
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
define(['require',
'utils/Globals',
'collection/BaseCollection',
'models/VCatalog',
'utils/UrlLinks'
], function(require, Globals, BaseCollection, VCatalog, UrlLinks) {
'use strict';
var VCatalogList = BaseCollection.extend(
//Prototypal attributes
{
url: UrlLinks.taxonomiesApiUrl(),
model: VCatalog,
initialize: function() {
this.modelName = 'VCatalog';
this.modelAttrName = '';
},
fetch: function(options) {
//Call Backbone's fetch
return Backbone.Collection.prototype.fetch.call(this, options);
},
parseRecords: function(resp, options) {
try {
/* var arr = [];
arr.push({
taxonomies: resp
});*/
return resp;
} catch (e) {
console.log(e);
}
},
},
//Static Class Members
{
/**
* Table Cols to be passed to Backgrid
* UI has to use this as base and extend this.
*
*/
tableCols: {}
}
);
return VCatalogList;
});
...@@ -213,9 +213,6 @@ require(['App', ...@@ -213,9 +213,6 @@ require(['App',
Globals.userLogedIn.status = true; Globals.userLogedIn.status = true;
Globals.userLogedIn.response = response; Globals.userLogedIn.response = response;
} }
if (response && response['atlas.feature.taxonomy.enable'] !== undefined) {
Globals.taxonomy = response['atlas.feature.taxonomy.enable']
}
if (response && response['atlas.entity.create.allowed'] !== undefined) { if (response && response['atlas.entity.create.allowed'] !== undefined) {
Globals.entityCreate = response['atlas.entity.create.allowed']; Globals.entityCreate = response['atlas.entity.create.allowed'];
} }
......
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
define(['require',
'utils/Globals',
'models/BaseModel',
'utils/UrlLinks'
], function(require, Globals, VBaseModel, UrlLinks) {
'use strict';
var VCatalog = VBaseModel.extend({
urlRoot: UrlLinks.taxonomiesApiUrl(),
defaults: {},
serverSchema: {},
idAttribute: 'id',
initialize: function() {
this.modelName = 'VCatalog';
},
toString: function() {
return this.get('name');
},
deleteTerm: function(termURL, options) {
var url = termURL;
options = _.extend({
contentType: 'application/json',
dataType: 'json'
}, options);
return this.constructor.nonCrudOperation.call(this, url, 'DELETE', options);
}
}, {});
return VCatalog;
});
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
* limitations under the License. * limitations under the License.
*/ */
define(['require', 'backbone', 'hbs!tmpl/common/modal'], function(require, Backbone, template) { define(['require', 'backbone', 'hbs!tmpl/common/Modal'], function(require, Backbone, template) {
var Modal = Backbone.View.extend({ var Modal = Backbone.View.extend({
......
...@@ -32,11 +32,9 @@ define([ ...@@ -32,11 +32,9 @@ define([
'': 'defaultAction', '': 'defaultAction',
'!/': 'tagAttributePageLoad', '!/': 'tagAttributePageLoad',
'!/tag/tagAttribute/(*name)': 'tagAttributePageLoad', '!/tag/tagAttribute/(*name)': 'tagAttributePageLoad',
'!/taxonomy/detailCatalog/(*url)': 'detailCatalog',
'!/search/searchResult': 'searchResult', '!/search/searchResult': 'searchResult',
'!/detailPage/:id': 'detailPage', '!/detailPage/:id': 'detailPage',
'!/tag': 'commonAction', '!/tag': 'commonAction',
'!/taxonomy': 'commonAction',
'!/search': 'commonAction', '!/search': 'commonAction',
// Default // Default
'*actions': 'defaultAction' '*actions': 'defaultAction'
...@@ -64,29 +62,11 @@ define([ ...@@ -64,29 +62,11 @@ define([
bindCommonEvents: function() { bindCommonEvents: function() {
var that = this; var that = this;
$('body').on('click', 'li.aboutAtlas', function() { $('body').on('click', 'li.aboutAtlas', function() {
that.aboutAtlas(); require([
}); 'views/common/AboutAtlas',
}, ], function(AboutAtlas) {
aboutAtlas: function() { new AboutAtlas();
var that = this;
require([
'hbs!tmpl/common/aboutAtlas_tmpl',
'modules/Modal',
'views/common/aboutAtlas',
], function(aboutAtlasTmpl, Modal, aboutAtlasView) {
var view = new aboutAtlasView();
var modal = new Modal({
title: 'Apache Atlas',
content: view,
okCloses: true,
showFooter: true,
allowCancel: false,
}).open();
view.on('closeModal', function() {
modal.trigger('cancel');
}); });
}); });
}, },
showRegions: function() {}, showRegions: function() {},
...@@ -110,53 +90,13 @@ define([ ...@@ -110,53 +90,13 @@ define([
// console.log("Post-Route Change Operations can be performed here !!"); // console.log("Post-Route Change Operations can be performed here !!");
// console.log("Route changed: ", name); // console.log("Route changed: ", name);
}, },
detailCatalog: function(url) {
var that = this;
require([
'views/business_catalog/BusinessCatalogHeader',
'views/business_catalog/BusinessCatalogDetailLayoutView',
'views/business_catalog/SideNavLayoutView',
'collection/VCatalogList'
], function(BusinessCatalogHeader, BusinessCatalogDetailLayoutView, SideNavLayoutView, VCatalogList) {
if (Globals.taxonomy) {
var paramObj = Utils.getUrlState.getQueryParams();
this.collection = new VCatalogList();
this.collection.url = url;
App.rNHeader.show(new BusinessCatalogHeader(
_.extend({
'url': url,
'collection': this.collection
}, that.preFetchedCollectionLists)
));
if (!App.rSideNav.currentView) {
App.rSideNav.show(new SideNavLayoutView(
_.extend({
'url': url
}, that.preFetchedCollectionLists, that.sharedObj)
));
} else {
App.rSideNav.currentView.RBusinessCatalogLayoutView.currentView.manualRender("/" + url);
App.rSideNav.currentView.selectTab();
}
App.rNContent.show(new BusinessCatalogDetailLayoutView(
_.extend({
'url': url,
'collection': this.collection
}, that.preFetchedCollectionLists)
));
this.collection.fetch({ reset: true });
} else {
that.defaultAction()
}
});
},
detailPage: function(id) { detailPage: function(id) {
var that = this; var that = this;
if (id) { if (id) {
require([ require([
'views/site/Header', 'views/site/Header',
'views/detail_page/DetailPageLayoutView', 'views/detail_page/DetailPageLayoutView',
'views/business_catalog/SideNavLayoutView', 'views/site/SideNavLayoutView',
'collection/VEntityList' 'collection/VEntityList'
], function(Header, DetailPageLayoutView, SideNavLayoutView, VEntityList) { ], function(Header, DetailPageLayoutView, SideNavLayoutView, VEntityList) {
this.entityCollection = new VEntityList([], {}); this.entityCollection = new VEntityList([], {});
...@@ -183,10 +123,9 @@ define([ ...@@ -183,10 +123,9 @@ define([
var that = this; var that = this;
require([ require([
'views/site/Header', 'views/site/Header',
'views/business_catalog/BusinessCatalogLayoutView', 'views/site/SideNavLayoutView',
'views/business_catalog/SideNavLayoutView',
'views/tag/TagDetailLayoutView', 'views/tag/TagDetailLayoutView',
], function(Header, BusinessCatalogLayoutView, SideNavLayoutView, TagDetailLayoutView) { ], function(Header, SideNavLayoutView, TagDetailLayoutView) {
var paramObj = Utils.getUrlState.getQueryParams(), var paramObj = Utils.getUrlState.getQueryParams(),
url = Utils.getUrlState.getQueryUrl().queyParams[0]; url = Utils.getUrlState.getQueryUrl().queyParams[0];
App.rNHeader.show(new Header()); App.rNHeader.show(new Header());
...@@ -233,10 +172,9 @@ define([ ...@@ -233,10 +172,9 @@ define([
var that = this; var that = this;
require([ require([
'views/site/Header', 'views/site/Header',
'views/business_catalog/BusinessCatalogLayoutView', 'views/site/SideNavLayoutView',
'views/business_catalog/SideNavLayoutView',
'views/search/SearchDetailLayoutView', 'views/search/SearchDetailLayoutView',
], function(Header, BusinessCatalogLayoutView, SideNavLayoutView, SearchDetailLayoutView) { ], function(Header, SideNavLayoutView, SearchDetailLayoutView) {
var paramObj = Utils.getUrlState.getQueryParams(); var paramObj = Utils.getUrlState.getQueryParams();
App.rNHeader.show(new Header()); App.rNHeader.show(new Header());
if (!App.rSideNav.currentView) { if (!App.rSideNav.currentView) {
...@@ -249,8 +187,6 @@ define([ ...@@ -249,8 +187,6 @@ define([
App.rSideNav.currentView.selectTab(); App.rSideNav.currentView.selectTab();
if (Utils.getUrlState.isTagTab()) { if (Utils.getUrlState.isTagTab()) {
App.rSideNav.currentView.RTagLayoutView.currentView.manualRender(); App.rSideNav.currentView.RTagLayoutView.currentView.manualRender();
} else if (Utils.getUrlState.isTaxonomyTab()) {
App.rSideNav.currentView.RBusinessCatalogLayoutView.currentView.manualRender(undefined, true);
} }
} }
if (Globals.entityCreate && Utils.getUrlState.isSearchTab()) { if (Globals.entityCreate && Utils.getUrlState.isSearchTab()) {
...@@ -271,10 +207,9 @@ define([ ...@@ -271,10 +207,9 @@ define([
var that = this; var that = this;
require([ require([
'views/site/Header', 'views/site/Header',
'views/business_catalog/BusinessCatalogLayoutView', 'views/site/SideNavLayoutView',
'views/business_catalog/SideNavLayoutView',
'views/search/SearchDetailLayoutView' 'views/search/SearchDetailLayoutView'
], function(Header, BusinessCatalogLayoutView, SideNavLayoutView, SearchDetailLayoutView) { ], function(Header, SideNavLayoutView, SearchDetailLayoutView) {
var paramObj = Utils.getUrlState.getQueryParams(); var paramObj = Utils.getUrlState.getQueryParams();
var isinitialView = true, var isinitialView = true,
isTypeTagNotExists = false, isTypeTagNotExists = false,
......
<!--
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<div id="r_treeLayoutView"></div>
<!--
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<form name="tagDefinitionform" class="form-horizontal" onsubmit="return false;">
<div class="form-group">
<label class="control-label col-sm-2 required" for="name">Name</label>
{{#if defaultTerm}}
<div class="col-sm-10">
<input class="form-control" data-id="termName" placeholder="Enter Taxonomy Name" autofocus>
<p class='alertTerm' style='display:none'>Taxonomy name should not have spaces</p>
</div>
{{else}}
<div class="col-sm-10">
<input class="form-control" data-id="termName" placeholder="Name(Required)" autofocus>
<p class='alertTerm' style='display:none'>Term name should not have spaces</p>
</div>
{{/if}}
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="description">Description</label>
<div class="col-sm-10">
<textarea class="form-control" data-id="termDetail" placeholder="Description"></textarea>
</div>
</div>
</form>
\ No newline at end of file
<!--
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<div class="page-title clearfix">
<div class="fontLoader">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
<div class="catlogDetail">
<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>
<p class="form-group" data-id="description">Description</p>
</div>
</div>
<div class="container-fluid gray-bg">
<div class="row">
<div class="col-sm-custom">
<div class="atlast-tabbable">
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="tab active"><a href="#tab-details" aria-controls="tab-details" role="tab" data-toggle="tab">Properties</a></li>
</ul>
<div class="tab-content">
<div id="tab-details" role="tabpanel" class="tab-pane active">
<p data-id="createDate"></p>
</div>
</div>
</div>
</div>
</div>
</div>
<!--
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<ol class="breadcrumb col-md-6">
</ol>
<header class="clearfix">
<div class="btn-group pull-right header-menu">
<a target="_blank" href="http://atlas.apache.org/"><i class="fa fa-question-circle"></i></a>
<a href="javascript:void(0);" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fa fa-user user-circle"></i><span class="userName"></span></a>
<ul class="dropdown-menu">
<li class="aboutAtlas"><a href="javascript:void(0)">About</a></li>
<li role="separator" class="divider"></li>
<li><a href="logout.html"><i class="fa fa-sign-out"></i>Logout</a></li>
</ul>
</div>
</header>
<!--
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<div id="r_treeLayoutView"></div>
<!--
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<div class="form-control termMoveDiv">
<div id="tree"></div>
</div>
<!--
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<div class="clearfix add-seperator">
<p data-id="descriptionAssign" style="display:none">Assign a term to this asset</p>
<button type="button" class="btn btn-action btn-md pull-left" data-id="backTaxanomy"><i class="fa fa-chevron-left"></i> Back</button>
<button type="button" class="btn btn-action btn-md pull-right" onclick="this.blur();" title="Refresh" data-id="refreshTaxanomy"><i class="fa fa-refresh"></i></button>
</div>
<div>
<select type="text" class="form-control" data-id="searchTermInput"></select>
</div>
<div class="">
<ul class="taxonomyTree">
<div class="contentLoading"></div>
<li class="children parent" data-id="Parent"></li>
<li class="childs parentChild">
<ul data-id="childList">
</ul>
</li>
</ul>
</div>
...@@ -33,14 +33,6 @@ ...@@ -33,14 +33,6 @@
</button> </button>
</div> </div>
</div> </div>
{{#if taxonomy}}
<div class="form-group">
<span class="control-label-sm-pr pull-left">Terms:</span>
<div class="pull-left" data-id="termList">
<button class="btn btn-action btn-sm" title="Add Term" data-id="addTerm"><i class="fa fa-plus"></i></button>
</div>
</div>
{{/if}}
</div> </div>
</div> </div>
<div class="container-fluid gray-bg"> <div class="container-fluid gray-bg">
...@@ -84,9 +76,6 @@ ...@@ -84,9 +76,6 @@
<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>
{{#if taxonomy}}
<li role="terms"><a href="#tab-termTable" aria-controls="tab-termTable" role="tab" data-toggle="tab">Terms</a></li>
{{/if}}
<li role="audits" class="tab"><a href="#tab-audit" aria-controls="tab-audit" role="tab" data-toggle="tab">Audits</a></li> <li role="audits" class="tab"><a href="#tab-audit" aria-controls="tab-audit" role="tab" data-toggle="tab">Audits</a></li>
<li role="schema" class="tab schemaTable" style="display:none"><a href="#tab-schema" aria-controls="tab-schema" role="tab" data-toggle="tab">Schema</a></li> <li role="schema" class="tab schemaTable" style="display:none"><a href="#tab-schema" aria-controls="tab-schema" role="tab" data-toggle="tab">Schema</a></li>
<li role="profile" class="tab profileTab" style="display:none"><a href="#tab-profile" aria-controls="tab-profile" role="tab" data-toggle="tab">Profile</a></li> <li role="profile" class="tab profileTab" style="display:none"><a href="#tab-profile" aria-controls="tab-profile" role="tab" data-toggle="tab">Profile</a></li>
...@@ -108,13 +97,6 @@ ...@@ -108,13 +97,6 @@
</div> </div>
</div> </div>
</div> </div>
<div id="tab-termTable" role="terms" class="tab-pane">
<div id="r_termTableLayoutView">
<div class="fontLoader-relative">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
</div>
</div>
<div id="tab-audit" role="audits" class="tab-pane"> <div id="tab-audit" role="audits" class="tab-pane">
<div id="r_auditTableLayoutView"> <div id="r_auditTableLayoutView">
<div class="fontLoader-relative"> <div class="fontLoader-relative">
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
<input type="checkbox" class="input" name="queryType" value="text" name="check" value="1" />Show historical entities</label> <input type="checkbox" class="input" name="queryType" value="text" name="check" value="1" />Show historical entities</label>
</div> </div>
<div class="clearfix inline"> <div class="clearfix inline">
<a href="javascript:void(0)" class="inputAssignTag multiSelectTerm btn btn-action btn-sm" style="display:none" data-id="addTerm"><i class="fa fa-plus"></i> Assign Term</a>
<a href="javascript:void(0)" class="inputAssignTag multiSelectTag assignTag btn btn-action btn-sm" style="display:none" data-id="addAssignTag"><i class="fa fa-plus"></i> Assign Tag</a> <a href="javascript:void(0)" class="inputAssignTag multiSelectTag assignTag btn btn-action btn-sm" style="display:none" data-id="addAssignTag"><i class="fa fa-plus"></i> Assign Tag</a>
</div> </div>
</div> </div>
......
...@@ -36,8 +36,6 @@ ...@@ -36,8 +36,6 @@
<b>Show historical entities</b></label> <b>Show historical entities</b></label>
</div> </div>
<div class="inline"> <div class="inline">
{{#if taxonomy}}
<a href="javascript:void(0)" class=" multiSelectTerm btn btn-action btn-sm inline" style="display:none" data-id="addTerm"><i class="fa fa-plus"></i> Assign Term</a> {{/if}}
<a href="javascript:void(0)" class=" multiSelectTag assignTag btn btn-action btn-sm" style="display:none" data-id="addAssignTag"><i class="fa fa-plus"></i> Assign Tag</a> <a href="javascript:void(0)" class=" multiSelectTag assignTag btn btn-action btn-sm" style="display:none" data-id="addAssignTag"><i class="fa fa-plus"></i> Assign Tag</a>
</div> </div>
</div> </div>
......
...@@ -21,18 +21,12 @@ ...@@ -21,18 +21,12 @@
<ul class="tabs" style="width: 100%;" role="tablist"> <ul class="tabs" style="width: 100%;" role="tablist">
<li role="presentation" class="{{tabClass}}"><a href="#tab-search" aria-controls="tab-search" data-name="tab-search" role="tab" data-toggle="tab" class=""><i class="fa fa-search"></i> Search</a></li> <li role="presentation" class="{{tabClass}}"><a href="#tab-search" aria-controls="tab-search" data-name="tab-search" role="tab" data-toggle="tab" class=""><i class="fa fa-search"></i> Search</a></li>
<li role="presentation" class="{{tabClass}}"><a href="#tab-tag" aria-controls="tab-tag" data-name="tab-tag" role="tab" data-toggle="tab"><i class="fa fa-tags"></i> Tags</a></li> <li role="presentation" class="{{tabClass}}"><a href="#tab-tag" aria-controls="tab-tag" data-name="tab-tag" role="tab" data-toggle="tab"><i class="fa fa-tags"></i> Tags</a></li>
{{#if taxonomy}}
<li role="presentation" class="tab col-sm-4"><a href="#tab-taxonomy" aria-controls="tab-taxonomy" data-name="tab-taxonomy" role="tab" data-toggle="tab" class=""><i class="fa fa-sitemap"></i> Taxonomy</a></li>
{{/if}}
</ul> </ul>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
<div role="tabpanel" class="tab-pane" id="tab-tag"> <div role="tabpanel" class="tab-pane" id="tab-tag">
<div id="r_tagLayoutView"></div> <div id="r_tagLayoutView"></div>
</div> </div>
<div role="tabpanel" class="tab-pane" id="tab-taxonomy">
<div id="r_businessCatalogLayoutView"></div>
</div>
<div role="tabpanel" class="tab-pane" id="tab-search"> <div role="tabpanel" class="tab-pane" id="tab-search">
<div id="r_searchLayoutView"></div> <div id="r_searchLayoutView"></div>
</div> </div>
......
...@@ -16,5 +16,5 @@ ...@@ -16,5 +16,5 @@
--> -->
<div> <div>
<div class="tableOverlay"></div> <div class="tableOverlay"></div>
<div id="r_tagTermTableLayoutView"></div> <div id="r_tagTableLayoutView"></div>
</div> </div>
...@@ -42,14 +42,8 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum ...@@ -42,14 +42,8 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
tagModel.deleteAssociation(options.guid, options.tagName, { tagModel.deleteAssociation(options.guid, options.tagName, {
skipDefaultError: true, skipDefaultError: true,
success: function(data) { success: function(data) {
var msg = "Tag " + name.name + Messages.removeSuccessMessage;
if (options.tagOrTerm === "term") {
msg = "Term " + options.tagName + Messages.removeSuccessMessage;
} else if (options.tagOrTerm === "tag") {
msg = "Tag " + options.tagName + Messages.removeSuccessMessage;
}
Utils.notifySuccess({ Utils.notifySuccess({
content: msg content: "Tag " + options.tagName + Messages.removeSuccessMessage
}); });
if (options.callback) { if (options.callback) {
options.callback(); options.callback();
...@@ -233,122 +227,6 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum ...@@ -233,122 +227,6 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
}); });
return table; return table;
} }
CommonViewFunction.breadcrumbUrlMaker = function(url) {
if (url) {
var urlList = [];
var splitURL = url.split("api/atlas/v1/taxonomies/");
if (splitURL.length > 1) {
var splitUrlWithoutTerm = splitURL[1].split("/terms/");
if (splitUrlWithoutTerm.length == 1) {
splitUrlWithoutTerm = splitUrlWithoutTerm[0].split("/");
}
} else {
var splitUrlWithoutTerm = splitURL[0].split("/terms/");
if (splitUrlWithoutTerm.length == 1) {
splitUrlWithoutTerm = splitUrlWithoutTerm[0].split("/");
}
}
var href = "";
for (var i in splitUrlWithoutTerm) {
if (i == 0) {
href = splitUrlWithoutTerm[i];
urlList.push({
value: _.escape(splitUrlWithoutTerm[i]),
href: href
});
} else {
href += "/terms/" + splitUrlWithoutTerm[i];
urlList.push({
value: _.escape(splitUrlWithoutTerm[i]),
href: href
});
};
}
return urlList;
}
}
CommonViewFunction.breadcrumbMaker = function(options) {
var li = "";
if (options.urlList) {
_.each(options.urlList, function(object) {
li += '<li><a class="link" href="#!/taxonomy/detailCatalog/api/atlas/v1/taxonomies/' + object.href + '?load=true">' + _.escape(object.value) + '</a></li>';
});
}
if (options.scope) {
options.scope.html(li);
options.scope.asBreadcrumbs("destroy");
options.scope.asBreadcrumbs({
namespace: 'breadcrumb',
overflow: "left",
responsive: false,
toggleIconClass: 'fa fa-ellipsis-h',
dropdown: function(classes) {
var dropdownClass = 'dropdown';
var dropdownMenuClass = 'dropdown-menu popover popoverTerm bottom arrowPosition';
if (this.options.overflow === 'right') {
dropdownMenuClass += ' dropdown-menu-right';
}
return '<li class="' + dropdownClass + ' ' + classes.dropdownClass + '">' +
'<a href="javascript:void(0);" class="' + classes.toggleClass + '" data-toggle="dropdown">' +
'<i class="' + classes.toggleIconClass + '"></i>' +
'</a>' +
'<ul class="' + dropdownMenuClass + ' ' + classes.dropdownMenuClass + '">' +
'<div class="arrow"></div>' +
'</ul>' +
'</li>';
}
});
}
}
CommonViewFunction.termTableBreadcrumbMaker = function(obj) {
if (!obj) {
return "";
}
var traits = obj.classificationNames || _.pluck(obj.classifications, 'typeName'),
url = "",
deleteHtml = "",
html = "",
id = obj.guid,
terms = [],
entityName = Utils.getName(obj);
if (traits) {
traits.map(function(term) {
var checkTagOrTerm = Utils.checkTagOrTerm(term);
if (checkTagOrTerm.term) {
terms.push({
deleteHtml: '<a href="javascript:void(0)" class="pull-left" title="Remove Term"><i class="fa fa-trash" data-id="tagClick" data-type="term" data-assetname="' + entityName + '" data-name="' + term + '" data-guid="' + obj.guid + '" ></i></a>',
url: _.unescape(term).split(".").join("/"),
name: term
});
}
});
}
_.each(terms, function(obj, i) {
var className = "";
if (i >= 1) {
className += "showHideDiv hide";
}
obj['valueUrl'] = CommonViewFunction.breadcrumbUrlMaker(obj.url);
html += '<div class="' + className + '" dataterm-name="' + obj.name + '"><div class="liContent"></div>' + obj.deleteHtml + '</div>';
})
if (terms.length > 1) {
html += '<div><a href="javascript:void(0)" data-id="showMoreLessTerm" class="btn btn-action btn-sm btn-icon-pd"><span>Show More </span><i class="fa fa-angle-right"></i></a></div>'
}
if (!Enums.entityStateReadOnly[obj.status]) {
if (obj.guid) {
html += '<div><a href="javascript:void(0)" class="btn btn-action btn-sm" data-id="addTerm" data-guid="' + (obj.guid) + '"><i class="fa fa-plus"></i></a></div>'
} else {
html += '<div><a href="javascript:void(0)" class="btn btn-action btn-sm" data-id="addTerm"><i class="fa fa-plus"></i></a></div>'
}
}
return {
html: '<div class="termTableBreadcrumb btn-inline" dataterm-id="' + id + '">' + html + '</div>',
object: { scopeId: id, value: terms }
}
}
CommonViewFunction.tagForTable = function(obj) { CommonViewFunction.tagForTable = function(obj) {
var traits = obj.classificationNames || _.pluck(obj.classifications, 'typeName'), var traits = obj.classificationNames || _.pluck(obj.classifications, 'typeName'),
atags = "", atags = "",
...@@ -358,17 +236,14 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum ...@@ -358,17 +236,14 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
entityName = Utils.getName(obj); entityName = Utils.getName(obj);
if (traits) { if (traits) {
traits.map(function(tag) { traits.map(function(tag) {
var checkTagOrTerm = Utils.checkTagOrTerm(tag); var className = "btn btn-action btn-sm btn-blue btn-icon",
if (checkTagOrTerm.tag) { tagString = '<a class="' + className + '" data-id="tagClick"><span title="' + tag + '">' + tag + '</span><i class="fa fa-times" data-id="delete" data-assetname="' + entityName + '"data-name="' + tag + '" data-type="tag" data-guid="' + obj.guid + '" ></i></a>';
var className = "btn btn-action btn-sm btn-blue btn-icon", if (count >= 1) {
tagString = '<a class="' + className + '" data-id="tagClick"><span title="' + tag + '">' + tag + '</span><i class="fa fa-times" data-id="delete" data-assetname="' + entityName + '"data-name="' + tag + '" data-type="tag" data-guid="' + obj.guid + '" ></i></a>'; popTag += tagString;
if (count >= 1) { } else {
popTag += tagString; atags += tagString;
} else {
atags += tagString;
}
++count;
} }
++count;
}); });
} }
if (!Enums.entityStateReadOnly[obj.status]) { if (!Enums.entityStateReadOnly[obj.status]) {
...@@ -418,32 +293,6 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum ...@@ -418,32 +293,6 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
} }
} }
CommonViewFunction.saveTermToAsset = function(options, that) {
require(['models/VCatalog'], function(Vcatalog) {
var VCatalog = new Vcatalog();
var name = options.termName;
++that.asyncFetchCounter;
VCatalog.url = function() {
return "api/atlas/v1/entities/" + options.guid + "/tags/" + name;
};
VCatalog.save(null, {
success: function(data) {
Utils.notifySuccess({
content: "Term " + name + Messages.addTermToEntitySuccessMessage
});
if (options.collection) {
options.collection.fetch({ reset: true });
}
},
complete: function() {
--that.asyncFetchCounter
if (that.callback && that.asyncFetchCounter === 0) {
that.callback(); // It will call to parent of parent Callback i.e callback of searchLayoutView
}
}
});
})
}
CommonViewFunction.generateObjectForSaveSearchApi = function(options) { CommonViewFunction.generateObjectForSaveSearchApi = function(options) {
var obj = { var obj = {
name: options.name, name: options.name,
......
...@@ -27,7 +27,6 @@ define(['require'], function(require) { ...@@ -27,7 +27,6 @@ define(['require'], function(require) {
tabState: { tabState: {
stateChanged: false, stateChanged: false,
tagUrl: "#!/tag", tagUrl: "#!/tag",
taxonomyUrl: "#!/taxonomy",
searchUrl: "#!/search" searchUrl: "#!/search"
}, },
detailPageState: {} detailPageState: {}
......
...@@ -23,10 +23,7 @@ define(['require'], function(require) { ...@@ -23,10 +23,7 @@ define(['require'], function(require) {
defaultErrorMessage: "Something went wrong", defaultErrorMessage: "Something went wrong",
addSuccessMessage: " has been created successfully", addSuccessMessage: " has been created successfully",
addErrorMessage: " could not be Created", addErrorMessage: " could not be Created",
addTermToEntitySuccessMessage: " has been added to entity",
deleteTerm: "Delete Term",
removeTag: "Remove Tag Assignment", removeTag: "Remove Tag Assignment",
removeTerm: "Remove Term Assignment",
deleteSuccessMessage: " has been deleted successfully", deleteSuccessMessage: " has been deleted successfully",
deleteErrorMessage: " could not be deleted", deleteErrorMessage: " could not be deleted",
removeSuccessMessage: " has been removed successfully", removeSuccessMessage: " has been removed successfully",
...@@ -48,8 +45,7 @@ define(['require'], function(require) { ...@@ -48,8 +45,7 @@ define(['require'], function(require) {
}, },
tag: { tag: {
addAttributeSuccessMessage: "Tag attribute is added successfully", addAttributeSuccessMessage: "Tag attribute is added successfully",
updateTagDescriptionMessage: "Tag description is updated successfully", updateTagDescriptionMessage: "Tag description is updated successfully"
updateTermDescriptionMessage: "Term description is updated successfully"
} }
}; };
return Messages; return Messages;
......
...@@ -48,12 +48,6 @@ define(['require', 'utils/Enums', 'utils/Utils', 'underscore'], function(require ...@@ -48,12 +48,6 @@ define(['require', 'utils/Enums', 'utils/Utils', 'underscore'], function(require
return defApiUrl.defs + '?type=' + type; return defApiUrl.defs + '?type=' + type;
} }
}, },
taxonomiesApiUrl: function() {
return this.baseUrl + '/v1/taxonomies';
},
taxonomiesTermsApiUrl: function(name) {
return this.baseUrl + '/v1/taxonomies' + '/' + name + '/terms';
},
entitiesApiUrl: function(guid, name) { entitiesApiUrl: function(guid, name) {
var entitiesUrl = this.baseUrlV2 + '/entity'; var entitiesUrl = this.baseUrlV2 + '/entity';
if (guid && name) { if (guid && name) {
......
...@@ -281,8 +281,6 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums', ...@@ -281,8 +281,6 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
}; };
if (Utils.getUrlState.isTagTab(options.url)) { if (Utils.getUrlState.isTagTab(options.url)) {
urlUpdate['tagUrl'] = options.url; urlUpdate['tagUrl'] = options.url;
} else if (Utils.getUrlState.isTaxonomyTab(options.url)) {
urlUpdate['taxonomyUrl'] = options.url;
} else if (Utils.getUrlState.isSearchTab(options.url)) { } else if (Utils.getUrlState.isSearchTab(options.url)) {
urlUpdate['searchUrl'] = options.url; urlUpdate['searchUrl'] = options.url;
} }
...@@ -311,9 +309,6 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums', ...@@ -311,9 +309,6 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
isTagTab: function(url) { isTagTab: function(url) {
return this.getQueryUrl(url).firstValue == "tag" ? true : false; return this.getQueryUrl(url).firstValue == "tag" ? true : false;
}, },
isTaxonomyTab: function(url) {
return this.getQueryUrl(url).firstValue == "taxonomy" ? true : false;
},
isSearchTab: function(url) { isSearchTab: function(url) {
return this.getQueryUrl(url).firstValue == "search" ? true : false; return this.getQueryUrl(url).firstValue == "search" ? true : false;
}, },
...@@ -354,63 +349,6 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums', ...@@ -354,63 +349,6 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
} }
} }
} }
Utils.checkTagOrTerm = function(value, isTermView) {
if (value && _.isString(value) && isTermView) {
// For string break
if (value == "TaxonomyTerm") {
return {}
}
var name = _.escape(value).split('.');
return {
term: true,
tag: false,
name: name[name.length - 1],
fullName: value
}
}
if (value && _.isString(value)) {
value = {
typeName: value
}
}
if (_.isObject(value)) {
var name = "";
if (value && value.$typeName$) {
name = value.$typeName$;
} else if (value && value.typeName) {
name = value.typeName;
}
if (name === "TaxonomyTerm") {
return {}
}
name = _.escape(name).split('.');
var trem = false;
if (value['taxonomy.namespace']) {
trem = true;
} else if (value.values && value.values['taxonomy.namespace']) {
trem = true;
} else if (Globals.taxonomy && name.length > 1) {
trem = true; // Temp fix
}
if (trem) {
return {
term: true,
tag: false,
name: name[name.length - 1],
fullName: name.join('.')
}
} else {
return {
term: false,
tag: true,
name: name[name.length - 1],
fullName: name.join('.')
}
}
}
}
Utils.getName = function() { Utils.getName = function() {
return Utils.extractKeyValueFromEntity.apply(this, arguments).name; return Utils.extractKeyValueFromEntity.apply(this, arguments).name;
} }
......
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
define(['require',
'backbone',
'hbs!tmpl/business_catalog/AddTermView_tmpl',
'utils/Utils',
'collection/VCatalogList'
], function(require, Backbone, AddTermViewTmpl, Utils, VCatalogList) {
'use strict';
var AddTermLayoutView = Backbone.Marionette.LayoutView.extend(
/** @lends AddTermView */
{
_viewName: 'AddTermLayoutView',
template: AddTermViewTmpl,
templateHelpers: function() {
return {
defaultTerm: this.defaultTerm
};
},
/** Layout sub regions */
regions: {},
/** ui selector cache */
ui: {
termName: '[data-id="termName"]',
termDetail: '[data-id="termDetail"]'
},
/** ui events hash */
events: function() {
var events = {};
return events;
},
/**
* intialize a new BusinessCatalogLayoutView Layout
* @constructs
*/
initialize: function(options) {
_.extend(this, _.pick(options, 'url', 'model','defaultTerm'));
},
bindEvents: function() {},
onRender: function() {}
});
return AddTermLayoutView;
});
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
define(['require',
'backbone',
'hbs!tmpl/business_catalog/AddTermToEntityLayoutView_tmpl',
'utils/Utils',
'modules/Modal',
'collection/VCatalogList',
'utils/CommonViewFunction',
'utils/Messages',
'utils/Enums'
], function(require, Backbone, AddTermToEntityLayoutViewTmpl, Utils, Modal, VCatalogList, CommonViewFunction, Messages, Enums) {
'use strict';
var AddTermToEntityLayoutView = Backbone.Marionette.LayoutView.extend(
/** @lends AddTermToEntityLayoutView */
{
_viewName: 'AddTermToEntityLayoutView',
template: AddTermToEntityLayoutViewTmpl,
/** Layout sub regions */
regions: {
RTreeLayoutView: "#r_treeLayoutView"
},
/** ui selector cache */
ui: {},
/** ui events hash */
events: function() {
var events = {};
return events;
},
/**
* intialize a new AddTermToEntityLayoutView Layout
* @constructs
*/
initialize: function(options) {
_.extend(this, _.pick(options, 'guid', 'modalCollection', 'callback', 'multiple', 'showLoader', 'hideLoader'));
this.vCatalogList = new VCatalogList();
var that = this;
this.modal = new Modal({
title: 'Assign Term',
content: this,
okText: 'Assign',
cancelText: "Cancel",
allowCancel: true,
}).open();
this.on('ok', function() {
that.asyncFetchCounter = 0;
var termName = this.modal.$el.find('.taxonomyTree li.active a').data('name').split("`").join("");
if (termName.trim) {
termName = termName.trim();
}
if (that.multiple) {
for (var i = 0; i < that.multiple.length; i++) {
if (i == 0) {
if (that.showLoader) {
that.showLoader();
}
}
var obj = {
termName: termName,
guid: that.multiple[i].id,
deletedEntity: Enums.entityStateReadOnly[that.multiple[i].model.status],
entityName: Utils.getName(that.multiple[i].model)
};
if (obj.deletedEntity) {
Utils.notifyError({
content: obj.entityName + Messages.assignDeletedEntity
});
if (that.multiple.length === 1 || (that.multiple.length == (i + 1) && that.asyncFetchCounter == 0)) {
that.hideLoader();
}
} else {
CommonViewFunction.saveTermToAsset(obj, that);
}
}
} else {
that.asyncFetchCounter = 0;
if (that.showLoader) {
that.showLoader();
}
CommonViewFunction.saveTermToAsset({
termName: termName,
guid: this.guid
}, that);
}
});
this.on('closeModal', function() {
this.modal.trigger('cancel');
});
},
onRender: function() {
this.renderTreeLayoutView();
},
renderTreeLayoutView: function() {
var that = this;
require(['views/business_catalog/TreeLayoutView'], function(TreeLayoutView) {
that.RTreeLayoutView.show(new TreeLayoutView({
url: that.url,
viewBased: false
}));
});
}
});
return AddTermToEntityLayoutView;
});
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
define(['require',
'backbone',
'hbs!tmpl/business_catalog/BusinessCatalogDetailLayoutView_tmpl',
'utils/Utils',
'models/VEntity',
'models/VCatalog',
'utils/Messages'
], function(require, Backbone, BusinessCatalogDetailLayoutViewTmpl, Utils, VEntity, VCatalog, Messages) {
'use strict';
var BusinessCatalogDetailLayoutView = Backbone.Marionette.LayoutView.extend(
/** @lends BusinessCatalogDetailLayoutView */
{
_viewName: 'BusinessCatalogDetailLayoutView',
template: BusinessCatalogDetailLayoutViewTmpl,
/** Layout sub regions */
regions: {},
/** ui selector cache */
ui: {
title: '[data-id="title"]',
editButton: '[data-id="editButton"]',
description: '[data-id="description"]',
editBox: '[data-id="editBox"]',
createDate: '[data-id="createDate"]'
},
/** ui events hash */
events: function() {
var events = {};
events["click " + this.ui.editButton] = 'onEditButton';
events["click " + this.ui.cancelButton] = 'onCancelButtonClick';
return events;
},
/**
* intialize a new BusinessCatalogDetailLayoutView Layout
* @constructs
*/
initialize: function(options) {
_.extend(this, _.pick(options, 'url', 'collection'));
this.bindEvents();
},
bindEvents: function() {
var that = this;
this.listenTo(this.collection, 'error', function(model, response) {
this.$('.fontLoader').hide();
if (response && response.responseJSON && response.responseJSON.message) {
Utils.notifyError({
content: response.responseJSON.message
});
}
}, this);
this.listenTo(this.collection, 'reset', function() {
this.$('.fontLoader').hide();
this.$('.hide').removeClass('hide');
this.model = this.collection.first();
var name = this.model.get('name'),
description = this.model.get('description'),
createdDate = this.model.get('creation_time');
if (name) {
this.ui.title.show();
this.termName = Utils.checkTagOrTerm(name, true);
this.ui.title.html('<span>' + this.termName.name + '</span>');
} else {
this.ui.title.hide();
}
if (description) {
this.ui.description.show();
this.ui.description.html('<span>' + _.escape(description) + '</span>');
} else {
this.ui.description.hide();
}
if (createdDate) {
var splitDate = createdDate.split(":");
this.ui.createDate.html('<strong> Date Created: </strong> ' + splitDate[0] + " " + splitDate[1] + ":" + splitDate[2] + ":" + splitDate[3] + " (GMT)");
}
Utils.hideTitleLoader(this.$('.fontLoader'), this.$('.catlogDetail'));
}, this);
},
onRender: function() {
var that = this;
Utils.showTitleLoader(this.$('.page-title .fontLoader'), this.$('.catlogDetail'));
},
fetchCollection: function() {
this.collection.fetch({ reset: true });
},
onEditButton: function(e) {
var that = this;
$(e.currentTarget).blur();
require([
'views/tag/CreateTagLayoutView',
'modules/Modal'
], function(CreateTagLayoutView, Modal) {
var view = new CreateTagLayoutView({ 'termCollection': that.collection, 'descriptionData': that.model.get('description'), 'tag': _.unescape(that.termName.name) });
var modal = new Modal({
title: 'Edit Term',
content: view,
cancelText: "Cancel",
okText: 'Save',
allowCancel: true,
}).open();
view.ui.description.on('keyup', function(e) {
that.textAreaChangeEvent(view, modal);
});
modal.$el.find('button.ok').prop('disabled', true);
modal.on('ok', function() {
that.onSaveDescriptionClick(view);
});
modal.on('closeModal', function() {
modal.trigger('cancel');
});
});
},
textAreaChangeEvent: function(view, modal) {
if (view.description == view.ui.description.val()) {
modal.$el.find('button.ok').prop('disabled', true);
} else {
modal.$el.find('button.ok').prop('disabled', false);
}
},
onSaveDescriptionClick: function(view) {
view.description = view.ui.description.val();
this.onSaveButton(this.collection.first().toJSON(), Messages.tag.updateTermDescriptionMessage, view);
this.ui.description.show();
},
onSaveButton: function(saveObject, message, view) {
var that = this,
termModel = new VCatalog();
termModel.url = function() {
return that.collection.url;
};
Utils.showTitleLoader(this.$('.page-title .fontLoader'), this.$('.catlogDetail'));
termModel.set({
"description": view.ui.description.val()
}).save(null, {
type: "PUT",
success: function(model, response) {
that.collection.fetch({ reset: true });
Utils.notifySuccess({
content: message
});
}
});
}
});
return BusinessCatalogDetailLayoutView;
});
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
define(['require',
'hbs!tmpl/business_catalog/BusinessCatalogHeader',
'utils/CommonViewFunction',
'utils/Globals'
], function(require, tmpl, CommonViewFunction, Globals) {
'use strict';
var BusinessCatalogHeader = Marionette.LayoutView.extend({
template: tmpl,
templateHelpers: function() {},
regions: {},
events: {},
initialize: function(options) {
_.extend(this, _.pick(options, 'url', 'collection'));
this.value = [];
},
/**
* After Page Render createBrudCrum called.
* @return {[type]} [description]
*/
render: function() {
var that = this;
$(this.el).html(this.template());
if (Globals.userLogedIn.status) {
that.$('.userName').text(Globals.userLogedIn.response.userName);
}
var that = this;
if (this.url) {
this.value = CommonViewFunction.breadcrumbUrlMaker(this.url);
}
this.listenTo(this.collection, 'reset', function() {
setTimeout(function() {
that.createBrudCrum();
}, 0);
}, this);
return this;
},
createBrudCrum: function() {
var li = "",
value = this.value,
that = this;
CommonViewFunction.breadcrumbMaker({ urlList: this.value, scope: this.$('.breadcrumb') });
}
});
return BusinessCatalogHeader;
});
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
define(['require',
'backbone',
'hbs!tmpl/business_catalog/BusinessCatalogLayoutView_tmpl'
], function(require, Backbone, BusinessCatalogLayoutViewTmpl) {
'use strict';
var BusinessCatalogLayoutView = Backbone.Marionette.LayoutView.extend(
/** @lends BusinessCatalogLayoutView */
{
_viewName: 'BusinessCatalogLayoutView',
template: BusinessCatalogLayoutViewTmpl,
/** Layout sub regions */
regions: {
RTreeLayoutView: "#r_treeLayoutView"
},
/** ui selector cache */
ui: {},
/** ui events hash */
events: function() {},
/**
* intialize a new BusinessCatalogLayoutView Layout
* @constructs
*/
initialize: function(options) {
_.extend(this, _.pick(options, 'url'));
},
bindEvents: function() {},
onRender: function() {
this.renderTreeLayoutView();
},
renderTreeLayoutView: function() {
var that = this;
require(['views/business_catalog/TreeLayoutView'], function(TreeLayoutView) {
that.RTreeLayoutView.show(new TreeLayoutView({
url: that.url,
viewBased: true
}));
});
},
manualRender: function(url, isParent, back) {
this.RTreeLayoutView.currentView.manualRender(url, isParent, back);
}
});
return BusinessCatalogLayoutView;
});
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
define(['require',
'backbone',
'hbs!tmpl/business_catalog/MoveTermLayoutView_tmpl',
'utils/Utils'
], function(require, Backbone, MoveTermLayoutViewTmpl, Utils) {
'use strict';
var MoveTermLayoutView = Backbone.Marionette.LayoutView.extend(
/** @lends MoveTermLayoutView */
{
_viewName: 'MoveTermLayoutView',
template: MoveTermLayoutViewTmpl,
/** Layout sub regions */
regions: {},
/** ui selector cache */
ui: {
moveTree: '[data-id="moveTree"]'
},
/** ui events hash */
events: function() {
var events = {};
return events;
},
/**
* intialize a new MoveTermLayoutView Layout
* @constructs
*/
initialize: function(options) {
_.extend(this, _.pick(options, 'taxanomyCollection'));
},
bindEvents: function() {},
onRender: function() {}
});
return MoveTermLayoutView;
});
...@@ -18,16 +18,17 @@ ...@@ -18,16 +18,17 @@
define(['require', define(['require',
'backbone', 'backbone',
'hbs!tmpl/common/aboutAtlas_tmpl', 'hbs!tmpl/common/AboutAtlas_tmpl',
'modules/Modal',
'models/VCommon', 'models/VCommon',
'utils/UrlLinks' 'utils/UrlLinks',
], function(require, Backbone, aboutAtlasTmpl, VCommon, UrlLinks) { ], function(require, Backbone, AboutAtlasTmpl, Modal, VCommon, UrlLinks) {
'use strict'; 'use strict';
var aboutAtlasView = Backbone.Marionette.LayoutView.extend( var AboutAtlasView = Backbone.Marionette.LayoutView.extend(
/** @lends aboutAtlasView */ /** @lends AboutAtlasView */
{ {
template: aboutAtlasTmpl, template: AboutAtlasTmpl,
/** Layout sub regions */ /** Layout sub regions */
regions: {}, regions: {},
/** ui selector cache */ /** ui selector cache */
...@@ -37,16 +38,24 @@ define(['require', ...@@ -37,16 +38,24 @@ define(['require',
/** ui events hash */ /** ui events hash */
events: function() {}, events: function() {},
/** /**
* intialize a new aboutAtlasView Layout * intialize a new AboutAtlasView Layout
* @constructs * @constructs
*/ */
initialize: function(options) { initialize: function(options) {
_.extend(this, options); _.extend(this, options);
}, var modal = new Modal({
bindEvents: function() { title: 'Apache Atlas',
content: this,
okCloses: true,
showFooter: true,
allowCancel: false,
}).open();
modal.on('closeModal', function() {
modal.trigger('cancel');
});
}, },
bindEvents: function() {},
onRender: function() { onRender: function() {
var that = this; var that = this;
var url = UrlLinks.versionApiUrl(); var url = UrlLinks.versionApiUrl();
...@@ -61,5 +70,5 @@ define(['require', ...@@ -61,5 +70,5 @@ define(['require',
}, },
}); });
return aboutAtlasView; return AboutAtlasView;
}); });
\ No newline at end of file
...@@ -429,10 +429,7 @@ define(['require', ...@@ -429,10 +429,7 @@ define(['require',
typeStr += '<option>' + (name) + '</option>'; typeStr += '<option>' + (name) + '</option>';
} }
if (model.get('category') == 'CLASSIFICATION') { if (model.get('category') == 'CLASSIFICATION') {
var checkTagOrTerm = Utils.checkTagOrTerm(name); tagStr += '<option>' + (name) + '</option>';
if (checkTagOrTerm.tag) {
tagStr += '<option>' + (name) + '</option>';
}
} }
}); });
that.ui.typeLov.html(typeStr); that.ui.typeLov.html(typeStr);
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
*/ */
define(['require', define(['require',
'hbs!tmpl/site/header', 'hbs!tmpl/site/Header',
'utils/CommonViewFunction', 'utils/CommonViewFunction',
'utils/Globals' 'utils/Globals'
], function(require, tmpl, CommonViewFunction, Globals) { ], function(require, tmpl, CommonViewFunction, Globals) {
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
*/ */
define(['require', define(['require',
'hbs!tmpl/business_catalog/SideNavLayoutView_tmpl', 'hbs!tmpl/site/SideNavLayoutView_tmpl',
'utils/Utils', 'utils/Utils',
'utils/Globals', 'utils/Globals',
'utils/UrlLinks' 'utils/UrlLinks'
...@@ -37,7 +37,6 @@ define(['require', ...@@ -37,7 +37,6 @@ define(['require',
}, },
templateHelpers: function() { templateHelpers: function() {
return { return {
taxonomy: Globals.taxonomy,
tabClass: this.tabClass, tabClass: this.tabClass,
apiBaseUrl: UrlLinks.apiBaseUrl apiBaseUrl: UrlLinks.apiBaseUrl
}; };
...@@ -60,16 +59,10 @@ define(['require', ...@@ -60,16 +59,10 @@ define(['require',
if (hashUrl != tabStateUrls.searchUrl) { if (hashUrl != tabStateUrls.searchUrl) {
Globals.saveApplicationState.tabState.searchUrl = hashUrl; Globals.saveApplicationState.tabState.searchUrl = hashUrl;
} }
} else if (urlStateObj.isTaxonomyTab()) {
if (hashUrl != tabStateUrls.taxonomyUrl) {
Globals.saveApplicationState.tabState.isTaxonomyTab = hashUrl;
}
} }
if (elementName.name == "tab-tag") { if (elementName.name == "tab-tag") {
urlString = tabStateUrls.tagUrl; //'#!/tag'; urlString = tabStateUrls.tagUrl; //'#!/tag';
} else if (elementName.name == "tab-taxonomy") {
urlString = tabStateUrls.taxonomyUrl; // '#!/taxonomy';
} else if (elementName.name == "tab-search") { } else if (elementName.name == "tab-search") {
urlString = tabStateUrls.searchUrl; // '#!/search'; urlString = tabStateUrls.searchUrl; // '#!/search';
} }
...@@ -84,29 +77,14 @@ define(['require', ...@@ -84,29 +77,14 @@ define(['require',
}, },
initialize: function(options) { initialize: function(options) {
_.extend(this, _.pick(options, 'url', 'value', 'tag', 'selectFirst', 'classificationDefCollection', 'typeHeaders', 'searchVent', 'entityDefCollection', 'enumDefCollection', 'searchTableColumns', 'searchTableFilters')); _.extend(this, _.pick(options, 'url', 'value', 'tag', 'selectFirst', 'classificationDefCollection', 'typeHeaders', 'searchVent', 'entityDefCollection', 'enumDefCollection', 'searchTableColumns', 'searchTableFilters'));
if (Globals.taxonomy) { this.tabClass = "tab col-sm-6";
this.tabClass = "tab col-sm-4";
} else {
this.tabClass = "tab col-sm-6";
}
}, },
onRender: function() { onRender: function() {
this.renderTagLayoutView(); this.renderTagLayoutView();
this.renderSearchLayoutView(); this.renderSearchLayoutView();
if (Globals.taxonomy) {
this.rendeBusinessCatalogLayoutView();
}
this.selectTab(); this.selectTab();
}, },
rendeBusinessCatalogLayoutView: function() {
var that = this;
require(['views/business_catalog/BusinessCatalogLayoutView'], function(BusinessCatalogLayoutView) {
that.RBusinessCatalogLayoutView.show(new BusinessCatalogLayoutView({
url: that.url
}));
});
},
renderTagLayoutView: function() { renderTagLayoutView: function() {
var that = this; var that = this;
require(['views/tag/TagLayoutView'], function(TagLayoutView) { require(['views/tag/TagLayoutView'], function(TagLayoutView) {
...@@ -137,9 +115,6 @@ define(['require', ...@@ -137,9 +115,6 @@ define(['require',
if (Utils.getUrlState.isTagTab()) { if (Utils.getUrlState.isTagTab()) {
this.$('.tabs').find('li a[aria-controls="tab-tag"]').parents('li').addClass('active').siblings().removeClass('active'); this.$('.tabs').find('li a[aria-controls="tab-tag"]').parents('li').addClass('active').siblings().removeClass('active');
this.$('.tab-content').find('div#tab-tag').addClass('active').siblings().removeClass('active'); this.$('.tab-content').find('div#tab-tag').addClass('active').siblings().removeClass('active');
} else if (Utils.getUrlState.isTaxonomyTab()) {
this.$('.tabs').find('li a[aria-controls="tab-taxonomy"]').parents('li').addClass('active').siblings().removeClass('active');
this.$('.tab-content').find('div#tab-taxonomy').addClass('active').siblings().removeClass('active');
} else if (Utils.getUrlState.isSearchTab() || (Utils.getUrlState.isDetailPage()) || Utils.getUrlState.isInitial()) { } else if (Utils.getUrlState.isSearchTab() || (Utils.getUrlState.isDetailPage()) || Utils.getUrlState.isInitial()) {
this.$('.tabs').find('li a[aria-controls="tab-search"]').parents('li').addClass('active').siblings().removeClass('active'); this.$('.tabs').find('li a[aria-controls="tab-search"]').parents('li').addClass('active').siblings().removeClass('active');
this.$('.tab-content').find('div#tab-search').addClass('active').siblings().removeClass('active'); this.$('.tab-content').find('div#tab-search').addClass('active').siblings().removeClass('active');
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
*/ */
define(['require', define(['require',
'hbs!tmpl/tag/addTagModalView_tmpl', 'hbs!tmpl/tag/AddTagModalView_tmpl',
'collection/VTagList', 'collection/VTagList',
'collection/VCommonList', 'collection/VCommonList',
'modules/Modal', 'modules/Modal',
...@@ -215,9 +215,6 @@ define(['require', ...@@ -215,9 +215,6 @@ define(['require',
var str = '<option selected="selected" disabled="disabled">-- Select a tag from the dropdown list --</option>'; var str = '<option selected="selected" disabled="disabled">-- Select a tag from the dropdown list --</option>';
this.collection.fullCollection.sort().each(function(obj, key) { this.collection.fullCollection.sort().each(function(obj, key) {
var name = Utils.getName(obj.toJSON(), 'name'); var name = Utils.getName(obj.toJSON(), 'name');
if (name === "TaxonomyTerm") {
return;
}
// 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) {
str += '<option ' + (that.tagModel && that.tagModel.typeName === name ? 'selected' : '') + '>' + name + '</option>'; str += '<option ' + (that.tagModel && that.tagModel.typeName === name ? 'selected' : '') + '>' + name + '</option>';
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
define(['require', define(['require',
'backbone', 'backbone',
'hbs!tmpl/tag/createTagLayoutView_tmpl', 'hbs!tmpl/tag/CreateTagLayoutView_tmpl',
'utils/Utils', 'utils/Utils',
'views/tag/TagAttributeItemView', 'views/tag/TagAttributeItemView',
'collection/VTagList', 'collection/VTagList',
...@@ -74,11 +74,9 @@ define(['require', ...@@ -74,11 +74,9 @@ define(['require',
* @constructs * @constructs
*/ */
initialize: function(options) { initialize: function(options) {
_.extend(this, _.pick(options, 'tagCollection', 'model', 'tag', 'termCollection', 'descriptionData')); _.extend(this, _.pick(options, 'tagCollection', 'model', 'tag', 'descriptionData'));
if (this.model) { if (this.model) {
this.description = this.model.get('description'); this.description = this.model.get('description');
} else if (this.termCollection) {
this.description = this.descriptionData;
} else { } else {
this.create = true; this.create = true;
} }
...@@ -107,15 +105,12 @@ define(['require', ...@@ -107,15 +105,12 @@ define(['require',
}); });
}, },
tagCollectionList: function() { tagCollectionList: function() {
var str = '', var that = this,
that = this; str = '';
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());
checkTagOrTerm = Utils.checkTagOrTerm(name); str += '<option>' + (name) + '</option>';
if (checkTagOrTerm.tag) {
str += '<option>' + (name) + '</option>';
}
}); });
that.ui.parentTag.html(str); that.ui.parentTag.html(str);
// IE9 support // IE9 support
...@@ -152,4 +147,4 @@ define(['require', ...@@ -152,4 +147,4 @@ define(['require',
} }
}); });
return CreateTagLayoutView; return CreateTagLayoutView;
}); });
\ No newline at end of file
...@@ -35,7 +35,7 @@ define(['require', ...@@ -35,7 +35,7 @@ define(['require',
/** Layout sub regions */ /** Layout sub regions */
regions: { regions: {
RTagTermTableLayoutView: "#r_tagTermTableLayoutView" RTagTableLayoutView: "#r_tagTableLayoutView"
}, },
/** ui selector cache */ /** ui selector cache */
...@@ -64,27 +64,14 @@ define(['require', ...@@ -64,27 +64,14 @@ define(['require',
* @constructs * @constructs
*/ */
initialize: function(options) { initialize: function(options) {
_.extend(this, _.pick(options, 'entity', 'guid', 'term', 'entityName', 'fetchCollection', 'enumDefCollection', 'classificationDefCollection')); _.extend(this, _.pick(options, 'entity', 'guid', 'entityName', 'fetchCollection', 'enumDefCollection', 'classificationDefCollection'));
this.collectionObject = this.entity; this.collectionObject = this.entity;
this.tagTermCollection = new VTagList(); this.tagCollection = new VTagList();
var tagorterm = _.toArray(this.collectionObject.classifications), var that = this,
tagTermList = [], tags = _.toArray(this.collectionObject.classifications);
that = this; this.tagCollection.set(tags);
_.each(tagorterm, function(object) {
var checkTagOrTerm = Utils.checkTagOrTerm(object);
if (that.term) {
if (checkTagOrTerm.term) {
tagTermList.push(object);
}
} else {
if (checkTagOrTerm.tag) {
tagTermList.push(object);
}
}
});
this.tagTermCollection.set(tagTermList);
this.commonTableOptions = { this.commonTableOptions = {
collection: this.tagTermCollection, collection: this.tagCollection,
includeFilter: false, includeFilter: false,
includePagination: true, includePagination: true,
includePageSize: false, includePageSize: false,
...@@ -105,7 +92,7 @@ define(['require', ...@@ -105,7 +92,7 @@ define(['require',
var that = this; var that = this;
require(['utils/TableLayout'], function(TableLayout) { require(['utils/TableLayout'], function(TableLayout) {
var cols = new Backgrid.Columns(that.getSchemaTableColumns()); var cols = new Backgrid.Columns(that.getSchemaTableColumns());
that.RTagTermTableLayoutView.show(new TableLayout(_.extend({}, that.commonTableOptions, { that.RTagTableLayoutView.show(new TableLayout(_.extend({}, that.commonTableOptions, {
columns: cols columns: cols
}))); })));
}); });
...@@ -114,9 +101,9 @@ define(['require', ...@@ -114,9 +101,9 @@ define(['require',
var that = this; var that = this;
var col = {}; var col = {};
return this.tagTermCollection.constructor.getTableCols({ return this.tagCollection.constructor.getTableCols({
TagorTerm: { tag: {
label: (this.term) ? "Terms" : "Tags", label: "Tags",
cell: "String", cell: "String",
editable: false, editable: false,
sortable: false, sortable: false,
...@@ -126,7 +113,7 @@ define(['require', ...@@ -126,7 +113,7 @@ define(['require',
} }
}) })
}, },
Attributes: { attributes: {
label: "Attributes", label: "Attributes",
cell: "html", cell: "html",
editable: false, editable: false,
...@@ -177,52 +164,40 @@ define(['require', ...@@ -177,52 +164,40 @@ define(['require',
}) })
}, },
}, },
this.tagTermCollection); this.tagCollection);
}, },
addModalView: function(e) { addModalView: function(e) {
var that = this; var that = this;
require(['views/tag/addTagModalView'], function(AddTagModalView) { require(['views/tag/AddTagModalView'], function(AddTagModalView) {
var view = new AddTagModalView({ var view = new AddTagModalView({
guid: that.guid, guid: that.guid,
modalCollection: that.collection, modalCollection: that.collection,
enumDefCollection: that.enumDefCollection enumDefCollection: that.enumDefCollection
}); });
// view.saveTagData = function() {
//override saveTagData function
// }
}); });
}, },
deleteTagDataModal: function(e) { deleteTagDataModal: function(e) {
var tagName = $(e.currentTarget).data("name"), var that = this,
that = this; tagName = $(e.currentTarget).data("name"),
if (that.term) { modal = CommonViewFunction.deleteTagModel({
var modal = CommonViewFunction.deleteTagModel({
msg: "<div class='ellipsis'>Remove: " + "<b>" + _.escape(tagName) + "</b> assignment from" + " " + "<b>" + this.entityName + "?</b></div>",
titleMessage: Messages.removeTerm,
buttonText: "Remove",
});
} else {
var modal = CommonViewFunction.deleteTagModel({
msg: "<div class='ellipsis'>Remove: " + "<b>" + _.escape(tagName) + "</b> assignment from" + " " + "<b>" + this.entityName + "?</b></div>", msg: "<div class='ellipsis'>Remove: " + "<b>" + _.escape(tagName) + "</b> assignment from" + " " + "<b>" + this.entityName + "?</b></div>",
titleMessage: Messages.removeTag, titleMessage: Messages.removeTag,
buttonText: "Remove", buttonText: "Remove",
}); });
}
modal.on('ok', function() { modal.on('ok', function() {
that.deleteTagData(e); that.deleteTagData({
'tagName': tagName,
'guid': that.guid
});
}); });
modal.on('closeModal', function() { modal.on('closeModal', function() {
modal.trigger('cancel'); modal.trigger('cancel');
}); });
}, },
deleteTagData: function(e) { deleteTagData: function(options) {
var that = this, var that = this;
tagName = $(e.currentTarget).data("name"); CommonViewFunction.deleteTag(_.extend({}, options, {
CommonViewFunction.deleteTag({
'tagName': tagName,
'guid': that.guid,
'tagOrTerm': (that.term ? "term" : "tag"),
showLoader: function() { showLoader: function() {
that.$('.fontLoader').show(); that.$('.fontLoader').show();
that.$('.tableOverlay').show(); that.$('.tableOverlay').show();
...@@ -238,14 +213,14 @@ define(['require', ...@@ -238,14 +213,14 @@ define(['require',
} }
} }
}); }));
}, },
editTagDataModal: function(e) { editTagDataModal: function(e) {
var that = this, var that = this,
tagName = $(e.currentTarget).data('name'), tagName = $(e.currentTarget).data('name'),
tagModel = _.findWhere(that.collectionObject.classifications, { typeName: tagName }); tagModel = _.findWhere(that.collectionObject.classifications, { typeName: tagName });
require([ require([
'views/tag/addTagModalView' 'views/tag/AddTagModalView'
], function(AddTagModalView) { ], function(AddTagModalView) {
var view = new AddTagModalView({ var view = new AddTagModalView({
'tagModel': tagModel, 'tagModel': tagModel,
......
...@@ -144,17 +144,14 @@ define(['require', ...@@ -144,17 +144,14 @@ define(['require',
}; };
this.collection.fullCollection.sort().each(function(model) { this.collection.fullCollection.sort().each(function(model) {
var name = Utils.getName(model.toJSON(), 'name'); var name = Utils.getName(model.toJSON(), 'name');
var checkTagOrTerm = Utils.checkTagOrTerm(name); if (searchString) {
if (checkTagOrTerm.tag) { if (name.search(new RegExp(searchString, "i")) != -1) {
if (searchString) { str += '<li class="parent-node" data-id="tags"><div class="tools"><i class="fa fa-ellipsis-h tagPopover"></i></div><a href="#!/tag/tagAttribute/' + name + '" data-name="' + name + '" >' + name + '</a></li>';
if (name.search(new RegExp(searchString, "i")) != -1) {
str += '<li class="parent-node" data-id="tags"><div class="tools"><i class="fa fa-ellipsis-h tagPopover"></i></div><a href="#!/tag/tagAttribute/' + name + '" data-name="' + name + '" >' + name + '</a></li>';
} else {
return;
}
} else { } else {
str += '<li class="parent-node" data-id="tags"><div class="tools"><i class="fa fa-ellipsis-h tagPopover"></i></div><a href="#!/tag/tagAttribute/' + name + '" data-name="' + name + '">' + name + '</a></li>'; return;
} }
} else {
str += '<li class="parent-node" data-id="tags"><div class="tools"><i class="fa fa-ellipsis-h tagPopover"></i></div><a href="#!/tag/tagAttribute/' + name + '" data-name="' + name + '">' + name + '</a></li>';
} }
}); });
this.ui.tagsParent.empty().html(str); this.ui.tagsParent.empty().html(str);
......
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