Skip to content

Commit

Permalink
Restored icons
Browse files Browse the repository at this point in the history
Now based on SVG. Provisioned at startup using `meteor-inject-initial`
Icons created from font awesome using [icomoon](https://icomoon.io/app/#/select)
  • Loading branch information
mrsimpson committed Oct 2, 2017
1 parent a87b575 commit 8a1eb37
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 8 deletions.
4 changes: 4 additions & 0 deletions packages/assistify-help-request/client/public/icons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 10 additions & 3 deletions packages/assistify-help-request/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ Package.describe({
name: 'assistify:help-request',
version: '0.0.1',
summary: 'Adds rooms which are to be closed once the initial question has been resolved',
// URL to the Git repository containing the source code for this package.
// URL to the Git repository containing the source code for this package.
git: '',
// By default, Meteor will default to using README.md for documentation.
// To avoid submitting documentation, set this field to null.
// By default, Meteor will default to using README.md for documentation.
// To avoid submitting documentation, set this field to null.
documentation: 'README.md'
});

Expand All @@ -18,6 +18,7 @@ Package.onUse(function(api) {
api.use('rocketchat:authorization'); //In order to create custom permissions
api.use(['nimble:restivus', 'rocketchat:authorization', 'rocketchat:api'], 'server');
api.use('templating', 'client');
api.use('meteorhacks:inject-initial'); //for provisioning of svg-icons

api.addFiles('help-request.js', 'server');
api.addFiles('server/types.js', 'server');
Expand All @@ -27,6 +28,9 @@ Package.onUse(function(api) {
api.addFiles('startup/customRoomTypes.js');
api.addFiles('startup/rolesAndPermissions.js', 'server');

// Libraries
api.addFiles('server/inject.js', 'server');

// Models
api.addFiles('server/models/Users.js', ['server', 'client']);
api.addFiles('server/models/Rooms.js', ['server', 'client']);
Expand All @@ -48,6 +52,9 @@ Package.onUse(function(api) {
// Hooks
api.addFiles('server/hooks/sendMessageToKnowledgeAdapter.js', 'server');

// UI artifacts which are pre-processed or packaged by the server
api.addAssets('client/public/icons.svg', 'server');

///////// Client

//Templates
Expand Down
2 changes: 2 additions & 0 deletions packages/assistify-help-request/server/inject.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* globals Inject */
Inject.rawBody('custom-icons', Assets.getText('client/public/icons.svg'));
56 changes: 51 additions & 5 deletions packages/assistify-help-request/startup/customRoomTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/
RocketChat.roomTypes.add('r', 6, { //5 is livechat
template: 'requests',
icon: 'icon-help',
icon: 'question',
label: 'Requests',
creationTemplate: 'AssistifyCreateRequest',
route: {
Expand Down Expand Up @@ -40,21 +40,44 @@ RocketChat.roomTypes.add('r', 6, { //5 is livechat
},

showJoinLink(roomId) {
return !!ChatRoom.findOne({ _id: roomId, t: 'r' });
return !!ChatRoom.findOne({_id: roomId, t: 'r'});
},

canBeDeleted(userId, room) {
return RocketChat.authz.hasPermission(userId, 'delete-c', room._id);
},

canBeDeleted(userId, room) {
return RocketChat.authz.hasPermission(userId, 'delete-c', room._id);
},
includeInRoomSearch() {
return true;
},

isGroupChat() {
return true;
},

canAddUser() {
return true;
},

userDetailShowAll() {
return true;
},

userDetailShowAdmin() {
return true;
}
});

/**
* An expert group is a private group of people who know something
* An expert group is being added to a request-channel on creation based on naming conventions
* An expert group is a private group of people who know something
* An expert group is being added to a request-channel on creation based on naming conventions
*/
RocketChat.roomTypes.add('e', 15, { //20 = private messages
template: 'expertise',
icon: 'icon-lightbulb',
icon: 'lightbulb',
label: 'Expertises',
creationTemplate: 'AssistifyCreateExpertise',
route: {
Expand Down Expand Up @@ -83,5 +106,28 @@ RocketChat.roomTypes.add('e', 15, { //20 = private messages

canBeDeleted(userId, room) {
return RocketChat.authz.hasPermission(userId, 'delete-c', room._id);
},
includeInRoomSearch() {
return true;
},

isGroupChat() {
return true;
},

canAddUser() {
return true;
},

userDetailShowAll() {
return true;
},

userDetailShowAdmin() {
return true;
},

preventRenaming() {
return true; //renaming an expertise will lead to new requests not finding answers to the previously named expertise
}
});

0 comments on commit 8a1eb37

Please sign in to comment.