Skip to content

Convert ui-admin package to js#6911

Merged
rodrigok merged 16 commits into
developfrom
ui-admin-to-js
May 17, 2017
Merged

Convert ui-admin package to js#6911
rodrigok merged 16 commits into
developfrom
ui-admin-to-js

Conversation

@MartinSchoeler
Copy link
Copy Markdown
Member

@RocketChat/core

@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-6911 May 8, 2017 13:47 Inactive
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member Author

@ggazzo or @rodrigok could you do a review?

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
Copy Markdown
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