foreman_scc_manager 3.1.1 → 4.0.1

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.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -8
  3. data/app/assets/javascripts/foreman_scc_manager/locale/de/foreman_scc_manager.js +341 -341
  4. data/app/assets/javascripts/foreman_scc_manager/locale/el/foreman_scc_manager.js +288 -288
  5. data/app/assets/javascripts/foreman_scc_manager/locale/en/foreman_scc_manager.js +2 -582
  6. data/app/assets/javascripts/foreman_scc_manager/locale/fr/foreman_scc_manager.js +1 -1
  7. data/app/assets/javascripts/foreman_scc_manager/locale/ja/foreman_scc_manager.js +348 -348
  8. data/app/assets/javascripts/foreman_scc_manager/locale/ka/foreman_scc_manager.js +381 -381
  9. data/app/assets/javascripts/foreman_scc_manager/locale/ko/foreman_scc_manager.js +592 -0
  10. data/app/assets/javascripts/foreman_scc_manager/locale/zh_CN/foreman_scc_manager.js +346 -346
  11. data/app/models/concerns/recurring_logic_extensions.rb +4 -6
  12. data/lib/foreman_scc_manager/engine.rb +80 -83
  13. data/lib/foreman_scc_manager/version.rb +1 -1
  14. data/locale/Makefile +12 -2
  15. data/locale/de/LC_MESSAGES/foreman_scc_manager.mo +0 -0
  16. data/locale/de/foreman_scc_manager.po +101 -98
  17. data/locale/el/LC_MESSAGES/foreman_scc_manager.mo +0 -0
  18. data/locale/el/foreman_scc_manager.po +25 -24
  19. data/locale/en/foreman_scc_manager.po +0 -593
  20. data/locale/fr/LC_MESSAGES/foreman_scc_manager.mo +0 -0
  21. data/locale/fr/foreman_scc_manager.po +1 -1
  22. data/locale/ja/LC_MESSAGES/foreman_scc_manager.mo +0 -0
  23. data/locale/ja/foreman_scc_manager.po +94 -92
  24. data/locale/ka/LC_MESSAGES/foreman_scc_manager.mo +0 -0
  25. data/locale/ka/foreman_scc_manager.po +139 -133
  26. data/locale/ko/LC_MESSAGES/foreman_scc_manager.mo +0 -0
  27. data/locale/ko/foreman_scc_manager.po +600 -0
  28. data/locale/zh_CN/LC_MESSAGES/foreman_scc_manager.mo +0 -0
  29. data/locale/zh_CN/foreman_scc_manager.po +92 -91
  30. data/test/controllers/api/v2/scc_accounts_test.rb +5 -5
  31. data/test/features/sync_test.rb +3 -3
  32. data/test/lib/scc_manager_test.rb +64 -0
  33. data/test/test_plugin_helper.rb +4 -1
  34. metadata +23 -7
@@ -1,9 +1,7 @@
1
- module Concerns
2
- module RecurringLogicExtensions
3
- extend ActiveSupport::Concern
1
+ module RecurringLogicExtensions
2
+ extend ActiveSupport::Concern
4
3
 
5
- included do
6
- has_one :scc_account, :inverse_of => :foreman_tasks_recurring_logic, :class_name => 'SccAccount'
7
- end
4
+ included do
5
+ has_one :scc_account, :inverse_of => :foreman_tasks_recurring_logic, :class_name => 'SccAccount'
8
6
  end
9
7
  end
@@ -4,13 +4,8 @@ module ForemanSccManager
4
4
  class Engine < ::Rails::Engine
5
5
  engine_name 'foreman_scc_manager'
6
6
 
7
- config.autoload_paths += Dir["#{config.root}/app/controllers/concerns"]
8
- config.autoload_paths += Dir["#{config.root}/app/helpers/concerns"]
9
- config.autoload_paths += Dir["#{config.root}/app/models/concerns"]
10
- config.autoload_paths += Dir["#{config.root}/app/overrides"]
11
-
12
7
  config.to_prepare do
13
- ForemanTasks::RecurringLogic.include Concerns::RecurringLogicExtensions
8
+ ForemanTasks::RecurringLogic.include RecurringLogicExtensions
14
9
  end
15
10
 
16
11
  # Add any db migrations
@@ -20,84 +15,86 @@ module ForemanSccManager
20
15
  end
21
16
  end
22
17
 
