foreman_rh_cloud 12.2.10 → 13.0.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.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/foreman_rh_cloud/locale/fr/foreman_rh_cloud.js +17 -50
  3. data/app/assets/javascripts/foreman_rh_cloud/locale/ja/foreman_rh_cloud.js +17 -50
  4. data/app/assets/javascripts/foreman_rh_cloud/locale/ka/foreman_rh_cloud.js +16 -49
  5. data/app/assets/javascripts/foreman_rh_cloud/locale/ko/foreman_rh_cloud.js +17 -50
  6. data/app/assets/javascripts/foreman_rh_cloud/locale/zh_CN/foreman_rh_cloud.js +17 -50
  7. data/app/controllers/concerns/insights_cloud/package_profile_upload_extensions.rb +3 -2
  8. data/app/models/insights_hit.rb +1 -1
  9. data/app/services/foreman_rh_cloud/cert_auth.rb +3 -13
  10. data/app/services/foreman_rh_cloud/gateway_request.rb +26 -0
  11. data/app/services/foreman_rh_cloud/insights_api_forwarder.rb +1 -3
  12. data/app/services/foreman_rh_cloud/tags_auth.rb +1 -2
  13. data/lib/foreman_inventory_upload/async/generate_report_job.rb +8 -13
  14. data/lib/foreman_inventory_upload/async/queue_for_upload_job.rb +4 -4
  15. data/lib/foreman_inventory_upload/async/upload_report_job.rb +5 -6
  16. data/lib/foreman_inventory_upload/generators/fact_helpers.rb +2 -2
  17. data/lib/foreman_inventory_upload/generators/slice.rb +3 -3
  18. data/lib/foreman_inventory_upload/scripts/uploader.sh.erb +1 -7
  19. data/lib/foreman_rh_cloud/engine.rb +15 -33
  20. data/lib/foreman_rh_cloud/plugin.rb +9 -9
  21. data/lib/foreman_rh_cloud/version.rb +1 -1
  22. data/lib/tasks/rh_cloud_inventory.rake +31 -14
  23. data/locale/foreman_rh_cloud.pot +152 -219
  24. data/locale/fr/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
  25. data/locale/fr/foreman_rh_cloud.po +18 -50
  26. data/locale/ja/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
  27. data/locale/ja/foreman_rh_cloud.po +18 -50
  28. data/locale/ka/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
  29. data/locale/ka/foreman_rh_cloud.po +17 -49
  30. data/locale/ko/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
  31. data/locale/ko/foreman_rh_cloud.po +18 -50
  32. data/locale/zh_CN/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
  33. data/locale/zh_CN/foreman_rh_cloud.po +18 -50
  34. data/package.json +1 -1
  35. data/test/jobs/upload_report_job_test.rb +1 -2
  36. data/test/unit/fact_helpers_test.rb +0 -47
  37. data/test/unit/slice_generator_test.rb +0 -57
  38. data/webpack/ForemanRhCloudFills.js +2 -6
  39. data/webpack/ForemanRhCloudHelpers.js +0 -4
  40. data/webpack/InsightsHostDetailsTab/InsightsTab.scss +0 -4
  41. data/webpack/InsightsHostDetailsTab/InsightsTotalRiskChart.js +23 -59
  42. data/webpack/InsightsHostDetailsTab/NewHostDetailsTab.js +16 -3
  43. data/webpack/__tests__/ForemanRhCloudHelpers.test.js +1 -16
  44. data/webpack/__tests__/__snapshots__/ForemanRhCloudHelpers.test.js.snap +0 -6
  45. metadata +4 -10
  46. data/lib/foreman_inventory_upload/async/create_missing_insights_facets.rb +0 -29
  47. data/lib/foreman_inventory_upload/async/generate_host_report.rb +0 -20
  48. data/lib/foreman_inventory_upload/async/host_inventory_report_job.rb +0 -39
  49. data/lib/foreman_inventory_upload/async/single_host_report_job.rb +0 -20
  50. data/test/jobs/queue_for_upload_job_test.rb +0 -63
  51. data/webpack/InsightsHostDetailsTab/__tests__/InsightsTotalRiskChart.test.js +0 -194
@@ -9,6 +9,7 @@
9
9
  # 0868a4d1af5275b3f70b0a6dac4c99a4, 2023
10
10
  # Ewoud Kohl van Wijngaarden <ewoud+transifex@kohlvanwijngaarden.nl>, 2025
11
11
  #
12
+ #, fuzzy
12
13
  msgid ""
13
14
  msgstr ""
14
15
  "Project-Id-Version: foreman_rh_cloud 11.1.0\n"
@@ -41,9 +42,6 @@ msgstr "고급 인벤토리 설정"
41
42
  msgid "All recommendations are now selected."
42
43
  msgstr "모든 권장 사항이 선택되었습니다."
43
44
 
44
- msgid "Analytics data collection"
45
- msgstr ""
46
-
47
45
  msgid "Any Organization"
48
46
  msgstr "모든 조직 "
49
47
 
@@ -143,14 +141,17 @@ msgstr "인벤토리 업로드 활성화"
143
141
  msgid "Encountered an error while trying to access the server:"
144
142
  msgstr "서버에 접근하는 동안 오류가 발생했습니다:"
145
143
 
146
- msgid "Exclude installed packages"
147
- msgstr ""
144
+ msgid "Exclude installed Packages"
145
+ msgstr "설치된 패키지 제외"
148
146
 
149
147
  msgid "Exclude installed packages from being uploaded to the Red Hat cloud"
150
148
  msgstr "설치된 패키지가 Red Hat 클라우드에 업로드되는 것을 제외합니다."
151
149
 
152
- msgid "Exclude installed packages from being uploaded to the Red Hat cloud. (If insights_minimal_data_collection is set to true, this setting is ignored and installed packages are always excluded.)"
153
- msgstr ""
150
+ msgid "Exclude packages"
151
+ msgstr "패키지 제외"
152
+
153
+ msgid "Exclude packages from being uploaded to the Red Hat cloud"
154
+ msgstr "Red Hat 클라우드에 업로드되는 패키지 제외"
154
155
 
155
156
  msgid "Exit Code: %s"
156
157
  msgstr "종료 코드: %s"
@@ -185,9 +186,6 @@ msgstr "전체 화면"
185
186
  msgid "Generate and upload report"
186
187
  msgstr "보고서 생성 및 업로드"
187
188
 
188
- msgid "Generate report"
189
- msgstr ""
190
-
191
189
  msgid "Generate the report, but do not upload"
192
190
  msgstr "보고서를 생성하되 업로드하지 마십시오."
193
191
 
@@ -257,9 +255,6 @@ msgstr "페이지당 항목"
257
255
  msgid "Knowledgebase article"
258
256
  msgstr "지식베이스 문서"
259
257
 
260
- msgid "Learn more about {minimalDataCollectionSetting}."
261
- msgstr ""
262
-
263
258
  msgid "List of host UUIDs"
264
259
  msgstr "호스트 UUID 목록"
265
260
 
@@ -275,9 +270,6 @@ msgstr "낮음"
275
270
  msgid "Manual"
276
271
  msgstr "수동"
277
272
 
278
- msgid "Minimal data collection"
279
- msgstr ""
280
-
281
273
  msgid "Moderate"
282
274
  msgstr "중간 수준"
283
275
 
@@ -308,33 +300,21 @@ msgstr "동기화할 것이 없습니다. 이 조직에 대한 서브스크립
308
300
  msgid "Notice"
309
301
  msgstr "주의 "
310
302
 
303
+ msgid "Obfuscate IPs"
304
+ msgstr "IP 난독화"
305
+
311
306
  msgid "Obfuscate host ipv4 addresses"
312
307
  msgstr "호스트 ipv4 주소 난독화"
313
308
 
314
- msgid "Obfuscate host ipv4 addresses."
315
- msgstr ""
316
-
317
309
  msgid "Obfuscate host names"
318
310
  msgstr "호스트 이름 난독화"
319
311
 
320
312
  msgid "Obfuscate host names sent to the Red Hat cloud"
321
313
  msgstr "Red Hat 클라우드로 전송된 호스트 이름을 난독화합니다."
322
314
 
323
- msgid "Obfuscate host names sent to the Red Hat cloud. (If insights_minimal_data_collection is set to true, this setting is ignored because host names are not included in the report.)"
324
- msgstr ""
325
-
326
315
  msgid "Obfuscate ipv4 addresses sent to the Red Hat cloud"
327
316
  msgstr "Red Hat 클라우드로 전송된 ipv4 주소 난독화"
328
317
 
329
- msgid "Obfuscate ipv4 addresses sent to the Red Hat cloud. (If insights_minimal_data_collection is set to true, this setting is ignored because host IPv4 addresses are not included in the report.)"
330
- msgstr ""
331
-
332
- msgid "Only include the minimum required data in inventory reports for uploading to Red Hat cloud. When this is true, installed packages are excluded from the report regardless of the exclude_installed_packages setting, and host names and IPv4 addresses are excluded from the report regardless of obfuscation settings."
333
- msgstr ""
334
-
335
- msgid "Only send the minimum required data to Red Hat cloud, obfuscation settings are disabled"
336
- msgstr ""
337
-
338
318
  msgid "Oops! Couldn't find organization that matches your query"
