Patch #31859

Per role visibility settings for spent time custom fields

Added by Marius BALTEANU 10 days ago. Updated about 4 hours ago.

Status:ReopenedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Custom fields
Target version:4.1.0

Description

Based on the work made by Jens Krämer in #23997, I've created a patch that adds role visibility settings for spent time custom fields (including two tests).

0001-Per-role-visibility-settings-for-spent-time-custom-f.patch Magnifier (16.8 KB) Marius BALTEANU, 2019-08-07 08:03

box.png (132 KB) Marius BALTEANU, 2019-08-17 11:41

restore_hook.diff Magnifier (2.69 KB) Marius BALTEANU, 2019-08-17 11:52

0001-Refactor-custom-fields-form.patch Magnifier (7.57 KB) Marius BALTEANU, 2019-08-17 11:52


Related issues

Related to Redmine - Patch #23997: Per role visibility settings for project and version cust... New
Duplicated by Redmine - Feature #25746: Spent time - CUSTOM fields - permissions Closed

Associated revisions

Revision 18358
Added by Go MAEDA 8 days ago

Per role visibility settings for spent time custom fields (#31859).

Patch by Marius BALTEANU.

History

#1 Updated by Marius BALTEANU 10 days ago

  • Related to Patch #23997: Per role visibility settings for project and version custom fields added

#2 Updated by Go MAEDA 10 days ago

  • Duplicated by Feature #25746: Spent time - CUSTOM fields - permissions added

#3 Updated by Marius BALTEANU 10 days ago

  • Target version set to Candidate for next major release

#4 Updated by Jenda Benda 10 days ago

Hello Marius,

amazing job, thanks so much! I'd like to test your patch in our env.

Could you please advise me how to apply the patch?
What are the proper commands and order please?
What are the compatible versions of redmine, where can be patch applied?
How the redmine installation/database will be affected when patched redmine will be updated? ...and patched again then? Wil be any data/permission settings lost?
Is it safe to apply this on our productiton redmine? -)

thank you!
Kind regards
J.

#5 Updated by Marius BALTEANU 10 days ago

Jenda Benda wrote:

Hello Marius,

amazing job, thanks so much! I'd like to test your patch in our env.

Could you please advise me how to apply the patch?
What are the proper commands and order please?
What are the compatible versions of redmine, where can be patch applied?
How the redmine installation/database will be affected when patched redmine will be updated? ...and patched again then? Wil be any data/permission settings lost?
Is it safe to apply this on our productiton redmine? -)

thank you!
Kind regards
J.

Hello Jenda,

The patch doesn't add any migration of the database, so it should be quite safe to apply it in your environment, especially if you make the tests on new spent time custom fields or you set back the visibility to any role after your tests, but I do not recommend to apply it if you don't have experience with patches and/or Redmine. Unfortunately, I cannot offer you assistance for your environment, maybe you can request help on the forum.

I'm confident that we will deliver this feature in 4.1.0 or 4.2.0.

#6 Updated by Go MAEDA 8 days ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Target version changed from Candidate for next major release to 4.1.0

Commited the patch. Thank you for this nice improvement.

#7 Updated by Marius BALTEANU 5 days ago

The changes committed (some line breaks) to app/models/issue_query.rb were intended?

#8 Updated by Go MAEDA 5 days ago

Marius BALTEANU wrote:

The changes committed (some line breaks) to app/models/issue_query.rb were intended?

Maybe I mistakenly updated issue_query.rb while fixing Rubocop's Layout/MultilineBlockLayout warning. Since I saw some Rubocop warnings after applying the patch, I ran rubocop --auto-correct.

#9 Updated by Marius BALTEANU about 4 hours ago

The patch changed also the location where <%= call_hook(:"view_custom_fields_form_#{@custom_field.type.to_s.underscore}", :custom_field => @custom_field, :form => f) %> is rendered.

Before this patch, the hook was rendered inside the first tabular box:

but after this patch, the hook is rendered outside the box.

In order to restore the previous behaviour, I see 2 options:
1. Add the hook for each type of custom field (restore_hook.diff)
2. Refactor the custom fields form view (0001-Refactor-custom-fields-form.patch)

Attached both patches. I'm in favour of the second solution and also I think we should add a new hook in the page in order to allow plugins to render outside the box (for example: to use the new partial views (role, tracker, projects).

Also available in: Atom PDF