Skip to content

Commit 2e41db4

Browse files
author
Christoph Wolfes
committed
#5 updated error handling
1 parent a00cd89 commit 2e41db4

File tree

7 files changed

+21
-2
lines changed

7 files changed

+21
-2
lines changed

src/charts/commitsByAuthor.js

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
angular.module('adf.widget.scm')
2828
.controller('CommitsByAuthorController', function (config, repository, commitsByAuthor) {
2929
var vm = this;
30+
vm.repository = repository;
3031

3132
if (repository && commitsByAuthor) {
3233
vm.chart = createChart();

src/charts/commitsByMonth.js

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
angular.module('adf.widget.scm')
2828
.controller('CommitsByMonthController', function (config, repository, commitsByMonth) {
2929
var vm = this;
30+
vm.repository = repository;
31+
3032
if (commitsByMonth) {
3133
vm.chart = createChart();
3234
}

src/charts/commitsLastCommits.js

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
angular.module('adf.widget.scm')
2828
.controller('LastCommitsController', function ($filter, config, repository, commits) {
2929
var vm = this;
30+
vm.repository = repository;
3031

3132
if (repository && commits) {
3233
vm.chart = createChart();

src/charts/line-chart.html

+5
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,15 @@
22
<div class="alert alert-info" ng-if="!vm.chart">
33
Please insert a repository path in the widget configuration
44
</div>
5+
<div ng-if="vm.repository.status == 404 || vm.repository.status == 500" class="alert alert-danger">
6+
<b>Error {{vm.repository.status}}</b> the endpoint could not be reached, this could mean that the selected repository does not exist
7+
or that the statistics plugin is not installed
8+
</div>
59
<div ng-if="vm.chart">
610
<canvas id="line" class="chart chart-line"
711
chart-data="vm.chart.data" chart-labels="vm.chart.labels"
812
chart-series="vm.chart.series" chart-options="vm.chart.options">
913
</canvas>
1014
</div>
15+
1116
</div>

src/charts/pie-chart.html

+5
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,15 @@
22
<div class="alert alert-info" ng-if="!vm.chart">
33
Please insert a repository path in the widget configuration
44
</div>
5+
<div ng-if="vm.repository.status == 404 || vm.repository.status == 500" class="alert alert-danger">
6+
<b>Error {{vm.repository.status}}</b> the endpoint could not be reached, this could mean that the selected repository does not exist
7+
or that the statistics plugin is not installed
8+
</div>
59
<div ng-if="vm.chart">
610
<canvas id="pie" class="chart chart-pie"
711
chart-legend="true" chart-data="vm.chart.data"
812
chart-labels="vm.chart.labels" chart-options="vm.chart.options">
913
</canvas>
1014
</div>
15+
1116
</div>

src/commits/view.html

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
<div ng-if="!config.repository" class="alert alert-info">
33
Please configure a repository
44
</div>
5+
<div ng-if="vm.repository.status == 404 || vm.repository.status == 500" class="alert alert-danger">
6+
<b>Error {{vm.repository.status}}</b> the endpoint could not be reached, this could mean that the selected repository does not exist
7+
</div>
58
<div ng-if="config.repository">
69
<ul class="media-list">
710
<li class="media" ng-repeat="commit in vm.commits">
@@ -16,4 +19,5 @@
1619
</li>
1720
</ul>
1821
</div>
22+
1923
</div>

src/markdownPreview/view.html

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
</div>
1010
<div ng-if="vm.fileContent" btf-markdown="vm.fileContent" class="markdownContent">
1111
</div>
12-
<div class="alert alert-danger" ng-if="vm.fileContent.status == 500">
13-
Markdown-File not found. Please check your configuration and try again.
12+
<div class="alert alert-danger" ng-if="vm.fileContent.status == 500 || vm.fileContent.status == 404">
13+
<b>Error {{vm.fileContent.status}}</b> Markdown-File not found. Please check your configuration and try again.
1414
</div>
15+

0 commit comments

Comments
 (0)