Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ dist
.sass-cache
.DS_Store
app/bower_components
app/transpiled
.idea
17 changes: 17 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,24 @@ module.exports = function (grunt) {

grunt.initConfig({
yeoman: yeomanConfig,

transpile: {
dashboard: {
type: 'amd', // or 'cjs'
files: [{
expand: true,
cwd: '<%= yeoman.app %>/scripts/',
dest: '<%= yeoman.app %>/transpiled/',
src: ['**/*.js'],
}]
}
},

watch: {
transpile: {
files: ['<%= yeoman.app %>/scripts/{,*/}*.js'],
tasks: ['transpile']
},
coffee: {
files: ['<%= yeoman.app %>/scripts/{,*/}*.coffee'],
tasks: ['coffee:dist']
Expand Down
27 changes: 2 additions & 25 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!--[if lt IE 7]> <html ng-app="dashboardApp" class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html ng-app="dashboardApp" class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html ng-app="dashboardApp" class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html ng-app="dashboardApp" class="no-js"> <!--<![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
Expand Down Expand Up @@ -83,32 +83,9 @@ <h2 class="branch-title" bind-markdown="branch.title"></h2>

<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/d3/d3.js"></script>
<script src="bower_components/requirejs/require.js" data-main="transpiled/main"></script>

<!-- build:js({.tmp,app}) scripts/scripts.js -->
<script src="scripts/app.js"></script>
<script src="scripts/services/configService.js"></script>
<script src="scripts/services/githubService.js"></script>
<script src="scripts/services/scheduleService.js"></script>
<script src="scripts/services/jenkinsService.js"></script>

<script src="scripts/filters/prettyDateFilter.js"></script>

<script src="scripts/factories/CardFactory.js"></script>
<script src="scripts/factories/BuildCardFactory.js"></script>
<script src="scripts/factories/Google3CardFactory.js"></script>
<script src="scripts/factories/ShaCountCardFactory.js"></script>
<script src="scripts/factories/GithubCardFactory.js"></script>
<script src="scripts/factories/UntriagedCardFactory.js"></script>

<script src="scripts/directives/progressBarDirective.js"></script>
<script src="scripts/directives/cardDirective.js"></script>
<script src="scripts/directives/bindMarkdownDirective.js"></script>
<script src="scripts/directives/burnDownChart.js"></script>

<script src="scripts/controllers/MainController.js"></script>
<script src="scripts/controllers/GithubStatusController.js"></script>
<script src="scripts/controllers/BranchStatusController.js"></script>
<script src="directive/dashGraph.js"></script>
<!-- endbuild -->
</body>
</html>
11 changes: 0 additions & 11 deletions app/scripts/app.js

This file was deleted.

19 changes: 19 additions & 0 deletions app/scripts/config/dart.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
var config = {
githubProject: 'angular.dart',
nextMilestone: {
title: 'v0.9.1',
githubName: 'v0.9.1'
},
branches: {
master: {
title: 'master',
name: 'master',
g3Name: 'g3v1x',
jenkinsProjectId: 'angular.dart-master'
}
}
};

config.$providerType = 'value';

export {config};
27 changes: 27 additions & 0 deletions app/scripts/config/js.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
var config = {
githubProject: 'angular.js',
nextMilestone: {
title: 'v1.2.1',
githubName: '1.2.1'
},
branches: {
master: {
title: 'master',
name: 'master',
g3Name: 'g3_v1_2',
releaseTag: 'v1.2',
jenkinsProjectId: 'angular.js-angular-master'
},
stable: {
title: 'stable/1.0',
name: 'v1.0.x',
g3Name: 'g3_v1_0',
releaseTag: 'v1.0',
jenkinsProjectId: 'angular.js-angular-v1.0.x'
}
}
};

config.$providerType = 'value';

export {config};
14 changes: 5 additions & 9 deletions app/scripts/controllers/BranchStatusController.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
'use strict';
BranchStatusController.$providerType = 'controller';
BranchStatusController.$inject = ['$scope', 'schedule', 'config', 'jenkins', 'github',
'createBuildCard', 'createGoogle3Card', 'createShaCountCard'];

app.controller('BranchStatusController', BranchStatusController);

BranchStatusController.$inject = [
'$scope', 'schedule', 'config', 'jenkins', 'github',
'createBuildCard', 'createGoogle3Card', 'createShaCountCard'
];
function BranchStatusController(
export function BranchStatusController(
$scope, schedule, config, jenkins, github,
createBuildCard, createGoogle3Card, createShaCountCard) {
var updators = [];
Expand All @@ -15,7 +11,7 @@ function BranchStatusController(
updator();
});
});

$scope.branches = [];
angular.forEach(config.branches, function(branchConfig) {
var buildCard = createBuildCard();
Expand Down
17 changes: 8 additions & 9 deletions app/scripts/controllers/GithubStatusController.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
'use strict';
// TODO(vojta): this will become annotation
// @controllerProvider
// @inject(...)
GithubStatusController.$providerType = 'controller';
GithubStatusController.$inject = ['$scope', 'schedule', 'config', 'github', 'createGithubCard',
'createUntriagedCard'];

app.controller('GithubStatusController', GithubStatusController);

GithubStatusController.$inject = [
'$scope', 'schedule', 'config', 'github', 'createGithubCard',
'createUntriagedCard'
];
function GithubStatusController($scope, schedule, config, github,
createGithubCard, createUntriagedCard) {
export function GithubStatusController($scope, schedule, config, github,
createGithubCard, createUntriagedCard) {
var milestonePRsCard = createGithubCard('Pull requests', ['milestone-card', 'pr-card']);
var milestoneIssuesCard = createGithubCard('Issues', ['milestone-card', 'issue-card']);
var untriagedPRsCard = createUntriagedCard('Untriaged _Pull requests_', ['untriaged-card', 'pr-card', 'untriaged-pr-card']);
Expand Down
10 changes: 3 additions & 7 deletions app/scripts/controllers/MainController.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
'use strict';


app.controller('MainController', MainController);
MainController.$providerType = 'controller';
MainController.$inject = ['$scope', '$timeout'];

function MainController($scope, $timeout) {
export function MainController($scope, $timeout) {
$scope.brokenBuild = null;
$scope.fixedBuild = null;

Expand Down Expand Up @@ -36,5 +34,3 @@ function MainController($scope, $timeout) {
}
});
}

MainController.$inject = ['$scope', '$timeout'];
11 changes: 6 additions & 5 deletions app/scripts/directives/bindMarkdownDirective.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
'use strict';


var markdown = function(string) {
return string.replace('/', '<span>/</span>')
.replace('-', '<span>-</span>')
.replace(/\*(.*)\*/, '<strong>$1</strong>')
.replace(/_(.*)_/, '<span>$1</span>');
};

app.directive('bindMarkdown', function() {
var bindMarkdown = function() {
return function(scope, elm, attr) {
scope.$watch(attr.bindMarkdown, function(value) {
elm.html(value ? markdown(value) : '');
});
};
});
};

bindMarkdown.$providerType = 'directive';

export {bindMarkdown, markdown};
11 changes: 6 additions & 5 deletions app/scripts/directives/burnDownChart.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
'use strict';

angular.module('dashboardApp').directive('burnDown', function () {

var burnDown = function() {
return {
template: '<svg class="bd-chart">' +
'<path class="line total"></path>' +
Expand Down Expand Up @@ -98,4 +95,8 @@ angular.module('dashboardApp').directive('burnDown', function () {
}
}
};
});
};

burnDown.$providerType = 'directive';

export {burnDown};
11 changes: 6 additions & 5 deletions app/scripts/directives/cardDirective.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
'use strict';


app.directive('card', function() {
var card = function() {
return {
restrict: 'E',
templateUrl: 'views/card.html',
scope: {
'data': '=cardData'
}
};
});
};

card.$providerType = 'directive';

export {card};
9 changes: 5 additions & 4 deletions app/scripts/directives/progressBarDirective.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
'use strict';

// TODO(chirayu):
// - Include bootstrap css

app.directive('progressBar', function() {
var progressBar = function() {
return {
restrict: 'E',
templateUrl: 'views/progressBar.html',
Expand All @@ -23,5 +21,8 @@ app.directive('progressBar', function() {
};
}
};
});
};

progressBar.$providerType = 'directive';

export {progressBar};
5 changes: 3 additions & 2 deletions app/scripts/directives/progressBarDirective.spec.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
'use strict';
module pbd from 'progressBarDirective';

describe('directive: progressBar', function () {
beforeEach(function() {
module('dashboardApp');
// the string module is to load the templates
module(pbd, 'dashboardApp');
module(function($exceptionHandlerProvider) {
$exceptionHandlerProvider.mode('log');
});
Expand Down
12 changes: 6 additions & 6 deletions app/scripts/factories/BuildCardFactory.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use strict';
import {inherits} from '../utils';

createBuildCard.$providerType = 'factory';
createBuildCard.$inject = ['createCard', 'prettyDateFilter'];

app.factory('createBuildCard', [
'createCard', 'prettyDateFilter',
function (createCard, prettyDateFilter) {
export function createBuildCard(createCard, prettyDateFilter) {
var BuildCardViewModel = function(title, content, note, classes) {
if (!(this instanceof BuildCardViewModel)) {
return new BuildCardViewModel(title, content, note, classes);
Expand All @@ -12,7 +12,7 @@ app.factory('createBuildCard', [
createCard.call(this, 'build', null, null, ['build-card']);
};

app.inherits(BuildCardViewModel, createCard);
inherits(BuildCardViewModel, createCard);

BuildCardViewModel.prototype.update = function(passing, since) {
if (passing) {
Expand All @@ -27,4 +27,4 @@ app.factory('createBuildCard', [
};

return BuildCardViewModel;
}]);
}
8 changes: 4 additions & 4 deletions app/scripts/factories/CardFactory.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';
createCard.$inject = [];
createCard.$providerType = 'factory';


app.factory('createCard', function () {
export function createCard() {
var CardViewModel = function(title, content, note, classes, url) {
if (!(this instanceof CardViewModel)) {
return new CardViewModel(title, content, note, classes, url);
Expand All @@ -15,4 +15,4 @@ app.factory('createCard', function () {
};

return CardViewModel;
});
}
12 changes: 6 additions & 6 deletions app/scripts/factories/GithubCardFactory.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use strict';
import {inherits} from '../utils';

createGithubCard.$providerType = 'factory';
createGithubCard.$inject = ['createCard'];

app.factory('createGithubCard', [
'createCard',
function (createCard) {
export function createGithubCard(createCard) {
var GithubCardViewModel = function(title, classes) {
if (!(this instanceof GithubCardViewModel)) {
return new GithubCardViewModel(title, classes);
Expand All @@ -12,7 +12,7 @@ app.factory('createGithubCard', [
createCard.call(this, title, null, null, ['github-card'].concat(classes));
};

app.inherits(GithubCardViewModel, createCard);
inherits(GithubCardViewModel, createCard);

GithubCardViewModel.prototype.update = function(count, total, burnDown) {
this.content = count;
Expand All @@ -26,4 +26,4 @@ app.factory('createGithubCard', [
};

return GithubCardViewModel;
}]);
}
12 changes: 6 additions & 6 deletions app/scripts/factories/Google3CardFactory.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use strict';
import {inherits} from '../utils';

createGoogle3Card.$inject = ['createCard'];
createGoogle3Card.$providerType = 'factory';

app.factory('createGoogle3Card', [
'createCard',
function (createCard) {
export function createGoogle3Card(createCard) {
var Google3CardViewModel = function(title, content, note, classes, url) {
if (!(this instanceof Google3CardViewModel)) {
return new Google3CardViewModel(title, content, note, classes, url);
Expand All @@ -12,7 +12,7 @@ app.factory('createGoogle3Card', [
createCard.call(this, '*google*3', null, 'shas behind', ['google3-card'], url);
};

app.inherits(Google3CardViewModel, createCard);
inherits(Google3CardViewModel, createCard);

Google3CardViewModel.prototype.update = function(count) {
this.content = count;
Expand All @@ -25,4 +25,4 @@ app.factory('createGoogle3Card', [
};

return Google3CardViewModel;
}]);
}
Loading