Project

General

Profile

Actions

Feature #31859

closed

Per role visibility settings for spent time custom fields

Added by Marius BĂLTEANU over 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Custom fields
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:

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


Files

0001-Per-role-visibility-settings-for-spent-time-custom-f.patch (16.8 KB) 0001-Per-role-visibility-settings-for-spent-time-custom-f.patch Marius BĂLTEANU, 2019-08-07 08:03
box.png (132 KB) box.png Marius BĂLTEANU, 2019-08-17 11:41
restore_hook.diff (2.69 KB) restore_hook.diff Marius BĂLTEANU, 2019-08-17 11:52
0001-Refactor-custom-fields-form.patch (7.57 KB) 0001-Refactor-custom-fields-form.patch Marius BĂLTEANU, 2019-08-17 11:52

Related issues

Related to Redmine - Feature #23997: Per role visibility settings for version custom fieldsClosedGo MAEDA

Actions
Related to Redmine - Patch #31999: Add missing fixtures to TimelogCustomFieldsVisibilityTestClosedGo MAEDA

Actions
Has duplicate Redmine - Feature #25746: Spent time - CUSTOM fields - permissionsClosed

Actions
Actions #1

Updated by Marius BĂLTEANU over 4 years ago

  • Related to Feature #23997: Per role visibility settings for version custom fields added
Actions #2

Updated by Go MAEDA over 4 years ago

  • Has duplicate Feature #25746: Spent time - CUSTOM fields - permissions added
Actions #3

Updated by Marius BĂLTEANU over 4 years ago

  • Target version set to Candidate for next major release
Actions #4

Updated by Jenda Benda over 4 years 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.

Actions #5

Updated by Marius BĂLTEANU over 4 years 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.

Actions #6

Updated by Go MAEDA over 4 years 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.

Actions #7

Updated by Marius BĂLTEANU over 4 years ago

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

Actions #8

Updated by Go MAEDA over 4 years 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.

Actions #9

Updated by Marius BĂLTEANU over 4 years 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).

Actions #10

Updated by Jenda Benda over 4 years 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.

Actions #11

Updated by Go MAEDA over 4 years 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.

Actions #12

Updated by Go MAEDA over 4 years ago

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

Updated by Jean-Philippe Lang over 4 years ago

  • Tracker changed from Patch to Feature
Actions #14

Updated by Mi Po about 4 years ago

Hello #Go MAEDA is the plug-in useful for Redmine 3.4.13 too? I cannot find GIT repo for this patch. Thank you

Actions #15

Updated by Adrien Crivelli almost 4 years ago

It seems this feature has a defect as described in #33550 where the new setting is ignored.

Actions

Also available in: Atom PDF