Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fh-wfm-message

Package Overview
Dependencies
Maintainers
3
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fh-wfm-message - npm Package Compare versions

Comparing version 0.0.10 to 0.0.11

.eslintrc

102

lib/angular/directive.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc