Git Product home page Git Product logo

redmine-view-customize's Introduction

Redmine view customize plugin

CircleCI

This a plugin allows you to customize the view for the Redmine.

Features

Customize the page by inserting JavaScript, CSS or HTML on the page that matched the condition.

Installation

Install the plugin in your Redmine plugins directory, clone this repository as view_customize:

cd {RAILS_ROOT}/plugins
git clone https://github.com/onozaty/redmine-view-customize.git view_customize
cd ../
bundle install --without development test
bundle exec rake redmine:plugins:migrate RAILS_ENV=production

note: The directory name must be a view_customize. Directory name is different, it will fail to run the Plugin.

Usage

Add

When installing the plugin, "View customize" is added to the administrator menu.

Screenshot of admin menu

Click "View customize" go to the list screen.

Screenshot of list new

Click "New view customize" and enter items.

Screenshot of new

Use "Path pattern" and "Project pattern" to specify the target page.
If neither is set, all pages will be targeted.

"Path pattern" is a regular expression to specify the page path.
If a path pattern was set, the code will not be inserted if the path of the page do not match.

The following is an example.

  • /issues$ : Issue list
  • /issues/[0-9]+ : Issue detail page

"Project pattern" is a regular expression to specify the project identifier. It becomes item added in v2.7.0.
If the project pattern was set, the code will not be inserted if the current project do not match.

"Insertion position" is the code insertion position. It becomes item added in v1.2.0.

  • "Head of all pages" (The same position as the version before v1.2.0)
  • "Bottom of issue form"
    Issue input fields are reconstructed when trackers or statuses are changed. If "Bottom of issue form" is specified, it will be executed again when reconstructed.
  • "Bottom of issue detail"
  • "Bottom of all pages" (Last in HTML body)
  • "Issues context menu"

If there is no part corresponding to the insertion position of the code on the page, the code is not insert. For example, even if there are no "Path pattern" and "Project pattern" settings and all pages are targeted, if "Bottom of issue detail" is specified for "Insertion position", it will be executed only on the issue detail page.

In "Type", select the type of code ("JavaScript", "CSS" or "HTML") and enter the actual code in "Code".

For "Comment" you can put an overview on customization. The contents entered here are displayed in the list display. When "Comment" is entered, "Comment" is displayed on the list. If "Comment" is not entered, "Code" is displayed in the list.

Addition is completed by clicking "Create" button.

On the page that matches the "Path pattern" and "Project pattern", the code will be embedded at the position specified in "Insertion position", and the page will be customized.

Screenshot of example

Edit / Delete

Screenshot of list edit

When you click the number of the customize list, go to the detail page.

Screenshot of detail

You can delete it by clicking "Delete".

Click "Edit" to switch to the edit page. The input item is the same as when creating a new one.

Disable / Private

You can disable it by unchecking "Enabled". If you check "Private", it will be enable only for the author.

Screenshot of enabled and private

If you check the operation with "Private" and there is no problem in operation, it will be good to release it to the all.

ViewCustomize.context (JavaScript)

You can access information on users and projects using ViewCustomize.context.

ViewCustomize.context is as follows.

ViewCustomize = {
  "context": {
    "user": {
      "id": 1,
      "login": "admin",
      "admin": true,
      "firstname": "Redmine",
      "lastname": "Admin",
      "mail": "[email protected]",
      "lastLoginOn": "2019-09-22T14:44:53Z",
      "groups": [
        {"id": 5, "name": "Group1"}
      ],
      "apiKey": "3dd35b5ad8456d90d21ef882f7aea651d367a9d8",
      "customFields": [
        {"id": 1, "name": "[Custom field] Text", "value": "text"},
        {"id": 2, "name": "[Custom field] List", "value": ["B", "A"]},
        {"id": 3, "name": "[Custom field] Boolean", "value": "1"}
      ]
    },
    "project": {
      "id": 1,
      "identifier": "project-a",
      "name": "Project A",
      "roles": [
        {"id": 6, "name": "RoleX"}
      ],
      "customFields": [
        {"id": 4, "name": "[Project Custom field] Text", "value": "text"}
      ]
    },
    "issue": {
      "id": 1,
      "author": {"id": 2, "name": "John Smith"},
      "totalEstimatedHours": 10.0,
      "totalSpentHours": 11.5,
      "lastUpdatedBy": {"id": 1, "name": "Redmine Admin"}
    }
  }
}

For example, to access the user's API access key is ViewCustomize.context.user.apiKey.

API access key

The API access key is created when the "Show" link of the API access key on the My account page is click for the first time.

Screenshot of my account

If you want to created it automatically, set "Automatically create API access key" to ON in the plugin configure page. API access keys can be created without having each user operate the My account page.

Screenshot of plugin configure

To use the API access key, "Enable REST web service" must be turned on in the "API" tab of the setting page.

