Ilogeek / redmine_issue_dynamic_edit

Allows users to dynamically update (AJAX) issue's attributes from issue details page without any refresh (JIRA like)
http://www.redmine.org/plugins/redmine_issue_dynamic_edit
MIT License
134 stars 56 forks source link

If description disabled in tracker, user could not change state from "new state" #65

Closed koledas closed 4 years ago

koledas commented 4 years ago

If description disabled in tracker, user could not change state from "new state" by dynamic edit. From standart edit it changed. This fix solves the problem. From: requiredAttributes = issue.required_attribute_names(User.current) To: requiredAttributes = issue.required_attribute_names(User.current) & issue.safe_attribute_names(User.current)

Ilogeek commented 4 years ago

Hi @koledas

I don't get why adding optional field into requiredAttributes var resolve the issue. Adding attributes user can edit to "requiredAttributes" var doesn't sound good to me. By doing that, you'll set all the attributes user can edit as required attribute even if they're optional.

You may have a problem with this condition which display or not the current issue status : https://github.com/Ilogeek/redmine_issue_dynamic_edit/blob/master/lib/details_issue_hooks.rb#L55-L60

The last one is maybe the one that block you. What happens if you remove this condition ?

koledas commented 4 years ago

I have already modeled this behavior. Its blocked on L59. If comment L59 user can edit issue status dynamicaly. issue.required_attribute_names(User.current) & issue.safe_attribute_names(User.current) - this is the intersection (not a union) of the sets of required attributes and those that the user can edit. We get the required attributes available to the user.

Ilogeek commented 4 years ago

Hi @koledas

Thank you for the complete feedback and explanations. My bad I haven't correctly read the modification (and unfortunately Ruby is not my main programmation language)

I'll merge your PRs, thank you a lot for the other modification regarding IE issues 👍

koledas commented 4 years ago

Thank you for this cool plugin!