339
319
  msgstr "죄송합니다! 귀하의 쿼리와 일치하는 조직을 찾을 수 없습니다."
340
320
 
@@ -353,6 +333,9 @@ msgstr "RH 클라우드"
353
333
  msgid "RHC daemon id"
354
334
  msgstr "RHC 데몬 ID"
355
335
 
336
+ msgid "RHCloud"
337
+ msgstr "RHCloud"
338
+
356
339
  msgid "Read more about it in RH cloud insights"
357
340
  msgstr "RH 클라우드 Insights에서 이에 대해 자세히 알아보세요."
358
341
 
@@ -410,8 +393,8 @@ msgstr "해결 방법"
410
393
  msgid "Run RH Cloud playbook"
411
394
  msgstr "RH Cloud playbook 실행"
412
395
 
413
- msgid "Run playbook generated by Red Hat remediations app"
414
- msgstr ""
396
+ msgid "Run playbook genrated by Red Hat remediations app"
397
+ msgstr "Red Hat Remediations 앱에서 생성된 playbook 실행"
415
398
 
416
399
  msgid "Run remediation playbook generated by Insights"
417
400
  msgstr "Insights에서 생성된 수정 playbook 실행"
@@ -425,9 +408,6 @@ msgstr "호스트 제거를 위한 범위 검색 문자열"
425
408
  msgid "Select recommendations from all pages"
426
409
  msgstr "모든 페이지에서 추천을 선택하세요"
427
410
 
428
- msgid "Send additional data to enhance Insights services, as per the settings"
429
- msgstr ""
430
-
431
411
  msgid "Set the current organization context for the request"
432
412
  msgstr "요청에 대한 현재 조직 컨텍스트 설정"
433
413
 
@@ -473,8 +453,8 @@ msgstr "Red Hat 하이브리드 클라우드 콘솔은 이 Foreman 인스턴스
473
453
  msgid "The report file %{filename} doesn't exist"
474
454
  msgstr "보고서 파일%{filename}이/가 존재하지 않습니다"
475
455
 
476
- msgid "The scheduled process is disabled because this Foreman is configured with a local IoP Smart Proxy."
477
- msgstr ""
456
+ msgid "The scheduled process is disabled because this Foreman is configured with the use_local_advisor_engine option."
457
+ msgstr "예약된 프로세스는 이 Foreman이 use_local_advisor_engine 옵션으로 구성되어 있기 때문에 비활성화되었습니다."
478
458
 
479
459
  msgid "The server returned the following error: %s"
480
460
  msgstr "서버에서 다음 오류가 반환되었습니다. %s"
@@ -494,9 +474,6 @@ msgstr "이 보고서를 모든 Foreman 조직에 대해 활성화하려면 {upl
494
474
  msgid "To manually upload the data for a specific organization, select an organization and click {restartButtonName}."
495
475
  msgstr "특정 조직에 대한 데이터를 수동으로 업로드하려면 조직을 선택하고 {restartButtonName}를 클릭하십시오."
496
476
 
497
- msgid "Total CVEs"
498
- msgstr ""
499
-
500
477
  msgid "Total risk"
501
478
  msgstr "총 위험"
502
479
 
@@ -524,12 +501,6 @@ msgstr "모든 권장 사항 보기"
524
501
  msgid "View in Red Hat Insights"
525
502
  msgstr "Red Hat Insights에서 보기"
526
503
 
527
- msgid "Vulnerabilities"
528
- msgstr ""
529
-
530
- msgid "Vulnerability"
531
- msgstr ""
532
-
533
504
  msgid "Wait and %s"
534
505
  msgstr "대기 및 %s"
535
506
 
@@ -596,9 +567,6 @@ msgstr "규칙 ID"
596
567
  msgid "rule title"
597
568
  msgstr "규칙 제목"
598
569
 
599
- msgid "setting minimal data collection"
600
- msgstr ""
601
-
602
570
  msgid "solution url"
603
571
  msgstr "솔루션 URL"
604
572
 
@@ -10,6 +10,7 @@
10
10
  # Amit Upadhye <aupadhye@redhat.com>, 2023
11
11
  # Ewoud Kohl van Wijngaarden <ewoud+transifex@kohlvanwijngaarden.nl>, 2025
12
12
  #
13
+ #, fuzzy
13
14
  msgid ""
14
15
  msgstr ""
15
16
  "Project-Id-Version: foreman_rh_cloud 11.1.0\n"
@@ -43,9 +44,6 @@ msgstr "高级清单设置"
43
44
  msgid "All recommendations are now selected."
44
45
  msgstr "现在选择了所有建议。"
45
46
 
46
- msgid "Analytics data collection"
47
- msgstr ""
48
-
49
47
  msgid "Any Organization"
50
48
  msgstr "任意机构"
51
49
 
@@ -145,14 +143,17 @@ msgstr "启用清单上传"
145
143
  msgid "Encountered an error while trying to access the server:"
146
144
  msgstr "在尝试访问服务器时遇到错误:"
147
145
 
148
- msgid "Exclude installed packages"
149
- msgstr ""
146
+ msgid "Exclude installed Packages"
147
+ msgstr "排除安装的软件包"
150
148
 
151
149
  msgid "Exclude installed packages from being uploaded to the Red Hat cloud"
152
150
  msgstr "将安装的软件包上传到红帽云"
153
151
 
154
- msgid "Exclude installed packages from being uploaded to the Red Hat cloud. (If insights_minimal_data_collection is set to true, this setting is ignored and installed packages are always excluded.)"
155
- msgstr ""
152
+ msgid "Exclude packages"
153
+ msgstr "排除软件包"
154
+
155
+ msgid "Exclude packages from being uploaded to the Red Hat cloud"
156
+ msgstr "排除软件包上传到红帽云"
156
157
 
157
158
  msgid "Exit Code: %s"
158
159
  msgstr "退出代码:%s"
@@ -187,9 +188,6 @@ msgstr "全屏"
187
188
  msgid "Generate and upload report"
188
189
  msgstr "生成并上传报告"
189
190
 
190
- msgid "Generate report"
191
- msgstr ""
192
-
193
191
  msgid "Generate the report, but do not upload"
194
192
  msgstr "生成报告,但不上传"
195
193
 
@@ -259,9 +257,6 @@ msgstr "每页的项"
259
257
  msgid "Knowledgebase article"
260
258
  msgstr "知识库文章"
261
259
 
262
- msgid "Learn more about {minimalDataCollectionSetting}."
263
- msgstr ""
264
-
265
260
  msgid "List of host UUIDs"
266
261
  msgstr "主机 UUID 列表"
267
262
 
@@ -277,9 +272,6 @@ msgstr "低"
277
272
  msgid "Manual"
278
273
  msgstr "手册"
279
274
 
280
- msgid "Minimal data collection"
281
- msgstr ""
282
-
283
275
  msgid "Moderate"
284
276
  msgstr "中等"
285
277
 
@@ -310,33 +302,21 @@ msgstr "没有同步,此机构没有带有订阅的主机。"
310
302
  msgid "Notice"
311
303
  msgstr "注意事項"
312
304
 
305
+ msgid "Obfuscate IPs"
306
+ msgstr "模糊 IP"
307
+
313
308
  msgid "Obfuscate host ipv4 addresses"
314
309
  msgstr "模糊的主机 ipv4 地址"
315
310
 
316
- msgid "Obfuscate host ipv4 addresses."
317
- msgstr ""
318
-
319
311
  msgid "Obfuscate host names"
320
312
  msgstr "模糊主机名"
321
313
 
322
314
  msgid "Obfuscate host names sent to the Red Hat cloud"
323
315
  msgstr "发送到红帽云的模糊主机名"
324
316
 
325
- msgid "Obfuscate host names sent to the Red Hat cloud. (If insights_minimal_data_collection is set to true, this setting is ignored because host names are not included in the report.)"
326
- msgstr ""
327
-
328
317
  msgid "Obfuscate ipv4 addresses sent to the Red Hat cloud"
329
318
  msgstr "发送到红帽云的模糊 ipv4 地址"
330
319
 
331
- msgid "Obfuscate ipv4 addresses sent to the Red Hat cloud. (If insights_minimal_data_collection is set to true, this setting is ignored because host IPv4 addresses are not included in the report.)"
332
- msgstr ""
333
-
334
- msgid "Only include the minimum required data in inventory reports for uploading to Red Hat cloud. When this is true, installed packages are excluded from the report regardless of the exclude_installed_packages setting, and host names and IPv4 addresses are excluded from the report regardless of obfuscation settings."
335
- msgstr ""
336
-
337
- msgid "Only send the minimum required data to Red Hat cloud, obfuscation settings are disabled"
338
- msgstr ""
339
-
340
320
  msgid "Oops! Couldn't find organization that matches your query"
