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

Widget refactoring #847

Merged
merged 76 commits into from
Jun 13, 2019
Merged

Widget refactoring #847

merged 76 commits into from
Jun 13, 2019

Conversation

kevinpapst
Copy link
Member

@kevinpapst kevinpapst commented Jun 11, 2019

Description

Refactored widget system:

  • now widgets are registered automatically if they implement the WidgetInterface
  • registered widgets can be used in twig templates like this: {{ render_widget('DailyWorkingTimeChart', {'color': '#000'}) }}
  • widget configuration from kimai.yaml was inlined and can overwrite interally registered ones
  • new statistics method was added to fetch daily working times
  • new WidgetType was added ro render a bar chart of these daily working times
  • new chart widget added to Dashboard for the current working week
  • improved existing charts: do not round times and display better tooltips on hover

TODO

  • update UPGRADING.md, explain config change
  • update Dashboard / config documentation
  • update Widget / developer documentation

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I verified that my code applies to the guidelines (composer kimai:code-check)
  • I updated the documentation (see here)
  • I agree that this code is used in Kimai and will be published under the MIT license

@codecov
Copy link

codecov bot commented Jun 12, 2019

Codecov Report

Merging #847 into master will increase coverage by 0.18%.
The diff coverage is 99.04%.

@@             Coverage Diff              @@
##             master     #847      +/-   ##
============================================
+ Coverage     94.01%   94.19%   +0.18%     
- Complexity     2340     2397      +57     
============================================
  Files           243      254      +11     
  Lines          7346     7516     +170     
============================================
+ Hits           6906     7080     +174     
+ Misses          440      436       -4
Impacted Files Coverage Δ Complexity Δ
src/Entity/BudgetTrait.php 100% <ø> (ø) 6 <0> (ø) ⬇️
src/Repository/WidgetRepository.php 100% <100%> (ø) 20 <20> (+10) ⬆️
src/Twig/WidgetExtension.php 100% <100%> (ø) 7 <7> (?)
src/EventSubscriber/DashboardSubscriber.php 100% <100%> (ø) 9 <0> (+4) ⬆️
src/Model/Statistic/Year.php 100% <100%> (ø) 7 <5> (+1) ⬆️
src/Widget/Renderer/SimpleWidgetRenderer.php 100% <100%> (ø) 2 <2> (?)
src/Model/Statistic/Month.php 100% <100%> (ø) 8 <4> (ø) ⬇️
src/Widget/Type/AbstractContainer.php 100% <100%> (ø) 10 <10> (?)
src/Widget/Type/AbstractWidgetType.php 100% <100%> (ø) 12 <12> (?)
src/Widget/Renderer/CompoundChartRenderer.php 100% <100%> (ø) 2 <2> (?)
... and 27 more

@kevinpapst kevinpapst marked this pull request as ready for review June 13, 2019 15:38
@kevinpapst kevinpapst merged commit 3311f17 into master Jun 13, 2019
@kevinpapst kevinpapst deleted the widget-refactoring branch June 13, 2019 16:38
@lock
Copy link

lock bot commented Aug 12, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. If you use Kimai on a daily basis, please consider donating to support further development of Kimai.

@lock lock bot locked and limited conversation to collaborators Aug 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant