Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
fix(annotations): match fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Christine Yu authored and Shane Wilson committed Feb 28, 2015
1 parent 446b24e commit aa4e723
Show file tree
Hide file tree
Showing 9 changed files with 101 additions and 75 deletions.
28 changes: 14 additions & 14 deletions app/scripts/annotations/annotations.controllers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,28 @@ module ngApp.annotations.controllers {
this.refresh();
}



refresh() {
this.AnnotationsService.getAnnotations({
fields: [
"id",
"categoryName",
"dateCreated",
"createdBy",
"annotation_id",
"category",
//"dateCreated",
"creator",
"status",
"itemType",
"item",
"annotationClassificationName"
"item_type",
"item_id",
"classification",
"project.program.name",
"project.code"
],
facets: [
"categoryName",
"dateCreated",
"createdBy",
"category",
//"dateCreated",
"creator",
"status",
"itemType",
"item_type",
"item",
"annotationClassificationName"
"classification"
]
}).then((data) => {
if (!data.hits.length) {
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/annotations/annotations.services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ module ngApp.annotations.services {
var defaults = {
size: paging.size,
from: paging.from,
sort: paging.sort || 'itemType:asc',
sort: paging.sort || 'item_type:asc',
filters: this.LocationService.filters()
};

Expand Down
57 changes: 43 additions & 14 deletions app/scripts/annotations/annotations.table.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,74 @@ module ngApp.projects.models {

var AnnotationsTableModel:TableiciousConfig = {
title: "Annotations",
order: ['itemType', 'item', 'annotationClassificationName', 'categoryName', 'dateCreated', 'createdBy', 'status'],
order: ['annotation_id', 'participant_id', 'project.program.name', 'project.code', 'barcode', 'item_type', 'category', 'classification', 'dateCreated', 'creator', 'status'],
headings: [{
displayName: "ID",
id: "id",
id: "annotation_id",
sref: function (field) {
return "annotation({annotationId:'" + field.val + "'})";
}
}, {
},
sortable: true
},
{
displayName: "Participant ID",
id: "participant_id",
template: function () {
return "tbd";
},
sortable: true
},
{
displayName: "Program",
id: "project.program.name",
sortable: true
},
{
displayName: "Project",
id: "project.code",
sortable: true
},
{
displayName: "Item Type",
id: "itemType",
id: "item_type",
template: function (x) {
return x && x.val || "tbc";
},
sortable: true
},
{
displayName: "Item Barcode",
id: "item",
sortable: true
id: "barcode",
sortable: true,
template: function() {
return "tbd";
}
},
{
displayName: "Classification",
id: "annotationClassificationName",
displayName: "Category",
id: "category",
template: function(field,row,scope) {
return scope.$filter('ellipsicate')(field.val, 30);
},
sortable: true
},
{
displayName: "Category",
id: "categoryName",
displayName: "Classification",
id: "classification",
sortable: true
},
{
displayName: "Created Date",
id: "dateCreated",
template:function(field,row,scope){
return scope.$filter('date')(field.val);
return "tbd";
//return scope.$filter('date')(field.val);
}
},
{
displayName: "Annotator",
id: "createdBy",
id: "creator",
sortable: true
},
{
displayName: "Status",
Expand All @@ -52,4 +81,4 @@ module ngApp.projects.models {
}
angular.module("annotations.table.model", [])
.value("AnnotationsTableModel", AnnotationsTableModel);
}
}
22 changes: 12 additions & 10 deletions app/scripts/annotations/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,19 @@ module ngApp.annotations {
return AnnotationsService.getAnnotation($stateParams["annotationId"],
{
fields: [
"id",
"categoryName",
"createdBy",
"annotation_id",
"category",
"creator",
"status",
"itemType",
"item",
"annotationClassificationName",
"notes.noteText",
"notes.dateAdded",
"notes.noteId",
"notes.addedBy"
"item_type",
"item_id",
"classification",
"notes",
"project.code",
"project.project_id"
//"notes.dateAdded",
//"notes.noteId",
//"notes.addedBy"
]
});
}
Expand Down
44 changes: 22 additions & 22 deletions app/scripts/annotations/templates/annotation.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="container entity" data-scroll-spy="">
<h1 data-scroll-fix=85>
<i class="fa fa-align-left"></i>
{{ ::ac.annotation.id }}
{{ ::ac.annotation.annotation_id }}
</h1>

<div class="col-lg-2 col-md-2">
Expand All @@ -20,7 +20,6 @@ <h4 data-spy="notes" class="list-group-item-heading">
</div>
</div>
</div>

</aside>
</div>

Expand All @@ -33,51 +32,51 @@ <h3 class="panel-title" data-translate>Summary</h3>
<tbody>
<tr>
<th data-translate scope="row">Annotation ID</th>
<td>{{ ::ac.annotation.id }}</td>
<td>{{ ::ac.annotation.annotation_id }}</td>
</tr>
<tr>
<th data-translate scope="row">UUID</th>
<td>??? {{ ::ac.annotation.uuid }}</td>
<th data-translate scope="row">Item UUID</th>
<td>{{ ::ac.annotation.item_id }}</td>
</tr>
<tr>
<th data-translate scope="row">Item ID</th>
<td>{{ ::ac.annotation.item }}</td>
<th data-translate scope="row">Item Barcode</th>
<td>tbd {{ ::ac.annotation.barcode }}</td>
</tr>
<tr>
<th data-translate scope="row">Item Type</th>
<td>{{ ::ac.annotation.itemType }}</td>
<td>{{ ::ac.annotation.item_type }}</td>
</tr>
<tr>
<th data-translate scope="row">Participant ID</th>
<td>
<a data-ui-sref="participant({ participantId: ac.annotation.participant.id })">
??? {{ ::ac.annotation.participant.id }}
tbd {{ ::ac.annotation.participant.id }}
</a>
</td>
</tr>
<tr>
<th data-translate scope="row">Project</th>
<th data-translate scope="row">Project Code</th>
<td>
<a data-ui-sref="project({ projectId: ac.annotation.project.id })">
??? {{ ::ac.annotation.project.name }}
<a data-ui-sref="project({ projectId: ac.annotation.project.project_id })">
{{ ::ac.annotation.project.code}}
</a>
</td>
</tr>
<tr>
<th data-translate scope="row">Classification</th>
<td>{{ ::ac.annotation.annotationClassificationName }}</td>
<td>{{ ::ac.annotation.classification }}</td>
</tr>
<tr>
<th data-translate scope="row">Category</th>
<td>{{ ::ac.annotation.categoryName }}</td>
<td>{{ ::ac.annotation.category }}</td>
</tr>
<tr>
<th data-translate scope="row">Created On</th>
<td>{{ ::ac.annotation.dateCreated | date }}</td>
<td>tbd {{ ::ac.annotation.dateCreated | date }}</td>
</tr>
<tr>
<th data-translate scope="row">Created By</th>
<td>{{ ::ac.annotation.createdBy }}</td>
<td>{{ ::ac.annotation.creator }}</td>
</tr>
<tr>
<th data-translate scope="row">Status</th>
Expand All @@ -87,18 +86,19 @@ <h3 class="panel-title" data-translate>Summary</h3>
</table>
</div>



<div class="panel panel-default" id="notes">
<div class="panel-heading">
<h3 class="panel-title" data-translate>Notes</h3>
</div>
<div class="list-group">
<div class="list-group-item clearfix" data-ng-repeat="note in ac.annotation.notes">
<p class="list-group-item-text" style="word-break: break-all">{{ ::note.noteText}}</p>
<p class="list-group-item-text pull-right"><span data-translate>Added by</span> <strong>{{ ::note.addedBy }}</strong>
<span data-translate>on</span> <strong>{{ ::note.dateAdded | date }}</strong></p>
<div class="list-group-item clearfix">
<p class="list-group-item-text" style="word-break: break-all">{{ ::ac.annotation.notes }}</p>
</div>
<!-- <div class="list-group-item clearfix" data-ng-repeat="note in ac.annotation.notes">-->
<!--<p class="list-group-item-text" style="word-break: break-all">{{ ::note.noteText}}</p>-->
<!--<p class="list-group-item-text pull-right"><span data-translate>Added by</span> <strong>{{ ::note.addedBy }}</strong>-->
<!--<span data-translate>on</span> <strong>{{ ::note.dateAdded | date }}</strong></p>-->
<!--</div>-->
</div>
</div>
</div>
Expand Down
12 changes: 6 additions & 6 deletions app/scripts/annotations/templates/annotations.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ <h3 class="panel-title pull-left">Facets</h3>
entity="annotations"
data-template="components/facets/templates/typeahead-annotations.html"></facets-free-text>

<terms data-name="itemType"
<terms data-name="item_type"
data-title="Annotated Item"
data-facet="asc.annotations.aggregations.itemType"></terms>
<terms data-name="categoryName"
data-facet="asc.annotations.aggregations.item_type"></terms>
<terms data-name="category"
data-title="Category"
data-facet="asc.annotations.aggregations.categoryName"></terms>
<terms data-name="annotationClassificationName"
data-facet="asc.annotations.aggregations.category"></terms>
<terms data-name="classification"
data-title="Classification"
data-facet="asc.annotations.aggregations.annotationClassificationName"></terms>
data-facet="asc.annotations.aggregations.classifcation"></terms>
<terms data-name="status"
data-title="Status"
data-facet="asc.annotations.aggregations.status"></terms>
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/annotations/tests/annotations.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('Annotations:', function () {
sinon.spy(AnnotationsService.ds, 'get');

var fs = {hits: [], facets: [], pagination: {}};
httpBackend.whenGET("/annotations?filters=%7B%7D&from=1&size=10&sort=itemType:asc").respond(fs);
httpBackend.whenGET("/annotations?filters=%7B%7D&from=1&size=10&sort=item_type:asc").respond(fs);

AnnotationsService.getAnnotations();
httpBackend.flush();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
</div>
<div class="data-container">
<div class="data-row">
<span class="uuid">{{ match.model.id }}</span>
<span class="uuid">{{ match.model.annotation_id }}</span>
</div>
</div>
</div>
</a>
</a>
5 changes: 0 additions & 5 deletions app/scripts/components/tables/tableicious.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ module ngApp.components.tables.directives.tableicious {
*/
icon?(field:TableiciousEntryDefinition, row:TableiciousEntryDefinition[],scope:ITableicousScope) : string



/**
* A class or space-delimited list of classes to be applied only to the heading of the column.
* Or, a function that returns the above.
Expand Down Expand Up @@ -158,9 +156,6 @@ module ngApp.components.tables.directives.tableicious {

sortable? : boolean;




}

class TableiciousController {
Expand Down

0 comments on commit aa4e723

Please sign in to comment.