xmera-circle / redmine_workload Goto Github PK
View Code? Open in Web Editor NEWThis project forked from jostbaron/redmine_workload
[Fork] Calculate user workload over time
This project forked from jostbaron/redmine_workload
[Fork] Calculate user workload over time
comparison of Float with nil failed
Hey @mboremski
My user has all the options enabled in his profile but he does not open the page, he sends screens and my version of Redmine
Environment:
Redmine version 4.2.5.stable
Ruby version 2.7.6-p219 (2022-04-12) [x86_64-linux]
Rails version 5.2.6.3
Environment production
Database adapter Mysql2
Mailer queue ActiveJob::QueueAdapters::AsyncAdapter
Mailer delivery smtp
SCM:
Subversion 1.14.1
Mercurial 5.6.1
Bazaar 3.1.0
Git 2.30.2
Filesystem
Redmine plugins:
microsoft_project_connector 1.0.7
redmine_dashboard 2.12.0
redmine_indicator 0.2.16
redmine_issue_evm 4.6.0
redmine_monitoring_controlling 0.1.1
redmine_reports 0.0.1
redmine_risks 1.4.1
redmine_team_resource 0.4.3
redmine_workload 2.0.1
remove_top_menu_help 0.0.1
scrum 0.20.0
time_logger 0.5.4
Originally posted by @kevinguiro in #11 (comment)
This behaviour has just been found:
If we have a task with one subtask.
Both, task an d subtask, having Estimated time.
Only estimated time of the subtask is used for workload-calculations.
This unfortunately in our case leads to some heavy blind-spots since users sometimes only planning one subtask.
Hi team,
I'm using postgres as database.
I cannot usse the workload plugin, because the table wl_national_holidays is using the column name END. This is a resreved keyword in Postgres and produces an error:
ActiveRecord::StatementInvalid (PG::SyntaxError: ERROR: syntax error at or near "end"
LINE 1: ...tional_holidays" WHERE (start <= '2022-12-26' AND end >= '20...
^
: SELECT 1 AS one FROM "wl_national_holidays" WHERE (start <= '2022-12-26' AND end >= '2022-12-26') LIMIT $1):
Could you please fix this?
Cheers.
Steffen
The module UserWorkload needs further refactoring to increase maintainability, re-usability, testability, and efficiency.
See also #2.
This task is open to everyone who likes to contribute and learn.
Como administrador de la herramienta no me carga todos los usuarios para ver sus actividades o tengo que hacer algo mas en la configuracion
Users are ordered by their lastname by default.
If possible without much effort they should be ordered by the name they are displayed in the system.
leads to:
Started GET "/workloads?utf8=%E2%9C%93&workload%5Bfirst_day%5D=2022-08-22&workload%5Blast_day%5D=2022-03-31&workload%5Bstart_date%5D=2022-09-01&workload%5Bgroups%5D%5B%5D=75" for 10.10.92.21 at 2022-09-01 16:14:41 +0200
Processing by WorkloadsController#index as HTML
Parameters: {"utf8"=>"✓", "workload"=>{"first_day"=>"2022-08-22", "last_day"=>"2022-03-31", "start_date"=>"2022-09-01", "groups"=>["75"]}}
Current user: boremski (id=10)
Completed 500 Internal Server Error in 204ms (ActiveRecord: 11.1ms)
NoMethodError (undefined method `[]' for nil:NilClass):
plugins/redmine_workload/app/models/user_workload.rb:105:in `block (2 levels) in hours_per_user_issue_and_day'
plugins/redmine_workload/app/models/user_workload.rb:95:in `each'
plugins/redmine_workload/app/models/user_workload.rb:95:in `block in hours_per_user_issue_and_day'
plugins/redmine_workload/app/models/user_workload.rb:65:in `each'
plugins/redmine_workload/app/models/user_workload.rb:65:in `hours_per_user_issue_and_day'
plugins/redmine_workload/app/controllers/workloads_controller.rb:42:in `index'
lib/redmine/sudo_mode.rb:61:in `sudo_mode'
Will collect issues here that need to be adressed to make this plugin ready for usage in redmine 5.x
User with ID 29 seem to lead to an Error for unknown reason:
Started GET "/workloads?utf8=%E2%9C%93&workload%5Bfirst_day%5D=2022-06-11&workload%5Blast_day%5D=2022-08-10&workload%5Bstart_date%5D=2022-06-21&workload%5Bgroups%5D%5B%5D=7" for xxx.xxx.xxx.xxx at 2022-06-21 15:46:48 +0200
Processing by WorkloadsController#index as HTML
Parameters: {"utf8"=>"✓", "workload"=>{"first_day"=>"2022-06-11", "last_day"=>"2022-08-10", "start_date"=>"2022-06-21", "groups"=>["7"]}}
Current user: boremski (id=10)
Completed 500 Internal Server Error in 341ms (ActiveRecord: 14.1ms)
NoMethodError (undefined method `id' for 29:Integer
Did you mean? i):
plugins/redmine_workload/lib/redmine_workload/wl_date_tools.rb:58:in `working_days_in_time_span'
plugins/redmine_workload/app/models/group_workload.rb:75:in `total_availabilities_of'
plugins/redmine_workload/app/models/group_workload.rb:69:in `block in user_workload_with_availabilities'
plugins/redmine_workload/app/models/group_workload.rb:68:in `each'
plugins/redmine_workload/app/models/group_workload.rb:68:in `user_workload_with_availabilities'
plugins/redmine_workload/app/models/group_workload.rb:59:in `sorted_user_workload'
plugins/redmine_workload/app/models/group_workload.rb:50:in `block in define_group_members'
plugins/redmine_workload/app/models/group_workload.rb:49:in `each'
plugins/redmine_workload/app/models/group_workload.rb:49:in `each_with_object'
plugins/redmine_workload/app/models/group_workload.rb:49:in `define_group_members'
plugins/redmine_workload/app/models/group_workload.rb:20:in `initialize'
plugins/redmine_workload/app/controllers/workloads_controller.rb:44:in `new'
plugins/redmine_workload/app/controllers/workloads_controller.rb:44:in `index'
lib/redmine/sudo_mode.rb:61:in `sudo_mode'
Hi,
The tasks in our redmine project management does not calculate the workload in hours, but in days, so this “estimated time field” is not used(hidden) in all trackers, and makes this plugin unusable.
Is it possible to have an option to calculate the workload by days?
There are some rubocop defenses w.r.t. to Ruby's naming conventions:
# Offense count: 3
# Configuration parameters: EnforcedStyle, AllowedPatterns, IgnoredPatterns.
# SupportedStyles: snake_case, camelCase
Naming/MethodName:
Exclude:
- 'app/controllers/workloads_controller.rb'
- 'app/models/wl_national_holiday.rb'
- 'app/models/wl_user_vacation.rb'
# Offense count: 4
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
# AllowedNames: at, by, db, id, in, io, ip, of, on, os, pp, to
Naming/MethodParameterName:
Exclude:
- 'app/helpers/workload_filters_helper.rb'
# Offense count: 8
# Configuration parameters: EnforcedStyle, AllowedIdentifiers.
# SupportedStyles: snake_case, camelCase
Naming/VariableName:
Exclude:
- 'app/helpers/workload_filters_helper.rb'
They could be easily changed independent of the individual coding skills.
We have the possibility to download a file that contains the data ob the table.
It would be handy if we could use api-calls to download this file while providing an apikey.
The current toggle
If possible there should be found another pair of characters to be used as toggle.
Alternative:
These symbols are already in use. You can find them along with the filter and options above projects and issues.
Installing this plugin in redmine 5.0 leads to LoadError: cannot load such file -- redmine_workload
Environment:
Redmine version 5.0.1.stable.21623
Ruby version 3.0.0-p0 (2020-12-25) [x86_64-linux]
Rails version 6.1.6
Environment production
Database adapter Mysql2
Mailer queue ActiveJob::QueueAdapters::AsyncAdapter
Mailer delivery smtp
Redmine settings:
Redmine theme Purplemine2 (includes JavaScript)
SCM:
Subversion 1.10.4
Git 2.20.1
Filesystem
Redmine plugins:
no plugin installed
run bundle exec rake redmine:plugins:migrate RAILS_ENV=production
leads to
rake aborted!
LoadError: cannot load such file -- redmine_workload
/usr/local/rvm/gems/ruby-3.0.0/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in `require'
/usr/local/rvm/gems/ruby-3.0.0/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in `require'
/usr/local/rvm/gems/ruby-3.0.0/gems/activesupport-6.1.6/lib/active_support/dependencies/zeitwerk_integration.rb:51:in `require_dependency'
/opt/redmine-5.0/plugins/redmine_workload/init.rb:4:in `<top (required)>'
/opt/redmine-5.0/lib/redmine/plugin_loader.rb:31:in `load'
/opt/redmine-5.0/lib/redmine/plugin_loader.rb:31:in `run_initializer'
/opt/redmine-5.0/lib/redmine/plugin_loader.rb:108:in `each'
/opt/redmine-5.0/lib/redmine/plugin_loader.rb:108:in `block in load'
/usr/local/rvm/gems/ruby-3.0.0/gems/activesupport-6.1.6/lib/active_support/callbacks.rb:427:in `instance_exec'
/usr/local/rvm/gems/ruby-3.0.0/gems/activesupport-6.1.6/lib/active_support/callbacks.rb:427:in `block in make_lambda'
/usr/local/rvm/gems/ruby-3.0.0/gems/activesupport-6.1.6/lib/active_support/callbacks.rb:198:in `block (2 levels) in halting'
/usr/local/rvm/gems/ruby-3.0.0/gems/activesupport-6.1.6/lib/active_support/callbacks.rb:604:in `block (2 levels) in default_terminator'
/usr/local/rvm/gems/ruby-3.0.0/gems/activesupport-6.1.6/lib/active_support/callbacks.rb:603:in `catch'
/usr/local/rvm/gems/ruby-3.0.0/gems/activesupport-6.1.6/lib/active_support/callbacks.rb:603:in `block in default_terminator'
/usr/local/rvm/gems/ruby-3.0.0/gems/activesupport-6.1.6/lib/active_support/callbacks.rb:199:in `block in halting'
/usr/local/rvm/gems/ruby-3.0.0/gems/activesupport-6.1.6/lib/active_support/callbacks.rb:512:in `block in invoke_before'
/usr/local/rvm/gems/ruby-3.0.0/gems/activesupport-6.1.6/lib/active_support/callbacks.rb:512:in `each'
/usr/local/rvm/gems/ruby-3.0.0/gems/activesupport-6.1.6/lib/active_support/callbacks.rb:512:in `invoke_before'
/usr/local/rvm/gems/ruby-3.0.0/gems/activesupport-6.1.6/lib/active_support/callbacks.rb:105:in `run_callbacks'
/usr/local/rvm/gems/ruby-3.0.0/gems/activesupport-6.1.6/lib/active_support/reloader.rb:88:in `prepare!'
/usr/local/rvm/gems/ruby-3.0.0/gems/railties-6.1.6/lib/rails/application/finisher.rb:124:in `block in <module:Finisher>'
/usr/local/rvm/gems/ruby-3.0.0/gems/railties-6.1.6/lib/rails/initializable.rb:32:in `instance_exec'
/usr/local/rvm/gems/ruby-3.0.0/gems/railties-6.1.6/lib/rails/initializable.rb:32:in `run'
/usr/local/rvm/gems/ruby-3.0.0/gems/railties-6.1.6/lib/rails/initializable.rb:61:in `block in run_initializers'
/usr/local/rvm/gems/ruby-3.0.0/gems/railties-6.1.6/lib/rails/initializable.rb:60:in `run_initializers'
/usr/local/rvm/gems/ruby-3.0.0/gems/railties-6.1.6/lib/rails/application.rb:391:in `initialize!'
/opt/redmine-5.0/config/environment.rb:16:in `<top (required)>'
/usr/local/rvm/gems/ruby-3.0.0/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in `require'
/usr/local/rvm/gems/ruby-3.0.0/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in `require'
/usr/local/rvm/gems/ruby-3.0.0/gems/activesupport-6.1.6/lib/active_support/dependencies.rb:332:in `block in require'
/usr/local/rvm/gems/ruby-3.0.0/gems/activesupport-6.1.6/lib/active_support/dependencies.rb:299:in `load_dependency'
/usr/local/rvm/gems/ruby-3.0.0/gems/activesupport-6.1.6/lib/active_support/dependencies.rb:332:in `require'
/usr/local/rvm/gems/ruby-3.0.0/gems/railties-6.1.6/lib/rails/application.rb:367:in `require_environment!'
/usr/local/rvm/gems/ruby-3.0.0/gems/railties-6.1.6/lib/rails/application.rb:533:in `block in run_tasks_blocks'
/usr/local/rvm/gems/ruby-3.0.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/usr/local/rvm/gems/ruby-3.0.0/bin/ruby_executable_hooks:22:in `eval'
/usr/local/rvm/gems/ruby-3.0.0/bin/ruby_executable_hooks:22:in `<main>'
Tasks: TOP => redmine:plugins:migrate => environment
(See full trace by running task with --trace)
Started GET "/workloads" for 192.168.206.13 at 2022-09-21 10:11:21 +0300
Processing by WorkloadsController#index as HTML
Current user: andrei.ifrim (id=90)
Completed 500 Internal Server Error in 114ms (ActiveRecord: 21.1ms)
ActiveRecord::StatementInvalid (PG::SyntaxError: ERROR: syntax error at or near "end"
LINE 1: ...tional_holidays" WHERE (start <= '2022-09-11' AND end >= '20...
^
: SELECT 1 AS one FROM "wl_national_holidays" WHERE (start <= '2022-09-11' AND end >= '2022-09-11') LIMIT $1):
plugins/redmine_workload/lib/redmine_workload/wl_date_tools.rb:79:in `holiday?'
plugins/redmine_workload/lib/redmine_workload/wl_date_tools.rb:63:in `block (2 levels) in working_days_in_time_span'
plugins/redmine_workload/lib/redmine_workload/wl_date_tools.rb:61:in `block in working_days_in_time_span'
plugins/redmine_workload/lib/redmine_workload/wl_date_tools.rb:58:in `working_days_in_time_span'
plugins/redmine_workload/app/models/user_workload.rb:358:in `working_days_in_time_span'
plugins/redmine_workload/app/models/user_workload.rb:66:in `block in hours_per_user_issue_and_day'
plugins/redmine_workload/app/models/user_workload.rb:65:in `each'
plugins/redmine_workload/app/models/user_workload.rb:65:in `hours_per_user_issue_and_day'
plugins/redmine_workload/app/controllers/workloads_controller.rb:42:in `index'
lib/redmine/sudo_mode.rb:61:in `sudo_mode'
when i install this plugin Redmine crashes.
Hello dears
What I'm looking for is for users who don't have admin privilege to be able to see their times on workloads
Thanks and regards
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.