Skip to content

Adding a check to only include datasources when looking through categories-list#1

Merged
Angamanga merged 1 commit intomainfrom
USH-2130
Nov 27, 2025
Merged

Adding a check to only include datasources when looking through categories-list#1
Angamanga merged 1 commit intomainfrom
USH-2130

Conversation

@Angamanga
Copy link
Contributor

Making datasources an enum and adding a check to see if the row is a datasource or not before adding them to the section "Platform breakdown" (this is an adjustment to the datastructure that will come out of the api).

@linear
Copy link

linear bot commented Nov 26, 2025

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces type safety for datasource filtering by creating a DataSource enum and adding a check to ensure only valid datasource categories are included in the "Platform breakdown" section. This change prepares the component for an adjusted data structure from the API.

  • Added a DataSource enum with four platform values (PLATFORM, FACEBOOK, TWITTER, YOUTUBE)
  • Updated switch statement to use enum values instead of string literals
  • Enhanced filtering logic to only include rows that match valid DataSource enum values

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +34 to +46
return { icon: ushahidiIcon, color: '#EFC44C' };

case 'facebook':
return { icon: facebookIcon, color: '#8B9DC3' };
case DataSource.FACEBOOK:
return { icon: facebookIcon, color: '#8B9DC3' };

case 'twitter':
return { icon: twitterIcon, color: '#1DA1F2' };
case DataSource.TWITTER:
return { icon: twitterIcon, color: '#1DA1F2' };

case 'youtube':
return { icon: youtubeIcon, color: '#CC181E' };
case DataSource.YOUTUBE:
return { icon: youtubeIcon, color: '#CC181E' };

default:
return { icon: '', color: '#8e8e8e' };
return { icon: '', color: '#8e8e8e' };
Copy link

Copilot AI Nov 26, 2025

Choose a reason for hiding this comment

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

The return statements inside the switch cases have inconsistent indentation. They should be indented to align with the case statements. This appears across all cases in the switch statement.

Copilot uses AI. Check for mistakes.
@github-actions
Copy link

Playwright test results

Image Name Version Result Report
grafana-dev 12.4.0-19691013295
grafana-enterprise 12.3.0
grafana-enterprise 12.1.4
grafana-enterprise 11.4.8
grafana-enterprise 11.1.13
grafana-enterprise 10.4.19

⚠️ To make Playwright reports for failed tests publicly accessible on GitHub Pages, set the upload-report input to true in your CI workflow. For more details, refer to the Developer Portal documentation.

Copy link
Collaborator

@MMwandigha MMwandigha left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@Angamanga Angamanga merged commit 4b89729 into main Nov 27, 2025
11 of 17 checks passed
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