@allurereport/web-awesome 3.0.0-beta.17 → 3.0.0-beta.19

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 (102) hide show
  1. package/dist/multi/173.app-87488b008bf93bf0b234.js +1 -0
  2. package/dist/multi/174.app-87488b008bf93bf0b234.js +1 -0
  3. package/dist/multi/252.app-87488b008bf93bf0b234.js +1 -0
  4. package/dist/multi/282.app-87488b008bf93bf0b234.js +1 -0
  5. package/dist/multi/29.app-87488b008bf93bf0b234.js +1 -0
  6. package/dist/multi/416.app-87488b008bf93bf0b234.js +1 -0
  7. package/dist/multi/527.app-87488b008bf93bf0b234.js +1 -0
  8. package/dist/multi/600.app-87488b008bf93bf0b234.js +1 -0
  9. package/dist/multi/605.app-87488b008bf93bf0b234.js +1 -0
  10. package/dist/multi/638.app-87488b008bf93bf0b234.js +1 -0
  11. package/dist/multi/672.app-87488b008bf93bf0b234.js +1 -0
  12. package/dist/multi/686.app-87488b008bf93bf0b234.js +1 -0
  13. package/dist/multi/725.app-87488b008bf93bf0b234.js +1 -0
  14. package/dist/multi/741.app-87488b008bf93bf0b234.js +1 -0
  15. package/dist/multi/755.app-87488b008bf93bf0b234.js +1 -0
  16. package/dist/multi/894.app-87488b008bf93bf0b234.js +1 -0
  17. package/dist/multi/943.app-87488b008bf93bf0b234.js +1 -0
  18. package/dist/multi/980.app-87488b008bf93bf0b234.js +1 -0
  19. package/dist/multi/app-87488b008bf93bf0b234.js +2 -0
  20. package/dist/multi/{app-3f57abaa5734556b2988.js.LICENSE.txt → app-87488b008bf93bf0b234.js.LICENSE.txt} +2 -8
  21. package/dist/multi/manifest.json +20 -20
  22. package/dist/multi/{styles-9475296a2cbcd0e5d2d0.css → styles-88a1cf6726b2a478108e.css} +13 -11
  23. package/dist/single/app-af34e3cec116175b6d9a.js +2 -0
  24. package/dist/single/{app-800f7e75bb52ecb2ae21.js.LICENSE.txt → app-af34e3cec116175b6d9a.js.LICENSE.txt} +2 -8
  25. package/dist/single/manifest.json +1 -1
  26. package/package.json +5 -5
  27. package/src/components/Charts/index.tsx +53 -5
  28. package/src/components/Charts/styles.scss +2 -2
  29. package/src/components/Header/CiInfo/index.tsx +45 -29
  30. package/src/components/Header/index.tsx +1 -4
  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/index.tsx +1 -2
  35. package/src/components/ReportBody/styles.scss +2 -2
  36. package/src/components/ReportGlobalAttachments/index.tsx +34 -0
  37. package/src/components/ReportGlobalAttachments/styles.scss +11 -0
  38. package/src/components/ReportGlobalErrors/index.tsx +30 -0
  39. package/src/components/ReportGlobalErrors/styles.scss +12 -0
  40. package/src/components/ReportHeader/index.tsx +28 -10
  41. package/src/components/ReportHeader/styles.scss +7 -1
  42. package/src/components/ReportMetadata/MetadataSummary.tsx +1 -2
  43. package/src/components/ReportMetadata/styles.scss +0 -2
  44. package/src/components/SplitLayout/index.tsx +0 -2
  45. package/src/components/TestResult/TrAttachmentsView/index.tsx +5 -3
  46. package/src/components/TestResult/TrError/index.tsx +6 -5
  47. package/src/components/TestResult/TrInfo/TrInfoStatuses.tsx +1 -1
  48. package/src/components/TestResult/TrInfo/index.tsx +1 -1
  49. package/src/components/TestResult/TrPrevStatuses/index.tsx +1 -2
  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/index.tsx +9 -1
  57. package/src/locales/az.json +8 -2
  58. package/src/locales/de.json +8 -2
  59. package/src/locales/en.json +8 -2
  60. package/src/locales/es.json +8 -2
  61. package/src/locales/fr.json +8 -2
  62. package/src/locales/he.json +8 -2
  63. package/src/locales/hy.json +8 -2
  64. package/src/locales/it.json +8 -2
  65. package/src/locales/ja.json +8 -2
  66. package/src/locales/ka.json +8 -2
  67. package/src/locales/kr.json +8 -2
  68. package/src/locales/nl.json +8 -2
  69. package/src/locales/pl.json +8 -2
  70. package/src/locales/pt.json +8 -2
  71. package/src/locales/ru.json +8 -2
  72. package/src/locales/sv.json +8 -2
  73. package/src/locales/tr.json +8 -2
  74. package/src/locales/zh.json +8 -2
  75. package/src/stores/chart.ts +7 -7
  76. package/src/stores/globals.ts +28 -0
  77. package/test/components/Header/CiInfo.test.tsx +79 -53
  78. package/test/components/Header.test.tsx +1 -6
  79. package/vitest.config.ts +1 -1
  80. package/dist/multi/173.app-3f57abaa5734556b2988.js +0 -1
  81. package/dist/multi/174.app-3f57abaa5734556b2988.js +0 -1
  82. package/dist/multi/252.app-3f57abaa5734556b2988.js +0 -1
  83. package/dist/multi/282.app-3f57abaa5734556b2988.js +0 -1
  84. package/dist/multi/29.app-3f57abaa5734556b2988.js +0 -1
  85. package/dist/multi/416.app-3f57abaa5734556b2988.js +0 -1
  86. package/dist/multi/527.app-3f57abaa5734556b2988.js +0 -1
  87. package/dist/multi/600.app-3f57abaa5734556b2988.js +0 -1
  88. package/dist/multi/605.app-3f57abaa5734556b2988.js +0 -1
  89. package/dist/multi/638.app-3f57abaa5734556b2988.js +0 -1
  90. package/dist/multi/672.app-3f57abaa5734556b2988.js +0 -1
  91. package/dist/multi/686.app-3f57abaa5734556b2988.js +0 -1
  92. package/dist/multi/725.app-3f57abaa5734556b2988.js +0 -1
  93. package/dist/multi/741.app-3f57abaa5734556b2988.js +0 -1
  94. package/dist/multi/755.app-3f57abaa5734556b2988.js +0 -1
  95. package/dist/multi/894.app-3f57abaa5734556b2988.js +0 -1
  96. package/dist/multi/943.app-3f57abaa5734556b2988.js +0 -1
  97. package/dist/multi/980.app-3f57abaa5734556b2988.js +0 -1
  98. package/dist/multi/app-3f57abaa5734556b2988.js +0 -2
  99. package/dist/single/app-800f7e75bb52ecb2ae21.js +0 -2
  100. package/src/utils/capitalize.ts +0 -6
  101. package/src/utils/charts.ts +0 -167
  102. /package/src/components/{TestResult/TrTabs → NavTabs}/styles.scss +0 -0
@@ -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
- };