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

feat: persist report settings, use relative filtering #1228

Merged
merged 13 commits into from
Jun 12, 2024

Conversation

IanKrieger
Copy link
Member

@IanKrieger IanKrieger commented Jun 7, 2024

Resolves: #1227


Screenshare.-.2024-06-11.1_30_16.PM.mp4

@IanKrieger IanKrieger changed the title feat: use relative filtering feat: persist report settings, use relative filtering Jun 11, 2024
@IanKrieger IanKrieger marked this pull request as ready for review June 11, 2024 17:52
@IanKrieger IanKrieger requested a review from a team as a code owner June 11, 2024 17:52
@IanKrieger IanKrieger requested a review from tackley June 12, 2024 14:35
Copy link

[puLL-Merge] - brave/ads-ui@1228

Description

This PR makes several changes to the campaign analytics UI, mainly around the filters and metrics selection. It improves the UX for selecting time ranges, operating systems, and metrics to display on the graphs and tables.

Changes

Changes

  • src/components/Date/DateRangePicker.tsx:

    • Adds a timezone prop to the date pickers to use UTC
    • Changes the onChange handlers to set the time to the start/end of day
  • src/locales/*.po:

    • Updates translation files with new strings
  • src/routes/campaigns/analytics/CampaignAnalytics.tsx:

    • Refactors to use a new useCampaignAnalyticFilter hook to manage the filter state
    • Removes some no longer needed local state
  • src/routes/campaigns/analytics/MetricSelector.tsx:

    • Changes to force a default metric selection if none are selected
  • src/routes/campaigns/analytics/ResultsPane.tsx:

    • Passes the campaignOverview prop through to the DailyGraph
  • src/routes/campaigns/analytics/TabularData.tsx:

    • Removes a stray console.log
  • src/routes/campaigns/analytics/filters/BreakdownSelector.tsx:

    • Adds a key and value prop to the Tab components
  • src/routes/campaigns/analytics/filters/FilterBar.tsx:

    • Removes the minDate and maxDate props
    • Sets a fixed height on the bar
  • src/routes/campaigns/analytics/filters/OsFilter.tsx:

    • Refactors to use a new useOsFilterParams hook to manage the OS filter state
    • Forces a default selection if none selected
    • Adds functions to lookup OS filter entries
  • src/routes/campaigns/analytics/filters/TimeFilter.tsx:

    • Refactors to use a new useTimeFilterParams hook
    • Adds a date range picker for custom date ranges
    • Uses sticky state to persist custom range
  • src/routes/campaigns/analytics/filters/multi-filters.ts:

    • Fixes applySelection to handle the filters array being empty
  • src/routes/campaigns/analytics/filters/time-filters.test.ts:

    • Removes no longer needed tests
  • src/routes/campaigns/analytics/filters/time-filters.ts:

    • Refactors the time filter options
    • Adds i18n using @lingui/macro
  • src/routes/campaigns/analytics/graphs/DailyGraph.tsx:

    • Filters out metrics disabled for the campaign
    • Takes campaignOverview prop
  • src/routes/campaigns/analytics/graphs/GraphSkeleton.tsx:

    • Tweaks the Skeleton settings
  • src/routes/campaigns/analytics/graphs/HourlyGraph.tsx:

    • Filters out metrics disabled for the campaign
  • src/routes/campaigns/analytics/hooks.ts:

    • Adds useOsFilterParams, useTimeFilterParams and useCampaignAnalyticFilter hooks
    • Refactors useMetricSelection and useBreakdownParams to use a generic function
  • src/routes/campaigns/analytics/metrics.ts:

    • Adds a new isEnabledForCampaign function

Security Hotspots

None identified. The changes are primarily to the UI and client-side state management. No new external data sources or sensitive data handling.

@IanKrieger IanKrieger merged commit 0c7a272 into master Jun 12, 2024
8 checks passed
@IanKrieger IanKrieger deleted the feat/persist-report-settings branch June 12, 2024 16:23
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.

Remember report settings
2 participants