Commit 70ebb228 by kevalbhatt

ATLAS-3554 : UI: changes to display/add/update/delete namespace attributes for…

ATLAS-3554 : UI: changes to display/add/update/delete namespace attributes for entities in entity details page
parent 47ccfaf7
......@@ -248,6 +248,7 @@ pre {
.custom-col-1 {
width: 39%;
margin-bottom: 10px;
}
.custom-col-2 {
......
......@@ -159,9 +159,9 @@
.panel-default.custom-panel>.panel-actions {
float: right;
margin-top: 15px;
margin-right: 10px;
button {
margin-right: 10px;
margin-top: -4px;
}
}
......
......@@ -107,7 +107,15 @@ define(['require',
deleteNameSpace: function(options) {
var url = UrlLinks.nameSpaceUpdateUrl(options.typeName);
return this.constructor.nonCrudOperation.call(this, url, 'DELETE', options);
}
},
saveNamespaceEntity: function(guid, options) {
var url = UrlLinks.entitiesNamespaceApiUrl(guid);
options = _.extend({
contentType: 'application/json',
dataType: 'json'
}, options);
return this.constructor.nonCrudOperation.call(this, url, 'POST', options);
},
}, {});
return VEntity;
});
\ No newline at end of file
......@@ -89,6 +89,12 @@ define(['require',
case '>=':
return (v1 >= v2) ? options.fn(this) : options.inverse(this);
break;
case 'isEmpty':
return (_.isEmpty(v1)) ? options.fn(this) : options.inverse(this);
break;
case 'has':
return (_.has(v1, v2)) ? options.fn(this) : options.inverse(this);
break;
default:
return options.inverse(this);
break;
......
......@@ -79,6 +79,7 @@
<div class="col-md-6">
<div id="r_entityUserDefineView"></div>
<div id="r_entityLabelDefineView"></div>
<div id="r_entityNameSpaceView"></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.
-->
{{#ifCond model "has" "isNew"}}
<td class="custom-col-1">
{{{callmyfunction getNamespaceDroupdown nameSpaceCollection}}}
</td>
<td class="custom-col-0"> : </td>
<td class="custom-col-1" data-id="value">
<input type="text" data-key disabled class="form-control">
</td>
<td class="custom-col-2 btn-group">
<button class="btn btn-default btn-sm" data-id="deleteItem">
<i class="fa fa-minus"> </i>
</button>
<button class="btn btn-default btn-sm" data-id="addItem">
<i class="fa fa-plus"> </i>
</button>
</td>
{{else}}
<hr />
<ul class="namespace-tree-parent">
<li>{{model.__internal_UI_nameSpaceName}}</li>
<li class="namespace-tree-child" data-id="namespaceTreeChild">
</li>
</ul>
{{/ifCond}}
\ 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="panel panel-default custom-panel expand_collapse_panel-icon" data-id="namespace">
<div class="panel-heading" data-toggle="collapse" href="#namespaceCollapse" aria-expanded="false" style="width: 70%;">
<h4 class="panel-title">
<a>Namespaces</a>
</h4>
<div class="btn-group pull-left">
<button type="button" title="Collapse"><i class="ec-icon fa"></i></button>
</div>
</div>
<div class="panel-actions">
<button class="btn btn-action btn-sm" title="" data-id="addNameSpace">Add</button>
<button class="btn btn-action btn-sm" style="display: none;" data-id="saveNameSpace">Save</button>
<button class="btn btn-action btn-sm" style="display: none;" data-id="cancel">Cancel</button>
</div>
<div id="namespaceCollapse" class="panel-collapse collapse">
<div class="panel-body">
<div data-id="namespaceTree"></div>
<div class="editBox" style="display: none;">
<div class="form-group">
<a href="javascript:void(0)" class="btn btn-action btn-sm" data-id="addItem" data-type="addAttrButton">Add New Attribute</a>
</div>
<table class="custom-table">
<tbody data-id="itemView"></tbody>
</table>
</div>
</div>
</div>
</div>
\ No newline at end of file
......@@ -26,7 +26,7 @@
<textarea placeholder="value" data-type="value" data-index={{@index}} class="form-control" class="form-control">{{value}}</textarea>
<p class="errorMsg"></p>
</td>
<td class="custom-col-2">
<td class="custom-col-2 btn-group">
<button class="btn btn-default btn-sm" title="" data-index={{@index}} data-id="deleteItem">
<i class="fa fa-minus"> </i>
</button>
......
......@@ -99,6 +99,11 @@ define(['require', 'utils/Enums', 'utils/Utils', 'underscore'], function(require
return this.baseUrlV2 + '/entity/bulk/classification';
}
},
entitiesNamespaceApiUrl: function(guid) {
if (guid) {
return this.baseUrlV2 + '/entity/guid/' + guid + '/namespaces?isOverwrite=true';
}
},
entityCollectionaudit: function(guid) {
return this.baseUrlV2 + '/entity/' + guid + '/audit';
},
......
......@@ -46,7 +46,8 @@ define(['require',
RProfileLayoutView: "#r_profileLayoutView",
RRelationshipLayoutView: "#r_relationshipLayoutView",
REntityUserDefineView: "#r_entityUserDefineView",
REntityLabelDefineView: "#r_entityLabelDefineView"
REntityLabelDefineView: "#r_entityLabelDefineView",
REntityNameSpaceView: "#r_entityNameSpaceView"
},
/** ui selector cache */
ui: {
......@@ -120,7 +121,7 @@ define(['require',
* @constructs
*/
initialize: function(options) {
_.extend(this, _.pick(options, 'value', 'collection', 'id', 'entityDefCollection', 'typeHeaders', 'enumDefCollection', 'classificationDefCollection', 'glossaryCollection', 'searchVent'));
_.extend(this, _.pick(options, 'value', 'collection', 'id', 'entityDefCollection', 'typeHeaders', 'enumDefCollection', 'classificationDefCollection', 'glossaryCollection', 'nameSpaceCollection', 'searchVent'));
$('body').addClass("detail-page");
},
bindEvents: function() {
......@@ -244,6 +245,7 @@ define(['require',
enumDefCollection: this.enumDefCollection,
classificationDefCollection: this.classificationDefCollection,
glossaryCollection: this.glossaryCollection,
nameSpaceCollection: this.nameSpaceCollection,
searchVent: this.searchVent,
attributeDefs: (function() {
return that.getEntityDef(collectionJSON);
......@@ -253,6 +255,7 @@ define(['require',
this.renderEntityDetailTableLayoutView(obj);
this.renderEntityUserDefineView(obj);
this.renderEntityLabelDefineView(obj);
this.renderEntityNameSpaceView(obj);
this.renderRelationshipLayoutView(obj);
this.renderAuditTableLayoutView(obj);
this.renderTagTableLayoutView(obj);
......@@ -512,6 +515,12 @@ define(['require',
that.REntityLabelDefineView.show(new EntityLabelDefineView(obj));
});
},
renderEntityNameSpaceView: function(obj) {
var that = this;
require(['views/entity/EntityNameSpaceView'], function(EntityNameSpaceView) {
that.REntityNameSpaceView.show(new EntityNameSpaceView(obj));
});
},
renderTagTableLayoutView: function(obj) {
var that = this;
require(['views/tag/TagDetailTableLayoutView'], function(TagDetailTableLayoutView) {
......
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