@allurereport/web-awesome 3.0.0-beta.12 → 3.0.0-beta.14
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-52d1decd.js → 173.app-1829fb8f.js} +1 -1
- package/dist/multi/174.app-1829fb8f.js +1 -0
- package/dist/multi/252.app-1829fb8f.js +1 -0
- package/dist/multi/{282.app-52d1decd.js → 282.app-1829fb8f.js} +1 -1
- package/dist/multi/29.app-1829fb8f.js +1 -0
- package/dist/multi/416.app-1829fb8f.js +1 -0
- package/dist/multi/527.app-1829fb8f.js +1 -0
- package/dist/multi/{600.app-52d1decd.js → 600.app-1829fb8f.js} +1 -1
- package/dist/multi/605.app-1829fb8f.js +1 -0
- package/dist/multi/{638.app-52d1decd.js → 638.app-1829fb8f.js} +1 -1
- package/dist/multi/672.app-1829fb8f.js +1 -0
- package/dist/multi/{686.app-52d1decd.js → 686.app-1829fb8f.js} +1 -1
- package/dist/multi/725.app-1829fb8f.js +1 -0
- package/dist/multi/{741.app-52d1decd.js → 741.app-1829fb8f.js} +1 -1
- package/dist/multi/755.app-1829fb8f.js +1 -0
- package/dist/multi/{894.app-52d1decd.js → 894.app-1829fb8f.js} +1 -1
- package/dist/multi/943.app-1829fb8f.js +1 -0
- package/dist/multi/980.app-1829fb8f.js +1 -0
- package/dist/multi/app-1829fb8f.js +2 -0
- package/dist/multi/manifest.json +20 -20
- package/dist/multi/{styles-52d1decd.css → styles-1829fb8f.css} +13 -11
- package/dist/single/app-3a6e31c7.js +2 -0
- package/dist/single/manifest.json +1 -1
- package/package.json +4 -4
- package/src/components/BaseLayout/index.tsx +1 -4
- package/src/components/BaseLayout/styles.scss +4 -2
- package/src/components/Charts/index.tsx +89 -0
- package/src/components/Charts/styles.scss +29 -0
- package/src/components/Footer/index.tsx +6 -2
- package/src/components/Header/index.tsx +5 -2
- package/src/components/Header/styles.scss +2 -0
- package/src/components/MainReport/index.tsx +0 -2
- package/src/components/MetadataButton/index.tsx +2 -2
- package/src/components/Report/index.tsx +7 -0
- package/src/components/ReportBody/Filters.tsx +2 -2
- package/src/components/ReportBody/index.tsx +24 -13
- package/src/components/ReportBody/styles.scss +1 -0
- package/src/components/ReportHeader/index.tsx +3 -0
- package/src/components/ReportMetadata/MetadataWithIcon.tsx +1 -1
- package/src/components/SectionPicker/index.tsx +54 -0
- package/src/components/SectionPicker/styles.scss +5 -0
- package/src/components/SectionSwitcher/index.tsx +14 -0
- package/src/components/SectionSwitcher/styles.scss +4 -0
- package/src/components/SectionTabs/index.tsx +0 -0
- package/src/components/SideBySide/styles.scss +1 -1
- package/src/components/SplitLayout/index.tsx +1 -3
- package/src/components/SplitLayout/styles.scss +1 -3
- package/src/components/TestResult/TrDropdown/index.tsx +1 -2
- package/src/components/TestResult/TrEnvironmentItem/index.tsx +3 -3
- package/src/components/TestResult/TrEnvironmentsView/index.tsx +2 -2
- package/src/components/TestResult/TrHistory/TrHistoryItem.tsx +1 -2
- package/src/components/TestResult/TrInfo/index.tsx +16 -12
- package/src/components/TestResult/TrPwTraces/PwTraceButton.tsx +0 -1
- package/src/components/TestResult/TrRetriesView/TrRetriesItem.tsx +5 -4
- package/src/components/TestResult/TrSteps/TrAttachment.tsx +33 -6
- package/src/components/TestResult/TrSteps/TrStep.tsx +7 -5
- package/src/components/TestResult/TrSteps/styles.scss +4 -6
- package/src/components/TestResult/TrTabs/index.tsx +18 -6
- package/src/components/TestResult/TrTabs/styles.scss +0 -3
- package/src/components/TestResult/index.tsx +0 -1
- package/src/components/Tree/index.tsx +6 -6
- package/src/components/Tree/styles.scss +0 -4
- package/src/index.tsx +26 -12
- package/src/locales/az.json +16 -0
- package/src/locales/de.json +17 -0
- package/src/locales/en.json +17 -1
- package/src/locales/es.json +17 -1
- package/src/locales/fr.json +17 -1
- package/src/locales/he.json +16 -0
- package/src/locales/hy.json +16 -0
- package/src/locales/it.json +17 -1
- package/src/locales/ja.json +17 -1
- package/src/locales/ka.json +16 -0
- package/src/locales/kr.json +17 -1
- package/src/locales/nl.json +17 -1
- package/src/locales/pl.json +17 -1
- package/src/locales/pt.json +16 -0
- package/src/locales/ru.json +16 -0
- package/src/locales/sv.json +17 -1
- package/src/locales/tr.json +17 -1
- package/src/locales/zh.json +17 -1
- package/src/stores/chart.ts +32 -0
- package/src/stores/locale.ts +2 -0
- package/src/stores/router.ts +76 -16
- package/src/stores/sections.ts +63 -0
- package/src/stores/tree.ts +9 -6
- package/src/styles.scss +21 -0
- package/src/utils/charts.ts +169 -0
- package/src/utils/time.ts +1 -0
- package/types.d.ts +3 -1
- package/dist/multi/174.app-52d1decd.js +0 -1
- package/dist/multi/252.app-52d1decd.js +0 -1
- package/dist/multi/29.app-52d1decd.js +0 -1
- package/dist/multi/416.app-52d1decd.js +0 -1
- package/dist/multi/527.app-52d1decd.js +0 -1
- package/dist/multi/605.app-52d1decd.js +0 -1
- package/dist/multi/672.app-52d1decd.js +0 -1
- package/dist/multi/725.app-52d1decd.js +0 -1
- package/dist/multi/755.app-52d1decd.js +0 -1
- package/dist/multi/943.app-52d1decd.js +0 -1
- package/dist/multi/980.app-52d1decd.js +0 -1
- package/dist/multi/app-52d1decd.js +0 -2
- package/dist/single/app-83b0c4fc.js +0 -2
- package/src/components/ArrowButton/index.tsx +0 -36
- package/src/components/ArrowButton/styles.scss +0 -35
- /package/dist/multi/{app-52d1decd.js.LICENSE.txt → app-1829fb8f.js.LICENSE.txt} +0 -0
- /package/dist/single/{app-83b0c4fc.js.LICENSE.txt → app-3a6e31c7.js.LICENSE.txt} +0 -0
package/src/locales/it.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"testSummary": {
|
|
14
14
|
"total": "Totale",
|
|
15
15
|
"flaky": "Test instabili",
|
|
16
|
-
"retries": "Test
|
|
16
|
+
"retries": "Test ripetuti",
|
|
17
17
|
"new": "Nuovi test"
|
|
18
18
|
},
|
|
19
19
|
"tabs": {
|
|
@@ -138,5 +138,21 @@
|
|
|
138
138
|
},
|
|
139
139
|
"errors": {
|
|
140
140
|
"missedAttachment": "Allegato non trovato"
|
|
141
|
+
},
|
|
142
|
+
"sections": {
|
|
143
|
+
"report": "Report",
|
|
144
|
+
"charts": "Grafici"
|
|
145
|
+
},
|
|
146
|
+
"charts": {
|
|
147
|
+
"trend": {
|
|
148
|
+
"title": "Grafico di tendenza: {{type}}",
|
|
149
|
+
"type": {
|
|
150
|
+
"status": "Stato",
|
|
151
|
+
"severity": "Gravità"
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"pie": {
|
|
155
|
+
"title": "Tasso di successo dei test"
|
|
156
|
+
}
|
|
141
157
|
}
|
|
142
158
|
}
|
package/src/locales/ja.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"testSummary": {
|
|
14
14
|
"total": "合計",
|
|
15
15
|
"flaky": "不安定なテスト",
|
|
16
|
-
"retries": "
|
|
16
|
+
"retries": "再実行テスト",
|
|
17
17
|
"new": "新しいテスト"
|
|
18
18
|
},
|
|
19
19
|
"tabs": {
|
|
@@ -138,5 +138,21 @@
|
|
|
138
138
|
},
|
|
139
139
|
"errors": {
|
|
140
140
|
"missedAttachment": "添付ファイルが見つかりません"
|
|
141
|
+
},
|
|
142
|
+
"sections": {
|
|
143
|
+
"report": "Report",
|
|
144
|
+
"charts": "グラフ"
|
|
145
|
+
},
|
|
146
|
+
"charts": {
|
|
147
|
+
"trend": {
|
|
148
|
+
"title": "トレンドチャート: {{type}}",
|
|
149
|
+
"type": {
|
|
150
|
+
"status": "ステータス",
|
|
151
|
+
"severity": "重要度"
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"pie": {
|
|
155
|
+
"title": "テスト成功率"
|
|
156
|
+
}
|
|
141
157
|
}
|
|
142
158
|
}
|
package/src/locales/ka.json
CHANGED
|
@@ -138,5 +138,21 @@
|
|
|
138
138
|
},
|
|
139
139
|
"errors": {
|
|
140
140
|
"missedAttachment": "დანართი ვერ მოიძებნა"
|
|
141
|
+
},
|
|
142
|
+
"sections": {
|
|
143
|
+
"report": "Report",
|
|
144
|
+
"charts": "გრაფიკები"
|
|
145
|
+
},
|
|
146
|
+
"charts": {
|
|
147
|
+
"trend": {
|
|
148
|
+
"title": "ტრენდის გრაფიკი: {{type}}",
|
|
149
|
+
"type": {
|
|
150
|
+
"status": "სტატუსი",
|
|
151
|
+
"severity": "სიმძიმე"
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"pie": {
|
|
155
|
+
"title": "ტესტების წარმატების მაჩვენებელი"
|
|
156
|
+
}
|
|
141
157
|
}
|
|
142
158
|
}
|
package/src/locales/kr.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"testSummary": {
|
|
14
14
|
"total": "총계",
|
|
15
15
|
"flaky": "불안정한 테스트들",
|
|
16
|
-
"retries": "재시도
|
|
16
|
+
"retries": "재시도 테스트",
|
|
17
17
|
"new": "새로운 테스트들"
|
|
18
18
|
},
|
|
19
19
|
"tabs": {
|
|
@@ -138,5 +138,21 @@
|
|
|
138
138
|
},
|
|
139
139
|
"errors": {
|
|
140
140
|
"missedAttachment": "첨부파일을 찾을 수 없습니다"
|
|
141
|
+
},
|
|
142
|
+
"sections": {
|
|
143
|
+
"report": "Report",
|
|
144
|
+
"charts": "그래프"
|
|
145
|
+
},
|
|
146
|
+
"charts": {
|
|
147
|
+
"trend": {
|
|
148
|
+
"title": "트렌드 차트: {{type}}",
|
|
149
|
+
"type": {
|
|
150
|
+
"status": "상태",
|
|
151
|
+
"severity": "심각도"
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"pie": {
|
|
155
|
+
"title": "테스트 성공률"
|
|
156
|
+
}
|
|
141
157
|
}
|
|
142
158
|
}
|
package/src/locales/nl.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"testSummary": {
|
|
14
14
|
"total": "Totaal",
|
|
15
15
|
"flaky": "Onstabiele tests",
|
|
16
|
-
"retries": "
|
|
16
|
+
"retries": "Herhaalde tests",
|
|
17
17
|
"new": "Nieuwe tests"
|
|
18
18
|
},
|
|
19
19
|
"tabs": {
|
|
@@ -138,5 +138,21 @@
|
|
|
138
138
|
},
|
|
139
139
|
"errors": {
|
|
140
140
|
"missedAttachment": "Bijlage niet gevonden"
|
|
141
|
+
},
|
|
142
|
+
"sections": {
|
|
143
|
+
"report": "Report",
|
|
144
|
+
"charts": "Grafieken"
|
|
145
|
+
},
|
|
146
|
+
"charts": {
|
|
147
|
+
"trend": {
|
|
148
|
+
"title": "Trendgrafiek: {{type}}",
|
|
149
|
+
"type": {
|
|
150
|
+
"status": "Status",
|
|
151
|
+
"severity": "Ernst"
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"pie": {
|
|
155
|
+
"title": "Test slagingspercentage"
|
|
156
|
+
}
|
|
141
157
|
}
|
|
142
158
|
}
|
package/src/locales/pl.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"testSummary": {
|
|
11
11
|
"total": "Wszystkie",
|
|
12
12
|
"flaky": "Niestabilne testy",
|
|
13
|
-
"retries": "
|
|
13
|
+
"retries": "Powtórzone testy",
|
|
14
14
|
"new": "Nowe testy"
|
|
15
15
|
},
|
|
16
16
|
"tabs": {
|
|
@@ -136,5 +136,21 @@
|
|
|
136
136
|
},
|
|
137
137
|
"errors": {
|
|
138
138
|
"missedAttachment": "Nie znaleziono załącznika"
|
|
139
|
+
},
|
|
140
|
+
"sections": {
|
|
141
|
+
"report": "Report",
|
|
142
|
+
"charts": "Wykresy"
|
|
143
|
+
},
|
|
144
|
+
"charts": {
|
|
145
|
+
"trend": {
|
|
146
|
+
"title": "Wykres trendu: {{type}}",
|
|
147
|
+
"type": {
|
|
148
|
+
"status": "Status",
|
|
149
|
+
"severity": "Ważność"
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
"pie": {
|
|
153
|
+
"title": "Wskaźnik powodzenia testów"
|
|
154
|
+
}
|
|
139
155
|
}
|
|
140
156
|
}
|
package/src/locales/pt.json
CHANGED
|
@@ -137,5 +137,21 @@
|
|
|
137
137
|
},
|
|
138
138
|
"errors": {
|
|
139
139
|
"missedAttachment": "Anexo não encontrado"
|
|
140
|
+
},
|
|
141
|
+
"sections": {
|
|
142
|
+
"report": "Report",
|
|
143
|
+
"charts": "Gráficos"
|
|
144
|
+
},
|
|
145
|
+
"charts": {
|
|
146
|
+
"trend": {
|
|
147
|
+
"title": "Gráfico de tendência: {{type}}",
|
|
148
|
+
"type": {
|
|
149
|
+
"status": "Estado",
|
|
150
|
+
"severity": "Severidade"
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
"pie": {
|
|
154
|
+
"title": "Taxa de sucesso dos testes"
|
|
155
|
+
}
|
|
140
156
|
}
|
|
141
157
|
}
|
package/src/locales/ru.json
CHANGED
|
@@ -136,5 +136,21 @@
|
|
|
136
136
|
},
|
|
137
137
|
"errors": {
|
|
138
138
|
"missedAttachment": "Вложение не найдено"
|
|
139
|
+
},
|
|
140
|
+
"sections": {
|
|
141
|
+
"report": "Report",
|
|
142
|
+
"charts": "Графики"
|
|
143
|
+
},
|
|
144
|
+
"charts": {
|
|
145
|
+
"trend": {
|
|
146
|
+
"title": "График тренда: {{type}}",
|
|
147
|
+
"type": {
|
|
148
|
+
"status": "Статус",
|
|
149
|
+
"severity": "Важность"
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
"pie": {
|
|
153
|
+
"title": "Успешность тестирования"
|
|
154
|
+
}
|
|
139
155
|
}
|
|
140
156
|
}
|
package/src/locales/sv.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"testSummary": {
|
|
14
14
|
"total": "Totalt",
|
|
15
15
|
"flaky": "Ostadiga tester",
|
|
16
|
-
"retries": "
|
|
16
|
+
"retries": "Omtagna tester",
|
|
17
17
|
"new": "Nya tester"
|
|
18
18
|
},
|
|
19
19
|
"tabs": {
|
|
@@ -138,5 +138,21 @@
|
|
|
138
138
|
},
|
|
139
139
|
"errors": {
|
|
140
140
|
"missedAttachment": "Bilaga hittades inte"
|
|
141
|
+
},
|
|
142
|
+
"sections": {
|
|
143
|
+
"report": "Report",
|
|
144
|
+
"charts": "Grafer"
|
|
145
|
+
},
|
|
146
|
+
"charts": {
|
|
147
|
+
"trend": {
|
|
148
|
+
"title": "Trenddiagram: {{type}}",
|
|
149
|
+
"type": {
|
|
150
|
+
"status": "Status",
|
|
151
|
+
"severity": "Allvarlighetsgrad"
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"pie": {
|
|
155
|
+
"title": "Testframgångsfrekvens"
|
|
156
|
+
}
|
|
141
157
|
}
|
|
142
158
|
}
|
package/src/locales/tr.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"testSummary": {
|
|
14
14
|
"total": "Toplam",
|
|
15
15
|
"flaky": "İstikrarsız Testler",
|
|
16
|
-
"retries": "
|
|
16
|
+
"retries": "Yinelenen Testler",
|
|
17
17
|
"new": "Yeni Testler"
|
|
18
18
|
},
|
|
19
19
|
"tabs": {
|
|
@@ -138,5 +138,21 @@
|
|
|
138
138
|
},
|
|
139
139
|
"errors": {
|
|
140
140
|
"missedAttachment": "Ek bulunamadı"
|
|
141
|
+
},
|
|
142
|
+
"sections": {
|
|
143
|
+
"report": "Report",
|
|
144
|
+
"charts": "Grafikler"
|
|
145
|
+
},
|
|
146
|
+
"charts": {
|
|
147
|
+
"trend": {
|
|
148
|
+
"title": "Trend Grafiği: {{type}}",
|
|
149
|
+
"type": {
|
|
150
|
+
"status": "Durum",
|
|
151
|
+
"severity": "Önem Derecesi"
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"pie": {
|
|
155
|
+
"title": "Test Başarı Oranı"
|
|
156
|
+
}
|
|
141
157
|
}
|
|
142
158
|
}
|
package/src/locales/zh.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"testSummary": {
|
|
14
14
|
"total": "总计",
|
|
15
15
|
"flaky": "不稳定的测试",
|
|
16
|
-
"retries": "
|
|
16
|
+
"retries": "重跑测试",
|
|
17
17
|
"new": "新的测试"
|
|
18
18
|
},
|
|
19
19
|
"tabs": {
|
|
@@ -138,5 +138,21 @@
|
|
|
138
138
|
},
|
|
139
139
|
"errors": {
|
|
140
140
|
"missedAttachment": "未找到附件"
|
|
141
|
+
},
|
|
142
|
+
"sections": {
|
|
143
|
+
"report": "Report",
|
|
144
|
+
"charts": "图形"
|
|
145
|
+
},
|
|
146
|
+
"charts": {
|
|
147
|
+
"trend": {
|
|
148
|
+
"title": "趋势图表: {{type}}",
|
|
149
|
+
"type": {
|
|
150
|
+
"status": "状态",
|
|
151
|
+
"severity": "严重程度"
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"pie": {
|
|
155
|
+
"title": "测试成功率"
|
|
156
|
+
}
|
|
141
157
|
}
|
|
142
158
|
}
|
package/src/stores/chart.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { fetchReportJsonData } from "@allurereport/web-commons";
|
|
2
2
|
import { signal } from "@preact/signals";
|
|
3
3
|
import type { StoreSignalState } from "@/stores/types";
|
|
4
|
+
import type { ChartsData, ChartsResponse } from "@/utils/charts";
|
|
5
|
+
import { createCharts } from "@/utils/charts";
|
|
4
6
|
|
|
5
7
|
export const pieChartStore = signal<StoreSignalState<any>>({
|
|
6
8
|
loading: true,
|
|
@@ -30,3 +32,33 @@ export const fetchPieChartData = async (env: string) => {
|
|
|
30
32
|
};
|
|
31
33
|
}
|
|
32
34
|
};
|
|
35
|
+
|
|
36
|
+
export const chartsStore = signal<StoreSignalState<ChartsData>>({
|
|
37
|
+
loading: true,
|
|
38
|
+
error: undefined,
|
|
39
|
+
data: undefined,
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
export const fetchChartsData = async () => {
|
|
43
|
+
chartsStore.value = {
|
|
44
|
+
...chartsStore.value,
|
|
45
|
+
loading: true,
|
|
46
|
+
error: undefined,
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
try {
|
|
50
|
+
const res = await fetchReportJsonData<ChartsResponse>("widgets/charts.json");
|
|
51
|
+
|
|
52
|
+
chartsStore.value = {
|
|
53
|
+
data: createCharts(res),
|
|
54
|
+
error: undefined,
|
|
55
|
+
loading: false,
|
|
56
|
+
};
|
|
57
|
+
} catch (err) {
|
|
58
|
+
chartsStore.value = {
|
|
59
|
+
data: undefined,
|
|
60
|
+
error: err.message,
|
|
61
|
+
loading: false,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
};
|
package/src/stores/locale.ts
CHANGED
package/src/stores/router.ts
CHANGED
|
@@ -1,42 +1,101 @@
|
|
|
1
1
|
import { computed, signal } from "@preact/signals";
|
|
2
2
|
|
|
3
|
-
type NavigateToString = string;
|
|
4
3
|
type NavigateToObject = {
|
|
5
|
-
|
|
4
|
+
category?: string;
|
|
6
5
|
params?: {
|
|
7
|
-
|
|
6
|
+
testResultId?: string | null;
|
|
7
|
+
subTab?: string | null;
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
params: params ? { tabName: params } : {},
|
|
11
|
+
type Route = {
|
|
12
|
+
category?: string;
|
|
13
|
+
params?: {
|
|
14
|
+
testResultId?: string | null;
|
|
15
|
+
subTab?: string | null;
|
|
17
16
|
};
|
|
18
17
|
};
|
|
19
18
|
|
|
20
|
-
export const
|
|
19
|
+
export const parseHash = (): Route => {
|
|
20
|
+
const hash = globalThis.location.hash.replace(/^#/, "").trim();
|
|
21
|
+
const parts = hash.split("/").filter(Boolean);
|
|
22
|
+
const [first, second] = parts;
|
|
23
|
+
|
|
24
|
+
if (parts.length === 0) {
|
|
25
|
+
return {};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (parts.length === 1) {
|
|
29
|
+
if (/^[a-f0-9]{32,}$/.test(first)) {
|
|
30
|
+
return { params: { testResultId: first } };
|
|
31
|
+
}
|
|
32
|
+
return { category: first || "", params: { testResultId: second } };
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (parts.length === 2) {
|
|
36
|
+
if (/^[a-f0-9]{32,}$/.test(first)) {
|
|
37
|
+
return {
|
|
38
|
+
params: {
|
|
39
|
+
testResultId: first,
|
|
40
|
+
subTab: second,
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return {
|
|
46
|
+
category: first,
|
|
47
|
+
params: {
|
|
48
|
+
testResultId: second,
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (parts.length === 3) {
|
|
54
|
+
const [category, testResultId, subTab] = parts;
|
|
55
|
+
return { category, params: { testResultId, subTab } };
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return {};
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export const route = signal<Route>(parseHash());
|
|
21
62
|
|
|
22
63
|
export const handleHashChange = () => {
|
|
23
64
|
const newRoute = parseHash();
|
|
24
65
|
|
|
25
|
-
if (
|
|
26
|
-
route.value
|
|
66
|
+
if (
|
|
67
|
+
newRoute.category !== route.value?.category ||
|
|
68
|
+
newRoute.params?.testResultId !== route.value.params?.testResultId ||
|
|
69
|
+
newRoute.params?.subTab !== route.value.params?.subTab
|
|
70
|
+
) {
|
|
71
|
+
route.value = { ...newRoute };
|
|
27
72
|
}
|
|
28
73
|
};
|
|
29
74
|
|
|
30
|
-
export const navigateTo = (path:
|
|
75
|
+
export const navigateTo = (path: NavigateToObject | string) => {
|
|
31
76
|
let newHash = "";
|
|
32
77
|
|
|
33
78
|
if (typeof path === "string") {
|
|
34
79
|
newHash = path.startsWith("#") ? path.slice(1) : path;
|
|
35
80
|
} else {
|
|
36
|
-
const {
|
|
81
|
+
const { category, params = {} } = path;
|
|
82
|
+
const parts: string[] = [];
|
|
37
83
|
|
|
38
|
-
|
|
84
|
+
if (category) {
|
|
85
|
+
parts.push(category);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if (params.testResultId) {
|
|
89
|
+
parts.push(params.testResultId);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (params.subTab) {
|
|
93
|
+
parts.push(params.subTab);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
newHash = parts.join("/");
|
|
39
97
|
}
|
|
98
|
+
|
|
40
99
|
history.pushState(null, "", `#${newHash}`);
|
|
41
100
|
handleHashChange();
|
|
42
101
|
};
|
|
@@ -45,4 +104,5 @@ export const openInNewTab = (path: string) => {
|
|
|
45
104
|
window.open(`#${path}`, "_blank");
|
|
46
105
|
};
|
|
47
106
|
|
|
48
|
-
export const activeTab = computed(() => route.value.
|
|
107
|
+
export const activeTab = computed(() => route.value.category || "");
|
|
108
|
+
export const activeSubTab = computed(() => route.value.params?.subTab || "overview");
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { getReportOptions } from "@allurereport/web-commons";
|
|
2
|
+
import { effect, signal } from "@preact/signals";
|
|
3
|
+
import { navigateTo, parseHash, route } from "@/stores/router";
|
|
4
|
+
import type { AwesomeReportOptions } from "../../types.js";
|
|
5
|
+
|
|
6
|
+
const DEFAULT_SECTION = "default";
|
|
7
|
+
type Section = string;
|
|
8
|
+
|
|
9
|
+
export const currentSection = signal<Section>("");
|
|
10
|
+
export const availableSections = signal<Section[]>([]);
|
|
11
|
+
|
|
12
|
+
const updateSectionState = (section: Section): void => {
|
|
13
|
+
currentSection.value = section;
|
|
14
|
+
document.documentElement.setAttribute("data-section", section);
|
|
15
|
+
globalThis.localStorage.setItem("chosenSection", section);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const setSection = (chosenSection: Section): void => {
|
|
19
|
+
const isDefaultSection = chosenSection === DEFAULT_SECTION;
|
|
20
|
+
const isValidSection = availableSections.value?.includes(chosenSection);
|
|
21
|
+
const isSectionChanged = currentSection.value !== chosenSection;
|
|
22
|
+
|
|
23
|
+
updateSectionState(chosenSection);
|
|
24
|
+
|
|
25
|
+
if (isDefaultSection) {
|
|
26
|
+
navigateTo({ category: "" });
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (isSectionChanged && isValidSection) {
|
|
31
|
+
navigateTo({ category: chosenSection });
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const getSection = () => {
|
|
36
|
+
const { category } = parseHash();
|
|
37
|
+
availableSections.value = getReportOptions<AwesomeReportOptions>()?.sections ?? [];
|
|
38
|
+
const defaultSectionFromReportOptions = getReportOptions<AwesomeReportOptions>()?.defaultSection ?? "";
|
|
39
|
+
const sectionFromUrl = parseHash().category;
|
|
40
|
+
const sectionFromLS =
|
|
41
|
+
globalThis.localStorage.getItem("chosenSection") === ""
|
|
42
|
+
? ""
|
|
43
|
+
: globalThis.localStorage.getItem("chosenSection") || defaultSectionFromReportOptions;
|
|
44
|
+
currentSection.value = sectionFromUrl || sectionFromLS;
|
|
45
|
+
|
|
46
|
+
if (category) {
|
|
47
|
+
setSection(category);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (sectionFromLS) {
|
|
52
|
+
setSection(sectionFromLS);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
setSection("");
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
effect(() => {
|
|
60
|
+
const category = route.value.category;
|
|
61
|
+
|
|
62
|
+
setSection(category || "");
|
|
63
|
+
});
|
package/src/stores/tree.ts
CHANGED
|
@@ -167,13 +167,16 @@ export const fetchEnvTreesData = async (envs: string[]) => {
|
|
|
167
167
|
envsToFetch.map((env) => fetchReportJsonData<AwesomeTree>(`widgets/${env}/tree.json`)),
|
|
168
168
|
);
|
|
169
169
|
|
|
170
|
+
const previous = treeStore.value.data;
|
|
170
171
|
treeStore.value = {
|
|
171
|
-
data:
|
|
172
|
-
(acc, env, index) =>
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
172
|
+
data: envsToFetch.reduce(
|
|
173
|
+
(acc, env, index) => {
|
|
174
|
+
return {
|
|
175
|
+
...acc,
|
|
176
|
+
[env]: data[index],
|
|
177
|
+
};
|
|
178
|
+
},
|
|
179
|
+
{ ...previous },
|
|
177
180
|
),
|
|
178
181
|
loading: false,
|
|
179
182
|
error: undefined,
|
package/src/styles.scss
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
position: relative;
|
|
3
3
|
max-width: 1920px;
|
|
4
4
|
margin: 0 auto;
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
height: 100vh;
|
|
5
8
|
|
|
6
9
|
&:hover {
|
|
7
10
|
.split {
|
|
@@ -10,6 +13,16 @@
|
|
|
10
13
|
}
|
|
11
14
|
}
|
|
12
15
|
|
|
16
|
+
.layout {
|
|
17
|
+
flex: 1 1 auto;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.content {
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
height: 100%;
|
|
24
|
+
}
|
|
25
|
+
|
|
13
26
|
.split {
|
|
14
27
|
opacity: 0;
|
|
15
28
|
position: absolute;
|
|
@@ -43,3 +56,11 @@
|
|
|
43
56
|
opacity: 1;
|
|
44
57
|
}
|
|
45
58
|
}
|
|
59
|
+
|
|
60
|
+
.layout-base {
|
|
61
|
+
max-width: 920px;
|
|
62
|
+
margin: auto;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.layout-split {
|
|
66
|
+
}
|