foreman_rh_cloud 14.6.2 → 14.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.
Files changed (29) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/app/assets/javascripts/foreman_rh_cloud/locale/fr/foreman_rh_cloud.js +70 -82
  4. data/app/assets/javascripts/foreman_rh_cloud/locale/ja/foreman_rh_cloud.js +70 -82
  5. data/app/assets/javascripts/foreman_rh_cloud/locale/ka/foreman_rh_cloud.js +139 -151
  6. data/app/assets/javascripts/foreman_rh_cloud/locale/ko/foreman_rh_cloud.js +70 -82
  7. data/app/assets/javascripts/foreman_rh_cloud/locale/zh_CN/foreman_rh_cloud.js +70 -82
  8. data/app/services/foreman_rh_cloud/insights_api_forwarder.rb +16 -0
  9. data/lib/foreman_inventory_upload/generators/queries.rb +1 -1
  10. data/lib/foreman_inventory_upload/generators/slice.rb +14 -2
  11. data/lib/foreman_inventory_upload.rb +1 -7
  12. data/lib/foreman_rh_cloud/version.rb +1 -1
  13. data/locale/foreman_rh_cloud.pot +246 -268
  14. data/locale/fr/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
  15. data/locale/fr/foreman_rh_cloud.po +70 -83
  16. data/locale/ja/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
  17. data/locale/ja/foreman_rh_cloud.po +70 -83
  18. data/locale/ka/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
  19. data/locale/ka/foreman_rh_cloud.po +139 -152
  20. data/locale/ko/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
  21. data/locale/ko/foreman_rh_cloud.po +70 -83
  22. data/locale/zh_CN/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
  23. data/locale/zh_CN/foreman_rh_cloud.po +70 -83
  24. data/package.json +1 -1
  25. data/test/unit/services/foreman_rh_cloud/insights_api_forwarder_test.rb +22 -0
  26. data/test/unit/slice_generator_test.rb +29 -0
  27. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/Dashboard.test.js +79 -49
  28. data/webpack/ForemanInventoryUpload/Components/TaskProgress/TaskProgress.js +1 -5
  29. metadata +2 -2
@@ -11,10 +11,9 @@
11
11
  # Bryan Kearney <bryan.kearney@gmail.com>, 2026
12
12
  # Ondřej Gajdušek, 2026
13
13
  #
14
- #, fuzzy
15
14
  msgid ""
16
15
  msgstr ""
17
- "Project-Id-Version: foreman_rh_cloud 14.0.2\n"
16
+ "Project-Id-Version: foreman_rh_cloud 14.6.1\n"
18
17
  "Report-Msgid-Bugs-To: \n"
19
18
  "PO-Revision-Date: 2023-01-20 13:26+0000\n"
20
19
  "Last-Translator: Ondřej Gajdušek, 2026\n"
@@ -38,6 +37,9 @@ msgstr "必须从机构上下文中选择一个特定的机构。"
38
37
  msgid "About subscription watch"
39
38
  msgstr "订阅查看"
40
39
 
40
+ msgid "Actions"
41
+ msgstr ""
42
+
41
43
  msgid "Actions history"
42
44
  msgstr "操作历史记录"
43
45
 
@@ -77,27 +79,6 @@ msgstr "清除"
77
79
  msgid "Clear Selection"
78
80
  msgstr "清除选择"
79
81
 
80
- msgid "Cloud Connector has been configured however obfuscating host names setting is enabled, it's recommended to disable it"
81
- msgstr "已配置了云连接器,但启用了模糊主机名设置,建议禁用它"
82
-
83
- msgid "Cloud Connector has been configured however the inventory auto-upload is disabled, it's recommended to enable it"
84
- msgstr "已配置了云连接器,但禁用了清单自动上传,建议启用它"
85
-
86
- msgid "Cloud Connector is in progress"
87
- msgstr "云连接器正在进行"
88
-
89
- msgid "Cloud connector job link"
90
- msgstr "云连接器作业链接"
91
-
92
- msgid "Cloud connector setup has failed: "
93
- msgstr "云连接器设置失败: "
94
-
95
- msgid "Cloud connector setup has started: "
96
- msgstr "云连接器设置已启动: "
97
-
98
- msgid "Cloud connector setup is in progress now: "
99
- msgstr "云连接器设置现在正在进行: "
100
-
101
82
  msgid "Completed"