341
321
  msgstr "未找到与您的查询匹配的机构"
342
322
 
@@ -355,6 +335,9 @@ msgstr "RH Cloud"
355
335
  msgid "RHC daemon id"
356
336
  msgstr "RHC 守护进程 ID"
357
337
 
338
+ msgid "RHCloud"
339
+ msgstr "RHCloud"
340
+
358
341
  msgid "Read more about it in RH cloud insights"
359
342
  msgstr "在 RH Cloud insights 中了解更多有关它的信息"
360
343
 
@@ -412,8 +395,8 @@ msgstr "解决方案"
412
395
  msgid "Run RH Cloud playbook"
413
396
  msgstr "运行 RH Cloud playbook"
414
397
 
415
- msgid "Run playbook generated by Red Hat remediations app"
416
- msgstr ""
398
+ msgid "Run playbook genrated by Red Hat remediations app"
399
+ msgstr "运行由红帽补救应用生成的 playbook"
417
400
 
418
401
  msgid "Run remediation playbook generated by Insights"
419
402
  msgstr "运行 Insights 生成的补救 playbook"
@@ -427,9 +410,6 @@ msgstr "用于删除主机的有范围的搜索字符串"
427
410
  msgid "Select recommendations from all pages"
428
411
  msgstr "在所有页面中选择建议"
429
412
 
430
- msgid "Send additional data to enhance Insights services, as per the settings"
431
- msgstr ""
432
-
433
413
  msgid "Set the current organization context for the request"
434
414
  msgstr "设置请求的当前机构上下文"
435
415
 
@@ -475,8 +455,8 @@ msgstr "Red Hat Hybrid Cloud Console 提供了一组云服务,包括 Red Hat I
475
455
  msgid "The report file %{filename} doesn't exist"
476
456
  msgstr "报告文件 %{filename} 不存在"
477
457
 
478
- msgid "The scheduled process is disabled because this Foreman is configured with a local IoP Smart Proxy."
479
- msgstr ""
458
+ msgid "The scheduled process is disabled because this Foreman is configured with the use_local_advisor_engine option."
459
+ msgstr "调度的进程被禁用,因为此 Foreman 配置了 use_local_advisor_engine 选项。"
480
460
 
481
461
  msgid "The server returned the following error: %s"
482
462
  msgstr "服务器返回以下错误:%s"
@@ -496,9 +476,6 @@ msgstr "要为所有 Foreman 机构启用此报告,请将 {uploadButtonName}
496
476
  msgid "To manually upload the data for a specific organization, select an organization and click {restartButtonName}."
497
477
  msgstr "要手动上传特定机构的数据,请选择机构并点 {restartButtonName}。"
498
478
 
499
- msgid "Total CVEs"
500
- msgstr ""
501
-
502
479
  msgid "Total risk"
503
480
  msgstr "总风险"
504
481
 
@@ -526,12 +503,6 @@ msgstr "查看所有建议"
526
503
  msgid "View in Red Hat Insights"
527
504
  msgstr "禁用 Red Hat Insights"
528
505
 
529
- msgid "Vulnerabilities"
530
- msgstr ""
531
-
532
- msgid "Vulnerability"
533
- msgstr ""
534
-
535
506
  msgid "Wait and %s"
536
507
  msgstr "等待和 %s"
537
508
 
@@ -598,9 +569,6 @@ msgstr "rule id"
598
569
  msgid "rule title"
599
570
  msgstr "rule 标题"
600
571
 
601
- msgid "setting minimal data collection"
602
- msgstr ""
603
-
604
572
  msgid "solution url"
605
573
  msgstr "solution url"
606
574
 
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foreman_rh_cloud",
3
- "version": "12.2.10",
3
+ "version": "13.0.0",
4
4
  "description": "Inventory Upload =============",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -18,8 +18,7 @@ class UploadReportJobTest < ActiveSupport::TestCase
18
18
 
19
19
  label = ForemanInventoryUpload::Async::UploadReportJob.output_label(organization.id)
20
20
  progress_output = ForemanInventoryUpload::Async::ProgressOutput.get(label)
21
- assert_match(/upload was canceled because connection to Insights is not enabled/, progress_output.full_output)
22
- assert_match(/Report location:/, progress_output.full_output)
21
+ assert_match(/Upload canceled/, progress_output.full_output)
23
22
  assert_match(/exit 1/, progress_output.status)
24
23
  end
25
24
 
