@allurereport/web-awesome 3.0.0-beta.9 → 3.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.
- package/dist/multi/173.app-bae2a0fe5738d77cd976.js +1 -0
- package/dist/multi/174.app-bae2a0fe5738d77cd976.js +1 -0
- package/dist/multi/252.app-bae2a0fe5738d77cd976.js +1 -0
- package/dist/multi/282.app-bae2a0fe5738d77cd976.js +1 -0
- package/dist/multi/29.app-bae2a0fe5738d77cd976.js +1 -0
- package/dist/multi/416.app-bae2a0fe5738d77cd976.js +1 -0
- package/dist/multi/527.app-bae2a0fe5738d77cd976.js +1 -0
- package/dist/multi/600.app-bae2a0fe5738d77cd976.js +1 -0
- package/dist/multi/605.app-bae2a0fe5738d77cd976.js +1 -0
- package/dist/multi/638.app-bae2a0fe5738d77cd976.js +1 -0
- package/dist/multi/672.app-bae2a0fe5738d77cd976.js +1 -0
- package/dist/multi/686.app-bae2a0fe5738d77cd976.js +1 -0
- package/dist/multi/725.app-bae2a0fe5738d77cd976.js +1 -0
- package/dist/multi/741.app-bae2a0fe5738d77cd976.js +1 -0
- package/dist/multi/755.app-bae2a0fe5738d77cd976.js +1 -0
- package/dist/multi/894.app-bae2a0fe5738d77cd976.js +1 -0
- package/dist/multi/91.app-bae2a0fe5738d77cd976.js +1 -0
- package/dist/multi/943.app-bae2a0fe5738d77cd976.js +1 -0
- package/dist/multi/980.app-bae2a0fe5738d77cd976.js +1 -0
- package/dist/multi/app-bae2a0fe5738d77cd976.js +2 -0
- package/dist/multi/app-bae2a0fe5738d77cd976.js.LICENSE.txt +10 -0
- package/dist/multi/manifest.json +25 -24
- package/dist/multi/styles-bbf68b2ba63c38b53c38.css +48 -0
- package/dist/single/app-996d3b5869f8fc942b66.js +2 -0
- package/dist/single/app-996d3b5869f8fc942b66.js.LICENSE.txt +10 -0
- package/dist/single/manifest.json +1 -1
- package/package.json +31 -19
- package/src/assets/scss/day.scss +2 -0
- package/src/assets/scss/index.scss +1 -3
- package/src/assets/scss/night.scss +2 -0
- package/src/assets/scss/palette.scss +391 -391
- package/src/assets/scss/theme.scss +292 -79
- package/src/components/BaseLayout/index.tsx +10 -32
- package/src/components/BaseLayout/styles.scss +14 -4
- package/src/components/Charts/index.tsx +245 -0
- package/src/components/Charts/styles.scss +27 -0
- package/src/components/EnvironmentPicker/index.tsx +60 -0
- package/src/components/EnvironmentPicker/styles.scss +9 -0
- package/src/components/Footer/FooterLogo.tsx +1 -2
- package/src/components/Footer/FooterVersion.tsx +7 -3
- package/src/components/Footer/index.tsx +6 -2
- package/src/components/Header/CiInfo/index.tsx +67 -0
- package/src/components/Header/CiInfo/styles.scss +7 -0
- package/src/components/Header/index.tsx +21 -8
- package/src/components/Header/styles.scss +9 -1
- package/src/components/HeaderControls/index.tsx +20 -0
- package/src/components/MainReport/index.tsx +84 -6
- package/src/components/MainReport/styles.scss +20 -0
- package/src/components/Metadata/index.tsx +6 -4
- package/src/components/MetadataButton/index.tsx +14 -6
- package/src/components/MetadataButton/styles.scss +3 -0
- package/src/components/Modal/index.tsx +15 -167
- package/src/components/NavTabs/index.tsx +70 -0
- package/src/components/{TestResult/TestResultTabs → NavTabs}/styles.scss +0 -3
- package/src/components/Report/index.tsx +7 -0
- package/src/components/ReportBody/Filters.tsx +96 -64
- package/src/components/ReportBody/HeaderActions.tsx +2 -2
- package/src/components/ReportBody/SortBy.tsx +4 -7
- package/src/components/ReportBody/index.tsx +30 -24
- package/src/components/ReportBody/styles.scss +9 -3
- package/src/components/ReportGlobalAttachments/index.tsx +34 -0
- package/src/components/ReportGlobalAttachments/styles.scss +11 -0
- package/src/components/ReportGlobalErrors/index.tsx +30 -0
- package/src/components/ReportGlobalErrors/styles.scss +12 -0
- package/src/components/ReportHeader/ReportHeaderLogo.tsx +6 -2
- package/src/components/ReportHeader/ReportHeaderPie.tsx +1 -2
- package/src/components/ReportHeader/index.tsx +38 -12
- package/src/components/ReportHeader/styles.scss +9 -1
- package/src/components/ReportMetadata/MetadataSummary.tsx +57 -65
- package/src/components/ReportMetadata/MetadataWithIcon.tsx +11 -13
- package/src/components/ReportMetadata/index.tsx +50 -3
- package/src/components/ReportMetadata/styles.scss +0 -2
- package/src/components/ReportQualityGateResults/index.tsx +42 -0
- package/src/components/ReportQualityGateResults/styles.scss +44 -0
- package/src/components/ReportTabs/index.tsx +37 -0
- package/src/components/SectionPicker/index.tsx +55 -0
- package/src/components/SectionPicker/styles.scss +5 -0
- package/src/components/SectionSwitcher/index.tsx +16 -0
- package/src/components/SectionSwitcher/styles.scss +4 -0
- package/src/components/SectionTabs/index.tsx +0 -0
- package/src/components/SideBySide/index.tsx +52 -0
- package/src/components/SideBySide/styles.scss +64 -0
- package/src/components/SplitLayout/index.tsx +71 -0
- package/src/components/SplitLayout/styles.scss +84 -0
- package/src/components/TestResult/TestStepsEmpty/index.tsx +3 -9
- package/src/components/TestResult/TrAttachmentsView/index.tsx +29 -0
- package/src/components/TestResult/{TestResultDescription → TrDescription}/index.tsx +5 -5
- package/src/components/TestResult/{TestResultDropdown → TrDropdown}/index.tsx +7 -5
- package/src/components/TestResult/{TestResultEmpty → TrEmpty}/index.tsx +7 -13
- package/src/components/TestResult/TrEnvironmentItem/index.tsx +82 -0
- package/src/components/TestResult/TrEnvironmentItem/styles.scss +60 -0
- package/src/components/TestResult/TrEnvironmentsView/index.tsx +64 -0
- package/src/components/TestResult/TrEnvironmentsView/styles.scss +11 -0
- package/src/components/TestResult/TrError/TrDiff.tsx +121 -0
- package/src/components/TestResult/TrError/index.tsx +111 -0
- package/src/components/TestResult/TrError/styles.scss +223 -0
- package/src/components/TestResult/TrHeader/TrBreadcrumbs.tsx +44 -0
- package/src/components/TestResult/TrHeader/index.tsx +15 -0
- package/src/components/TestResult/{TestResultHeader → TrHeader}/styles.scss +7 -2
- package/src/components/TestResult/TrHistory/TrHistoryItem.tsx +94 -0
- package/src/components/TestResult/TrHistory/index.tsx +26 -0
- package/src/components/TestResult/{TestResultHistory → TrHistory}/styles.scss +2 -1
- package/src/components/TestResult/{TestResultInfo/TestResultInfoStatuses.tsx → TrInfo/TrInfoStatuses.tsx} +6 -4
- package/src/components/TestResult/TrInfo/index.tsx +99 -0
- package/src/components/TestResult/{TestResultInfo → TrInfo}/styles.scss +18 -0
- package/src/components/TestResult/{TestResultLinks → TrLinks}/index.tsx +8 -8
- package/src/components/TestResult/{TestResultMetadata → TrMetadata}/index.tsx +6 -6
- package/src/components/TestResult/{TestResultNavigation → TrNavigation}/index.tsx +7 -9
- package/src/components/TestResult/TrOverview.tsx +46 -0
- package/src/components/TestResult/{TestResultParameters → TrParameters}/index.tsx +4 -4
- package/src/components/TestResult/TrPrevStatuses/index.tsx +63 -0
- package/src/components/TestResult/TrPwTraces/PwTrace.tsx +34 -0
- package/src/components/TestResult/TrPwTraces/PwTraceButton.tsx +32 -0
- package/src/components/TestResult/TrPwTraces/index.tsx +32 -0
- package/src/components/TestResult/TrPwTraces/styles.scss +20 -0
- package/src/components/TestResult/TrRetriesView/TrRetriesItem.tsx +70 -0
- package/src/components/TestResult/TrRetriesView/index.tsx +29 -0
- package/src/components/TestResult/{TestResultSetup → TrSetup}/index.tsx +13 -13
- package/src/components/TestResult/{TestResultSeverity → TrSeverity}/index.tsx +2 -2
- package/src/components/TestResult/{TestResultStatus → TrStatus}/index.tsx +5 -5
- package/src/components/TestResult/TrSteps/TrAttachment.tsx +118 -0
- package/src/components/TestResult/{TestResultSteps/testResultAttachmentInfo.tsx → TrSteps/TrAttachmentInfo.tsx} +11 -11
- package/src/components/TestResult/TrSteps/TrStep.tsx +98 -0
- package/src/components/TestResult/TrSteps/TrStepInfo.tsx +90 -0
- package/src/components/TestResult/{TestResultSteps → TrSteps}/index.tsx +12 -12
- package/src/components/TestResult/{TestResultSteps → TrSteps}/styles.scss +49 -10
- package/src/components/TestResult/{TestResultSteps → TrSteps}/wrongAttachment.tsx +1 -1
- package/src/components/TestResult/TrTabs/index.tsx +42 -0
- package/src/components/TestResult/{TestResultTeardown → TrTeardown}/index.tsx +13 -13
- package/src/components/TestResult/index.tsx +54 -38
- package/src/components/TestResult/styles.scss +12 -0
- package/src/components/Timeline/index.tsx +100 -0
- package/src/components/Timeline/styles.scss +45 -0
- package/src/components/ToggleLayout/index.tsx +17 -0
- package/src/components/Tree/index.tsx +117 -11
- package/src/components/Tree/styles.scss +23 -5
- package/src/index.html +22 -6
- package/src/index.tsx +90 -20
- package/src/locales/az.json +378 -0
- package/src/locales/de.json +378 -0
- package/src/locales/en.json +378 -0
- package/src/locales/es.json +378 -0
- package/src/locales/fr.json +378 -0
- package/src/locales/he.json +378 -0
- package/src/locales/hy.json +378 -0
- package/src/locales/it.json +378 -0
- package/src/locales/ja.json +378 -0
- package/src/locales/ka.json +378 -0
- package/src/locales/kr.json +378 -0
- package/src/locales/nl.json +378 -0
- package/src/locales/pl.json +386 -0
- package/src/locales/pt.json +378 -0
- package/src/locales/ru.json +386 -0
- package/src/locales/sv.json +378 -0
- package/src/locales/tr.json +378 -0
- package/src/locales/ua.json +329 -0
- package/src/locales/zh.json +378 -0
- package/src/stores/chart.ts +41 -6
- package/src/stores/env.ts +88 -0
- package/src/stores/envInfo.ts +2 -2
- package/src/stores/globals.ts +28 -0
- package/src/stores/layout.ts +36 -0
- package/src/stores/locale.ts +77 -29
- package/src/stores/modal.ts +22 -0
- package/src/stores/qualityGate.ts +28 -0
- package/src/stores/router.ts +108 -0
- package/src/stores/sections.ts +63 -0
- package/src/stores/stats.ts +52 -7
- package/src/stores/testResults.ts +13 -9
- package/src/stores/theme.ts +15 -18
- package/src/stores/timeline.ts +39 -0
- package/src/stores/tree.ts +65 -110
- package/src/stores/treeFilters/actions.ts +67 -0
- package/src/stores/treeFilters/constants.ts +7 -0
- package/src/stores/treeFilters/index.ts +3 -0
- package/src/stores/treeFilters/store.ts +73 -0
- package/src/stores/treeFilters/types.ts +12 -0
- package/src/stores/variables.ts +40 -0
- package/src/styles.scss +66 -0
- package/src/utils/persist.ts +23 -0
- package/src/utils/time.ts +1 -0
- package/src/utils/tree.ts +30 -0
- package/src/utils/treeFilters.ts +42 -24
- package/test/components/Header/CiInfo.test.tsx +177 -0
- package/test/components/Header.test.tsx +122 -0
- package/test/stores/treeFilters.test.ts +302 -0
- package/test/utils/treeFilters.test.ts +189 -44
- package/tsconfig.json +7 -2
- package/tsconfig.node.json +8 -0
- package/types.d.ts +45 -24
- package/vitest.config.ts +15 -2
- package/vitest.setup.ts +1 -0
- package/webpack.config.js +35 -5
- package/dist/multi/141.app-f32e4213.js +0 -1
- package/dist/multi/222.app-f32e4213.js +0 -1
- package/dist/multi/335.app-f32e4213.js +0 -1
- package/dist/multi/34.app-f32e4213.js +0 -1
- package/dist/multi/349.app-f32e4213.js +0 -1
- package/dist/multi/378.app-f32e4213.js +0 -1
- package/dist/multi/406.app-f32e4213.js +0 -1
- package/dist/multi/476.app-f32e4213.js +0 -1
- package/dist/multi/53.app-f32e4213.js +0 -1
- package/dist/multi/584.app-f32e4213.js +0 -1
- package/dist/multi/690.app-f32e4213.js +0 -1
- package/dist/multi/747.app-f32e4213.js +0 -1
- package/dist/multi/767.app-f32e4213.js +0 -1
- package/dist/multi/816.app-f32e4213.js +0 -1
- package/dist/multi/83.app-f32e4213.js +0 -1
- package/dist/multi/873.app-f32e4213.js +0 -1
- package/dist/multi/920.app-f32e4213.js +0 -1
- package/dist/multi/991.app-f32e4213.js +0 -1
- package/dist/multi/app-f32e4213.js +0 -2
- package/dist/multi/app-f32e4213.js.LICENSE.txt +0 -16
- package/dist/multi/styles-f32e4213.css +0 -284
- package/dist/single/app-7fa8e43f.js +0 -2
- package/dist/single/app-7fa8e43f.js.LICENSE.txt +0 -16
- package/src/assets/scss/code.scss +0 -71
- package/src/assets/scss/typography.scss +0 -218
- package/src/components/ArrowButton/index.tsx +0 -36
- package/src/components/ArrowButton/styles.scss +0 -35
- package/src/components/LanguagePicker/index.tsx +0 -40
- package/src/components/Modal/styles.scss +0 -126
- package/src/components/ReportLogo/index.tsx +0 -16
- package/src/components/ReportLogo/styles.scss +0 -20
- package/src/components/ReportLogoFull/index.tsx +0 -20
- package/src/components/ReportLogoFull/styles.scss +0 -7
- package/src/components/Tabs/index.tsx +0 -62
- package/src/components/TestResult/TestResultAttachmentsView/index.tsx +0 -27
- package/src/components/TestResult/TestResultError/index.tsx +0 -59
- package/src/components/TestResult/TestResultError/styles.scss +0 -51
- package/src/components/TestResult/TestResultHeader/index.tsx +0 -55
- package/src/components/TestResult/TestResultHistory/TestResultHistoryItem.tsx +0 -67
- package/src/components/TestResult/TestResultHistory/index.tsx +0 -26
- package/src/components/TestResult/TestResultInfo/index.tsx +0 -79
- package/src/components/TestResult/TestResultOverview.tsx +0 -43
- package/src/components/TestResult/TestResultPrevStatuses/index.tsx +0 -49
- package/src/components/TestResult/TestResultRetriesView/TestResultRetriesItem.tsx +0 -52
- package/src/components/TestResult/TestResultRetriesView/index.tsx +0 -24
- package/src/components/TestResult/TestResultSteps/HtmlAttachmentPreview.tsx +0 -12
- package/src/components/TestResult/TestResultSteps/attachment.tsx +0 -68
- package/src/components/TestResult/TestResultSteps/attachmentCode.tsx +0 -20
- package/src/components/TestResult/TestResultSteps/attachmentImage.tsx +0 -32
- package/src/components/TestResult/TestResultSteps/attachmentVideo.tsx +0 -15
- package/src/components/TestResult/TestResultSteps/testResultAttachment.tsx +0 -77
- package/src/components/TestResult/TestResultSteps/testResultStep.tsx +0 -85
- package/src/components/TestResult/TestResultSteps/testResultStepInfo.tsx +0 -30
- package/src/components/TestResult/TestResultTabs/index.tsx +0 -59
- package/src/components/ThemeButton/ThemeButton.tsx +0 -20
- package/src/components/Tree/Tree.tsx +0 -75
- package/src/components/Tree/TreeHeader.tsx +0 -82
- package/src/components/Tree/TreeItem.tsx +0 -35
- package/src/components/Tree/TreeItemIcon.tsx +0 -32
- package/src/i18n/constants.ts +0 -124
- package/src/i18n/locales/am.json +0 -120
- package/src/i18n/locales/az.json +0 -120
- package/src/i18n/locales/de.json +0 -120
- package/src/i18n/locales/en.json +0 -121
- package/src/i18n/locales/es.json +0 -120
- package/src/i18n/locales/fr.json +0 -120
- package/src/i18n/locales/he.json +0 -120
- package/src/i18n/locales/it.json +0 -120
- package/src/i18n/locales/ja.json +0 -120
- package/src/i18n/locales/ka.json +0 -120
- package/src/i18n/locales/kr.json +0 -120
- package/src/i18n/locales/nl.json +0 -120
- package/src/i18n/locales/pl.json +0 -118
- package/src/i18n/locales/pt.json +0 -120
- package/src/i18n/locales/ru.json +0 -118
- package/src/i18n/locales/sv.json +0 -120
- package/src/i18n/locales/tr.json +0 -120
- package/src/i18n/locales/zh.json +0 -120
- package/src/utils/attachments.ts +0 -156
- package/src/utils/capitalize.ts +0 -6
- /package/dist/multi/{JetBrainsMono_vf-b9a9c326..woff → JetBrainsMono_vf.woff} +0 -0
- /package/dist/multi/{JetBrainsMono_vf-9e9649b6..woff2 → JetBrainsMono_vf.woff2} +0 -0
- /package/dist/multi/{pt-root-ui_vf-22fe60ca..woff → pt-root-ui_vf.woff} +0 -0
- /package/dist/multi/{pt-root-ui_vf-9d251e8b..woff2 → pt-root-ui_vf.woff2} +0 -0
- /package/src/components/{Tabs → ReportTabs}/styles.scss +0 -0
- /package/src/components/TestResult/{TestResultAttachmentsView → TrAttachmentsView}/styles.scss +0 -0
- /package/src/components/TestResult/{TestResultDescription → TrDescription}/styles.scss +0 -0
- /package/src/components/TestResult/{TestResultDropdown → TrDropdown}/styles.scss +0 -0
- /package/src/components/TestResult/{TestResultEmpty → TrEmpty}/styles.scss +0 -0
- /package/src/components/TestResult/{TestResultLinks → TrLinks}/styles.scss +0 -0
- /package/src/components/TestResult/{TestResultMetadata → TrMetadata}/styles.scss +0 -0
- /package/src/components/TestResult/{TestResultNavigation → TrNavigation}/styles.scss +0 -0
- /package/src/components/TestResult/{TestResultParameters → TrParameters}/styles.scss +0 -0
- /package/src/components/TestResult/{TestResultPrevStatuses → TrPrevStatuses}/styles.scss +0 -0
- /package/src/components/TestResult/{TestResultRetriesView → TrRetriesView}/styles.scss +0 -0
- /package/src/components/TestResult/{TestResultSeverity → TrSeverity}/styles.scss +0 -0
- /package/src/components/TestResult/{TestResultStatus → TrStatus}/styles.scss +0 -0
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
{
|
|
2
|
+
"statuses": {
|
|
3
|
+
"passed": "通过",
|
|
4
|
+
"failed": "失败",
|
|
5
|
+
"broken": "损坏",
|
|
6
|
+
"skipped": "跳过",
|
|
7
|
+
"unknown": "未知",
|
|
8
|
+
"total": "总计",
|
|
9
|
+
"flakyTests": "不稳定",
|
|
10
|
+
"newTests": "新的",
|
|
11
|
+
"retryTests": "重试"
|
|
12
|
+
},
|
|
13
|
+
"testSummary": {
|
|
14
|
+
"total": "总计",
|
|
15
|
+
"flaky": "不稳定的测试",
|
|
16
|
+
"retries": "重跑测试",
|
|
17
|
+
"new": "新的测试"
|
|
18
|
+
},
|
|
19
|
+
"tabs": {
|
|
20
|
+
"total": "全部",
|
|
21
|
+
"results": "结果",
|
|
22
|
+
"globalAttachments": "全局附件",
|
|
23
|
+
"globalErrors": "全局错误",
|
|
24
|
+
"qualityGates": "质量门"
|
|
25
|
+
},
|
|
26
|
+
"search": {
|
|
27
|
+
"search": "搜索",
|
|
28
|
+
"search-placeholder": "名称或ID"
|
|
29
|
+
},
|
|
30
|
+
"filters": {
|
|
31
|
+
"more-filters": "更多过滤器",
|
|
32
|
+
"enable-filter": "启用 \"{{filter}}\" 过滤器",
|
|
33
|
+
"flaky": "不稳定",
|
|
34
|
+
"retry": "重试",
|
|
35
|
+
"new": "新的",
|
|
36
|
+
"fixed": "已修复",
|
|
37
|
+
"regressed": "已回归",
|
|
38
|
+
"malfunctioned": "已损坏"
|
|
39
|
+
},
|
|
40
|
+
"filters.description": {
|
|
41
|
+
"flaky": "显示不稳定的测试",
|
|
42
|
+
"retry": "显示重新运行的测试结果",
|
|
43
|
+
"new": "显示在此报告中首次出现的测试结果",
|
|
44
|
+
"fixed": "显示现在通过但之前\"失败\"或\"损坏\"的测试",
|
|
45
|
+
"regressed": "显示从\"通过\"或\"损坏\"状态变为\"失败\"状态的测试结果",
|
|
46
|
+
"malfunctioned": "显示从\"通过\"或\"失败\"状态变为\"损坏\"状态的测试结果"
|
|
47
|
+
},
|
|
48
|
+
"sort-by": {
|
|
49
|
+
"sort-by-text": "排序依据:",
|
|
50
|
+
"sort-by-category": "排序类别",
|
|
51
|
+
"direction-category": "方向"
|
|
52
|
+
},
|
|
53
|
+
"sort-by.values": {
|
|
54
|
+
"order": "顺序",
|
|
55
|
+
"alphabet": "字母",
|
|
56
|
+
"duration": "持续时间",
|
|
57
|
+
"status": "状态"
|
|
58
|
+
},
|
|
59
|
+
"sort-by.directions": {
|
|
60
|
+
"order-desc": "最新 – 最早",
|
|
61
|
+
"order-asc": "最早 – 最新",
|
|
62
|
+
"order-asc-short": "最早",
|
|
63
|
+
"order-desc-short": "最新",
|
|
64
|
+
"alphabet-asc": "A – Z",
|
|
65
|
+
"alphabet-desc": "Z – A",
|
|
66
|
+
"alphabet-asc-short": "A – Z",
|
|
67
|
+
"alphabet-desc-short": "Z – A",
|
|
68
|
+
"duration-asc": "1 – 9",
|
|
69
|
+
"duration-desc": "9 – 1",
|
|
70
|
+
"duration-asc-short": "1 – 9",
|
|
71
|
+
"duration-desc-short": "9 – 1",
|
|
72
|
+
"status-asc": "按照过滤列表",
|
|
73
|
+
"status-desc": "反转",
|
|
74
|
+
"status-asc-short": "正常",
|
|
75
|
+
"status-desc-short": "反转"
|
|
76
|
+
},
|
|
77
|
+
"empty": {
|
|
78
|
+
"no-results": "没有结果",
|
|
79
|
+
"no-tests-found": "未找到结果",
|
|
80
|
+
"no-message-provided": "未提供消息",
|
|
81
|
+
"clear-filters": "清除过滤器",
|
|
82
|
+
"no-attachments-results": "没有附件信息",
|
|
83
|
+
"no-global-errors-results": "没有全局错误信息",
|
|
84
|
+
"no-quality-gate-results": "没有质量门结果",
|
|
85
|
+
"no-history-results": "没有历史信息",
|
|
86
|
+
"no-retries-results": "没有重试信息",
|
|
87
|
+
"no-test-steps-results": "没有可用的测试步骤信息",
|
|
88
|
+
"no-test-case-results": "没有测试用例结果",
|
|
89
|
+
"no-environments-results": "没有环境信息"
|
|
90
|
+
},
|
|
91
|
+
"severity": {
|
|
92
|
+
"blocker": "阻断",
|
|
93
|
+
"critical": "严重",
|
|
94
|
+
"normal": "正常",
|
|
95
|
+
"minor": "次要",
|
|
96
|
+
"trivial": "轻微"
|
|
97
|
+
},
|
|
98
|
+
"execution": {
|
|
99
|
+
"name": "执行",
|
|
100
|
+
"body": "测试内容",
|
|
101
|
+
"setup": "设置",
|
|
102
|
+
"teardown": "拆解"
|
|
103
|
+
},
|
|
104
|
+
"environments": {
|
|
105
|
+
"environment_one": "环境",
|
|
106
|
+
"environment_other": "环境",
|
|
107
|
+
"all": "所有"
|
|
108
|
+
},
|
|
109
|
+
"ui": {
|
|
110
|
+
"labels": "标签",
|
|
111
|
+
"metadata": "元数据",
|
|
112
|
+
"parameters": "参数",
|
|
113
|
+
"description": "描述",
|
|
114
|
+
"links": "链接",
|
|
115
|
+
"overview": "概览",
|
|
116
|
+
"history": "历史",
|
|
117
|
+
"attachments": "附件",
|
|
118
|
+
"retries": "重试",
|
|
119
|
+
"environments": "环境",
|
|
120
|
+
"error": "错误",
|
|
121
|
+
"goToStep": "跳转到步骤",
|
|
122
|
+
"showLess": "显示更少",
|
|
123
|
+
"showMore": "显示更多",
|
|
124
|
+
"copy": "复制",
|
|
125
|
+
"attempt": "第 {{attempt}} 次尝试,共 {{total}} 次",
|
|
126
|
+
"at": "在",
|
|
127
|
+
"variables": "变量",
|
|
128
|
+
"openPwTrace": "打开 Playwright Trace",
|
|
129
|
+
"finishedAtOriginal": "{{formattedCreatedAt}},退出代码 {{original}}",
|
|
130
|
+
"finishedAtBoth": "{{formattedCreatedAt}},退出代码 {{actual}}(原始 {{original}})"
|
|
131
|
+
},
|
|
132
|
+
"controls": {
|
|
133
|
+
"newTabAttachment": "在新标签页中打开附件",
|
|
134
|
+
"nextTR": "下一个测试结果",
|
|
135
|
+
"prevTR": "上一个测试结果",
|
|
136
|
+
"downloadAttachment": "下载附件",
|
|
137
|
+
"backto": "返回",
|
|
138
|
+
"clipboard": "复制到剪贴板",
|
|
139
|
+
"clipboardError": "无法复制到剪贴板。可能是浏览器不支持此功能",
|
|
140
|
+
"clipboardSuccess": "复制成功",
|
|
141
|
+
"collapse": "折叠",
|
|
142
|
+
"expand": "展开",
|
|
143
|
+
"fullscreen": "全屏",
|
|
144
|
+
"language": "更改语言",
|
|
145
|
+
"openInNewTab": "在新标签页中打开",
|
|
146
|
+
"openPreview": "打开预览",
|
|
147
|
+
"noSelectedTR": "没有选择的测试结果",
|
|
148
|
+
"comparison": "对比",
|
|
149
|
+
"showDiff": "显示差异",
|
|
150
|
+
"viewMode": "查看模式",
|
|
151
|
+
"unified": "统一",
|
|
152
|
+
"side-by-side": "并排",
|
|
153
|
+
"compareBy": "比较方式",
|
|
154
|
+
"chars": "字符",
|
|
155
|
+
"words": "单词",
|
|
156
|
+
"lines": "行",
|
|
157
|
+
"actual": "实际",
|
|
158
|
+
"expected": "预期"
|
|
159
|
+
},
|
|
160
|
+
"errors": {
|
|
161
|
+
"missedAttachment": "未找到附件"
|
|
162
|
+
},
|
|
163
|
+
"sections": {
|
|
164
|
+
"report": "Report",
|
|
165
|
+
"charts": "图形",
|
|
166
|
+
"timeline": "时间轴"
|
|
167
|
+
},
|
|
168
|
+
"timeline": {
|
|
169
|
+
"empty": "无数据",
|
|
170
|
+
"empty_host": "{{ host }} 无数据",
|
|
171
|
+
"selected_one": "已选择 {{ count }} 个测试({{ percentage }}%),持续时间大于 {{ minDuration }} 且小于 {{ maxDuration }}",
|
|
172
|
+
"selected_other": "已选择 {{ count }} 个测试({{ percentage }}%),持续时间大于 {{ minDuration }} 且小于 {{ maxDuration }}",
|
|
173
|
+
"host": "主机: {{ host }}"
|
|
174
|
+
},
|
|
175
|
+
"charts": {
|
|
176
|
+
"trend": {
|
|
177
|
+
"title": "趋势图表: {{type}}",
|
|
178
|
+
"type": {
|
|
179
|
+
"status": "状态",
|
|
180
|
+
"severity": "严重程度"
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
"currentStatus": {
|
|
184
|
+
"title": "当前状态",
|
|
185
|
+
"status": {
|
|
186
|
+
"passed": "$t(statuses:passed, capitalize)",
|
|
187
|
+
"failed": "$t(statuses:failed, capitalize)",
|
|
188
|
+
"broken": "$t(statuses:broken, capitalize)",
|
|
189
|
+
"skipped": "$t(statuses:skipped, capitalize)",
|
|
190
|
+
"unknown": "$t(statuses:unknown, capitalize)"
|
|
191
|
+
},
|
|
192
|
+
"percentage": "{{percentage}}%",
|
|
193
|
+
"of": "共 {{total}}",
|
|
194
|
+
"total": "总计",
|
|
195
|
+
"tests": {
|
|
196
|
+
"new_zero": "没有新测试",
|
|
197
|
+
"new_one": "{{count}} 个新测试",
|
|
198
|
+
"new_other": "{{count}} 个新测试",
|
|
199
|
+
"flaky_zero": "没有不稳定测试",
|
|
200
|
+
"flaky_one": "{{count}} 个不稳定测试",
|
|
201
|
+
"flaky_other": "{{count}} 个不稳定测试",
|
|
202
|
+
"retries_zero": "没有重试测试",
|
|
203
|
+
"retries_one": "{{count}} 个重试测试",
|
|
204
|
+
"retries_other": "{{count}} 个重试测试"
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
"statusDynamics": {
|
|
208
|
+
"title": "状态动态",
|
|
209
|
+
"status": {
|
|
210
|
+
"passed": "$t(statuses:passed, capitalize)",
|
|
211
|
+
"failed": "$t(statuses:failed, capitalize)",
|
|
212
|
+
"broken": "$t(statuses:broken, capitalize)",
|
|
213
|
+
"skipped": "$t(statuses:skipped, capitalize)",
|
|
214
|
+
"unknown": "$t(statuses:unknown, capitalize)"
|
|
215
|
+
},
|
|
216
|
+
"no-history": "$t(empty:no-history-results)",
|
|
217
|
+
"no-results": "$t(empty:no-results)",
|
|
218
|
+
"tooltips": {
|
|
219
|
+
"current": "最新报告 ({{timestamp, timestamp_long_no_seconds}})",
|
|
220
|
+
"history": "{{timestamp, timestamp_long_no_seconds}} 的报告"
|
|
221
|
+
},
|
|
222
|
+
"ticks": {
|
|
223
|
+
"current": "最新",
|
|
224
|
+
"history": "{{timestamp, timestamp_date}}"
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
"statusTransitions": {
|
|
228
|
+
"title": "状态转换",
|
|
229
|
+
"legend": {
|
|
230
|
+
"trend": "修复率"
|
|
231
|
+
},
|
|
232
|
+
"transitions": {
|
|
233
|
+
"new": "$t(transitions:new, capitalize)",
|
|
234
|
+
"fixed": "$t(transitions:fixed, capitalize)",
|
|
235
|
+
"regressed": "$t(transitions:regressed, capitalize)",
|
|
236
|
+
"malfunctioned": "$t(transitions:malfunctioned, capitalize)"
|
|
237
|
+
},
|
|
238
|
+
"no-history": "$t(empty:no-history-results)",
|
|
239
|
+
"no-results": "$t(empty:no-results)",
|
|
240
|
+
"tooltips": {
|
|
241
|
+
"current": "最新报告 ({{timestamp, timestamp_long_no_seconds}})",
|
|
242
|
+
"history": "{{timestamp, timestamp_long_no_seconds}} 的报告"
|
|
243
|
+
},
|
|
244
|
+
"ticks": {
|
|
245
|
+
"current": "最新",
|
|
246
|
+
"history": "{{timestamp, timestamp_date}}"
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
"durations": {
|
|
250
|
+
"title": "按{{groupBy}}的持续时间直方图",
|
|
251
|
+
"title_none": "持续时间直方图",
|
|
252
|
+
"no-results": "$t(empty:no-results)",
|
|
253
|
+
"groupBy": {
|
|
254
|
+
"none": "无",
|
|
255
|
+
"layer": "层"
|
|
256
|
+
},
|
|
257
|
+
"ticks": {
|
|
258
|
+
"durationRange": "{{from, format_duration}} - {{to, format_duration}}"
|
|
259
|
+
},
|
|
260
|
+
"tooltips": {
|
|
261
|
+
"durationRange": "{{from, format_duration}} - {{to, format_duration}}"
|
|
262
|
+
},
|
|
263
|
+
"legend": {
|
|
264
|
+
"value": "{{value}}",
|
|
265
|
+
"total": "测试数量"
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
"stabilityDistribution": {
|
|
269
|
+
"title": "稳定性分布",
|
|
270
|
+
"no-results": "$t(empty:no-results)",
|
|
271
|
+
"legend": {
|
|
272
|
+
"stabilityRate": "稳定性率"
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
"testBaseGrowthDynamics": {
|
|
276
|
+
"title": "测试基础增长动态",
|
|
277
|
+
"status": {
|
|
278
|
+
"newpassed": "新增 $t(statuses:passed)",
|
|
279
|
+
"newfailed": "新增 $t(statuses:failed)",
|
|
280
|
+
"newbroken": "新增 $t(statuses:broken)",
|
|
281
|
+
"newskipped": "新增 $t(statuses:skipped)",
|
|
282
|
+
"newunknown": "新增 $t(statuses:unknown)",
|
|
283
|
+
"removedpassed": "移除 $t(statuses:passed)",
|
|
284
|
+
"removedfailed": "移除 $t(statuses:failed)",
|
|
285
|
+
"removedbroken": "移除 $t(statuses:broken)",
|
|
286
|
+
"removedskipped": "移除 $t(statuses:skipped)",
|
|
287
|
+
"removedunknown": "移除 $t(statuses:unknown)"
|
|
288
|
+
},
|
|
289
|
+
"legend": {
|
|
290
|
+
"trend": "增长趋势"
|
|
291
|
+
},
|
|
292
|
+
"no-history": "$t(empty:no-history-results)",
|
|
293
|
+
"no-results": "$t(empty:no-results)",
|
|
294
|
+
"tooltips": {
|
|
295
|
+
"current": "最新报告 ({{timestamp, timestamp_long_no_seconds}})",
|
|
296
|
+
"history": "报告来自 {{timestamp, timestamp_long_no_seconds}}"
|
|
297
|
+
},
|
|
298
|
+
"ticks": {
|
|
299
|
+
"current": "最新",
|
|
300
|
+
"history": "{{timestamp, timestamp_date}}"
|
|
301
|
+
}
|
|
302
|
+
},
|
|
303
|
+
"fbsuAgePyramid": {
|
|
304
|
+
"title": "FBSU年龄金字塔",
|
|
305
|
+
"status": {
|
|
306
|
+
"passed": "$t(statuses:passed, capitalize)",
|
|
307
|
+
"failed": "$t(statuses:failed, capitalize)",
|
|
308
|
+
"broken": "$t(statuses:broken, capitalize)",
|
|
309
|
+
"skipped": "$t(statuses:skipped, capitalize)",
|
|
310
|
+
"unknown": "$t(statuses:unknown, capitalize)"
|
|
311
|
+
},
|
|
312
|
+
"no-history": "$t(empty:no-history-results)",
|
|
313
|
+
"no-results": "$t(empty:no-results)",
|
|
314
|
+
"tooltips": {
|
|
315
|
+
"current": "最新报告 ({{timestamp, timestamp_long_no_seconds}})",
|
|
316
|
+
"history": "报告来自 {{timestamp, timestamp_long_no_seconds}}"
|
|
317
|
+
},
|
|
318
|
+
"ticks": {
|
|
319
|
+
"current": "最新",
|
|
320
|
+
"history": "{{timestamp, timestamp_date}}"
|
|
321
|
+
}
|
|
322
|
+
},
|
|
323
|
+
"trSeverities": {
|
|
324
|
+
"title": "按严重程度的测试结果",
|
|
325
|
+
"no-results": "$t(empty:no-results)",
|
|
326
|
+
"status": {
|
|
327
|
+
"passed": "$t(statuses:passed, capitalize)",
|
|
328
|
+
"failed": "$t(statuses:failed, capitalize)",
|
|
329
|
+
"broken": "$t(statuses:broken, capitalize)",
|
|
330
|
+
"skipped": "$t(statuses:skipped, capitalize)",
|
|
331
|
+
"unknown": "$t(statuses:unknown, capitalize)"
|
|
332
|
+
},
|
|
333
|
+
"severity": {
|
|
334
|
+
"blocker": "$t(severity:blocker, capitalize)",
|
|
335
|
+
"critical": "$t(severity:critical, capitalize)",
|
|
336
|
+
"normal": "$t(severity:normal, capitalize)",
|
|
337
|
+
"minor": "$t(severity:minor, capitalize)",
|
|
338
|
+
"trivial": "$t(severity:trivial, capitalize)",
|
|
339
|
+
"unset": "无严重程度"
|
|
340
|
+
}
|
|
341
|
+
},
|
|
342
|
+
"durationDynamics": {
|
|
343
|
+
"title": "持续时间动态",
|
|
344
|
+
"durations": {
|
|
345
|
+
"sequential": "顺序持续时间",
|
|
346
|
+
"duration": "测试持续时间",
|
|
347
|
+
"speedup": "加速"
|
|
348
|
+
},
|
|
349
|
+
"no-results": "$t(empty:no-results)",
|
|
350
|
+
"tooltips": {
|
|
351
|
+
"current": "最新报告 ({{timestamp, timestamp_long_no_seconds}})",
|
|
352
|
+
"history": "{{timestamp, timestamp_long_no_seconds}} 的报告"
|
|
353
|
+
},
|
|
354
|
+
"ticks": {
|
|
355
|
+
"current": "最新",
|
|
356
|
+
"history": "{{timestamp, timestamp_date}}"
|
|
357
|
+
},
|
|
358
|
+
"legend": {
|
|
359
|
+
"duration": "{{duration, format_duration}}",
|
|
360
|
+
"speedup": "{{speedup}}x"
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
"transitions": {
|
|
365
|
+
"description": {
|
|
366
|
+
"new": "此测试结果在报告中的首次出现",
|
|
367
|
+
"fixed": "之前\"失败\"或\"损坏\"的测试现在\"通过\"了",
|
|
368
|
+
"regressed": "之前\"通过\"或\"损坏\"的测试现在\"失败\"了",
|
|
369
|
+
"malfunctioned": "之前\"通过\"或\"失败\"的测试现在\"损坏\"了",
|
|
370
|
+
"retries": "{{count}} 次重试",
|
|
371
|
+
"flaky": "多次运行结果不一致"
|
|
372
|
+
},
|
|
373
|
+
"new": "新的",
|
|
374
|
+
"fixed": "已修复",
|
|
375
|
+
"regressed": "已回归",
|
|
376
|
+
"malfunctioned": "已损坏"
|
|
377
|
+
}
|
|
378
|
+
}
|
package/src/stores/chart.ts
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { PieChartValues } from "@allurereport/charts-api";
|
|
2
|
+
import { type Statistic } from "@allurereport/core-api";
|
|
3
|
+
import { createChartsWithEnvs, fetchReportJsonData, getPieChartValues } from "@allurereport/web-commons";
|
|
4
|
+
import type { ChartsResponse, UIChartsDataWithEnvs } from "@allurereport/web-commons";
|
|
2
5
|
import { signal } from "@preact/signals";
|
|
3
|
-
import { StoreSignalState } from "@/stores/types";
|
|
6
|
+
import type { StoreSignalState } from "@/stores/types";
|
|
4
7
|
|
|
5
|
-
export const pieChartStore = signal<StoreSignalState<
|
|
8
|
+
export const pieChartStore = signal<StoreSignalState<PieChartValues>>({
|
|
6
9
|
loading: true,
|
|
7
10
|
error: undefined,
|
|
8
11
|
data: undefined,
|
|
9
12
|
});
|
|
10
13
|
|
|
11
|
-
export const fetchPieChartData = async () => {
|
|
14
|
+
export const fetchPieChartData = async (env: string) => {
|
|
12
15
|
pieChartStore.value = {
|
|
13
16
|
...pieChartStore.value,
|
|
14
17
|
loading: true,
|
|
@@ -16,10 +19,12 @@ export const fetchPieChartData = async () => {
|
|
|
16
19
|
};
|
|
17
20
|
|
|
18
21
|
try {
|
|
19
|
-
const res = await fetchReportJsonData("widgets/
|
|
22
|
+
const res = await fetchReportJsonData<Statistic>(env ? `widgets/${env}/statistic.json` : "widgets/statistic.json", {
|
|
23
|
+
bustCache: true,
|
|
24
|
+
});
|
|
20
25
|
|
|
21
26
|
pieChartStore.value = {
|
|
22
|
-
data: res,
|
|
27
|
+
data: getPieChartValues(res),
|
|
23
28
|
error: undefined,
|
|
24
29
|
loading: false,
|
|
25
30
|
};
|
|
@@ -30,3 +35,33 @@ export const fetchPieChartData = async () => {
|
|
|
30
35
|
};
|
|
31
36
|
}
|
|
32
37
|
};
|
|
38
|
+
|
|
39
|
+
export const chartsStore = signal<StoreSignalState<UIChartsDataWithEnvs>>({
|
|
40
|
+
loading: true,
|
|
41
|
+
error: undefined,
|
|
42
|
+
data: undefined,
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
export const fetchChartsData = async () => {
|
|
46
|
+
chartsStore.value = {
|
|
47
|
+
...chartsStore.value,
|
|
48
|
+
loading: true,
|
|
49
|
+
error: undefined,
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
try {
|
|
53
|
+
const res = await fetchReportJsonData<ChartsResponse>("widgets/charts.json", { bustCache: true });
|
|
54
|
+
|
|
55
|
+
chartsStore.value = {
|
|
56
|
+
data: createChartsWithEnvs(res),
|
|
57
|
+
error: undefined,
|
|
58
|
+
loading: false,
|
|
59
|
+
};
|
|
60
|
+
} catch (err) {
|
|
61
|
+
chartsStore.value = {
|
|
62
|
+
data: undefined,
|
|
63
|
+
error: err.message,
|
|
64
|
+
loading: false,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { type TestEnvGroup } from "@allurereport/core-api";
|
|
2
|
+
import { fetchReportJsonData } from "@allurereport/web-commons";
|
|
3
|
+
import { effect, signal } from "@preact/signals";
|
|
4
|
+
import type { StoreSignalState } from "@/stores/types";
|
|
5
|
+
import { loadFromLocalStorage } from "@/utils/loadFromLocalStorage";
|
|
6
|
+
|
|
7
|
+
export const environmentsStore = signal<StoreSignalState<string[]>>({
|
|
8
|
+
loading: false,
|
|
9
|
+
error: undefined,
|
|
10
|
+
data: [],
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export const testEnvGroupsStore = signal<StoreSignalState<Record<string, TestEnvGroup>>>({
|
|
14
|
+
loading: false,
|
|
15
|
+
error: undefined,
|
|
16
|
+
data: {},
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export const collapsedEnvironments = signal<string[]>(loadFromLocalStorage<string[]>("collapsedEnvironments", []));
|
|
20
|
+
|
|
21
|
+
export const currentEnvironment = signal<string>(loadFromLocalStorage<string>("currentEnvironment", ""));
|
|
22
|
+
|
|
23
|
+
export const setCurrentEnvironment = (env: string) => {
|
|
24
|
+
currentEnvironment.value = env;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const fetchEnvironments = async () => {
|
|
28
|
+
environmentsStore.value = {
|
|
29
|
+
...environmentsStore.value,
|
|
30
|
+
loading: true,
|
|
31
|
+
error: undefined,
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
try {
|
|
35
|
+
const res = await fetchReportJsonData<string[]>("widgets/environments.json", { bustCache: true });
|
|
36
|
+
|
|
37
|
+
environmentsStore.value = {
|
|
38
|
+
data: res,
|
|
39
|
+
error: undefined,
|
|
40
|
+
loading: false,
|
|
41
|
+
};
|
|
42
|
+
} catch (e) {
|
|
43
|
+
environmentsStore.value = {
|
|
44
|
+
...environmentsStore.value,
|
|
45
|
+
error: e.message,
|
|
46
|
+
loading: false,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const fetchTestEnvGroup = async (id: string) => {
|
|
52
|
+
if (testEnvGroupsStore.value.data[id]) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
testEnvGroupsStore.value = {
|
|
57
|
+
...testEnvGroupsStore.value,
|
|
58
|
+
loading: true,
|
|
59
|
+
error: undefined,
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
try {
|
|
63
|
+
const res = await fetchReportJsonData<TestEnvGroup | undefined>(`data/test-env-groups/${id}.json`);
|
|
64
|
+
|
|
65
|
+
testEnvGroupsStore.value = {
|
|
66
|
+
data: {
|
|
67
|
+
...testEnvGroupsStore.value.data,
|
|
68
|
+
[id]: res,
|
|
69
|
+
},
|
|
70
|
+
error: undefined,
|
|
71
|
+
loading: false,
|
|
72
|
+
};
|
|
73
|
+
} catch (e) {
|
|
74
|
+
testEnvGroupsStore.value = {
|
|
75
|
+
...testEnvGroupsStore.value,
|
|
76
|
+
error: e.message,
|
|
77
|
+
loading: false,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
effect(() => {
|
|
83
|
+
localStorage.setItem("currentEnvironment", JSON.stringify(currentEnvironment.value));
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
effect(() => {
|
|
87
|
+
localStorage.setItem("collapsedEnvironments", JSON.stringify([...collapsedEnvironments.value]));
|
|
88
|
+
});
|
package/src/stores/envInfo.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { EnvironmentItem } from "@allurereport/core-api";
|
|
2
2
|
import { fetchReportJsonData } from "@allurereport/web-commons";
|
|
3
3
|
import { signal } from "@preact/signals";
|
|
4
|
-
import { StoreSignalState } from "@/stores/types";
|
|
4
|
+
import type { StoreSignalState } from "@/stores/types";
|
|
5
5
|
|
|
6
6
|
export const envInfoStore = signal<StoreSignalState<EnvironmentItem[]>>({
|
|
7
7
|
loading: false,
|
|
@@ -17,7 +17,7 @@ export const fetchEnvInfo = async () => {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
try {
|
|
20
|
-
const res = await fetchReportJsonData<EnvironmentItem[]>("widgets/allure_environment.json");
|
|
20
|
+
const res = await fetchReportJsonData<EnvironmentItem[]>("widgets/allure_environment.json", { bustCache: true });
|
|
21
21
|
|
|
22
22
|
envInfoStore.value = {
|
|
23
23
|
data: res,
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type PluginGlobals } from "@allurereport/plugin-api";
|
|
2
|
+
import { fetchReportJsonData } from "@allurereport/web-commons";
|
|
3
|
+
import { signal } from "@preact/signals";
|
|
4
|
+
import { type StoreSignalState } from "./types";
|
|
5
|
+
|
|
6
|
+
export const globalsStore = signal<StoreSignalState<PluginGlobals>>({
|
|
7
|
+
loading: true,
|
|
8
|
+
error: undefined,
|
|
9
|
+
data: undefined,
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export const fetchGlobals = async () => {
|
|
13
|
+
try {
|
|
14
|
+
const data = await fetchReportJsonData<PluginGlobals>("widgets/globals.json");
|
|
15
|
+
|
|
16
|
+
globalsStore.value = {
|
|
17
|
+
data,
|
|
18
|
+
error: undefined,
|
|
19
|
+
loading: false,
|
|
20
|
+
};
|
|
21
|
+
} catch (err) {
|
|
22
|
+
globalsStore.value = {
|
|
23
|
+
...globalsStore.value,
|
|
24
|
+
error: err.message,
|
|
25
|
+
loading: false,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { getReportOptions } from "@allurereport/web-commons";
|
|
2
|
+
import { computed, signal } from "@preact/signals";
|
|
3
|
+
import type { AwesomeReportOptions, Layout } from "types";
|
|
4
|
+
|
|
5
|
+
export const layoutStore = signal<Layout>("base");
|
|
6
|
+
export const isLayoutLoading = signal(false);
|
|
7
|
+
|
|
8
|
+
export const setLayout = (newLayout: Layout): void => {
|
|
9
|
+
layoutStore.value = newLayout;
|
|
10
|
+
document.documentElement.setAttribute("data-layout", newLayout as string);
|
|
11
|
+
window.localStorage.setItem("layout", newLayout as string);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const toggleLayout = () => {
|
|
15
|
+
isLayoutLoading.value = true;
|
|
16
|
+
|
|
17
|
+
setTimeout(() => {
|
|
18
|
+
setLayout(layoutStore.value === "base" ? "split" : "base");
|
|
19
|
+
|
|
20
|
+
setTimeout(() => {
|
|
21
|
+
isLayoutLoading.value = false;
|
|
22
|
+
}, 300);
|
|
23
|
+
}, 200);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const isSplitMode = computed(() => layoutStore.value === "split");
|
|
27
|
+
|
|
28
|
+
export const getLayout = () => {
|
|
29
|
+
const { layout } = getReportOptions<AwesomeReportOptions>() ?? {};
|
|
30
|
+
const layoutFromLS = window.localStorage.getItem("layout") || (layout as Layout) || "base";
|
|
31
|
+
|
|
32
|
+
if (layoutFromLS) {
|
|
33
|
+
setLayout(layoutFromLS as Layout);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
};
|