102
83
  msgstr "完成"
103
84
 
@@ -107,12 +88,6 @@ msgstr "完成,带有警告"
107
88
  msgid "Configure"
108
89
  msgstr "配置"
109
90
 
110
- msgid "Configure Cloud Connector on given hosts"
111
- msgstr "在给定主机上配置 Cloud Connector"
112
-
113
- msgid "Configure cloud connector"
114
- msgstr "配置云连接器"
115
-
116
91
  msgid "Connectivity test"
117
92
  msgstr "连接测试"
118
93
 
@@ -122,6 +97,9 @@ msgstr "关键"
122
97
  msgid "Current page"
123
98
  msgstr "当前页"
124
99
 
100
+ msgid "Destroy HBI hosts for organization"
101
+ msgstr ""
102
+
125
103
  msgid "Details"
126
104
  msgstr "详情"
127
105
 
@@ -131,18 +109,12 @@ msgstr "禁用"
131
109
  msgid "Disable vulnerability analysis"
132
110
  msgstr "禁用漏洞分析"
133
111
 
134
- msgid "Disconnected hosts: "
135
- msgstr "断开连接的主机:"
136
-
137
112
  msgid "Displays manifest statuses per accessible organizations."
138
113
  msgstr "显示每个可访问的机构的清单状态。"
139
114
 
140
115
  msgid "Documentation"
141
116
  msgstr "文档"
142
117
 
143
- msgid "Download Report"
144
- msgstr "下载报告"
145
-
146
118
  msgid "Download latest report"
147
119
  msgstr "下载最新的报告"
148
120
 
@@ -173,9 +145,6 @@ msgstr "启用自动将主机清单上传到红帽云。在使用本地 Insights
173
145
  msgid "Enable automatic upload of your hosts inventory to the Red Hat cloud"
174
146
  msgstr "启用自动将主机清单上传到红帽云"
175
147
 
176
- msgid "Enable cloud connector"
177
- msgstr "启用云连接器"
178
-
179
148
  msgid "Enable inventory upload"
180
149
  msgstr "启用清单上传"
181
150
 
@@ -194,8 +163,8 @@ msgstr "将安装的软件包上传到红帽云"
194
163
  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.) Ignored when using local Insights."
195
164
  msgstr "在上传到红帽云时排除安装的软件包。(如果 insights_minimal_data_collection 设置为 true,则忽略此设置,且安装的软件包始终被排除。)在使用本地 Insights 时忽略。"
196
165
 
197
- msgid "Exit Code: %s"
198
- msgstr "退出代码:%s"
166
+ msgid "Excluded from upload to console.redhat.com Inventory service because host_registration_insights_inventory parameter value is false: "
167
+ msgstr ""
199
168
 
200
169
  msgid "Failed"
201
170
  msgstr "失败"
@@ -203,6 +172,9 @@ msgstr "失败"
203
172
  msgid "Failed to destroy HBI host %s: %s"
204
173
  msgstr "销毁 HBI 主机 %s 失败:%s"
205
174
 
175
+ msgid "Failed to destroy HBI hosts for organization %s: %s"
176
+ msgstr ""
177
+
206
178
  msgid "Failed to fetch hosts"
207
179
  msgstr "获取主机失败"
208
180
 
@@ -221,20 +193,20 @@ msgstr "过滤器..."
221
193
  msgid "Fix host"
222
194
  msgstr "修复主机"
223
195
 
224
- msgid "For more info, please visit the"
225
- msgstr "如需更多信息,请访问"
226
-
227
196
  msgid "For more information about Insights and Cloud Connector, see:"
228
197
  msgstr "有关 Insights 和云连接器的更多信息,请参阅"
229
198
 
230
199
  msgid "For more information about the Subscriptions service, see:"
231
200
  msgstr "有关订阅服务的更多信息,请参阅:"
232
201
 
202
+ msgid "Force RHEL Lightspeed CLA connection"
203
+ msgstr ""
204
+
233
205
  msgid "Foreman plugin that process & upload data to Red Hat Cloud"
234
206
  msgstr "处理数据并将其上传到红帽云的 Foreman 插件"
235
207
 
236
- msgid "Full Screen"
237
- msgstr "全屏"
208
+ msgid "Forward requests to Lightspeed CLA even when in IoP mode. Ignored when IoP mode is off."
209
+ msgstr ""
238
210
 
239
211
  msgid "Generate and upload report"
240
212
  msgstr "生成并上传报告"
@@ -248,9 +220,6 @@ msgstr "生成报告,但不上传"
248
220
  msgid "Generated"
249
221
  msgstr "生成"
250
222
 
251
- msgid "Generating"
252
- msgstr "生成中"
253
-
254
223
  msgid "Go to Foreman Insights page"
255
224
  msgstr "进入 Foreman Insights 页面"
256
225
 
@@ -275,15 +244,18 @@ msgstr "主机 Insights 建议"
275
244
  msgid "Host inventory report job"
276
245
  msgstr "主机清单报告作业"
277
246
 
278
- msgid "Host was not uploaded to your RH cloud inventory"
279
- msgstr "主机没有上传到您的 RH 云清单"
247
+ msgid "Host is excluded from upload to console.redhat.com Inventory service due to host parameter"
248
+ msgstr ""
249
+
250
+ msgid "Host is not present on console.redhat.com Inventory service"
251
+ msgstr ""
252
+
253
+ msgid "Host is uploaded and present on console.redhat.com Inventory service"
254
+ msgstr ""
280
255
 
281
256
  msgid "Hostname"
282
257
  msgstr "主机名"
283
258
 
284
- msgid "Hosts with subscription in organization: "
285
- msgstr "机构中具有订阅的主机: "
286
-
287
259
  msgid "ID of the RHC(Yggdrasil) daemon"
288
260
  msgstr "RHC (Yggdrasil)守护进程的 ID"
289
261
 
@@ -356,12 +328,12 @@ msgstr "如需更多详细信息,请参阅"
356
328
  msgid "N/A"
357
329
  msgstr "不适用"
358
330
 
359
- msgid "Next run: "
360
- msgstr "下一次运行 :"
361
-
362
331
  msgid "No"
363
332
  msgstr "否"
364
333
 
334
+ msgid "No HBI hosts found for organization %s"
335
+ msgstr ""
336
+
365
337
  msgid "No account data available."
366
338
  msgstr "没有可用的帐户数据。"
367
339
 
@@ -389,15 +361,18 @@ msgstr "还没有运行任何任务。"
389
361
  msgid "None of the selected hosts are registered"
390
362
  msgstr "所选主机都没有注册"
391
363
 
364
+ msgid "Not present on console.redhat.com Inventory service: "
365
+ msgstr ""
366
+
392
367
  msgid "Not reporting"
393
368
  msgstr "未报告"
394
369
 
370
+ msgid "Not reporting because host_registration_insights parameter value is false"
371
+ msgstr ""
372
+
395
373
  msgid "Nothing to sync, there are no hosts with subscription for this organization."
396
374
  msgstr "没有同步,此机构没有带有订阅的主机。"
397
375
 
398
- msgid "Notice"
399
- msgstr "注意事項"
400
-
401
376
  msgid "Obfuscate host ipv4 addresses"
402
377
  msgstr "模糊的主机 ipv4 地址"
403
378
 
@@ -428,6 +403,12 @@ msgstr "仅将最低所需的数据发送到红帽云,禁用模糊设置"
428
403
  msgid "Oops! Couldn't find organization that matches your query"
429
404
  msgstr "未找到与您的查询匹配的机构"
430
405
 
406
+ msgid "Organization"
407
+ msgstr ""
408
+
409
+ msgid "Organization not found"
410
+ msgstr ""
411
+
431
412
  msgid "Organization status"
432
413
  msgstr "机构标签"
433
414
 
@@ -449,6 +430,9 @@ msgstr "RH Cloud"
449
430
  msgid "RHC daemon id. Ignored when using local Insights."
450
431
  msgstr "RHC 守护进程 ID。在使用本地 Insights 时忽略。"
451
432
 
433
+ msgid "RHC instance ID to register with Red Hat Sources"
434
+ msgstr ""
435
+
452
436
  msgid "Read more about it in RH cloud insights"
453
437
  msgstr "在 RH Cloud insights 中了解更多有关它的信息"
454
438
 
@@ -467,15 +451,15 @@ msgstr "建议同步已启动: "
467
451
  msgid "Recommendations"
