-
Notifications
You must be signed in to change notification settings - Fork 11.4k
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 ui-admin package to js #6911
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix the packages/rocketchat-ui-admin/client/admin.js
and apply the same 'logic' for all files.
languages() { | ||
const languages = TAPi18n.getLanguages(); | ||
let result = []; | ||
Object.keys(languages).forEach((key) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think one .map()
would be better
if (!group) { | ||
return; | ||
} | ||
const settings = RocketChat.settings.collectionPrivate.find({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use one line
} | ||
}).fetch(); | ||
const sections = {}; | ||
Object.keys(settings).forEach((key) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use key =>
if (!_.isArray(i18nDefaultQuery)) { | ||
i18nDefaultQuery = [i18nDefaultQuery]; | ||
} | ||
Object.keys(i18nDefaultQuery).forEach((key) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use key =>
}); | ||
|
||
group.sections = []; | ||
Object.keys(sections).forEach((key) =>{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use key =>
return { | ||
limit: 10, | ||
rules: [ | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you put the comment back?
return color.replace(/theme-color-/, '@'); | ||
}, | ||
showResetButton() { | ||
const setting = TempSettings.findOne({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one line
|
||
Template.admin.events({ | ||
'change .input-monitor, keyup .input-monitor': _.throttle(function(e) { | ||
let value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can declare and set the value at same line.
files = []; | ||
} | ||
} | ||
const results = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you dont need a result, coffee by default always returns the last thing.
toastr.info(TAPi18n.__('Uploading_file')); | ||
const reader = new FileReader(); | ||
reader.readAsBinaryString(blob); | ||
results.push(reader.onloadend = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's wrong, see again.
reader.onloadend = =>
Meteor.call 'setAsset', reader.result, blob.type, @asset, (err, data) ->
if err?
handleError(err)
# toastr.error err.reason, TAPi18n.__ err.error
console.log err
return
}, | ||
'click .remove-room'(event, instance) { | ||
const docId = this._id; | ||
const settingId = event.currentTarget.getAttribute('data-setting'); | ||
const selectedRooms = instance.selectedRooms.get(); | ||
selectedRooms[settingId] = _.reject(selectedRooms[settingId] || [], function(setting) { | ||
return setting._id === docId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can't remove this return
@RocketChat/core