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

Feedback implementation #3461

Merged
merged 4 commits into from
Jun 5, 2018
Merged

Feedback implementation #3461

merged 4 commits into from
Jun 5, 2018

Conversation

01painadam
Copy link
Contributor

Overview

Last round of feedback implementations.

  • Gain selectors removed. No extent year or % available
  • Some Dynamic Sentences updated
  • Plantations loss maths fixed!

@@ -7,10 +7,10 @@ export default {
size: 'small',
forestTypes: ['ifl_2013'],
landCategories: ['wdpa', 'landmark', 'mining'],
units: ['ha', '%'],
units: ['ha'],
Copy link
Contributor

Choose a reason for hiding this comment

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

not needed if no selector

@@ -6,10 +6,10 @@ export default {
size: 'small',
forestTypes: ['ifl_2013', 'plantations', 'primary_forest'],
landCategories: ['mining', 'wdpa', 'landmark'],
units: ['ha', '%'],
units: ['ha'],
Copy link
Contributor

Choose a reason for hiding this comment

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

same here


const sentence = initial;
const params = {
location: currentLabel,
startYear,
endYear,
lossPhrase,
value: `${format('.3s')(totalOutsideLoss)}t of CO<sub>2</sub> emissions`
value: `${format('.3s')(outsideEmissions)}t`,
percentage: percentage < 0.1 ? '<0.1%' : `${format('.2r')(percentage)}%`
Copy link
Contributor

Choose a reason for hiding this comment

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

Shall we start using our format helper?

@@ -62,6 +62,7 @@ export const getSentence = createSelector(
const params = {
year: settings.extentYear,
location: currentLabel || 'global',
location_alt: `${currentLabel}'s`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Ideally when it comes to translations, this 's should be in the sentence so that it can be changed.

@01painadam
Copy link
Contributor Author

Made the changes! 👍

@01painadam 01painadam requested a review from pjosh June 4, 2018 14:14
Copy link
Contributor

@edbrett edbrett left a comment

Choose a reason for hiding this comment

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

One small change extra if you have the energy! Just a syntax improvement.

@@ -93,7 +94,7 @@ export const getSentence = createSelector(
endYear,
lossPhrase,
value: `${format('.3s')(outsideEmissions)}t`,
percentage: percentage < 0.1 ? '<0.1%' : `${format('.2r')(percentage)}%`
percentage: `${formatNumber({ num: percentage, unit: '%' })}`
Copy link
Contributor

Choose a reason for hiding this comment

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

You aren't generating a string here outside of the function so you just need to execute the helper, no need for the ` and $ :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice :) Done.

@edbrett edbrett merged commit 48ac3fb into develop Jun 5, 2018
@edbrett edbrett deleted the fix/feedback-implementation branch June 5, 2018 15:29
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.

2 participants