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

Fix assigning staff members to budgets #3807

Merged
merged 15 commits into from
Nov 1, 2019
Merged

Fix assigning staff members to budgets #3807

merged 15 commits into from
Nov 1, 2019

Conversation

javierm
Copy link
Member

@javierm javierm commented Oct 30, 2019

References

Objectives

  • Make it possible to deselect all staff members assigned to a budget
  • Fix searching investments by milestone tags
  • Remove unused tags and help link attributes in budgets
  • Remove unused BudgetRolAssignment model
  • Assign administrators and valuators to existing budgets so we don't lose data

Notes

Before removing tags from budgets, I made them work the way we usually use tags in the application. So if we want to add them back in the future, we can use this implementation as a reference.

@javierm javierm added the Bug label Oct 30, 2019
@javierm javierm self-assigned this Oct 30, 2019
@javierm javierm added this to Reviewing in Roadmap via automation Oct 30, 2019
@javierm javierm moved this from Reviewing to Doing in Roadmap Oct 30, 2019
@javierm javierm changed the base branch from remove_votation_types to master October 31, 2019 12:49
@javierm javierm changed the base branch from master to pluralize_js October 31, 2019 15:04
@javierm javierm force-pushed the fix_budget_staff branch 3 times, most recently from 32ea7b7 to 7c514dd Compare October 31, 2019 15:14
@javierm javierm changed the title [WIP] Fix assigning staff members to budgets Fix assigning staff members to budgets Oct 31, 2019
@javierm javierm force-pushed the fix_budget_staff branch 2 times, most recently from 8dc32f1 to e2a0533 Compare October 31, 2019 23:39
@javierm javierm force-pushed the fix_budget_staff branch 4 times, most recently from 6b74a13 to 649bc36 Compare November 1, 2019 00:21
@javierm javierm moved this from Doing to Reviewing in Roadmap Nov 1, 2019
@javierm javierm changed the base branch from pluralize_js to master November 1, 2019 15:48
They weren't caught by `i18n-tasks` because there are places were we use
`t("budgets.edit.#{variable}"`, which marks as used all translations
starting with `budgets.edit`
We need to add a hidden field for each group of check boxes, so if we
don't check anything, the hidden field is sent to the server, indicating
nothing was selected. Without the hidden field, the server will not know
anything has been done to the check boxes.

The easiest way to do it is using `collection_check_boxes`, which also
adds labels to every check box.
Same result, with less code.
It doesn't seem very useful.

This commit reverts part of commit 74083df.
It was added in commit 74083df; we're not sure why.
We were manually doing the same thing, generating inconsistent results,
since the method `valuation_tag_list` was using the `valuation` context,
when actually the expected behavior would be to use the `valuation_tag`
context.
Since budgets now have milestone tags, the name of this method was
confusing and will conflict with the name generated by acts_as_taggable.

Note the new name could be improved too.
We were adding columns to the budgets table instead of using the same
logic we use everywhere else.
We were ordering one group of tags alphabetically and then adding
another group of tags which wasn't ordered alphabetically, which didn't
make much sense.
Tags and help links can be edited, but aren't used anywhere. Since we
don't know what the intended behavior was, I'm removing them for now.

My best guess is tags were supposed to be used so investments for a
budget can only be assigned tags present in the budget. Achieving that
behavior wouldn't be a trivial task.
If we didn't run this task, investments for existing budgets wouldn't
show their administrator/valuators as an option when we're editing them,
leading to data loss.
@javierm javierm merged commit affb41c into master Nov 1, 2019
Roadmap automation moved this from Reviewing to Release 1.1.0 Nov 1, 2019
@javierm javierm deleted the fix_budget_staff branch November 1, 2019 16:21
smarques pushed a commit to venetochevogliamo/consul that referenced this pull request Apr 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Roadmap
  
Release 1.1.0
Development

Successfully merging this pull request may close these issues.

None yet

2 participants