Skip to content

Commit

Permalink
Merge branch 'add-dashboard-views' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
ttben committed Sep 9, 2015
2 parents 75c5a0a + 77899fd commit 7b9e857
Show file tree
Hide file tree
Showing 123 changed files with 5,423 additions and 3,904 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ before_script:
- 'cd ../frontend'
- 'npm install'
- 'bower install'
- 'grunt test'
3 changes: 0 additions & 3 deletions .tsdrc

This file was deleted.

29 changes: 26 additions & 3 deletions backend/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-express-server');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-typescript');
grunt.loadNpmTasks('grunt-mocha-test');

Expand Down Expand Up @@ -109,8 +110,29 @@ module.exports = function (grunt) {
dist: ['dist/'],
test: ['buildTests/'],
all:['src/**/*.js', 'src/**/*js.map','tests/**/*.js', 'tests/**/*js.map']
}
},
// ---------------------------------------------


// ---------------------------------------------
// copy task
// ---------------------------------------------
copy: {
testFiles: {
files: [{
expand: true,
src: ['db_test.json', 'stub_values_test.json', 'db.json', 'stub_values.json'],
dest: 'buildTests/'
}]
},
prodFiles: {
files: [{
expand: true,
src: ['db_test.json', 'stub_values_test.json', 'db.json', 'stub_values.json'],
dest: 'build/'
}]
}
}
});

// register tasks
Expand All @@ -119,7 +141,8 @@ module.exports = function (grunt) {
grunt.registerTask('build', function () {
grunt.task.run(['clean:build','clean:test']);

grunt.task.run(['typescript:build', 'typescript:test']);
grunt.task.run(['typescript:build','typescript:test', 'copy:prodFiles']);
//grunt.task.run(['typescript:build']);
});

grunt.registerTask('develop', function() {
Expand All @@ -135,7 +158,7 @@ module.exports = function (grunt) {
grunt.registerTask('test', function() {
grunt.task.run(['clean:test']);

grunt.task.run(['typescript:test', 'mochaTest:test']);
grunt.task.run(['copy:testFiles','typescript:test', 'mochaTest:test']);
});

}
173 changes: 64 additions & 109 deletions backend/db.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,31 @@
{
"id": "3221c575-85ca-447b-86f3-3a4ef39985dc",
"name": "Clim",
"timeBox": {
"startDate": "2015-07-01T06:58:42.000Z",
"endDate": "2015-08-31T13:01:24.000Z"
"validityPeriod": {
"start": "2015-07-01T06:58:42.000Z",
"end": "2015-09-30T13:01:24.000Z"
},
"duration": "week",
"recurringPeriod": "week",
"conditions": [
{
"id": "ab72f9b4-a368-4ea2-8adb-738ea0e6f30b",
"description": "la température a augmenté de 25% par rapport à la semaine dernière",
"expression": {
"valueLeft": {
"value": "TMP_CLI",
"sensor": true
"symbolicName": true
},
"valueRight": {
"value": "15",
"sensor": false
"symbolicName": false
},
"comparison": ">",
"description": "a desc",
"periodOfTime": "-2208474000000"
"comparison": ">"
},
"threshold": 25,
"startDate": "2015-08-02T22:00:00.000Z",
"dateOfCreation": "2015-08-09T22:00:00.000Z",
"endDate": "2015-08-14T21:59:59.999Z",
"percentageAchieved": 100,
"percentageOfTimeElapsed": 100,
"referencePeriod": {
"numberOfUnitToSubtract": 1,
"unitToSubtract": "week"
},
"filter": {
"dayOfWeekFilter": "all",
"periodOfDayFilter": [
Expand All @@ -38,141 +36,98 @@
]
},
"type": "comparison"
}
],
"badgeID": "44bb8108-8830-4f43-abd1-3ef643303d92"
},
{
"id": "9bddaf87-5065-4df7-920a-d1d249c9171d",
"name": "Obj1",
"timeBox": {
"startDate": "2015-08-04T12:25:57.787Z",
"endDate": "2015-08-31T12:25:57.787Z"
},
"duration": "week",
"conditions": [
{
},
{
"id": "7713cb13-e86d-40d0-a39f-c4ad5a33546d",
"description": "tmp_cli > 28, 50% du temps",
"expression": {
"valueLeft": {
"value": "TMP_CLI",
"sensor": true
"symbolicName": true
},
"valueRight": {
"value": 1,
"sensor": false
"value": 28,
"symbolicName": false
},
"comparison": ">",
"description": "tmp_cli > 1"
"comparison": ">"
},
"threshold": 100,
"startDate": "2015-08-04T12:25:57.787Z",
"dateOfCreation": "2015-08-07T07:56:06.107Z",
"endDate": "2015-08-31T12:25:57.787Z",
"percentageAchieved": 0,
"percentageOfTimeElapsed": 0,
"threshold": 50,
"filter": {
"dayOfWeekFilter": "working-week",
"dayOfWeekFilter": "all",
"periodOfDayFilter": [
"all"
]
},
"type": "overall"
}
],
"badgeID": "fde68334-f515-4563-954b-ac91b4a42f88"
"badgeID": "44bb8108-8830-4f43-abd1-3ef643303d92"
}
],
"badges": [
{
"id": "44bb8108-8830-4f43-abd1-3ef643303d92",
"name": "Un challenge de démo !",
"name": "Un challenge de d\u00e9mo !",
"points": 100
},
{
"id": "fde68334-f515-4563-954b-ac91b4a42f88",
"name": "Pas froid aux yeux",
"points": "100"
},
{
"id": "faa78334-f515-4563-954b-ac91b4a42f88",
"name": "Pas chiche de tout fermer !",
"points": "100"
"points": "40"
}
],
"users": [
{
"id": "2cf91e02-a320-4766-aa9f-6efce3142d44",
"name": "Jackie!",
"name": "Charlie",
"mapSymbolicNameToSensor": {
"TMP_CLI": "TEMP_443V"
},
"currentChallenges": [

],
"finishedBadgesMap": {
"44bb8108-8830-4f43-abd1-3ef643303d92": 1
}
},
{
"id": "6efce3142d44-a320-4766-4766-2cf91e02",
"name": "G\u00e9g\u00e9",
"mapSymbolicNameToSensor": {
"TMP_CLI": "AC_555V"
},
"currentChallenges": [

],
"finishedBadgesMap": {
"44bb8108-8830-4f43-abd1-3ef643303d92": 1,
"fde68334-f515-4563-954b-ac91b4a42f88": 1
}
}
],
"challenges": [
"teams": [
{
"id": "af0947e9-bf85-4233-8d50-2de787bf6021",
"name": "Clim",
"timeProgress": 100,
"startDate": "2015-08-02T22:00:00.000Z",
"endDate": "2015-08-07T21:59:59.999Z",
"goal": {
"id": "3221c575-85ca-447b-86f3-3a4ef39985dc",
"conditions": {
"TMP_CLI": "TEMP_443V"
}
},
"progress": [
{
"id": "ab72f9b4-a368-4ea2-8adb-738ea0e6f30b",
"expression": {
"valueLeft": {
"value": "TMP_CLI",
"sensor": true
},
"valueRight": {
"value": "15",
"sensor": false
},
"comparison": ">",
"description": "a desc",
"periodOfTime": "-2208474000000"
},
"threshold": 25,
"startDate": "2015-07-26T22:00:00.000Z",
"dateOfCreation": "2015-08-02T22:00:00.000Z",
"endDate": "2015-08-07T21:59:59.999Z",
"percentageAchieved": 100,
"percentageOfTimeElapsed": 100,
"filter": {
"dayOfWeekFilter": "all",
"periodOfDayFilter": [
"morning",
"afternoon"
]
},
"type": "comparison"
}
"id": "28aa8108-8830-4f43-abd1-3ab643303d92",
"name": "croquette",
"members": [
"2cf91e02-a320-4766-aa9f-6efce3142d44",
"6efce3142d44-a320-4766-4766-2cf91e02"
],
"status": "SUCCESS"
},
{
"id": "f3abd585-b5a2-43d2-bced-738d646921b8",
"name": "Clim",
"timeProgress": 0,
"startDate": "2015-08-09T22:00:00.000Z",
"endDate": "2015-08-14T21:59:59.999Z",
"goal": {
"id": "3221c575-85ca-447b-86f3-3a4ef39985dc",
"conditions": {
"TMP_CLI": "TEMP_443V"
}
},
"progress": [],
"status": "WAIT"
"leader": "2cf91e02-a320-4766-aa9f-6efce3142d44",
"currentChallenges": [

],
"finishedBadgesMap": {
"44bb8108-8830-4f43-abd1-3ef643303d92": 2
}
}
]
],
"challenges": {
"userChallenges": [

],
"teamChallenges": [

]
}
}
Loading

0 comments on commit 7b9e857

Please sign in to comment.