468
452
  msgstr "建议"
469
453
 
454
+ msgid "Recommendations actions"
455
+ msgstr ""
456
+
470
457
  msgid "Recommendations selected: %s."
471
458
  msgstr "选择的建议:%s。"
472
459
 
473
460
  msgid "Recommendations synced successfully"
474
461
  msgstr "成功同步建议"
475
462
 
476
- msgid "Reconfigure cloud connector"
477
- msgstr "重新配置云连接器"
478
-
479
463
  msgid "Red Hat Cloud Inventory"
480
464
  msgstr "红帽云清单"
481
465
 
@@ -488,8 +472,8 @@ msgstr "Red Hat Insights 数据和应用程序安全"
488
472
  msgid "Red Hat Inventory"
489
473
  msgstr "Red Hat 清单"
490
474
 
491
- msgid "Remain"
492
- msgstr "保留"
475
+ msgid "Registered hosts in organization: "
476
+ msgstr ""
493
477
 
494
478
  msgid "Remediate"
495
479
  msgstr "补救"
@@ -530,9 +514,18 @@ msgstr "執行中"
530
514
  msgid "Satellite server has %{hits_count} recommendations by Red Hat"
531
515
  msgstr "Satellite 服务器有 %{hits_count} 个红帽提供的建议"
532
516
 
517
+ msgid "Schedule a task to register in Red Hat Sources for cloud connector"
518
+ msgstr ""
519
+
533
520
  msgid "Scoped search string for host removal"
534
521
  msgstr "用于删除主机的有范围的搜索字符串"
535
522
 
523
+ msgid "Searching by recommendations count is not available in IoP mode."
524
+ msgstr ""
525
+
526
+ msgid "Select all recommendations"
527
+ msgstr ""
528
+
536
529
  msgid "Select recommendations from all pages"
537
530
  msgstr "在所有页面中选择建议"
538
531
 
@@ -551,9 +544,6 @@ msgstr "是否应该导入 Foreman 中的 include 参数标签?在使用本地
551
544
  msgid "Show Advanced Settings"
552
545
  msgstr "显示高级设置"
553
546
 
554
- msgid "Show if system is configured to use local iop-advisor-engine."
555
- msgstr "显示系统是否被配置为使用本地 iop-advisor-engine。"
556
-
557
547
  msgid "Single-host report job"
558
548
  msgstr "单主机报告作业"
559
549
 
@@ -575,11 +565,8 @@ msgstr "停止"
575
565
  msgid "Success"
576
566
  msgstr "成功"
577
567
 
578
- msgid "Successfully synced hosts: "
579
- msgstr "成功同步的主机:"
580
-
581
- msgid "Successfully uploaded to your RH cloud inventory"
582
- msgstr "成功上传到您的 RH 云清单"
568
+ msgid "Successfully deleted all HBI hosts for organization %s"
569
+ msgstr ""
583
570
 
584
571
  msgid "Sync automatically"
585
572
  msgstr "自动同步"
@@ -590,6 +577,9 @@ msgstr "同步建议"
590
577
  msgid "Synchronize recommendations Automatically"
591
578
  msgstr "自动同步建议"
592
579
 
580
+ msgid "Table actions"
581
+ msgstr ""
582
+
593
583
  msgid "The Foreman inventory upload plugin automatically uploads Foreman host inventory data to the Inventory service of Insights, where it can also be used by the Subscriptions service for subscription reporting. If you use the Subscriptions service, enabling inventory uploads is required."
594
584
  msgstr "Foreman 清单上传插件会自动将 Foreman 主机清单数据上传到 Insights 的 Inventory 服务,订阅服务使用这些信息来提供订阅报告。如果使用订阅服务,则需要启用清单上传。"
595
585
 
@@ -614,9 +604,6 @@ msgstr "没有适用于您的主机的建议"
614
604
  msgid "There were no missing Insights facets"
615
605
  msgstr "没有缺失的 Insights 情况"
616
606
 
617
- msgid "This action will also enable automatic reports upload"
618
- msgstr "此操作还会启用自动报告上传"
619
-
620
607
  msgid "To enable this reporting for all Foreman organizations, set {uploadButtonName} to on. The data will be reported automatically once per day."
621
608
  msgstr "要为所有 Foreman 机构启用此报告,请将 {uploadButtonName} 设置为 on。数据将每天自动报告一次。"