Examples

Example code is published in the following project.

If you don't know how to write the code, please refer to the project above.

If the code you try does not work, you can ask questions from the Issue of the above project.
Please note that this is a place to ask questions, not a place to request coding.

Supported versions

  • Current version : Redmine 3.1.x - 3.4.x, 4.0.x or later
  • 1.2.2 : Redmine 2.0.x - 3.4.x

License

The plugin is available under the terms of the GNU General Public License, version 2 or later.

Author

onozaty

I am looking for people who are willing to become sponsors and contribute to maintaining this project.

redmine-view-customize's People

Contributors

basyura avatar cat-in-136 avatar ftobler avatar fu7mu4 avatar iquiw avatar ishikawa999 avatar jgallot avatar keineahnung2345 avatar mantykora-net avatar nishidayuya avatar onozaty avatar sho130 avatar vividtone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

redmine-view-customize's Issues

Redmine Internal Server Error with 1.2.0

hi @onozaty
I install the plugin with the version 1.2.0, it cause the Redmine do not work and show an internal error. The problem is the same as above .

The env
`
Environment:
Redmine version 3.3.0.stable
Ruby version 2.1.9-p490 (2016-03-30) [x86_64-linux]
Rails version 4.2.6
Environment production
Database adapter Mysql2

`

the log is

`
Rendered news/_news.html.erb (12.4ms)
Rendered welcome/index.html.erb within layouts/base (132.2ms)
Rendered plugins/advanced_roadmap/app/views/hooks/_stylesheet.html.erb (1.0ms)
Rendered plugins/redmine_code_review/app/views/code_review/_html_header.html.erb (1.3ms)
Rendered plugins/scrum/app/views/scrum_hooks/_head.html.erb (1.1ms)
Completed 500 Internal Server Error in 569ms (ActiveRecord: 15.5ms)

ActionView::Template::Error (undefined method roles' for #User:0x0055bdfd8e4868): 17: <script type="text/javascript" src="/chartkick/Chart.bundle.min.js"></script> 18: <%= javascript_heads %> 19: <%= heads_for_theme %> 20: <%= call_hook :view_layouts_base_html_head %> 21: 22: <%= yield :header_tags -%> 23: plugins/view_customize/lib/view_customize/view_hook.rb:82:increate_view_customize_context'
plugins/view_customize/lib/view_customize/view_hook.rb:10:in view_layouts_base_html_head' lib/redmine/hook.rb:61:inblock (2 levels) in call_hook'
lib/redmine/hook.rb:61:in each' lib/redmine/hook.rb:61:inblock in call_hook'
lib/redmine/hook.rb:58:in tap' lib/redmine/hook.rb:58:incall_hook'
lib/redmine/hook.rb:96:in call_hook' app/views/layouts/base.html.erb:20:in_app_views_layouts_base_html_erb___3024194164021486896_47137250057600'
lib/redmine/sudo_mode.rb:63:in sudo_mode' plugins/redmine_dmsf/lib/redmine_dmsf/webdav/no_parse.rb:33:incall'

Add ViewCustomize object on JavaScript

ViewCustomize というオブジェクトをJavaScriptから参照可能にします。

このオブジェクトには、ユーザ情報(管理者かどうか、ロールID一覧など)を含めるようにします。
View customizeのコードでこの情報を利用することによって、カスタマイズの幅を広げることができるようになります。

Internal error

マルチバイト文字のリンク(wikiページのリンク)からページを開こうとすると
下記エラーで表示されません。
何か対策はありますでしょうか?
ActionView::Template::Error (incompatible character encodings: ASCII-8BIT and UTF-8):
13: <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
14: <%= javascript_heads %>
15: <%= heads_for_theme %>
16: <%= call_hook :view_layouts_base_html_head %>
17:
18: <%= yield :header_tags -%>
19:

plugins/view_customize/lib/view_customize/view_hook.rb:10:in view_layouts_base_html_head' lib/redmine/hook.rb:61:in block (2 levels) in call_hook'
lib/redmine/hook.rb:61:in each' lib/redmine/hook.rb:61:in block in call_hook'
lib/redmine/hook.rb:58:in tap' lib/redmine/hook.rb:58:in call_hook'
lib/redmine/hook.rb:96:in call_hook' app/views/layouts/base.html.erb:16:in _app_views_layouts_base_html_erb__756437483_44190576'
lib/redmine/sudo_mode.rb:63:in `sudo_mode'

User and password

I'm accessing the redmine API doing a $.get(.....) to get an xml of an issue, in the get command I add the user apikey (obtained with ViewCustomize.context.user.apiKey) and it asks for username and password. It asks for it the first time that I execute the command, if I introduce it, it doesn't ask for it again. Isn't it supposed that accessing with the apikey it is not necessary the user and password?

