Skip to content

Commit

Permalink
Added imports for global variables in rocketchat-google-natural-langu…
Browse files Browse the repository at this point in the history
…age package (#12647)

* Added imports for global variables in rocketchat-google-natural-language package

* fix lint
  • Loading branch information
MarcosSpessatto authored and rodrigok committed Nov 16, 2018
1 parent db6cb9d commit 2c143ea
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
2 changes: 2 additions & 0 deletions packages/rocketchat-google-natural-language/client/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { Template } from 'meteor/templating';
import { RocketChat } from 'meteor/rocketchat:lib';
import { ChatRoom } from 'meteor/rocketchat:ui';

Template.room.helpers({
sentimentSmile() {
Expand Down
16 changes: 9 additions & 7 deletions packages/rocketchat-google-natural-language/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ Package.describe({
});

Package.onUse(function(api) {
api.use('ecmascript');
api.use('http');
api.use('templating', 'client');

api.use('rocketchat:lib');
api.use('rocketchat:ui', 'client');

api.use([
'ecmascript',
'http',
'rocketchat:lib',
]);
api.use([
'templating',
'rocketchat:ui',
], 'client');
api.mainModule('client/index.js', 'client');
api.mainModule('server/index.js', 'server');
});
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';
import './settings.js';
import './models/Rooms.js';
import googleLanguage from '@google-cloud/language';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { RocketChat } from 'meteor/rocketchat:lib';

RocketChat.models.Rooms.setSentiment = function(roomId, sentiment) {
return this.update({ _id: roomId }, { $set: { sentiment } });
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';

Meteor.startup(function() {
RocketChat.settings.add('GoogleNaturalLanguage_Enabled', false, {
Expand Down

0 comments on commit 2c143ea

Please sign in to comment.