Enable typescript lint (#15979)

* Enable typescript lint

* Move eslint-plugin-import to deve section
pull/15989/head
Rodrigo Nascimento 6 years ago committed by GitHub
parent f0f83d29be
commit e91444eb6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 103
      .eslintrc
  2. 1
      .meteor/packages
  3. 1
      .meteor/versions
  4. 4
      .scripts/set-version.js
  5. 2
      .scripts/start.js
  6. 2
      .scripts/version.js
  7. 2
      app/api/server/v1/misc.js
  8. 4
      app/api/server/v1/rooms.js
  9. 4
      app/api/server/v1/subscriptions.js
  10. 4
      app/apps/server/bridges/commands.js
  11. 2
      app/apps/server/bridges/messages.js
  12. 2
      app/apps/server/cron.js
  13. 9
      app/authorization/client/views/permissions.js
  14. 4
      app/authorization/server/publications/permissions/emitter.js
  15. 2
      app/authorization/server/publications/permissions/index.js
  16. 4
      app/callbacks/lib/callbacks.js
  17. 2
      app/cas/client/cas_client.js
  18. 24
      app/channel-settings/client/views/channelSettings.js
  19. 4
      app/chatpal-search/server/provider/provider.js
  20. 2
      app/custom-sounds/client/admin/adminSounds.js
  21. 2
      app/custom-sounds/client/admin/soundEdit.js
  22. 4
      app/custom-sounds/client/lib/CustomSounds.js
  23. 4
      app/custom-sounds/client/notifications/deleteCustomSound.js
  24. 4
      app/custom-sounds/client/notifications/updateCustomSound.js
  25. 2
      app/custom-sounds/server/methods/uploadCustomSound.js
  26. 4
      app/dolphin/lib/common.js
  27. 2
      app/emoji-custom/client/admin/adminEmoji.js
  28. 2
      app/emoji-custom/client/admin/emojiEdit.js
  29. 2
      app/emoji-custom/client/lib/emojiCustom.js
  30. 2
      app/emoji-custom/client/notifications/deleteEmojiCustom.js
  31. 2
      app/emoji-custom/client/notifications/updateEmojiCustom.js
  32. 2
      app/emoji-custom/server/methods/insertOrUpdateEmoji.js
  33. 2
      app/emoji-custom/server/methods/uploadEmojiCustom.js
  34. 2
      app/emoji/client/emojiParser.js
  35. 2
      app/importer-hipchat/server/importer.js
  36. 5
      app/importer/client/admin/adminImport.js
  37. 5
      app/importer/client/admin/adminImportHistory.js
  38. 5
      app/importer/client/admin/adminImportPrepare.js
  39. 5
      app/importer/client/admin/adminImportProgress.js
  40. 4
      app/importer/server/classes/ImporterBase.js
  41. 3
      app/importer/server/methods/downloadPublicImportFile.js
  42. 5
      app/importer/server/methods/getImportFileData.js
  43. 3
      app/importer/server/methods/getImportProgress.js
  44. 3
      app/importer/server/methods/getSelectionData.js
  45. 3
      app/importer/server/methods/prepareImport.js
  46. 3
      app/importer/server/methods/restartImport.js
  47. 3
      app/importer/server/methods/setupImporter.js
  48. 3
      app/importer/server/methods/startImport.js
  49. 3
      app/importer/server/methods/uploadImportFile.js
  50. 2
      app/lazy-load/client/index.js
  51. 2
      app/lib/client/UserDeleted.js
  52. 2
      app/lib/server/functions/cleanRoomHistory.js
  53. 2
      app/lib/server/lib/sendNotificationsOnMessage.js
  54. 2
      app/lib/server/oauth/oauth.js
  55. 2
      app/lib/server/startup/rateLimiter.js
  56. 8
      app/livechat/client/views/app/livechatAgents.js
  57. 2
      app/livechat/client/views/app/livechatDepartmentForm.js
  58. 10
      app/livechat/client/views/app/livechatManagers.js
  59. 2
      app/livechat/client/views/app/tabbar/agentInfo.js
  60. 2
      app/livechat/lib/LivechatInquiry.js
  61. 4
      app/markdown/lib/parser/marked/marked.js
  62. 4
      app/message-pin/server/pinMessage.js
  63. 2
      app/message-snippet/server/publications/snippetedMessage.js
  64. 2
      app/message-snippet/server/publications/snippetedMessagesByRoom.js
  65. 2
      app/message-snippet/server/requests.js
  66. 3
      app/models/client/models/Subscriptions.js
  67. 3
      app/models/server/models/Roles.js
  68. 4
      app/models/server/models/Sessions.js
  69. 2
      app/models/server/models/Users.js
  70. 8
      app/models/server/models/_BaseDb.js
  71. 2
      app/sms/server/services/mobex.js
  72. 2
      app/ui-clean-history/client/views/cleanHistory.js
  73. 8
      app/ui-flextab/client/flexTabBar.js
  74. 4
      app/ui-flextab/client/tabs/userActions.js
  75. 2
      app/ui-message/client/message.js
  76. 6
      app/ui-message/client/popup/messagePopupConfig.js
  77. 5
      app/ui-utils/client/lib/openRoom.js
  78. 4
      app/ui/client/components/header/headerRoom.js
  79. 2
      app/ui/client/components/status.js
  80. 2
      app/ui/client/lib/notification.js
  81. 8
      app/ui/client/views/app/createChannel.js
  82. 2
      app/user-data-download/server/cronProcessDownloads.js
  83. 2
      app/user-status/client/admin/adminUserStatus.js
  84. 2
      app/user-status/client/notifications/deleteCustomUserStatus.js
  85. 2
      app/user-status/client/notifications/updateCustomUserStatus.js
  86. 4
      app/webdav/server/lib/webdavClientAdapter.js
  87. 4
      app/webdav/server/methods/addWebdavAccount.js
  88. 2
      client/components/admin/info/InstancesSection.js
  89. 6
      client/components/admin/info/UsageSection.js
  90. 2
      client/components/admin/settings/inputs/ColorSettingInput.js
  91. 2
      client/components/admin/settings/inputs/LanguageSettingInput.js
  92. 2
      client/components/admin/settings/inputs/RoomPickSettingInput.js
  93. 2
      client/components/admin/settings/inputs/SelectSettingInput.js
  94. 2
      client/components/basic/Input.js
  95. 2
      client/components/setupWizard/SideBar.js
  96. 4
      client/components/setupWizard/steps/SettingsBasedStep.js
  97. 2
      client/routes.js
  98. 1056
      package-lock.json
  99. 17
      package.json
  100. 2
      server/methods/toogleFavorite.js
  101. Some files were not shown because too many files have changed in this diff Show More

@ -1,23 +1,104 @@
{
"extends": ["@rocket.chat/eslint-config"],
"parser": "babel-eslint",
"globals": {
"__meteor_bootstrap__" : false,
"__meteor_runtime_config__" : false,
"Assets" : false,
"chrome" : false
"extends": [
"@rocket.chat/eslint-config"
],
"parser": "babel-eslint",
"globals": {
"__meteor_bootstrap__": false,
"__meteor_runtime_config__": false,
"Assets": false,
"chrome": false,
"jscolor": false
},
"plugins": ["react"],
"rules": {
"jsx-quotes": ["error", "prefer-single"],
"plugins": [
"react"
],
"rules": {
"jsx-quotes": [
"error",
"prefer-single"
],
"react/jsx-uses-react": "error",
"react/jsx-uses-vars": "error",
"react/jsx-no-undef": "error",
"react/jsx-fragments": ["error", "syntax"],
"react/jsx-fragments": [
"error",
"syntax"
],
},
"settings": {
"react": {
"version": "detect",
},
},
"overrides": [
{
"files": [
"**/*.ts",
"**/*.tsx"
],
"extends": [
"@rocket.chat/eslint-config",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/eslint-recommended"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2018,
"warnOnUnsupportedTypeScriptVersion": false,
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"legacyDecorators": true
}
},
"plugins": [
"react",
"@typescript-eslint"
],
"rules": {
"jsx-quotes": [
"error",
"prefer-single"
],
"react/jsx-uses-react": "error",
"react/jsx-uses-vars": "error",
"react/jsx-no-undef": "error",
"react/jsx-fragments": [
"error",
"syntax"
],
"@typescript-eslint/ban-ts-ignore": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/interface-name-prefix": [
"error",
"always"
]
},
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"node": true
},
"settings": {
"import/resolver": {
"node": {
"extensions": [
".js",
".ts",
".tsx"
]
}
},
"react": {
"version": "detect"
}
}
}
]
}

