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

Fix a couple bugs with organizer view #13979

Merged
merged 1 commit into from Mar 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -307,7 +307,7 @@ const SurveyResultsHeader = React.createClass({
<b>{question['text']}</b>
{
thisWorkshop[question['key']].map((answer, j) => {
return (
return !!(_.trim(answer)) && (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not just filter before maping?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The syntax got really compressed.

_.filter(thisWorkshop[question['key']], (answer) => {return !!_.trim(answer)}).map((answer, j) => {
                return (
                  <li key={j}>
                    {answer}
                  </li>
                );
              })

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking more

thisWorkshop[question['key']].filter((answer) => {
  return !!_.trim(answer);
}).map((answer, j)) => {
  return (
    <li key={j}>
      {answer}
    </li>
  );
});

<li key={j}>
{answer}
</li>
Expand Down
Expand Up @@ -13,7 +13,7 @@ def index
survey_report[:all_workshops_for_course] = aggregate_for_all_workshops[params[:course]]

survey_report[:all_my_workshops_for_course], facilitator_scores = get_score_for_workshops(
::Pd::Workshop.where(course: params[:course], organizer_id: current_user.id), facilitator_breakdown: true
::Pd::Workshop.where(course: params[:course], organizer_id: current_user.id).in_state(::Pd::Workshop::STATE_ENDED), facilitator_breakdown: true
)
survey_report.merge!(facilitator_scores)

Expand Down