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

Integrate Partner statistics from mapswipe #6568

Merged
merged 101 commits into from
Oct 15, 2024

Conversation

bshankar
Copy link
Collaborator

@bshankar bshankar commented Sep 18, 2024

What type of PR is this? (check all applicable)

  • 🍕 Feature

Related Issue

This PR fixes #6550 #6538 #6537 #6491

Describe this PR

This PR adds mapswipe statistics for partners.

  1. Add a generic DTO (data transfer object) that contains generic partner statistics.
  2. Add a mapswipe connector that fetches mapswipe statistics and loads them into the DTO.
  3. Implement the UI and various chart components to display these statistics. (Screenshots attached below)

Screenshots

partner-mapswipe-stats

Review Guide

Here are some group ids that we have tested with.
-NL6WXPOdFyWACqwNU2O (American Red cross)
-NOyTo2zuMtyCNGaqb6J (Microsoft)
-O1uWeupd5RrKo-QQGdU (HOT)
-NPOaQfvxJ9arN1lmc2X (Leonardo DRS)

You have to link partners with a valid mapswipe group ID first using Manage > edit partner. Needs admin access.
Then click on statistics button and then the mapswipe tab.

You can visit the following URL (after substituting the group ID) to view these stats on Mapswipe.
https://community.mapswipe.org/user-group/[groupid]/

@bshankar bshankar force-pushed the feature/partner-mapswipe-stats branch from 404c2b6 to cad3cdd Compare September 18, 2024 13:27
@github-actions github-actions bot added dependencies Pull requests that update a dependency file scope: frontend labels Sep 18, 2024
@bshankar bshankar force-pushed the feature/partner-mapswipe-stats branch from aa018c9 to c882514 Compare September 19, 2024 09:31
import messages from './messages';

const Legend = () => {
const indexes = [30, 50, 70, 100];
Copy link
Contributor

Choose a reason for hiding this comment

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

these constants could be moved above the Legend component in L7.

};

export const ContributionsGrid = ({ contributionsByDate = [] }) => {
contributionsByDate = contributionsByDate.map((contribution) => ({
Copy link
Contributor

Choose a reason for hiding this comment

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

do not reassign the props. create a new variable instead.

};
}}
/>
<Tooltip id={'partnerMapswipeContributionsGridTooltip'} />
Copy link
Contributor

Choose a reason for hiding this comment

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

id="partnerMapswipeContributionsGridTooltip"

return features;
};

const zoomToH3ResMapping = {
Copy link
Contributor

Choose a reason for hiding this comment

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

can we write a function for these mappings?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure how a function can help here since we have pre-established static values.
We can retain it this way for now.

<div className="flex items-center justify-start absolute top-0 left-0 right-0 pa2">
<p
className="ma0 pa1 bg-white ba b--black-20 br2 partner-mapswipe-heatmap-zoom-text"
style={{ userSelect: 'none' }}
Copy link
Contributor

Choose a reason for hiding this comment

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

this can be written in scss file in partner-mapswipe-heatmap-zoom-text classname.

@royallsilwallz
Copy link
Contributor

The Use Ctrl + Scroll to zoom info in Contributions Heatmap looks more visible if the bg is dark [#333333] and the text color is white as shown below -

image

cc - @VinayakRugvedi @emi420

@ramyaragupathy ramyaragupathy added this to the v4.8.2 milestone Oct 8, 2024
@VinayakRugvedi
Copy link
Collaborator

Here is how the updated cards design look like:
Screenshot from 2024-10-10 02-07-54
Screenshot from 2024-10-10 02-07-17

Copy link

sonarcloud bot commented Oct 10, 2024

Copy link
Collaborator

@emi420 emi420 left a comment

Choose a reason for hiding this comment

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

Ready to go!

@ramyaragupathy ramyaragupathy merged commit 2351517 into hotosm:develop Oct 15, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file scope: backend scope: frontend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Contribution Time Grid Component for Partner Statistics Page
6 participants