Skip to content

Commit 5737371

Browse files
author
Maren Süwer
committed
Added requested changes for ActivityWidget
1 parent 05f434e commit 5737371

File tree

4 files changed

+19
-48
lines changed

4 files changed

+19
-48
lines changed

src/activities/activities.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
'use strict';
2626

2727
angular.module('adf.widget.scm')
28-
.controller('ActivitiesController', function ($sce, activities, VM) {
28+
.controller('ActivitiesController', function ($sce, activities, SCM) {
2929
var vm = this;
3030
vm.status = activities.status;
3131

@@ -41,6 +41,6 @@ angular.module('adf.widget.scm')
4141
}
4242

4343
vm.gravatarHash = function (activity) {
44-
return VM.getGravatarHash(activity.changeset.properties);
44+
return SCM.getGravatarHash(activity.changeset.properties);
4545
};
4646
});

src/commits/commits.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
'use strict';
2626

2727
angular.module('adf.widget.scm')
28-
.controller('CommitsController', function ($sce, config, repository, commits, VM) {
28+
.controller('CommitsController', function ($sce, config, repository, commits, SCM) {
2929
var vm = this;
3030

3131
vm.repository = repository;
@@ -37,6 +37,6 @@ angular.module('adf.widget.scm')
3737
vm.commits = commits;
3838

3939
vm.gravatarHash = function (commit) {
40-
return VM.getGravatarHash(commit.properties);
40+
return SCM.getGravatarHash(commit.properties);
4141
};
4242
});

src/gravatarHashService.js

-43
This file was deleted.

src/service.js

+15-1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,19 @@ angular.module('adf.widget.scm')
7272
return request('repositories/' + id + '/branches');
7373
}
7474

75+
function getGravatarHash(properties) {
76+
var hash;
77+
if (properties){
78+
for (var i=0; i<properties.length; i++){
79+
if (properties[0].key === 'gravatar-hash'){
80+
hash = properties[0].value;
81+
break;
82+
}
83+
}
84+
}
85+
return hash;
86+
}
87+
7588
return {
7689
getRepositories: getRepositories,
7790
getRepository: getRepository,
@@ -80,6 +93,7 @@ angular.module('adf.widget.scm')
8093
getCommits: getCommits,
8194
getActivities: getActivities,
8295
getFileContent: getFileContent,
83-
getBranchesByRepositoryId: getBranchesByRepositoryId
96+
getBranchesByRepositoryId: getBranchesByRepositoryId,
97+
getGravatarHash: getGravatarHash
8498
};
8599
});

0 commit comments

Comments
 (0)