Commit edc4786b by kalyanikk Committed by Madhan Neethiraj

ATLAS-1193: UI to create/update entities

parent 1620284e
...@@ -126,7 +126,7 @@ module.exports = function(grunt) { ...@@ -126,7 +126,7 @@ module.exports = function(grunt) {
'd3': 'd3/d3.min.js', 'd3': 'd3/d3.min.js',
'd3/': 'd3-tip/index.js', 'd3/': 'd3-tip/index.js',
'dagre-d3': 'dagre-d3/dist/dagre-d3.min.js', 'dagre-d3': 'dagre-d3/dist/dagre-d3.min.js',
'select2': 'select2/dist/js/select2.min.js', 'select2': 'select2/dist/js/select2.full.min.js',
'backgrid-select-all': 'backgrid-select-all/backgrid-select-all.min.js', 'backgrid-select-all': 'backgrid-select-all/backgrid-select-all.min.js',
'moment/js': 'moment/min/moment.min.js', 'moment/js': 'moment/min/moment.min.js',
'jquery-placeholder/js': 'jquery-placeholder/jquery.placeholder.js', 'jquery-placeholder/js': 'jquery-placeholder/jquery.placeholder.js',
......
...@@ -227,3 +227,23 @@ button:focus { ...@@ -227,3 +227,23 @@ button:focus {
.block { .block {
display: block !important; display: block !important;
} }
.editBtn {
border-color: $color_mountain_mist_approx;
color: $color_mountain_mist_approx;
cursor: default;
margin: 5px 10px;
font-size: 14px;
cursor: pointer;
padding: 0px 5px;
&:hover {
border-color: $color_mountain_mist_approx;
color: $color_mountain_mist_approx;
background-color: $transparent;
}
&:focus {
border-color: $color_mountain_mist_approx;
color: $color_mountain_mist_approx;
background-color: $transparent;
}
}
...@@ -152,6 +152,11 @@ ...@@ -152,6 +152,11 @@
.select2-container--default .select2-search--inline .select2-search__field { .select2-container--default .select2-search--inline .select2-search__field {
color: #555; color: #555;
width: 300px !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
width: 327px !important;
} }
.typeLOV { .typeLOV {
...@@ -240,3 +245,7 @@ ...@@ -240,3 +245,7 @@
} }
} }
} }
.tab-content > .tab-pane.active {
overflow-x: hidden;
}
...@@ -36,7 +36,6 @@ $switchTransition: .4s ease-out; ...@@ -36,7 +36,6 @@ $switchTransition: .4s ease-out;
.switch { .switch {
position: relative; position: relative;
display: inline-block;
width: 50px; width: 50px;
height: 22px; height: 22px;
margin-left: 8px; margin-left: 8px;
......
...@@ -284,7 +284,8 @@ form-control .tagInpput { ...@@ -284,7 +284,8 @@ form-control .tagInpput {
float: left; float: left;
padding: 2px 10px 2px 0px; padding: 2px 10px 2px 0px;
font-weight: 600; font-weight: 600;
width: 70px width: 70px;
margin-right: 5px;
} }
.inputAssignTag { .inputAssignTag {
...@@ -300,11 +301,6 @@ form-control .tagInpput { ...@@ -300,11 +301,6 @@ form-control .tagInpput {
cursor: pointer; cursor: pointer;
background-color: $white; background-color: $white;
white-space: nowrap; white-space: nowrap;
// i.fa {
// position: relative;
// right: -5px;
// cursor: pointer;
// }
&:hover { &:hover {
color: $color_dark_grey_approx; color: $color_dark_grey_approx;
background-color: $color_mercury_approx; background-color: $color_mercury_approx;
...@@ -346,3 +342,68 @@ form-control .tagInpput { ...@@ -346,3 +342,68 @@ form-control .tagInpput {
.tagAttributeLabel { .tagAttributeLabel {
color: $color_star_dust_approx; color: $color_star_dust_approx;
} }
fieldset.scheduler-border {
border-top: 1px solid #999 !important;
padding: 0 1em 0em 1em !important;
margin: 0 0 .5em 0 !important;
}
legend.scheduler-border {
width: auto;
padding: 0 5px;
border-bottom: none;
font-size: 16px;
margin-left: 50%;
margin-bottom: 10px;
color: #555;
}
.requiredInput {
color: #d20606;
}
.spanEntityType {
position: absolute;
right: 38px;
top: 10px;
cursor: help;
width: 45px;
overflow: hidden;
z-index: 9;
text-overflow: ellipsis;
font-size: 14px;
color: #a7a19f;
}
.enitityInputBox {
padding-right: 69px;
}
.entityLoader {
margin-left: 286px;
}
.errorClass {
border: 1px solid red;
}
.entityInputBox {
padding-right: 70px;
}
.attributeTag {
padding: 5px 8px;
border: 1px solid #999999;
color: #999999;
border-radius: 1px;
cursor: pointer
}
.attrTopMargin {
margin-top: 15px;
}
.topMargin {
margin-top: 13px;
}
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
<link rel="stylesheet" href="js/libs/select2/css/select2.min.css"> <link rel="stylesheet" href="js/libs/select2/css/select2.min.css">
<link rel="stylesheet" href="js/libs/bootstrap/css/bootstrap.min.css"> <link rel="stylesheet" href="js/libs/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="js/libs/jquery-asBreadcrumbs/css/asBreadcrumbs.min.css"> <link rel="stylesheet" href="js/libs/jquery-asBreadcrumbs/css/asBreadcrumbs.min.css">
<link rel="stylesheet" href="js/external_lib/datetimepicker/bootstrap-datetimepicker.min.css">
<link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400italic,600,600italic,700,700italic' rel='stylesheet' type='text/css'> <link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400italic,600,600italic,700,700italic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="js/external_lib/jquery-ui/jquery-ui.min.css"> <link rel="stylesheet" type="text/css" href="js/external_lib/jquery-ui/jquery-ui.min.css">
<link href="css/bootstrap-sidebar.css" rel="stylesheet"> <link href="css/bootstrap-sidebar.css" rel="stylesheet">
......
...@@ -40,14 +40,7 @@ define(['require', ...@@ -40,14 +40,7 @@ define(['require',
// if (!this.modelAttrName) { // if (!this.modelAttrName) {
// throw new Error("this.modelAttrName not defined for " + this); // throw new Error("this.modelAttrName not defined for " + this);
// } // }
if (this.modelAttrName && this.modelAttrName.length) { if (this.modelAttrName && this.modelAttrName === "createEntity") {
if (resp[this.modelAttrName]) {
return resp[this.modelAttrName];
} else {
return resp
}
} else {
var arr = []; var arr = [];
arr.push({ arr.push({
attributes: resp.attributes, attributes: resp.attributes,
...@@ -56,6 +49,12 @@ define(['require', ...@@ -56,6 +49,12 @@ define(['require',
typeName: resp.typeName typeName: resp.typeName
}); });
return arr; return arr;
} else {
if (resp[this.modelAttrName]) {
return resp[this.modelAttrName];
} else {
return resp
}
} }
} catch (e) { } catch (e) {
......
...@@ -46,7 +46,15 @@ define(['require', ...@@ -46,7 +46,15 @@ define(['require',
if (!this.modelAttrName) { if (!this.modelAttrName) {
throw new Error("this.modelAttrName not defined for " + this); throw new Error("this.modelAttrName not defined for " + this);
} }
return _.reject(resp[this.modelAttrName], _.isNull); var list = _.reject(resp[this.modelAttrName], _.isNull);
_.each(list, function(obj) {
if (!obj.id) {
if (obj['$id$'] && obj['$id$'].id) {
obj.id = obj['$id$'].id
}
}
})
return list;
} catch (e) { } catch (e) {
console.log(e); console.log(e);
} }
......
/*!
* Datetimepicker for Bootstrap 3
* version : 4.14.30
* https://github.com/Eonasdan/bootstrap-datetimepicker/
*/.bootstrap-datetimepicker-widget{list-style:none}.bootstrap-datetimepicker-widget.dropdown-menu{margin:2px 0;padding:4px;width:19em}@media (min-width:768px){.bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs{width:38em}}@media (min-width:992px){.bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs{width:38em}}@media (min-width:1200px){.bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs{width:38em}}.bootstrap-datetimepicker-widget.dropdown-menu:after,.bootstrap-datetimepicker-widget.dropdown-menu:before{content:'';display:inline-block;position:absolute}.bootstrap-datetimepicker-widget.dropdown-menu.bottom:before{border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-bottom-color:rgba(0,0,0,.2);top:-7px;left:7px}.bootstrap-datetimepicker-widget.dropdown-menu.bottom:after{border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #fff;top:-6px;left:8px}.bootstrap-datetimepicker-widget.dropdown-menu.top:before{border-left:7px solid transparent;border-right:7px solid transparent;border-top:7px solid #ccc;border-top-color:rgba(0,0,0,.2);bottom:-7px;left:6px}.bootstrap-datetimepicker-widget.dropdown-menu.top:after{border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #fff;bottom:-6px;left:7px}.bootstrap-datetimepicker-widget.dropdown-menu.pull-right:before{left:auto;right:6px}.bootstrap-datetimepicker-widget.dropdown-menu.pull-right:after{left:auto;right:7px}.bootstrap-datetimepicker-widget .list-unstyled{margin:0}.bootstrap-datetimepicker-widget a[data-action]{padding:6px 0}.bootstrap-datetimepicker-widget a[data-action]:active{box-shadow:none}.bootstrap-datetimepicker-widget .timepicker-hour,.bootstrap-datetimepicker-widget .timepicker-minute,.bootstrap-datetimepicker-widget .timepicker-second{width:54px;font-weight:700;font-size:1.2em;margin:0}.bootstrap-datetimepicker-widget button[data-action]{padding:6px}.bootstrap-datetimepicker-widget .btn[data-action=incrementHours]::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0;content:"Increment Hours"}.bootstrap-datetimepicker-widget .btn[data-action=incrementMinutes]::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0;content:"Increment Minutes"}.bootstrap-datetimepicker-widget .btn[data-action=decrementHours]::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0;content:"Decrement Hours"}.bootstrap-datetimepicker-widget .btn[data-action=decrementMinutes]::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0;content:"Decrement Minutes"}.bootstrap-datetimepicker-widget .btn[data-action=showHours]::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0;content:"Show Hours"}.bootstrap-datetimepicker-widget .btn[data-action=showMinutes]::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0;content:"Show Minutes"}.bootstrap-datetimepicker-widget .btn[data-action=togglePeriod]::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0;content:"Toggle AM/PM"}.bootstrap-datetimepicker-widget .btn[data-action=clear]::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0;content:"Clear the picker"}.bootstrap-datetimepicker-widget .btn[data-action=today]::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0;content:"Set the date to today"}.bootstrap-datetimepicker-widget .picker-switch{text-align:center}.bootstrap-datetimepicker-widget .picker-switch::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0;content:"Toggle Date and Time Screens"}.bootstrap-datetimepicker-widget .picker-switch td{padding:0;margin:0;height:auto;width:auto;line-height:inherit}.bootstrap-datetimepicker-widget .picker-switch td span{line-height:2.5;height:2.5em;width:100%}.bootstrap-datetimepicker-widget table{width:100%;margin:0}.bootstrap-datetimepicker-widget table td,.bootstrap-datetimepicker-widget table th{text-align:center;border-radius:4px}.bootstrap-datetimepicker-widget table th{height:20px;line-height:20px;width:20px}.bootstrap-datetimepicker-widget table th.picker-switch{width:145px}.bootstrap-datetimepicker-widget table th.disabled,.bootstrap-datetimepicker-widget table th.disabled:hover{background:0 0;color:#777;cursor:not-allowed}.bootstrap-datetimepicker-widget table th.prev::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0;content:"Previous Month"}.bootstrap-datetimepicker-widget table th.next::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0;content:"Next Month"}.bootstrap-datetimepicker-widget table thead tr:first-child th{cursor:pointer}.bootstrap-datetimepicker-widget table thead tr:first-child th:hover{background:#eee}.bootstrap-datetimepicker-widget table td{height:54px;line-height:54px;width:54px}.bootstrap-datetimepicker-widget table td.cw{font-size:.8em;height:20px;line-height:20px;color:#777}.bootstrap-datetimepicker-widget table td.day{height:20px;line-height:20px;width:20px}.bootstrap-datetimepicker-widget table td.day:hover,.bootstrap-datetimepicker-widget table td.hour:hover,.bootstrap-datetimepicker-widget table td.minute:hover,.bootstrap-datetimepicker-widget table td.second:hover{background:#eee;cursor:pointer}.bootstrap-datetimepicker-widget table td.new,.bootstrap-datetimepicker-widget table td.old{color:#777}.bootstrap-datetimepicker-widget table td.today{position:relative}.bootstrap-datetimepicker-widget table td.today:before{content:'';display:inline-block;border:0 solid transparent;border-bottom-color:#337ab7;border-top-color:rgba(0,0,0,.2);position:absolute;bottom:4px;right:4px}.bootstrap-datetimepicker-widget table td.active,.bootstrap-datetimepicker-widget table td.active:hover{background-color:#337ab7;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25)}.bootstrap-datetimepicker-widget table td.active.today:before{border-bottom-color:#fff}.bootstrap-datetimepicker-widget table td.disabled,.bootstrap-datetimepicker-widget table td.disabled:hover{background:0 0;color:#777;cursor:not-allowed}.bootstrap-datetimepicker-widget table td span{display:inline-block;width:54px;height:54px;line-height:54px;margin:2px 1.5px;cursor:pointer;border-radius:4px}.bootstrap-datetimepicker-widget table td span:hover{background:#eee}.bootstrap-datetimepicker-widget table td span.active{background-color:#337ab7;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25)}.bootstrap-datetimepicker-widget table td span.old{color:#777}.bootstrap-datetimepicker-widget table td span.disabled,.bootstrap-datetimepicker-widget table td span.disabled:hover{background:0 0;color:#777;cursor:not-allowed}.bootstrap-datetimepicker-widget.usetwentyfour td.hour{height:27px;line-height:27px}.bootstrap-datetimepicker-widget.wider{width:21em}.bootstrap-datetimepicker-widget .datepicker-decades .decade{line-height:1.8em!important}.input-group.date .input-group-addon{cursor:pointer}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0}
\ No newline at end of file
...@@ -94,6 +94,10 @@ require.config({ ...@@ -94,6 +94,10 @@ require.config({
'deps': ['d3'], 'deps': ['d3'],
'exports': ['d3-tip'] 'exports': ['d3-tip']
}, },
'datetimepicker': {
'deps': ['jquery'],
'exports': 'datetimepicker'
},
'dagreD3': { 'dagreD3': {
'deps': ['d3'], 'deps': ['d3'],
'exports': ['dagreD3'] 'exports': ['dagreD3']
...@@ -130,10 +134,11 @@ require.config({ ...@@ -130,10 +134,11 @@ require.config({
'hbs': 'external_lib/require-handlebars-plugin/js/hbs', 'hbs': 'external_lib/require-handlebars-plugin/js/hbs',
'i18nprecompile': 'external_lib/require-handlebars-plugin/js/i18nprecompile', 'i18nprecompile': 'external_lib/require-handlebars-plugin/js/i18nprecompile',
'dagreD3': 'libs/dagre-d3/dagre-d3.min', 'dagreD3': 'libs/dagre-d3/dagre-d3.min',
'select2': 'libs/select2/select2.min', 'select2': 'libs/select2/select2.full.min',
'backgrid-select-all': 'libs/backgrid-select-all/backgrid-select-all.min', 'backgrid-select-all': 'libs/backgrid-select-all/backgrid-select-all.min',
'moment': 'libs/moment/js/moment.min', 'moment': 'libs/moment/js/moment.min',
'jquery-ui': 'external_lib/jquery-ui/jquery-ui.min', 'jquery-ui': 'external_lib/jquery-ui/jquery-ui.min',
'datetimepicker': 'external_lib/datetimepicker/bootstrap-datetimepicker',
'pnotify': 'external_lib/pnotify.custom.min', 'pnotify': 'external_lib/pnotify.custom.min',
'jquery-placeholder': 'libs/jquery-placeholder/js/jquery.placeholder', 'jquery-placeholder': 'libs/jquery-placeholder/js/jquery.placeholder',
'platform': 'libs/platform/platform' 'platform': 'libs/platform/platform'
...@@ -156,7 +161,7 @@ require(['App', ...@@ -156,7 +161,7 @@ require(['App',
'utils/Overrides', 'utils/Overrides',
'bootstrap', 'bootstrap',
'd3', 'd3',
'select2' 'select2'
], function(App, Router, CommonViewFunction, Globals, UrlLinks) { ], function(App, Router, CommonViewFunction, Globals, UrlLinks) {
App.appRouter = new Router(); App.appRouter = new Router();
CommonViewFunction.userDataFetch({ CommonViewFunction.userDataFetch({
......
...@@ -70,8 +70,20 @@ define(['require', ...@@ -70,8 +70,20 @@ define(['require',
}, options); }, options);
return this.constructor.nonCrudOperation.call(this, url, 'GET', options); return this.constructor.nonCrudOperation.call(this, url, 'GET', options);
},
createOreditEntity: function(guid, options) {
var url;
if (guid) {
url = UrlLinks.entitiesApiUrl(guid);
} else {
url = UrlLinks.entitiesApiUrl();
}
options = _.extend({
contentType: 'application/json',
dataType: 'json'
}, options);
return this.constructor.nonCrudOperation.call(this, url, "", options);
} }
}, {}); }, {});
return VEntity; return VEntity;
}); });
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
<a href="javascript:void(0);" class="backButton" data-id="backButton"><i class="fa fa-chevron-left"></i> Back To Results</a> <a href="javascript:void(0);" class="backButton" data-id="backButton"><i class="fa fa-chevron-left"></i> Back To Results</a>
</div> </div>
<h1><span data-id="title"></span></h1> <h1><span data-id="title"></span></h1>
<button data-id="editButton" class="btn btn-default pull-right editbutton" id="editText"><i class="fa fa-pencil"></i></button>
<div data-id="editBox" style="margin-bottom:10px;"> <div data-id="editBox" style="margin-bottom:10px;">
<textarea class="well well-sm col-sm-12" data-id="descriptionTextArea"></textarea> <textarea class="well well-sm col-sm-12" data-id="descriptionTextArea"></textarea>
<div class="clearfix" align="right"> <div class="clearfix" align="right">
......
<!--
* 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="entityDefinitionform" class="css-form">
<!-- <h4 style="margin-bottom:30px"></h4> -->
<div class="form-group">
<div class="col-sm-12">
<div class="row">
{{#if guid}}
<div class="col-md-8">
<label class="col-md-6 row-margin-bottom" data-id="assetName"></label>
</div>
{{else}}
<div class="col-md-8">
<select class="form-control col-md-6 row-margin-bottom" data-id="entityList"></select>
</div>
{{/if}}
<div class="col-md-4">
<span class="pull-left">Required</span>
<label class="switch pull-left">
<input type="checkbox" class="switch-input" name="toggleRequired" value="text">
<div class="switch-slider"></div>
</label>
<span class="pull-left">All</span>
</div>
</div>
</div>
<div class="entityLoader" style="display:none">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
<div class="control-group entityInputData" data-id="entityInputData"></div>
</div>
</form>
...@@ -15,6 +15,9 @@ ...@@ -15,6 +15,9 @@
* limitations under the License. * limitations under the License.
--> -->
<div class="row row-margin-bottom"> <div class="row row-margin-bottom">
<div class="col-sm-12">
<button class="btn btn-atlasAction btn-atlas pull-left" data-id="createEntity"><i class="fa fa-plus"></i> Create Entity</button>
</div>
<div class="col-sm-12" style="margin:15px 0px;"> <div class="col-sm-12" style="margin:15px 0px;">
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
......
...@@ -29,11 +29,11 @@ define(['require', 'utils/Enums'], function(require, Enums) { ...@@ -29,11 +29,11 @@ define(['require', 'utils/Enums'], function(require, Enums) {
return this.baseUrl + '/v1/taxonomies' + '/' + name + '/terms'; return this.baseUrl + '/v1/taxonomies' + '/' + name + '/terms';
}, },
entitiesApiUrl: function(guid, name) { entitiesApiUrl: function(guid, name) {
var entitiesUrl = this.baseUrlV2 + '/entity/guid'; var entitiesUrl = this.baseUrlV2 + '/entity';
if (guid && name) { if (guid && name) {
return entitiesUrl + '/' + guid + '/classification/' + name; return entitiesUrl + '/guid/' + guid + '/classification/' + name;
} else if (guid && !name) { } else if (guid && !name) {
return entitiesUrl + '/' + guid; return entitiesUrl + '/guid/' + guid;
} else { } else {
return entitiesUrl; return entitiesUrl;
} }
......
...@@ -75,6 +75,7 @@ define(['require', ...@@ -75,6 +75,7 @@ define(['require',
/** ui events hash */ /** ui events hash */
events: function() { events: function() {
var events = {}; var events = {};
events["click " + this.ui.editButton] = 'onClickEditEntity';
events["click " + this.ui.tagClick] = function(e) { events["click " + this.ui.tagClick] = function(e) {
if (e.target.nodeName.toLocaleLowerCase() != "i") { if (e.target.nodeName.toLocaleLowerCase() != "i") {
var scope = $(e.currentTarget); var scope = $(e.currentTarget);
...@@ -358,6 +359,21 @@ define(['require', ...@@ -358,6 +359,21 @@ define(['require',
term: true term: true
})); }));
}); });
},
onClickEditEntity: function(e) {
var that = this;
$(e.currentTarget).blur();
require([
'views/entity/CreateEntityLayoutView'
], function(CreateEntityLayoutView) {
var view = new CreateEntityLayoutView({
guid: that.id,
callback: function() {
that.fetchCollection();
}
});
});
} }
}); });
return DetailPageLayoutView; return DetailPageLayoutView;
......
...@@ -42,7 +42,8 @@ define(['require', ...@@ -42,7 +42,8 @@ define(['require',
searchBtn: '[data-id="searchBtn"]', searchBtn: '[data-id="searchBtn"]',
clearSearch: '[data-id="clearSearch"]', clearSearch: '[data-id="clearSearch"]',
typeLov: '[data-id="typeLOV"]', typeLov: '[data-id="typeLOV"]',
refreshBtn: '[data-id="refreshBtn"]' refreshBtn: '[data-id="refreshBtn"]',
createEntity: "[data-id='createEntity']",
}, },
/** ui events hash */ /** ui events hash */
events: function() { events: function() {
...@@ -63,6 +64,7 @@ define(['require', ...@@ -63,6 +64,7 @@ define(['require',
events["click " + this.ui.clearSearch] = 'clearSearchData'; events["click " + this.ui.clearSearch] = 'clearSearchData';
events["change " + this.ui.typeLov] = 'onChangeTypeList'; events["change " + this.ui.typeLov] = 'onChangeTypeList';
events["click " + this.ui.refreshBtn] = 'onRefreshButton'; events["click " + this.ui.refreshBtn] = 'onRefreshButton';
events["click " + this.ui.createEntity] = 'onClickCreateEntity';
return events; return events;
}, },
/** /**
...@@ -247,7 +249,20 @@ define(['require', ...@@ -247,7 +249,20 @@ define(['require',
mergeBrowserUrl: false, mergeBrowserUrl: false,
trigger: true trigger: true
}); });
} },
onClickCreateEntity: function(e) {
var that = this;
$(e.currentTarget).blur();
require([
'views/entity/CreateEntityLayoutView'
], function(CreateEntityLayoutView) {
var view = new CreateEntityLayoutView({
callback: function() {
that.fetchCollection();
}
});
});
},
}); });
return SearchLayoutView; return SearchLayoutView;
}); });
...@@ -57,7 +57,8 @@ define(['require', ...@@ -57,7 +57,8 @@ define(['require',
previousData: "[data-id='previousData']", previousData: "[data-id='previousData']",
nextData: "[data-id='nextData']", nextData: "[data-id='nextData']",
pageRecordText: "[data-id='pageRecordText']", pageRecordText: "[data-id='pageRecordText']",
addAssignTag: "[data-id='addAssignTag']" addAssignTag: "[data-id='addAssignTag']",
editEntityButton: "[data-id='editEntityButton']"
}, },
/** ui events hash */ /** ui events hash */
...@@ -107,6 +108,7 @@ define(['require', ...@@ -107,6 +108,7 @@ define(['require',
}; };
events["click " + this.ui.nextData] = "onClicknextData"; events["click " + this.ui.nextData] = "onClicknextData";
events["click " + this.ui.previousData] = "onClickpreviousData"; events["click " + this.ui.previousData] = "onClickpreviousData";
events["click " + this.ui.editEntityButton] = "onClickEditEntity";
return events; return events;
}, },
/** /**
...@@ -450,6 +452,7 @@ define(['require', ...@@ -450,6 +452,7 @@ define(['require',
nameHtml += '<button type="button" title="Deleted" class="btn btn-atlasAction btn-atlas deleteBtn"><i class="fa fa-trash"></i></button>'; nameHtml += '<button type="button" title="Deleted" class="btn btn-atlasAction btn-atlas deleteBtn"><i class="fa fa-trash"></i></button>';
return '<div class="readOnly readOnlyLink">' + nameHtml + '</div>'; return '<div class="readOnly readOnlyLink">' + nameHtml + '</div>';
} else { } else {
nameHtml += '<button title="Edit" data-id="editEntityButton" data-giud= "' + (model.get('$id$').id || model.get('$id$')) + '" class="btn btn-atlasAction btn-atlas editBtn"><i class="fa fa-pencil"></i></button>'
return nameHtml; return nameHtml;
} }
} }
...@@ -485,6 +488,7 @@ define(['require', ...@@ -485,6 +488,7 @@ define(['require',
nameHtml += '<button type="button" title="Deleted" class="btn btn-atlasAction btn-atlas deleteBtn"><i class="fa fa-trash"></i></button>'; nameHtml += '<button type="button" title="Deleted" class="btn btn-atlasAction btn-atlas deleteBtn"><i class="fa fa-trash"></i></button>';
return '<div class="readOnly readOnlyLink">' + nameHtml + '</div>'; return '<div class="readOnly readOnlyLink">' + nameHtml + '</div>';
} else { } else {
nameHtml += '<button title="Edit" data-giud= "' +(model.get('$id$').id || model.get('$id$')) + '" class="btn btn-atlasAction btn-atlas editBtn"><i class="fa fa-pencil"></i></button>'
return nameHtml; return nameHtml;
} }
} }
...@@ -667,6 +671,22 @@ define(['require', ...@@ -667,6 +671,22 @@ define(['require',
}); });
this.previousClick = true; this.previousClick = true;
this.fetchCollection(); this.fetchCollection();
},
onClickEditEntity: function(e) {
var that = this;
$(e.currentTarget).blur();
var guid = $(e.currentTarget).data('giud');
require([
'views/entity/CreateEntityLayoutView'
], function(CreateEntityLayoutView) {
var view = new CreateEntityLayoutView({
guid: guid,
callback: function() {
that.fetchCollection();
}
});
});
} }
}); });
return SearchResultLayoutView; return SearchResultLayoutView;
......
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