@ -17,6 +17,7 @@ ddp-rate-limiter@1.0.7
ddp-common@1.4.0
dynamic-import@0.5.1
ecmascript@0.13.0
typescript
ejson@1.1.0
email@1.2.3
fastclick@1.0.13

@ -150,6 +150,7 @@ tmeasday:check-npm-versions@0.3.2
todda00:friendly-slugs@0.6.0
tracker@1.2.0
twitter-oauth@1.2.0
typescript@3.7.0
ui@1.0.13
underscore@1.0.10
url@1.2.0

@ -13,7 +13,7 @@ let pkgJson = {};
try {
pkgJson = require(path.resolve( // eslint-disable-line import/no-dynamic-require
process.cwd(),
'./package.json'
'./package.json',
));
} catch (err) {
console.error('no root package.json found');
@ -87,7 +87,7 @@ git.status()
type: 'confirm',
message: 'Commit files?',
name: 'commit',
}])
}]),
)
.then((answers) => {
if (!answers.commit) {

@ -43,7 +43,7 @@ function startProcess(opts, callback) {
const proc = spawn(
opts.command,
opts.params,
opts.options
opts.options,
);
if (opts.waitForMessage) {

@ -5,7 +5,7 @@ let pkgJson = {};
try {
pkgJson = require(path.resolve( // eslint-disable-line import/no-dynamic-require
process.cwd(),
'./package.json'
'./package.json',
));
} catch (err) {
console.error('no root package.json found');

@ -162,7 +162,7 @@ API.v1.addRoute('spotlight', { authRequired: true }, {
const { query } = this.queryParams;
const result = Meteor.runAsUser(this.userId, () =>
Meteor.call('spotlight', query)
Meteor.call('spotlight', query),
);
return API.v1.success(result);

@ -134,8 +134,8 @@ API.v1.addRoute('rooms.saveNotification', { authRequired: true }, {
const saveNotifications = (notifications, roomId) => {
Object.keys(notifications).forEach((notificationKey) =>
Meteor.runAsUser(this.userId, () =>
Meteor.call('saveNotificationSettings', roomId, notificationKey, notifications[notificationKey])
)
Meteor.call('saveNotificationSettings', roomId, notificationKey, notifications[notificationKey]),
),
);
};
const { roomId, notifications } = this.bodyParams;

@ -62,7 +62,7 @@ API.v1.addRoute('subscriptions.read', { authRequired: true }, {
});
Meteor.runAsUser(this.userId, () =>
Meteor.call('readMessages', this.bodyParams.rid)
Meteor.call('readMessages', this.bodyParams.rid),
);
return API.v1.success();
@ -77,7 +77,7 @@ API.v1.addRoute('subscriptions.unread', { authRequired: true }, {
}
Meteor.runAsUser(this.userId, () =>
Meteor.call('unreadMessages', firstUnreadMessage, roomId)
Meteor.call('unreadMessages', firstUnreadMessage, roomId),
);
return API.v1.success();

@ -170,7 +170,7 @@ export class AppCommandsBridge {
Object.freeze(user),
Object.freeze(room),
Object.freeze(params),
threadId
threadId,
);
return Promise.await(this.orch.getManager().getCommandManager().getPreviews(command, context));
}
@ -185,7 +185,7 @@ export class AppCommandsBridge {
Object.freeze(user),
Object.freeze(room),
Object.freeze(params),
threadId
threadId,
);
Promise.await(this.orch.getManager().getCommandManager().executePreview(command, preview, context));
}

@ -77,7 +77,7 @@ export class AppMessageBridge {
Users.findByIds(users, { fields: { _id: 1 } })
.fetch()
.forEach(({ _id }) =>
Notifications.notifyUser(_id, 'message', rmsg)
Notifications.notifyUser(_id, 'message', rmsg),
);
}
}

@ -93,7 +93,7 @@ export const appsUpdateMarketplaceInfo = Meteor.bindEnvironment(function _appsUp
Promise.await(
Apps.updateAppsMarketplaceInfo(data)
.then(notifyAdminsAboutInvalidApps)
.then(notifyAdminsAboutRenewedApps)
.then(notifyAdminsAboutRenewedApps),
);
});

@ -8,13 +8,12 @@ import { Template } from 'meteor/templating';
import { Roles } from '../../../models';
import { ChatPermissions } from '../lib/ChatPermissions';
import { hasAllPermission } from '../hasPermission';
import { hasAtLeastOnePermission } from '..';
import { t } from '../../../utils/client';
import { SideNav } from '../../../ui-utils/client/lib/SideNav';
import { CONSTANTS } from '../../lib';
import { hasAtLeastOnePermission } from '..';
Template.permissions.helpers({
tabsData() {
const {
@ -85,7 +84,7 @@ Template.permissions.helpers({
_id: 1,
},
limit,
}
},
);
},
@ -105,7 +104,7 @@ Template.permissions.helpers({
group: 1,
section: 1,
},
}
},
);
},

@ -25,7 +25,7 @@ Permissions.on('change', ({ clientAction, id, data, diff }) => {
Notifications.notifyLoggedInThisInstance(
'permissions-changed',
clientAction,
data
data,
);
if (data.level && data.level === CONSTANTS.SETTINGS_LEVEL) {
@ -36,7 +36,7 @@ Permissions.on('change', ({ clientAction, id, data, diff }) => {
Notifications.notifyLoggedInThisInstance(
'private-settings-changed',
'updated',
setting
setting,
);
}
});

@ -16,7 +16,7 @@ Meteor.methods({
remove: Permissions.trashFindDeletedAfter(
updatedAt,
{},
{ fields: { _id: 1, _deletedAt: 1 } }
{ fields: { _id: 1, _deletedAt: 1 } },
).fetch(),
};
}

@ -50,7 +50,7 @@ const createCallbackTimed = (hook, callbacks) =>
callbacks
.map(wrapCallback)
.map(handleResult)
.reduce(pipe, identity)
.reduce(pipe, identity),
);
const create = (hook, cbs) =>
@ -79,7 +79,7 @@ callbacks.add = function(
hook,
callback,
priority = callbacks.priority.MEDIUM,
id = Random.id()
id = Random.id(),
) {
callbacks[hook] = getHooks(hook);
if (callbacks[hook].find((cb) => cb.id === id)) {

@ -45,7 +45,7 @@ Meteor.loginWithCas = function(options, callback) {
const popup = openCenteredPopup(
loginUrl,
popup_width || 800,
popup_height || 600
popup_height || 600,
);

@ -412,7 +412,7 @@ Template.channelSettingsEditing.onCreated(function() {
canView() {
return roomTypes.roomTypes[room.t].allowRoomSettingChange(
room,
RoomSettingsEnum.SYSTEM_MESSAGES
RoomSettingsEnum.SYSTEM_MESSAGES,
);
},
getValue() {
@ -425,9 +425,9 @@ Template.channelSettingsEditing.onCreated(function() {
return call('saveRoomSettings', room._id, 'systemMessages', value).then(
() => {
toastr.success(
t('System_messages_setting_changed_successfully')
t('System_messages_setting_changed_successfully'),
);
}
},
);
},
},
@ -572,9 +572,9 @@ Template.channelSettingsEditing.onCreated(function() {
return call('saveRoomSettings', room._id, 'retentionOverrideGlobal', value).then(
() => {
toastr.success(
t('Retention_setting_changed_successfully')
t('Retention_setting_changed_successfully'),
);
}
},
);
},
},
@ -596,9 +596,9 @@ Template.channelSettingsEditing.onCreated(function() {
return call('saveRoomSettings', room._id, 'retentionMaxAge', value).then(
() => {
toastr.success(
t('Retention_setting_changed_successfully')
t('Retention_setting_changed_successfully'),
);
}
},
);
},
},
@ -620,9 +620,9 @@ Template.channelSettingsEditing.onCreated(function() {
return call('saveRoomSettings', room._id, 'retentionExcludePinned', value).then(
() => {
toastr.success(
t('Retention_setting_changed_successfully')
t('Retention_setting_changed_successfully'),
);
}
},
);
},
},
@ -644,9 +644,9 @@ Template.channelSettingsEditing.onCreated(function() {
return call('saveRoomSettings', room._id, 'retentionFilesOnly', value).then(
() => {
toastr.success(
t('Retention_setting_changed_successfully')
t('Retention_setting_changed_successfully'),
);
}
},
);
},
},
@ -664,7 +664,7 @@ Template.channelSettingsEditing.onCreated(function() {
save(value) {
return call('saveRoomSettings', room._id, 'encrypted', value).then(() => {
toastr.success(
t('Encrypted_setting_changed_successfully')
t('Encrypted_setting_changed_successfully'),
);
});
},

@ -315,7 +315,7 @@ class ChatpalProvider extends SearchProvider {
payload.start || 0,
payload.rows || this._settings.get('PageSize'),
callback,
params
params,
);
}
@ -332,7 +332,7 @@ class ChatpalProvider extends SearchProvider {
this._settings.get('Main_Language'),
this._getAcl(context),
type,
callback
callback,
);
}
}

@ -123,7 +123,7 @@ Template.adminSounds.onRendered(() =>
Tracker.afterFlush(function() {
SideNav.setFlex('adminFlex');
SideNav.openFlex();
})
}),
);
Template.adminSounds.events({

@ -133,7 +133,7 @@ Template.soundEdit.onCreated(function() {
handleError(uploadError);
console.log(uploadError);
}
}
},
);
delete this.soundFile;
toastr.success(TAPi18n.__('File_uploaded'));

@ -20,7 +20,7 @@ class CustomSoundsClass {
sound.src = this.getURL(sound);
}
const audio = $('<audio />', { id: sound._id, preload: true }).append(
$('<source />', { src: sound.src })
$('<source />', { src: sound.src }),
);
const list = this.list.get();
list[sound._id] = sound;
@ -81,5 +81,5 @@ Meteor.startup(() =>
CustomSounds.add(sound);
}
});
})
}),
);