Thx, this is great!

Hi @onozaty

Just wanted to say thank you for a great plugin. It just works and is the magic sauce that makes redmine perfect for us. We already have several small tidbits that removes the suck from certain pages.

So again. THX!

Add control by role

Currently, it is difficult to control scripts to be executed for each user.
We solve this problem by allowing it to be controlled by roles.

The code does not run with normal users

Hello, I have a problem, the code only runs on users who are with the administrator profile, with any other profile the code does not run, do you know where the problem might be?

Add ViewCustomize.context.project.id

Is your feature request related to a problem? Please describe.

When there is only one project, the project ID selection is not displayed in the Issue edit screen.
Therefore, there is no easy way to get the project ID.

Describe the solution you'd like

Add ViewCustomize.context.project.id.

Can't appear view customize in admin menu

I manage some redmine site. One of these can't appear view customize in admin menu and I can't access view customize page directly.
I've checked production.log, but no error. The installatin was success.
This is my first experience. It appears in information page.
Please advice what I have to check.

Redmine version is 3.1.4, view customize is latest version.
On same environment, another same version redmine is working well.

Thanks.

Icon could not be displayed

アイコンを追加します。

今まではSettingsと同じアイコンを使っていましたが、わかりずらいので別のアイコンとして追加します。
また、Redmineのバージョンがあがったことによってアイコン自体がうまく表示できていなかった問題にも対応します。

Feature Request: Option to insert script at bottom of HTML body

I'd like to insert View Customize script that manages Gantt chart at bottom of HTML body.

Gant chart HTML looks like the following.

<html>
...
// (A) view customize scripts
...
<script src=".../gantt.js"/>
...
// main contents
...
<script>
$(function () {
// gantt chart initialize
});
</script>
...
// (B) 
</body>
</html>

It is difficult to manage generated gantt chart at (A), so I'd like to insert script at (B).

Missing detailed documentation for view-customize plugin

Is there a more detailed documentation for this plugin avaiable?
Information abaut:

  • Java Issue-field-relation
  • CSS Issue-field-relation
  • Which fields at all are supported
  • Is there a relation to standard CSS - and Java programming?
  • How do I get information of supported field- and property-Information like:
    Access to field status_id with "tr.issue.status"
    Access to field "assigned_to_id" with me as attribute by "tr.issue.assigned-to-me"
  • Where do I get information about syntax?
    Thanks for related information!

Conditional custom fields with this plugin.

Hi onozaty,

Our Redmine System have two custom fields as below,
image
image
If we would like to make only "#[Image release]" and "#[Travel]" items can be selected in 2nd level when "#[Routine task]" be selected in 1st level,can we apply this plugin or not?
If it does work,could you give me a favor?thanks in advanced.

LoadError during startup with Redmine trunk r21288

Summary

View Customize plugin cannot run with Redmine trunk r21288. With the plugin installed, the following error occurs during startup and Redmine cannot be started.

Probably this is due to https://www.redmine.org/issues/32938.

