@allurereport/web-awesome 3.0.0-beta.16 → 3.0.0-beta.18

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 (113) hide show
  1. package/dist/multi/173.app-b58a8b2733d390b78773.js +1 -0
  2. package/dist/multi/174.app-b58a8b2733d390b78773.js +1 -0
  3. package/dist/multi/252.app-b58a8b2733d390b78773.js +1 -0
  4. package/dist/multi/282.app-b58a8b2733d390b78773.js +1 -0
  5. package/dist/multi/29.app-b58a8b2733d390b78773.js +1 -0
  6. package/dist/multi/416.app-b58a8b2733d390b78773.js +1 -0
  7. package/dist/multi/527.app-b58a8b2733d390b78773.js +1 -0
  8. package/dist/multi/600.app-b58a8b2733d390b78773.js +1 -0
  9. package/dist/multi/605.app-b58a8b2733d390b78773.js +1 -0
  10. package/dist/multi/638.app-b58a8b2733d390b78773.js +1 -0
  11. package/dist/multi/672.app-b58a8b2733d390b78773.js +1 -0
  12. package/dist/multi/686.app-b58a8b2733d390b78773.js +1 -0
  13. package/dist/multi/725.app-b58a8b2733d390b78773.js +1 -0
  14. package/dist/multi/741.app-b58a8b2733d390b78773.js +1 -0
  15. package/dist/multi/755.app-b58a8b2733d390b78773.js +1 -0
  16. package/dist/multi/894.app-b58a8b2733d390b78773.js +1 -0
  17. package/dist/multi/943.app-b58a8b2733d390b78773.js +1 -0
  18. package/dist/multi/980.app-b58a8b2733d390b78773.js +1 -0
  19. package/dist/multi/app-b58a8b2733d390b78773.js +2 -0
  20. package/dist/multi/app-b58a8b2733d390b78773.js.LICENSE.txt +8 -0
  21. package/dist/multi/manifest.json +20 -20
  22. package/dist/multi/styles-3610e3d9923b6a2a1c67.css +46 -0
  23. package/dist/single/app-51defb8852956a2ff6f1.js +2 -0
  24. package/dist/single/app-51defb8852956a2ff6f1.js.LICENSE.txt +8 -0
  25. package/dist/single/manifest.json +1 -1
  26. package/package.json +17 -10
  27. package/src/components/Charts/index.tsx +12 -3
  28. package/src/components/Header/CiInfo/index.tsx +51 -0
  29. package/src/components/Header/CiInfo/styles.scss +7 -0
  30. package/src/components/Header/index.tsx +6 -1
  31. package/src/components/MainReport/index.tsx +65 -2
  32. package/src/components/MainReport/styles.scss +8 -0
  33. package/src/components/NavTabs/index.tsx +70 -0
  34. package/src/components/ReportBody/Filters.tsx +1 -1
  35. package/src/components/ReportBody/index.tsx +1 -1
  36. package/src/components/ReportBody/styles.scss +2 -2
  37. package/src/components/ReportGlobalAttachments/index.tsx +34 -0
  38. package/src/components/ReportGlobalAttachments/styles.scss +11 -0
  39. package/src/components/ReportGlobalErrors/index.tsx +30 -0
  40. package/src/components/ReportGlobalErrors/styles.scss +12 -0
  41. package/src/components/ReportHeader/index.tsx +28 -10
  42. package/src/components/ReportHeader/styles.scss +7 -1
  43. package/src/components/ReportMetadata/MetadataSummary.tsx +1 -1
  44. package/src/components/ReportMetadata/styles.scss +0 -2
  45. package/src/components/TestResult/TrAttachmentsView/index.tsx +5 -3
  46. package/src/components/TestResult/TrInfo/TrInfoStatuses.tsx +1 -1
  47. package/src/components/TestResult/TrPrevStatuses/index.tsx +1 -2
  48. package/src/components/TestResult/TrRetriesView/TrRetriesItem.tsx +24 -6
  49. package/src/components/TestResult/TrRetriesView/index.tsx +8 -1
  50. package/src/components/TestResult/TrSeverity/index.tsx +1 -1
  51. package/src/components/TestResult/TrStatus/index.tsx +1 -1
  52. package/src/components/TestResult/TrSteps/TrStepInfo.tsx +4 -4
  53. package/src/components/TestResult/TrSteps/styles.scss +10 -1
  54. package/src/components/TestResult/TrTabs/index.tsx +19 -57
  55. package/src/components/TestResult/index.tsx +0 -1
  56. package/src/components/Tree/index.tsx +1 -3
  57. package/src/index.html +14 -1
  58. package/src/index.tsx +9 -1
  59. package/src/locales/az.json +9 -8
  60. package/src/locales/de.json +9 -8
  61. package/src/locales/en.json +9 -8
  62. package/src/locales/es.json +9 -8
  63. package/src/locales/fr.json +9 -8
  64. package/src/locales/he.json +9 -8
  65. package/src/locales/hy.json +9 -8
  66. package/src/locales/it.json +9 -8
  67. package/src/locales/ja.json +9 -8
  68. package/src/locales/ka.json +9 -8
  69. package/src/locales/kr.json +9 -8
  70. package/src/locales/nl.json +9 -8
  71. package/src/locales/pl.json +9 -8
  72. package/src/locales/pt.json +9 -8
  73. package/src/locales/ru.json +9 -8
  74. package/src/locales/sv.json +9 -8
  75. package/src/locales/tr.json +9 -8
  76. package/src/locales/zh.json +9 -8
  77. package/src/stores/chart.ts +7 -7
  78. package/src/stores/globals.ts +28 -0
  79. package/src/stores/locale.ts +0 -1
  80. package/src/utils/tree.ts +0 -2
  81. package/test/components/Header/CiInfo.test.tsx +151 -0
  82. package/test/components/Header.test.tsx +127 -0
  83. package/tsconfig.json +6 -1
  84. package/tsconfig.node.json +8 -0
  85. package/types.d.ts +2 -1
  86. package/vitest.config.ts +30 -3
  87. package/vitest.setup.ts +1 -0
  88. package/dist/multi/173.app-1e7b32b35927de455ae2.js +0 -1
  89. package/dist/multi/174.app-1e7b32b35927de455ae2.js +0 -1
  90. package/dist/multi/252.app-1e7b32b35927de455ae2.js +0 -1
  91. package/dist/multi/282.app-1e7b32b35927de455ae2.js +0 -1
  92. package/dist/multi/29.app-1e7b32b35927de455ae2.js +0 -1
  93. package/dist/multi/416.app-1e7b32b35927de455ae2.js +0 -1
  94. package/dist/multi/527.app-1e7b32b35927de455ae2.js +0 -1
  95. package/dist/multi/600.app-1e7b32b35927de455ae2.js +0 -1
  96. package/dist/multi/605.app-1e7b32b35927de455ae2.js +0 -1
  97. package/dist/multi/638.app-1e7b32b35927de455ae2.js +0 -1
  98. package/dist/multi/672.app-1e7b32b35927de455ae2.js +0 -1
  99. package/dist/multi/686.app-1e7b32b35927de455ae2.js +0 -1
  100. package/dist/multi/725.app-1e7b32b35927de455ae2.js +0 -1
  101. package/dist/multi/741.app-1e7b32b35927de455ae2.js +0 -1
  102. package/dist/multi/755.app-1e7b32b35927de455ae2.js +0 -1
  103. package/dist/multi/894.app-1e7b32b35927de455ae2.js +0 -1
  104. package/dist/multi/943.app-1e7b32b35927de455ae2.js +0 -1
  105. package/dist/multi/980.app-1e7b32b35927de455ae2.js +0 -1
  106. package/dist/multi/app-1e7b32b35927de455ae2.js +0 -2
  107. package/dist/multi/app-1e7b32b35927de455ae2.js.LICENSE.txt +0 -23
  108. package/dist/multi/styles-99f5e45d3e35c8c13cd6.css +0 -43
  109. package/dist/single/app-b4be944c6ebe4a83f366.js +0 -2
  110. package/dist/single/app-b4be944c6ebe4a83f366.js.LICENSE.txt +0 -23
  111. package/src/utils/capitalize.ts +0 -6
  112. package/src/utils/charts.ts +0 -167
  113. /package/src/components/{TestResult/TrTabs → NavTabs}/styles.scss +0 -0
@@ -1,23 +0,0 @@
1
- /**
2
- * Prism: Lightweight, robust, elegant syntax highlighting
3
- *
4
- * @license MIT <https://opensource.org/licenses/MIT>
5
- * @author Lea Verou <https://lea.verou.me>
6
- * @namespace
7
- * @public
8
- */
9
-
10
- /**
11
- * filesize
12
- *
13
- * @copyright 2024 Jason Mulligan <jason.mulligan@avoidwork.com>
14
- * @license BSD-3-Clause
15
- * @version 10.1.6
16
- */
17
-
18
- /**!
19
- * Sortable 1.15.6
20
- * @author RubaXa <trash@rubaxa.org>
21
- * @author owenm <owen23355@gmail.com>
22
- * @license MIT
23
- */
@@ -1,6 +0,0 @@
1
- export const capitalize = (str: string) => {
2
- if (!str) {
3
- return;
4
- }
5
- return str.charAt(0).toLocaleUpperCase() + str.slice(1);
6
- };
@@ -1,167 +0,0 @@
1
- import { type SeverityLevel, type TestStatus, severityLevels, statusesList } from "@allurereport/core-api";
2
- import { ChartDataType, type ChartId, type ChartMode, ChartType } from "@allurereport/web-commons";
3
-
4
- export interface Point {
5
- x: Date | string | number;
6
- y: number;
7
- }
8
-
9
- export interface Slice {
10
- min: number;
11
- max: number;
12
- metadata: { executionId: string };
13
- }
14
-
15
- export type SeriesType = TestStatus | SeverityLevel;
16
-
17
- interface ResponseTrendChartData<GroupBy extends string = SeriesType> {
18
- type: ChartType.Trend;
19
- dataType: ChartDataType;
20
- mode: ChartMode;
21
- title?: string;
22
- min: number;
23
- max: number;
24
- points: Record<string, Point>;
25
- slices: Record<string, Slice>;
26
- series: Record<GroupBy, string[]>;
27
- }
28
-
29
- interface TrendChartItem {
30
- id: string;
31
- data: Point[];
32
- color: string;
33
- }
34
-
35
- export interface TrendChartData {
36
- type: ChartType.Trend;
37
- dataType: ChartDataType;
38
- mode: ChartMode;
39
- min: number;
40
- max: number;
41
- items: TrendChartItem[];
42
- slices: Slice[];
43
- title?: string;
44
- }
45
-
46
- export interface PieSlice {
47
- status: TestStatus;
48
- count: number;
49
- d: string | null;
50
- }
51
-
52
- export interface ResponsePieChartData {
53
- type: ChartType.Pie;
54
- title?: string;
55
- percentage: number;
56
- slices: PieSlice[];
57
- }
58
-
59
- export type PieChartData = ResponsePieChartData;
60
- export type ChartData = TrendChartData | PieChartData;
61
- export type ChartsResponse = Partial<Record<ChartId, ResponseTrendChartData | ResponsePieChartData>>;
62
- export type ChartsData = Record<ChartId, ChartData>;
63
-
64
- const statusColors: Record<TestStatus, string> = {
65
- failed: "var(--bg-support-capella)",
66
- broken: "var(--bg-support-atlas)",
67
- passed: "var(--bg-support-castor)",
68
- skipped: "var(--bg-support-rau)",
69
- unknown: "var(--bg-support-skat)",
70
- };
71
- const severityColors: Record<SeverityLevel, string> = {
72
- blocker: "var(--bg-support-capella)",
73
- critical: "var(--bg-support-atlas)",
74
- normal: "var(--bg-support-castor)",
75
- minor: "var(--bg-support-rau)",
76
- trivial: "var(--bg-support-skat)",
77
- };
78
-
79
- /**
80
- * Helper function to create chart data for different chart types
81
- *
82
- * @param getChart - Function to get the chart data
83
- * @param getGroups - Function to get the groups
84
- * @param getColor - Function to get the color
85
- * @returns TrendChartData or undefined if the chart data is not available
86
- */
87
- export const createTrendChartData = <T extends TestStatus | SeverityLevel>(
88
- getChart: () => ResponseTrendChartData | undefined,
89
- getGroups: () => readonly T[],
90
- getColor: (group: T) => string,
91
- ): TrendChartData | undefined => {
92
- const chart = getChart();
93
- if (!chart) {
94
- return undefined;
95
- }
96
-
97
- const items = getGroups().reduce((acc, group) => {
98
- const pointsByGroupBy =
99
- chart.series[group]?.map((pointId) => {
100
- const point = chart.points[pointId];
101
-
102
- return {
103
- x: point.x,
104
- y: point.y,
105
- };
106
- }) ?? [];
107
-
108
- if (pointsByGroupBy.length) {
109
- acc.push({
110
- id: group.charAt(0).toUpperCase() + group.slice(1),
111
- data: pointsByGroupBy,
112
- color: getColor(group),
113
- });
114
- }
115
-
116
- return acc;
117
- }, [] as TrendChartItem[]);
118
-
119
- return {
120
- type: chart.type,
121
- dataType: chart.dataType,
122
- mode: chart.mode,
123
- title: chart.title,
124
- items,
125
- slices: Object.values(chart.slices),
126
- min: chart.min,
127
- max: chart.max,
128
- };
129
- };
130
-
131
- export const createStatusTrendChartData = (chartId: ChartId, res: ChartsResponse): TrendChartData | undefined =>
132
- createTrendChartData(
133
- () => res[chartId] as ResponseTrendChartData | undefined,
134
- () => statusesList,
135
- (status) => statusColors[status],
136
- );
137
-
138
- export const createSeverityTrendChartData = (chartId: ChartId, res: ChartsResponse): TrendChartData | undefined =>
139
- createTrendChartData(
140
- () => res[chartId] as ResponseTrendChartData | undefined,
141
- () => severityLevels,
142
- (severity) => severityColors[severity],
143
- );
144
-
145
- export const createaTrendChartData = (
146
- chartId: string,
147
- chartData: ResponseTrendChartData,
148
- res: ChartsResponse,
149
- ): TrendChartData | undefined => {
150
- if (chartData.dataType === ChartDataType.Status) {
151
- return createStatusTrendChartData(chartId, res);
152
- } else if (chartData.dataType === ChartDataType.Severity) {
153
- return createSeverityTrendChartData(chartId, res);
154
- }
155
- };
156
-
157
- export const createCharts = (res: ChartsResponse): ChartsData => {
158
- return Object.entries(res).reduce((acc, [chartId, chart]) => {
159
- if (chart.type === ChartType.Trend) {
160
- acc[chartId] = createaTrendChartData(chartId, chart, res);
161
- } else if (chart.type === ChartType.Pie) {
162
- acc[chartId] = chart;
163
- }
164
-
165
- return acc;
166
- }, {} as ChartsData);
167
- };