@ -6,6 +6,6 @@ import { CustomSounds } from '../lib/CustomSounds';
Meteor.startup(() =>
CachedCollectionManager.onLogin(() =>
Notifications.onAll('deleteCustomSound', (data) => CustomSounds.remove(data.soundData))
)
Notifications.onAll('deleteCustomSound', (data) => CustomSounds.remove(data.soundData)),
),
);

@ -6,6 +6,6 @@ import { CustomSounds } from '../lib/CustomSounds';
Meteor.startup(() =>
CachedCollectionManager.onLogin(() =>
Notifications.onAll('updateCustomSound', (data) => CustomSounds.update(data.soundData))
)
Notifications.onAll('updateCustomSound', (data) => CustomSounds.update(data.soundData)),
),
);

@ -17,7 +17,7 @@ Meteor.methods({
RocketChatFileCustomSoundsInstance.deleteFile(`${ soundData._id }.${ soundData.extension }`);
const ws = RocketChatFileCustomSoundsInstance.createWriteStream(`${ soundData._id }.${ soundData.extension }`, contentType);
ws.on('end', Meteor.bindEnvironment(() =>
Meteor.setTimeout(() => Notifications.notifyAll('updateCustomSound', { soundData }), 500)
Meteor.setTimeout(() => Notifications.notifyAll('updateCustomSound', { soundData }), 500),
));
rs.pipe(ws);

@ -40,7 +40,7 @@ if (Meteor.isServer) {
config.serverURL = settings.get('Accounts_OAuth_Dolphin_URL');
return Dolphin.configure(config);
},
})
}),
);
if (settings.get('Accounts_OAuth_Dolphin_URL')) {
@ -65,6 +65,6 @@ if (Meteor.isServer) {
config.serverURL = settings.get('Accounts_OAuth_Dolphin_URL');
return Dolphin.configure(config);
}
})
}),
);
}

@ -117,7 +117,7 @@ Template.adminEmoji.onRendered(() =>
Tracker.afterFlush(function() {
SideNav.setFlex('adminFlex');
SideNav.openFlex();
})
}),
);
Template.adminEmoji.events({

@ -131,7 +131,7 @@ Template.emojiEdit.onCreated(function() {
handleError(uploadError);
console.log(uploadError);
}
}
},
);
delete this.emojiFile;
toastr.success(TAPi18n.__('File_uploaded'));