/path/to/gems/ruby/3.0.0/gems/zeitwerk-2.5.1/lib/zeitwerk/kernel.rb:35:in `require': cannot load such file -- view_customize/view_hook (LoadError)

Description

You can reproduce the issue by running bin/rails c

Environment

  • View customize plugin version: 2.8.1
  • Redmine version: trunk r21288
  • Ruby version: 3.0.0p0
  • Rails version: 6.1.4.1
  • Installed other plugins

Unable to install the plugin

bundle exec rake redmine:plugins:migrate RAILS_ENV=production
(in /opt/redmine/redmine-5.0.3)
Rails Error: Unable to access log file. Please ensure that /opt/redmine/redmine-5.0.3/log/production.log exists and is writable (ie, make it writable for user and group: chmod 0664 /opt/redmine/redmine-5.0.3/log/production.log). The log level has been raised to WARN and the output directed to STDERR until the problem is fixed.
rake aborted!
Could not create directory /opt/redmine/redmine-5.0.3/public/plugin_assets/view_customize/stylesheets: Permission denied @ dir_s_mkdir - /opt/redmine/redmine-5.0.3/public/plugin_assets/view_customize
/opt/redmine/redmine-5.0.3/lib/redmine/plugin_loader.rb:51:in rescue in mirror_assets' /opt/redmine/redmine-5.0.3/lib/redmine/plugin_loader.rb:48:in mirror_assets'
/opt/redmine/redmine-5.0.3/lib/redmine/plugin_loader.rb:143:in each' /opt/redmine/redmine-5.0.3/lib/redmine/plugin_loader.rb:143:in mirror_assets'
/opt/redmine/redmine-5.0.3/lib/redmine/plugin_loader.rb:99:in block in create_assets_reloader' /var/lib/gems/2.7.0/gems/activesupport-6.1.7/lib/active_support/file_update_checker.rb:83:in execute'
/opt/redmine/redmine-5.0.3/config/initializers/30-redmine.rb:25:in <top (required)>' /var/lib/gems/2.7.0/gems/activesupport-6.1.7/lib/active_support/dependencies.rb:326:in load'
/var/lib/gems/2.7.0/gems/activesupport-6.1.7/lib/active_support/dependencies.rb:326:in block in load' /var/lib/gems/2.7.0/gems/activesupport-6.1.7/lib/active_support/dependencies.rb:299:in load_dependency'
/var/lib/gems/2.7.0/gems/activesupport-6.1.7/lib/active_support/dependencies.rb:326:in load' /var/lib/gems/2.7.0/gems/railties-6.1.7/lib/rails/engine.rb:681:in block in load_config_initializer'
/var/lib/gems/2.7.0/gems/activesupport-6.1.7/lib/active_support/notifications.rb:205:in instrument' /var/lib/gems/2.7.0/gems/railties-6.1.7/lib/rails/engine.rb:680:in load_config_initializer'
/var/lib/gems/2.7.0/gems/railties-6.1.7/lib/rails/engine.rb:634:in block (2 levels) in <class:Engine>' /var/lib/gems/2.7.0/gems/railties-6.1.7/lib/rails/engine.rb:633:in each'
/var/lib/gems/2.7.0/gems/railties-6.1.7/lib/rails/engine.rb:633:in block in <class:Engine>' /var/lib/gems/2.7.0/gems/railties-6.1.7/lib/rails/initializable.rb:32:in instance_exec'
/var/lib/gems/2.7.0/gems/railties-6.1.7/lib/rails/initializable.rb:32:in run' /var/lib/gems/2.7.0/gems/railties-6.1.7/lib/rails/initializable.rb:61:in block in run_initializers'
/var/lib/gems/2.7.0/gems/railties-6.1.7/lib/rails/initializable.rb:50:in each' /var/lib/gems/2.7.0/gems/railties-6.1.7/lib/rails/initializable.rb:50:in tsort_each_child'
/var/lib/gems/2.7.0/gems/railties-6.1.7/lib/rails/initializable.rb:60:in run_initializers' /var/lib/gems/2.7.0/gems/railties-6.1.7/lib/rails/application.rb:391:in initialize!'
/opt/redmine/redmine-5.0.3/config/environment.rb:16:in <top (required)>' /var/lib/gems/2.7.0/gems/zeitwerk-2.6.1/lib/zeitwerk/kernel.rb:35:in require'
/var/lib/gems/2.7.0/gems/zeitwerk-2.6.1/lib/zeitwerk/kernel.rb:35:in require' /var/lib/gems/2.7.0/gems/activesupport-6.1.7/lib/active_support/dependencies.rb:332:in block in require'
/var/lib/gems/2.7.0/gems/activesupport-6.1.7/lib/active_support/dependencies.rb:299:in load_dependency' /var/lib/gems/2.7.0/gems/activesupport-6.1.7/lib/active_support/dependencies.rb:332:in require'
/var/lib/gems/2.7.0/gems/railties-6.1.7/lib/rails/application.rb:367:in require_environment!' /var/lib/gems/2.7.0/gems/railties-6.1.7/lib/rails/application.rb:533:in block in run_tasks_blocks'
/var/lib/gems/2.7.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'

Caused by:
Errno::EACCES: Permission denied @ dir_s_mkdir - /opt/redmine/redmine-5.0.3/public/plugin_assets/view_customize
/opt/redmine/redmine-5.0.3/lib/redmine/plugin_loader.rb:49:in mirror_assets' /opt/redmine/redmine-5.0.3/lib/redmine/plugin_loader.rb:143:in each'
/opt/redmine/redmine-5.0.3/lib/redmine/plugin_loader.rb:143:in mirror_assets' /opt/redmine/redmine-5.0.3/lib/redmine/plugin_loader.rb:99:in block in create_assets_reloader'
/var/lib/gems/2.7.0/gems/activesupport-6.1.7/lib/active_support/file_update_checker.rb:83:in execute' /opt/redmine/redmine-5.0.3/config/initializers/30-redmine.rb:25:in <top (required)>'
/var/lib/gems/2.7.0/gems/activesupport-6.1.7/lib/active_support/dependencies.rb:326:in load' /var/lib/gems/2.7.0/gems/activesupport-6.1.7/lib/active_support/dependencies.rb:326:in block in load'
/var/lib/gems/2.7.0/gems/activesupport-6.1.7/lib/active_support/dependencies.rb:299:in load_dependency' /var/lib/gems/2.7.0/gems/activesupport-6.1.7/lib/active_support/dependencies.rb:326:in load'
/var/lib/gems/2.7.0/gems/railties-6.1.7/lib/rails/engine.rb:681:in block in load_config_initializer' /var/lib/gems/2.7.0/gems/activesupport-6.1.7/lib/active_support/notifications.rb:205:in instrument'
/var/lib/gems/2.7.0/gems/railties-6.1.7/lib/rails/engine.rb:680:in load_config_initializer' /var/lib/gems/2.7.0/gems/railties-6.1.7/lib/rails/engine.rb:634:in block (2 levels) in class:Engine'
/var/lib/gems/2.7.0/gems/railties-6.1.7/lib/rails/engine.rb:633:in each' /var/lib/gems/2.7.0/gems/railties-6.1.7/lib/rails/engine.rb:633:in block in class:Engine'
/var/lib/gems/2.7.0/gems/railties-6.1.7/lib/rails/initializable.rb:32:in instance_exec' /var/lib/gems/2.7.0/gems/railties-6.1.7/lib/rails/initializable.rb:32:in run'
/var/lib/gems/2.7.0/gems/railties-6.1.7/lib/rails/initializable.rb:61:in block in run_initializers' /var/lib/gems/2.7.0/gems/railties-6.1.7/lib/rails/initializable.rb:50:in each'
/var/lib/gems/2.7.0/gems/railties-6.1.7/lib/rails/initializable.rb:50:in tsort_each_child' /var/lib/gems/2.7.0/gems/railties-6.1.7/lib/rails/initializable.rb:60:in run_initializers'
/var/lib/gems/2.7.0/gems/railties-6.1.7/lib/rails/application.rb:391:in initialize!' /opt/redmine/redmine-5.0.3/config/environment.rb:16:in <top (required)>'
/var/lib/gems/2.7.0/gems/zeitwerk-2.6.1/lib/zeitwerk/kernel.rb:35:in require' /var/lib/gems/2.7.0/gems/zeitwerk-2.6.1/lib/zeitwerk/kernel.rb:35:in require'
/var/lib/gems/2.7.0/gems/activesupport-6.1.7/lib/active_support/dependencies.rb:332:in block in require' /var/lib/gems/2.7.0/gems/activesupport-6.1.7/lib/active_support/dependencies.rb:299:in load_dependency'
/var/lib/gems/2.7.0/gems/activesupport-6.1.7/lib/active_support/dependencies.rb:332:in require' /var/lib/gems/2.7.0/gems/railties-6.1.7/lib/rails/application.rb:367:in require_environment!'
/var/lib/gems/2.7.0/gems/railties-6.1.7/lib/rails/application.rb:533:in block in run_tasks_blocks' /var/lib/gems/2.7.0/gems/rake-13.0.6/exe/rake:27:in <top (required)>'
Tasks: TOP => redmine:plugins:migrate => environment
(See full trace by running task with --trace)

What can I do?

Conditional custom fields - max size list field

Is there a limit to the size of the field?
I'm trying to add a field with 1200 lines, but get an error :

Internal error
An error occurred on the page you were trying to access.
If you continue to experience problems please contact your Redmine administrator for assistance.

If you are the Redmine administrator, check your log files for details about the error.

Back

Thank you in advance for your response!

P.S. 700 lines are added normally

ActionView::Template::Error (undefined method `all' for ViewCustomize:Module):

I am getting the following error after adding the plugin and restarting redmine.

ActionView::Template::Error (undefined method `all' for ViewCustomize:Module):
    11: <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
    12: <%= javascript_heads %>
    13: <%= heads_for_theme %>
    14: <%= call_hook :view_layouts_base_html_head %>
    15: <!-- page specific tags -->
    16: <%= yield :header_tags -%>
    17: </head>
  lib/redmine/hook.rb:61:in `block (2 levels) in call_hook'
  lib/redmine/hook.rb:61:in `each'
  lib/redmine/hook.rb:61:in `block in call_hook'
  lib/redmine/hook.rb:58:in `tap'
  lib/redmine/hook.rb:58:in `call_hook'
  lib/redmine/hook.rb:158:in `call_hook'
  app/views/layouts/base.html.erb:14:in `_app_views_layouts_base_html_erb___3015700283242552760_49086080'
  app/views/layouts/admin.html.erb:8:in `_app_views_layouts_admin_html_erb___1856115460351587520_26785740'

The Version I am trying is: a68c6e6

not working in redmine 4.0.6

plugins/view_customi/lib/view_customize/view_hook.rb:15:in view_layouts_base_html_head' lib/redmine/hook.rb:61:in block (2 levels) in call_hook'
lib/redmine/hook.rb:61:in each' lib/redmine/hook.rb:61:in block in call_hook'
lib/redmine/hook.rb:58:in tap' lib/redmine/hook.rb:58:in call_hook'
lib/redmine/hook.rb:96:in call_hook' app/views/layouts/base.html.erb:16:in _app_views_layouts_base_html_erb___2726933900762255495_46985971666360'
lib/redmine/sudo_mode.rb:63:in `sudo_mode'
Started GET "/" for 172.18.25.65 at 2020-03-11 00:18:00 +0200
Processing by WelcomeController#index as HTML
Current user: admin (id=1)
Rendering welcome/index.html.erb within layouts/base
Rendered welcome/index.html.erb within layouts/base (1.7ms)
Completed 500 Internal Server Error in 53ms (ActiveRecord: 14.8ms)

ActionView::Template::Error (uninitialized constant RedmineViewCustomize::ViewHook::ViewCustomize):
13: <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
14: <%= javascript_heads %>
15: <%= heads_for_theme %>
16: <%= call_hook :view_layouts_base_html_head %>
17:
18: <%= yield :header_tags -%>
19:

It does not appear a confirmation dialog when deleting

It does not appear a confirmation dialog when deleting.

<%= link_to(l(:button_delete),
               {:action => 'destroy', :id => @view_customize.id},
               :confirm => l(:text_are_you_sure), :method => :delete,
               :class => 'icon icon-del') %>

Confirm option is disabled on Rails 4.1.

Customized Key/value list Value

Summary

We are unable to get the Actual Value of the Key/value customized list on project level.

Description

We have a Key/value list on project level. We are able to get the the Key only yet the Value is not showing,
ViewCustomize.context.project.customFields[0].id => 7
ViewCustomize.context.project.customFields[0].name => Client (label)
ViewCustomize.context.project.customFields[0].value=> 9 (Key on Table)

how to get the actual value of the Key/value value

Environment

  • View customize plugin version 3.3.0
  • Redmine version 5.0.3
  • Ruby version 3.0.2p107
  • Rails version 6.1.7.2
  • Installed other plugins: additional_tags, additionals, custom_tables, redmine_ckeditor, redmine_issue_dynamic_edit, redmine_issues_tree

You can get these informations from Redmine's project page.
(E.g. http://example.com/project/test_prj1)

javascript give error Network error IN MY FIREWALL

TYPE ONLY JAVA SCRIPT GIVE THIS ERROR ONLY

Network Error (tcp_error)

A communication error occurred: ""
The Web Server may be down, too busy, or experiencing other problems preventing it from responding to requests. You may wish to try again at a later time.
For assistance, contact your network support team.Your request was categorized by Blue Coat Web Filter as 'none'.If you wish to question or dispute this result, please click here.


Site entered is invalid (URL is on an internal network), please enter a valid site


By entering a URL in the box below and clicking "Check Category", you are agreeing to the Symantec Website Terms of Use .

Site Review allows users to check and dispute the current WebPulse categorization for any URL. Note: This tool does not perform full real-time analysis of malicious URLs or files, which is included with the complete Symantec security solution.

Please enter a valid URL for the review process:
http%3A%2F%2F10.55.10.210%2Fview_customizes%2F3

NoMethodError: undefined method `represent_boolean_as_integer=' for nil:NilClass encountered with Redmine 4.1.0-9

Hello, May I ask help on this? Tried to install the plugin in redmine-4.1.0-9, but an error is logged as below.

...\view_customize>bundle exec rake redmine:plugins:migrate RAILS_ENV=production --trace (in .../redmine/htdocs)
rake aborted!
NoMethodError: undefined method `represent_boolean_as_integer=' for nil:NilClass

The bundle install command seems to be successful with the log as follows.

..\htdocs\plugins\view_customize>bundle install --without development test
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/.
. . .
Bundle complete! 3 Gemfile dependencies, 50 gems now installed.
Gems in the groups development and test were not installed.
Use bundle info [gemname] to see where a bundled gem is installed.

Any feedback would be much appreciated. Thank you.

Internal error

HELP me
How to fix this error

Started GET "/redmine/" for 127.0.0.1 at 2019-01-10 08:37:03 +0800
Processing by WelcomeController#index as HTML
Current user: admin (id=1)
Rendered welcome/index.html.erb within layouts/base (0.0ms)
Completed 500 Internal Server Error in 359ms (ActiveRecord: 31.2ms)

ActionView::Template::Error (Mysql2::Error: Table 'bitnami_redmine.view_customizes' doesn't exist: SELECT view_customizes.* FROM view_customizes):
13: <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
14: <%= javascript_heads %>
15: <%= heads_for_theme %>
16: <%= call_hook :view_layouts_base_html_head %>
17:
18: <%= yield :header_tags -%>
19:
plugins/view_customize/lib/view_customize/view_hook.rb:47:in match_customize' plugins/view_customize/lib/view_customize/view_hook.rb:38:in create_view_customize_html'
plugins/view_customize/lib/view_customize/view_hook.rb:13:in view_layouts_base_html_head' lib/redmine/hook.rb:61:in block (2 levels) in call_hook'
lib/redmine/hook.rb:61:in each' lib/redmine/hook.rb:61:in block in call_hook'
lib/redmine/hook.rb:58:in tap' lib/redmine/hook.rb:58:in call_hook'
lib/redmine/hook.rb:96:in call_hook' app/views/layouts/base.html.erb:16:in _app_views_layouts_base_html_erb___343716820_33568284'
lib/redmine/sudo_mode.rb:63:in `sudo_mode'

ViewCustomize User Roles on project

Could you please add to ViewCustomize context

ViewCustomize.context.user.roles
(in context of the current project or globally if no project is selected)
?

that would provide us with many more possibilities.

maybe there is some other workaround now about how to take user roles for the current project?

Internal error Redmine

Redmine show an internal error as soon as I install redmine-view-customize

Here is the `log/production.log

Started GET "/" for 10.0.2.2 at 2018-09-06 20:47:14 +0000
Processing by WelcomeController#index as HTML
  Current user: admin (id=1)
  Rendered welcome/index.html.erb within layouts/base (2.2ms)
Completed 500 Internal Server Error in 52ms (ActiveRecord: 3.1ms)

ActionView::Template::Error (undefined method `all' for ViewCustomize:Module):
    13: <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
    14: <%= javascript_heads %>
    15: <%= heads_for_theme %>
    16: <%= call_hook :view_layouts_base_html_head %>
    17: <!-- page specific tags -->
    18: <%= yield :header_tags -%>
    19: </head>
  plugins/redmine-view-customize/lib/view_customize/view_layouts_base_html_head_hook.rb:17:in `match_customize'
  plugins/redmine-view-customize/lib/view_customize/view_layouts_base_html_head_hook.rb:5:in `view_layouts_base_html_head'
  lib/redmine/hook.rb:61:in `block (2 levels) in call_hook'
  lib/redmine/hook.rb:61:in `each'
  lib/redmine/hook.rb:61:in `block in call_hook'
  lib/redmine/hook.rb:58:in `tap'
  lib/redmine/hook.rb:58:in `call_hook'
  lib/redmine/hook.rb:96:in `call_hook'
  app/views/layouts/base.html.erb:16:in `_app_views_layouts_base_html_erb___774233765271934486_47005662821820'
  lib/redmine/sudo_mode.rb:63:in `sudo_mode'

Do you have any suggestion?

Question regards View Customize and Custom Table Plugins

Good afternoon,
I had a question regarding usage of both plugins together.
I was wondering if there is a chance to hide tables created with that plugin, for example, until the issue is closed, since I saw that there was an issue about data with tables that were created with Custom Table Plugin.

Thanks beforehand.

Kind regards

ActionView::Template::Error (Mysql2::Error: Table 'bitnami_redmine.view_customizes' doesn't exist

I got Template::Error on bitnami-redmine-3.2.2-0-linux-x64


ActionView::Template::Error (Mysql2::Error: Table 'bitnami_redmine.view_customizes' doesn't exist: SELECT `view_customizes`.* FROM `view_customizes`):
    13: <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
    14: <%= javascript_heads %>
    15: <%= heads_for_theme %>
    16: <%= call_hook :view_layouts_base_html_head %>
    17: <!-- page specific tags -->
    18: <%= yield :header_tags -%>
    19: </head>
  plugins/view_customize/lib/view_customize/view_layouts_base_html_head_hook.rb:17:in `match_customize'
  plugins/view_customize/lib/view_customize/view_layouts_base_html_head_hook.rb:5:in `view_layouts_base_html_head'
  lib/redmine/hook.rb:61:in `block (2 levels) in call_hook'
  lib/redmine/hook.rb:61:in `each'
  lib/redmine/hook.rb:61:in `block in call_hook'
  lib/redmine/hook.rb:58:in `tap'
  lib/redmine/hook.rb:58:in `call_hook'
  lib/redmine/hook.rb:96:in `call_hook'
  app/views/layouts/base.html.erb:16:in `_app_views_layouts_base_html_erb__1559771949650330764_47202440892840'
  lib/redmine/sudo_mode.rb:63:in `sudo_mode'

Feature to disable all cutomizes

I think it would be nice if ViewCustomize plugin has a feature to temporarily disable all customizes at once.

Suppose that a Redmine instance which has dozens view customizes and the admin is to troubleshoot unexpected behavior. The admin can quickly determine whether the issue is caused by some customize or not if ViewCustomize plugin has a feature to disable all customize with one-click. Currently, the admin has to disable customizes one by one. That is really time-consuming and boring work.

Thank you for open-sourcing the great plugin.

Add user mails to ViewCustomize context

Hello,

Will it be possible in the next version of this plugin to access user's mails through ViewCustomize.context.user ?

Thanks by advance.

PS : working on redmine 5.0.5

Not working at Redmine 4.1.1 (Bitnami) with undeinfed method before_filter error

Hello. I am really helped by this plugin ;)

I am trying to install a new Redmine with Bitnami latest version, but I got an error.
I got the error message at apache/error_log.

Error

App 55766 output: Error: The application encountered the following error: undefined method `before_filter' for ViewCustomizesController:Class
App 55766 output: Did you mean?  before_action (NoMethodError)
App 55766 output:     /opt/redmine-4.1.1-6/apps/redmine/htdocs/plugins/view_customize/app/controllers/view_customizes_controller.rb:4:in `<class:ViewCustomizesController>'
/2.5.0/gems/railties-5.2.4.2/lib/rails/initializable.rb:61:in `block in run_initializers'
/2.5.0/gems/railties-5.2.4.2/lib/rails/initializable.rb:32:in `run'
/2.5.0/gems/railties-5.2.4.2/lib/rails/initializable.rb:32:in `instance_exec'
/2.5.0/gems/railties-5.2.4.2/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>'
/2.5.0/gems/railties-5.2.4.2/lib/rails/application/finisher.rb:69:in `each'
/2.5.0/gems/railties-5.2.4.2/lib/rails/engine.rb:356:in `eager_load!'
/2.5.0/gems/railties-5.2.4.2/lib/rails/engine.rb:475:in `eager_load!'
/2.5.0/gems/railties-5.2.4.2/lib/rails/engine.rb:475:in `each'
/2.5.0/gems/railties-5.2.4.2/lib/rails/engine.rb:477:in `block in eager_load!'
/2.5.0/gems/railties-5.2.4.2/lib/rails/engine.rb:477:in `each'
/2.5.0/gems/railties-5.2.4.2/lib/rails/engine.rb:478:in `block (2 levels) in eager_load!'
/2.5.0/gems/activesupport-5.2.4.2/lib/active_support/dependencies.rb:246:in `require_dependency'

Versions

I am using Bitnami.

https://bitnami.com/stack/redmine/README.txt

  • Redmine 4.1.1
  • Apache 2.4.46
  • ImageMagick 6.9.8
  • MySQL 5.7.32
  • Subversion 1.14.0
  • Git 2.29.2
  • Ruby 2.5.8
  • Rails 5.0.7.2
  • RubyGems 2.7.9

May I fix it?

Thank you.

View Customize Script Not Working

Hello,
I am trying to get my view customize script to work. I have two custom fields in redmine. They are Product Family and Product. Product Family has 3 possible values. They are Lattice Public Site, NetVisit, and Nexus.
When Lattice Public Site is selected I only want to see PubSite, View&Agree and PREA displayed in the Product custom field... this works. When NetVisit is selected I only want to see Pin Acct, SchedulePage, and Scheduler displayed in the Product custom field.... this does not work. When Nexus is selected, I only want to see SPCHSRVR, NexMblSvc, and NEX displayed in the Product custom field.... this does not work. Can someone please help me with this? Here is my script:

$(function() {

  var parentFieldId = 'issue_custom_field_values_24';
  var childFieldId = 'issue_custom_field_values_2';

  var isTarget = function(child, parent) {
    var childText = child.text();
    var NexusChild = (childText == 'SPCHSRVR' || childText == 'NexMblSvc' || childText == 'NEX');
    var NetVisitChild = (childText == 'Pin Acct' || childText == 'SchedulePage' || childText == 'Scheduler');
    var LPSChild = (childText == 'PubSite' || childText == 'View&Agree' || childText == 'PREA');

    if (parent.text() == 'NEXUS') {
      return NexusChild;
    } else {
      return !NexusChild;
    }

    if (parent.text() == 'NetVisit') {
      return NetVisitChild;
    } else {
      return !NetVisitChild;
    }

    if (parent.text() == 'Lattice Public Site') {
      return LPSChild;
    } else {
      return !LPSChild;
    }

  }

  var narrowChildField = function() {

    var parentSelected = $('#' + parentFieldId + ' > option:selected');

    $('#' + childFieldId + ' > option').each(function() {

      var child = $(this);

      if (isTarget(child, parentSelected)) {
        child.show();
        child.prop('disabled', false);
      } else {
        child.hide();
        child.prop('disabled', true);
      }
    });
  }

  narrowChildField();

  $('#all_attributes').change(function(e) {
    if (e.target.id == parentFieldId) {
      narrowChildField();
    }
  });

  var _replaceIssueFormWith = replaceIssueFormWith;
  replaceIssueFormWith = function(html){

    _replaceIssueFormWith(html);

    narrowChildField();
  };
});

Spent time fields on new issue page

Hi, would it be possible to use your plugin to insert the spent time form at the bottom of the "new issue" form? That would be very useful for tickets that are created after the task has been executed.

Thanks in advance for your help!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.