Patch #31859

Per role visibility settings for spent time custom fields

Added by Marius BALTEANU 4 months ago. Updated 4 months ago.

Status:ClosedStart 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 version custom fields Closed
Related to Redmine - Patch #31999: Add missing fixtures to TimelogCustomFieldsVisibilityTest Closed
Duplicated by Redmine - Feature #25746: Spent time - CUSTOM fields - permissions Closed

Associated revisions

Revision 18358
Added by Go MAEDA 4 months ago

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

Patch by Marius BALTEANU.

Revision 18376
Added by Go MAEDA 4 months ago

Refactor custom fields form (#31859).

Patch by Marius BALTEANU.

Revision 18422
Added by Go MAEDA 3 months ago

Add missing fixtures to TimelogCustomFieldsVisibilityTest (#31999).

Patch by Yuichi HARADA.

History

#1 Updated by Marius BALTEANU 4 months ago

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

#2 Updated by Go MAEDA 4 months ago

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

#3 Updated by Marius BALTEANU 4 months ago

  • Target version set to Candidate for next major release

#4 Updated by Jenda Benda 4 months 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 4 months 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 4 months 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 4 months ago

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

#8 Updated by Go MAEDA 4 months 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 4 months 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).

#10 Updated by Jenda Benda 4 months ago

Hi There,

thanks a lot once again for all the work here...

I was just about to try to apply the patch in our prod redmine and found this new comment, which I'm afraid do not understand fully.

Does that mean I should wait with the patching? Or is it still safe to apply? Is it necessary/recommended to apply additional patch from Marius as well please?

thanks a lot
kind regards
j.

#11 Updated by Go MAEDA 4 months ago

  • Status changed from Reopened to Closed

Marius BALTEANU wrote:

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).

Committed the second patch in r18376. Thanks.

#12 Updated by Go MAEDA 3 months ago

  • Related to Patch #31999: Add missing fixtures to TimelogCustomFieldsVisibilityTest added

Also available in: Atom PDF