622
609
 
@@ -635,6 +622,9 @@ msgstr "总风险"
635
622
  msgid "Unknown"
636
623
  msgstr "未知"
637
624
 
625
+ msgid "Unsupported operator for recommendations count search: %s"
626
+ msgstr ""
627
+
638
628
  msgid "Upload hits from iop-advisor-engine"
639
629
  msgstr "从 iop-advisor-engine 上传 hits"
640
630
 
@@ -650,8 +640,8 @@ msgstr "上传与 hits 相关的 rule"
650
640
  msgid "Uploaded"
651
641
  msgstr "已上传"
652
642
 
653
- msgid "Uploading"
654
- msgstr "上载中"
643
+ msgid "Uploaded and present on console.redhat.com Inventory service: "
644
+ msgstr ""
655
645
 
656
646
  msgid "Value %{value} is not a valid UUID"
657
647
  msgstr "值 %{value} 不是一个有效的 UUID"
@@ -689,6 +679,9 @@ msgstr "警告"
689
679
  msgid "Whether the resolution requires reboot"
690
680
  msgstr "resolution 是否需要重启"
691
681
 
682
+ msgid "You can review this information later by looking at the Inventory status of each host."
683
+ msgstr ""
684
+
692
685
  msgid "You do not have permission to perform this action"
693
686
  msgstr "您没有执行此操作的权限"
694
687
 
@@ -698,9 +691,6 @@ msgstr "类别名称"
698
691
  msgid "generic"
699
692
  msgstr "通用"
700
693
 
701
- msgid "hosts page"
702
- msgstr "主机页"
703
-
704
694
  msgid "impact name"
705
695
  msgstr "影响名称"
706
696
 
@@ -773,8 +763,5 @@ msgstr "上传 hits 详情 json"
773
763
  msgid "upload resolutions related to the hits"
774
764
  msgstr "上传与 hits 相关的 resolutions"
775
765
 
776
- msgid "view the job in progress"
777
- msgstr "查看正在进行中的任务"
778
-
779
766
  msgid "view the task page for more details"
780
767
  msgstr "查看任务页面以了解更多详细信息"
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foreman_rh_cloud",
3
- "version": "14.6.2",
3
+ "version": "14.7.0",
4
4
  "description": "Inventory Upload =============",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -233,6 +233,28 @@ class UIRequestForwarderTest < ActiveSupport::TestCase
233
233
  assert_equal :tags, result
234
234
  end
235
235
 
236
+ test 'scope_request? should return tag_name for report test_results list endpoint' do
237
+ get_req = ActionDispatch::Request.new(
238
+ 'REQUEST_URI' => '/api/compliance/v2/reports/report-123/test_results',
239
+ 'REQUEST_METHOD' => 'GET',
240
+ 'rack.input' => ::Puma::NullIO.new
241
+ )
242
+
243
+ result = @forwarder.send(:scope_request?, get_req, 'api/compliance/v2/reports/report-123/test_results')
244
+ assert_equal :tags, result
245
+ end
246
+
247
+ test 'scope_request? should return tag_name for individual test_result endpoint' do
248
+ get_req = ActionDispatch::Request.new(
249
+ 'REQUEST_URI' => '/api/compliance/v2/reports/report-123/test_results/result-456',
250
+ 'REQUEST_METHOD' => 'GET',
251
+ 'rack.input' => ::Puma::NullIO.new
252
+ )
253
+
254
+ result = @forwarder.send(:scope_request?, get_req, 'api/compliance/v2/reports/report-123/test_results/result-456')
255
+ assert_equal :tags, result
256
+ end
257
+
236
258
  test 'prepare_tags should use provided tag_name' do
237
259
  result = @forwarder.send(:prepare_tags, @user, @organization, @location, :custom_tag)
238
260
 
@@ -220,6 +220,35 @@ class SliceGeneratorTest < ActiveSupport::TestCase
220
220
  assert true, @host.subscription_facet.hypervisor?
221
221
  end
222
222
 
