Skip to content

Commit

Permalink
Fix eslint errors
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <jus@bitgrid.net>
  • Loading branch information
juliusknorr committed Sep 6, 2018
1 parent eea5803 commit a6dceb2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
1 change: 1 addition & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ extends:
env:
browser: true
amd: true
es6: true

globals:
global: false
Expand Down
2 changes: 1 addition & 1 deletion js/controller/ActivityController.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class ActivityController {
}
};
_executeFetch();
};
}

page() {
if (!this.activityservice.since[this.type][this.element.id].finished) {
Expand Down
30 changes: 17 additions & 13 deletions js/service/ActivityService.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,16 @@ class ActivityService {
deck_board: {

},
}
};
}

static getUrl(type, id, since) {
if (type === DECK_ACTIVITY_TYPE_CARD)
if (type === DECK_ACTIVITY_TYPE_CARD) {
return OC.linkToOCS('apps/activity/api/v2/activity', 2) + 'filter?format=json&object_type=deck_card&object_id=' + id + '&limit=5&since=' + since;
if (type === DECK_ACTIVITY_TYPE_BOARD)
}
if (type === DECK_ACTIVITY_TYPE_BOARD) {
return OC.linkToOCS('apps/activity/api/v2/activity', 2) + 'deck?format=json&limit=5&since=' + since;
}
}

fetchCardActivities(type, id, since) {
Expand All @@ -60,17 +62,17 @@ class ActivityService {
this.checkData(type, id);
var self = this;
return this.$http.get(ActivityService.getUrl(type, id, since)).then(function (response) {
var objects = response.data.ocs.data;
const objects = response.data.ocs.data;

var dataLengthBefore = self.data[type][id].length;
for (let index in objects) {
let item = objects[index];
self.addItem(type, id, item);
if (item.activity_id > self.since[type][id].latest) {
self.since[type][id].latest = item.activity_id;
if (objects.hasOwnProperty(index)) {
let item = objects[index];
self.addItem(type, id, item);
if (item.activity_id > self.since[type][id].latest) {
self.since[type][id].latest = item.activity_id;
}
}
}
var dataLengthAfter = self.data[type][id].length;
self.data[type][id].sort(function(a, b) {
return b.activity_id - a.activity_id;
});
Expand Down Expand Up @@ -147,8 +149,10 @@ class ActivityService {

let data = [];
for (let index in objects) {
let item = objects[index];
self.addItem(type, id, item);
if (objects.hasOwnProperty(index)) {
let item = objects[index];
self.addItem(type, id, item);
}
}
self.data[type][id].sort(function(a, b) {
return b.activity_id - a.activity_id;
Expand All @@ -172,7 +176,7 @@ class ActivityService {
return this.data[type][id];
}

};
}

app.service('ActivityService', ActivityService);

Expand Down

0 comments on commit a6dceb2

Please sign in to comment.