23
- initializer 'foreman_scc_manager.register_plugin', :before => :finisher_hook do |_app|
24
- Foreman::Plugin.register :foreman_scc_manager do
25
- requires_foreman '>= 3.7'
26
- requires_foreman_plugin 'katello', '>= 3.16.0'
27
- register_gettext
28
-
29
- precompile_assets 'foreman_scc_manager/scc_accounts.js'
30
-
31
- apipie_documented_controllers ["#{ForemanSccManager::Engine.root}/app/controllers/api/v2/*.rb"]
32
-
33
- # Add permissions
34
- security_block :foreman_scc_manager do
35
- permission :view_scc_accounts,
36
- { :scc_accounts => [:show, :index, :auto_complete_search],
37
- :'api/v2/scc_accounts' => [:show, :index, :auto_complete_search] },
38
- :resource_type => 'SccAccount'
39
-
40
- permission :use_scc_accounts,
41
- { :scc_accounts => [:bulk_subscribe],
42
- :'api/v2/scc_accounts' => [:bulk_subscribe, :bulk_subscribe_with_repos] },
43
- :resource_type => 'SccAccount'
44
-
45
- permission :new_scc_accounts,
46
- { :scc_accounts => [:new, :create],
47
- :'api/v2/scc_accounts' => [:create] },
48
- :resource_type => 'SccAccount'
49
-
50
- permission :edit_scc_accounts,
51
- { :scc_accounts => [:edit, :update],
52
- :'api/v2/scc_accounts' => [:update] },
53
- :resource_type => 'SccAccount'
54
-
55
- permission :delete_scc_accounts,
56
- { :scc_accounts => [:destroy],
57
- :'api/v2/scc_accounts' => [:destroy] },
58
- :resource_type => 'SccAccount'
59
-
60
- permission :sync_scc_accounts,
61
- { :scc_accounts => [:sync],
62
- :'api/v2/scc_accounts' => [:sync] },
63
- :resource_type => 'SccAccount'
64
-
65
- permission :test_connection_scc_accounts,
66
- { :scc_accounts => [:test_connection],
67
- :'api/v2/scc_accounts' => [:test_connection] },
68
- :resource_type => 'SccAccount'
69
-
70
- permission :view_scc_products,
71
- { :scc_products => [:index, :show],
72
- :'api/v2/scc_products' => [:index, :show] },
73
- :resource_type => 'SccProduct'
74
-
75
- permission :subscribe_scc_products,
76
- { :scc_products => [:subscribe, :unsubscribe],
77
- :'api/v2/scc_products' => [:subscribe, :unsibscribe] },
78
- :resource_type => 'SccProduct'
18
+ initializer 'foreman_scc_manager.register_plugin', :before => :finisher_hook do |app|
19
+ app.reloader.to_prepare do
20
+ Foreman::Plugin.register :foreman_scc_manager do
21
+ requires_foreman '>= 3.13'
22
+ requires_foreman_plugin 'katello', '>= 3.16.0'
23
+ register_gettext
24
+
25
+ precompile_assets 'foreman_scc_manager/scc_accounts.js'
26
+
27
+ apipie_documented_controllers ["#{ForemanSccManager::Engine.root}/app/controllers/api/v2/*.rb"]
28
+
29
+ # Add permissions
30
+ security_block :foreman_scc_manager do
31
+ permission :view_scc_accounts,
32
+ { :scc_accounts => [:show, :index, :auto_complete_search],
33
+ :'api/v2/scc_accounts' => [:show, :index, :auto_complete_search] },
34
+ :resource_type => 'SccAccount'
35
+
36
+ permission :use_scc_accounts,
37
+ { :scc_accounts => [:bulk_subscribe],
38
+ :'api/v2/scc_accounts' => [:bulk_subscribe, :bulk_subscribe_with_repos] },
39
+ :resource_type => 'SccAccount'
40
+
41
+ permission :new_scc_accounts,
42
+ { :scc_accounts => [:new, :create],
43
+ :'api/v2/scc_accounts' => [:create] },
44
+ :resource_type => 'SccAccount'
45
+
46
+ permission :edit_scc_accounts,
47
+ { :scc_accounts => [:edit, :update],
48
+ :'api/v2/scc_accounts' => [:update] },
49
+ :resource_type => 'SccAccount'
50
+
51
+ permission :delete_scc_accounts,
52
+ { :scc_accounts => [:destroy],
53
+ :'api/v2/scc_accounts' => [:destroy] },
54
+ :resource_type => 'SccAccount'
55
+
56
+ permission :sync_scc_accounts,
57
+ { :scc_accounts => [:sync],
58
+ :'api/v2/scc_accounts' => [:sync] },
59
+ :resource_type => 'SccAccount'
60
+
61
+ permission :test_connection_scc_accounts,
62
+ { :scc_accounts => [:test_connection],
63
+ :'api/v2/scc_accounts' => [:test_connection] },
64
+ :resource_type => 'SccAccount'
65
+
66
+ permission :view_scc_products,
67
+ { :scc_products => [:index, :show],
68
+ :'api/v2/scc_products' => [:index, :show] },
69
+ :resource_type => 'SccProduct'
70
+
71
+ permission :subscribe_scc_products,
72
+ { :scc_products => [:subscribe, :unsubscribe],
73
+ :'api/v2/scc_products' => [:subscribe, :unsibscribe] },
74
+ :resource_type => 'SccProduct'
75
+ end
76
+
77
+ # Add a new role called 'SccManager' if it doesn't exist
78
+ role 'SccManager',
79
+ %i[view_scc_accounts use_scc_accounts new_scc_accounts edit_scc_accounts
80
+ delete_scc_accounts sync_scc_accounts test_connection_scc_accounts
81
+ view_scc_products subscribe_scc_products],
82
+ 'Role granting permissons to manage SUSE Subscriptions'
83
+
84
+ role 'SccViewer',
85
+ %i[view_scc_accounts use_scc_accounts sync_scc_accounts
86
+ create_products view_products subscribe_scc_products view_scc_products],
87
+ 'Role granting permissons to view and use SUSE Subscriptions'
88
+
89
+ add_all_permissions_to_default_roles
90
+
91
+ # add menu entry
92
+ menu :top_menu, :scc_manager,
93
+ url_hash: { controller: :scc_accounts, action: :index },
94
+ caption: _('SUSE Subscriptions'),
95
+ parent: :content_menu,
96
+ after: :red_hat_subscriptions
79
97
  end
