@allurereport/web-classic 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/.eslintrc.cjs +1 -1
- package/dist/multi/10.app-81fc0bb26fd1b73b22f9.js +1 -0
- package/dist/multi/222.app-81fc0bb26fd1b73b22f9.js +1 -0
- package/dist/multi/26.app-81fc0bb26fd1b73b22f9.js +1 -0
- package/dist/multi/302.app-81fc0bb26fd1b73b22f9.js +1 -0
- package/dist/multi/304.app-81fc0bb26fd1b73b22f9.js +1 -0
- package/dist/multi/369.app-81fc0bb26fd1b73b22f9.js +1 -0
- package/dist/multi/389.app-81fc0bb26fd1b73b22f9.js +1 -0
- package/dist/multi/498.app-81fc0bb26fd1b73b22f9.js +1 -0
- package/dist/multi/60.app-81fc0bb26fd1b73b22f9.js +1 -0
- package/dist/multi/643.app-81fc0bb26fd1b73b22f9.js +1 -0
- package/dist/multi/671.app-81fc0bb26fd1b73b22f9.js +1 -0
- package/dist/multi/725.app-81fc0bb26fd1b73b22f9.js +1 -0
- package/dist/multi/770.app-81fc0bb26fd1b73b22f9.js +1 -0
- package/dist/multi/848.app-81fc0bb26fd1b73b22f9.js +1 -0
- package/dist/multi/853.app-81fc0bb26fd1b73b22f9.js +1 -0
- package/dist/multi/872.app-81fc0bb26fd1b73b22f9.js +1 -0
- package/dist/multi/895.app-81fc0bb26fd1b73b22f9.js +1 -0
- package/dist/multi/920.app-81fc0bb26fd1b73b22f9.js +1 -0
- package/dist/multi/979.app-81fc0bb26fd1b73b22f9.js +1 -0
- package/dist/multi/991.app-81fc0bb26fd1b73b22f9.js +1 -0
- package/dist/multi/app-81fc0bb26fd1b73b22f9.js +2 -0
- package/dist/multi/{app-e5caa85e.js.LICENSE.txt → app-81fc0bb26fd1b73b22f9.js.LICENSE.txt} +9 -0
- package/dist/multi/manifest.json +26 -26
- package/dist/multi/styles-02faf4bb6ebabe212265.css +284 -0
- package/dist/single/app-997b57d6b8885a4f88c7.js +2 -0
- package/dist/single/{app-006b2a35.js.LICENSE.txt → app-997b57d6b8885a4f88c7.js.LICENSE.txt} +9 -0
- package/dist/single/manifest.json +1 -1
- package/package.json +19 -18
- package/src/assets/scss/palette.scss +391 -391
- package/src/assets/scss/theme.scss +288 -79
- package/src/components/Behaviors/BehaviorsList.tsx +3 -3
- package/src/components/Categories/CategoriesList.tsx +3 -3
- package/src/components/Footer/FooterLogo.tsx +1 -2
- package/src/components/Footer/FooterVersion.tsx +2 -2
- package/src/components/HeaderActions/HeaderActions.tsx +1 -2
- package/src/components/Modal/index.tsx +2 -2
- package/src/components/Overview/Overview.module.scss +29 -0
- package/src/components/Overview/index.tsx +101 -5
- package/src/components/Packages/PackagesList.tsx +3 -3
- package/src/components/ReportBody/index.tsx +2 -4
- package/src/components/ReportHeader/ReportHeaderLogo.tsx +6 -2
- package/src/components/ReportHeader/index.tsx +2 -2
- package/src/components/ReportMetadata/MetadataSummary.tsx +1 -2
- package/src/components/TestResult/TestResultAttachmentsView/index.tsx +2 -2
- package/src/components/TestResult/TestResultDescription/index.tsx +2 -2
- package/src/components/TestResult/TestResultEmpty/index.tsx +2 -9
- package/src/components/TestResult/TestResultHeader/index.tsx +3 -5
- package/src/components/TestResult/TestResultHistory/index.tsx +2 -2
- package/src/components/TestResult/TestResultInfo/TestResultInfoStatuses.tsx +1 -1
- package/src/components/TestResult/TestResultInfo/index.tsx +2 -2
- package/src/components/TestResult/TestResultLinks/index.tsx +2 -2
- package/src/components/TestResult/TestResultMetadata/index.tsx +2 -2
- package/src/components/TestResult/TestResultNavigation/index.tsx +2 -2
- package/src/components/TestResult/TestResultOverview.tsx +2 -2
- package/src/components/TestResult/TestResultParameters/index.tsx +2 -2
- package/src/components/TestResult/TestResultPrevStatuses/index.tsx +7 -7
- package/src/components/TestResult/TestResultRetriesView/TestResultRetriesItem.tsx +24 -8
- package/src/components/TestResult/TestResultRetriesView/index.tsx +10 -3
- package/src/components/TestResult/TestResultSetup/index.tsx +2 -2
- package/src/components/TestResult/TestResultSeverity/index.tsx +1 -1
- package/src/components/TestResult/TestResultStatus/index.tsx +1 -1
- package/src/components/TestResult/TestResultSteps/HtmlAttachmentPreview.tsx +28 -2
- package/src/components/TestResult/TestResultSteps/index.tsx +4 -4
- package/src/components/TestResult/TestResultSteps/styles.scss +1 -5
- package/src/components/TestResult/TestResultTeardown/index.tsx +2 -2
- package/src/components/TestResult/index.tsx +4 -4
- package/src/components/Tree/Tree.tsx +3 -3
- package/src/components/Tree/TreeHeader.tsx +1 -1
- package/src/components/Tree/index.tsx +3 -3
- package/src/index.tsx +1 -5
- package/src/stores/behaviors.ts +6 -6
- package/src/stores/categories.ts +6 -6
- package/src/stores/chart.ts +1 -1
- package/src/stores/charts.ts +22 -0
- package/src/stores/envInfo.ts +1 -1
- package/src/stores/locale.ts +3 -2
- package/src/stores/packages.ts +6 -6
- package/src/stores/router.ts +0 -2
- package/src/stores/stats.ts +1 -1
- package/src/stores/testResults.ts +4 -4
- package/src/stores/theme.ts +15 -18
- package/src/stores/tree.ts +6 -6
- package/src/stores/trend.ts +36 -0
- package/src/translations/am.json +2 -1
- package/src/translations/az.json +2 -1
- package/src/translations/de.json +2 -2
- package/src/translations/en.json +10 -1
- package/src/translations/es.json +2 -1
- package/src/translations/fr.json +2 -1
- package/src/translations/he.json +2 -1
- package/src/translations/it.json +2 -1
- package/src/translations/ja.json +2 -1
- package/src/translations/ka.json +2 -1
- package/src/translations/kr.json +2 -1
- package/src/translations/nl.json +2 -1
- package/src/translations/pl.json +2 -1
- package/src/translations/pt.json +2 -1
- package/src/translations/ru.json +2 -1
- package/src/translations/sv.json +2 -1
- package/src/translations/tr.json +2 -1
- package/src/translations/zh.json +2 -1
- package/src/utils/treeFilters.ts +13 -18
- package/test/dummy.test.ts +7 -0
- package/test/utils/treeFilters.test.ts +44 -44
- package/types.d.ts +22 -20
- package/webpack.config.js +8 -3
- package/.babelrc--old.cjs +0 -18
- package/.eslintrc--old.cjs +0 -125
- package/dist/multi/10.app-e5caa85e.js +0 -1
- package/dist/multi/222.app-e5caa85e.js +0 -1
- package/dist/multi/26.app-e5caa85e.js +0 -1
- package/dist/multi/302.app-e5caa85e.js +0 -1
- package/dist/multi/304.app-e5caa85e.js +0 -1
- package/dist/multi/369.app-e5caa85e.js +0 -1
- package/dist/multi/389.app-e5caa85e.js +0 -1
- package/dist/multi/498.app-e5caa85e.js +0 -1
- package/dist/multi/60.app-e5caa85e.js +0 -1
- package/dist/multi/643.app-e5caa85e.js +0 -1
- package/dist/multi/671.app-e5caa85e.js +0 -1
- package/dist/multi/725.app-e5caa85e.js +0 -1
- package/dist/multi/770.app-e5caa85e.js +0 -1
- package/dist/multi/848.app-e5caa85e.js +0 -1
- package/dist/multi/853.app-e5caa85e.js +0 -1
- package/dist/multi/872.app-e5caa85e.js +0 -1
- package/dist/multi/895.app-e5caa85e.js +0 -1
- package/dist/multi/920.app-e5caa85e.js +0 -1
- package/dist/multi/979.app-e5caa85e.js +0 -1
- package/dist/multi/991.app-e5caa85e.js +0 -1
- package/dist/multi/app-e5caa85e.js +0 -2
- package/dist/multi/styles-e5caa85e.css +0 -283
- package/dist/single/app-006b2a35.js +0 -2
- package/package--old.json +0 -106
- 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/utils/capitalize.ts +0 -6
- package/webpack.config--old.js +0 -127
- /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/translations/fr.json
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"filters": {
|
|
27
27
|
"more-filters": "Plus de filtres",
|
|
28
|
-
"enable-filter": "Activer le filtre \"{filter}\"",
|
|
28
|
+
"enable-filter": "Activer le filtre \"{{filter}}\"",
|
|
29
29
|
"flaky": "Instables",
|
|
30
30
|
"retry": "Réessais",
|
|
31
31
|
"new": "Nouveaux"
|
|
@@ -95,6 +95,7 @@
|
|
|
95
95
|
"showLess": "Montrer moins",
|
|
96
96
|
"showMore": "Montrer plus",
|
|
97
97
|
"copy": "Copier",
|
|
98
|
+
"attempt": "Tentative {{attempt}} sur {{total}}",
|
|
98
99
|
"at": "à"
|
|
99
100
|
},
|
|
100
101
|
"controls": {
|
package/src/translations/he.json
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"filters": {
|
|
27
27
|
"more-filters": "עוד מסננים",
|
|
28
|
-
"enable-filter": "אפשר מסנן \"{filter}\"",
|
|
28
|
+
"enable-filter": "אפשר מסנן \"{{filter}}\"",
|
|
29
29
|
"flaky": "לא יציב",
|
|
30
30
|
"retry": "חוזר",
|
|
31
31
|
"new": "חדש"
|
|
@@ -95,6 +95,7 @@
|
|
|
95
95
|
"showLess": "הצג פחות",
|
|
96
96
|
"showMore": "הצג עוד",
|
|
97
97
|
"copy": "העתק",
|
|
98
|
+
"attempt": "ניסיון {{attempt}} מתוך {{total}}",
|
|
98
99
|
"at": "ב-"
|
|
99
100
|
},
|
|
100
101
|
"controls": {
|
package/src/translations/it.json
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"filters": {
|
|
27
27
|
"more-filters": "Più filtri",
|
|
28
|
-
"enable-filter": "Abilita il filtro \"{filter}\"",
|
|
28
|
+
"enable-filter": "Abilita il filtro \"{{filter}}\"",
|
|
29
29
|
"flaky": "Instabili",
|
|
30
30
|
"retry": "Ritentati",
|
|
31
31
|
"new": "Nuovi"
|
|
@@ -95,6 +95,7 @@
|
|
|
95
95
|
"showLess": "Mostra meno",
|
|
96
96
|
"showMore": "Mostra di più",
|
|
97
97
|
"copy": "Copia",
|
|
98
|
+
"attempt": "Tentativo {{attempt}} di {{total}}",
|
|
98
99
|
"at": "a"
|
|
99
100
|
},
|
|
100
101
|
"controls": {
|
package/src/translations/ja.json
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"filters": {
|
|
27
27
|
"more-filters": "さらにフィルター",
|
|
28
|
-
"enable-filter": "\"{filter}\" フィルターを有効にする",
|
|
28
|
+
"enable-filter": "\"{{filter}}\" フィルターを有効にする",
|
|
29
29
|
"flaky": "不安定",
|
|
30
30
|
"retry": "再試行",
|
|
31
31
|
"new": "新しい"
|
|
@@ -95,6 +95,7 @@
|
|
|
95
95
|
"showLess": "表示を減らす",
|
|
96
96
|
"showMore": "もっと見る",
|
|
97
97
|
"copy": "コピー",
|
|
98
|
+
"attempt": "試行 {{attempt}} 回目(全 {{total}} 回)",
|
|
98
99
|
"at": "時"
|
|
99
100
|
},
|
|
100
101
|
"controls": {
|
package/src/translations/ka.json
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"filters": {
|
|
27
27
|
"more-filters": "დამატებითი ფილტრები",
|
|
28
|
-
"enable-filter": "ჩართეთ ფილტრი \"{filter}\"",
|
|
28
|
+
"enable-filter": "ჩართეთ ფილტრი \"{{filter}}\"",
|
|
29
29
|
"flaky": "არასტაბილური",
|
|
30
30
|
"retry": "ხელახალი",
|
|
31
31
|
"new": "ახალი"
|
|
@@ -95,6 +95,7 @@
|
|
|
95
95
|
"showLess": "ნაკლების ჩვენება",
|
|
96
96
|
"showMore": "მეტის ჩვენება",
|
|
97
97
|
"copy": "კოპირება",
|
|
98
|
+
"attempt": "მცდელობა {{attempt}} {{total}}-დან",
|
|
98
99
|
"at": "ზე"
|
|
99
100
|
},
|
|
100
101
|
"controls": {
|
package/src/translations/kr.json
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"filters": {
|
|
27
27
|
"more-filters": "추가 필터",
|
|
28
|
-
"enable-filter": "\"{filter}\" 필터 활성화",
|
|
28
|
+
"enable-filter": "\"{{filter}}\" 필터 활성화",
|
|
29
29
|
"flaky": "불안정함",
|
|
30
30
|
"retry": "재시도",
|
|
31
31
|
"new": "새로운"
|
|
@@ -95,6 +95,7 @@
|
|
|
95
95
|
"showLess": "덜 보기",
|
|
96
96
|
"showMore": "더 보기",
|
|
97
97
|
"copy": "복사",
|
|
98
|
+
"attempt": "시도 {{attempt}}/{{total}}",
|
|
98
99
|
"at": "에서"
|
|
99
100
|
},
|
|
100
101
|
"controls": {
|
package/src/translations/nl.json
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"filters": {
|
|
27
27
|
"more-filters": "Meer filters",
|
|
28
|
-
"enable-filter": "Filter \"{filter}\" inschakelen",
|
|
28
|
+
"enable-filter": "Filter \"{{filter}}\" inschakelen",
|
|
29
29
|
"flaky": "Onstabiel",
|
|
30
30
|
"retry": "Opnieuw proberen",
|
|
31
31
|
"new": "Nieuw"
|
|
@@ -95,6 +95,7 @@
|
|
|
95
95
|
"showLess": "Minder weergeven",
|
|
96
96
|
"showMore": "Meer weergeven",
|
|
97
97
|
"copy": "Kopiëren",
|
|
98
|
+
"attempt": "Poging {{attempt}} van {{total}}",
|
|
98
99
|
"at": "om"
|
|
99
100
|
},
|
|
100
101
|
"controls": {
|
package/src/translations/pl.json
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"filters": {
|
|
24
24
|
"more-filters": "Filtry",
|
|
25
|
-
"enable-filter": "Filtruj po \"{filter}\"",
|
|
25
|
+
"enable-filter": "Filtruj po \"{{filter}}\"",
|
|
26
26
|
"flaky": "Niestabilne",
|
|
27
27
|
"retry": "Powtórne",
|
|
28
28
|
"new": "Nowe"
|
|
@@ -93,6 +93,7 @@
|
|
|
93
93
|
"showLess": "Pokaż mniej",
|
|
94
94
|
"showMore": "Pokaż więcej",
|
|
95
95
|
"copy": "Skopuj",
|
|
96
|
+
"attempt": "Próba {{attempt}} z {{total}}",
|
|
96
97
|
"at": "w"
|
|
97
98
|
},
|
|
98
99
|
"controls": {
|
package/src/translations/pt.json
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"filters": {
|
|
27
27
|
"more-filters": "Mais filtros",
|
|
28
|
-
"enable-filter": "Habilitar filtro para \"{filter}\"",
|
|
28
|
+
"enable-filter": "Habilitar filtro para \"{{filter}}\"",
|
|
29
29
|
"flaky": "Instável",
|
|
30
30
|
"retry": "Repetir",
|
|
31
31
|
"new": "Novo"
|
|
@@ -95,6 +95,7 @@
|
|
|
95
95
|
"showLess": "Mostrar menos",
|
|
96
96
|
"showMore": "Mostrar mais",
|
|
97
97
|
"copy": "Copiar",
|
|
98
|
+
"attempt": "Tentativa {{attempt}} de {{total}}",
|
|
98
99
|
"at": "em"
|
|
99
100
|
},
|
|
100
101
|
"controls": {
|
package/src/translations/ru.json
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"filters": {
|
|
24
24
|
"more-filters": "Фильтры",
|
|
25
|
-
"enable-filter": "Включить фильтр по \"{filter}\"",
|
|
25
|
+
"enable-filter": "Включить фильтр по \"{{filter}}\"",
|
|
26
26
|
"flaky": "Нестабильные",
|
|
27
27
|
"retry": "Повторенные",
|
|
28
28
|
"new": "Новые"
|
|
@@ -93,6 +93,7 @@
|
|
|
93
93
|
"showLess": "Показать меньше",
|
|
94
94
|
"showMore": "Показать больше",
|
|
95
95
|
"copy": "Скопировать",
|
|
96
|
+
"attempt": "Попытка {{attempt}} из {{total}}",
|
|
96
97
|
"at": "в"
|
|
97
98
|
},
|
|
98
99
|
"controls": {
|
package/src/translations/sv.json
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"filters": {
|
|
27
27
|
"more-filters": "Fler filter",
|
|
28
|
-
"enable-filter": "Aktivera filtret \"{filter}\"",
|
|
28
|
+
"enable-filter": "Aktivera filtret \"{{filter}}\"",
|
|
29
29
|
"flaky": "Ostadig",
|
|
30
30
|
"retry": "Försök igen",
|
|
31
31
|
"new": "Ny"
|
|
@@ -95,6 +95,7 @@
|
|
|
95
95
|
"showLess": "Visa mindre",
|
|
96
96
|
"showMore": "Visa mer",
|
|
97
97
|
"copy": "Kopiera",
|
|
98
|
+
"attempt": "Försök {{attempt}} av {{total}}",
|
|
98
99
|
"at": "vid"
|
|
99
100
|
},
|
|
100
101
|
"controls": {
|
package/src/translations/tr.json
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"filters": {
|
|
27
27
|
"more-filters": "Daha fazla filtre",
|
|
28
|
-
"enable-filter": "\"{filter}\" filtresini etkinleştir",
|
|
28
|
+
"enable-filter": "\"{{filter}}\" filtresini etkinleştir",
|
|
29
29
|
"flaky": "İstikrarsız",
|
|
30
30
|
"retry": "Tekrar",
|
|
31
31
|
"new": "Yeni"
|
|
@@ -95,6 +95,7 @@
|
|
|
95
95
|
"showLess": "Daha az göster",
|
|
96
96
|
"showMore": "Daha fazla göster",
|
|
97
97
|
"copy": "Kopyala",
|
|
98
|
+
"attempt": "Deneme {{attempt}} / {{total}}",
|
|
98
99
|
"at": "tarihinde"
|
|
99
100
|
},
|
|
100
101
|
"controls": {
|
package/src/translations/zh.json
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"filters": {
|
|
27
27
|
"more-filters": "更多过滤器",
|
|
28
|
-
"enable-filter": "启用 \"{filter}\" 过滤器",
|
|
28
|
+
"enable-filter": "启用 \"{{filter}}\" 过滤器",
|
|
29
29
|
"flaky": "不稳定",
|
|
30
30
|
"retry": "重试",
|
|
31
31
|
"new": "新的"
|
|
@@ -95,6 +95,7 @@
|
|
|
95
95
|
"showLess": "显示更少",
|
|
96
96
|
"showMore": "显示更多",
|
|
97
97
|
"copy": "复制",
|
|
98
|
+
"attempt": "第 {{attempt}} 次尝试,共 {{total}} 次",
|
|
98
99
|
"at": "在"
|
|
99
100
|
},
|
|
100
101
|
"controls": {
|
package/src/utils/treeFilters.ts
CHANGED
|
@@ -12,14 +12,9 @@ import {
|
|
|
12
12
|
reverse,
|
|
13
13
|
} from "@allurereport/core-api";
|
|
14
14
|
import type { TreeFiltersState, TreeSortBy } from "@/stores/tree";
|
|
15
|
-
import type {
|
|
16
|
-
AllureAwesomeRecursiveTree,
|
|
17
|
-
AllureAwesomeTree,
|
|
18
|
-
AllureAwesomeTreeGroup,
|
|
19
|
-
AllureAwesomeTreeLeaf,
|
|
20
|
-
} from "../../types";
|
|
15
|
+
import type { ClassicRecursiveTree, ClassicTree, ClassicTreeGroup, ClassicTreeLeaf } from "../../types";
|
|
21
16
|
|
|
22
|
-
export const isIncluded = (leaf: TreeLeaf<
|
|
17
|
+
export const isIncluded = (leaf: TreeLeaf<ClassicTreeLeaf>, filterOptions: TreeFiltersState) => {
|
|
23
18
|
const queryMatched = !filterOptions?.query || leaf.name.toLowerCase().includes(filterOptions.query.toLowerCase());
|
|
24
19
|
const statusMatched =
|
|
25
20
|
!filterOptions?.status || filterOptions?.status === "total" || leaf.status === filterOptions.status;
|
|
@@ -31,8 +26,8 @@ export const isIncluded = (leaf: TreeLeaf<AllureAwesomeTreeLeaf>, filterOptions:
|
|
|
31
26
|
return [queryMatched, statusMatched, flakyMatched, retryMatched].every(Boolean);
|
|
32
27
|
};
|
|
33
28
|
|
|
34
|
-
const leafComparatorByTreeSortBy = (sortBy: TreeSortBy): Comparator<TreeLeaf<
|
|
35
|
-
const typedCompareBy = compareBy<TreeLeaf<
|
|
29
|
+
const leafComparatorByTreeSortBy = (sortBy: TreeSortBy): Comparator<TreeLeaf<ClassicTreeLeaf>> => {
|
|
30
|
+
const typedCompareBy = compareBy<TreeLeaf<ClassicTreeLeaf>>;
|
|
36
31
|
switch (sortBy) {
|
|
37
32
|
case "order":
|
|
38
33
|
return typedCompareBy("groupOrder", ordinal());
|
|
@@ -57,7 +52,7 @@ const groupComparatorByTreeSortBy = (sortBy: TreeSortBy): Comparator<DefaultTree
|
|
|
57
52
|
}
|
|
58
53
|
};
|
|
59
54
|
|
|
60
|
-
export const leafComparator = (filterOptions: TreeFiltersState): Comparator<TreeLeaf<
|
|
55
|
+
export const leafComparator = (filterOptions: TreeFiltersState): Comparator<TreeLeaf<ClassicTreeLeaf>> => {
|
|
61
56
|
const cmp = leafComparatorByTreeSortBy(filterOptions.sortBy);
|
|
62
57
|
const directional = filterOptions.direction === "asc" ? cmp : reverse(cmp);
|
|
63
58
|
// apply fallback sorting by name
|
|
@@ -73,12 +68,12 @@ export const groupComparator = (filterOptions: TreeFiltersState): Comparator<Def
|
|
|
73
68
|
|
|
74
69
|
export const filterLeaves = (
|
|
75
70
|
leaves: string[] = [],
|
|
76
|
-
leavesById:
|
|
71
|
+
leavesById: ClassicTree["leavesById"],
|
|
77
72
|
filterOptions: TreeFiltersState,
|
|
78
73
|
) => {
|
|
79
74
|
const filteredLeaves = [...leaves]
|
|
80
75
|
.map((leafId) => leavesById[leafId])
|
|
81
|
-
.filter((leaf: TreeLeaf<
|
|
76
|
+
.filter((leaf: TreeLeaf<ClassicTreeLeaf>) => isIncluded(leaf, filterOptions));
|
|
82
77
|
|
|
83
78
|
const comparator = leafComparator(filterOptions);
|
|
84
79
|
return filteredLeaves.sort(comparator);
|
|
@@ -90,11 +85,11 @@ export const filterLeaves = (
|
|
|
90
85
|
* @param payload
|
|
91
86
|
*/
|
|
92
87
|
export const createRecursiveTree = (payload: {
|
|
93
|
-
group:
|
|
94
|
-
groupsById:
|
|
95
|
-
leavesById:
|
|
88
|
+
group: ClassicTreeGroup;
|
|
89
|
+
groupsById: ClassicTree["groupsById"];
|
|
90
|
+
leavesById: ClassicTree["leavesById"];
|
|
96
91
|
filterOptions?: TreeFiltersState;
|
|
97
|
-
}):
|
|
92
|
+
}): ClassicRecursiveTree => {
|
|
98
93
|
const { group, groupsById, leavesById, filterOptions } = payload;
|
|
99
94
|
const groupLeaves: string[] = group.leaves ?? [];
|
|
100
95
|
|
|
@@ -112,7 +107,7 @@ export const createRecursiveTree = (payload: {
|
|
|
112
107
|
?.filter((rt) => !isRecursiveTreeEmpty(rt)) ?? [];
|
|
113
108
|
|
|
114
109
|
const statistic: Statistic = emptyStatistic();
|
|
115
|
-
trees.forEach((rt:
|
|
110
|
+
trees.forEach((rt: ClassicRecursiveTree) => {
|
|
116
111
|
if (rt.statistic) {
|
|
117
112
|
const additional: Statistic = rt.statistic;
|
|
118
113
|
mergeStatistic(statistic, additional);
|
|
@@ -131,7 +126,7 @@ export const createRecursiveTree = (payload: {
|
|
|
131
126
|
};
|
|
132
127
|
};
|
|
133
128
|
|
|
134
|
-
export const isRecursiveTreeEmpty = (tree:
|
|
129
|
+
export const isRecursiveTreeEmpty = (tree: ClassicRecursiveTree): boolean => {
|
|
135
130
|
if (!tree.trees?.length && !tree.leaves?.length) {
|
|
136
131
|
return true;
|
|
137
132
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
2
|
import { createRecursiveTree, filterLeaves } from "../../src/utils/treeFilters.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { ClassicTestResult } from "../../types.js";
|
|
4
4
|
|
|
5
5
|
describe("utils > treeFilters", () => {
|
|
6
6
|
describe("filterLeaves", () => {
|
|
@@ -11,15 +11,15 @@ describe("utils > treeFilters", () => {
|
|
|
11
11
|
a1: {
|
|
12
12
|
name: "a1",
|
|
13
13
|
start: baseDate,
|
|
14
|
-
} as
|
|
14
|
+
} as ClassicTestResult,
|
|
15
15
|
b2: {
|
|
16
16
|
name: "b2",
|
|
17
17
|
start: baseDate + 1000,
|
|
18
|
-
} as
|
|
18
|
+
} as ClassicTestResult,
|
|
19
19
|
c3: {
|
|
20
20
|
name: "c3",
|
|
21
21
|
start: baseDate + 2000,
|
|
22
|
-
} as
|
|
22
|
+
} as ClassicTestResult,
|
|
23
23
|
};
|
|
24
24
|
const result = filterLeaves(leaves, leavesById, {
|
|
25
25
|
query: "",
|
|
@@ -48,17 +48,17 @@ describe("utils > treeFilters", () => {
|
|
|
48
48
|
name: "a1",
|
|
49
49
|
status: "passed",
|
|
50
50
|
start: baseDate,
|
|
51
|
-
} as
|
|
51
|
+
} as ClassicTestResult,
|
|
52
52
|
b2: {
|
|
53
53
|
name: "b2",
|
|
54
54
|
status: "failed",
|
|
55
55
|
start: baseDate + 1000,
|
|
56
|
-
} as
|
|
56
|
+
} as ClassicTestResult,
|
|
57
57
|
c3: {
|
|
58
58
|
name: "c3",
|
|
59
59
|
status: "passed",
|
|
60
60
|
start: baseDate + 2000,
|
|
61
|
-
} as
|
|
61
|
+
} as ClassicTestResult,
|
|
62
62
|
};
|
|
63
63
|
const result = filterLeaves(leaves, leavesById, {
|
|
64
64
|
query: "",
|
|
@@ -83,17 +83,17 @@ describe("utils > treeFilters", () => {
|
|
|
83
83
|
name: "a1",
|
|
84
84
|
start: baseDate,
|
|
85
85
|
flaky: true,
|
|
86
|
-
} as
|
|
86
|
+
} as ClassicTestResult,
|
|
87
87
|
b2: {
|
|
88
88
|
name: "b2",
|
|
89
89
|
start: baseDate + 1000,
|
|
90
90
|
flaky: false,
|
|
91
|
-
} as
|
|
91
|
+
} as ClassicTestResult,
|
|
92
92
|
c3: {
|
|
93
93
|
name: "c3",
|
|
94
94
|
start: baseDate + 2000,
|
|
95
95
|
flaky: true,
|
|
96
|
-
} as
|
|
96
|
+
} as ClassicTestResult,
|
|
97
97
|
};
|
|
98
98
|
const result = filterLeaves(leaves, leavesById, {
|
|
99
99
|
query: "",
|
|
@@ -118,17 +118,17 @@ describe("utils > treeFilters", () => {
|
|
|
118
118
|
name: "a1",
|
|
119
119
|
start: baseDate,
|
|
120
120
|
retry: true,
|
|
121
|
-
} as
|
|
121
|
+
} as ClassicTestResult,
|
|
122
122
|
b2: {
|
|
123
123
|
name: "b2",
|
|
124
124
|
start: baseDate + 1000,
|
|
125
125
|
retry: false,
|
|
126
|
-
} as
|
|
126
|
+
} as ClassicTestResult,
|
|
127
127
|
c3: {
|
|
128
128
|
name: "c3",
|
|
129
129
|
start: baseDate + 2000,
|
|
130
130
|
retry: false,
|
|
131
|
-
} as
|
|
131
|
+
} as ClassicTestResult,
|
|
132
132
|
};
|
|
133
133
|
const result = filterLeaves(leaves, leavesById, {
|
|
134
134
|
filter: {
|
|
@@ -145,15 +145,15 @@ describe("utils > treeFilters", () => {
|
|
|
145
145
|
a1: {
|
|
146
146
|
name: "a1",
|
|
147
147
|
duration: 1000,
|
|
148
|
-
} as
|
|
148
|
+
} as ClassicTestResult,
|
|
149
149
|
b2: {
|
|
150
150
|
name: "b2",
|
|
151
151
|
duration: 2000,
|
|
152
|
-
} as
|
|
152
|
+
} as ClassicTestResult,
|
|
153
153
|
c3: {
|
|
154
154
|
name: "c3",
|
|
155
155
|
duration: 3000,
|
|
156
|
-
} as
|
|
156
|
+
} as ClassicTestResult,
|
|
157
157
|
};
|
|
158
158
|
const result = filterLeaves(leaves, leavesById, {
|
|
159
159
|
direction: "asc",
|
|
@@ -173,15 +173,15 @@ describe("utils > treeFilters", () => {
|
|
|
173
173
|
a1: {
|
|
174
174
|
name: "a1",
|
|
175
175
|
duration: 1000,
|
|
176
|
-
} as
|
|
176
|
+
} as ClassicTestResult,
|
|
177
177
|
b2: {
|
|
178
178
|
name: "b2",
|
|
179
179
|
duration: 2000,
|
|
180
|
-
} as
|
|
180
|
+
} as ClassicTestResult,
|
|
181
181
|
c3: {
|
|
182
182
|
name: "c3",
|
|
183
183
|
duration: 3000,
|
|
184
|
-
} as
|
|
184
|
+
} as ClassicTestResult,
|
|
185
185
|
};
|
|
186
186
|
const result = filterLeaves(leaves, leavesById, {
|
|
187
187
|
direction: "desc",
|
|
@@ -200,13 +200,13 @@ describe("utils > treeFilters", () => {
|
|
|
200
200
|
const leavesById = {
|
|
201
201
|
a1: {
|
|
202
202
|
name: "a1",
|
|
203
|
-
} as
|
|
203
|
+
} as ClassicTestResult,
|
|
204
204
|
b2: {
|
|
205
205
|
name: "b2",
|
|
206
|
-
} as
|
|
206
|
+
} as ClassicTestResult,
|
|
207
207
|
c3: {
|
|
208
208
|
name: "c3",
|
|
209
|
-
} as
|
|
209
|
+
} as ClassicTestResult,
|
|
210
210
|
};
|
|
211
211
|
const result = filterLeaves(leaves, leavesById, {
|
|
212
212
|
direction: "asc",
|
|
@@ -225,13 +225,13 @@ describe("utils > treeFilters", () => {
|
|
|
225
225
|
const leavesById = {
|
|
226
226
|
a1: {
|
|
227
227
|
name: "a1",
|
|
228
|
-
} as
|
|
228
|
+
} as ClassicTestResult,
|
|
229
229
|
b2: {
|
|
230
230
|
name: "b2",
|
|
231
|
-
} as
|
|
231
|
+
} as ClassicTestResult,
|
|
232
232
|
c3: {
|
|
233
233
|
name: "c3",
|
|
234
|
-
} as
|
|
234
|
+
} as ClassicTestResult,
|
|
235
235
|
};
|
|
236
236
|
const result = filterLeaves(leaves, leavesById, {
|
|
237
237
|
direction: "desc",
|
|
@@ -251,23 +251,23 @@ describe("utils > treeFilters", () => {
|
|
|
251
251
|
a1: {
|
|
252
252
|
name: "a1",
|
|
253
253
|
status: "passed",
|
|
254
|
-
} as
|
|
254
|
+
} as ClassicTestResult,
|
|
255
255
|
b2: {
|
|
256
256
|
name: "b2",
|
|
257
257
|
status: "failed",
|
|
258
|
-
} as
|
|
258
|
+
} as ClassicTestResult,
|
|
259
259
|
c3: {
|
|
260
260
|
name: "c3",
|
|
261
261
|
status: "broken",
|
|
262
|
-
} as
|
|
262
|
+
} as ClassicTestResult,
|
|
263
263
|
d4: {
|
|
264
264
|
name: "d4",
|
|
265
265
|
status: "unknown",
|
|
266
|
-
} as
|
|
266
|
+
} as ClassicTestResult,
|
|
267
267
|
e5: {
|
|
268
268
|
name: "e5",
|
|
269
269
|
status: "skipped",
|
|
270
|
-
} as
|
|
270
|
+
} as ClassicTestResult,
|
|
271
271
|
};
|
|
272
272
|
const result = filterLeaves(leaves, leavesById, {
|
|
273
273
|
direction: "asc",
|
|
@@ -289,23 +289,23 @@ describe("utils > treeFilters", () => {
|
|
|
289
289
|
a1: {
|
|
290
290
|
name: "a1",
|
|
291
291
|
status: "passed",
|
|
292
|
-
} as
|
|
292
|
+
} as ClassicTestResult,
|
|
293
293
|
b2: {
|
|
294
294
|
name: "b2",
|
|
295
295
|
status: "failed",
|
|
296
|
-
} as
|
|
296
|
+
} as ClassicTestResult,
|
|
297
297
|
c3: {
|
|
298
298
|
name: "c3",
|
|
299
299
|
status: "broken",
|
|
300
|
-
} as
|
|
300
|
+
} as ClassicTestResult,
|
|
301
301
|
d4: {
|
|
302
302
|
name: "d4",
|
|
303
303
|
status: "unknown",
|
|
304
|
-
} as
|
|
304
|
+
} as ClassicTestResult,
|
|
305
305
|
e5: {
|
|
306
306
|
name: "e5",
|
|
307
307
|
status: "skipped",
|
|
308
|
-
} as
|
|
308
|
+
} as ClassicTestResult,
|
|
309
309
|
};
|
|
310
310
|
const result = filterLeaves(leaves, leavesById, {
|
|
311
311
|
direction: "desc",
|
|
@@ -329,17 +329,17 @@ describe("utils > treeFilters", () => {
|
|
|
329
329
|
name: "a1",
|
|
330
330
|
start: baseDate + 2000,
|
|
331
331
|
groupOrder: 3,
|
|
332
|
-
} as
|
|
332
|
+
} as ClassicTestResult,
|
|
333
333
|
b2: {
|
|
334
334
|
name: "b2",
|
|
335
335
|
start: baseDate + 1000,
|
|
336
336
|
groupOrder: 2,
|
|
337
|
-
} as
|
|
337
|
+
} as ClassicTestResult,
|
|
338
338
|
c3: {
|
|
339
339
|
name: "c3",
|
|
340
340
|
start: baseDate,
|
|
341
341
|
groupOrder: 1,
|
|
342
|
-
} as
|
|
342
|
+
} as ClassicTestResult,
|
|
343
343
|
};
|
|
344
344
|
const result = filterLeaves(leaves, leavesById, {
|
|
345
345
|
direction: "asc",
|
|
@@ -361,17 +361,17 @@ describe("utils > treeFilters", () => {
|
|
|
361
361
|
name: "a1",
|
|
362
362
|
start: baseDate + 2000,
|
|
363
363
|
groupOrder: 3,
|
|
364
|
-
} as
|
|
364
|
+
} as ClassicTestResult,
|
|
365
365
|
b2: {
|
|
366
366
|
name: "b2",
|
|
367
367
|
start: baseDate + 1000,
|
|
368
368
|
groupOrder: 2,
|
|
369
|
-
} as
|
|
369
|
+
} as ClassicTestResult,
|
|
370
370
|
c3: {
|
|
371
371
|
name: "c3",
|
|
372
372
|
start: baseDate,
|
|
373
373
|
groupOrder: 1,
|
|
374
|
-
} as
|
|
374
|
+
} as ClassicTestResult,
|
|
375
375
|
};
|
|
376
376
|
const result = filterLeaves(leaves, leavesById, {
|
|
377
377
|
direction: "desc",
|
|
@@ -397,15 +397,15 @@ describe("utils > treeFilters", () => {
|
|
|
397
397
|
a1: {
|
|
398
398
|
name: "a1",
|
|
399
399
|
start: baseDate,
|
|
400
|
-
} as
|
|
400
|
+
} as ClassicTestResult,
|
|
401
401
|
b2: {
|
|
402
402
|
name: "b2",
|
|
403
403
|
start: baseDate + 1000,
|
|
404
|
-
} as
|
|
404
|
+
} as ClassicTestResult,
|
|
405
405
|
c3: {
|
|
406
406
|
name: "c3",
|
|
407
407
|
start: baseDate + 2000,
|
|
408
|
-
} as
|
|
408
|
+
} as ClassicTestResult,
|
|
409
409
|
};
|
|
410
410
|
const groupsById = {
|
|
411
411
|
a1: {
|