Giter VIP home page Giter VIP logo

redmine_scheduling_poll's Introduction

redmine_scheduling_poll

Scheduling Poll is a plugin which provides simple polls to scheduling appointments on Redmine.

  • belongs to issue (not project)

  • anybody can add alternative date

How to install

  • Download the plugin to your ‘plugins/’ directory

  • Run bundle exec rake redmine:plugins:migrate RAILS_ENV=production

  • Restart your redmine

  • Go to Admin/Projects

  • Enable “scheduling poll”

  • Go to Admin/Role

  • Add permission “View scheduling polls” and/or “Vote scheduling polls” to some user

Contributing

Bug reports and pull requests are welcome on GitHub at github.com/cat-in-136/redmine_scheduling_poll

License

MIT License. See the ‘LICENSE.md’ file.

redmine_scheduling_poll's People

Contributors

cat-in-136 avatar eyewritecode avatar theosakamg avatar tumtum avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

redmine_scheduling_poll's Issues

responce of scheduling_polls#create.xml should be based on Rails rule

it actually render hand-written XML:

<scheduling_poll><status>exist</status><poll><id>#{@poll.id}</id></poll></scheduling_poll>

it shall be based on Rails rule, that is:

  • the element name shall not be use underscore _ but hyphen -.
  • the type of value shall be specified in the attributes.

scheduling_poll#show raise an error if db is sqlite

SQLite does not a native datetime type. COALESCE function call returns a string not datetime.

<% ((@poll.votes.group(:user).maximum("COALESCE(scheduling_votes.updated_at, scheduling_votes.created_at)").to_a) +
    (@poll.scheduling_poll_items.map{|v| [v, v.updated_at || v.created_at]} )).reject{|v| v[1].nil? }.sort{|a,b| a[1] <=> b[1]}.each do |v| %>
  <% subject, datetime = v %>
  <% if subject.kind_of? User
     user = subject %>
    <li>
      <%= avatar(user, :size => "24") %>
      <%= authoring datetime, user, :label => :label_updated_time_by %>
    </li>
  <% elsif subject.kind_of? SchedulingPollItem %>
    <li class="scheduling-poll-item-update">
      <%= l(:label_scheduling_poll_item) %> "<%=h subject.text %>":
      <%= l(:label_updated_time, :value => time_tag(datetime)).html_safe %>
    </li>
  <% end %>
<% end %>

authoring function 1st argument should be an DateTimeTimeZone but actual is a String if the DB is sqlite. In which case, an error raised.

Could not create a new poll as of now.

404 Not found error is always shown when "Create" button on /scheduling_polls/new?issue=XXX clicked.

  • Related to #13 , this issue occur on usual server usecase, too.
  • @poll.save seems to yield false (indicating failure for creating a poll.)

permission users

thx for your plugin @cat-in-136

1- Vote on scheduling polls
the user can see total votes and edit the poll items
iif u can edit it TO BE without see any OTHER vote and Voting Result and cant edit the poll items
2- View scheduling polls
the user see all result for another users

i think the only admin can edit the poll items
and specific users can see the all result

if u can add new permission for normal users for vote only without any show any total vote or edit item??

[Feature] Add vote value in comment

Hi,
Would it be possible to have, when adding a comment (or just voting?), the new value of the vote in the comment?

Something like:

Vote changed: from < OldValue > to < NewValue >
< Comment added>

Internal error on Redmine 4.2.9

Hello,
i installed the plug-in on a 4.2.9 redmine following the step by step
It seems to work until i activated activity.
From then "activity" return in internal error. The log show that the scheduling_polls table is not existing.
who and when this table is suppose to be created ?

Regards
Michel

Can't add comment

Hi,

after clicking on [Add a comment], I can show the input box, but there is no "send" button.
Even if you click on [Vote], the text is not taken into account

image

image

Environment:
Redmine version                4.0.5.stable.19319
Ruby version                   2.5.1-p57 (2018-03-29) [x86_64-linux-gnu]
Rails version                  5.2.3
Database adapter               Mysql2

Scheduling Poll version        4.0.2

test incompatibility with redmine 4.2.0

# Running:

DEPRECATION WARNING: acts_as_activity_provider with implicit :scope option is deprecated. Please pass a scope on the SchedulingVote as a proc. (called from block (2 levels) in events at /home/runner/work/redmine_scheduling_poll/redmine_scheduling_poll/redmine/lib/redmine/activity/fetcher.rb:93)
DEPRECATION WARNING: acts_as_activity_provider with implicit :scope option is deprecated. Please pass a scope on the SchedulingPoll as a proc. (called from block (2 levels) in events at /home/runner/work/redmine_scheduling_poll/redmine_scheduling_poll/redmine/lib/redmine/activity/fetcher.rb:93)
...........E

Error:
SchedulingPollsControllerTest#test_create:
NoMethodError: undefined method `high?' for nil:NilClass
    app/models/issue.rb:1106:in `notified_users'
    app/models/journal.rb:162:in `notified_users'
    app/models/mailer.rb:132:in `deliver_issue_edit'
    app/models/journal.rb:337:in `send_notification'
    plugins/redmine_scheduling_poll/app/controllers/scheduling_polls_controller.rb:50:in `create'
    lib/redmine/sudo_mode.rb:61:in `sudo_mode'
    plugins/redmine_scheduling_poll/test/functional/scheduling_polls_controller_test.rb:59:in `block in <class:SchedulingPollsControllerTest>'

bin/rails test plugins/redmine_scheduling_poll/test/functional/scheduling_polls_controller_test.rb:47

..E

Error:
SchedulingPollsControllerTest#test_vote.xml:
NoMethodError: undefined method `high?' for nil:NilClass
    app/models/issue.rb:1106:in `notified_users'
    app/models/journal.rb:162:in `notified_users'
    app/models/mailer.rb:132:in `deliver_issue_edit'
    app/models/journal.rb:337:in `send_notification'
    plugins/redmine_scheduling_poll/app/controllers/scheduling_polls_controller.rb:142:in `vote'
    lib/redmine/sudo_mode.rb:61:in `sudo_mode'
    plugins/redmine_scheduling_poll/test/functional/scheduling_polls_controller_test.rb:333:in `block (2 levels) in <class:SchedulingPollsControllerTest>'
    test/test_helper.rb:101:in `with_settings'
    plugins/redmine_scheduling_poll/test/functional/scheduling_polls_controller_test.rb:321:in `block in <class:SchedulingPollsControllerTest>'

bin/rails test plugins/redmine_scheduling_poll/test/functional/scheduling_polls_controller_test.rb:320

E

Error:
SchedulingPollsControllerTest#test_create.xml:
NoMethodError: undefined method `high?' for nil:NilClass
    app/models/issue.rb:1106:in `notified_users'
    app/models/journal.rb:162:in `notified_users'
    app/models/mailer.rb:132:in `deliver_issue_edit'
    app/models/journal.rb:337:in `send_notification'
    plugins/redmine_scheduling_poll/app/controllers/scheduling_polls_controller.rb:50:in `create'
    lib/redmine/sudo_mode.rb:61:in `sudo_mode'
    plugins/redmine_scheduling_poll/test/functional/scheduling_polls_controller_test.rb:115:in `block (2 levels) in <class:SchedulingPollsControllerTest>'
    test/test_helper.rb:101:in `with_settings'
    plugins/redmine_scheduling_poll/test/functional/scheduling_polls_controller_test.rb:102:in `block in <class:SchedulingPollsControllerTest>'

bin/rails test plugins/redmine_scheduling_poll/test/functional/scheduling_polls_controller_test.rb:101

E

Error:
SchedulingPollsControllerTest#test_vote:
NoMethodError: undefined method `high?' for nil:NilClass
    app/models/issue.rb:1106:in `notified_users'
    app/models/journal.rb:162:in `notified_users'
    app/models/mailer.rb:132:in `deliver_issue_edit'
    app/models/journal.rb:337:in `send_notification'
    plugins/redmine_scheduling_poll/app/controllers/scheduling_polls_controller.rb:142:in `vote'
    lib/redmine/sudo_mode.rb:61:in `sudo_mode'
    plugins/redmine_scheduling_poll/test/functional/scheduling_polls_controller_test.rb:282:in `block in <class:SchedulingPollsControllerTest>'

bin/rails test plugins/redmine_scheduling_poll/test/functional/scheduling_polls_controller_test.rb:270

.E

Error:
SchedulingPollsControllerTest#test_vote.json:
NoMethodError: undefined method `high?' for nil:NilClass
    app/models/issue.rb:1106:in `notified_users'
    app/models/journal.rb:162:in `notified_users'
    app/models/mailer.rb:132:in `deliver_issue_edit'
    app/models/journal.rb:337:in `send_notification'
    plugins/redmine_scheduling_poll/app/controllers/scheduling_polls_controller.rb:142:in `vote'
    lib/redmine/sudo_mode.rb:61:in `sudo_mode'
    plugins/redmine_scheduling_poll/test/functional/scheduling_polls_controller_test.rb:307:in `block (2 levels) in <class:SchedulingPollsControllerTest>'
    test/test_helper.rb:101:in `with_settings'
    plugins/redmine_scheduling_poll/test/functional/scheduling_polls_controller_test.rb:295:in `block in <class:SchedulingPollsControllerTest>'

bin/rails test plugins/redmine_scheduling_poll/test/functional/scheduling_polls_controller_test.rb:294

.E

Error:
SchedulingPollsControllerTest#test_create.json:
NoMethodError: undefined method `high?' for nil:NilClass
    app/models/issue.rb:1106:in `notified_users'
    app/models/journal.rb:162:in `notified_users'
    app/models/mailer.rb:132:in `deliver_issue_edit'
    app/models/journal.rb:337:in `send_notification'
    plugins/redmine_scheduling_poll/app/controllers/scheduling_polls_controller.rb:50:in `create'
    lib/redmine/sudo_mode.rb:61:in `sudo_mode'
    plugins/redmine_scheduling_poll/test/functional/scheduling_polls_controller_test.rb:89:in `block (2 levels) in <class:SchedulingPollsControllerTest>'
    test/test_helper.rb:101:in `with_settings'
    plugins/redmine_scheduling_poll/test/functional/scheduling_polls_controller_test.rb:75:in `block in <class:SchedulingPollsControllerTest>'

bin/rails test plugins/redmine_scheduling_poll/test/functional/scheduling_polls_controller_test.rb:74

DEPRECATION WARNING: acts_as_activity_provider with implicit :scope option is deprecated. Please pass a scope on the SchedulingPollItem as a proc. (called from block (2 levels) in events at /home/runner/work/redmine_scheduling_poll/redmine_scheduling_poll/redmine/lib/redmine/activity/fetcher.rb:93)
..............

Finished in 3.093769s, 11.3131 runs/s, 60.4441 assertions/s.
35 runs, 187 assertions, 0 failures, 6 errors, 0 skips

Page title on the poll page

Some issue-related texts should be added to the page title on "/scheduling_polls/:id/show".
But actually there is no title text. So, any issue-related text is not shown on the tab on the browser.

HTML Bug

The final </div> tag will still printed. If permission "View scheduling polls" is disabled.

wronghtmltag

correct view:

righthtmltag

Not processed if voting again after voting fails

  1. [Precondition] for users already voted the poll
  2. Submit the poll without change votes
  3. User gets an error message saying "No change in vote"
  4. Submit again after changing the votes
    • Expected: the votes are submitted and processed.
    • Actual: the votes are not submitted. Nothing proceed.

mysql5.7 fails on migration of VERSION=4

Executing bundle exec rake redmine:plugins NAME=redmine_scheduling_poll fails as follows:

== 4 AddTimestampToSchedulingPollItemsAndFixTimestampOfSchedulingVotes: migrating 
-- change_table(:scheduling_poll_items, {})
   -> 1.0714s
-- rename_column(:scheduling_votes, :create_at, :created_at)
rake aborted!
StandardError: An error has occurred, all later migrations canceled:

Mysql2::Error: Invalid default value for 'created_at': ALTER TABLE `scheduling_votes` CHANGE `create_at` `created_at` timestamp DEFAULT NULL

Environment:

  • mysql 5.7 (using docker.io/mysql:5.7 container)
  • redmine 4.0
  • ruby 2.5.3p105

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.