foreman_leapp 4.1.2 → 4.2.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 +4 -4
- data/app/assets/javascripts/foreman_leapp/locale/de/foreman_leapp.js +36 -3
- data/app/assets/javascripts/foreman_leapp/locale/en/foreman_leapp.js +36 -3
- data/app/assets/javascripts/foreman_leapp/locale/fr/foreman_leapp.js +37 -4
- data/app/assets/javascripts/foreman_leapp/locale/ja/foreman_leapp.js +37 -4
- data/app/assets/javascripts/foreman_leapp/locale/ka/foreman_leapp.js +40 -7
- data/app/assets/javascripts/foreman_leapp/locale/ko/foreman_leapp.js +38 -5
- data/app/assets/javascripts/foreman_leapp/locale/zh_CN/foreman_leapp.js +37 -4
- data/app/lib/actions/foreman_leapp/preupgrade_job.rb +1 -2
- data/app/lib/helpers/job_helper.rb +8 -0
- data/app/views/api/v2/job_invocations/leapp_preupgrade_report.json.rabl +3 -0
- data/lib/foreman_leapp/engine.rb +4 -2
- data/lib/foreman_leapp/version.rb +1 -1
- data/locale/de/LC_MESSAGES/foreman_leapp.mo +0 -0
- data/locale/de/foreman_leapp.po +36 -3
- data/locale/en/LC_MESSAGES/foreman_leapp.mo +0 -0
- data/locale/en/foreman_leapp.po +36 -3
- data/locale/foreman_leapp.pot +66 -18
- data/locale/fr/LC_MESSAGES/foreman_leapp.mo +0 -0
- data/locale/fr/foreman_leapp.po +37 -4
- data/locale/ja/LC_MESSAGES/foreman_leapp.mo +0 -0
- data/locale/ja/foreman_leapp.po +37 -4
- data/locale/ka/LC_MESSAGES/foreman_leapp.mo +0 -0
- data/locale/ka/foreman_leapp.po +41 -8
- data/locale/ko/LC_MESSAGES/foreman_leapp.mo +0 -0
- data/locale/ko/foreman_leapp.po +40 -6
- data/locale/zh_CN/LC_MESSAGES/foreman_leapp.mo +0 -0
- data/locale/zh_CN/foreman_leapp.po +37 -4
- data/test/functional/api/v2/job_invocations_controller_test.rb +39 -0
- data/test/unit/helpers/job_helper_test.rb +20 -0
- data/webpack/components/PreupgradeReportsTable/PreupgradeReportsTableHelpers.js +1 -1
- data/webpack/components/PreupgradeReportsTable/__tests__/PreupgradeReportsTable.test.js +90 -2
- data/webpack/components/PreupgradeReportsTable/index.js +3 -3
- metadata +6 -3
data/locale/ka/foreman_leapp.po
CHANGED
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
|
5
5
|
#
|
|
6
6
|
# Translators:
|
|
7
|
-
# Temuri Doghonadze <temuri.doghonadze@gmail.com>,
|
|
7
|
+
# Temuri Doghonadze <temuri.doghonadze@gmail.com>, 2026
|
|
8
8
|
#
|
|
9
9
|
msgid ""
|
|
10
10
|
msgstr ""
|
|
11
|
-
"Project-Id-Version: foreman_leapp
|
|
11
|
+
"Project-Id-Version: foreman_leapp 4.1.2\n"
|
|
12
12
|
"Report-Msgid-Bugs-To: \n"
|
|
13
13
|
"PO-Revision-Date: 2022-10-12 12:00+0000\n"
|
|
14
|
-
"Last-Translator: Temuri Doghonadze <temuri.doghonadze@gmail.com>,
|
|
14
|
+
"Last-Translator: Temuri Doghonadze <temuri.doghonadze@gmail.com>, 2026\n"
|
|
15
15
|
"Language-Team: Georgian (https://app.transifex.com/foreman/teams/114/ka/)\n"
|
|
16
16
|
"MIME-Version: 1.0\n"
|
|
17
17
|
"Content-Type: text/plain; charset=UTF-8\n"
|
|
@@ -25,11 +25,17 @@ msgstr "Foreman-ის დამატება RHEL-ის Leapp-ით ად
|
|
|
25
25
|
msgid "All"
|
|
26
26
|
msgstr "ყველა"
|
|
27
27
|
|
|
28
|
+
msgid "An unexpected error occurred while creating the remediation job."
|
|
29
|
+
msgstr ""
|
|
30
|
+
|
|
31
|
+
msgid "Array of excluded entry IDs"
|
|
32
|
+
msgstr ""
|
|
33
|
+
|
|
28
34
|
msgid "Command"
|
|
29
35
|
msgstr "ბრძანება"
|
|
30
36
|
|
|
31
37
|
msgid "Could not retrieve data: %(status)s - %(msg)s"
|
|
32
|
-
msgstr ""
|
|
38
|
+
msgstr "მონაცემების მიღების შეცდომა: %(status)s - %(msg)s"
|
|
33
39
|
|
|
34
40
|
msgid "Failed to fetch preupgrade reports from server."
|
|
35
41
|
msgstr "სერვერიდან განახლებისწინა ანგარიშების გამოთხოვის შეცდომა."
|
|
@@ -58,6 +64,9 @@ msgstr "მინიშნება"
|
|
|
58
64
|
msgid "Host"
|
|
59
65
|
msgstr "ჰოსტი"
|
|
60
66
|
|
|
67
|
+
msgid "ID of the preupgrade report"
|
|
68
|
+
msgstr ""
|
|
69
|
+
|
|
61
70
|
msgid "Info"
|
|
62
71
|
msgstr "ინფორმაცია"
|
|
63
72
|
|
|
@@ -79,6 +88,12 @@ msgstr "განახლებისწინა ანგარიშებ
|
|
|
79
88
|
msgid "List Preupgrade reports for Job invocation"
|
|
80
89
|
msgstr "განახლებისწინა ანგარიშების სია დავალების ჩასაწოდებლად"
|
|
81
90
|
|
|
91
|
+
msgid "List all preupgrade report entries"
|
|
92
|
+
msgstr ""
|
|
93
|
+
|
|
94
|
+
msgid "List entries for a specific preupgrade report"
|
|
95
|
+
msgstr ""
|
|
96
|
+
|
|
82
97
|
msgid "Low"
|
|
83
98
|
msgstr "დაბალი"
|
|
84
99
|
|
|
@@ -100,12 +115,15 @@ msgstr "არა"
|
|
|
100
115
|
msgid "No Preupgrade Report Available"
|
|
101
116
|
msgstr "განახლებისწინა ანგარიში ხელმისაწვდომი არაა"
|
|
102
117
|
|
|
103
|
-
msgid "
|
|
104
|
-
msgstr "
|
|
118
|
+
msgid "No fixable entries found matching the selection."
|
|
119
|
+
msgstr ""
|
|
105
120
|
|
|
106
|
-
msgid "
|
|
121
|
+
msgid "No results found for your search."
|
|
107
122
|
msgstr ""
|
|
108
123
|
|
|
124
|
+
msgid "Preupgrade check with Leapp"
|
|
125
|
+
msgstr "განახლებისწინა შემოწმება Leapp-ით"
|
|
126
|
+
|
|
109
127
|
msgid "Remediation plan"
|
|
110
128
|
msgstr "გაუქმების გეგმა"
|
|
111
129
|
|
|
@@ -121,6 +139,12 @@ msgstr "გაუქმების გეგმის Leapp-ით გაშვ
|
|
|
121
139
|
msgid "Run Upgrade"
|
|
122
140
|
msgstr "განახლების გაშვება"
|
|
123
141
|
|
|
142
|
+
msgid "Search autocomplete for preupgrade report entries"
|
|
143
|
+
msgstr ""
|
|
144
|
+
|
|
145
|
+
msgid "Search string"
|
|
146
|
+
msgstr ""
|
|
147
|
+
|
|
124
148
|
msgid "Show Preupgrade report"
|
|
125
149
|
msgstr "განახლებისწინა ანგარიშის ჩვენება"
|
|
126
150
|
|
|
@@ -134,7 +158,7 @@ msgid "The preupgrade report could not be generated, check the job details for t
|
|
|
134
158
|
msgstr "განახლებამდელი ანგარიშის შექმნის შეცდომა. მიზეზისთვის იხილეთ დავალების დეტალები"
|
|
135
159
|
|
|
136
160
|
msgid "The preupgrade report shows no issues."
|
|
137
|
-
msgstr ""
|
|
161
|
+
msgstr "განახლებისწინა ანგარიშს პრობლემებს არ აჩვენებს."
|
|
138
162
|
|
|
139
163
|
msgid "The preupgrade report will be available after the job finishes"
|
|
140
164
|
msgstr "განახლებისწინა ანგარიში დავალების დასრულების შემდეგ იქნება ხელმისაწვდომი"
|
|
@@ -145,6 +169,15 @@ msgstr "ეს პრობლემა აჩერებს განახლ
|
|
|
145
169
|
msgid "Title"
|
|
146
170
|
msgstr "სათაური"
|
|
147
171
|
|
|
172
|
+
msgid "Trigger a remediation job for selected preupgrade report entries"
|
|
173
|
+
msgstr ""
|
|
174
|
+
|
|
175
|
+
msgid "Unknown fix_type value '%s' for search_fix_type"
|
|
176
|
+
msgstr ""
|
|
177
|
+
|
|
178
|
+
msgid "Unknown search key '%s' for search_yes_no_fields"
|
|
179
|
+
msgstr ""
|
|
180
|
+
|
|
148
181
|
msgid "Upgrade with Leapp"
|
|
149
182
|
msgstr "Leapp-ით განახლება"
|
|
150
183
|
|
|
Binary file
|
data/locale/ko/foreman_leapp.po
CHANGED
|
@@ -6,15 +6,16 @@
|
|
|
6
6
|
# Translators:
|
|
7
7
|
# 0868a4d1af5275b3f70b0a6dac4c99a4, 2022
|
|
8
8
|
# Bryan Kearney <bryan.kearney@gmail.com>, 2022
|
|
9
|
-
# Ewoud Kohl van Wijngaarden <ewoud+transifex@kohlvanwijngaarden.nl>, 2025
|
|
10
9
|
# Ondřej Gajdušek, 2026
|
|
10
|
+
# Ewoud Kohl van Wijngaarden <ewoud+transifex@kohlvanwijngaarden.nl>, 2026
|
|
11
11
|
#
|
|
12
12
|
msgid ""
|
|
13
13
|
msgstr ""
|
|
14
|
-
"Project-Id-Version: foreman_leapp
|
|
14
|
+
"Project-Id-Version: foreman_leapp 4.1.2\n"
|
|
15
15
|
"Report-Msgid-Bugs-To: \n"
|
|
16
16
|
"PO-Revision-Date: 2022-10-12 12:00+0000\n"
|
|
17
|
-
"Last-Translator:
|
|
17
|
+
"Last-Translator: Ewoud Kohl van Wijngaarden <ewoud+transifex@kohlvanwijngaarde"
|
|
18
|
+
"n.nl>, 2026\n"
|
|
18
19
|
"Language-Team: Korean (https://app.transifex.com/foreman/teams/114/ko/)\n"
|
|
19
20
|
"MIME-Version: 1.0\n"
|
|
20
21
|
"Content-Type: text/plain; charset=UTF-8\n"
|
|
@@ -28,6 +29,12 @@ msgstr "Leapp 유틸리티를 사용하여 기존 RHEL 업그레이드를 지원
|
|
|
28
29
|
msgid "All"
|
|
29
30
|
msgstr "모두"
|
|
30
31
|
|
|
32
|
+
msgid "An unexpected error occurred while creating the remediation job."
|
|
33
|
+
msgstr ""
|
|
34
|
+
|
|
35
|
+
msgid "Array of excluded entry IDs"
|
|
36
|
+
msgstr ""
|
|
37
|
+
|
|
31
38
|
msgid "Command"
|
|
32
39
|
msgstr "명령어"
|
|
33
40
|
|
|
@@ -61,6 +68,9 @@ msgstr "힌트"
|
|
|
61
68
|
msgid "Host"
|
|
62
69
|
msgstr "호스트 "
|
|
63
70
|
|
|
71
|
+
msgid "ID of the preupgrade report"
|
|
72
|
+
msgstr ""
|
|
73
|
+
|
|
64
74
|
msgid "Info"
|
|
65
75
|
msgstr "정보 "
|
|
66
76
|
|
|
@@ -82,6 +92,12 @@ msgstr "사전 업그레이드 보고서 목록"
|
|
|
82
92
|
msgid "List Preupgrade reports for Job invocation"
|
|
83
93
|
msgstr "작업 호출을 위한 사전 업그레이드 보고서 목록"
|
|
84
94
|
|
|
95
|
+
msgid "List all preupgrade report entries"
|
|
96
|
+
msgstr ""
|
|
97
|
+
|
|
98
|
+
msgid "List entries for a specific preupgrade report"
|
|
99
|
+
msgstr ""
|
|
100
|
+
|
|
85
101
|
msgid "Low"
|
|
86
102
|
msgstr "낮음"
|
|
87
103
|
|
|
@@ -103,12 +119,15 @@ msgstr "아니오 "
|
|
|
103
119
|
msgid "No Preupgrade Report Available"
|
|
104
120
|
msgstr "사전 업그레이드 보고서가 없습니다"
|
|
105
121
|
|
|
106
|
-
msgid "
|
|
107
|
-
msgstr "
|
|
122
|
+
msgid "No fixable entries found matching the selection."
|
|
123
|
+
msgstr ""
|
|
108
124
|
|
|
109
|
-
msgid "
|
|
125
|
+
msgid "No results found for your search."
|
|
110
126
|
msgstr ""
|
|
111
127
|
|
|
128
|
+
msgid "Preupgrade check with Leapp"
|
|
129
|
+
msgstr "Leapp으로 업그레이드 전 확인"
|
|
130
|
+
|
|
112
131
|
msgid "Remediation plan"
|
|
113
132
|
msgstr "수정 계획"
|
|
114
133
|
|
|
@@ -124,6 +143,12 @@ msgstr "Leapp으로 수정 계획 실행"
|
|
|
124
143
|
msgid "Run Upgrade"
|
|
125
144
|
msgstr "업그레이드 실행"
|
|
126
145
|
|
|
146
|
+
msgid "Search autocomplete for preupgrade report entries"
|
|
147
|
+
msgstr ""
|
|
148
|
+
|
|
149
|
+
msgid "Search string"
|
|
150
|
+
msgstr ""
|
|
151
|
+
|
|
127
152
|
msgid "Show Preupgrade report"
|
|
128
153
|
msgstr "사전 업그레이드 보고서 표시"
|
|
129
154
|
|
|
@@ -148,6 +173,15 @@ msgstr "이 문제로 인해 업그레이드가 불가능합니다."
|
|
|
148
173
|
msgid "Title"
|
|
149
174
|
msgstr "제목"
|
|
150
175
|
|
|
176
|
+
msgid "Trigger a remediation job for selected preupgrade report entries"
|
|
177
|
+
msgstr ""
|
|
178
|
+
|
|
179
|
+
msgid "Unknown fix_type value '%s' for search_fix_type"
|
|
180
|
+
msgstr ""
|
|
181
|
+
|
|
182
|
+
msgid "Unknown search key '%s' for search_yes_no_fields"
|
|
183
|
+
msgstr ""
|
|
184
|
+
|
|
151
185
|
msgid "Upgrade with Leapp"
|
|
152
186
|
msgstr "Leapp으로 업그레이드"
|
|
153
187
|
|
|
Binary file
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
#
|
|
12
12
|
msgid ""
|
|
13
13
|
msgstr ""
|
|
14
|
-
"Project-Id-Version: foreman_leapp
|
|
14
|
+
"Project-Id-Version: foreman_leapp 4.1.2\n"
|
|
15
15
|
"Report-Msgid-Bugs-To: \n"
|
|
16
16
|
"PO-Revision-Date: 2022-10-12 12:00+0000\n"
|
|
17
17
|
"Last-Translator: Ondřej Gajdušek, 2026\n"
|
|
@@ -29,6 +29,12 @@ msgstr "支持使用 Leapp 的 RHEL 原位升级的 Foreman 插件。"
|
|
|
29
29
|
msgid "All"
|
|
30
30
|
msgstr "全部"
|
|
31
31
|
|
|
32
|
+
msgid "An unexpected error occurred while creating the remediation job."
|
|
33
|
+
msgstr ""
|
|
34
|
+
|
|
35
|
+
msgid "Array of excluded entry IDs"
|
|
36
|
+
msgstr ""
|
|
37
|
+
|
|
32
38
|
msgid "Command"
|
|
33
39
|
msgstr "命令"
|
|
34
40
|
|
|
@@ -62,6 +68,9 @@ msgstr "提示"
|
|
|
62
68
|
msgid "Host"
|
|
63
69
|
msgstr "主机"
|
|
64
70
|
|
|
71
|
+
msgid "ID of the preupgrade report"
|
|
72
|
+
msgstr ""
|
|
73
|
+
|
|
65
74
|
msgid "Info"
|
|
66
75
|
msgstr "Info"
|
|
67
76
|
|
|
@@ -83,6 +92,12 @@ msgstr "列出预升级报告"
|
|
|
83
92
|
msgid "List Preupgrade reports for Job invocation"
|
|
84
93
|
msgstr "列出作业调用的预升级报告"
|
|
85
94
|
|
|
95
|
+
msgid "List all preupgrade report entries"
|
|
96
|
+
msgstr ""
|
|
97
|
+
|
|
98
|
+
msgid "List entries for a specific preupgrade report"
|
|
99
|
+
msgstr ""
|
|
100
|
+
|
|
86
101
|
msgid "Low"
|
|
87
102
|
msgstr "低"
|
|
88
103
|
|
|
@@ -104,12 +119,15 @@ msgstr "否"
|
|
|
104
119
|
msgid "No Preupgrade Report Available"
|
|
105
120
|
msgstr "没有可用的预升级报告"
|
|
106
121
|
|
|
107
|
-
msgid "
|
|
108
|
-
msgstr "
|
|
122
|
+
msgid "No fixable entries found matching the selection."
|
|
123
|
+
msgstr ""
|
|
109
124
|
|
|
110
|
-
msgid "
|
|
125
|
+
msgid "No results found for your search."
|
|
111
126
|
msgstr ""
|
|
112
127
|
|
|
128
|
+
msgid "Preupgrade check with Leapp"
|
|
129
|
+
msgstr "使用 Leapp 的预升级检查"
|
|
130
|
+
|
|
113
131
|
msgid "Remediation plan"
|
|
114
132
|
msgstr "补救计划"
|
|
115
133
|
|
|
@@ -125,6 +143,12 @@ msgstr "使用 Leapp 的运行补救计划"
|
|
|
125
143
|
msgid "Run Upgrade"
|
|
126
144
|
msgstr "运行升级"
|
|
127
145
|
|
|
146
|
+
msgid "Search autocomplete for preupgrade report entries"
|
|
147
|
+
msgstr ""
|
|
148
|
+
|
|
149
|
+
msgid "Search string"
|
|
150
|
+
msgstr ""
|
|
151
|
+
|
|
128
152
|
msgid "Show Preupgrade report"
|
|
129
153
|
msgstr "显示预升级报告"
|
|
130
154
|
|
|
@@ -149,6 +173,15 @@ msgstr "此问题会阻止升级。"
|
|
|
149
173
|
msgid "Title"
|
|
150
174
|
msgstr "提示"
|
|
151
175
|
|
|
176
|
+
msgid "Trigger a remediation job for selected preupgrade report entries"
|
|
177
|
+
msgstr ""
|
|
178
|
+
|
|
179
|
+
msgid "Unknown fix_type value '%s' for search_fix_type"
|
|
180
|
+
msgstr ""
|
|
181
|
+
|
|
182
|
+
msgid "Unknown search key '%s' for search_yes_no_fields"
|
|
183
|
+
msgstr ""
|
|
184
|
+
|
|
152
185
|
msgid "Upgrade with Leapp"
|
|
153
186
|
msgstr "使用 Leapp 升级"
|
|
154
187
|
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'test_plugin_helper'
|
|
4
|
+
|
|
5
|
+
module Api
|
|
6
|
+
module V2
|
|
7
|
+
class JobInvocationsControllerTest < ActionController::TestCase
|
|
8
|
+
tests Api::V2::JobInvocationsController
|
|
9
|
+
|
|
10
|
+
setup do
|
|
11
|
+
@template = FactoryBot.create(
|
|
12
|
+
:job_template,
|
|
13
|
+
template: 'echo 1',
|
|
14
|
+
job_category: 'Leapp',
|
|
15
|
+
provider_type: 'SSH',
|
|
16
|
+
name: 'Leapp remediation demo'
|
|
17
|
+
)
|
|
18
|
+
RemoteExecutionFeature.find_by(label: 'leapp_remediation_plan')
|
|
19
|
+
.update(job_template: @template)
|
|
20
|
+
|
|
21
|
+
@invocation = FactoryBot.create(:job_invocation, :with_template, :with_task)
|
|
22
|
+
@invocation.pattern_template_invocations.first.update!(template: @template)
|
|
23
|
+
@invocation.update!(job_category: @template.job_category)
|
|
24
|
+
|
|
25
|
+
@user = FactoryBot.create(:user, admin: false)
|
|
26
|
+
setup_user('view', 'job_invocations', nil, @user)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
test 'show includes has_leapp_report from JobHelper' do
|
|
30
|
+
get :show, params: { id: @invocation.id, include_hosts: false },
|
|
31
|
+
session: set_session_user(@user)
|
|
32
|
+
|
|
33
|
+
assert_response :success
|
|
34
|
+
body = JSON.parse(@response.body)
|
|
35
|
+
assert body['has_leapp_report']
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -17,6 +17,26 @@ module Helpers
|
|
|
17
17
|
FactoryBot.create(:template_invocation, template: job_template, job_invocation: job_invocation)
|
|
18
18
|
end
|
|
19
19
|
|
|
20
|
+
describe 'with_leapp_report' do
|
|
21
|
+
test 'returns true for leapp preupgrade feature on template' do
|
|
22
|
+
RemoteExecutionFeature.find_by(label: feature_label).update(job_template: job_template)
|
|
23
|
+
job_invocation.task.stubs(:input).returns({})
|
|
24
|
+
assert helper.with_leapp_report(job_invocation)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
test 'returns true for leapp remediation feature on template' do
|
|
28
|
+
remediation_label = 'leapp_remediation_plan'
|
|
29
|
+
RemoteExecutionFeature.find_by(label: remediation_label).update(job_template: job_template)
|
|
30
|
+
job_invocation.task.stubs(:input).returns({})
|
|
31
|
+
assert helper.with_leapp_report(job_invocation)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
test 'returns false when no leapp features apply' do
|
|
35
|
+
job_invocation.task.stubs(:input).returns({ 'job_features' => ['some_other_feature'] })
|
|
36
|
+
assert_not helper.with_leapp_report(job_invocation)
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
20
40
|
describe 'correct_feature?' do
|
|
21
41
|
test 'returns true when feature is listed in job_features' do
|
|
22
42
|
job_invocation.task.stubs(:input).returns({ 'job_features' => [feature_label] })
|
|
@@ -24,7 +24,7 @@ export const usePreupgradeTableState = (data, isExpanded) => {
|
|
|
24
24
|
const [expandedRowIds, setExpandedRowIds] = useState(new Set());
|
|
25
25
|
|
|
26
26
|
// eslint-disable-next-line camelcase
|
|
27
|
-
const isLeappJob = data?.
|
|
27
|
+
const isLeappJob = Boolean(data?.has_leapp_report);
|
|
28
28
|
// eslint-disable-next-line camelcase
|
|
29
29
|
const jobStatusLabel = data?.status_label;
|
|
30
30
|
|
|
@@ -49,7 +49,7 @@ const mockJobId = 42;
|
|
|
49
49
|
const mockReportId = 999;
|
|
50
50
|
const mockJobData = {
|
|
51
51
|
id: mockJobId,
|
|
52
|
-
|
|
52
|
+
has_leapp_report: true,
|
|
53
53
|
};
|
|
54
54
|
|
|
55
55
|
const mockEntries = Array.from({ length: 12 }, (_, i) => ({
|
|
@@ -132,12 +132,24 @@ describe('PreupgradeReportsTable', () => {
|
|
|
132
132
|
});
|
|
133
133
|
|
|
134
134
|
it('does not render anything for non-Leapp jobs', () => {
|
|
135
|
-
renderComponent({ id: 55,
|
|
135
|
+
renderComponent({ id: 55, has_leapp_report: false });
|
|
136
136
|
expect(
|
|
137
137
|
screen.queryByText('Leapp preupgrade report')
|
|
138
138
|
).not.toBeInTheDocument();
|
|
139
139
|
});
|
|
140
140
|
|
|
141
|
+
it('renders when has_leapp_report is true (e.g. remediation jobs)', async () => {
|
|
142
|
+
renderComponent({
|
|
143
|
+
id: mockJobId,
|
|
144
|
+
has_leapp_report: true,
|
|
145
|
+
});
|
|
146
|
+
expandSection();
|
|
147
|
+
await waitForTable();
|
|
148
|
+
expect(
|
|
149
|
+
screen.getByText('Report Entry 1', { selector: 'td' })
|
|
150
|
+
).toBeInTheDocument();
|
|
151
|
+
});
|
|
152
|
+
|
|
141
153
|
it('refetches when status_label transitions (e.g. Running → Succeeded)', async () => {
|
|
142
154
|
const store = configureStore({
|
|
143
155
|
reducer: mockReducer,
|
|
@@ -577,6 +589,82 @@ describe('PreupgradeReportsTable', () => {
|
|
|
577
589
|
);
|
|
578
590
|
});
|
|
579
591
|
|
|
592
|
+
it('keeps Fix Selected enabled on page 1 when select-all is active but fixable rows are only on later pages', async () => {
|
|
593
|
+
const entriesFixableOnLaterPages = mockEntries.map((entry, index) => {
|
|
594
|
+
if (index < 5) {
|
|
595
|
+
return {
|
|
596
|
+
...entry,
|
|
597
|
+
detail: {
|
|
598
|
+
...entry.detail,
|
|
599
|
+
remediations:
|
|
600
|
+
index === 1
|
|
601
|
+
? [{ type: 'hint', context: 'Manual fix only' }]
|
|
602
|
+
: null,
|
|
603
|
+
},
|
|
604
|
+
};
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
if (index === 5) {
|
|
608
|
+
return {
|
|
609
|
+
...entry,
|
|
610
|
+
detail: {
|
|
611
|
+
remediations: [{ type: 'command', context: ['echo', 'fix'] }],
|
|
612
|
+
},
|
|
613
|
+
};
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
return {
|
|
617
|
+
...entry,
|
|
618
|
+
detail: { ...entry.detail, remediations: null },
|
|
619
|
+
};
|
|
620
|
+
});
|
|
621
|
+
|
|
622
|
+
const fixableEntryCount = entriesFixableOnLaterPages.filter(entry =>
|
|
623
|
+
entry.detail?.remediations?.some(r => r.type === 'command')
|
|
624
|
+
).length;
|
|
625
|
+
|
|
626
|
+
APIActions.get.mockImplementation(({ key, handleSuccess, params }) => {
|
|
627
|
+
return () => {
|
|
628
|
+
if (key.includes('GET_LEAPP_REPORT_LIST')) {
|
|
629
|
+
handleSuccess({ results: [{ id: mockReportId }] });
|
|
630
|
+
}
|
|
631
|
+
if (key.includes('GET_LEAPP_REPORT_ENTRIES')) {
|
|
632
|
+
const page = Number(params?.page ?? 1);
|
|
633
|
+
const perPage = Number(params?.per_page ?? 5);
|
|
634
|
+
const start = (page - 1) * perPage;
|
|
635
|
+
const results = entriesFixableOnLaterPages.slice(start, start + perPage);
|
|
636
|
+
handleSuccess({
|
|
637
|
+
id: mockReportId,
|
|
638
|
+
results,
|
|
639
|
+
total: entriesFixableOnLaterPages.length,
|
|
640
|
+
subtotal: entriesFixableOnLaterPages.length,
|
|
641
|
+
});
|
|
642
|
+
}
|
|
643
|
+
if (key.includes('GET_FIXABLE_COUNT')) {
|
|
644
|
+
handleSuccess({
|
|
645
|
+
total: fixableEntryCount,
|
|
646
|
+
subtotal: fixableEntryCount,
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
return { type: 'MOCK_API_SUCCESS' };
|
|
650
|
+
};
|
|
651
|
+
});
|
|
652
|
+
|
|
653
|
+
renderComponent();
|
|
654
|
+
expandSection();
|
|
655
|
+
await waitFor(() =>
|
|
656
|
+
screen.getByText('Report Entry 1', { selector: 'td' })
|
|
657
|
+
);
|
|
658
|
+
|
|
659
|
+
fireEvent.click(screen.getByLabelText('Select all'));
|
|
660
|
+
|
|
661
|
+
await waitFor(() =>
|
|
662
|
+
expect(
|
|
663
|
+
screen.getByRole('button', { name: 'Fix Selected' })
|
|
664
|
+
).not.toBeDisabled()
|
|
665
|
+
);
|
|
666
|
+
});
|
|
667
|
+
|
|
580
668
|
it('fetches fixable count on demand when Select All is clicked', async () => {
|
|
581
669
|
let fixableCountFetched = false;
|
|
582
670
|
|
|
@@ -375,8 +375,8 @@ const PreupgradeReportsTable = ({ data = {} }) => {
|
|
|
375
375
|
status === STATUS.PENDING ||
|
|
376
376
|
isSubmitting ||
|
|
377
377
|
!hasAnySelection ||
|
|
378
|
-
//
|
|
379
|
-
(areAllRowsSelected() &&
|
|
378
|
+
// Global select-all with zero fixable entries in the report (not per-page)
|
|
379
|
+
(areAllRowsSelected() && fixableCount === 0);
|
|
380
380
|
|
|
381
381
|
const isRunUpgradeDisabled =
|
|
382
382
|
status === STATUS.PENDING ||
|
|
@@ -547,7 +547,7 @@ PreupgradeReportsTable.propTypes = {
|
|
|
547
547
|
data: PropTypes.shape({
|
|
548
548
|
id: PropTypes.number,
|
|
549
549
|
// eslint-disable-next-line camelcase
|
|
550
|
-
|
|
550
|
+
has_leapp_report: PropTypes.bool,
|
|
551
551
|
// eslint-disable-next-line camelcase
|
|
552
552
|
status_label: PropTypes.string,
|
|
553
553
|
targeting: PropTypes.shape({
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: foreman_leapp
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.
|
|
4
|
+
version: 4.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Foreman Leapp team
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-
|
|
10
|
+
date: 2026-10-05 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: foreman_remote_execution
|
|
@@ -65,6 +65,7 @@ files:
|
|
|
65
65
|
- app/models/concerns/foreman_leapp/job_invocation_extensions.rb
|
|
66
66
|
- app/models/preupgrade_report.rb
|
|
67
67
|
- app/models/preupgrade_report_entry.rb
|
|
68
|
+
- app/views/api/v2/job_invocations/leapp_preupgrade_report.json.rabl
|
|
68
69
|
- app/views/api/v2/preupgrade_report_entries/base.json.rabl
|
|
69
70
|
- app/views/api/v2/preupgrade_report_entries/index.json.rabl
|
|
70
71
|
- app/views/api/v2/preupgrade_reports/base.json.rabl
|
|
@@ -109,6 +110,7 @@ files:
|
|
|
109
110
|
- locale/zh_CN/foreman_leapp.po
|
|
110
111
|
- package.json
|
|
111
112
|
- test/factories/foreman_leapp_factories.rb
|
|
113
|
+
- test/functional/api/v2/job_invocations_controller_test.rb
|
|
112
114
|
- test/functional/api/v2/preupgrade_report_entries_controller_test.rb
|
|
113
115
|
- test/functional/api/v2/preupgrade_reports_controller_test.rb
|
|
114
116
|
- test/functional/preupgrade_reports_controller_test.rb
|
|
@@ -203,11 +205,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
203
205
|
- !ruby/object:Gem::Version
|
|
204
206
|
version: '0'
|
|
205
207
|
requirements: []
|
|
206
|
-
rubygems_version: 4.0.
|
|
208
|
+
rubygems_version: 4.0.20
|
|
207
209
|
specification_version: 4
|
|
208
210
|
summary: A Foreman plugin for Leapp utility.
|
|
209
211
|
test_files:
|
|
210
212
|
- test/factories/foreman_leapp_factories.rb
|
|
213
|
+
- test/functional/api/v2/job_invocations_controller_test.rb
|
|
211
214
|
- test/functional/api/v2/preupgrade_report_entries_controller_test.rb
|
|
212
215
|
- test/functional/api/v2/preupgrade_reports_controller_test.rb
|
|
213
216
|
- test/functional/preupgrade_reports_controller_test.rb
|