@ -187,5 +187,5 @@ Meteor.startup(() =>
} catch (e) {
console.error('Error getting custom emoji', e);
}
})
}),
);

@ -4,5 +4,5 @@ import { Notifications } from '../../../notifications';
import { deleteEmojiCustom } from '../lib/emojiCustom';
Meteor.startup(() =>
Notifications.onLogged('deleteEmojiCustom', (data) => deleteEmojiCustom(data.emojiData))
Notifications.onLogged('deleteEmojiCustom', (data) => deleteEmojiCustom(data.emojiData)),
);

@ -4,5 +4,5 @@ import { Notifications } from '../../../notifications';
import { updateEmojiCustom } from '../lib/emojiCustom';
Meteor.startup(() =>
Notifications.onLogged('updateEmojiCustom', (data) => updateEmojiCustom(data.emojiData))
Notifications.onLogged('updateEmojiCustom', (data) => updateEmojiCustom(data.emojiData)),
);

@ -91,7 +91,7 @@ Meteor.methods({
RocketChatFileEmojiCustomInstance.deleteFile(encodeURIComponent(`${ emojiData.name }.${ emojiData.extension }`));
const ws = RocketChatFileEmojiCustomInstance.createWriteStream(encodeURIComponent(`${ emojiData.name }.${ emojiData.previousExtension }`), rs.contentType);
ws.on('end', Meteor.bindEnvironment(() =>
RocketChatFileEmojiCustomInstance.deleteFile(encodeURIComponent(`${ emojiData.previousName }.${ emojiData.previousExtension }`))
RocketChatFileEmojiCustomInstance.deleteFile(encodeURIComponent(`${ emojiData.previousName }.${ emojiData.previousExtension }`)),
));
rs.readStream.pipe(ws);
}

@ -21,7 +21,7 @@ Meteor.methods({
RocketChatFileEmojiCustomInstance.deleteFile(encodeURIComponent(`${ emojiData.name }.${ emojiData.extension }`));
const ws = RocketChatFileEmojiCustomInstance.createWriteStream(encodeURIComponent(`${ emojiData.name }.${ emojiData.extension }`), contentType);
ws.on('end', Meteor.bindEnvironment(() =>
Meteor.setTimeout(() => Notifications.notifyLogged('updateEmojiCustom', { emojiData }), 500)
Meteor.setTimeout(() => Notifications.notifyLogged('updateEmojiCustom', { emojiData }), 500),
));
rs.pipe(ws);

@ -49,7 +49,7 @@ Tracker.autorun(() => {
const walker = document.createTreeWalker(
checkEmojiOnly,
NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT,
filter
filter,
);

@ -170,7 +170,7 @@ export class HipChatImporter extends Base {
if (c.room_id === channel.channel_id) {
c.do_import = channel.do_import;
}
})
}),
);
this.collection.update({ _id: this.channels._id }, { $set: { channels: this.channels.channels } });

@ -1,8 +1,5 @@
import { Meteor } from 'meteor/meteor';
import { Tracker } from 'meteor/tracker';
import { Importers } from '..';
import { FlowRouter } from 'meteor/kadira:flow-router';
import { Template } from 'meteor/templating';
import { TAPi18n } from 'meteor/rocketchat:tap-i18n';
@ -11,6 +8,8 @@ import { hasRole } from '../../../authorization';
import { t, handleError } from '../../../utils';
import { SideNav } from '../../../ui-utils/client';
import { Importers } from '..';
Template.adminImport.helpers({
isAdmin() {
return hasRole(Meteor.userId(), 'admin');

@ -1,8 +1,5 @@
import { Meteor } from 'meteor/meteor';
import { Tracker } from 'meteor/tracker';
import { Importers } from '..';
import { Template } from 'meteor/templating';
import toastr from 'toastr';
import { ReactiveVar } from 'meteor/reactive-var';
@ -13,6 +10,8 @@ import { t, APIClient } from '../../../utils';
import { ProgressStep } from '../../lib/ImporterProgressStep';
import { SideNav } from '../../../ui-utils/client';
import { Importers } from '..';
Template.adminImportHistory.helpers({
isAdmin() {
return hasRole(Meteor.userId(), 'admin');

@ -1,9 +1,6 @@
import { Meteor } from 'meteor/meteor';
import { ReactiveVar } from 'meteor/reactive-var';
import { Tracker } from 'meteor/tracker';
import { Importers } from '..';
import { FlowRouter } from 'meteor/kadira:flow-router';
import { Template } from 'meteor/templating';
import { TAPi18n } from 'meteor/rocketchat:tap-i18n';
@ -14,6 +11,8 @@ import { settings } from '../../../settings';
import { t, handleError, APIClient } from '../../../utils';
import { SideNav } from '../../../ui-utils/client';
import { Importers } from '..';
Template.adminImportPrepare.helpers({
isAdmin() {
return hasRole(Meteor.userId(), 'admin');

@ -1,14 +1,13 @@
import { Meteor } from 'meteor/meteor';
import { ReactiveVar } from 'meteor/reactive-var';
import { Importers, ImporterWebsocketReceiver, ProgressStep } from '..';
import { FlowRouter } from 'meteor/kadira:flow-router';
import { Template } from 'meteor/templating';
import toastr from 'toastr';
import { t, handleError } from '../../../utils';
import { Importers, ImporterWebsocketReceiver, ProgressStep } from '..';
Template.adminImportProgress.helpers({
step() {
return Template.instance().step.get();

@ -274,7 +274,7 @@ export class Base {
* @returns {Progress} The progress record of the import.
*/
addCountToTotal(count) {
this.progress.count.total = this.progress.count.total + count;
this.progress.count.total += count;
this.updateRecord({ 'count.total': this.progress.count.total });
return this.progress;
@ -287,7 +287,7 @@ export class Base {
* @returns {Progress} The progress record of the import.
*/
addCountCompleted(count) {
this.progress.count.completed = this.progress.count.completed + count;
this.progress.count.completed += count;
// Only update the database every 500 records
// Or the completed is greater than or equal to the total amount

@ -3,12 +3,13 @@ import fs from 'fs';
import { Meteor } from 'meteor/meteor';
import { Importers } from '..';
import { RocketChatImportFileInstance } from '../startup/store';
import { ProgressStep } from '../../lib/ImporterProgressStep';
import { hasRole } from '../../../authorization';
import { Importers } from '..';
function downloadHttpFile(fileUrl, writeStream) {
http.get(fileUrl, function(response) {
response.pipe(writeStream);

@ -4,12 +4,11 @@ import fs from 'fs';
import { Meteor } from 'meteor/meteor';
import { RocketChatImportFileInstance } from '../startup/store';
import { Importers } from '..';
import { hasRole } from '../../../authorization';
import { ProgressStep } from '../../lib/ImporterProgressStep';
import { Importers } from '..';
Meteor.methods({
getImportFileData(importerKey) {
const userId = Meteor.userId();

@ -1,8 +1,9 @@
import { Meteor } from 'meteor/meteor';
import { hasPermission } from '../../../authorization';
import { Importers } from '..';
import { hasPermission } from '../../../authorization';
Meteor.methods({
getImportProgress(key) {

@ -1,11 +1,12 @@
import { Meteor } from 'meteor/meteor';
import { hasPermission } from '../../../authorization';
import {
Importers,
ProgressStep,
} from '..';
import { hasPermission } from '../../../authorization';
Meteor.methods({
getSelectionData(key) {

@ -1,9 +1,10 @@
import { Meteor } from 'meteor/meteor';
import { check } from 'meteor/check';
import { hasPermission } from '../../../authorization';
import { Importers } from '..';
import { hasPermission } from '../../../authorization';
Meteor.methods({
prepareImport(key, dataURI, contentType, fileName) {

@ -1,11 +1,12 @@
import { Meteor } from 'meteor/meteor';
import { hasPermission } from '../../../authorization';
import {
Importers,
ProgressStep,
} from '..';
import { hasPermission } from '../../../authorization';
Meteor.methods({
restartImport(key) {

@ -1,8 +1,9 @@
import { Meteor } from 'meteor/meteor';
import { hasPermission } from '../../../authorization';
import { Importers } from '..';
import { hasPermission } from '../../../authorization';
Meteor.methods({
setupImporter(key) {

@ -1,5 +1,7 @@
import { Meteor } from 'meteor/meteor';
import { hasPermission } from '../../../authorization';
import {
Importers,
Selection,
@ -7,7 +9,6 @@ import {
SelectionUser,
} from '..';
import { hasPermission } from '../../../authorization';
Meteor.methods({
startImport(key, input) {

@ -1,11 +1,12 @@
import { Meteor } from 'meteor/meteor';
import { Importers } from '..';
import { RocketChatFile } from '../../../file';
import { RocketChatImportFileInstance } from '../startup/store';
import { hasRole } from '../../../authorization';
import { Importers } from '..';
Meteor.methods({
uploadImportFile(binaryContent, contentType, fileName, importerKey) {
const userId = Meteor.userId();

@ -34,7 +34,7 @@ window.addEventListener('resize', window.lazyloadtick);
export const lazyloadtick = _.debounce(() => {
const lazyImg = document.querySelectorAll('.lazy-img[data-src]');
Array.from(lazyImg).forEach((el) =>
isVisible(el, Blaze.getView(el)._templateInstance)
isVisible(el, Blaze.getView(el)._templateInstance),
);
}, 300);

@ -7,6 +7,6 @@ Meteor.startup(function() {
Notifications.onLogged('Users:Deleted', ({ userId }) =>
ChatMessage.remove({
'u._id': userId,
})
}),
);
});

@ -20,7 +20,7 @@ export const cleanRoomHistory = function({ rid, latest = new Date(), oldest = ne
ignoreDiscussion,
ts,
fromUsers,
{ fields: { 'file._id': 1, pinned: 1 }, limit }
{ fields: { 'file._id': 1, pinned: 1 }, limit },
).forEach((document) => {
FileUpload.getStore('Uploads').deleteById(document.file._id);
fileCount++;

@ -329,7 +329,7 @@ export async function sendAllNotifications(message, room) {
await callJoinRoom(userId, room._id);
return userId;
})
}),
).then((users) => {
users.forEach((userId) => {
const subscription = Subscriptions.findOneByRoomIdAndUserId(room._id, userId);

@ -44,7 +44,7 @@ Accounts.registerLoginHandler(function(options) {
type: 'oauth',
error: new Meteor.Error(
Accounts.LoginCancelledError.numericError,
`No registered oauth service found for: ${ service.serviceName }`
`No registered oauth service found for: ${ service.serviceName }`,
),
};
}

@ -144,7 +144,7 @@ const reconfigureLimit = Meteor.bindEnvironment((name, rules, factor = 1) => {
rules,
settings.get(`DDP_Rate_Limit_${ name }_Requests_Allowed`) * factor,
settings.get(`DDP_Rate_Limit_${ name }_Interval_Time`) * factor,
callback(`limit by ${ messages[name] }`, name)
callback(`limit by ${ messages[name] }`, name),
);
});

@ -55,7 +55,7 @@ Template.livechatAgents.helpers({
? text
: text.replace(
new RegExp(filter.get()),
(part) => `<strong>${ part }</strong>`
(part) => `<strong>${ part }</strong>`,
)
}`;
};
@ -111,7 +111,7 @@ Template.livechatAgents.events({
},
() => {
Meteor.call('livechat:removeAgent', this.username, async function(
error /* , result*/
error, /* , result*/
) {
if (error) {
return handleError(error);
@ -131,7 +131,7 @@ Template.livechatAgents.events({
showConfirmButton: false,
});
});
}
},
);
},
@ -148,7 +148,7 @@ Template.livechatAgents.events({
state.set('loading', true);
try {
await Promise.all(
users.map(({ username }) => call('livechat:addAgent', username))
users.map(({ username }) => call('livechat:addAgent', username)),
);
await loadAgents(instance, limit.get(), filter.get());

@ -51,7 +51,7 @@ Template.livechatDepartmentForm.helpers({
? text
: text.replace(
new RegExp(filter.get()),
(part) => `<strong>${ part }</strong>`
(part) => `<strong>${ part }</strong>`,
)
}`;
};

@ -50,7 +50,7 @@ Template.livechatManagers.helpers({
? text
: text.replace(
new RegExp(filter.get()),
(part) => `<strong>${ part }</strong>`
(part) => `<strong>${ part }</strong>`,
)
}`;
};
@ -95,7 +95,7 @@ Template.livechatManagers.events({
},
() => {
Meteor.call('livechat:removeManager', this.username, function(
error /* , result*/
error, /* , result*/
) {
if (error) {
return handleError(error);
@ -109,7 +109,7 @@ Template.livechatManagers.events({
showConfirmButton: false,
});
});
}
},
);
},
async 'submit #form-manager'(e, instance) {
@ -125,7 +125,7 @@ Template.livechatManagers.events({
state.set('loading', true);
try {
await Promise.all(
users.map(({ username }) => call('livechat:addManager', username))
users.map(({ username }) => call('livechat:addManager', username)),
);
selectedManagers.set([]);
} finally {
@ -164,7 +164,7 @@ Template.livechatManagers.onCreated(function() {
this.onClickTagManagers = ({ username }) => {
this.selectedManagers.set(
this.selectedManagers.curValue.filter((user) => user.username !== username)
this.selectedManagers.curValue.filter((user) => user.username !== username),
);
};

@ -130,7 +130,7 @@ Template.agentInfo.events({
showConfirmButton: false,
});
});
}
},
);
},
'click .edit-agent'(e, instance) {

@ -40,7 +40,7 @@ if (Meteor.isServer) {
sort: {
ts: 1,
},
}
},
);
}

@ -22,9 +22,9 @@ renderer.code = function(code, lang, escaped) {
let text = null;
if (!lang) {
text = `<pre><code class="code-colors hljs">${ (escaped ? code : s.escapeHTML(code, true)) }</code></pre>`;
text = `<pre><code class="code-colors hljs">${ escaped ? code : s.escapeHTML(code, true) }</code></pre>`;
} else {
text = `<pre><code class="code-colors hljs ${ escape(lang, true) }">${ (escaped ? code : s.escapeHTML(code, true)) }</code></pre>`;
text = `<pre><code class="code-colors hljs ${ escape(lang, true) }">${ escaped ? code : s.escapeHTML(code, true) }</code></pre>`;
}
if (_.isString(msg)) {

@ -18,7 +18,7 @@ const recursiveRemove = (msg, deep = 1) => {
}
msg.attachments = Array.isArray(msg.attachments) ? msg.attachments.map(
(nestedMsg) => recursiveRemove(nestedMsg, deep + 1)
(nestedMsg) => recursiveRemove(nestedMsg, deep + 1),
) : null;
return msg;
@ -106,7 +106,7 @@ Meteor.methods({
attachments: recursiveRemove(attachments),
},
],
}
},
);
},
unpinMessage(message) {

@ -35,7 +35,7 @@ Meteor.publish('snippetedMessage', function(_id) {
}
const cursor = Messages.find(
{ _id }
{ _id },
).observeChanges({
added(_id, record) {
publication.added('rocketchat_snippeted_message', _id, record);

@ -25,7 +25,7 @@ Meteor.publish('snippetedMessages', function(rid, limit = 50) {
{
sort: { ts: -1 },
limit,
}
},
).observeChanges({
added(_id, record) {
publication.added('rocketchat_snippeted_message', _id, record);

@ -40,7 +40,7 @@ WebApp.connectHandlers.use('/snippet/download', function(req, res) {
{
_id: match[1],
snippeted: true,
}
},
);
const room = Rooms.findOne({ _id: snippet.rid, usernames: { $in: [user.username] } });
if (room === undefined) {

@ -1,8 +1,9 @@
import { Users } from '..';
import _ from 'underscore';
import mem from 'mem';
import { Users } from '..';
const Subscriptions = {};
Object.assign(Subscriptions, {

@ -1,6 +1,7 @@
import { Base } from './_Base';
import * as Models from '..';
import { Base } from './_Base';
export class Roles extends Base {
constructor(...args) {

@ -159,8 +159,8 @@ export const aggregates = {
},
getMatchOfLastMonthToday({ year, month, day }) {
const pastMonthLastDay = (new Date(year, month - 1, 0)).getDate();
const currMonthLastDay = (new Date(year, month, 0)).getDate();
const pastMonthLastDay = new Date(year, month - 1, 0).getDate();
const currMonthLastDay = new Date(year, month, 0).getDate();
const lastMonthToday = new Date(year, month - 1, day);
lastMonthToday.setMonth(lastMonthToday.getMonth() - 1, (currMonthLastDay === day ? pastMonthLastDay : Math.min(pastMonthLastDay, day)) + 1);

@ -983,7 +983,7 @@ export class Users extends Base {
setPreferences(_id, preferences) {
const settingsObject = Object.assign(
{},
...Object.keys(preferences).map((key) => ({ [`settings.preferences.${ key }`]: preferences[key] }))
...Object.keys(preferences).map((key) => ({ [`settings.preferences.${ key }`]: preferences[key] })),
);
const update = {

@ -11,7 +11,7 @@ try {
trash._ensureIndex({ collection: 1 });
trash._ensureIndex(
{ _deletedAt: 1 },
{ expireAfterSeconds: 60 * 60 * 24 * 30 }
{ expireAfterSeconds: 60 * 60 * 24 * 30 },
);
} catch (e) {
console.log(e);
@ -57,12 +57,12 @@ export class BaseDb extends EventEmitter {
MongoInternals.defaultRemoteCollectionDriver().mongo._oplogHandle.onOplogEntry(
query,
this.processOplogRecord.bind(this)
this.processOplogRecord.bind(this),
);
// Meteor will handle if we have a value https://github.com/meteor/meteor/blob/5dcd0b2eb9c8bf881ffbee98bc4cb7631772c4da/packages/mongo/oplog_tailing.js#L5
if (process.env.METEOR_OPLOG_TOO_FAR_BEHIND == null) {
MongoInternals.defaultRemoteCollectionDriver().mongo._oplogHandle._defineTooFarBehind(
Number.MAX_SAFE_INTEGER
Number.MAX_SAFE_INTEGER,
);
}
};
@ -148,7 +148,7 @@ export class BaseDb extends EventEmitter {
(key) =>
key.includes('.$')
|| (Match.test(update[key], Object)
&& this.updateHasPositionalOperator(update[key]))
&& this.updateHasPositionalOperator(update[key])),
);
}

@ -121,7 +121,7 @@ class Mobex {
},
],
},
}
},
);
result.isSuccess = true;

@ -41,7 +41,7 @@ const purgeWorker = function(roomId, oldest, latest, inclusive, limit, excludePi
const getTimeZoneOffset = function() {
const offset = new Date().getTimezoneOffset();
const absOffset = Math.abs(offset);
return `${ offset < 0 ? '+' : '-' }${ `00${ Math.floor(absOffset / 60) }`.slice(-2) }:${ `00${ (absOffset % 60) }`.slice(-2) }`;
return `${ offset < 0 ? '+' : '-' }${ `00${ Math.floor(absOffset / 60) }`.slice(-2) }:${ `00${ absOffset % 60 }`.slice(-2) }`;
};

@ -22,13 +22,13 @@ const commonHelpers = {
};
function canShowAddUsersButton(rid) {
const canAddToChannel = hasAllPermission(
'add-user-to-any-c-room', rid
'add-user-to-any-c-room', rid,
);
const canAddToGroup = hasAllPermission(
'add-user-to-any-p-room', rid
'add-user-to-any-p-room', rid,
);
const canAddToJoinedRoom = hasAllPermission(
'add-user-to-joined-room', rid
'add-user-to-joined-room', rid,
);
if (
!canAddToJoinedRoom
@ -68,7 +68,7 @@ Template.flexTabBar.helpers({
...commonHelpers,
buttons() {
return TabBar.getButtons().filter((button) =>
filterButtons(button, this.anonymous, this.data && this.data.rid)
filterButtons(button, this.anonymous, this.data && this.data.rid),
);
},
opened() {

@ -104,7 +104,7 @@ export const getActions = ({ user, directActions, hideAdminControls }) => {
icon: 'message',
name: t('Conversation'),
action: prevent(getUser, ({ username }) =>
Meteor.call('createDirectMessage', username, success((result) => result.rid && FlowRouter.go('direct', { username }, FlowRouter.current().queryParams)))
Meteor.call('createDirectMessage', username, success((result) => result.rid && FlowRouter.go('direct', { username }, FlowRouter.current().queryParams))),
),
condition() {
return canDirectMessageTo(this.username);
@ -376,7 +376,7 @@ export const getActions = ({ user, directActions, hideAdminControls }) => {
timer: 2000,
showConfirmButton: false,
});
}))
})),
);
}),
};

@ -464,7 +464,7 @@ const findParentMessage = (() => {
repliesCount: message.tcount,
},
},
{ multi: true }
{ multi: true },
);
};
})();

@ -218,7 +218,7 @@ Template.messagePopupConfig.helpers({
{
limit: 5,
sort: { ts: -1 },
}
},
)
.fetch();
@ -246,7 +246,7 @@ Template.messagePopupConfig.helpers({
},
{
fields: { name: 1 },
}
},
)
.map(({ name }) => name);
const newItems = Users
@ -263,7 +263,7 @@ Template.messagePopupConfig.helpers({
status: 1,
},
limit: 5 - usernamesAlreadyFetched.length,
}
},
)
.fetch()
.map(({ username, name, status }) => ({

@ -6,9 +6,6 @@ import { FlowRouter } from 'meteor/kadira:flow-router';
import { BlazeLayout } from 'meteor/kadira:blaze-layout';
import { Session } from 'meteor/session';
import mem from 'mem';
import { RoomManager, fireGlobalEvent, RoomHistoryManager } from '..';
import _ from 'underscore';
import { ChatSubscription, Rooms } from '../../../models';
@ -16,6 +13,8 @@ import { settings } from '../../../settings';
import { callbacks } from '../../../callbacks';
import { roomTypes, handleError } from '../../../utils';
import { RoomManager, fireGlobalEvent, RoomHistoryManager } from '..';
window.currentTracker = undefined;
const getDomOfLoading = mem(function getDomOfLoading() {

@ -154,7 +154,7 @@ Template.headerRoom.events({
'toggleFavorite',
this._id,
!instance.state.get('favorite'),
(err) => err && handleError(err)
(err) => err && handleError(err),
);
},
@ -170,7 +170,7 @@ Template.headerRoom.events({
if (hasAllPermission('edit-room', this._id)) {
call('saveRoomSettings', this._id, 'encrypted', !(room && room.encrypted)).then(() => {
toastr.success(
t('Encrypted_setting_changed_successfully')
t('Encrypted_setting_changed_successfully'),
);
});
}

@ -18,7 +18,7 @@ const clearRetryInterval = function() {
const trackStatus = function() {
if (Meteor.status().status === 'waiting') {
retryHandle = retryHandle || setInterval(function() {
const timeDiff = Meteor.status().retryTime - (new Date()).getTime();
const timeDiff = Meteor.status().retryTime - new Date().getTime();
const _retryTime = (timeDiff > 0 && Math.round(timeDiff / 1000)) || 0;
retryTime.set(_retryTime);

@ -56,7 +56,7 @@ export const KonchatNotification = {
_id: Random.id(),
rid: notification.payload.rid,
msg: response,
})
}),
);
}

@ -155,17 +155,17 @@ Template.createChannel.helpers({
roomTypesBeforeStandard() {
const orderLow = roomTypes.roomTypesOrder.filter((roomTypeOrder) => roomTypeOrder.identifier === 'c')[0].order;
return roomTypes.roomTypesOrder.filter(
(roomTypeOrder) => roomTypeOrder.order < orderLow
(roomTypeOrder) => roomTypeOrder.order < orderLow,
).map(
(roomTypeOrder) => roomTypes.roomTypes[roomTypeOrder.identifier]
(roomTypeOrder) => roomTypes.roomTypes[roomTypeOrder.identifier],
).filter((roomType) => roomType.creationTemplate);
},
roomTypesAfterStandard() {
const orderHigh = roomTypes.roomTypesOrder.filter((roomTypeOrder) => roomTypeOrder.identifier === 'd')[0].order;
return roomTypes.roomTypesOrder.filter(
(roomTypeOrder) => roomTypeOrder.order > orderHigh
(roomTypeOrder) => roomTypeOrder.order > orderHigh,
).map(
(roomTypeOrder) => roomTypes.roomTypes[roomTypeOrder.identifier]
(roomTypeOrder) => roomTypes.roomTypes[roomTypeOrder.identifier],
).filter((roomType) => roomType.creationTemplate);
},
});

@ -139,7 +139,7 @@ const hideUserName = function(username, exportOperation) {
if (exportOperation.userData && username === exportOperation.userData.username) {
exportOperation.userNameTable[username] = username;
} else {
exportOperation.userNameTable[username] = `User_${ (Object.keys(exportOperation.userNameTable).length + 1) }`;
exportOperation.userNameTable[username] = `User_${ Object.keys(exportOperation.userNameTable).length + 1 }`;
}
}

@ -105,7 +105,7 @@ Template.adminUserStatus.onRendered(() =>
Tracker.afterFlush(function() {
SideNav.setFlex('adminFlex');
SideNav.openFlex();
})
}),
);
Template.adminUserStatus.events({

@ -4,5 +4,5 @@ import { deleteCustomUserStatus } from '../lib/customUserStatus';
import { Notifications } from '../../../notifications';
Meteor.startup(() =>
Notifications.onLogged('deleteCustomUserStatus', (data) => deleteCustomUserStatus(data.userStatusData))
Notifications.onLogged('deleteCustomUserStatus', (data) => deleteCustomUserStatus(data.userStatusData)),
);

@ -4,5 +4,5 @@ import { updateCustomUserStatus } from '../lib/customUserStatus';
import { Notifications } from '../../../notifications';
Meteor.startup(() =>
Notifications.onLogged('updateCustomUserStatus', (data) => updateCustomUserStatus(data.userStatusData))
Notifications.onLogged('updateCustomUserStatus', (data) => updateCustomUserStatus(data.userStatusData)),
);

@ -5,7 +5,7 @@ export class WebdavClientAdapter {
if (cred.token) {
this._client = createClient(
serverConfig,
{ token: cred.token }
{ token: cred.token },
);
} else {
this._client = createClient(
@ -13,7 +13,7 @@ export class WebdavClientAdapter {
{
username: cred.username,
password: cred.password,
}
},
);
}
}

@ -36,7 +36,7 @@ Meteor.methods({
{
username: formData.username,
password: formData.pass,
}
},
);
const accountData = {
@ -73,7 +73,7 @@ Meteor.methods({
try {
const client = new WebdavClientAdapter(
data.serverURL,
{ token: data.token }
{ token: data.token },
);
const accountData = {

@ -24,7 +24,7 @@ export function InstancesSection({ instances }) {
<DescriptionList.Entry label={<>{t('Instance_Record')} > {t('PID')}</>}>{instanceRecord.pid}</DescriptionList.Entry>
<DescriptionList.Entry label={<>{t('Instance_Record')} > {t('Created_at')}</>}>{formatDate(instanceRecord._createdAt)}</DescriptionList.Entry>
<DescriptionList.Entry label={<>{t('Instance_Record')} > {t('Updated_at')}</>}>{formatDate(instanceRecord._updatedAt)}</DescriptionList.Entry>
</DescriptionList>
</DescriptionList>,
)}
</>;
}

@ -34,9 +34,9 @@ export function UsageSection({ statistics, isLoading }) {
<DescriptionList.Entry label={t('Stats_Total_Uploads')}>{s(() => statistics.uploadsTotal)}</DescriptionList.Entry>
<DescriptionList.Entry label={t('Stats_Total_Uploads_Size')}>{s(() => formatMemorySize(statistics.uploadsTotalSize))}</DescriptionList.Entry>
{statistics && statistics.apps && <>
<DescriptionList.Entry label={t('Stats_Total_Installed_Apps')}>{statistics.apps.totalInstalled}</DescriptionList.Entry>
<DescriptionList.Entry label={t('Stats_Total_Active_Apps')}>{statistics.apps.totalActive}</DescriptionList.Entry>
</>}
<DescriptionList.Entry label={t('Stats_Total_Installed_Apps')}>{statistics.apps.totalInstalled}</DescriptionList.Entry>
<DescriptionList.Entry label={t('Stats_Total_Active_Apps')}>{statistics.apps.totalActive}</DescriptionList.Entry>
</>}
<DescriptionList.Entry label={t('Stats_Total_Integrations')}>{s(() => statistics.integrations.totalIntegrations)}</DescriptionList.Entry>
<DescriptionList.Entry label={t('Stats_Total_Incoming_Integrations')}>{s(() => statistics.integrations.totalIncoming)}</DescriptionList.Entry>
<DescriptionList.Entry label={t('Stats_Total_Active_Incoming_Integrations')}>{s(() => statistics.integrations.totalIncomingActive)}</DescriptionList.Entry>

@ -100,7 +100,7 @@ export function ColorSettingInput({
onChange={handleEditorTypeChange}
>
{allowedTypes && allowedTypes.map((allowedType) =>
<SelectInput.Option key={allowedType} value={allowedType}>{t(allowedType)}</SelectInput.Option>
<SelectInput.Option key={allowedType} value={allowedType}>{t(allowedType)}</SelectInput.Option>,
)}
</SelectInput>
</Field>

@ -42,7 +42,7 @@ export function LanguageSettingInput({
onChange={handleChange}
>
{languages.map(({ key, name }) =>
<SelectInput.Option key={key} value={key} dir='auto'>{name}</SelectInput.Option>
<SelectInput.Option key={key} value={key} dir='auto'>{name}</SelectInput.Option>,
)}
</SelectInput>
</>;

@ -81,7 +81,7 @@ export function RoomPickSettingInput({
{value.map(({ _id, name }) =>
<li key={_id} className='remove-room' onClick={handleRemoveRoomButtonClick(_id)}>
{name} <Icon name='cross' />
</li>
</li>,
)}
</ul>
</>;

@ -43,7 +43,7 @@ export function SelectSettingInput({
onChange={handleChange}
>
{values.map(({ key, i18nLabel }) =>
<SelectInput.Option key={key} value={key}>{t(i18nLabel)}</SelectInput.Option>
<SelectInput.Option key={key} value={key}>{t(i18nLabel)}</SelectInput.Option>,
)}
</SelectInput>
</>;

@ -51,7 +51,7 @@ export const Input = ({
value=''
>{placeholder}</option>}
{options.map(({ label, value }, i) =>
<option key={i} className='rc-select__option' value={value}>{label}</option>
<option key={i} className='rc-select__option' value={value}>{label}</option>,
)}
</select>
<Icon block='rc-select__arrow' icon='arrow-down' />

@ -32,7 +32,7 @@ export function SideBar({
data-number={step}
>
{title}
</li>
</li>,
)}
</ol>
</div>

@ -51,7 +51,7 @@ export function SettingsBasedStep({ step, title, active }) {
.filter(({ wizard }) => wizard.step === step)
.filter(({ type }) => ['string', 'select', 'language'].includes(type))
.sort(({ wizard: { order: a } }, { wizard: { order: b } }) => a - b)
.map(({ value, ...field }) => ({ ...field, value: value || '' }))
.map(({ value, ...field }) => ({ ...field, value: value || '' })),
);
}, [settings, currentStep]);
@ -123,7 +123,7 @@ export function SettingsBasedStep({ step, title, active }) {
.sort((a, b) => a.key - b.key)
.map(({ label, value }) => <SelectInput.Option key={value} value={value}>{label}</SelectInput.Option>)}
</SelectInput>}
</Field>
</Field>,
)}
</FieldGroup>
</StepContent>

@ -38,7 +38,7 @@ const createTemplateForComponent = async (
component,
props = {},
// eslint-disable-next-line new-cap
renderContainerView = () => HTML.DIV()
renderContainerView = () => HTML.DIV(),
) => {
const name = component.displayName || component.name;

1056
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -25,8 +25,9 @@
"start": "meteor",
"debug": "meteor run --inspect",
"debug-brk": "meteor run --inspect-brk",
"lint": "meteor npm run stylelint && meteor npm run jslint",
"jslint": "eslint .",
"lint": "meteor npm run stylelint && meteor npm run eslint",
"jslint": "npm run eslint",
"eslint": "eslint --ext .js,.ts,.jsx,.tsx .",
"stylelint": "stylelint \"app/**/*.css\" \"client/**/*.css\"",
"test": "node .scripts/start.js",
"deploy": "npm run build && pm2 startOrRestart pm2.json",
@ -68,9 +69,13 @@
"@storybook/addon-viewport": "^5.2.4",
"@storybook/addons": "^5.2.4",
"@storybook/react": "^5.2.4",
"@types/bcrypt": "^3.0.0",
"@types/meteor": "^1.4.37",
"@typescript-eslint/eslint-plugin": "^2.11.0",
"@typescript-eslint/parser": "^2.11.0",
"acorn": "^6.0.7",
"autoprefixer": "^9.6.1",
"babel-eslint": "^10.0.1",
"babel-eslint": "^10.0.3",
"babel-loader": "^8.0.6",
"babel-mocha-es6-compiler": "^0.1.0",
"babel-plugin-array-includes": "^2.0.3",
@ -78,8 +83,9 @@
"chai-datetime": "^1.5.0",
"chimp": "^0.51.1",
"emojione-assets": "^4.5.0",
"eslint": "^5.9.0",
"eslint-plugin-react": "^7.14.3",
"eslint": "^6.7.2",
"eslint-plugin-import": "^2.19.1",
"eslint-plugin-react": "^7.17.0",
"fast-glob": "^2.2.6",
"husky": "^1.2.0",
"i18next": "^17.0.17",
@ -103,6 +109,7 @@
"stylelint": "^9.9.0",
"stylelint-order": "^2.0.0",
"supertest": "^3.3.0",
"typescript": "^3.7.3",
"webpack": "^4.29.3"
},
"dependencies": {

@ -18,7 +18,7 @@ Meteor.methods({
if (!userSubscription) {
throw new Meteor.Error('error-invalid-subscription',
'You must be part of a room to favorite it',
{ method: 'toggleFavorite' }
{ method: 'toggleFavorite' },
);
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save