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

Refactor Time Tracking API, Revamp TimeTracking Statistics Page #7524

Merged
merged 83 commits into from
Mar 26, 2024

Conversation

fm3
Copy link
Member

@fm3 fm3 commented Jan 8, 2024

Changes the time-tracking overview to show times spent in annotations and tasks and filter them by teams and projects. In the linked detail view, the tracked times can also be filtered by type (annotations or tasks) and project.

Backend Changes

  • Removed several now-unused routes (previously used either by frontend or braintracing dbs)
  • Added new route /time/overview to fill new user time tracking table, filtered by team, projectIds, onlyCountTasks
  • Refactoring
    • No more JodaTime dependency, use java.time utilities instead
    • Renaming of some Methods
    • Moved more Logic to SQL
    • Integrated StatisticsController into TimeController

Steps to test:

  • go to https://timetrackingapi.webknossos.xyz/
  • Create several users with different rights, annotations, tasks
  • Annotate some, as different users
  • Time tracking overview should list all users you are allowed to see (only your orga, only yourself if you’re no team manager, only of your teams if you are team manager)
  • Use Filters to select specific teams and projects, as well as switch between tasks and non-task annotations.
  • Time tracking detail view should list a single user’s spent time in more detail.

TODOs:

  • Backend
    • merge StatisticsController with TimeController?
    • split statistics routes?
    • make inclusion of explorative optional for /api/time routes AND statistics routes (unify those routes altogether?)
    • Move more logic to SQL
    • No more JodaTime
    • Clean up
    • No more java.util.Calendar
    • CI
    • Document changes
    • support selecting multiple teams in /time/summed/userList
    • investigate report of empty response depending on team members
    • fix snapshot tests
    • remove unused routes (api/time/groupedByInterval?, /time/allusers, /time/userlist)
    • make sure every user can see their own timetracking info
  • Frontend
    • Adapt to changed api for time graph
    • Remove Best/Busiest users of the week table from webknossos.org/statistics -> maybe delete whole view
    • Add new timetracking overview table as discussed in https://scm.slack.com/archives/C5AKLAV0B/p1704359796147499
    • adapt timetracking detail view
      • to filter by projects
      • to handle exploratives (task-related entries can now be null)
    • Rethink page structure (time tracking vs statistics)

Charlies todos:

for time tracking overview

  • add and fill table (sortable) in new page
  • add CSV export
  • link to prefilled detail view
  • add filter include exploratives
  • test with more than 1 user
  • move initial user and daterange values for detail view to url params
  • fix key in navbar
  • rethink placeholder for projetcs
  • time in s in csv
  • fix link to detail view, possibly with router
  • implement deselect
  • include possibility to select only annotations (maybe talk to backend)
  • fix DateRangePicker. like in time line view? plain antd? how to do presets without getting TS problems?
  • fix spinner
  • only visible to admins and team managers

detail view

  • fix project update (somehow an old state is used after getting to view from overview)
  • fix google chart, which is not showing time from sth. other than tasks

Issues:


@fm3 fm3 self-assigned this Jan 8, 2024
@fm3 fm3 changed the title WIP: Unify Time Tracking API Refactor Time Tracking API, Revamp TimeTracking Statistics Page Jan 11, 2024
@fm3 fm3 requested review from frcroth and removed request for frcroth January 29, 2024 20:38
package.json Outdated Show resolved Hide resolved
frontend/javascripts/admin/time/time_line_view.tsx Outdated Show resolved Hide resolved
@dieknolle3333
Copy link
Contributor

@fm3 personally I think everything works as expected with your new changes, thank you!

@fm3 fm3 requested a review from normanrz March 21, 2024 08:52
Copy link
Member

@normanrz normanrz left a comment

Choose a reason for hiding this comment

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

I reviewed the backend code only. Looks good. Just one comment on time zones. Not sure we have considered these before.

I did a happy path testing. Seems to work. The UI looks slick!

app/controllers/TimeController.scala Outdated Show resolved Hide resolved
app/models/user/time/Interval.scala Show resolved Hide resolved
app/models/user/time/Interval.scala Outdated Show resolved Hide resolved
Copy link
Member

@philippotto philippotto left a comment

Choose a reason for hiding this comment

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

testing went smooth :) only one small thing:

the bullet points next to the values in the per-user-time-view look weird:
image

maybe use a border-less table and the • symbol in front of each label. or do it like here: https://master.webknossos.xyz/statistics

Copy link
Member

@philippotto philippotto left a comment

Choose a reason for hiding this comment

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

front-end looks good to me 🥇

@fm3 fm3 requested a review from normanrz March 26, 2024 10:23
@fm3 fm3 enabled auto-merge (squash) March 26, 2024 10:26
@fm3 fm3 merged commit e6efe78 into master Mar 26, 2024
2 checks passed
@fm3 fm3 deleted the time-tracking-api branch March 26, 2024 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants