Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert rocketchat-ui-account to main module structure #12842

Merged
merged 3 commits into from
Dec 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/rocketchat-ui-account/client/account.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Tracker } from 'meteor/tracker';
import { Template } from 'meteor/templating';
import { SideNav } from 'meteor/rocketchat:ui';

Template.account.onRendered(function() {
Tracker.afterFlush(function() {
Expand Down
2 changes: 2 additions & 0 deletions packages/rocketchat-ui-account/client/accountFlex.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 { t, SideNav } from 'meteor/rocketchat:ui';

Template.accountFlex.events({
'click [data-action="close"]'() {
Expand Down
4 changes: 2 additions & 2 deletions packages/rocketchat-ui-account/client/accountIntegrations.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* global */

import { Meteor } from 'meteor/meteor';
import { Template } from 'meteor/templating';
import { RocketChat } from 'meteor/rocketchat:lib';
import { t, modal } from 'meteor/rocketchat:ui';
import toastr from 'toastr';

Template.accountIntegrations.helpers({
Expand Down
3 changes: 2 additions & 1 deletion packages/rocketchat-ui-account/client/accountPreferences.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/* globals KonchatNotification */
import { Meteor } from 'meteor/meteor';
import { ReactiveVar } from 'meteor/reactive-var';
import { Tracker } from 'meteor/tracker';
import { Reload } from 'meteor/reload';
import { Template } from 'meteor/templating';
import { TAPi18n } from 'meteor/tap:i18n';
import { RocketChat, handleError } from 'meteor/rocketchat:lib';
import { t, modal, SideNav, KonchatNotification } from 'meteor/rocketchat:ui';
import _ from 'underscore';
import s from 'underscore.string';
import toastr from 'toastr';
Expand Down
2 changes: 2 additions & 0 deletions packages/rocketchat-ui-account/client/accountProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { Meteor } from 'meteor/meteor';
import { Tracker } from 'meteor/tracker';
import { FlowRouter } from 'meteor/kadira:flow-router';
import { Template } from 'meteor/templating';
import { RocketChat, handleError } from 'meteor/rocketchat:lib';
import { t, modal, SideNav } from 'meteor/rocketchat:ui';
import _ from 'underscore';
import s from 'underscore.string';
import toastr from 'toastr';
Expand Down
1 change: 1 addition & 0 deletions packages/rocketchat-ui-account/client/avatar/avatar.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Meteor } from 'meteor/meteor';
import { Session } from 'meteor/session';
import { Template } from 'meteor/templating';
import { getAvatarUrlFromUsername } from 'meteor/rocketchat:ui';

Template.avatar.helpers({
src() {
Expand Down
5 changes: 3 additions & 2 deletions packages/rocketchat-ui-account/client/avatar/prompt.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/* globals fileUploadHandler */

import { Meteor } from 'meteor/meteor';
import { ReactiveVar } from 'meteor/reactive-var';
import { Tracker } from 'meteor/tracker';
import { FlowRouter } from 'meteor/kadira:flow-router';
import { Template } from 'meteor/templating';
import { RocketChat } from 'meteor/rocketchat:lib';
import { t, SideNav } from 'meteor/rocketchat:ui';
import { fileUploadHandler } from 'meteor/rocketchat:file-upload';
import s from 'underscore.string';
import toastr from 'toastr';
import mime from 'mime-type/with-db';
Expand Down
14 changes: 14 additions & 0 deletions packages/rocketchat-ui-account/client/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import './account.html';
import './accountFlex.html';
import './accountIntegrations.html';
import './accountPreferences.html';
import './accountProfile.html';
import './avatar/avatar.html';
import './avatar/prompt.html';
import './account';
import './accountFlex';
import './accountIntegrations';
import './accountPreferences';
import './accountProfile';
import './avatar/avatar';
import './avatar/prompt';
19 changes: 1 addition & 18 deletions packages/rocketchat-ui-account/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,5 @@ Package.onUse(function(api) {
'sha',
'rocketchat:lazy-load',
]);

api.addFiles('client/account.html', 'client');
api.addFiles('client/accountFlex.html', 'client');
api.addFiles('client/accountIntegrations.html', 'client');
api.addFiles('client/accountPreferences.html', 'client');
api.addFiles('client/accountProfile.html', 'client');
api.addFiles('client/avatar/avatar.html', 'client');
api.addFiles('client/avatar/prompt.html', 'client');

api.addFiles('client/account.js', 'client');
api.addFiles('client/accountFlex.js', 'client');
api.addFiles('client/accountIntegrations.js', 'client');
api.addFiles('client/accountPreferences.js', 'client');
api.addFiles('client/accountProfile.js', 'client');
api.addFiles('client/avatar/avatar.js', 'client');
api.addFiles('client/avatar/prompt.js', 'client');

// api.addAssets('styles/side-nav.less', 'client');
api.mainModule('client/index.js', 'client');
});
8 changes: 3 additions & 5 deletions packages/rocketchat-ui/client/lib/notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import _ from 'underscore';
import s from 'underscore.string';
import { e2e } from 'meteor/rocketchat:e2e';

const KonchatNotification = {
KonchatNotification = { //eslint-disable-line
notificationStatus: new ReactiveVar,

// notificacoes HTML5
getDesktopPermission() {
if (window.Notification && (Notification.permission !== 'granted') && !Meteor.settings.public.sandstorm) {
return Notification.requestPermission(function(status) {
KonchatNotification.notificationStatus.set(status);
KonchatNotification.notificationStatus.set(status); //eslint-disable-line
if (Notification.permission !== status) {
return Notification.permission = status;
}
Expand Down Expand Up @@ -88,7 +88,7 @@ const KonchatNotification = {
/* globals getAvatarAsPng*/
return getAvatarAsPng(notification.payload.sender.username, function(avatarAsPng) {
notification.icon = avatarAsPng;
return KonchatNotification.notify(notification);
return KonchatNotification.notify(notification); //eslint-disable-line
});
},

Expand Down Expand Up @@ -175,5 +175,3 @@ Meteor.startup(() => {
}
});
});
export { KonchatNotification };
this.KonchatNotification = KonchatNotification;
1 change: 1 addition & 0 deletions packages/rocketchat-ui/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,5 @@ Package.onUse(function(api) {
api.export('popout', 'client');
api.export('ChatMessage', 'client');
api.export('RoomHistoryManager', 'client');
api.export('KonchatNotification', 'client');
});