223
+ test 'generates a report with minimal data collection retaining virtual_host_uuid for a guest' do
224
+ Setting[:insights_minimal_data_collection] = true
225
+ hypervisor_host = FactoryBot.create(
226
+ :host,
227
+ :with_subscription,
228
+ :with_content,
229
+ content_view: @host.content_views.first,
230
+ lifecycle_environment: @host.lifecycle_environments.first,
231
+ organization: @host.organization
232
+ )
233
+
234
+ @host.subscription_facet.hypervisor_host = hypervisor_host
235
+ @host.subscription_facet.save!
236
+
237
+ batch = Host.where(id: @host.id).in_batches.first
238
+ generator = create_generator(batch)
239
+
240
+ json_str = generator.render
241
+ actual = JSON.parse(json_str.join("\n"))
242
+
243
+ assert_not_nil(actual_host = actual['hosts'].first)
244
+ assert_not_nil(host_facts = actual_host['facts']&.first)
245
+ assert_equal 'satellite', host_facts['namespace']
246
+ assert_not_nil(fact_values = host_facts['facts'])
247
+ assert_equal hypervisor_host.subscription_facet.uuid, fact_values['virtual_host_uuid']
248
+ assert_nil actual_host['fqdn']
249
+ assert_nil fact_values['virtual_host_name']
250
+ end
251
+
223
252
  test 'packages are excluded in the report with minimal data collection' do
224
253
  Setting[:exclude_installed_packages] = false
225
254
  Setting[:insights_minimal_data_collection] = true
@@ -1,67 +1,97 @@
1
1
  import React from 'react';
2
- import { shallow } from '@theforeman/test';
2
+ import { screen } from '@testing-library/react';
3
+ import '@testing-library/jest-dom';
4
+ import { rtlHelpers } from 'foremanReact/common/rtlTestHelpers';
3
5
  import Dashboard from '../Dashboard';
4
6
 