80
-
81
- # Add a new role called 'SccManager' if it doesn't exist
82
- role 'SccManager',
83
- %i[view_scc_accounts use_scc_accounts new_scc_accounts edit_scc_accounts
84
- delete_scc_accounts sync_scc_accounts test_connection_scc_accounts
85
- view_scc_products subscribe_scc_products],
86
- 'Role granting permissons to manage SUSE Subscriptions'
87
-
88
- role 'SccViewer',
89
- %i[view_scc_accounts use_scc_accounts sync_scc_accounts
90
- create_products view_products subscribe_scc_products view_scc_products],
91
- 'Role granting permissons to view and use SUSE Subscriptions'
92
-
93
- add_all_permissions_to_default_roles
94
-
95
- # add menu entry
96
- menu :top_menu, :scc_manager,
97
- url_hash: { controller: :scc_accounts, action: :index },
98
- caption: _('SUSE Subscriptions'),
99
- parent: :content_menu,
100
- after: :red_hat_subscriptions
101
98
  end
102
99
  end
103
100
 
@@ -1,3 +1,3 @@
1
1
  module ForemanSccManager
2
- VERSION = '3.1.1'.freeze
2
+ VERSION = '4.0.1'.freeze
3
3
  end
data/locale/Makefile CHANGED
@@ -31,9 +31,16 @@ all-mo: $(MOFILES)
31
31
  cat $@
32
32
  ! grep -q msgid $@
33
33
 
34
- %.edit.po:
34
+ %.edit.po: %.po.time_stamp
35
35
  touch $@
36
36
 
37
+ # gettext will trash the .edit.po file if the time stamp doesn't exist or is older than the po file
38
+ %.po.time_stamp: %.po
39
+ touch --reference $< $@
40
+
41
+ # Prevent make from treating this as an intermediate file to be cleaned up
42
+ .PRECIOUS: %.po.time_stamp
43
+
37
44
  check: $(POXFILES)
38
45
 
39
46
  # Unify duplicate translations
@@ -43,7 +50,10 @@ uniq-po:
43
50
  done
44
51
 
45
52
  tx-pull: $(EDITFILES)
46
- cd .. && tx pull -f --all
53
+ # Initialize new languages
54
+ cd .. && tx pull -f --all --minimum-perc 50
55
+ # Force update all existing languages
56
+ cd .. && tx pull -f --minimum-perc 0
47
57
  for f in $(EDITFILES) ; do \
48
58
  sed -i 's/^\("Project-Id-Version: \).*$$/\1$(DOMAIN) $(VERSION)\\n"/' $$f; \
49
59
  done