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

[Analytics] Air quality cards UI and functionality #1650

Merged
merged 28 commits into from
Nov 15, 2023

Conversation

Codebmk
Copy link
Member

@Codebmk Codebmk commented Nov 7, 2023

Summary of Changes (What does this PR do?)

  • Added air quality location cards which display grids recent measurements. The grids are picked from the user defaults api but if not grids are found, the default grids which are lagos, kampala, nairobi and madagascar are used.
  • Added reusable tooltips component

Status of maturity (all need to be checked before merging):

  • I've tested this locally
  • I consider this code done
  • This change ready to hit production in its current state

How should this be manually tested?

  • Please include the steps to be done inorder to setup and test this PR.

What are the relevant tickets?

Screenshots (optional)

image
image

Copy link
Contributor

github-actions bot commented Nov 7, 2023

New next-platform changes available for preview here

1 similar comment
Copy link
Contributor

github-actions bot commented Nov 7, 2023

New next-platform changes available for preview here

Copy link
Contributor

New next-platform changes available for preview here

Copy link
Contributor

New next-platform changes available for preview here

Copy link
Collaborator

@Baalmart Baalmart left a comment

Choose a reason for hiding this comment

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

Hi @Codebmk , thanks for this! Good progress indeed!
Just a couple of changes required to get things moving.

const chartDataRange = useSelector((state) => state.chart.chartDataRange);
const userDefaults = useSelector((state) => state.userDefaults.defaults);
const [grids, setGrids] = useState([
'64b7baccf2b99f00296acd59',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hi @Codebmk , thanks for this. Can we set these as variables? Somewhere in a constants file? This is just good practice. Please note that we do NOT have to create secrets or ENVs, we just need to put all constants in one place ---- as a best practice.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

const dispatch = useDispatch();
const recentLocationMeasurements = useSelector((state) => state.recentMeasurements.measurements);
const chartDataRange = useSelector((state) => state.chart.chartDataRange);
const userDefaults = useSelector((state) => state.userDefaults.defaults);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hi @Codebmk , since we are moving towards using Preferences, please consider using Preferences endpoints for this. For context, Preferences was implemented last week and it is fully ready to be utilised.

Background to this change from Defaults to Preferences:

  • It was discovered that Defaults had so many issues that could not be fixed so we just decided to create a completely new set of endpoints for Analytics Redesign.
  • We might also to discontinue the usage of Defaults in the Old Analytics (Netmanager) and completely switch to Preferences all throughout our Systems.

Copy link
Member Author

Choose a reason for hiding this comment

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

list user preferences api says not found ie {{baseUrl}}/api/v2/users/preferences/USERID
image

Copy link
Contributor

New next-platform changes available for preview here

Copy link
Contributor

New next-platform changes available for preview here

}
setIsLoadingMeasurements(false);
}, [userLocationsData]);

Copy link
Member Author

Choose a reason for hiding this comment

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

I've updated to using preferences @Baalmart

Copy link
Contributor

New next-platform changes available for preview here

Copy link
Contributor

New next-platform changes available for preview here

Copy link
Contributor

New next-platform changes available for preview here

Copy link
Contributor

New next-platform changes available for preview here

Copy link
Contributor

New next-platform changes available for preview here

Copy link
Contributor

New next-platform changes available for preview here

@Baalmart Baalmart merged commit c8d61a5 into staging Nov 15, 2023
26 of 27 checks passed
@Baalmart Baalmart deleted the ft-air-quality-cards branch November 15, 2023 21:24
@Baalmart Baalmart mentioned this pull request Nov 15, 2023
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants