mirror of
https://github.com/datahub-project/datahub.git
synced 2025-10-18 12:27:15 +00:00
DSS-4080 and DSS-3941, fix the schema comment issues
This commit is contained in:
parent
cb42808cf0
commit
a39762076b
@ -675,7 +675,10 @@ public class Dataset extends Controller
|
||||
if(req.isArray()) {
|
||||
for(int i = 0; i < req.size(); i++) {
|
||||
JsonNode obj = req.get(i);
|
||||
Boolean isSuccess = DatasetsDAO.assignColumnComment(datasetId, columnId, obj.get("commentId").asInt());
|
||||
Boolean isSuccess = DatasetsDAO.assignColumnComment(
|
||||
obj.get("datasetId").asInt(),
|
||||
obj.get("columnId").asInt(),
|
||||
obj.get("commentId").asInt());
|
||||
ObjectNode itemResponse = Json.newObject();
|
||||
if(isSuccess) {
|
||||
itemResponse.put("success", "true");
|
||||
@ -688,8 +691,10 @@ public class Dataset extends Controller
|
||||
res.add(itemResponse);
|
||||
}
|
||||
} else {
|
||||
Logger.error("Comment ID: " + req.get("commentId"));
|
||||
Boolean isSuccess = DatasetsDAO.assignColumnComment(datasetId, columnId, req.get("commentId").asInt());
|
||||
Boolean isSuccess = DatasetsDAO.assignColumnComment(
|
||||
datasetId,
|
||||
columnId,
|
||||
req.get("commentId").asInt());
|
||||
ObjectNode itemResponse = Json.newObject();
|
||||
if(isSuccess) {
|
||||
itemResponse.put("success", "true");
|
||||
@ -721,7 +726,7 @@ public class Dataset extends Controller
|
||||
return ok(result);
|
||||
}
|
||||
|
||||
public static Result getSimilarColumnComments(int datasetId, int columnId) {
|
||||
public static Result getSimilarColumnComments(Long datasetId, int columnId) {
|
||||
ObjectNode result = Json.newObject();
|
||||
result.put("similar", Json.toJson(DatasetsDAO.similarColumnComments(datasetId, columnId)));
|
||||
return ok(result);
|
||||
|
@ -290,10 +290,10 @@ public class DatasetsDAO extends AbstractMySQLOpenSourceDAO
|
||||
"SELECT UPPER(field_name) FROM dict_field_detail WHERE field_id = ?";
|
||||
|
||||
private final static String GET_SIMILAR_COMMENTS_BY_FIELD_NAME =
|
||||
"SELECT count(*) as count, fd.dataset_id, " +
|
||||
"fd.default_comment_id as comment_id, fc.comment FROM dict_field_detail fd LEFT JOIN " +
|
||||
"field_comments fc ON fc.id = fd.default_comment_id WHERE UPPER(fd.field_name) = ? " +
|
||||
"AND fd.default_comment_id IS NOT NULL GROUP BY fd.default_comment_id ORDER BY count DESC";
|
||||
"SELECT count(*) as count, f.comment_id, c.comment FROM dict_field_detail d " +
|
||||
"JOIN dict_dataset_field_comment f on d.field_id = f.field_id and d.dataset_id = f.dataset_id " +
|
||||
"JOIN field_comments c on c.id = f.comment_id WHERE d.field_name = ? and f.is_default = 1 " +
|
||||
"GROUP BY f.comment_id, c.comment ORDER BY count DESC";
|
||||
|
||||
private final static String SET_COLUMN_COMMENT_TO_FALSE = "UPDATE dict_dataset_field_comment " +
|
||||
"SET is_default = false WHERE dataset_id = ? AND field_id = ? AND is_default = true";
|
||||
@ -1466,7 +1466,7 @@ public class DatasetsDAO extends AbstractMySQLOpenSourceDAO
|
||||
return result;
|
||||
}
|
||||
|
||||
public static List similarColumnComments(int datasetId, int columnId)
|
||||
public static List similarColumnComments(Long datasetId, int columnId)
|
||||
{
|
||||
List<SimilarComments> comments = new ArrayList<SimilarComments>();
|
||||
List<Map<String, Object>> rows = null;
|
||||
@ -1478,7 +1478,7 @@ public class DatasetsDAO extends AbstractMySQLOpenSourceDAO
|
||||
columnId);
|
||||
} catch(DataAccessException e) {
|
||||
Logger.error("Dataset similarColumnComments - get field name for columnId, datasetId = " +
|
||||
Integer.toString(datasetId) + " columnId = " + Integer.toString(columnId));
|
||||
Long.toString(datasetId) + " columnId = " + Integer.toString(columnId));
|
||||
Logger.error("Exception = " + e.getMessage());
|
||||
return comments;
|
||||
}
|
||||
@ -1494,12 +1494,12 @@ public class DatasetsDAO extends AbstractMySQLOpenSourceDAO
|
||||
sc.count = (Long)row.get("count");
|
||||
sc.commentId = (Long)row.get("comment_id");
|
||||
sc.comment = (String)row.get("comment");
|
||||
sc.datasetId = (Long)row.get("dataset_id");
|
||||
sc.datasetId = datasetId;
|
||||
comments.add(sc);
|
||||
}
|
||||
} catch(DataAccessException e) {
|
||||
Logger.error("Dataset similarColumnComments - get comments by field name, datasetId = " +
|
||||
Integer.toString(datasetId) + " columnId = " + Integer.toString(columnId));
|
||||
Long.toString(datasetId) + " columnId = " + Integer.toString(columnId));
|
||||
Logger.error("Exception = " + e.getMessage());
|
||||
return comments;
|
||||
}
|
||||
|
@ -56,7 +56,7 @@
|
||||
|
||||
<script type="text/x-handlebars" id="components/dataset-favorite">
|
||||
<i
|
||||
{{bind-attr class=":fa dataset.isFavorite:fa-heart:fa-heart-o"}}
|
||||
{{bind-attr class=":wh-clickable-icon :fa dataset.isFavorite:fa-heart:fa-heart-o"}}
|
||||
{{action "favorites" dataset}}
|
||||
>
|
||||
</i>
|
||||
@ -64,7 +64,7 @@
|
||||
|
||||
<script type="text/x-handlebars" id="components/dataset-owner">
|
||||
<i
|
||||
{{bind-attr class=":fa dataset.isOwned:fa-bookmark:fa-bookmark-o"}}
|
||||
{{bind-attr class=":wh-clickable-icon :fa dataset.isOwned:fa-bookmark:fa-bookmark-o"}}
|
||||
{{action "owned" dataset}}
|
||||
>
|
||||
</i>
|
||||
@ -72,7 +72,7 @@
|
||||
|
||||
<script type="text/x-handlebars" id="components/dataset-watch">
|
||||
<i
|
||||
{{bind-attr class=":fa dataset.watchId:fa-eye-slash:fa-eye"}}
|
||||
{{bind-attr class=":wh-clickable-icon :fa dataset.watchId:fa-eye-slash:fa-eye"}}
|
||||
{{action "watch" dataset}}
|
||||
>
|
||||
</i>
|
||||
@ -100,211 +100,6 @@
|
||||
{{/if}}
|
||||
</script>
|
||||
|
||||
<script type="text/x-handlebars" id="components/dataset-comments">
|
||||
<div class="row commentsHeader">
|
||||
<div class="col-xs-3">
|
||||
<b>Comments</b>
|
||||
</div>
|
||||
<div
|
||||
class="col-xs-6 text-center commentsPagination"
|
||||
>
|
||||
{{#if comments}}
|
||||
<ul class="pager">
|
||||
<li class="previous">
|
||||
<button
|
||||
class="btn btn-default btn-xs"
|
||||
{{action "pageBack"}}
|
||||
>
|
||||
<span aria-hidden="true">←</span>
|
||||
Older
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
{{page}} of {{totalPages}}
|
||||
</li>
|
||||
<li class="next">
|
||||
<button
|
||||
class="btn btn-default btn-xs"
|
||||
{{action "pageForward"}}
|
||||
>
|
||||
Newer
|
||||
<span aria-hidden="true">→</span>
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="col-xs-3 text-right pull-right">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-default btn-xs"
|
||||
{{action "showModal"}}
|
||||
>
|
||||
<i class="fa fa-plus"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row commentsArea">
|
||||
{{#if comments}}
|
||||
{{#each comment in comments}}
|
||||
<div class="col-xs-12 well comment">
|
||||
<span class="bs-docs-example">
|
||||
{{comment.type}}
|
||||
</span>
|
||||
<div class="text comment-text">
|
||||
{{comment.html}}
|
||||
</div>
|
||||
<div class="meta">
|
||||
<a href="#" class="author">{{comment.authorName}}</a>
|
||||
<span class="date">{{comment.created }}</span>
|
||||
{{#if comment.isAuthor}}
|
||||
<div
|
||||
class="pull-right actions"
|
||||
>
|
||||
<i
|
||||
class="fa fa-pencil"
|
||||
{{action "showModal" comment}}
|
||||
>
|
||||
</i>
|
||||
<i
|
||||
class="fa fa-trash"
|
||||
{{action "remove" comment}}
|
||||
>
|
||||
</i>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
{{/each}}
|
||||
{{else}}
|
||||
<div class="col-xs-12 well text-center">
|
||||
{{#if commentsLoading}}
|
||||
<i class="fa fa-spinner fa-3x spinning"></i>
|
||||
{{else}}
|
||||
No Comments.
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="modal"
|
||||
tabindex="-1"
|
||||
role="dialog"
|
||||
aria-labelledby="datasetCommentModal"
|
||||
id="datasetCommentModal"
|
||||
>
|
||||
<div class="modal-dialog modal-lg" role="document" style="top:30px;">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
Comment on <b>{{dataset.name}}</b>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-xs-3 pull-left text-right">
|
||||
{{view "select" content=commentTypes value=comment.type class="form-control"}}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li role="presentation" class="active">
|
||||
<a
|
||||
href="#datasetComment-write"
|
||||
aria-controls="datasetComment-write"
|
||||
role="tab"
|
||||
data-toggle="tab"
|
||||
>
|
||||
Write
|
||||
</a>
|
||||
</li>
|
||||
<li role="presentation">
|
||||
<a
|
||||
href="#datasetComment-preview"
|
||||
aria-controls="datasetComment-preview"
|
||||
role="tab"
|
||||
data-toggle="tab"
|
||||
>
|
||||
Preview
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div
|
||||
role="tabpanel"
|
||||
class="tab-pane active"
|
||||
id="datasetComment-write"
|
||||
>
|
||||
<div class="meldown_wrap" style="width: 787px;">
|
||||
<div class="mdt_button mdt_button_bold" title="Bold" {{action 'insertElement' 'bold'}}>
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_italic" title="Italic" {{action 'insertElement' 'italic'}}>
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_delimiter">
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_heading_1" title="H1" {{action 'insertElement' 'heading_1'}}>
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_heading_2" title="H2" {{action 'insertElement' 'heading_2'}}>
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_heading_3" title="H3" {{action 'insertElement' 'heading_3'}}>
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_delimiter">
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_list_bullets" title="Bulleted list" {{action 'insertList' 'bulleted'}}>
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_list_numbers" title="Numbered list" {{action 'insertList' 'numbered'}}>
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_blockquote" title="Blockquote" {{action 'insertList' 'blockquote'}}>
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_code" title="Source Code" {{action 'insertSourcecode'}}>
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_delimiter">
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_image" title="Image" {{action 'insertImageOrLink' 'image'}}>
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_link" title="Link" {{action 'insertImageOrLink' 'link'}}>
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_table" {{action 'importCSVTable'}} title="Import CSV table">
|
||||
</div>
|
||||
</div>
|
||||
{{textarea id="datasetcomment" value=comment.text name="text"
|
||||
class="form-control" focus-out="updatePreview"}}
|
||||
</div>
|
||||
<div
|
||||
role="tabpanel"
|
||||
class="tab-pane commentsArea"
|
||||
id="datasetComment-preview"
|
||||
>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<div class="row">
|
||||
<div class="col-xs-6 pull-right text-right">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-default"
|
||||
data-dismiss="modal"
|
||||
{{action "hideModal"}}
|
||||
>
|
||||
Close
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-primary"
|
||||
{{action "create" comment}}
|
||||
>
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
</script>
|
||||
|
||||
<script type="text/x-handlebars" id="datasets">
|
||||
<div id="pagedDatasets">
|
||||
<div class="row">
|
||||
@ -536,384 +331,6 @@
|
||||
{{/if}}
|
||||
</script>
|
||||
|
||||
<script type="text/x-handlebars" id="components/schema-comment">
|
||||
<i
|
||||
class="fa fa-pencil pull-right"
|
||||
{{action "openModal"}}
|
||||
></i>
|
||||
{{#if propModal}}
|
||||
<div class="modal fade" id="datasetSchemaColumnCommentModal" tabindex="-1" role="dialog" aria-labelledby="Dataset Schema Column Comments">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" aria-label="Close" {{action "closeModal"}}>
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title">Comments for <b>{{schema.fieldName}}</b></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
{{#if loading}}
|
||||
<div class="row text-center">
|
||||
<div class="col-xs-10 col-xs-offset-1 text-center">
|
||||
<i class="fa fa-spinner spinning fa-4x"></i>
|
||||
</div>
|
||||
</div>
|
||||
{{else}}
|
||||
{{#if comments}}
|
||||
{{#each comments as |comment|}}
|
||||
<div class="row">
|
||||
<div class="col-xs-10 col-xs-offset-1 well comment">
|
||||
{{#if comment.isDefault}}
|
||||
<div class="bs-docs-example">
|
||||
<i class="fa fa-star active"></i>
|
||||
Default
|
||||
</div>
|
||||
{{/if}}
|
||||
<div class="text wrap-all-word comment-text commentsArea">
|
||||
{{comment.html}}
|
||||
</div>
|
||||
<div class="meta">
|
||||
<a href="#" class="author">{{comment.authorName}}</a>
|
||||
<span class="date">{{comment.created }}</span>
|
||||
<div class="pull-right actions">
|
||||
<i
|
||||
class="fa fa-arrow-circle-o-up"
|
||||
title="Promote to Default Comment"
|
||||
{{action "setDefault" comment}}
|
||||
>
|
||||
</i>
|
||||
{{#if comment.isAuthor}}
|
||||
<i
|
||||
class="fa fa-pencil"
|
||||
title="Edit"
|
||||
{{action "editMode" comment}}
|
||||
>
|
||||
</i>
|
||||
<i
|
||||
class="fa fa-trash"
|
||||
title="Remove"
|
||||
{{action "remove" comment}}
|
||||
>
|
||||
</i>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/each}}
|
||||
{{else}}
|
||||
<div class="row">
|
||||
<div class="col-xs-10 col-xs-offset-1 well text-center">
|
||||
No Comments
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{#if multiFields}}
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div>
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li role="presentation" class="active">
|
||||
<a href="#similarColumns-view" aria-controls="similarColumns-view" role="tab" data-toggle="tab">
|
||||
Datasets for <b>{{schema.fieldName}}</b>
|
||||
</a>
|
||||
</li>
|
||||
<li role="presentation">
|
||||
<a href="#similarColumns-selected" aria-controls="similarColumns-selected" role="tab" data-toggle="tab">
|
||||
Selected ({{selectedSimilarColumns.length}})
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div role="tabpanel" class="tab-pane active" id="similarColumns-view">
|
||||
<nav>
|
||||
<ul class="pager">
|
||||
<li class="previous">
|
||||
<a href="#" {{action "similarColumnsPrevPage"}}>Prev</a>
|
||||
</li>
|
||||
<li class="next">
|
||||
<a href="#" {{action "similarColumnsNextPage"}}>Next</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<table class="table table-striped table-bordered" style="word-break: break-all;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center col-xs-1">
|
||||
</th>
|
||||
<th class="text-center col-xs-2">Dataset Name</th>
|
||||
<th class="text-center col-xs-2">Source</th>
|
||||
<th class="text-center col-xs-2">Data Type</th>
|
||||
<th class="text-center col-xs-5">Default Comment</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#unless similarColumns.count}}
|
||||
{{#if similarColumns.loading}}
|
||||
<tr>
|
||||
<td colspan="5">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 text-center">
|
||||
<i
|
||||
class="fa fa-spinner spinning 2x"
|
||||
></i>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{{else }}
|
||||
<tr>
|
||||
<td colspan="5">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 text-center">
|
||||
No Similar Columns.
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{{/if}}
|
||||
{{/unless}}
|
||||
{{#each similarColumns.data as |similar index|}}
|
||||
<tr {{action "selectSimilarColumn" similar index}}>
|
||||
<td class="text-center">
|
||||
{{input type="checkbox" checked=similar.selected disabled=true}}
|
||||
</td>
|
||||
<td>{{similar.datasetName}}</td>
|
||||
<td>{{similar.source}}</td>
|
||||
<td>{{similar.dataType}}</td>
|
||||
<td>{{similar.html}}</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div role="tabpanel" class="tab-pane" id="similarColumns-selected">
|
||||
<table class="table table-striped table-bordered" style="word-break: break-all;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center col-xs-1"></th>
|
||||
<th class="text-center col-xs-2">Dataset Name</th>
|
||||
<th class="text-center col-xs-2">Source</th>
|
||||
<th class="text-center col-xs-2">Data Type</th>
|
||||
<th class="text-center col-xs-5">Default Comment</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#unless selectedSimilarColumns}}
|
||||
<tr>
|
||||
<td colspan="5">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 text-center">
|
||||
No Similar Columns Selected.
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{{/unless}}
|
||||
{{#each selectedSimilarColumns as |similar index|}}
|
||||
<tr {{action "selectSimilarColumn" similar index}}>
|
||||
<td class="text-center">
|
||||
{{input type="checkbox" checked=similar.selected disabled=true}}
|
||||
</td>
|
||||
<td>{{similar.datasetName}}</td>
|
||||
<td>{{similar.source}}</td>
|
||||
<td>{{similar.dataType}}</td>
|
||||
<td>{{similar.html}}</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#unless promotionFlow}}
|
||||
<div>
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li role="presentation" class="active">
|
||||
<a
|
||||
href="#datasetSchemaComment-write"
|
||||
aria-controls="datasetSchemaComment-write"
|
||||
role="tab"
|
||||
data-toggle="tab"
|
||||
{{action "setTab" "write"}}>
|
||||
Write
|
||||
</a>
|
||||
</li>
|
||||
<li role="presentation">
|
||||
<a
|
||||
href="#datasetSchemaComment-preview"
|
||||
aria-controls="datasetSchemaComment-preview"
|
||||
role="tab"
|
||||
data-toggle="tab"
|
||||
{{action "setTab" "preview"}}>
|
||||
Preview
|
||||
</a>
|
||||
</li>
|
||||
<li role="presentation">
|
||||
<a
|
||||
href="#datasetSchemaComment-similar"
|
||||
aria-controls="datasetSchemaComment-similar"
|
||||
role="tab"
|
||||
data-toggle="tab"
|
||||
{{action "setTab" "similar"}}
|
||||
>
|
||||
Comments for Similar Fields
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div
|
||||
role="tabpanel"
|
||||
class="tab-pane active"
|
||||
id="datasetSchemaComment-write">
|
||||
<div class="meldown_wrap" style="width: 787px;">
|
||||
<div class="mdt_button mdt_button_bold" title="Bold" {{action 'insertElement' 'bold'}}>
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_italic" title="Italic" {{action 'insertElement' 'italic'}}>
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_delimiter">
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_heading_1" title="H1" {{action 'insertElement' 'heading_1'}}>
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_heading_2" title="H2" {{action 'insertElement' 'heading_2'}}>
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_heading_3" title="H3" {{action 'insertElement' 'heading_3'}}>
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_delimiter">
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_list_bullets" title="Bulleted list" {{action 'insertList' 'bulleted'}}>
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_list_numbers" title="Numbered list" {{action 'insertList' 'numbered'}}>
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_blockquote" title="Blockquote" {{action 'insertList' 'blockquote'}}>
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_code" title="Source Code" {{action 'insertSourcecode'}}>
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_delimiter">
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_image" title="Image" {{action 'insertImageOrLink' 'image'}}>
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_link" title="Link" {{action 'insertImageOrLink' 'link'}}>
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_table" {{action 'importCSVTable'}} title="Import CSV table">
|
||||
</div>
|
||||
</div>
|
||||
{{textarea id="datasetschemacomment" value=comment.text name="text" class="form-control" focus-out="updatePreview"}}
|
||||
</div>
|
||||
<div
|
||||
role="tabpanel"
|
||||
class="tab-pane commentsArea"
|
||||
id="datasetSchemaComment-preview">
|
||||
</div>
|
||||
<div
|
||||
role="tabpanel"
|
||||
class="tab-pane"
|
||||
id="datasetSchemaComment-similar">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 text-center">
|
||||
<table class="table table-striped" style="word-break: break-all;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-xs-1"></th>
|
||||
<th class="col-xs-9">Comment</th>
|
||||
<th class="col-xs-2 text-center">Count</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#each similarComments as |comment index|}}
|
||||
<tr>
|
||||
<td>
|
||||
<input
|
||||
type="radio"
|
||||
name="selectedComment"
|
||||
{{bind-attr value="index"}}
|
||||
/>
|
||||
</td>
|
||||
<td class="text-left">{{comment.html}}</td>
|
||||
<td>{{comment.count}}</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/unless}}
|
||||
{{#if commentError}}
|
||||
<div class="alert alert-danger alert-dismissible" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
{{errorMsg}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
{{#unless promotionFlow}}
|
||||
{{#unless similarFlow}}
|
||||
<button type="button" class="btn btn-primary" {{action "create"}}>
|
||||
Submit
|
||||
</button>
|
||||
{{/unless}}
|
||||
{{#if similarFlow}}
|
||||
<button type="button" class="btn btn-primary" {{action "promote"}}>
|
||||
Set As Default Comment
|
||||
</button>
|
||||
{{/if}}
|
||||
{{/unless}}
|
||||
{{#if promotionFlow}}
|
||||
{{#unless multiFields}}
|
||||
<button
|
||||
class="btn btn-primary"
|
||||
{{action "promote"}}
|
||||
>
|
||||
This Dataset
|
||||
</button>
|
||||
<button
|
||||
class="btn btn-warning"
|
||||
{{action "setMultifields"}}
|
||||
>
|
||||
Multiple Datasets
|
||||
</button>
|
||||
{{/unless}}
|
||||
{{/if}}
|
||||
{{#unless isEdit}}
|
||||
{{#if promotionFlow}}
|
||||
{{#if multiFields}}
|
||||
<button
|
||||
class="btn btn-primary"
|
||||
{{action "promote"}}
|
||||
>
|
||||
Promote
|
||||
{{#if promoteLoading}}
|
||||
<i
|
||||
class="fa fa-spinner spinning"
|
||||
>
|
||||
</i>
|
||||
{{/if}}
|
||||
</button>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/unless}}
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-default"
|
||||
data-dismiss="modal"
|
||||
>
|
||||
Close
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
</script>
|
||||
|
||||
<script type="text/x-handlebars" data-template-name="property">
|
||||
{{#if hasProperty}}
|
||||
<div>
|
||||
|
@ -576,5 +576,605 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/x-handlebars" id="components/dataset-comments">
|
||||
<div class="row commentsHeader">
|
||||
<div class="col-xs-3">
|
||||
<b>Comments</b>
|
||||
</div>
|
||||
<div
|
||||
class="col-xs-6 text-center commentsPagination"
|
||||
>
|
||||
{{#if comments}}
|
||||
<ul class="pager">
|
||||
<li class="previous">
|
||||
<button
|
||||
class="btn btn-default btn-xs"
|
||||
{{action "pageBack"}}
|
||||
>
|
||||
<span aria-hidden="true">←</span>
|
||||
Older
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
{{page}} of {{totalPages}}
|
||||
</li>
|
||||
<li class="next">
|
||||
<button
|
||||
class="btn btn-default btn-xs"
|
||||
{{action "pageForward"}}
|
||||
>
|
||||
Newer
|
||||
<span aria-hidden="true">→</span>
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="col-xs-3 text-right pull-right">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-default btn-xs"
|
||||
{{action "showModal"}}
|
||||
>
|
||||
<i class="fa fa-plus"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row commentsArea">
|
||||
{{#if comments}}
|
||||
{{#each comment in comments}}
|
||||
<div class="col-xs-12 well comment">
|
||||
<span class="bs-docs-example">
|
||||
{{comment.type}}
|
||||
</span>
|
||||
<div class="text comment-text">
|
||||
{{comment.html}}
|
||||
</div>
|
||||
<div class="meta">
|
||||
<a href="#" class="author">{{comment.authorName}}</a>
|
||||
<span class="date">{{comment.created }}</span>
|
||||
{{#if comment.isAuthor}}
|
||||
<div
|
||||
class="pull-right actions"
|
||||
>
|
||||
<i
|
||||
class="fa fa-pencil"
|
||||
{{action "showModal" comment}}
|
||||
>
|
||||
</i>
|
||||
<i
|
||||
class="fa fa-trash"
|
||||
{{action "remove" comment}}
|
||||
>
|
||||
</i>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
{{/each}}
|
||||
{{else}}
|
||||
<div class="col-xs-12 well text-center">
|
||||
{{#if commentsLoading}}
|
||||
<i class="fa fa-spinner fa-3x spinning"></i>
|
||||
{{else}}
|
||||
No Comments.
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="modal"
|
||||
tabindex="-1"
|
||||
role="dialog"
|
||||
aria-labelledby="datasetCommentModal"
|
||||
id="datasetCommentModal"
|
||||
>
|
||||
<div class="modal-dialog modal-lg" role="document" style="top:30px;">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
Comment on <b>{{dataset.name}}</b>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-xs-3 pull-left text-right">
|
||||
{{view "select" content=commentTypes value=comment.type class="form-control"}}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li role="presentation" class="active">
|
||||
<a
|
||||
href="#datasetComment-write"
|
||||
aria-controls="datasetComment-write"
|
||||
role="tab"
|
||||
data-toggle="tab"
|
||||
>
|
||||
Write
|
||||
</a>
|
||||
</li>
|
||||
<li role="presentation">
|
||||
<a
|
||||
href="#datasetComment-preview"
|
||||
aria-controls="datasetComment-preview"
|
||||
role="tab"
|
||||
data-toggle="tab"
|
||||
>
|
||||
Preview
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div
|
||||
role="tabpanel"
|
||||
class="tab-pane active"
|
||||
id="datasetComment-write"
|
||||
>
|
||||
<div class="meldown_wrap" style="width: 787px;">
|
||||
<div class="mdt_button mdt_button_bold" title="Bold" {{action 'insertElement' 'bold'}}>
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_italic" title="Italic" {{action 'insertElement' 'italic'}}>
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_delimiter">
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_heading_1" title="H1" {{action 'insertElement' 'heading_1'}}>
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_heading_2" title="H2" {{action 'insertElement' 'heading_2'}}>
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_heading_3" title="H3" {{action 'insertElement' 'heading_3'}}>
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_delimiter">
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_list_bullets" title="Bulleted list" {{action 'insertList' 'bulleted'}}>
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_list_numbers" title="Numbered list" {{action 'insertList' 'numbered'}}>
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_blockquote" title="Blockquote" {{action 'insertList' 'blockquote'}}>
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_code" title="Source Code" {{action 'insertSourcecode'}}>
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_delimiter">
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_image" title="Image" {{action 'insertImageOrLink' 'image'}}>
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_link" title="Link" {{action 'insertImageOrLink' 'link'}}>
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_table" {{action 'importCSVTable'}} title="Import CSV table">
|
||||
</div>
|
||||
</div>
|
||||
{{textarea id="datasetcomment" value=comment.text name="text"
|
||||
class="form-control" focus-out="updatePreview"}}
|
||||
</div>
|
||||
<div
|
||||
role="tabpanel"
|
||||
class="tab-pane commentsArea"
|
||||
id="datasetComment-preview"
|
||||
>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<div class="row">
|
||||
<div class="col-xs-6 pull-right text-right">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-default"
|
||||
data-dismiss="modal"
|
||||
{{action "hideModal"}}
|
||||
>
|
||||
Close
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-primary"
|
||||
{{action "create" comment}}
|
||||
>
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
</script>
|
||||
|
||||
<script type="text/x-handlebars" id="components/schema-comment">
|
||||
<i
|
||||
class="fa fa-pencil pull-right wh-clickable-icon"
|
||||
{{action "openModal"}}
|
||||
></i>
|
||||
{{#if propModal}}
|
||||
<div class="modal fade" id="datasetSchemaColumnCommentModal" tabindex="-1" role="dialog" aria-labelledby="Dataset Schema Column Comments">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" aria-label="Close" {{action "closeModal"}}>
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title">Comments for <b>{{schema.fieldName}}</b></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
{{#if loading}}
|
||||
<div class="row text-center">
|
||||
<div class="col-xs-10 col-xs-offset-1 text-center">
|
||||
<i class="fa fa-spinner spinning fa-4x"></i>
|
||||
</div>
|
||||
</div>
|
||||
{{else}}
|
||||
{{#if comments}}
|
||||
{{#each comments as |comment|}}
|
||||
<div class="row">
|
||||
<div class="col-xs-10 col-xs-offset-1 well comment">
|
||||
{{#if comment.isDefault}}
|
||||
<div class="bs-docs-example">
|
||||
<i class="fa fa-star active"></i>
|
||||
Default
|
||||
</div>
|
||||
{{/if}}
|
||||
<div class="text wrap-all-word comment-text commentsArea">
|
||||
{{comment.html}}
|
||||
</div>
|
||||
<div class="meta">
|
||||
<a href="#" class="author">{{comment.authorName}}</a>
|
||||
<span class="date">{{comment.created }}</span>
|
||||
<div class="pull-right actions">
|
||||
<i
|
||||
class="fa fa-arrow-circle-o-up wh-clickable-icon"
|
||||
title="Promote to Default Comment"
|
||||
{{action "setDefault" comment}}
|
||||
>
|
||||
</i>
|
||||
{{#if comment.isAuthor}}
|
||||
<i
|
||||
class="fa fa-pencil"
|
||||
title="Edit"
|
||||
{{action "editMode" comment}}
|
||||
>
|
||||
</i>
|
||||
<i
|
||||
class="fa fa-trash"
|
||||
title="Remove"
|
||||
{{action "remove" comment}}
|
||||
>
|
||||
</i>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/each}}
|
||||
{{else}}
|
||||
<div class="row">
|
||||
<div class="col-xs-10 col-xs-offset-1 well text-center">
|
||||
No Comments
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{#if multiFields}}
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div>
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li role="presentation" class="active">
|
||||
<a href="#similarColumns-view" aria-controls="similarColumns-view" role="tab" data-toggle="tab">
|
||||
Datasets for <b>{{schema.fieldName}}</b>
|
||||
</a>
|
||||
</li>
|
||||
<li role="presentation">
|
||||
<a href="#similarColumns-selected" aria-controls="similarColumns-selected" role="tab" data-toggle="tab">
|
||||
Selected ({{selectedSimilarColumns.length}})
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content" style="overflow-x:hidden; overflow-y: auto; height:400px;">
|
||||
<div role="tabpanel" class="tab-pane active" id="similarColumns-view">
|
||||
<nav>
|
||||
<ul class="pager">
|
||||
<li class="previous">
|
||||
<a href="#" {{action "similarColumnsPrevPage"}}>Prev</a>
|
||||
</li>
|
||||
<li>
|
||||
{{ similarColumns.count }} comments - page {{ similarColumns.page }} of {{ similarColumns.totalPages }}
|
||||
</li>
|
||||
<li class="next">
|
||||
<a href="#" {{action "similarColumnsNextPage"}}>Next</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<table class="table table-striped table-bordered" style="word-break: break-all;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center col-xs-1">
|
||||
{{#if similarColumns.selectedAll}}
|
||||
<input type="checkbox" checked {{action "selectAllSimilarColumn" false}} />
|
||||
{{else}}
|
||||
<input type="checkbox" {{action "selectAllSimilarColumn" true}} />
|
||||
{{/if}}
|
||||
</th>
|
||||
<th class="text-center col-xs-2">Dataset Name</th>
|
||||
<th class="text-center col-xs-2">Source</th>
|
||||
<th class="text-center col-xs-2">Data Type</th>
|
||||
<th class="text-center col-xs-5">Default Comment</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#unless similarColumns.count}}
|
||||
{{#if similarColumns.loading}}
|
||||
<tr>
|
||||
<td colspan="5">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 text-center">
|
||||
<i
|
||||
class="fa fa-spinner spinning 2x"
|
||||
></i>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{{else }}
|
||||
<tr>
|
||||
<td colspan="5">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 text-center">
|
||||
No Similar Columns.
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{{/if}}
|
||||
{{/unless}}
|
||||
{{#each similarColumns.data as |similar index|}}
|
||||
<tr>
|
||||
<td class="text-center">
|
||||
{{#if similar.selected}}
|
||||
<input type="checkbox" checked {{action "selectSimilarColumn" similar index}} />
|
||||
{{else}}
|
||||
<input type="checkbox" {{action "selectSimilarColumn" similar index}} />
|
||||
{{/if}}
|
||||
</td>
|
||||
<td>{{similar.datasetName}}</td>
|
||||
<td>{{similar.source}}</td>
|
||||
<td>{{similar.dataType}}</td>
|
||||
<td>{{similar.html}}</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div role="tabpanel" class="tab-pane" id="similarColumns-selected">
|
||||
<table class="table table-striped table-bordered" style="word-break: break-all;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center col-xs-1">
|
||||
</th>
|
||||
<th class="text-center col-xs-2">Dataset Name</th>
|
||||
<th class="text-center col-xs-2">Source</th>
|
||||
<th class="text-center col-xs-2">Data Type</th>
|
||||
<th class="text-center col-xs-5">Default Comment</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#unless selectedSimilarColumns}}
|
||||
<tr>
|
||||
<td colspan="5">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 text-center">
|
||||
No Similar Columns Selected.
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{{/unless}}
|
||||
{{#each selectedSimilarColumns as |similar index|}}
|
||||
<tr>
|
||||
<td class="text-center">
|
||||
{{#if similar.selected}}
|
||||
<input type="checkbox" checked {{action "selectSimilarColumn" similar index}} />
|
||||
{{else}}
|
||||
<input type="checkbox" {{action "selectSimilarColumn" similar index}} />
|
||||
{{/if}}
|
||||
</td>
|
||||
<td>{{similar.datasetName}}</td>
|
||||
<td>{{similar.source}}</td>
|
||||
<td>{{similar.dataType}}</td>
|
||||
<td>{{similar.html}}</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#unless promotionFlow}}
|
||||
<div>
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li role="presentation" class="active">
|
||||
<a
|
||||
href="#datasetSchemaComment-write"
|
||||
aria-controls="datasetSchemaComment-write"
|
||||
role="tab"
|
||||
data-toggle="tab"
|
||||
{{action "setTab" "write"}}>
|
||||
Write
|
||||
</a>
|
||||
</li>
|
||||
<li role="presentation">
|
||||
<a
|
||||
href="#datasetSchemaComment-preview"
|
||||
aria-controls="datasetSchemaComment-preview"
|
||||
role="tab"
|
||||
data-toggle="tab"
|
||||
{{action "setTab" "preview"}}>
|
||||
Preview
|
||||
</a>
|
||||
</li>
|
||||
<li role="presentation">
|
||||
<a
|
||||
href="#datasetSchemaComment-similar"
|
||||
aria-controls="datasetSchemaComment-similar"
|
||||
role="tab"
|
||||
data-toggle="tab"
|
||||
{{action "setTab" "similar"}}
|
||||
>
|
||||
Comments for Similar Fields
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div
|
||||
role="tabpanel"
|
||||
class="tab-pane active"
|
||||
id="datasetSchemaComment-write">
|
||||
<div class="meldown_wrap" style="width: 787px;">
|
||||
<div class="mdt_button mdt_button_bold" title="Bold" {{action 'insertElement' 'bold'}}>
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_italic" title="Italic" {{action 'insertElement' 'italic'}}>
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_delimiter">
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_heading_1" title="H1" {{action 'insertElement' 'heading_1'}}>
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_heading_2" title="H2" {{action 'insertElement' 'heading_2'}}>
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_heading_3" title="H3" {{action 'insertElement' 'heading_3'}}>
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_delimiter">
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_list_bullets" title="Bulleted list" {{action 'insertList' 'bulleted'}}>
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_list_numbers" title="Numbered list" {{action 'insertList' 'numbered'}}>
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_blockquote" title="Blockquote" {{action 'insertList' 'blockquote'}}>
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_code" title="Source Code" {{action 'insertSourcecode'}}>
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_delimiter">
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_image" title="Image" {{action 'insertImageOrLink' 'image'}}>
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_link" title="Link" {{action 'insertImageOrLink' 'link'}}>
|
||||
</div>
|
||||
<div class="mdt_button mdt_button_table" {{action 'importCSVTable'}} title="Import CSV table">
|
||||
</div>
|
||||
</div>
|
||||
{{textarea id="datasetschemacomment" value=comment.text name="text" class="form-control" focus-out="updatePreview"}}
|
||||
</div>
|
||||
<div
|
||||
role="tabpanel"
|
||||
class="tab-pane commentsArea"
|
||||
id="datasetSchemaComment-preview">
|
||||
</div>
|
||||
<div
|
||||
role="tabpanel"
|
||||
class="tab-pane"
|
||||
id="datasetSchemaComment-similar">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 text-center">
|
||||
<table class="table table-striped" style="word-break: break-all;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-xs-1"></th>
|
||||
<th class="col-xs-9">Comment</th>
|
||||
<th class="col-xs-2 text-center">Count</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#each similarComments as |comment index|}}
|
||||
<tr>
|
||||
<td>
|
||||
<input
|
||||
type="radio"
|
||||
name="selectedComment"
|
||||
{{bind-attr value="index"}}
|
||||
/>
|
||||
</td>
|
||||
<td class="text-left">{{comment.html}}</td>
|
||||
<td>{{comment.count}}</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/unless}}
|
||||
{{#if commentError}}
|
||||
<div class="alert alert-danger alert-dismissible" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
{{errorMsg}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
{{#unless promotionFlow}}
|
||||
{{#unless similarFlow}}
|
||||
<button type="button" class="btn btn-primary" {{action "create"}}>
|
||||
Submit
|
||||
</button>
|
||||
{{/unless}}
|
||||
{{#if similarFlow}}
|
||||
<button type="button" class="btn btn-primary" {{action "promote"}}>
|
||||
Set As Default Comment
|
||||
</button>
|
||||
{{/if}}
|
||||
{{/unless}}
|
||||
{{#if promotionFlow}}
|
||||
{{#unless multiFields}}
|
||||
<button
|
||||
class="btn btn-primary"
|
||||
{{action "promote"}}
|
||||
>
|
||||
This Dataset
|
||||
</button>
|
||||
<button
|
||||
class="btn btn-warning"
|
||||
{{action "setMultifields"}}
|
||||
>
|
||||
Multiple Datasets
|
||||
</button>
|
||||
{{/unless}}
|
||||
{{/if}}
|
||||
{{#unless isEdit}}
|
||||
{{#if promotionFlow}}
|
||||
{{#if multiFields}}
|
||||
<button
|
||||
class="btn btn-primary"
|
||||
{{action "promote"}}
|
||||
>
|
||||
Promote
|
||||
{{#if promoteLoading}}
|
||||
<i
|
||||
class="fa fa-spinner spinning"
|
||||
>
|
||||
</i>
|
||||
{{/if}}
|
||||
</button>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/unless}}
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-default"
|
||||
data-dismiss="modal"
|
||||
>
|
||||
Close
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -71,7 +71,7 @@ GET /api/v1/datasets/:id/columns/:columnId/similar controllers.api.v1.D
|
||||
|
||||
GET /api/v1/datasets/:id/columns/:columnId/comments controllers.api.v1.Dataset.getPagedDatasetColumnComments(id:Int, columnId:Int)
|
||||
|
||||
GET /api/v1/datasets/:id/columns/:columnId/comments/similar controllers.api.v1.Dataset.getSimilarColumnComments(id:Int, columnId:Int)
|
||||
GET /api/v1/datasets/:id/columns/:columnId/comments/similar controllers.api.v1.Dataset.getSimilarColumnComments(id:Long, columnId:Int)
|
||||
|
||||
POST /api/v1/datasets/:id/columns/:columnId/comments controllers.api.v1.Dataset.postDatasetColumnComment(id:Int, columnId:Int)
|
||||
|
||||
|
@ -222,13 +222,23 @@ App.SchemaCommentComponent = Ember.Component.extend({
|
||||
col.html = marked(col.comment || "").htmlSafe()
|
||||
col.selected = false
|
||||
})
|
||||
var page = _this.get('similarColumns.page');
|
||||
if (!page)
|
||||
{
|
||||
page = 1;
|
||||
}
|
||||
var pageSize = _this.get('similarColumns.pageSize');
|
||||
if (!pageSize)
|
||||
{
|
||||
pageSize = 10;
|
||||
}
|
||||
var similarColumns = {
|
||||
page: _this.get('similarColumns.page'),
|
||||
page: page,
|
||||
all: columns,
|
||||
count: columns.length,
|
||||
pageSize: _this.get('similarColumns.pageSize'),
|
||||
totalPages: Math.ceil(columns.length / _this.get('similarColumns.pageSize')),
|
||||
data: columns.slice(0,10),
|
||||
pageSize: pageSize,
|
||||
totalPages: Math.ceil(columns.length / pageSize),
|
||||
data: columns.slice(0, pageSize),
|
||||
loading: false
|
||||
}
|
||||
_this.set('similarColumns', similarColumns)
|
||||
@ -248,7 +258,6 @@ App.SchemaCommentComponent = Ember.Component.extend({
|
||||
comments.forEach(function(cmnt){
|
||||
cmnt.html = marked(cmnt.comment || "").htmlSafe()
|
||||
})
|
||||
console.log('Similar Comments: ', comments)
|
||||
_this.set('similarComments', comments)
|
||||
}
|
||||
)
|
||||
@ -540,6 +549,7 @@ App.SchemaCommentComponent = Ember.Component.extend({
|
||||
} else {
|
||||
selected.commentId = selectedComment.id
|
||||
}
|
||||
console.log(selected);
|
||||
this.set("promoteDisabled", true)
|
||||
this.set("promoteLoading, true")
|
||||
var params =
|
||||
@ -578,7 +588,6 @@ App.SchemaCommentComponent = Ember.Component.extend({
|
||||
this.getSimilarColumns()
|
||||
},
|
||||
setTab: function(name) {
|
||||
console.log('Tab Selected: ', name)
|
||||
this.set('currentTab', name)
|
||||
if(name !== "similar") {
|
||||
$("input[name='selectedComment']:checked").each(function(){
|
||||
@ -616,11 +625,28 @@ App.SchemaCommentComponent = Ember.Component.extend({
|
||||
var page = this.get('similarColumns.page');
|
||||
var pageSize = this.get('similarColumns.pageSize');
|
||||
var index = ((page - 1) * pageSize) + idx
|
||||
console.log('Index: ', index)
|
||||
var all = this.get('similarColumns.all');
|
||||
Ember.set(all[index], "selected", Ember.get(similar, "selected"));
|
||||
this.set('selectedSimilarColumns', this.getSelected())
|
||||
this.set('similarColumns.all', all)
|
||||
},
|
||||
selectAllSimilarColumn: function(selected)
|
||||
{
|
||||
var columns = this.get('similarColumns.all');
|
||||
var model = this.get('similarColumns');
|
||||
Ember.set(model, "selectedAll", selected);
|
||||
for(var i = 0; i < columns.length; i++)
|
||||
{
|
||||
Ember.set(columns[i], "selected", selected);
|
||||
}
|
||||
if (selected)
|
||||
{
|
||||
this.set('selectedSimilarColumns', columns);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.set('selectedSimilarColumns', []);
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -665,4 +665,8 @@ table tr td {
|
||||
|
||||
div.commentsArea td, div.commentsArea th, div.commentsArea table{
|
||||
border: 1px solid black;
|
||||
}
|
||||
|
||||
.wh-clickable-icon {
|
||||
cursor: pointer;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user