@@ -313,51 +313,4 @@ class FactHelpersTest < ActiveSupport::TestCase
313
313
  assert_equal '10.230.230.3', ip3
314
314
  end
315
315
  end
316
-
317
- describe 'IoP smart proxy checks' do
318
- test 'obfuscate_hostname? returns false when global setting is enabled but IoP is present' do
319
- Setting.expects(:[]).with(:obfuscate_inventory_hostnames).returns(true)
320
- ForemanRhCloud.expects(:with_iop_smart_proxy?).returns(true)
321
- host = mock('host')
322
- # When IoP is present, it falls back to checking host-specific facts
323
- @instance.expects(:fact_value).with(host, 'insights_client::obfuscate_hostname_enabled').returns(nil)
324
-
325
- result = @instance.obfuscate_hostname?(host)
326
-
327
- refute result
328
- end
329
-
330
- test 'obfuscate_hostname? returns true when global setting is enabled and IoP is not present' do
331
- Setting.expects(:[]).with(:obfuscate_inventory_hostnames).returns(true)
332
- ForemanRhCloud.expects(:with_iop_smart_proxy?).returns(false)
333
- host = mock('host')
334
-
335
- result = @instance.obfuscate_hostname?(host)
336
-
337
- assert result
338
- end
339
-
340
- test 'obfuscate_ips? returns false when global setting is enabled but IoP is present' do
341
- Setting.expects(:[]).with(:obfuscate_inventory_ips).returns(true)
342
- ForemanRhCloud.expects(:with_iop_smart_proxy?).returns(true)
343
- host = mock('host')
344
- # When IoP is present, it falls back to checking host-specific facts
345
- @instance.expects(:fact_value).with(host, 'insights_client::obfuscate_ipv4_enabled').returns(nil)
346
- @instance.expects(:fact_value).with(host, 'insights_client::obfuscate_ipv6_enabled').returns(nil)
347
-
348
- result = @instance.obfuscate_ips?(host)
349
-
350
- refute result
351
- end
352
-
353
- test 'obfuscate_ips? returns true when global setting is enabled and IoP is not present' do
354
- Setting.expects(:[]).with(:obfuscate_inventory_ips).returns(true)
355
- ForemanRhCloud.expects(:with_iop_smart_proxy?).returns(false)
356
- host = mock('host')
357
-
358
- result = @instance.obfuscate_ips?(host)
359
-
360
- assert result
361
- end
362
- end
363
316
  end
@@ -107,36 +107,6 @@ class SliceGeneratorTest < ActiveSupport::TestCase
107
107
  assert_equal 'test_nic1', actual_nic['name']
108
108
  end
109
109
 
110
- test 'does not generate a report with minimal data collection when iop is present' do
111
- Setting[:insights_minimal_data_collection] = true
112
- ForemanRhCloud.stubs(:with_iop_smart_proxy?).returns(true)
113
-
114
- batch = Host.where(id: @host.id).in_batches.first
115
- generator = create_generator(batch)
116
-
117
- json_str = generator.render
118
- actual = JSON.parse(json_str.join("\n"))
119
-
120
- assert_equal '00000000-0000-0000-0000-000000000000', actual['report_slice_id']
121
- assert_not_nil(actual_host = actual['hosts'].first)
122
- assert_nil actual_host['ip_addresses']
123
- assert_nil actual_host['mac_addresses']
124
- assert_equal @host.fqdn, actual_host['fqdn']
125
- assert_equal '1234', actual_host['account']
126
- assert_equal 1, generator.hosts_count
127
- assert_not_nil(actual_system_profile = actual_host['system_profile'])
128
- assert_nil actual_system_profile['number_of_cpus']
129
- assert_nil actual_system_profile['number_of_sockets']
130
- assert_nil actual_system_profile['cores_per_socket']
131
- assert_nil actual_system_profile['system_memory_bytes']
132
- assert_nil actual_system_profile['os_release']
133
- assert_not_nil(actual_network_interfaces = actual_system_profile['network_interfaces'])
134
- assert_not_nil(actual_nic = actual_network_interfaces.first)
135
- refute actual_nic.key?('mtu')
136
- refute actual_nic.key?('mac_address')
137
- assert_equal 'test_nic1', actual_nic['name']
138
- end
139
-
140
110
  test 'generates a report with minimal data collection' do
141
111
  Setting[:insights_minimal_data_collection] = true