7
+ const { renderWithStoreAndI18n } = rtlHelpers;
8
+
9
+ jest.mock('../../../../common/Hooks/ConfigHooks', () => ({
10
+ useIopConfig: jest.fn(() => false),
11
+ }));
12
+
13
+ const runningTask = {
14
+ id: 'task-1',
15
+ state: 'running',
16
+ result: null,
17
+ progress: 50,
18
+ };
19
+
20
+ const inventoryStore = {
21
+ API: {
22
+ INVENTORY_SETTINGS: {
23
+ response: { subscriptionConnectionEnabled: true },
24
+ },
25
+ },
26
+ };
27
+
28
+ const renderDashboard = (props = {}) =>
29
+ renderWithStoreAndI18n(<Dashboard {...props} />, inventoryStore);
30
+
5
31
  describe('Dashboard', () => {
6
- it('should render TaskProgress component with correct props', () => {
7
- const account = {
8
- id: 1,
9
- generate_task: {
10
- id: 'task-1',
11
- state: 'running',
12
- result: null,
13
- progress: 50,
14
- },
15
- };
32
+ it('renders report generation progress for a running task', async () => {
16
33
  const onTaskStart = jest.fn();
17
34
 
18
- const wrapper = shallow(
19
- <Dashboard account={account} onTaskStart={onTaskStart} />
20
- );
35
+ renderDashboard({
36
+ account: { id: 1, generate_task: runningTask },
37
+ onTaskStart,
38
+ });
21
39
 
22
- const taskProgress = wrapper.find('TaskProgress');
23
- expect(taskProgress).toHaveLength(1);
24
- expect(taskProgress.prop('task')).toEqual(account.generate_task);
25
- expect(taskProgress.prop('title')).toBe('Report Generation');
26
- expect(taskProgress.prop('organizationId')).toBe(1);
27
- expect(taskProgress.prop('taskType')).toBe('generate');
28
- expect(taskProgress.prop('onTaskStart')).toBe(onTaskStart);
40
+ expect(await screen.findByText('Report Generation')).toBeInTheDocument();
41
+ expect(screen.getByLabelText('task-progress')).toBeInTheDocument();
42
+ expect(screen.getByText('Running')).toBeInTheDocument();
43
+ expect(
44
+ screen.getByRole('link', { name: 'View task details' })
45
+ ).toHaveAttribute('href', '/foreman_tasks/tasks/task-1');
46
+ expect(
47
+ screen.getByRole('button', { name: 'Generate and upload report' })
48
+ ).toBeDisabled();
49
+ expect(
50
+ screen.getByRole('button', { name: 'Generate report' })
51
+ ).toBeDisabled();
29
52
  });
30
53
 
31
- it('should handle missing account gracefully', () => {
32
- const wrapper = shallow(<Dashboard account={null} onTaskStart={null} />);
54
+ it('shows an empty state when account data is missing', async () => {
55
+ renderDashboard({ account: null, onTaskStart: null });
33
56
 
34
- const taskProgress = wrapper.find('TaskProgress');
35
- expect(taskProgress).toHaveLength(1);
36
- expect(taskProgress.prop('task')).toBeNull();
37
- expect(taskProgress.prop('organizationId')).toBeNull();
38
- expect(taskProgress.prop('emptyMessage')).toBe(
39
- 'No account data available.'
40
- );
57
+ expect(await screen.findByText('No recent tasks')).toBeInTheDocument();
58
+ expect(screen.getByText('No account data available.')).toBeInTheDocument();
59
+ expect(
60
+ screen.queryByRole('button', { name: 'Generate report' })
61
+ ).not.toBeInTheDocument();
41
62
  });
42
63
 
43
- it('should handle missing generate_task gracefully', () => {
44
- const account = { id: 1, generate_task: null };
45
- const wrapper = shallow(<Dashboard account={account} onTaskStart={null} />);
64
+ it('shows generate actions when the account has no generate task', async () => {
65
+ renderDashboard({
66
+ account: { id: 1, generate_task: null },
67
+ onTaskStart: null,
68
+ });
46
69
 
47
- const taskProgress = wrapper.find('TaskProgress');
48
- expect(taskProgress).toHaveLength(1);
49
- expect(taskProgress.prop('task')).toBeNull();
50
- expect(taskProgress.prop('organizationId')).toBe(1);
70
+ expect(
71
+ await screen.findByText('No report generation tasks have been run yet.')
72
+ ).toBeInTheDocument();
73
+ expect(
74
+ screen.getByRole('button', { name: 'Generate and upload report' })
75
+ ).toBeInTheDocument();
76
+ expect(
77
+ screen.getByRole('button', { name: 'Generate report' })
78
+ ).toBeInTheDocument();
51
79
  });
52
80
 
53
- it('should handle missing account.id gracefully', () => {
54
- const account = {
55
- generate_task: {
56
- id: 'task-1',
57
- state: 'running',
58
- },
59
- };
60
- const wrapper = shallow(<Dashboard account={account} onTaskStart={null} />);
81
+ it('renders the task without generate actions when account id is missing', async () => {
82
+ renderDashboard({
83
+ account: { generate_task: runningTask },
84
+ onTaskStart: null,
85
+ });
61
86
 
62
- const taskProgress = wrapper.find('TaskProgress');
63
- expect(taskProgress).toHaveLength(1);
64
- expect(taskProgress.prop('organizationId')).toBeNull();
65
- expect(taskProgress.prop('task')).toEqual(account.generate_task);
87
+ expect(
88
+ await screen.findByRole('link', { name: 'View task details' })
89
+ ).toHaveAttribute('href', '/foreman_tasks/tasks/task-1');
90
+ expect(
91
+ screen.queryByRole('button', { name: 'Generate report' })
92
+ ).not.toBeInTheDocument();
93
+ expect(
94
+ screen.queryByRole('button', { name: 'Generate and upload report' })
95
+ ).not.toBeInTheDocument();
66
96
  });
67
97
  });
@@ -255,11 +255,7 @@ const TaskProgress = ({
255
255
  measureLocation="outside"
256
256
  aria-label="task-progress"
257
257
  />
258
- <DescriptionList
259
- isHorizontal
260
- className="task-progress-details"
261
- ouiaId="task-progress-details"
262
- >
258
+ <DescriptionList isHorizontal className="task-progress-details">
263
259
  <DescriptionListGroup>
264
260
  <DescriptionListTerm>{__('Started')}</DescriptionListTerm>
265
261
  <DescriptionListDescription>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_rh_cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 14.6.2
4
+ version: 14.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Foreman Red Hat Cloud team
@@ -528,7 +528,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
528
528
  - !ruby/object:Gem::Version
529
529
  version: '0'
530
530
  requirements: []
531
- rubygems_version: 4.0.16
531
+ rubygems_version: 4.0.20
532
532
  specification_version: 4
533
533
  summary: Summary of ForemanRhCloud.
534
534
  test_files: