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 ui-admin package to js #6911

Merged
merged 16 commits into from
May 17, 2017
Merged

Convert ui-admin package to js #6911

merged 16 commits into from
May 17, 2017

Conversation

MartinSchoeler
Copy link
Member

@RocketChat/core

@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-6911 May 8, 2017 13:47 Inactive
Copy link
Member

@ggazzo ggazzo left a 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) => {
Copy link
Member

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({
Copy link
Member

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) => {
Copy link
Member

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) => {
Copy link
Member

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) =>{
Copy link
Member

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: [
{
Copy link
Member

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({
Copy link
Member

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;
Copy link
Member

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 = [];
Copy link
Member

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 = () => {
Copy link
Member

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

@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-6911 May 9, 2017 17:09 Inactive
@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-6911 May 9, 2017 17:21 Inactive
@engelgabriel engelgabriel requested a deployment to rocket-chat-pr-6911 May 10, 2017 14:05 Pending
@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-6911 May 10, 2017 14:05 Inactive
@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-6911 May 12, 2017 17:49 Inactive
@MartinSchoeler
Copy link
Member Author

@ggazzo or @rodrigok could you do a review?

},
'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;
Copy link
Member

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

@rodrigok rodrigok added this to the 0.57.0 milestone May 17, 2017
@rodrigok rodrigok merged commit 29654c2 into develop May 17, 2017
@rodrigok rodrigok deleted the ui-admin-to-js branch May 17, 2017 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants