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

Add work summary panel #786

Merged
merged 5 commits into from
Feb 8, 2024
Merged

Add work summary panel #786

merged 5 commits into from
Feb 8, 2024

Conversation

dmtrek14
Copy link
Collaborator

The work summary panel will be visible only from the tasks area and show the user some basic information about the time they have worked for today and the week, as well as vacation time and extra hours. This information is shown in the current version of the application on the left side of the app. Some small improvements have been made here, such as breaking down the worked hours by project for a user and adding tooltips to explain each vacation category (used, scheduled, pending).

A few small UI changes have been made here, as well. The collapse button for the right panel has been modified to be within the panel instead of a floating button. The dark/light mode toggle has been made smaller on the desktop view (same as it appears on mobile).

This is a first version of the component and it might be nice to display the time per project from the 'Worked Hours' panel as a pie chart instead of (or in addition to?) the table. Another planned feature for the 'Vacation' panel would be to add a calendar that shows upcoming vacation at a glance.

Screencast.from.2024-01-24.10-34-25.webm

api/routers/v1/timelog.py Outdated Show resolved Hide resolved
api/services/timelog.py Outdated Show resolved Hide resolved
api/services/timelog.py Outdated Show resolved Hide resolved
api/services/timelog.py Outdated Show resolved Hide resolved
api/tests/routers/v1/test_timelog.py Show resolved Hide resolved
@dmtrek14 dmtrek14 force-pushed the summary-panel branch 4 times, most recently from bcec3dc to cb3ec07 Compare January 29, 2024 20:45
frontend/src/ui/BaseLayout/BaseLayout.tsx Outdated Show resolved Hide resolved
frontend/src/infra/workSummary/getWorkSummary.ts Outdated Show resolved Hide resolved
const { data } = useQuery({
queryKey: ['workSummary', userId],
queryFn: () => getWorkSummary(apiClient),
initialData: []
Copy link
Contributor

Choose a reason for hiding this comment

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

the initialData could be a {} empty object, so we won't have to do: summary?.something on WorkSummaryPanel

Copy link
Contributor

@negreirosleo negreirosleo left a comment

Choose a reason for hiding this comment

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

Besides the content overlap, it lgtm!

frontend/src/app/tasks/layout.tsx Show resolved Hide resolved
@dmtrek14 dmtrek14 force-pushed the summary-panel branch 2 times, most recently from 9ef840d to 205b56d Compare January 31, 2024 16:41
- Add time helpers to display summary info in a couple different ways
- Add tests for new time helpers and for those that were missing tests
- Add services to fetch task sum and vacations
- Add schema for data related to summary
- Add more info to mock data
- Add more users in conftest for use in summary tests
- Change color of collapse button on left
- Change style of collapse button on right to be within panel
- Update dark/light toggle to be smaller overall
- Add necessary types for Work Summary and project summary
- Add work summary component for use in right panel
- Update task hooks to include invalidation of work summary query when changes made to task
- Add infra to fetch summary from api
@dmtrek14 dmtrek14 merged commit a871036 into main Feb 8, 2024
2 checks passed
@dmtrek14 dmtrek14 deleted the summary-panel branch February 8, 2024 15:20
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.

3 participants