142
112
  create_fact_values(@host,
@@ -960,33 +930,6 @@ class SliceGeneratorTest < ActiveSupport::TestCase
960
930
  assert_equal 'alibaba', actual_profile['cloud_provider']
961
931
  end
962
932
 
963
- test 'do not exclude packages when iop is present' do
964
- Setting[:exclude_installed_packages] = true
965
- ForemanRhCloud.stubs(:with_iop_smart_proxy?).returns(true)
966
- installed_package = ::Katello::InstalledPackage.create(name: 'test-package', nvrea: 'test-package-1.0.x86_64', nvra: 'test-package-1.0.x86_64')
967
-
968
- another_host = FactoryBot.create(
969
- :host,
970
- :with_subscription,
971
- :with_content,
972
- content_view: @host.content_views.first,
973
- lifecycle_environment: @host.lifecycle_environments.first,
974
- organization: @host.organization,
975
- installed_packages: [installed_package]
976
- )
977
-
978
- batch = Host.where(id: another_host.id).in_batches.first
979
- generator = create_generator(batch)
980
-
981
- json_str = generator.render
982
- actual = JSON.parse(json_str.join("\n"))
983
-
984
- assert_equal '00000000-0000-0000-0000-000000000000', actual['report_slice_id']
985
- assert_not_nil(actual_host = actual['hosts'].first)
986
- assert_not_nil(actual_profile = actual_host['system_profile'])
987
- assert_not_nil(actual_profile['installed_packages'])
988
- end
989
-
990
933
  test 'include packages installed in the report' do
991
934
  Setting[:exclude_installed_packages] = false
992
935
  installed_package = ::Katello::InstalledPackage.create(name: 'test-package', nvrea: 'test-package-1.0.x86_64', nvra: 'test-package-1.0.x86_64')
@@ -4,11 +4,7 @@ import { translate as __ } from 'foremanReact/common/I18n';
4
4
  import InventoryAutoUploadSwitcher from './ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload';
5
5
  import NewHostDetailsTab from './InsightsHostDetailsTab/NewHostDetailsTab';
6
6
  import { InsightsTotalRiskChartWrapper } from './InsightsHostDetailsTab/InsightsTotalRiskChartWrapper';
7
- import {
8
- isNotRhelHost,
9
- vulnerabilityDisabled,
10
- hasNoInsightsFacet,
11
- } from './ForemanRhCloudHelpers';
7
+ import { isNotRhelHost, vulnerabilityDisabled } from './ForemanRhCloudHelpers';
12
8
  import CVEsHostDetailsTabWrapper from './CVEsHostDetailsTab/CVEsHostDetailsTab';
13
9
 
14
10
  const fills = [
@@ -24,7 +20,7 @@ const fills = [
24
20
  component: props => <NewHostDetailsTab {...props} />,
25
21
  weight: 400,
26
22
  metadata: {
27
- hideTab: props => isNotRhelHost(props) || hasNoInsightsFacet(props),
23
+ hideTab: isNotRhelHost,
28
24
  title: __('Recommendations'),
29
25
  },
30
26
  },
@@ -14,7 +14,3 @@ export const isNotRhelHost = ({ hostDetails }) =>
14
14
 
15
15
  export const vulnerabilityDisabled = ({ hostDetails }) =>
16
16
  isNotRhelHost({ hostDetails }) || !hostDetails?.vulnerability?.enabled;
17
-
18
- export const hasNoInsightsFacet = ({ response, hostDetails }) =>
19
- // eslint-disable-next-line camelcase
20
- !(response?.insights_attributes || hostDetails?.insights_attributes);
@@ -88,7 +88,3 @@
88
88
  #new_host_details_insights_tab {
89
89
  padding: 24px;
90
90
  }
91
-
92
- #total-risks-dropdown-container ul.pf-v5-c-menu__list {
93
- margin-bottom: 0px;
94
- }
@@ -3,7 +3,8 @@ import PropTypes from 'prop-types';
3
3
  import { useDispatch } from 'react-redux';
4
4
  import { push } from 'connected-react-router';
5
5
  import { useHistory } from 'react-router-dom';
