redmine_nonproject_modules 0.6.6 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2d790972272b2b8c6a971fe7bf0eca39098dedfe966ad68a4109e08748139167
4
- data.tar.gz: 9494ba0b7dc6753814b0c481a658eddb9deec72afd939851a38d6a22dde61701
3
+ metadata.gz: b578f9886ba944b5507eb94fa886a97903269922e734ae7a4eac06d4ec95b6e9
4
+ data.tar.gz: '01980a59523754315fc44ed81f4b297d0e472e293c648eb4db94a6bcb8bc16c3'
5
5
  SHA512:
6
- metadata.gz: 443a9c176478a3a8510fb8f8ab59ab89cd8aab92eccd73ee381396b78683611fee765eb00b1068b192608cd390ef429beea8b890119e47ef753fdca104d45f9c
7
- data.tar.gz: da12714137472c2cdb87358688ebad297beeeaa38a6005a6ccb21d1cde356446cbab6ac3dbdac11e9d98c4e1f694d4a8957212dd54b3c2db322af798d4d5ca50
6
+ metadata.gz: c1492e3eb27f409e441622dca6a080931f3a46c0dc3a61b7a669ca045d511cde1310ef145b067dd9dbb6645a3dad627f91724ae18760e5e37a407cef2457530f
7
+ data.tar.gz: aba2145b207daff87082f859de51445a8b87059c284c046ab367f3452791bfaae2f646c24950309e2d31db68c290551e84a3c31f520497b63238bc48e83159f6
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RedmineNonprojectModules
4
+ class MenuPluginSettingsEntry
5
+ NAME = :plugin_settings
6
+
7
+ # @!method initialize(plugin, options = {})
8
+ # @param plugin [Redmine::Plugin]
9
+ # @param options [Hash]
10
+ # @raise [ArgumentError]
11
+ common_constructor :plugin, :options, default: [{}] do
12
+ raise ArgumentError, "Plugin \"#{plugin.id}\" is not configurable" unless
13
+ plugin.configurable?
14
+ end
15
+
16
+ # @return [Array(Symbol, Hash, Hash)]
17
+ def build
18
+ [NAME, build_url, build_options]
19
+ end
20
+
21
+ private
22
+
23
+ # @return [Hash]
24
+ def build_url
25
+ { controller: 'settings', action: 'plugin', id: plugin.id.to_s }
26
+ end
27
+
28
+ # @return [Hash]
29
+ def build_options
30
+ {
31
+ caption: :label_settings, icon: 'settings', html: { class: 'icon icon-settings' },
32
+ if: proc { User.current.admin? }
33
+ }.merge(options)
34
+ end
35
+ end
36
+ end
@@ -11,6 +11,18 @@ module RedmineNonprojectModules
11
11
  ::GroupPermission.add_permission(p)
12
12
  end
13
13
  end
14
+
15
+ # @param plugin_id [Symbol]
16
+ # @param options [Hash]
17
+ # @return [void]
18
+ # @raise [Redmine::PluginNotFound]
19
+ # @raise [ArgumentError]
20
+ def push_plugin_settings(plugin_id = menu, options = {})
21
+ push(
22
+ *::RedmineNonprojectModules::MenuPluginSettingsEntry
23
+ .new(::Redmine::Plugin.find(plugin_id), options).build
24
+ )
25
+ end
14
26
  end
15
27
  end
16
28
  end
@@ -4,7 +4,7 @@ module RedmineNonprojectModules
4
4
  AUTHOR = 'Eduardo Henrique Bogoni'
5
5
  HOMEPAGE = 'https://github.com/esquilo-azul/redmine_nonproject_modules'
6
6
  SUMMARY = 'Support to non-project modules.'
7
- VERSION = '0.6.6'
7
+ VERSION = '0.7.0'
8
8
 
9
9
  module Version
10
10
  end
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redmine_nonproject_modules
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.6
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
- - 0.6.6
7
+ - 0.7.0
8
8
  bindir: bin
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
@@ -43,20 +43,14 @@ dependencies:
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '0.134'
47
- - - ">="
48
- - !ruby/object:Gem::Version
49
- version: 0.134.1
46
+ version: '0.135'
50
47
  type: :runtime
51
48
  prerelease: false
52
49
  version_requirements: !ruby/object:Gem::Requirement
53
50
  requirements:
54
51
  - - "~>"
55
52
  - !ruby/object:Gem::Version
56
- version: '0.134'
57
- - - ">="
58
- - !ruby/object:Gem::Version
59
- version: 0.134.1
53
+ version: '0.135'
60
54
  - !ruby/object:Gem::Dependency
61
55
  name: jquery-rails
62
56
  requirement: !ruby/object:Gem::Requirement
@@ -86,7 +80,7 @@ dependencies:
86
80
  version: '0.15'
87
81
  - - ">="
88
82
  - !ruby/object:Gem::Version
89
- version: 0.15.2
83
+ version: 0.15.3
90
84
  type: :development
91
85
  prerelease: false
92
86
  version_requirements: !ruby/object:Gem::Requirement
@@ -96,7 +90,7 @@ dependencies:
96
90
  version: '0.15'
97
91
  - - ">="
98
92
  - !ruby/object:Gem::Version
99
- version: 0.15.2
93
+ version: 0.15.3
100
94
  executables: []
101
95
  extensions: []
102
96
  extra_rdoc_files: []
@@ -130,6 +124,7 @@ files:
130
124
  - lib/redmine_nonproject_modules.rb
131
125
  - lib/redmine_nonproject_modules/dispatcher_finder.rb
132
126
  - lib/redmine_nonproject_modules/menu_controller_entry.rb
127
+ - lib/redmine_nonproject_modules/menu_plugin_settings_entry.rb
133
128
  - lib/redmine_nonproject_modules/patches/active_scaffold_js_response.rb
134
129
  - lib/redmine_nonproject_modules/patches/controller_patch.rb
135
130
  - lib/redmine_nonproject_modules/patches/group_patch.rb