Skip to content

Commit 881cdcf

Browse files
committed
update dist
1 parent 04f9c52 commit 881cdcf

File tree

2 files changed

+68
-12
lines changed

2 files changed

+68
-12
lines changed

dist/adf-widget-redmine.js

+67-11
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,19 @@
44
angular.module('adf.widget.redmine', ['adf.provider', 'smart-table'])
55
.constant("redmineEndpoint", "http://www.redmine.org/")
66
.config(["dashboardProvider", function(dashboardProvider){
7+
8+
var edit = {
9+
templateUrl: '{widgetsPath}/redmine/src/issues/edit/edit.html',
10+
controller: 'editController',
11+
controllerAs: 'vm',
12+
resolve: {
13+
/** @ngInject **/
14+
projects: ["redmineService", function(redmineService){
15+
return redmineService.getProjects();
16+
}]
17+
}
18+
};
19+
720
dashboardProvider
821
.widget('redmineIssues', {
922
title: 'Redmine Issues',
@@ -13,24 +26,44 @@ angular.module('adf.widget.redmine', ['adf.provider', 'smart-table'])
1326
controllerAs: 'vm',
1427
resolve: {
1528
/** @ngInject **/
16-
issues: ["redmineService", function(redmineService){
17-
return redmineService.getIssues();
29+
issues: ["redmineService", "config", function(redmineService, config){
30+
return redmineService.getIssues(config);
1831
}]
1932
},
20-
edit: {
21-
templateUrl: '{widgetsPath}/redmine/src/issues/edit/edit.html'
22-
}
33+
edit: edit
2334
});
2435
}]);
2536

26-
angular.module("adf.widget.redmine").run(["$templateCache", function($templateCache) {$templateCache.put("{widgetsPath}/redmine/src/issues/view.html","<table st-table=rowCollection class=\"table table-striped\"><thead><tr><th>ID</th><th>Tracker</th><th>Status</th><th>Thema</th></tr></thead><tbody><tr ng-repeat=\"issue in vm.issues\"><td><a href=\'{{\"http://www.redmine.org/issues/\"+issue.id}}\'>{{issue.id}}</a></td><td>{{issue.tracker.name}}</td><td>{{issue.status.name}}</td><td>{{issue.subject}}</td></tr></tbody></table>");
27-
$templateCache.put("{widgetsPath}/redmine/src/issues/edit/edit.html","<form role=form><div class=form-group><label for=sample>Sample</label> <input type=text class=form-control id=sample ng-model=config.sample placeholder=\"Enter sample\"></div></form>");}]);
37+
angular.module("adf.widget.redmine").run(["$templateCache", function($templateCache) {$templateCache.put("{widgetsPath}/redmine/src/issues/view.html","<table st-table=rowCollection class=\"table table-striped\"><thead><tr><th ng-if=vm.config.columns.id.show>ID</th><th ng-if=vm.config.columns.tracker.show>Tracker</th><th ng-if=vm.config.columns.status.show>Status</th><th ng-if=vm.config.columns.subject.show>Subject</th></tr></thead><tbody><tr ng-repeat=\"issue in vm.issues\"><td ng-if=vm.config.columns.id.show><a href=\'{{\"http://www.redmine.org/issues/\"+issue.id}}\'>{{issue.id}}</a></td><td ng-if=vm.config.columns.tracker.show>{{issue.tracker.name}}</td><td ng-if=vm.config.columns.status.show>{{issue.status.name}}</td><td ng-if=vm.config.columns.subject.show>{{issue.subject}}</td></tr></tbody></table>");
38+
$templateCache.put("{widgetsPath}/redmine/src/issues/edit/edit.html","<form role=form><div class=form-group><label for=project>Project</label><select name=project id=project class=form-control ng-model=config.project><option>All</option><option ng-repeat=\"project in vm.projects | orderBy: \'name\'\" value={{project.id}}>{{project.name}}</option></select></div><div class=form-group><label for=assgined_to_id>Assigned To</label> <span class=\"glyphicon glyphicon-info-sign\" uib-tooltip=\"Get issues which are assigned to the given user ID. <me> can be used instead an ID to fetch all issues from the logged in user. Leave empty if you want to see all issues.\"></span> <input name=assigned_to_id id=assgined_to_id class=form-control ng-model=config.assigned_to_id></div><div class=form-group><input type=checkbox name=showClosed ng-model=config.showClosed> Show closed issues</div><div class=form-group><label for=project>Columns to show:</label><li class=list-group-item ng-repeat=\"(key, entry) in vm.possibleColumns\"><input type=checkbox name={{key}} ng-model=config.columns[key].show> {{entry.name}}</li></div></form>");}]);
2839

2940

3041
angular.module('adf.widget.redmine')
31-
.controller('IssueController', ["issues", "config", function(issues, config){
42+
.controller('editController', ["projects", "config", function(projects, config){
3243
var vm = this;
44+
vm.possibleColumns = {
45+
"id":{"name":"ID", "show": true},
46+
"tracker":{"name":"Tracker","show": true},
47+
"status":{"name":"Status","show": true},
48+
"subject":{"name":"Subject","show": true}
49+
};
50+
51+
if(angular.equals({},config)) {
52+
config.columns=vm.possibleColumns;
53+
config.project="";
54+
config.assigned_to_id="me";
55+
config.showClosed=false;
56+
}
57+
58+
vm.projects = projects;
59+
}]);
60+
61+
3362

63+
angular.module('adf.widget.redmine')
64+
.controller('IssueController', ["issues", "config", function(issues, config){
65+
var vm = this;
66+
vm.config = config;
3467
vm.issues = issues.issues;
3568
}]);
3669

@@ -47,11 +80,34 @@ angular.module('adf.widget.redmine')
4780
return $http.get(redmineEndpoint+param).then(data);
4881
}
4982

50-
function getIssues(){
51-
return request('issues.json?limit=2');
83+
function getIssues(config){
84+
var params=generateIssuesParameter(config);
85+
return request('issues.json'+params);
86+
}
87+
88+
function generateIssuesParameter(data) {
89+
var params='?';
90+
if(data.project) {
91+
params+='&project_id='+data.project;
92+
}
93+
if(data.assigned_to_id) {
94+
params+='&assigned_to_id='+data.assigned_to_id;
95+
}
96+
if(data.showClosed) {
97+
params+='&status_id=*';
98+
}
99+
return params;
52100
}
101+
102+
function getProjects(){
103+
return request('projects.json').then(function(data){
104+
return data.projects;
105+
});
106+
}
107+
53108
return {
54-
getIssues: getIssues
109+
getIssues: getIssues,
110+
getProjects: getProjects
55111
};
56112
}]);
57113
})(window);

dist/adf-widget-redmine.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)