1
0
mirror of https://github.com/sismics/docs.git synced 2025-12-13 17:56:20 +00:00

Return file count on GET /document/list

This commit is contained in:
jendib
2013-08-22 17:59:24 +02:00
parent 62a5840777
commit 870a44da0d
6 changed files with 26 additions and 3 deletions

View File

@@ -171,6 +171,7 @@ public class DocumentResource extends BaseResource {
document.put("create_date", documentDto.getCreateTimestamp());
document.put("shared", documentDto.getShared());
document.put("language", documentDto.getLanguage());
document.put("file_count", documentDto.getFileCount());
// Get tags
List<TagDto> tagDtoList = tagDao.getByDocumentId(documentDto.getId());

View File

@@ -16,7 +16,8 @@ App.controller('Navigation', function($scope, $http, $state, $rootScope, User, R
setInterval(function() {
$scope.$apply(function() {
Restangular.one('app/log').get({
limit: 100,
// Error count will be wrong if there is more than 10 errors in 10 seconds
limit: 10,
level: 'ERROR'
}).then(function(data) {
// Add new errors

View File

@@ -109,6 +109,7 @@ public class TestDocumentResource extends BaseJerseyTest {
Assert.assertTrue(documents.length() == 1);
Assert.assertEquals(document1Id, documents.getJSONObject(0).getString("id"));
Assert.assertEquals("eng", documents.getJSONObject(0).getString("language"));
Assert.assertEquals(1, documents.getJSONObject(0).getInt("file_count"));
Assert.assertEquals(1, tags.length());
Assert.assertEquals(tag1Id, tags.getJSONObject(0).getString("id"));
Assert.assertEquals("SuperTag", tags.getJSONObject(0).getString("name"));