mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-20 07:07:59 +00:00
Merge pull request #213 from jerrybai2009/master
fix the issue that action getSchema did not fired
This commit is contained in:
commit
9bbbf1a68e
@ -321,7 +321,7 @@
|
||||
</td>
|
||||
<td class="commentsArea">
|
||||
<div class="commentsArea">
|
||||
{{#schema-comment schema=schema datasetId=this.model.id fieldId=schema.id getSchema="getSchema"}}{{/schema-comment}}
|
||||
{{#schema-comment schema=schema datasetId=dataset.id fieldId=schema.id}}{{/schema-comment}}
|
||||
{{schema.commentHtml}}
|
||||
</div>
|
||||
</td>
|
||||
|
@ -102,6 +102,36 @@ App.DatasetSchemaComponent = Ember.Component.extend({
|
||||
}, 500);
|
||||
},
|
||||
actions: {
|
||||
getSchema: function(){
|
||||
var _this = this
|
||||
var id = _this.get('dataset.id')
|
||||
var columnUrl = 'api/v1/datasets/' + id + "/columns";
|
||||
_this.set("isTable", true);
|
||||
_this.set("isJSON", false);
|
||||
$.get(columnUrl, function(data) {
|
||||
if (data && data.status == "ok")
|
||||
{
|
||||
if (data.columns && (data.columns.length > 0))
|
||||
{
|
||||
_this.set("hasSchemas", true);
|
||||
data.columns = data.columns.map(function(item, idx){
|
||||
item.commentHtml = marked(item.comment).htmlSafe()
|
||||
return item
|
||||
})
|
||||
_this.set("schemas", data.columns);
|
||||
setTimeout(initializeColumnTreeGrid, 500);
|
||||
}
|
||||
else
|
||||
{
|
||||
_this.set("hasSchemas", false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_this.set("hasSchemas", false);
|
||||
}
|
||||
});
|
||||
},
|
||||
setView: function (view) {
|
||||
switch (view) {
|
||||
case "tabular":
|
||||
|
@ -497,7 +497,10 @@ App.SchemaCommentComponent = Ember.Component.extend({
|
||||
})
|
||||
.on('hidden.bs.modal', function(){
|
||||
_this.set('propModal', false)
|
||||
_this.sendAction('getSchema')
|
||||
if (_this.parentView && _this.parentView.controller)
|
||||
{
|
||||
_this.parentView.controller.send('getSchema')
|
||||
}
|
||||
$("#datasetSchemaColumnCommentModal").modal('hide');
|
||||
})
|
||||
}, 300)
|
||||
|
@ -339,3 +339,8 @@ function filterListView(category, filter)
|
||||
}
|
||||
}
|
||||
|
||||
function initializeColumnTreeGrid()
|
||||
{
|
||||
$('#json-table').treegrid();
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,3 @@
|
||||
function initializeColumnTreeGrid()
|
||||
{
|
||||
$('#json-table').treegrid();
|
||||
}
|
||||
|
||||
function initializeDependsTreeGrid()
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user