Skip to content

converted messageAttachment coffee to js#6500

Merged
engelgabriel merged 2 commits into
RocketChat:developfrom
ggazzo:rocketchat-message-attachments
Mar 29, 2017
Merged

converted messageAttachment coffee to js#6500
engelgabriel merged 2 commits into
RocketChat:developfrom
ggazzo:rocketchat-message-attachments

Conversation

@ggazzo

@ggazzo ggazzo commented Mar 27, 2017

Copy link
Copy Markdown
Member

@RocketChat/core

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.

Why not declare the variable query here as const?

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 use the param's default value here:

getImageHeight(height = 200) {
  return height;
}

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.

A improvement for that IMO is:

const colors = {
  good: '#35AC19',
  warning: '#FCB316',
  danger: '#D30230'
};
return colors[this.color] || this.color

@geekgonecrazy geekgonecrazy changed the title converted messageAttachent coffee to js converted messageAttachment coffee to js Mar 28, 2017
@ggazzo
ggazzo force-pushed the rocketchat-message-attachments branch from afa023b to 4e1d31e Compare March 28, 2017 19:06
@engelgabriel
engelgabriel merged commit d408fa7 into RocketChat:develop Mar 29, 2017
@engelgabriel engelgabriel added this to the 0.55.0 milestone Mar 29, 2017
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