6
- import { Bullseye, DropdownItem, Title } from '@patternfly/react-core';
6
+ import { Bullseye, Title } from '@patternfly/react-core';
7
+ import { DropdownItem } from '@patternfly/react-core/deprecated';
7
8
  import {
8
9
  ChartDonut,
9
10
  ChartLegend,
@@ -18,67 +19,36 @@ import SkeletonLoader from 'foremanReact/components/common/SkeletonLoader';
18
19
  import { insightsCloudUrl } from '../InsightsCloudSync/InsightsCloudSyncHelpers';
19
20
  import { getInitialRisks, theme } from './InsightsTabConstants';
20
21
 
21
- const InsightsTotalRiskCard = ({ hostDetails }) => {
22
- const { id, insights_attributes: insightsFacet } = hostDetails;
23
- const uuid = insightsFacet?.uuid;
24
- // eslint-disable-next-line camelcase
25
- const isIop = insightsFacet?.use_iop_mode;
22
+ const InsightsTotalRiskCard = ({ hostDetails: { id } }) => {
26
23
  const [totalRisks, setTotalRisks] = useState(getInitialRisks());
27
24
  const hashHistory = useHistory();
28
25
  const dispatch = useDispatch();
29
26
  const API_KEY = `HOST_${id}_RECOMMENDATIONS`;
30
27
  const API_OPTIONS = useMemo(() => ({ key: API_KEY }), [API_KEY]);
28
+ const url = id && insightsCloudUrl(`hits/${id}`); // This will keep the API call from being triggered if there's no host id.
29
+ const {
30
+ status = STATUS.PENDING,
31
+ response: { hits = [] },
32
+ } = useAPI('get', url, API_OPTIONS);
31
33
 
32
- // This will keep the API call from being triggered if there's no host id.
33
- const url = isIop
34
- ? uuid && insightsCloudUrl(`api/insights/v1/system/${uuid}`)
35
- : id && insightsCloudUrl(`hits/${id}`);
36
- const { status = STATUS.PENDING, response } = useAPI('get', url, API_OPTIONS);
37
-
38
- const checkRisks = useMemo(() => {
39
- if (!response || status !== STATUS.RESOLVED) {
40
- return getInitialRisks();
41
- }
42
-
43
- const risks = getInitialRisks();
44
- if (isIop) {
45
- const {
46
- low_hits: lowHits = 0,
47
- moderate_hits: moderateHits = 0,
48
- important_hits: importantHits = 0,
49
- critical_hits: criticalHits = 0,
50
- hits = 0,
51
- } = response;
52
-
53
- risks[1].value += lowHits;
54
- risks[2].value += moderateHits;
55
- risks[3].value += importantHits;
56
- risks[4].value += criticalHits;
57
- risks.total = hits;
58
- } else {
59
- const { hits = [] } = response;
34
+ useEffect(() => {
35
+ if (status === STATUS.RESOLVED) {
36
+ const risks = getInitialRisks();
60
37
  hits.forEach(({ total_risk: risk }) => {
61
38
  risks[risk].value += 1;
62
39
  });
63
40
  risks.total = hits.length;
41
+ setTotalRisks(risks);
64
42
  }
65
- return risks;
66
- }, [response, status, isIop]);
67
-
68
- useEffect(() => {
69
- setTotalRisks(checkRisks);
70
- }, [checkRisks]);
71
-
72
- if (!insightsFacet) return null;
43
+ }, [hits, status]);
73
44
 
74
45
  const onChartClick = (evt, { index }) => {
75
46
  hashHistory.push(`/Insights`);
76
- !isIop &&
77
- dispatch(
78
- push({
79
- search: `search=total_risk+%3D+${index + 1}`,
80
- })
81
- );
47
+ dispatch(
48
+ push({
49
+ search: `search=total_risk+%3D+${index + 1}`,
50
+ })
51
+ );
82
52
  };
83
53
 
84
54
  const onChartHover = (evt, { index }) => [
@@ -92,16 +62,11 @@ const InsightsTotalRiskCard = ({ hostDetails }) => {
92
62
  const { 1: low, 2: moderate, 3: important, 4: critical, total } = totalRisks;
93
63
 
94
64
  // eslint-disable-next-line react/prop-types
95
- const LegendLabel = ({ index, ...rest }) => {
96
- if (isIop) {
97
- return <ChartLabel {...rest} />;
98
- }
99
- return (
100
- <a key={index} onClick={() => onChartClick(null, { index })}>
101
- <ChartLabel {...rest} />
102
- </a>
103
- );
104
- };
65
+ const LegendLabel = ({ index, ...rest }) => (
66
+ <a key={index} onClick={() => onChartClick(null, { index })}>
67
+ <ChartLabel {...rest} />
68
+ </a>
69
+ );
105
70
 
106
71
  const legend = (
107
72
  <ChartLegend
@@ -162,7 +127,6 @@ const InsightsTotalRiskCard = ({ hostDetails }) => {
162
127
  return (
163
128
  <CardTemplate
164
129
  header={__('Total risks')}
165
- overrideDropdownProps={{ id: 'total-risks-dropdown-container' }}
166
130
  dropdownItems={[
167
131
  <DropdownItem
168
132
  key="insights-tab"