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

Commit

Permalink
feat(file): 2230 proj id in props table
Browse files Browse the repository at this point in the history
Closes #2230
  • Loading branch information
Christine Yu committed Jun 15, 2016
1 parent 53f888d commit d779477
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
4 changes: 4 additions & 0 deletions app/scripts/files/files.controllers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ module ngApp.files.controllers {
}
});

//insert project into top level because it's in the properties table
file.projects = _.reject(_.unique(file.cases.map(c => (c.project || {}).project_id)),
p => _.isUndefined(p) || _.isNull(p));

//insert cases into related_files for checking isUserProject when downloading
_.forEach(file.related_files, (related_file) => {
related_file['cases'] = file.cases;
Expand Down
1 change: 1 addition & 0 deletions app/scripts/files/files.directives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ module ngApp.files.directives {
const params = _.merge({
attachment: true,
filters: filters,
fields: 'cases.project.project_id',
expand: [
'annotations',
'archive',
Expand Down
19 changes: 16 additions & 3 deletions app/scripts/files/templates/file.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,19 @@ <h3 class="panel-title pull-left" data-translate>File Properties</h3>
</span>
</td>
</tr>
<tr>
<th scope="row" data-translate>Project ID</th>
<td>
<span data-ng-repeat="p in fc.file.projects">
<a data-ui-sref="project({ projectId: p })" >
{{ p }}
</a>{{$last ? '' : ', '}}
</span>
<span data-ng-if="fc.file.projects.length === 0">
--
</span>
</td>
</tr>
</tbody>
</table>
</div>
Expand Down Expand Up @@ -159,15 +172,15 @@ <h4 class="list-group-item-heading">No Cases Found.</h4>
<th class="sticky" scope="col" data-translate>
Entity Type
<div>Entity Type</div>
</th>
</th>
<th class="sticky" scope="col" data-translate>
Case UUID
<div>Case UUID</div>
</th>
</th>
<th class="sticky" scope="col" data-translate>
Annotations
<div>Annotations</div>
</th>
</th>
</tr>
</thead>
<tbody>
Expand Down

0 comments on commit d779477

Please sign in to comment.