fh-wfm-message
Advanced tools
Comparing version 0.0.10 to 0.0.11
@@ -13,27 +13,27 @@ 'use strict'; | ||
, scope: { | ||
list : '=list', | ||
selectedModel: '=' | ||
} | ||
list : '=list', | ||
selectedModel: '=' | ||
} | ||
, controller: function($scope) { | ||
var self = this; | ||
self.list = $scope.list; | ||
self.selected = $scope.selectedModel; | ||
self.selectMessage = function(event, message) { | ||
self.selectedMessageId = message.id; | ||
mediator.publish('wfm:message:selected', message); | ||
event.preventDefault(); | ||
event.stopPropagation(); | ||
} | ||
self.ismessageShown = function(message) { | ||
return self.shownmessage === message; | ||
}; | ||
var self = this; | ||
self.list = $scope.list; | ||
self.selected = $scope.selectedModel; | ||
self.selectMessage = function(event, message) { | ||
self.selectedMessageId = message.id; | ||
mediator.publish('wfm:message:selected', message); | ||
event.preventDefault(); | ||
event.stopPropagation(); | ||
}; | ||
self.ismessageShown = function(message) { | ||
return self.shownmessage === message; | ||
}; | ||
self.applyFilter = function(term) { | ||
term = term.toLowerCase(); | ||
self.list = $scope.list.filter(function(message) { | ||
return String(message.sender.name).toLowerCase().indexOf(term) !== -1 | ||
self.applyFilter = function(term) { | ||
term = term.toLowerCase(); | ||
self.list = $scope.list.filter(function(message) { | ||
return String(message.sender.name).toLowerCase().indexOf(term) !== -1 | ||
|| String(message.subject).toLowerCase().indexOf(term) !== -1; | ||
}); | ||
}; | ||
} | ||
}); | ||
}; | ||
} | ||
, controllerAs: 'ctrl' | ||
@@ -50,18 +50,18 @@ }; | ||
, workers: '=' | ||
} | ||
} | ||
, controller: function($scope) { | ||
var self = this; | ||
self.model = angular.copy($scope.message); | ||
self.workers = $scope.workers; | ||
self.submitted = false; | ||
self.done = function(isValid) { | ||
self.submitted = true; | ||
self.model.receiver = JSON.parse(self.model.receiver); | ||
self.model.receiverId = self.model.receiver.id; | ||
self.model.status = "unread"; | ||
if (isValid) { | ||
mediator.publish('wfm:message:created', self.model); | ||
} | ||
var self = this; | ||
self.model = angular.copy($scope.message); | ||
self.workers = $scope.workers; | ||
self.submitted = false; | ||
self.done = function(isValid) { | ||
self.submitted = true; | ||
self.model.receiver = JSON.parse(self.model.receiver); | ||
self.model.receiverId = self.model.receiver.id; | ||
self.model.status = "unread"; | ||
if (isValid) { | ||
mediator.publish('wfm:message:created', self.model); | ||
} | ||
} | ||
}; | ||
} | ||
, controllerAs: 'ctrl' | ||
@@ -77,18 +77,18 @@ }; | ||
message : '=message' | ||
} | ||
} | ||
, controller: function($scope) { | ||
var self = this; | ||
self.message = $scope.message; | ||
self.showSelectButton = !! $scope.$parent.messages; | ||
self.selectmessage = function(event, message) { | ||
mediator.publish('wfm:message:selected', message); | ||
event.preventDefault(); | ||
event.stopPropagation(); | ||
} | ||
self.closeMessage = function(event, message) { | ||
mediator.publish('wfm:message:close:' + message.id); | ||
event.preventDefault(); | ||
event.stopPropagation(); | ||
} | ||
} | ||
var self = this; | ||
self.message = $scope.message; | ||
self.showSelectButton = !! $scope.$parent.messages; | ||
self.selectmessage = function(event, message) { | ||
mediator.publish('wfm:message:selected', message); | ||
event.preventDefault(); | ||
event.stopPropagation(); | ||
}; | ||
self.closeMessage = function(event, message) { | ||
mediator.publish('wfm:message:close:' + message.id); | ||
event.preventDefault(); | ||
event.stopPropagation(); | ||
}; | ||
} | ||
, controllerAs: 'ctrl' | ||
@@ -95,0 +95,0 @@ }; |
@@ -8,2 +8,2 @@ 'use strict'; | ||
, require('./sync-service') | ||
]) | ||
]); |
@@ -28,4 +28,4 @@ 'use strict'; | ||
}); | ||
}; | ||
} | ||
} | ||
}; | ||
@@ -38,3 +38,3 @@ var asyncValue = function(value) { | ||
return deferred.promise; | ||
} | ||
}; | ||
@@ -48,3 +48,3 @@ var fetch = function() { | ||
message.startTimestamp = new Date(message.startTimestamp); | ||
}; | ||
} | ||
}); | ||
@@ -62,3 +62,3 @@ return messages; | ||
var message = _.find(messages, function(_message) { | ||
return _message.id == id; | ||
return _message.id === id; | ||
}); | ||
@@ -81,3 +81,3 @@ return asyncValue(message); | ||
return FHCloud.put(config.apiPath + '/' + message.id, angular.toJson(message)) | ||
.then(function(response) { | ||
.then(function() { | ||
return FHCloud.get(config.apiPath); | ||
@@ -84,0 +84,0 @@ }) |
@@ -9,19 +9,2 @@ 'use strict'; | ||
function removeLocalVars(object) { | ||
_.keys(object).filter(function(key) { | ||
return key.indexOf('_') === 0; | ||
}).forEach(function(localKey) { | ||
delete object[localKey]; | ||
}); | ||
if (object.results) { | ||
_.values(object.results).forEach(function(result) { | ||
_.keys(result.submission).filter(function(key) { | ||
return key.indexOf('_') === 0; | ||
}).forEach(function(localKey) { | ||
delete result.submission[localKey]; | ||
}); | ||
}); | ||
}; | ||
}; | ||
function wrapManager($q, $timeout, manager) { | ||
@@ -57,3 +40,3 @@ var wrappedManager = _.create(manager); | ||
return messageSync.manager; | ||
}) | ||
}); | ||
} | ||
@@ -66,5 +49,5 @@ }; | ||
delete messageSync.manager; | ||
}) | ||
}); | ||
} | ||
} | ||
}; | ||
return messageSync; | ||
@@ -77,2 +60,2 @@ }) | ||
}); | ||
; | ||
@@ -12,2 +12,2 @@ 'use strict'; | ||
} | ||
} | ||
}; |
'use strict'; | ||
var express = require('express'), | ||
config = require('./config'); | ||
config = require('./config'); | ||
@@ -10,3 +10,3 @@ //This is probably not needed anymore after using sync service | ||
router.route('/').get(function(req, res, next) { | ||
router.route('/').get(function(req, res) { | ||
mediator.once('done:messages:load', function(data) { | ||
@@ -17,4 +17,4 @@ res.json(data); | ||
}); | ||
router.route('/:id').get(function(req, res, next) { | ||
var messageId = req.params.id | ||
router.route('/:id').get(function(req, res) { | ||
var messageId = req.params.id; | ||
mediator.once('done:message:load:' + messageId, function(data) { | ||
@@ -25,3 +25,3 @@ res.json(data); | ||
}); | ||
router.route('/:id').put(function(req, res, next) { | ||
router.route('/:id').put(function(req, res) { | ||
var messageId = req.params.id; | ||
@@ -35,3 +35,3 @@ var message = req.body; | ||
}); | ||
router.route('/').post(function(req, res, next) { | ||
router.route('/').post(function(req, res) { | ||
var ts = new Date().getTime(); // TODO: replace this with a proper uniqe (eg. a cuid) | ||
@@ -44,6 +44,6 @@ var message = req.body; | ||
mediator.publish('message:create', message); | ||
}) | ||
}); | ||
return router; | ||
}; | ||
} | ||
@@ -53,2 +53,2 @@ module.exports = function(mediator, app) { | ||
app.use(config.apiPath, router); | ||
} | ||
}; |
'use strict'; | ||
var _ = require('lodash') | ||
, sync = require('fh-wfm-sync/lib/server') | ||
, config = require('./config') | ||
var sync = require('fh-wfm-sync/lib/server') | ||
, config = require('./config'); | ||
@@ -7,0 +6,0 @@ |
{ | ||
"name": "fh-wfm-message", | ||
"version": "0.0.10", | ||
"version": "0.0.11", | ||
"description": "An message module for WFM", | ||
@@ -8,3 +8,4 @@ "main": "lib/angular/message-ng.js", | ||
"build": "wfm-template-build -m 'wfm.message.directives'", | ||
"watch": "wfm-template-build -w -m 'wfm.message.directives'" | ||
"watch": "wfm-template-build -w -m 'wfm.message.directives'", | ||
"test": "grunt" | ||
}, | ||
@@ -19,5 +20,6 @@ "keywords": [ | ||
"angular-messages": "1.5.3", | ||
"express": "4.13.4", | ||
"express": "4.14.0", | ||
"fh-wfm-sync": "0.0.12", | ||
"lodash": "4.7.0", | ||
"moment": "^2.15.1", | ||
"ng-feedhenry": "0.2.53", | ||
@@ -28,8 +30,10 @@ "q": "1.4.1" | ||
"body-parser": "1.15.0", | ||
"fh-wfm-mediator": "0.0.14", | ||
"fh-wfm-template-build": "0.0.9", | ||
"grunt": "^1.0.1", | ||
"grunt-eslint": "^18.0.0", | ||
"mocha": "2.4.5", | ||
"request": "2.69.0", | ||
"should": "8.3.0", | ||
"fh-wfm-mediator": "0.0.14" | ||
"should": "8.3.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
NPM Shrinkwrap
Supply chain riskPackage contains a shrinkwrap file. This may allow the package to bypass normal install procedures.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
53755
24
1079
7
8
1
+ Addedmoment@^2.15.1
+ Addedaccepts@1.3.8(transitive)
+ Addedcookie@0.3.1(transitive)
+ Addedencodeurl@1.0.2(transitive)
+ Addedexpress@4.14.0(transitive)
+ Addedfinalhandler@0.5.0(transitive)
+ Addedhttp-errors@1.5.1(transitive)
+ Addedinherits@2.0.3(transitive)
+ Addedipaddr.js@1.4.0(transitive)
+ Addedmoment@2.30.1(transitive)
+ Addedms@0.7.2(transitive)
+ Addednegotiator@0.6.3(transitive)
+ Addedproxy-addr@1.1.5(transitive)
+ Addedqs@6.2.0(transitive)
+ Addedrange-parser@1.2.1(transitive)
+ Addedsend@0.14.10.14.2(transitive)
+ Addedserve-static@1.11.2(transitive)
+ Addedsetprototypeof@1.0.2(transitive)
+ Addedstatuses@1.3.1(transitive)
+ Addedvary@1.1.2(transitive)
- Removedaccepts@1.2.13(transitive)
- Removedcookie@0.1.5(transitive)
- Removedexpress@4.13.4(transitive)
- Removedfinalhandler@0.4.1(transitive)
- Removedhttp-errors@1.3.1(transitive)
- Removedinherits@2.0.4(transitive)
- Removedipaddr.js@1.0.5(transitive)
- Removednegotiator@0.5.3(transitive)
- Removedproxy-addr@1.0.10(transitive)
- Removedqs@4.0.0(transitive)
- Removedrange-parser@1.0.3(transitive)
- Removedsend@0.13.10.13.2(transitive)
- Removedserve-static@1.10.3(transitive)
- Removedstatuses@1.2.1(transitive)
- Removedvary@1.0.1(transitive)
Updatedexpress@4.14.0