Skip to content

feat(affected-users): added chart data#821

Open
slaveeks wants to merge 4 commits intomasterfrom
feat/affected-users-chart
Open

feat(affected-users): added chart data#821
slaveeks wants to merge 4 commits intomasterfrom
feat/affected-users-chart

Conversation

@slaveeks
Copy link
Copy Markdown
Member

image
  • added daily chart for affected users for last two weeks
  • yarn lint

@slaveeks slaveeks requested review from e11sy and neSpecc January 21, 2026 16:59
@n0str n0str self-requested a review January 21, 2026 17:27
n0str
n0str previously approved these changes Jan 21, 2026
Copy link
Copy Markdown
Contributor

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 adds a chart visualization for affected users over the last two weeks to the event detail page. The implementation follows the existing pattern established by the event occurrence chart (Daily.vue component).

Changes:

  • Added affectedUsersChartData field to the HawkEvent type definition
  • Implemented new Vuex action and mutation to fetch and store affected users chart data
  • Created GraphQL query QUERY_AFFECTED_USERS_CHART_DATA following the same pattern as the existing event chart query
  • Updated UsersAffected.vue component to display the chart
  • Applied code formatting improvements (multi-line type annotations) throughout the events store module
  • Fixed trailing whitespace in utils.ts (linting cleanup)

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/utils.ts Removed trailing newline (linting fix)
src/types/events.ts Added optional affectedUsersChartData field to HawkEvent interface
src/store/modules/events/index.ts Added GET_AFFECTED_USERS_CHART_DATA action and SaveAffectedUsersChartData mutation; improved formatting for type annotations
src/store/modules/events/actionTypes.js Exported new GET_AFFECTED_USERS_CHART_DATA action constant
src/components/event/UsersAffected.vue Added chart component integration with data fetching in created hook
src/api/events/queries.ts Defined GraphQL query for fetching affected users chart data
src/api/events/index.ts Implemented fetchAffectedUsersChartData API function; improved formatting for type annotations

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

Comment on lines +567 to +578
/**
* Get affected users chart data for an event for a specified period
* @param context - vuex action context
* @param context.commit - VueX commit method
* @param context.dispatch - Vuex dispatch method
* @param project - object of project data
* @param project.projectId - project's id
* @param project.eventId - event's id
* @param project.startDate - start date
* @param project.endDate - end date
* @param project.groupBy - grouping interval in minutes
*/
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

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

The JSDoc documentation mentions parameters that don't exist in the action. The parameters startDate, endDate, and groupBy are documented but the action only accepts projectId, eventId, originalEventId, and days. The documentation should be updated to accurately reflect the actual parameters.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

Copy link
Copy Markdown

Copilot AI commented Jan 21, 2026

@n0str I've opened a new pull request, #822, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 2 commits January 21, 2026 17:37
Co-authored-by: n0str <988885+n0str@users.noreply.github.com>
Fix JSDoc parameters for GET_AFFECTED_USERS_CHART_DATA action
days: number,
timezoneOffset: number
): Promise<ChartLine[]> {
return (await api.callOld(QUERY_AFFECTED_USERS_CHART_DATA, {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

callOld is deprecated, use call instead

also handle errors from the call properly (we already have example )

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.

5 participants