You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by ni...@apache.org on 2017/05/26 10:20:27 UTC
[1/5] incubator-atlas git commit: ATLAS-1810 : UI : Audit details of
any tag event (Added, Updated) has only tag name and event.
Repository: incubator-atlas
Updated Branches:
refs/heads/master d0e48cfd4 -> e75984c48
ATLAS-1810 : UI : Audit details of any tag event (Added,Updated) has only tag name and event.
Signed-off-by: nixonrodrigues <ni...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/e483712b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/e483712b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/e483712b
Branch: refs/heads/master
Commit: e483712bd5964493f94a3dc0f679f250da740d64
Parents: d0e48cf
Author: Kalyani <ka...@freestoneinfotech.com>
Authored: Fri May 19 19:11:00 2017 +0530
Committer: nixonrodrigues <ni...@apache.org>
Committed: Fri May 26 15:45:09 2017 +0530
----------------------------------------------------------------------
.../audit/CreateAuditTableLayoutView_tmpl.html | 1 +
.../public/js/utils/CommonViewFunction.js | 169 +++++++++++--------
dashboardv2/public/js/utils/Utils.js | 16 +-
.../views/audit/CreateAuditTableLayoutView.js | 17 +-
.../views/entity/EntityDetailTableLayoutView.js | 2 +-
5 files changed, 119 insertions(+), 86 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/e483712b/dashboardv2/public/js/templates/audit/CreateAuditTableLayoutView_tmpl.html
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/templates/audit/CreateAuditTableLayoutView_tmpl.html b/dashboardv2/public/js/templates/audit/CreateAuditTableLayoutView_tmpl.html
index 52a0919..fc8e6cc 100644
--- a/dashboardv2/public/js/templates/audit/CreateAuditTableLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/audit/CreateAuditTableLayoutView_tmpl.html
@@ -14,6 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
-->
+<h4>Name: <span data-id="tagHeader"></span></h4>
<table class="table table-bordered table-striped" data-id="tableAudit">
<thead>
<tr data-id="auditHeaderValue">
http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/e483712b/dashboardv2/public/js/utils/CommonViewFunction.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/utils/CommonViewFunction.js b/dashboardv2/public/js/utils/CommonViewFunction.js
index e49d2b7..de46667 100644
--- a/dashboardv2/public/js/utils/CommonViewFunction.js
+++ b/dashboardv2/public/js/utils/CommonViewFunction.js
@@ -88,7 +88,12 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
}
});
}
- CommonViewFunction.propertyTable = function(scope, valueObject, entityDef) {
+ CommonViewFunction.propertyTable = function(options) {
+ var scope = options.scope,
+ valueObject = options.valueObject,
+ extractJSON = options.extractJSON,
+ entityDef = options.entityDef;
+
var table = "",
fetchInputOutputValue = function(id) {
var that = this;
@@ -117,92 +122,110 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
},
complete: function() {}
});
- }
- _.sortBy(_.keys(valueObject)).map(function(key) {
- key = _.escape(key)
- var keyValue = valueObject[key],
- valueOfArray = [];
- var defEntity = _.find(entityDef, { name: key });
- if (defEntity) {
- var defEntityType = defEntity.typeName.toLocaleLowerCase();
- if (defEntityType === 'date' || defEntityType === 'time') {
- table += '<tr><td>' + _.escape(key) + '</td><td>' + new Date(keyValue) + '</td></tr>';
- } else if (_.isObject(keyValue)) {
- if (!_.isArray(keyValue) && _.isObject(keyValue)) {
- keyValue = [keyValue];
+ },
+ extractObject = function(keyValue) {
+ var valueOfArray = [];
+ if (!_.isArray(keyValue) && _.isObject(keyValue)) {
+ keyValue = [keyValue];
+ }
+ var subLink = "";
+ for (var i = 0; i < keyValue.length; i++) {
+ var inputOutputField = keyValue[i],
+ id = inputOutputField.guid || (_.isObject(inputOutputField.id) ? inputOutputField.id.id : inputOutputField.id),
+ tempLink = "",
+ status = inputOutputField.status || (_.isObject(inputOutputField.id) ? inputOutputField.id.state : inputOutputField.state),
+ readOnly = Enums.entityStateReadOnly[status];
+ if (!inputOutputField.attributes && inputOutputField.values) {
+ inputOutputField['attributes'] = inputOutputField.values;
}
- var subLink = "";
- for (var i = 0; i < keyValue.length; i++) {
- var inputOutputField = keyValue[i],
- id = inputOutputField.guid || (_.isObject(inputOutputField.id) ? inputOutputField.id.id : inputOutputField.id),
- tempLink = "",
- status = inputOutputField.status || (_.isObject(inputOutputField.id) ? inputOutputField.id.state : inputOutputField.state),
- readOnly = Enums.entityStateReadOnly[status];
- if (!inputOutputField.attributes && inputOutputField.values) {
- inputOutputField['attributes'] = inputOutputField.values;
+ if (_.isString(inputOutputField) || _.isBoolean(inputOutputField) || _.isNumber(inputOutputField)) {
+ var tempVarfor$check = inputOutputField.toString();
+ if (tempVarfor$check.indexOf("$") == -1) {
+ valueOfArray.push('<span>' + _.escape(inputOutputField) + '</span>');
}
- if (_.isString(inputOutputField) || _.isBoolean(inputOutputField) || _.isNumber(inputOutputField)) {
- var tempVarfor$check = inputOutputField.toString();
- if (tempVarfor$check.indexOf("$") == -1) {
- valueOfArray.push('<span>' + _.escape(inputOutputField) + '</span>');
+ } else if (_.isObject(inputOutputField) && !id) {
+ var attributesList = inputOutputField;
+ if (scope.typeHeaders && inputOutputField.typeName) {
+ var typeNameCategory = scope.typeHeaders.fullCollection.findWhere({ name: inputOutputField.typeName });
+ if (attributesList.attributes && typeNameCategory && typeNameCategory.get('category') === 'STRUCT') {
+ attributesList = attributesList.attributes;
}
- } else if (_.isObject(inputOutputField) && !id) {
- var attributesList = inputOutputField;
- if (scope.typeHeaders && inputOutputField.typeName) {
- var typeNameCategory = scope.typeHeaders.fullCollection.findWhere({ name: inputOutputField.typeName });
- if (attributesList.attributes && typeNameCategory && typeNameCategory.get('category') === 'STRUCT') {
- attributesList = attributesList.attributes;
+ }
+ _.each(attributesList, function(objValue, objKey) {
+ var value = objValue,
+ tempVarfor$check = objKey.toString();
+ if (tempVarfor$check.indexOf("$") == -1) {
+ if (_.isObject(value)) {
+ value = JSON.stringify(value);
}
- }
- _.each(attributesList, function(objValue, objKey) {
- var value = objValue,
- tempVarfor$check = objKey.toString();
- if (tempVarfor$check.indexOf("$") == -1) {
- if (_.isObject(value)) {
- value = JSON.stringify(value);
+ if (extractJSON) {
+ if (extractJSON && extractJSON.extractKey) {
+ if (_.isObject(extractJSON.extractKey)) {
+ _.each(extractJSON.extractKey, function(extractKey) {
+ if (objKey === extractKey) {
+ valueOfArray.push('<span>' + _.escape(objKey) + ':' + _.escape(value) + '</span>');
+ }
+ });
+ } else if (_.isString(extractJSON.extractKey) && extractJSON.extractKey === objKey) {
+ valueOfArray.push(_.escape(value));
+ }
}
+ } else {
valueOfArray.push('<span>' + _.escape(objKey) + ':' + _.escape(value) + '</span>');
}
- });
- }
-
- if (id && inputOutputField) {
- var name = Utils.getName(inputOutputField);
- if (name === "-" || name === id) {
- var fetch = true;
- var fetchId = (_.isObject(id) ? id.id : id);
- fetchInputOutputValue(fetchId);
- tempLink += '<div data-id="' + fetchId + '"></div>';
- } else {
- tempLink += '<a href="#!/detailPage/' + id + '">' + name + '</a>'
}
- }
- if (readOnly) {
- if (!fetch) {
- tempLink += '<button title="Deleted" class="btn btn-atlasAction btn-atlas deleteBtn"><i class="fa fa-trash"></i></button>';
- subLink += '<div class="block readOnlyLink">' + tempLink + '</div>';
- } else {
- fetch = false;
- subLink += tempLink;
- }
-
+ });
+ }
+ if (id && inputOutputField) {
+ var name = Utils.getName(inputOutputField);
+ if (name === "-" || name === id) {
+ var fetch = true;
+ var fetchId = (_.isObject(id) ? id.id : id);
+ fetchInputOutputValue(fetchId);
+ tempLink += '<div data-id="' + fetchId + '"></div>';
} else {
- if (tempLink.search('href') != -1) {
- subLink += '<div>' + tempLink + '</div>'
- } else if (tempLink.length) {
- subLink += tempLink
- }
+ tempLink += '<a href="#!/detailPage/' + id + '">' + name + '</a>'
}
}
- if (valueOfArray.length) {
- subLink = valueOfArray.join(', ');
- }
- table += '<tr><td>' + _.escape(key) + '</td><td>' + subLink + '</td></tr>';
+ if (readOnly) {
+ if (!fetch) {
+ tempLink += '<button title="Deleted" class="btn btn-atlasAction btn-atlas deleteBtn"><i class="fa fa-trash"></i></button>';
+ subLink += '<div class="block readOnlyLink">' + tempLink + '</div>';
+ } else {
+ fetch = false;
+ subLink += tempLink;
+ }
- } else {
- table += '<tr><td>' + _.escape(key) + '</td><td>' + _.escape(valueObject[key]) + '</td></tr>';
+ } else {
+ if (tempLink.search('href') != -1) {
+ subLink += '<div>' + tempLink + '</div>'
+ } else if (tempLink.length) {
+ subLink += tempLink
+ }
+ }
+ }
+ if (valueOfArray.length) {
+ subLink = valueOfArray.join(', ');
+ }
+ return subLink;
+ }
+ _.sortBy(_.keys(valueObject)).map(function(key) {
+ key = _.escape(key);
+ var keyValue = valueObject[key];
+ var defEntity = _.find(entityDef, { name: key });
+ if (defEntity && defEntity.typeName) {
+ var defEntityType = defEntity.typeName.toLocaleLowerCase();
+ if (defEntityType === 'date' || defEntityType === 'time') {
+ keyValue = new Date(keyValue);
+ } else if (_.isObject(keyValue)) {
+ keyValue = extractObject(keyValue);
+ }
+ } else {
+ if (_.isObject(keyValue)) {
+ keyValue = extractObject(keyValue)
}
}
+ table += '<tr><td>' + _.escape(key) + '</td><td>' + (_.isObject(valueObject[key]) ? keyValue : _.escape(keyValue)) + '</td></tr>';
});
return table;
}
http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/e483712b/dashboardv2/public/js/utils/Utils.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/utils/Utils.js b/dashboardv2/public/js/utils/Utils.js
index e09220c..1d614a8 100644
--- a/dashboardv2/public/js/utils/Utils.js
+++ b/dashboardv2/public/js/utils/Utils.js
@@ -401,7 +401,13 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'pnotify.button
return returnObj;
}
if (collectionJSON.attributes.id) {
- returnObj.name = _.escape(collectionJSON.attributes.id);
+ if (_.isObject(collectionJSON.attributes.id)) {
+ if (collectionJSON.id.id) {
+ returnObj.name = _.escape(collectionJSON.attributes.id.id);
+ }
+ } else {
+ returnObj.name = _.escape(collectionJSON.attributes.id);
+ }
returnObj.key = 'id';
return returnObj;
}
@@ -427,7 +433,13 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'pnotify.button
return returnObj;
}
if (collectionJSON.id) {
- returnObj.name = _.escape(collectionJSON.id);
+ if (_.isObject(collectionJSON.id)) {
+ if (collectionJSON.id.id) {
+ returnObj.name = _.escape(collectionJSON.id.id);
+ }
+ } else {
+ returnObj.name = _.escape(collectionJSON.id);
+ }
returnObj.key = 'id';
return returnObj;
}
http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/e483712b/dashboardv2/public/js/views/audit/CreateAuditTableLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/audit/CreateAuditTableLayoutView.js b/dashboardv2/public/js/views/audit/CreateAuditTableLayoutView.js
index 3f6be02..34c56cb 100644
--- a/dashboardv2/public/js/views/audit/CreateAuditTableLayoutView.js
+++ b/dashboardv2/public/js/views/audit/CreateAuditTableLayoutView.js
@@ -41,7 +41,8 @@ define(['require',
auditCreate: "[data-id='auditCreate']",
noData: "[data-id='noData']",
tableAudit: "[data-id='tableAudit']",
- auditHeaderValue: "[data-id='auditHeaderValue']"
+ auditHeaderValue: "[data-id='auditHeaderValue']",
+ tagHeader: "[data-id='tagHeader']"
},
/** ui events hash */
events: function() {
@@ -79,13 +80,11 @@ define(['require',
}
}
var values = parseDetailsObject.values;
- if (this.action && (Enums.auditAction.ENTITY_CREATE !== this.action && Enums.auditAction.ENTITY_UPDATE !== this.action) && name) {
- this.ui.auditHeaderValue.html('<th>' + this.action + '</th>');
- this.ui.auditValue.html("<tr><td>" + (name ? name : this.entityName) + "</td></tr>");
- } else if (parseDetailsObject && parseDetailsObject.values) {
+ if (parseDetailsObject && parseDetailsObject.values) {
+ var tagHeader = ((name ? name : this.entityName));
+ this.ui.tagHeader.append(tagHeader);
this.ui.auditHeaderValue.html('<th>Key</th><th>New Value</th>');
- //CommonViewFunction.findAndmergeRefEntity(attributeObject, that.referredEntities);
- table = CommonViewFunction.propertyTable(this, values, this.entityDef);
+ table = CommonViewFunction.propertyTable({ scope: this, valueObject: values, entityDef: this.entityDef, extractJSON: { extractKey: 'value' } });
if (table.length) {
this.ui.noData.hide();
this.ui.tableAudit.show();
@@ -94,9 +93,7 @@ define(['require',
this.ui.noData.show();
this.ui.tableAudit.hide();
}
- }
- } else {
- if (Enums.auditAction.ENTITY_DELETE === this.action) {
+ } else {
this.ui.auditHeaderValue.html('<th>' + this.action + '</th>');
this.ui.auditValue.html("<tr><td>" + (name ? name : this.entityName) + "</td></tr>");
}
http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/e483712b/dashboardv2/public/js/views/entity/EntityDetailTableLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/entity/EntityDetailTableLayoutView.js b/dashboardv2/public/js/views/entity/EntityDetailTableLayoutView.js
index 480305e..79f7807 100644
--- a/dashboardv2/public/js/views/entity/EntityDetailTableLayoutView.js
+++ b/dashboardv2/public/js/views/entity/EntityDetailTableLayoutView.js
@@ -65,7 +65,7 @@ define(['require',
});
attributeObject.columns = valueSorted;
}
- var table = CommonViewFunction.propertyTable(this, attributeObject, this.entityDef);
+ var table = CommonViewFunction.propertyTable({ scope: this, valueObject: attributeObject, entityDef: this.entityDef });
that.ui.detailValue.append(table);
}
});
[3/5] incubator-atlas git commit: ATLAS-1809 : UI : Update button in
Edit tag attributes window should be enabled only when any update is done
Posted by ni...@apache.org.
ATLAS-1809 : UI : Update button in Edit tag attributes window should be enabled only when any update is done
Signed-off-by: nixonrodrigues <ni...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/bd69a4f1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/bd69a4f1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/bd69a4f1
Branch: refs/heads/master
Commit: bd69a4f1c6012c4b1a61594b91458990d5b9a26a
Parents: 363b88c
Author: Kalyani <ka...@freestoneinfotech.com>
Authored: Fri May 19 19:19:51 2017 +0530
Committer: nixonrodrigues <ni...@apache.org>
Committed: Fri May 26 15:47:47 2017 +0530
----------------------------------------------------------------------
.../js/views/entity/CreateEntityLayoutView.js | 24 +++++++++++++-------
.../public/js/views/tag/addTagModalView.js | 13 +++++++----
2 files changed, 25 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/bd69a4f1/dashboardv2/public/js/views/entity/CreateEntityLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/entity/CreateEntityLayoutView.js b/dashboardv2/public/js/views/entity/CreateEntityLayoutView.js
index 12edab6..d31a122 100644
--- a/dashboardv2/public/js/views/entity/CreateEntityLayoutView.js
+++ b/dashboardv2/public/js/views/entity/CreateEntityLayoutView.js
@@ -115,6 +115,17 @@ define(['require',
this.listenTo(this.collection, 'error', function() {
this.hideLoader();
}, this);
+ },
+ onRender: function() {
+ this.bindEvents();
+ if (!this.guid) {
+ this.bindRequiredField();
+ }
+ this.showLoader();
+ this.fetchCollections();
+ },
+ bindRequiredField: function() {
+ var that = this;
this.ui.entityInputData.on("keyup change", "textarea", function(e) {
var value = this.value;
if (!value.length && $(this).hasClass('false')) {
@@ -158,11 +169,6 @@ define(['require',
}
});
},
- onRender: function() {
- this.bindEvents();
- this.showLoader();
- this.fetchCollections();
- },
bindNonRequiredField: function() {
var that = this;
this.ui.entityInputData.off('keyup change dp.change', 'input.false,select.false').on('keyup change dp.change', 'input.false,select.false', function(e) {
@@ -332,9 +338,6 @@ define(['require',
});
}
});
- if (this.guid) {
- this.bindNonRequiredField();
- }
this.initializeValidation();
if (this.ui.entityInputData.find('fieldset').length > 0 && this.ui.entityInputData.find('select.true,input.true').length === 0) {
this.requiredAllToggle(this.ui.entityInputData.find('select.true,input.true').length === 0);
@@ -723,7 +726,12 @@ define(['require',
if (selectedValue) {
$this.val(selectedValue).trigger("change");
}
+
});
+ if (this.guid) {
+ this.bindRequiredField();
+ this.bindNonRequiredField();
+ }
this.hideLoader();
}
});
http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/bd69a4f1/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 a7cb7b5..7eaf23c 100644
--- a/dashboardv2/public/js/views/tag/addTagModalView.js
+++ b/dashboardv2/public/js/views/tag/addTagModalView.js
@@ -62,14 +62,13 @@ define(['require',
okText: 'Add',
cancelText: "Cancel",
allowCancel: true,
- },
- state = this.tagModel ? false : true;
+ };
if (this.tagModel) {
modalObj.title = 'Edit Tag';
modalObj.okText = 'Update';
}
this.modal = new Modal(modalObj).open();
- this.modal.$el.find('button.ok').attr("disabled", state);
+ this.modal.$el.find('button.ok').attr("disabled", true);
this.on('ok', function() {
var tagName = this.tagModel ? this.tagModel.typeName : this.ui.addTagOptions.val(),
tagAttributes = {},
@@ -242,11 +241,17 @@ define(['require',
this.subAttributeData(attributeDefs);
},
showAttributeBox: function() {
+ var that = this;
this.$('.attrLoader').hide();
this.$('.form-group.hide').removeClass('hide');
if (this.ui.tagAttribute.children().length !== 0) {
this.ui.tagAttribute.parent().show();
}
+ this.ui.tagAttribute.find('input,select').on("keyup change", function(e) {
+ if (e.keyCode != 32) {
+ that.modal.$el.find('button.ok').attr("disabled", false);
+ }
+ });
},
hideAttributeBox: function() {
this.ui.tagAttribute.children().empty();
@@ -264,7 +269,7 @@ define(['require',
var str = "<option disabled='disabled'" + (!that.tagModel ? 'selected' : '') + ">-- Select " + typeName + " --</option>";
var enumValue = typeNameValue.get('elementDefs');
_.each(enumValue, function(key, value) {
- str += '<option ' + (that.tagModel && key.value === _.values(that.tagModel.attributes)[0] ? 'selected' : '') + '>' + key.value + '</option>';
+ str += '<option ' + (that.tagModel && key.value === that.tagModel.attributes[name] ? 'selected' : '') + '>' + key.value + '</option>';
})
that.ui.tagAttribute.append('<div class="form-group"><label>' + name + '</label>' +
'<select class="form-control attributeInputVal attrName" data-key="' + name + '">' + str + '</select></div>');
[2/5] incubator-atlas git commit: ATLAS-1808:UI : All selected
entities are assigned to tag when Assign Tag corresponding to 1 entity is
clicked.
Posted by ni...@apache.org.
ATLAS-1808:UI : All selected entities are assigned to tag when Assign Tag corresponding to 1 entity is clicked.
Signed-off-by: nixonrodrigues <ni...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/363b88cf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/363b88cf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/363b88cf
Branch: refs/heads/master
Commit: 363b88cf806be8be362a6234c1bc3f292c72ff70
Parents: e483712
Author: kevalbhatt <kb...@apache.org>
Authored: Fri May 19 18:56:52 2017 +0530
Committer: nixonrodrigues <ni...@apache.org>
Committed: Fri May 26 15:46:25 2017 +0530
----------------------------------------------------------------------
.../public/js/views/search/SearchResultLayoutView.js | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/363b88cf/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 cf751e8..25df9b5 100644
--- a/dashboardv2/public/js/views/search/SearchResultLayoutView.js
+++ b/dashboardv2/public/js/views/search/SearchResultLayoutView.js
@@ -513,17 +513,19 @@ define(['require',
},
checkedValue: function(e) {
var guid = "",
- that = this;
- var multiSelectTag = $(e.currentTarget).hasClass('assignTag');
- if (multiSelectTag) {
- if (this.arr && this.arr.length && multiSelectTag) {
+ that = this,
+ isTagMultiSelect = $(e.currentTarget).hasClass('multiSelectTag'),
+ isTermMultiSelect = $(e.currentTarget).hasClass('multiSelectTerm'),
+ isTagButton = $(e.currentTarget).hasClass('assignTag');
+ if (isTagButton) {
+ if (isTagMultiSelect && this.arr && this.arr.length) {
that.addTagModalView(guid, this.arr);
} else {
guid = that.$(e.currentTarget).data("guid");
that.addTagModalView(guid);
}
} else {
- if (this.arr && this.arr.length) {
+ if (isTermMultiSelect && this.arr && this.arr.length) {
that.addTermModalView(guid, this.arr);
} else {
guid = that.$(e.currentTarget).data("guid");
[4/5] incubator-atlas git commit: ATLAS-1811 : UI : Audit Events are
not shown in sorted order based on time sometimes.
Posted by ni...@apache.org.
ATLAS-1811 : UI : Audit Events are not shown in sorted order based on time sometimes.
Signed-off-by: nixonrodrigues <ni...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/64988b8a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/64988b8a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/64988b8a
Branch: refs/heads/master
Commit: 64988b8a36258541b2131ad32cbdadc80e4faadd
Parents: bd69a4f
Author: Kalyani <ka...@freestoneinfotech.com>
Authored: Thu May 25 17:06:59 2017 +0530
Committer: nixonrodrigues <ni...@apache.org>
Committed: Fri May 26 15:48:21 2017 +0530
----------------------------------------------------------------------
.../js/views/audit/AuditTableLayoutView.js | 26 ++++++++++++++------
1 file changed, 18 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/64988b8a/dashboardv2/public/js/views/audit/AuditTableLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/audit/AuditTableLayoutView.js b/dashboardv2/public/js/views/audit/AuditTableLayoutView.js
index 0f068cc..f650b1c 100644
--- a/dashboardv2/public/js/views/audit/AuditTableLayoutView.js
+++ b/dashboardv2/public/js/views/audit/AuditTableLayoutView.js
@@ -59,7 +59,7 @@ define(['require',
initialize: function(options) {
_.extend(this, _.pick(options, 'guid', 'entity', 'entityName', 'entityDef'));
this.entityCollection = new VEntityList();
- this.count = 26;
+ this.limit = 26;
this.entityCollection.url = UrlLinks.entityCollectionaudit(this.guid);
this.entityCollection.modelAttrName = "events";
this.entityModel = new this.entityCollection.model();
@@ -80,17 +80,20 @@ define(['require',
this.currPage = 1;
},
onRender: function() {
- $.extend(this.entityCollection.queryParams, { count: this.count });
+ $.extend(this.entityCollection.queryParams, { count: this.limit });
this.fetchCollection({
next: this.ui.nextAuditData,
nextClick: false,
previous: this.ui.previousAuditData
});
+ this.entityCollection.comparator = function(model) {
+ return -model.get('timestamp');
+ }
},
bindEvents: function() {},
getToOffset: function() {
var toOffset = 0;
- if (this.entityCollection.models.length < this.count) {
+ if (this.entityCollection.models.length < this.limit) {
toOffset = (this.getFromOffset() + (this.entityCollection.models.length));
} else {
toOffset = (this.getFromOffset() + (this.entityCollection.models.length - 1));
@@ -98,7 +101,7 @@ define(['require',
return toOffset;
},
getFromOffset: function(options) {
- var count = (this.currPage - 1) * (this.count - 1);
+ var count = (this.currPage - 1) * (this.limit - 1);
if (options && (options.nextClick || options.previousClick || this.entityCollection.models.length)) {
return count + 1;
} else {
@@ -106,6 +109,7 @@ define(['require',
}
},
renderOffset: function(options) {
+ var entityLength;
if (options.nextClick) {
options.previous.removeAttr("disabled");
if (this.entityCollection.length != 0) {
@@ -118,7 +122,12 @@ define(['require',
this.currPage--;
}
}
- this.ui.pageRecordText.html("Showing " + this.getFromOffset(options) + " - " + this.getToOffset());
+ if (this.entityCollection.models.length > 25) {
+ entityLength = this.entityCollection.models.length - 1;
+ } else {
+ entityLength = this.entityCollection.models.length
+ }
+ this.ui.pageRecordText.html("Showing <u>" + entityLength + " records</u> From " + this.getFromOffset(options) + " - " + this.getToOffset());
},
fetchCollection: function(options) {
var that = this;
@@ -134,13 +143,14 @@ define(['require',
if (!(that.ui.pageRecordText instanceof jQuery)) {
return;
}
- if (that.entityCollection.models.length < that.count) {
+ if (that.entityCollection.models.length < that.limit) {
options.previous.attr('disabled', true);
options.next.attr('disabled', true);
}
that.renderOffset(options);
+ that.entityCollection.sort();
if (that.entityCollection.models.length) {
- if (that.entityCollection && (that.entityCollection.models.length < that.count && that.currPage == 1) && that.next == that.entityCollection.last().get('eventKey')) {
+ if (that.entityCollection && (that.entityCollection.models.length < that.limit && that.currPage == 1) && that.next == that.entityCollection.last().get('eventKey')) {
options.next.attr('disabled', true);
options.previous.removeAttr("disabled");
} else {
@@ -165,7 +175,7 @@ define(['require',
that.RAuditTableLayoutView.show(new TableLayout(_.extend({}, that.commonTableOptions, {
columns: cols
})));
- if (!(that.entityCollection.models.length < that.count)) {
+ if (!(that.entityCollection.models.length < that.limit)) {
that.RAuditTableLayoutView.$el.find('table tr').last().hide();
}
});
[5/5] incubator-atlas git commit: ATLAS-1817 : UI : n+1 pages are
created, even though only n*25 instances are retrieved
Posted by ni...@apache.org.
ATLAS-1817 : UI : n+1 pages are created, even though only n*25 instances are retrieved
Signed-off-by: nixonrodrigues <ni...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/e75984c4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/e75984c4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/e75984c4
Branch: refs/heads/master
Commit: e75984c483501f5c6325a1da91750c0f45d6c6fe
Parents: 64988b8
Author: Kalyani <ka...@freestoneinfotech.com>
Authored: Tue May 23 18:38:55 2017 +0530
Committer: nixonrodrigues <ni...@apache.org>
Committed: Fri May 26 15:48:48 2017 +0530
----------------------------------------------------------------------
.../public/js/views/search/SearchResultLayoutView.js | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/e75984c4/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 25df9b5..1c9320c 100644
--- a/dashboardv2/public/js/views/search/SearchResultLayoutView.js
+++ b/dashboardv2/public/js/views/search/SearchResultLayoutView.js
@@ -255,7 +255,12 @@ define(['require',
if (!(that.ui.pageRecordText instanceof jQuery)) {
return;
}
-
+ if (that.searchCollection.models.length === 0) {
+ that.ui.nextData.attr('disabled', true);
+ that.offset = that.offset - that.limit;
+ that.hideLoader();
+ return;
+ }
if (that.searchCollection.models.length < that.limit) {
that.ui.nextData.attr('disabled', true);
} else {
@@ -272,7 +277,7 @@ define(['require',
that.pageTo = that.pageTo - that.limit;
that.pageFrom = (that.pageTo - that.limit) + 1;
}
- that.ui.pageRecordText.html("Showing <u>" + that.searchCollection.models.length + " records</u>, from " + that.pageFrom + " - " + that.pageTo);
+ that.ui.pageRecordText.html("Showing <u>" + that.searchCollection.models.length + " records</u> From " + that.pageFrom + " - " + that.pageTo);
if (that.offset < that.limit && that.pageFrom < 26) {
that.ui.previousData.attr('disabled', true);
}