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.
- checksums.yaml +4 -4
- data/README.md +4 -8
- data/app/assets/javascripts/foreman_scc_manager/locale/de/foreman_scc_manager.js +341 -341
- data/app/assets/javascripts/foreman_scc_manager/locale/el/foreman_scc_manager.js +288 -288
- data/app/assets/javascripts/foreman_scc_manager/locale/en/foreman_scc_manager.js +2 -582
- data/app/assets/javascripts/foreman_scc_manager/locale/fr/foreman_scc_manager.js +1 -1
- data/app/assets/javascripts/foreman_scc_manager/locale/ja/foreman_scc_manager.js +348 -348
- data/app/assets/javascripts/foreman_scc_manager/locale/ka/foreman_scc_manager.js +381 -381
- data/app/assets/javascripts/foreman_scc_manager/locale/ko/foreman_scc_manager.js +592 -0
- data/app/assets/javascripts/foreman_scc_manager/locale/zh_CN/foreman_scc_manager.js +346 -346
- data/app/models/concerns/recurring_logic_extensions.rb +4 -6
- data/lib/foreman_scc_manager/engine.rb +80 -83
- data/lib/foreman_scc_manager/version.rb +1 -1
- data/locale/Makefile +12 -2
- data/locale/de/LC_MESSAGES/foreman_scc_manager.mo +0 -0
- data/locale/de/foreman_scc_manager.po +101 -98
- data/locale/el/LC_MESSAGES/foreman_scc_manager.mo +0 -0
- data/locale/el/foreman_scc_manager.po +25 -24
- data/locale/en/foreman_scc_manager.po +0 -593
- data/locale/fr/LC_MESSAGES/foreman_scc_manager.mo +0 -0
- data/locale/fr/foreman_scc_manager.po +1 -1
- data/locale/ja/LC_MESSAGES/foreman_scc_manager.mo +0 -0
- data/locale/ja/foreman_scc_manager.po +94 -92
- data/locale/ka/LC_MESSAGES/foreman_scc_manager.mo +0 -0
- data/locale/ka/foreman_scc_manager.po +139 -133
- data/locale/ko/LC_MESSAGES/foreman_scc_manager.mo +0 -0
- data/locale/ko/foreman_scc_manager.po +600 -0
- data/locale/zh_CN/LC_MESSAGES/foreman_scc_manager.mo +0 -0
- data/locale/zh_CN/foreman_scc_manager.po +92 -91
- data/test/controllers/api/v2/scc_accounts_test.rb +5 -5
- data/test/features/sync_test.rb +3 -3
- data/test/lib/scc_manager_test.rb +64 -0
- data/test/test_plugin_helper.rb +4 -1
- metadata +23 -7
@@ -1,9 +1,7 @@
|
|
1
|
-
module
|
2
|
-
|
3
|
-
extend ActiveSupport::Concern
|
1
|
+
module RecurringLogicExtensions
|
2
|
+
extend ActiveSupport::Concern
|
4
3
|
|
5
|
-
|
6
|
-
|
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
|
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 |
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
:
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
:
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
:
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
:
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
:
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
:
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
:
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
:
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
:
|
78
|
-
|
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
|
|
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
|
-
|
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
|
Binary file
|