Conversation
slaveeks
commented
Jan 21, 2026
- added daily chart for affected users for last two weeks
- yarn lint
There was a problem hiding this comment.
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
affectedUsersChartDatafield to theHawkEventtype definition - Implemented new Vuex action and mutation to fetch and store affected users chart data
- Created GraphQL query
QUERY_AFFECTED_USERS_CHART_DATAfollowing the same pattern as the existing event chart query - Updated
UsersAffected.vuecomponent 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.
| /** | ||
| * 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 | ||
| */ |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
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, { |
There was a problem hiding this comment.
callOld is deprecated, use call instead
also handle errors from the call properly (we already have example )