You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by ma...@apache.org on 2018/03/05 16:00:59 UTC
atlas git commit: ATLAS-2469: UI updates to support propagated tags
Repository: atlas
Updated Branches:
refs/heads/master 45e38e852 -> eecff698c
ATLAS-2469: UI updates to support propagated tags
Signed-off-by: Madhan Neethiraj <ma...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/eecff698
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/eecff698
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/eecff698
Branch: refs/heads/master
Commit: eecff698c04e52387a6e53d90b0c7de43397c6f3
Parents: 45e38e8
Author: pratik24mac <pr...@gmail.com>
Authored: Fri Mar 2 02:07:15 2018 +0530
Committer: Madhan Neethiraj <ma...@apache.org>
Committed: Mon Mar 5 07:57:18 2018 -0800
----------------------------------------------------------------------
dashboardv2/gruntfile.js | 4 +-
dashboardv2/package.json | 1 +
dashboardv2/public/css/scss/override.scss | 12 ++
dashboardv2/public/js/main.js | 7 +
.../detail_page/DetailPageLayoutView_tmpl.html | 11 +-
.../templates/search/SearchLayoutView_tmpl.html | 2 +-
.../search/SearchResultLayoutView_tmpl.html | 4 +-
.../templates/site/SideNavLayoutView_tmpl.html | 2 +-
.../js/templates/tag/AddTagModalView_tmpl.html | 40 +++++-
.../js/templates/tag/AddTimezoneView_tmpl.html | 34 +++++
.../templates/tag/CreateTagLayoutView_tmpl.html | 4 +-
.../tag/TagAttributeDetailLayoutView_tmpl.html | 4 +-
.../tag/TagDetailTableLayoutView_tmpl.html | 8 +-
.../js/templates/tag/TagLayoutView_tmpl.html | 2 +-
.../public/js/utils/CommonViewFunction.js | 4 +-
dashboardv2/public/js/utils/Enums.js | 6 +-
dashboardv2/public/js/utils/Messages.js | 10 +-
.../views/detail_page/DetailPageLayoutView.js | 51 +++++--
.../js/views/search/SearchResultLayoutView.js | 2 +-
.../public/js/views/tag/AddTagModalView.js | 138 ++++++++++++++++---
.../public/js/views/tag/AddTimezoneItemView.js | 137 ++++++++++++++++++
.../public/js/views/tag/CreateTagLayoutView.js | 2 +-
.../views/tag/TagAttributeDetailLayoutView.js | 2 +-
.../js/views/tag/TagDetailTableLayoutView.js | 50 +++++--
.../public/js/views/tag/TagLayoutView.js | 18 +--
25 files changed, 470 insertions(+), 85 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/atlas/blob/eecff698/dashboardv2/gruntfile.js
----------------------------------------------------------------------
diff --git a/dashboardv2/gruntfile.js b/dashboardv2/gruntfile.js
index 451a933..fc8fa0d 100644
--- a/dashboardv2/gruntfile.js
+++ b/dashboardv2/gruntfile.js
@@ -98,6 +98,7 @@ module.exports = function(grunt) {
'select2.full.min.js': { 'select2/dist/js': 'select2' },
'backgrid-select-all.min.js': { 'backgrid-select-all': 'backgrid-select-all' },
'moment.min.js': { 'moment/min': 'moment/js' },
+ 'moment-timezone-with-data.min.js' : {'moment-timezone/builds' : 'moment-timezone'},
'jquery.placeholder.js': { 'jquery-placeholder': 'jquery-placeholder/js' },
'platform.js': { 'platform': 'platform' },
'query-builder.standalone.min.js': { 'jQuery-QueryBuilder/dist/js': 'jQueryQueryBuilder/js' },
@@ -158,7 +159,8 @@ module.exports = function(grunt) {
{ 'd3-tip': 'd3/' },
{ 'dagre-d3': 'dagre-d3' },
{ 'platform': 'platform/' },
- { 'jQuery-QueryBuilder': 'jQueryQueryBuilder/' }
+ { 'jQuery-QueryBuilder': 'jQueryQueryBuilder/' },
+ {'moment-timezone' : 'moment-timezone'}
],
'LICENSE.md': [{ 'backbone.babysitter': 'backbone-babysitter' },
{ 'backbone.wreqr': 'backbone-wreqr' },
http://git-wip-us.apache.org/repos/asf/atlas/blob/eecff698/dashboardv2/package.json
----------------------------------------------------------------------
diff --git a/dashboardv2/package.json b/dashboardv2/package.json
index 9237c35..f8c3d3f 100644
--- a/dashboardv2/package.json
+++ b/dashboardv2/package.json
@@ -38,6 +38,7 @@
"jquery-placeholder": "2.3.1",
"jquery-sparkline": "2.4.0",
"moment": "2.18.1",
+ "moment-timezone": "^0.5.14",
"nvd3": "1.8.5",
"platform": "1.3.4",
"pnotify": "3.2.0",
http://git-wip-us.apache.org/repos/asf/atlas/blob/eecff698/dashboardv2/public/css/scss/override.scss
----------------------------------------------------------------------
diff --git a/dashboardv2/public/css/scss/override.scss b/dashboardv2/public/css/scss/override.scss
index f1e2c6b..5f86b2d 100644
--- a/dashboardv2/public/css/scss/override.scss
+++ b/dashboardv2/public/css/scss/override.scss
@@ -404,4 +404,16 @@ div.columnmanager-dropdown-container {
.ui-pnotify-icon,
.ui-pnotify-icon span {
padding: 2px 0px;
+}
+
+.btn-round-xs {
+ border-radius: 11px;
+ padding-left: 10px;
+ padding-right: 10px;
+ background-color: transparent!important;
+ color: #626467;
+ border: 1px solid black;
+}
+.text-center {
+ text-align: center !important;
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/atlas/blob/eecff698/dashboardv2/public/js/main.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/main.js b/dashboardv2/public/js/main.js
index ce0f4fe..a0e4bc5 100644
--- a/dashboardv2/public/js/main.js
+++ b/dashboardv2/public/js/main.js
@@ -114,6 +114,12 @@ require.config({
'daterangepicker': {
'deps': ['jquery', 'moment']
},
+ 'moment-timezone' : {
+ 'deps' : ['moment']
+ },
+ 'moment':{
+ 'exports':['moment']
+ },
'nvd3': {
'deps': ['d3']
},
@@ -150,6 +156,7 @@ require.config({
'select2': 'libs/select2/select2.full.min',
'backgrid-select-all': 'libs/backgrid-select-all/backgrid-select-all.min',
'moment': 'libs/moment/js/moment.min',
+ 'moment-timezone': 'libs/moment-timezone/moment-timezone-with-data.min',
'jquery-ui': 'external_lib/jquery-ui/jquery-ui.min',
'pnotify': 'external_lib/pnotify/pnotify.custom.min',
'pnotify.buttons': 'external_lib/pnotify/pnotify.custom.min',
http://git-wip-us.apache.org/repos/asf/atlas/blob/eecff698/dashboardv2/public/js/templates/detail_page/DetailPageLayoutView_tmpl.html
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/templates/detail_page/DetailPageLayoutView_tmpl.html b/dashboardv2/public/js/templates/detail_page/DetailPageLayoutView_tmpl.html
index 1578548..b084ba1 100644
--- a/dashboardv2/public/js/templates/detail_page/DetailPageLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/detail_page/DetailPageLayoutView_tmpl.html
@@ -26,13 +26,18 @@
<div data-id="editButtonContainer" class="pull-right"></div>
{{/if}}
<div class="form-group">
- <span class="control-label-sm-pr pull-left">Tags:</span>
+ <span class="control-label-sm-pr pull-left">Classifications:</span>
<div class="pull-left" data-id="tagList">
- <button class="btn btn-action btn-sm" title="Add Tag" data-id="addTag">
+ <button class="btn btn-action btn-sm" title="Add Classification" data-id="addTag">
<i class="fa fa-plus"> </i>
</button>
</div>
</div>
+ <div class="form-group" style="display: none;" data-id="propagatedTagDiv">
+ <span class="control-label-sm-pr pull-left">Propagated Classifications:</span>
+ <div class="pull-left" data-id="propagatedTagList">
+ </div>
+ </div>
</div>
</div>
<div class="container-fluid gray-bg">
@@ -75,7 +80,7 @@
<div class="col-sm-12">
<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="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">Classifications</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="profile" class="tab profileTab" style="display:none"><a href="#tab-profile" aria-controls="tab-profile" role="tab" data-toggle="tab">Profile</a></li>
http://git-wip-us.apache.org/repos/asf/atlas/blob/eecff698/dashboardv2/public/js/templates/search/SearchLayoutView_tmpl.html
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/templates/search/SearchLayoutView_tmpl.html b/dashboardv2/public/js/templates/search/SearchLayoutView_tmpl.html
index 5d3c3af..b30023e 100644
--- a/dashboardv2/public/js/templates/search/SearchLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/search/SearchLayoutView_tmpl.html
@@ -45,7 +45,7 @@
</div>
</div>
<div class="srchType tagBox clearfix">
- <span class="srchTitle">Search By Tag</span>
+ <span class="srchTitle">Search By Classification</span>
<div>
<div class="col-sm-10 no-padding">
<select data-id="tagLOV"></select>
http://git-wip-us.apache.org/repos/asf/atlas/blob/eecff698/dashboardv2/public/js/templates/search/SearchResultLayoutView_tmpl.html
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/templates/search/SearchResultLayoutView_tmpl.html b/dashboardv2/public/js/templates/search/SearchResultLayoutView_tmpl.html
index 403b064..7e0ed72 100644
--- a/dashboardv2/public/js/templates/search/SearchResultLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/search/SearchResultLayoutView_tmpl.html
@@ -38,12 +38,12 @@
<div class="inline" data-id="containerCheckBox" style="display: none;">
<label class="checkbox-inline btn" for="inputLabel">
<input type="checkbox" data-id="checkSubClassification" data-value="excludeSC"/>
- <b>Exclude sub-classification</b></label>
+ <b>Exclude sub-classifications</b></label>
</div>
<div class="inline" data-id="containerCheckBox" style="display: none;">
<label class="checkbox-inline btn" for="inputLabel">
<input type="checkbox" data-id="checkSubType" data-value="excludeST"/>
- <b>Exclude sub-type</b></label>
+ <b>Exclude sub-types</b></label>
</div>
<div class="inline">
<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>
http://git-wip-us.apache.org/repos/asf/atlas/blob/eecff698/dashboardv2/public/js/templates/site/SideNavLayoutView_tmpl.html
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/templates/site/SideNavLayoutView_tmpl.html b/dashboardv2/public/js/templates/site/SideNavLayoutView_tmpl.html
index b706609..942188e 100644
--- a/dashboardv2/public/js/templates/site/SideNavLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/site/SideNavLayoutView_tmpl.html
@@ -20,7 +20,7 @@
</li>
<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-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> Classification</a></li>
</ul>
</ul>
<div class="tab-content">
http://git-wip-us.apache.org/repos/asf/atlas/blob/eecff698/dashboardv2/public/js/templates/tag/AddTagModalView_tmpl.html
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/templates/tag/AddTagModalView_tmpl.html b/dashboardv2/public/js/templates/tag/AddTagModalView_tmpl.html
index a477532..dbf7d66 100644
--- a/dashboardv2/public/js/templates/tag/AddTagModalView_tmpl.html
+++ b/dashboardv2/public/js/templates/tag/AddTagModalView_tmpl.html
@@ -18,9 +18,39 @@
<div class="form-group hide">
{{#if tagModel}}
<h4>{{tagModel.typeName}}</h4> {{else}}
- <select class="form-control row-margin-bottom" data-id="addTagOptions" required>
- </select>
- {{/if}}
+ <div class="row modalHeight">
+ <div class="col-md-8">
+ <select class="form-control row-margin-bottom" data-id="addTagOptions" required>
+ </select>
+ </div>
+ {{/if}}
+ <div class="col-sm-2">
+ <div class="inline">
+ <label class="checkbox-inline btn">
+ <input type="checkbox" data-id="checkModalTagProperty" class="input" checked /> Propagate</label>
+ </div>
+ </div>
+ <div class="col-sm-2">
+ <div class="inline-content-fr table-action-btn">
+ <div class="inline">
+ <label class="checkbox-inline btn">
+ <input type="checkbox" data-id="checkTimezoneProperty" class="input" /> Apply Validity Period</label>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="row modalHeight" style="display: none;" data-id="timeZoneDiv">
+ <hr>
+ <div class="col-sm-12">
+ <div class="clearfix form-group">
+ <button type="button" class="btn btn-action btn-sm pull-right" data-id="addTimezoneParms"><i class="fa fa-plus"></i> Add Validity Period</button>
+ </div>
+ <div class="panel panel-default" data-id="validityPeriodBody" style="display: none;">
+ <div class="panel-body" data-id="addTimezoneDiv">
+ </div>
+ </div>
+ </div>
+ </div>
</div>
<div class="row modalHeight">
<div class="col-sm-12">
@@ -29,9 +59,9 @@
</div>
</div>
<div class="col-sm-12" style="display:none">
- <p>Tag Attributes(optional)</p>
+ <p>Classification Attributes(optional)</p>
<p class="text-gray">Add attribute values for this tag</p>
<div data-id="tagAttribute"></div>
</div>
</div>
-</div>
+</div>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/atlas/blob/eecff698/dashboardv2/public/js/templates/tag/AddTimezoneView_tmpl.html
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/templates/tag/AddTimezoneView_tmpl.html b/dashboardv2/public/js/templates/tag/AddTimezoneView_tmpl.html
new file mode 100644
index 0000000..e7e1289
--- /dev/null
+++ b/dashboardv2/public/js/templates/tag/AddTimezoneView_tmpl.html
@@ -0,0 +1,34 @@
+<!--
+ * 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-group clearfix">
+ <div class="col-sm-4">
+ <label for="">Start Time</label>
+ <input type="text" class="form-control" name="startTime" data-id="startTime" />
+ </div>
+ <div class="col-sm-4">
+ <label for="">End Time</label>
+ <input type="text" class="form-control" name="endTime" data-id="endTime" />
+ </div>
+ <div class="col-sm-3">
+ <label for="">TimeZone</label>
+ <select class="form-control row-margin-bottom" data-id="timeZone" required>
+ </select>
+ </div>
+ <div class="col-sm-1 attributePlusData" align="right">
+ <button type="button" class="btn btn-danger btn-sm closeInput" data-id="close"><i class="fa fa-times"></i></button>
+ </div>
+</div>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/atlas/blob/eecff698/dashboardv2/public/js/templates/tag/CreateTagLayoutView_tmpl.html
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/templates/tag/CreateTagLayoutView_tmpl.html b/dashboardv2/public/js/templates/tag/CreateTagLayoutView_tmpl.html
index 40827ef..5407233 100644
--- a/dashboardv2/public/js/templates/tag/CreateTagLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/tag/CreateTagLayoutView_tmpl.html
@@ -36,8 +36,8 @@
{{#if create}}
<div class="form-group">
<div class="col-sm-12">
- <label>Select tags to inherit attributes(optional)</label>
- <p class="text-gray">Attributes define additional properties for the tag</p>
+ <label>Select classification to inherit attributes(optional)</label>
+ <p class="text-gray">Attributes define additional properties for the classification</p>
<select class="form-control" data-id="parentTagList" multiple="multiple"></select>
</div>
</div>
http://git-wip-us.apache.org/repos/asf/atlas/blob/eecff698/dashboardv2/public/js/templates/tag/TagAttributeDetailLayoutView_tmpl.html
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/templates/tag/TagAttributeDetailLayoutView_tmpl.html b/dashboardv2/public/js/templates/tag/TagAttributeDetailLayoutView_tmpl.html
index d418782..32fc728 100644
--- a/dashboardv2/public/js/templates/tag/TagAttributeDetailLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/tag/TagAttributeDetailLayoutView_tmpl.html
@@ -23,12 +23,12 @@
<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>
<div class="superType form-group" style="display:none">
- <label class="control-label-sm-pr pull-left">Direct super-tags:</label>
+ <label class="control-label-sm-pr pull-left">Direct super-classifications:</label>
<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>
+ <label class="control-label-sm-pr pull-left">Direct sub-classifications:</label>
<div data-id="subType" class="btn-inline">
</div>
</div>
http://git-wip-us.apache.org/repos/asf/atlas/blob/eecff698/dashboardv2/public/js/templates/tag/TagDetailTableLayoutView_tmpl.html
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/templates/tag/TagDetailTableLayoutView_tmpl.html b/dashboardv2/public/js/templates/tag/TagDetailTableLayoutView_tmpl.html
index 76f225a..8298bc7 100644
--- a/dashboardv2/public/js/templates/tag/TagDetailTableLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/tag/TagDetailTableLayoutView_tmpl.html
@@ -16,5 +16,11 @@
-->
<div>
<div class="tableOverlay"></div>
+ <div class="inline-content-fr table-action-btn">
+ <div class="inline" >
+ <label class="checkbox-inline btn">
+ <input type="checkbox" data-id="checkPropagtedTag" class="input" checked="true" name="queryType" value="text" name="check" value="1" /> Show Propagated Classifications</label>
+ </div>
+ </div>
<div id="r_tagTableLayoutView"></div>
-</div>
+</div>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/atlas/blob/eecff698/dashboardv2/public/js/templates/tag/TagLayoutView_tmpl.html
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/templates/tag/TagLayoutView_tmpl.html b/dashboardv2/public/js/templates/tag/TagLayoutView_tmpl.html
index f786df4..185790e 100644
--- a/dashboardv2/public/js/templates/tag/TagLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/tag/TagLayoutView_tmpl.html
@@ -35,7 +35,7 @@
</div> -->
<div class="row">
<div class="list-view col-sm-12">
- <input type="text" class="form-control" data-id="offlineSearchTag" placeholder="Search Tags">
+ <input type="text" class="form-control" data-id="offlineSearchTag" placeholder="Search Classification">
<ul class="tag-tree" data-id="tagsList">
</ul>
</div>
http://git-wip-us.apache.org/repos/asf/atlas/blob/eecff698/dashboardv2/public/js/utils/CommonViewFunction.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/utils/CommonViewFunction.js b/dashboardv2/public/js/utils/CommonViewFunction.js
index 9b9ffcc..2057e3e 100644
--- a/dashboardv2/public/js/utils/CommonViewFunction.js
+++ b/dashboardv2/public/js/utils/CommonViewFunction.js
@@ -43,7 +43,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
skipDefaultError: true,
success: function(data) {
Utils.notifySuccess({
- content: "Tag " + options.tagName + Messages.removeSuccessMessage
+ content: "Classification " + options.tagName + Messages.removeSuccessMessage
});
if (options.callback) {
options.callback();
@@ -285,7 +285,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
queryArray.push(typeKeyValue)
}
if (value.tag) {
- var tagKeyValue = '<span class="key">Tag:</span> <span class="value">' + _.escape(value.tag) + '</span>';
+ var tagKeyValue = '<span class="key">Classification:</span> <span class="value">' + _.escape(value.tag) + '</span>';
if (tagFilters) {
tagKeyValue += ' <span class="operator">AND</span> (<span class="operator">' + tagFilters.condition + '</span> (' + objToString(tagFilters) + '))';
}
http://git-wip-us.apache.org/repos/asf/atlas/blob/eecff698/dashboardv2/public/js/utils/Enums.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/utils/Enums.js b/dashboardv2/public/js/utils/Enums.js
index a7b9a8b..5357fd9 100644
--- a/dashboardv2/public/js/utils/Enums.js
+++ b/dashboardv2/public/js/utils/Enums.js
@@ -25,9 +25,9 @@ define(['require'], function(require) {
ENTITY_CREATE: "Entity Created",
ENTITY_UPDATE: "Entity Updated",
ENTITY_DELETE: "Entity Deleted",
- TAG_ADD: "Tag Added",
- TAG_DELETE: "Tag Deleted",
- TAG_UPDATE: "Tag Updated",
+ TAG_ADD: "Classification Added",
+ TAG_DELETE: "Classification Deleted",
+ TAG_UPDATE: "Classification Updated",
ENTITY_IMPORT_CREATE: "Entity Created by import",
ENTITY_IMPORT_UPDATE: "Entity Updated by import",
ENTITY_IMPORT_DELETE: "Entity Deleted by import"
http://git-wip-us.apache.org/repos/asf/atlas/blob/eecff698/dashboardv2/public/js/utils/Messages.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/utils/Messages.js b/dashboardv2/public/js/utils/Messages.js
index 44604cf..1c733ff 100644
--- a/dashboardv2/public/js/utils/Messages.js
+++ b/dashboardv2/public/js/utils/Messages.js
@@ -23,20 +23,20 @@ define(['require'], function(require) {
defaultErrorMessage: "Something went wrong",
addSuccessMessage: " has been created successfully",
addErrorMessage: " could not be Created",
- removeTag: "Remove Tag Assignment",
+ removeTag: "Remove Classification Assignment",
deleteSuccessMessage: " has been deleted successfully",
deleteErrorMessage: " could not be deleted",
removeSuccessMessage: " has been removed successfully",
removeErrorMessage: " could not be removed",
editSuccessMessage: " has been updated successfully",
- assignDeletedEntity: " is deleted, tag cannot be assigned",
+ assignDeletedEntity: " is deleted, Classification cannot be assigned",
conformation: {
deleteMessage: "Are you sure you want to delete "
},
search: {
noRecordForPage: "No record found at ",
onSamePage: "You are on the same page!",
- notExists: "Invalid Expression or Tag/Type has been deleted.",
+ notExists: "Invalid Expression or Classification/Type has been deleted.",
favoriteSearch: {
save: "Do you want to overwrite ",
notSelectedFavoriteElement: "Please select any one favorite search",
@@ -44,8 +44,8 @@ define(['require'], function(require) {
}
},
tag: {
- addAttributeSuccessMessage: "Tag attribute is added successfully",
- updateTagDescriptionMessage: "Tag description is updated successfully"
+ addAttributeSuccessMessage: "Classification attribute is added successfully",
+ updateTagDescriptionMessage: "Classification description is updated successfully"
}
};
return Messages;
http://git-wip-us.apache.org/repos/asf/atlas/blob/eecff698/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js b/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js
index 802f6a4..19ac222 100644
--- a/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js
+++ b/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js
@@ -50,6 +50,7 @@ define(['require',
/** ui selector cache */
ui: {
tagClick: '[data-id="tagClick"]',
+ propagatedTagDiv: '[data-id="propagatedTagDiv"]',
title: '[data-id="title"]',
editButton: '[data-id="editButton"]',
editButtonContainer: '[data-id="editButtonContainer"]',
@@ -59,6 +60,7 @@ define(['require',
backButton: "[data-id='backButton']",
addTag: '[data-id="addTag"]',
tagList: '[data-id="tagList"]',
+ propagatedTagList: '[data-id="propagatedTagList"]',
fullscreenPanel: "#fullscreen_panel"
},
templateHelpers: function() {
@@ -302,12 +304,27 @@ define(['require',
},
generateTag: function(tagObject) {
var that = this,
- tagData = "";
+ tagData = "",
+ propagatedTagListData = "",
+ tag = {
+ 'self': [],
+ 'propagated': []
+ };
_.each(tagObject, function(val) {
- tagData += '<span class="btn btn-action btn-sm btn-icon btn-blue" data-id="tagClick"><span>' + val.typeName + '</span><i class="fa fa-close" data-id="deleteTag" data-type="tag"></i></span>';
+ val.entityGuid === that.id ? tag['self'].push(val) : tag['propagated'].push(val);
});
+ _.each(tag.self, function(val) {
+ tagData += '<span class="btn btn-action btn-sm btn-icon btn-blue" title=' + val.typeName + ' data-id="tagClick"><span>' + val.typeName + '</span><i class="fa fa-close" data-id="deleteTag" data-type="tag" title="Delete Tag"></i></span>';
+ });
+ _.each(tag.propagated, function(val) {
+ propagatedTagListData += '<span class="btn btn-action btn-sm btn-icon btn-blue" title=' + val.typeName + ' data-id="tagClick"><span>' + val.typeName + '</span></span>';
+ });
+ propagatedTagListData !== "" ? this.ui.propagatedTagDiv.show() : this.ui.propagatedTagDiv.hide();
this.ui.tagList.find("span.btn").remove();
+ this.ui.propagatedTagList.find("span.btn").remove();
this.ui.tagList.prepend(tagData);
+ this.ui.propagatedTagList.html(propagatedTagListData);
+
},
hideLoader: function() {
Utils.hideTitleLoader(this.$('.page-title .fontLoader'), this.$('.entityDetail'));
@@ -318,19 +335,23 @@ define(['require',
onClickAddTagBtn: function(e) {
var that = this;
require(['views/tag/AddTagModalView'], function(AddTagModalView) {
- var view = new AddTagModalView({
- guid: that.id,
- tagList: _.map(that.entityObject.entity.classifications, function(obj) {
- return obj.typeName;
- }),
- callback: function() {
- that.fetchCollection();
- },
- showLoader: that.showLoader.bind(that),
- hideLoader: that.hideLoader.bind(that),
- collection: that.classificationDefCollection,
- enumDefCollection: that.enumDefCollection
- });
+ var tagList = [];
+ _.map(that.entityObject.entity.classifications, function(obj) {
+ if (obj.entityGuid === that.id) {
+ tagList.push(obj.typeName);
+ }
+ });
+ var view = new AddTagModalView({
+ guid: that.id,
+ tagList: tagList,
+ callback: function() {
+ that.fetchCollection();
+ },
+ showLoader: that.showLoader.bind(that),
+ hideLoader: that.hideLoader.bind(that),
+ collection: that.classificationDefCollection,
+ enumDefCollection: that.enumDefCollection
+ });
view.modal.on('ok', function() {
Utils.showTitleLoader(that.$('.page-title .fontLoader'), that.$('.entityDetail'));
});
http://git-wip-us.apache.org/repos/asf/atlas/blob/eecff698/dashboardv2/public/js/views/search/SearchResultLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/search/SearchResultLayoutView.js b/dashboardv2/public/js/views/search/SearchResultLayoutView.js
index 86520c9..28d1124 100644
--- a/dashboardv2/public/js/views/search/SearchResultLayoutView.js
+++ b/dashboardv2/public/js/views/search/SearchResultLayoutView.js
@@ -779,7 +779,7 @@ define(['require',
col = options.col;
if (col) {
col['tag'] = {
- label: "Tags",
+ label: "Classifications",
cell: "Html",
editable: false,
sortable: false,
http://git-wip-us.apache.org/repos/asf/atlas/blob/eecff698/dashboardv2/public/js/views/tag/AddTagModalView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/tag/AddTagModalView.js b/dashboardv2/public/js/views/tag/AddTagModalView.js
index d1c8c67..43bb7dd 100644
--- a/dashboardv2/public/js/views/tag/AddTagModalView.js
+++ b/dashboardv2/public/js/views/tag/AddTagModalView.js
@@ -18,6 +18,7 @@
define(['require',
'hbs!tmpl/tag/AddTagModalView_tmpl',
+ 'views/tag/AddTimezoneItemView',
'collection/VTagList',
'collection/VCommonList',
'modules/Modal',
@@ -26,26 +27,61 @@ define(['require',
'utils/UrlLinks',
'utils/Enums',
'utils/Messages',
+ 'moment',
+ 'moment-timezone',
'daterangepicker'
-], function(require, AddTagModalViewTmpl, VTagList, VCommonList, Modal, VEntity, Utils, UrlLinks, Enums, Messages) {
+], function(require, AddTagModalViewTmpl, AddTimezoneItemView, VTagList, VCommonList, Modal, VEntity, Utils, UrlLinks, Enums, Messages, moment) {
'use strict';
- var AddTagModel = Marionette.LayoutView.extend({
+ var AddTagModel = Backbone.Marionette.CompositeView.extend({
template: AddTagModalViewTmpl,
templateHelpers: function() {
return {
tagModel: this.tagModel
};
},
-
+ childView: AddTimezoneItemView,
+ childViewOptions: function() {
+ return {
+ // saveButton: this.ui.saveButton,
+ parentView: this,
+ tagModel: this.tagModel
+ };
+ },
+ childViewContainer: "[data-id='addTimezoneDiv']",
regions: {},
ui: {
addTagOptions: "[data-id='addTagOptions']",
- tagAttribute: "[data-id='tagAttribute']"
+ tagAttribute: "[data-id='tagAttribute']",
+ togglepropagated: "input[name='togglePropagated']",
+ checkTimeZone: "[data-id='checkTimezoneProperty']",
+ timeZoneDiv: "[data-id='timeZoneDiv']",
+ checkTagModalPropagate: "[data-id='checkModalTagProperty']",
+ addTimezoneParms: "[data-id='addTimezoneParms']",
+ validityPeriodBody: "[data-id='validityPeriodBody']"
},
events: function() {
var events = {};
events["change " + this.ui.addTagOptions] = 'onChangeTagDefination';
+ events["change " + this.ui.togglepropagated] = 'checkPropagtedTag';
+ events["change " + this.ui.checkTimeZone] = function(e) {
+ if (e.target.checked) {
+ this.ui.timeZoneDiv.show();
+ this.ui.validityPeriodBody.show();
+ if (_.isEmpty(this.collection.models)) {
+ this.collection.add(new Backbone.Model({
+ "startTime": "",
+ "endTime": "",
+ "timeZone": ""
+ }));
+ }
+ } else {
+ this.ui.timeZoneDiv.hide();
+ this.ui.validityPeriodBody.hide();
+ }
+ };
+ events["change " + this.ui.checkTagModalPropagate] = 'checkTagModalPropagate';
+ events["click " + this.ui.addTimezoneParms] = 'addTimezoneBtn'
return events;
},
/**
@@ -53,21 +89,29 @@ define(['require',
* @constructs
*/
initialize: function(options) {
- _.extend(this, _.pick(options, 'collection', 'modalCollection', 'guid', 'callback', 'multiple', 'showLoader', 'hideLoader', 'tagList', 'tagModel', 'enumDefCollection'));
+ _.extend(this, _.pick(options, 'modalCollection', 'guid', 'callback', 'multiple', 'showLoader', 'hideLoader', 'tagList', 'tagModel', 'enumDefCollection'));
this.commonCollection = new VTagList();
+ if (this.tagModel) {
+ this.collection = new Backbone.Collection(this.tagModel.validityPeriods);
+ } else {
+ this.collection = new Backbone.Collection();
+ }
+ this.tagCollection = options.collection;
var that = this,
modalObj = {
- title: 'Add Tag',
+ title: 'Add Classification',
content: this,
okText: 'Add',
cancelText: "Cancel",
+ mainClass: 'modal-lg',
allowCancel: true,
};
if (this.tagModel) {
- modalObj.title = 'Edit Tag';
+ modalObj.title = 'Edit Classification';
modalObj.okText = 'Update';
}
- this.modal = new Modal(modalObj).open();
+ this.modal = new Modal(modalObj)
+ this.modal.open();
this.modal.$el.find('button.ok').attr("disabled", true);
this.on('ok', function() {
var tagName = this.tagModel ? this.tagModel.typeName : this.ui.addTagOptions.val(),
@@ -183,17 +227,34 @@ define(['require',
onRender: function() {
var that = this;
- this.hideAttributeBox();
+ this.propagate,
+ this.hideAttributeBox();
this.tagsCollection();
if (this.tagModel) {
this.fetchTagSubData(that.tagModel.typeName);
+ that.ui.checkTagModalPropagate.prop('checked', this.tagModel.propagate === true ? true : false);
+ that.ui.checkTimeZone.prop('checked', _.isEmpty(this.tagModel.validityPeriods) ? false : true);
+ if (_.isEmpty(this.tagModel.validityPeriods)) {
+ that.ui.timeZoneDiv.hide()
+ } else {
+ that.ui.timeZoneDiv.show();
+ }
+ that.checkTimezoneProperty(that.ui.checkTimeZone[0]);
}
that.showAttributeBox();
},
+ addTimezoneBtn: function() {
+ this.ui.validityPeriodBody.show();
+ this.collection.add(new Backbone.Model({
+ "startTime": "",
+ "endTime": "",
+ "timeZone": ""
+ }));
+ },
bindEvents: function() {
var that = this;
this.enumArr = [];
- this.listenTo(this.collection, 'reset', function() {
+ this.listenTo(this.tagCollection, 'reset', function() {
this.tagsCollection();
}, this);
this.listenTo(this.commonCollection, 'reset', function() {
@@ -202,8 +263,8 @@ define(['require',
},
tagsCollection: function() {
var that = this,
- str = '<option selected="selected" disabled="disabled">-- Select a tag from the dropdown list --</option>';
- this.collection.fullCollection.each(function(obj, key) {
+ str = '<option selected="selected" disabled="disabled">-- Select a Classification from the dropdown list --</option>';
+ this.tagCollection.fullCollection.each(function(obj, key) {
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.
if (_.indexOf(that.tagList, obj.get('name')) === -1) {
@@ -227,14 +288,15 @@ define(['require',
},
fetchTagSubData: function(tagname) {
var attributeDefs = Utils.getNestedSuperTypeObj({
- data: this.collection.fullCollection.find({ name: tagname }).toJSON(),
- collection: this.collection,
+ data: this.tagCollection.fullCollection.find({ name: tagname }).toJSON(),
+ collection: this.tagCollection,
attrMerge: true
});
this.subAttributeData(attributeDefs);
},
showAttributeBox: function() {
- var that = this;
+ var that = this,
+ isButtonactive;
this.$('.attrLoader').hide();
this.$('.form-group.hide').removeClass('hide');
if (this.ui.tagAttribute.children().length !== 0) {
@@ -242,10 +304,21 @@ define(['require',
}
this.ui.tagAttribute.find('input,select').on("keyup change", function(e) {
if (e.keyCode != 32) {
- that.modal.$el.find('button.ok').attr("disabled", false);
+ that.buttonActive({ isButtonActive: true });
+ }
+ });
+ this.ui.checkTagModalPropagate.on('change', function(e) {
+ if (that.tagModel) {
+ that.buttonActive({ isButtonActive: true });
}
});
},
+ buttonActive: function(option) {
+ if (option && option.isButtonActive) {
+ var isButton = option.isButtonActive;
+ this.modal.$el.find('button.ok').attr("disabled", isButton === true ? false : true);
+ }
+ },
hideAttributeBox: function() {
this.ui.tagAttribute.children().empty();
this.ui.tagAttribute.parent().hide();
@@ -314,22 +387,51 @@ define(['require',
}
},
+ checkPropagtedTag: function(e) {
+ if (!this.ui.togglepropagated.prop('checked')) {
+ this.propagate = true;
+ } else {
+ this.propagate = false;
+ }
+
+ },
+ checkTimezoneProperty: function(e) {
+ if (e.checked) {
+ this.ui.timeZoneDiv.show();
+ this.ui.validityPeriodBody.show();
+ } else {
+ this.ui.timeZoneDiv.hide();
+ this.ui.validityPeriodBody.hide();
+ }
+ },
+ checkTagModalPropagate: function(e) {
+ if (e.target.checked) {
+ this.propagate = true;
+ } else {
+ this.propagate = false;
+ }
+ },
saveTagData: function(options) {
var that = this;
this.entityModel = new VEntity();
var tagName = options.tagName,
tagAttributes = options.tagAttributes,
+ validityPeriodVal = that.ui.checkTimeZone.is(':checked') ? that.collection.toJSON() : [],
json = {
"classification": {
"typeName": tagName,
- "attributes": tagAttributes
+ "attributes": tagAttributes,
+ "propagate": _.isUndefined(that.propagate) ? true : that.propagate,
+ "validityPeriods": validityPeriodVal
},
"entityGuids": options.guid
};
if (this.tagModel) {
json = [{
"typeName": tagName,
- "attributes": tagAttributes
+ "attributes": tagAttributes,
+ "propagate": _.isUndefined(that.propagate) ? true : that.propagate,
+ "validityPeriods": validityPeriodVal
}]
}
if (this.showLoader) {
http://git-wip-us.apache.org/repos/asf/atlas/blob/eecff698/dashboardv2/public/js/views/tag/AddTimezoneItemView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/tag/AddTimezoneItemView.js b/dashboardv2/public/js/views/tag/AddTimezoneItemView.js
new file mode 100644
index 0000000..015bb51
--- /dev/null
+++ b/dashboardv2/public/js/views/tag/AddTimezoneItemView.js
@@ -0,0 +1,137 @@
+/*
+ * 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/tag/AddTimezoneView_tmpl',
+ 'moment',
+ 'moment-timezone',
+ 'daterangepicker'
+], function(require, Backbone, AddTimezoneViewTmpl, moment) {
+ 'use strict';
+
+ return Backbone.Marionette.ItemView.extend(
+ /** @lends GlobalExclusionListView */
+ {
+
+ template: AddTimezoneViewTmpl,
+
+ /** Layout sub regions */
+ regions: {},
+
+ /** ui selector cache */
+ ui: {
+ close: "[data-id='close']",
+ startTime: 'input[name="startTime"]',
+ endTime: 'input[name="endTime"]',
+ timeZone: '[data-id="timeZone"]'
+ },
+ /** ui events hash */
+ events: function() {
+ var events = {};
+ events["change " + this.ui.startTime] = function(e) {
+ this.model.set({ "startTime": this.ui.startTime.val() });
+ this.buttonActive({ isButtonActive: true });
+ };
+ events["change " + this.ui.endTime] = function(e) {
+ this.model.set({ "endTime": this.ui.endTime.val() });
+ this.buttonActive({ isButtonActive: true });
+ };
+ events["change " + this.ui.timeZone] = function(e) {
+ this.model.set({ "timeZone": this.ui.timeZone.val() });
+ this.buttonActive({ isButtonActive: true });
+ };
+ events["click " + this.ui.close] = 'onCloseButton';
+ return events;
+ },
+
+ /**
+ * intialize a new GlobalExclusionComponentView Layout
+ * @constructs
+ */
+ initialize: function(options) {
+ _.extend(this, _.pick(options, 'parentView', 'model', 'tagModel'));
+ },
+ onRender: function() {
+ var that = this,
+ dateObj = {
+ "singleDatePicker": true,
+ "showDropdowns": true,
+ "timePicker": true,
+ "startDate": new Date(),
+ "timePickerIncrement": 30,
+ "locale": {
+ format: 'YYYY/MM/DD HH:MM:SS'
+ }
+ },
+ tzstr = '<option selected="selected" disabled="disabled">-- Select Timezone --</option>';
+
+ if (this.model.get('startTime') !== "") {
+ this.ui.startTime.daterangepicker({
+ "singleDatePicker": true,
+ "showDropdowns": true,
+ "timePicker": true,
+ "startDate": this.model.get('startTime'),
+ "timePickerIncrement": 30,
+ "locale": {
+ format: 'YYYY/MM/DD HH:MM:SS'
+ }
+ });
+ this.ui.endTime.daterangepicker({
+ "singleDatePicker": true,
+ "showDropdowns": true,
+ "timePicker": true,
+ "startDate": this.model.get('endTime'),
+ "timePickerIncrement": 30,
+ "locale": {
+ format: 'YYYY/MM/DD HH:MM:SS'
+ }
+ });
+ this.ui.timeZone.select2({
+ data: moment.tz.names()
+ });
+ this.ui.timeZone.val(this.model.get('timeZone')).trigger("change", { 'manual': true });
+ } else {
+ this.ui.startTime.daterangepicker(dateObj);
+ this.ui.endTime.daterangepicker(dateObj);
+ this.ui.timeZone.html(tzstr);
+ this.ui.timeZone.select2({
+ placeholder: "Select TimeZone",
+ allowClear: true,
+ data: moment.tz.names()
+ });
+ }
+ },
+ buttonActive: function(option) {
+ var that = this;
+ if (option && option.isButtonActive && that.tagModel) {
+ var isButton = option.isButtonActive;
+ this.parentView.modal.$el.find('button.ok').attr("disabled", isButton === true ? false : true);
+ }
+ },
+ onCloseButton: function() {
+ if (this.parentView.collection.models.length > 0) {
+ this.model.destroy();
+ }
+ if (this.parentView.collection.models.length <= 0) {
+ this.parentView.ui.timeZoneDiv.hide();
+ this.parentView.ui.checkTimeZone.prop('checked',false);
+ this.parentView.modal.$el.find('button.ok').attr("disabled",true);
+ }
+ }
+ });
+});
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/atlas/blob/eecff698/dashboardv2/public/js/views/tag/CreateTagLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/tag/CreateTagLayoutView.js b/dashboardv2/public/js/views/tag/CreateTagLayoutView.js
index e43a431..c9c7b74 100644
--- a/dashboardv2/public/js/views/tag/CreateTagLayoutView.js
+++ b/dashboardv2/public/js/views/tag/CreateTagLayoutView.js
@@ -109,7 +109,7 @@ define(['require',
if (platform.name === "IE") {
that.ui.parentTag.select2({
multiple: true,
- placeholder: "Search Tags",
+ placeholder: "Search Classification",
allowClear: true
});
}
http://git-wip-us.apache.org/repos/asf/atlas/blob/eecff698/dashboardv2/public/js/views/tag/TagAttributeDetailLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/tag/TagAttributeDetailLayoutView.js b/dashboardv2/public/js/views/tag/TagAttributeDetailLayoutView.js
index 3d6b859..8018141 100644
--- a/dashboardv2/public/js/views/tag/TagAttributeDetailLayoutView.js
+++ b/dashboardv2/public/js/views/tag/TagAttributeDetailLayoutView.js
@@ -292,7 +292,7 @@ define(['require',
], function(CreateTagLayoutView, Modal) {
var view = new CreateTagLayoutView({ 'tagCollection': that.collection, 'model': that.model, 'tag': that.tag, 'enumDefCollection': enumDefCollection });
that.modal = new Modal({
- title: 'Edit Tag',
+ title: 'Edit Classification',
content: view,
cancelText: "Cancel",
okText: 'Save',
http://git-wip-us.apache.org/repos/asf/atlas/blob/eecff698/dashboardv2/public/js/views/tag/TagDetailTableLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/tag/TagDetailTableLayoutView.js b/dashboardv2/public/js/views/tag/TagDetailTableLayoutView.js
index c05b48d..2296dad 100644
--- a/dashboardv2/public/js/views/tag/TagDetailTableLayoutView.js
+++ b/dashboardv2/public/js/views/tag/TagDetailTableLayoutView.js
@@ -44,6 +44,8 @@ define(['require',
addTag: "[data-id='addTag']",
deleteTag: "[data-id='delete']",
editTag: "[data-id='edit']",
+ checkPropagtedTag: "[data-id='checkPropagtedTag']",
+ propagatedFromClick: "[data-id='propagatedFromClick']"
},
/** ui events hash */
events: function() {
@@ -57,6 +59,14 @@ define(['require',
events["click " + this.ui.editTag] = function(e) {
this.editTagDataModal(e);
};
+ events["click " + this.ui.propagatedFromClick] = function(e) {
+ Utils.setUrl({
+ url: '#!/detailPage/' + e.currentTarget.dataset.guid,
+ mergeBrowserUrl: false,
+ trigger: true
+ });
+ };
+ events["click " + this.ui.checkPropagtedTag] = 'onCheckPropagtedTag';
return events;
},
/**
@@ -97,19 +107,24 @@ define(['require',
})));
});
},
- getSchemaTableColumns: function() {
- var that = this;
- var col = {};
+ getSchemaTableColumns: function(options) {
+ var that = this,
+ col = {};
return this.tagCollection.constructor.getTableCols({
tag: {
- label: "Tags",
- cell: "String",
+ label: "Classification",
+ cell: "html",
editable: false,
sortable: false,
formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
fromRaw: function(rawValue, model) {
- return model.get('typeName');
+ if (that.guid !== model.get('entityGuid') ) {
+ var propagtedFrom = ' <span class="btn btn-action btn-sm btn-icon btn-blue" title="Propagated From" data-guid='+ model.get('entityGuid') +' data-id="propagatedFromClick"><span> Propagated From </span></span>';
+ return '<a title="" href="#!/tag/tagAttribute/' + model.get('typeName') + '">' + model.get('typeName') + '</a>' + propagtedFrom;
+ } else {
+ return '<a title="' + model.get('typeName') + '" href="#!/tag/tagAttribute/' + model.get('typeName') + '">' + model.get('typeName') + '</a>';
+ }
}
})
},
@@ -145,7 +160,7 @@ define(['require',
})
},
tool: {
- label: "Tool",
+ label: "Action",
cell: "html",
editable: false,
sortable: false,
@@ -154,12 +169,11 @@ define(['require',
var deleteData = '<button title="Delete" class="btn btn-action btn-sm" data-id="delete" data-name="' + model.get('typeName') + '"><i class="fa fa-trash"></i></button>',
editData = '<button title="Edit" class="btn btn-action btn-sm" data-id="edit" data-name="' + model.get('typeName') + '"><i class="fa fa-pencil"></i></button>',
btnObj = null;
- if (model.get('attributes') === undefined) {
- btnObj = deleteData;
+ if (that.guid === model.get('entityGuid')) {
+ return '<div class="btn-inline">' + deleteData + editData + '</div>'
} else {
- btnObj = deleteData + editData;
+ return;
}
- return '<div class="btn-inline">' + btnObj + '</div>'
}
})
},
@@ -233,6 +247,20 @@ define(['require',
'enumDefCollection': that.enumDefCollection
});
});
+ },
+ onCheckPropagtedTag: function(e) {
+ var that = this,
+ tags = _.toArray(that.collectionObject.classifications),
+ unPropagatedTags = [];
+ e.stopPropagation();
+ if (e.target.checked) {
+ that.tagCollection.reset(tags);
+ } else {
+ unPropagatedTags = _.filter(tags,function(val){
+ return that.guid === val.entityGuid;
+ });
+ that.tagCollection.reset(unPropagatedTags);
+ }
}
});
return TagDetailTableLayoutView;
http://git-wip-us.apache.org/repos/asf/atlas/blob/eecff698/dashboardv2/public/js/views/tag/TagLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/tag/TagLayoutView.js b/dashboardv2/public/js/views/tag/TagLayoutView.js
index 0edb378..7969041 100644
--- a/dashboardv2/public/js/views/tag/TagLayoutView.js
+++ b/dashboardv2/public/js/views/tag/TagLayoutView.js
@@ -124,7 +124,7 @@ define(['require',
});
that.ui.treeLov.html(treeStr);
that.ui.treeLov.select2({
- placeholder: "Search tag",
+ placeholder: "Search Classification",
allowClear: true
});
},
@@ -349,7 +349,7 @@ define(['require',
var name = (!(nodeName == "BUTTON") ? that.query[that.viewType].tagName : null);
var view = new CreateTagLayoutView({ 'tagCollection': that.collection, 'selectedTag': name, 'enumDefCollection': enumDefCollection }),
modal = new Modal({
- title: 'Create a new tag',
+ title: 'Create a new classification',
content: view,
cancelText: "Cancel",
okCloses: false,
@@ -368,7 +368,7 @@ define(['require',
modal.on('shownModal', function() {
view.ui.parentTag.select2({
multiple: true,
- placeholder: "Search Tags",
+ placeholder: "Search Classification",
allowClear: true
});
});
@@ -493,7 +493,7 @@ define(['require',
that.collection.fullCollection.add(classificationDefs);
that.setUrl('#!/tag/tagAttribute/' + ref.ui.tagName.val(), true);
Utils.notifySuccess({
- content: "Tag " + that.name + Messages.addSuccessMessage
+ content: "Classification " + that.name + Messages.addSuccessMessage
});
modal.trigger('cancel');
that.typeHeaders.fetch({ reset: true });
@@ -529,9 +529,9 @@ define(['require',
popoverOptions: {
content: function() {
return "<ul>" +
- "<li class='listTerm' ><i class='fa fa-search'></i> <a href='javascript:void(0)' data-fn='onSearchTag'>Search Tag</a></li>" +
- "<li class='listTerm' ><i class='fa fa-plus'></i> <a href='javascript:void(0)' data-fn='onClickCreateTag'>Create Sub-tag</a></li>" +
- "<li class='listTerm' ><i class='fa fa-trash-o'></i> <a href='javascript:void(0)' data-fn='onDeleteTag'>Delete Tag</a></li>" +
+ "<li class='listTerm' ><i class='fa fa-search'></i> <a href='javascript:void(0)' data-fn='onSearchTag'>Search Classification</a></li>" +
+ "<li class='listTerm' ><i class='fa fa-plus'></i> <a href='javascript:void(0)' data-fn='onClickCreateTag'>Create Sub-classification</a></li>" +
+ "<li class='listTerm' ><i class='fa fa-trash-o'></i> <a href='javascript:void(0)' data-fn='onDeleteTag'>Delete Classification</a></li>" +
"</ul>";
}
}
@@ -563,7 +563,7 @@ define(['require',
},
cancel: function(argument) {}
}
- var text = "Are you sure you want to delete the tag"
+ var text = "Are you sure you want to delete the classification"
notifyObj['text'] = text;
Utils.notifyConfirm(notifyObj);
},
@@ -581,7 +581,7 @@ define(['require',
data: JSON.stringify(deleteJson),
success: function() {
Utils.notifySuccess({
- content: "Tag " + that.tag + Messages.deleteSuccessMessage
+ content: "Classification " + that.tag + Messages.deleteSuccessMessage
});
// if deleted tag is prviously searched then remove that tag url from save state of tab.
var searchUrl = Globals.saveApplicationState.tabState.searchUrl;