@allurereport/web-awesome 3.0.0-beta.22 → 3.0.0-beta.24

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 (58) hide show
  1. package/dist/multi/{173.app-08a07d0f676c912297d1.js → 173.app-9744a06934ffbef2c892.js} +1 -1
  2. package/dist/multi/{174.app-08a07d0f676c912297d1.js → 174.app-9744a06934ffbef2c892.js} +1 -1
  3. package/dist/multi/{252.app-08a07d0f676c912297d1.js → 252.app-9744a06934ffbef2c892.js} +1 -1
  4. package/dist/multi/{282.app-08a07d0f676c912297d1.js → 282.app-9744a06934ffbef2c892.js} +1 -1
  5. package/dist/multi/{29.app-08a07d0f676c912297d1.js → 29.app-9744a06934ffbef2c892.js} +1 -1
  6. package/dist/multi/{416.app-08a07d0f676c912297d1.js → 416.app-9744a06934ffbef2c892.js} +1 -1
  7. package/dist/multi/{527.app-08a07d0f676c912297d1.js → 527.app-9744a06934ffbef2c892.js} +1 -1
  8. package/dist/multi/{600.app-08a07d0f676c912297d1.js → 600.app-9744a06934ffbef2c892.js} +1 -1
  9. package/dist/multi/{605.app-08a07d0f676c912297d1.js → 605.app-9744a06934ffbef2c892.js} +1 -1
  10. package/dist/multi/{638.app-08a07d0f676c912297d1.js → 638.app-9744a06934ffbef2c892.js} +1 -1
  11. package/dist/multi/{672.app-08a07d0f676c912297d1.js → 672.app-9744a06934ffbef2c892.js} +1 -1
  12. package/dist/multi/{686.app-08a07d0f676c912297d1.js → 686.app-9744a06934ffbef2c892.js} +1 -1
  13. package/dist/multi/{725.app-08a07d0f676c912297d1.js → 725.app-9744a06934ffbef2c892.js} +1 -1
  14. package/dist/multi/{741.app-08a07d0f676c912297d1.js → 741.app-9744a06934ffbef2c892.js} +1 -1
  15. package/dist/multi/{755.app-08a07d0f676c912297d1.js → 755.app-9744a06934ffbef2c892.js} +1 -1
  16. package/dist/multi/{894.app-08a07d0f676c912297d1.js → 894.app-9744a06934ffbef2c892.js} +1 -1
  17. package/dist/multi/{943.app-08a07d0f676c912297d1.js → 943.app-9744a06934ffbef2c892.js} +1 -1
  18. package/dist/multi/{980.app-08a07d0f676c912297d1.js → 980.app-9744a06934ffbef2c892.js} +1 -1
  19. package/dist/multi/app-9744a06934ffbef2c892.js +2 -0
  20. package/dist/multi/manifest.json +20 -20
  21. package/dist/multi/styles-c0d22dac0f1d971a76eb.css +48 -0
  22. package/dist/single/app-bfa8df3fad4158726f8e.js +2 -0
  23. package/dist/single/manifest.json +1 -1
  24. package/package.json +6 -6
  25. package/src/assets/scss/theme.scss +73 -68
  26. package/src/components/Charts/index.tsx +72 -16
  27. package/src/components/Charts/styles.scss +1 -13
  28. package/src/components/SectionPicker/index.tsx +1 -0
  29. package/src/components/SectionSwitcher/index.tsx +2 -0
  30. package/src/components/Timeline/index.tsx +108 -0
  31. package/src/components/Timeline/styles.scss +45 -0
  32. package/src/locales/az.json +32 -3
  33. package/src/locales/de.json +32 -3
  34. package/src/locales/en.json +32 -3
  35. package/src/locales/es.json +32 -3
  36. package/src/locales/fr.json +32 -3
  37. package/src/locales/he.json +32 -3
  38. package/src/locales/hy.json +32 -3
  39. package/src/locales/it.json +32 -3
  40. package/src/locales/ja.json +32 -3
  41. package/src/locales/ka.json +32 -3
  42. package/src/locales/kr.json +32 -3
  43. package/src/locales/nl.json +32 -3
  44. package/src/locales/pl.json +40 -3
  45. package/src/locales/pt.json +32 -3
  46. package/src/locales/ru.json +40 -3
  47. package/src/locales/sv.json +32 -3
  48. package/src/locales/tr.json +32 -3
  49. package/src/locales/zh.json +32 -3
  50. package/src/stores/locale.ts +13 -3
  51. package/src/stores/theme.ts +14 -16
  52. package/src/stores/timeline.ts +34 -0
  53. package/types.d.ts +3 -3
  54. package/dist/multi/app-08a07d0f676c912297d1.js +0 -2
  55. package/dist/multi/styles-5b8b40733448845bbda5.css +0 -47
  56. package/dist/single/app-0e422701ed9861ee2c14.js +0 -2
  57. /package/dist/multi/{app-08a07d0f676c912297d1.js.LICENSE.txt → app-9744a06934ffbef2c892.js.LICENSE.txt} +0 -0
  58. /package/dist/single/{app-0e422701ed9861ee2c14.js.LICENSE.txt → app-bfa8df3fad4158726f8e.js.LICENSE.txt} +0 -0
@@ -162,7 +162,15 @@
162
162
  },
163
163
  "sections": {
164
164
  "report": "Report",
165
- "charts": "Grafer"
165
+ "charts": "Grafer",
166
+ "timeline": "Tidslinje"
167
+ },
168
+ "timeline": {
169
+ "empty": "Inga data",
170
+ "empty_host": "Inga data för {{ host }}",
171
+ "selected_one": "{{ count }} test ({{ percentage }}%) med varaktighet mer än {{ minDuration }} och mindre än {{ maxDuration }} vald",
172
+ "selected_other": "{{ count }} tester ({{ percentage }}%) med varaktighet mer än {{ minDuration }} och mindre än {{ maxDuration }} valda",
173
+ "host": "Värd: {{ host }}"
166
174
  },
167
175
  "charts": {
168
176
  "trend": {
@@ -172,8 +180,29 @@
172
180
  "severity": "Allvarlighetsgrad"
173
181
  }
174
182
  },
175
- "pie": {
176
- "title": "Testframgångsfrekvens"
183
+ "currentStatus": {
184
+ "title": "Nuvarande status",
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": "av {{total}}",
194
+ "total": "totalt",
195
+ "tests": {
196
+ "new_zero": "Inga nya tester",
197
+ "new_one": "{{count}} nytt test",
198
+ "new_other": "{{count}} nya tester",
199
+ "flaky_zero": "Inga instabila tester",
200
+ "flaky_one": "{{count}} instabilt test",
201
+ "flaky_other": "{{count}} instabila tester",
202
+ "retries_zero": "Inga försökta tester",
203
+ "retries_one": "{{count}} försökt test",
204
+ "retries_other": "{{count}} försökta tester"
205
+ }
177
206
  }
178
207
  },
179
208
  "transitions.description": {
@@ -162,7 +162,15 @@
162
162
  },
163
163
  "sections": {
164
164
  "report": "Report",
165
- "charts": "Grafikler"
165
+ "charts": "Grafikler",
166
+ "timeline": "Zaman çizelgesi"
167
+ },
168
+ "timeline": {
169
+ "empty": "Veri yok",
170
+ "empty_host": "{{ host }} için veri yok",
171
+ "selected_one": "{{ count }} test ({{ percentage }}%) {{ minDuration }}'dan fazla ve {{ maxDuration }}'dan az süreyle seçildi",
172
+ "selected_other": "{{ count }} test ({{ percentage }}%) {{ minDuration }}'dan fazla ve {{ maxDuration }}'dan az süreyle seçildi",
173
+ "host": "Ana bilgisayar: {{ host }}"
166
174
  },
167
175
  "charts": {
168
176
  "trend": {
@@ -172,8 +180,29 @@
172
180
  "severity": "Önem Derecesi"
173
181
  }
174
182
  },
175
- "pie": {
176
- "title": "Test Başarı Oranı"
183
+ "currentStatus": {
184
+ "title": "Mevcut Durum",
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}} içinden",
194
+ "total": "toplam",
195
+ "tests": {
196
+ "new_zero": "Yeni test yok",
197
+ "new_one": "{{count}} yeni test",
198
+ "new_other": "{{count}} yeni test",
199
+ "flaky_zero": "Kararsız test yok",
200
+ "flaky_one": "{{count}} kararsız test",
201
+ "flaky_other": "{{count}} kararsız test",
202
+ "retries_zero": "Yeniden denenmiş test yok",
203
+ "retries_one": "{{count}} yeniden denenmiş test",
204
+ "retries_other": "{{count}} yeniden denenmiş test"
205
+ }
177
206
  }
178
207
  },
179
208
  "transitions.description": {
@@ -162,7 +162,15 @@
162
162
  },
163
163
  "sections": {
164
164
  "report": "Report",
165
- "charts": "图形"
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 }}"
166
174
  },
167
175
  "charts": {
168
176
  "trend": {
@@ -172,8 +180,29 @@
172
180
  "severity": "严重程度"
173
181
  }
174
182
  },
175
- "pie": {
176
- "title": "测试成功率"
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
+ }
177
206
  }
178
207
  },
179
208
  "transitions.description": {
@@ -25,8 +25,9 @@ const namespaces = [
25
25
  "environments",
26
26
  "charts",
27
27
  "sections",
28
+ "timeline",
28
29
  "transitions.description",
29
- ];
30
+ ] as const;
30
31
 
31
32
  export const currentLocale = signal<LangLocale>("en" as LangLocale);
32
33
  export const currentLocaleIso = computed(() => LANG_LOCALE[currentLocale.value]?.iso ?? LANG_LOCALE.en.iso);
@@ -61,10 +62,19 @@ export const waitForI18next = i18next
61
62
  fallbackLng: "en",
62
63
  ns: namespaces,
63
64
  interpolation: { escapeValue: false },
65
+ })
66
+ .then(() => {
67
+ i18next.services.formatter.add("capitalize", (value) => {
68
+ return value.charAt(0).toLocaleUpperCase() + value.slice(1);
69
+ });
64
70
  });
65
71
 
66
- export const useI18n = (namespace?: string) => {
67
- const t = computed(() => (key: string, options?: TOptions) => i18next.t(key, { ns: namespace, ...options }));
72
+ export const useI18n = (namespace: (typeof namespaces)[number]) => {
73
+ const t = computed(
74
+ () =>
75
+ (key: string, options: TOptions = {}) =>
76
+ i18next.t(key, { ns: namespace, ...options }),
77
+ );
68
78
 
69
79
  return {
70
80
  t: t.value,
@@ -1,32 +1,30 @@
1
1
  import { getReportOptions } from "@allurereport/web-commons";
2
+ import type { Theme } from "@allurereport/web-components";
2
3
  import { signal } from "@preact/signals";
3
4
  import type { AwesomeReportOptions } from "../../types.js";
4
5
 
5
- type Theme = "light" | "dark";
6
+ export const themeStore = signal<Theme>("auto");
6
7
 
7
- export const themeStore = signal<Theme>("light");
8
+ export const setTheme = (mode: "light" | "dark" | "auto") => {
9
+ themeStore.value = mode;
8
10
 
9
- export const setTheme = (newTheme: Theme): void => {
10
- themeStore.value = newTheme;
11
- document.documentElement.setAttribute("data-theme", newTheme);
12
- window.localStorage.setItem("theme", newTheme);
11
+ try {
12
+ window.localStorage.setItem("theme", mode);
13
+ } catch {}
14
+
15
+ document.documentElement.setAttribute("data-theme", mode);
13
16
  };
14
17
 
15
18
  export const toggleTheme = () => {
16
- setTheme(themeStore.value === "light" ? "dark" : "light");
19
+ const order = ["light", "dark", "auto"];
20
+ const current = themeStore.value;
21
+ const next = order[(order.indexOf(current) + 1) % order.length] as Theme;
22
+ setTheme(next);
17
23
  };
18
24
 
19
25
  export const getTheme = () => {
20
26
  const { theme } = getReportOptions<AwesomeReportOptions>() ?? {};
21
27
  const themeFromLS = (window.localStorage.getItem("theme") as Theme | null) || (theme as Theme);
22
28
 
23
- if (themeFromLS) {
24
- setTheme(themeFromLS);
25
- return;
26
- }
27
-
28
- const prefersDarkScheme = window.matchMedia("(prefers-color-scheme: dark)").matches;
29
- const initialTheme = prefersDarkScheme ? "dark" : "light";
30
-
31
- setTheme(initialTheme);
29
+ setTheme(themeFromLS);
32
30
  };
@@ -0,0 +1,34 @@
1
+ import type { TestResult } from "@allurereport/core-api";
2
+ import { fetchReportJsonData } from "@allurereport/web-commons";
3
+ import { signal } from "@preact/signals";
4
+ import type { StoreSignalState } from "@/stores/types";
5
+
6
+ export const timelineStore = signal<StoreSignalState<TestResult[]>>({
7
+ loading: true,
8
+ error: undefined,
9
+ data: undefined,
10
+ });
11
+
12
+ export const fetchTimelineData = async () => {
13
+ timelineStore.value = {
14
+ ...timelineStore.value,
15
+ loading: true,
16
+ error: undefined,
17
+ };
18
+
19
+ try {
20
+ const res = await fetchReportJsonData<TestResult[]>("widgets/timeline.json", { bustCache: true });
21
+
22
+ timelineStore.value = {
23
+ data: res,
24
+ error: undefined,
25
+ loading: false,
26
+ };
27
+ } catch (err) {
28
+ timelineStore.value = {
29
+ data: undefined,
30
+ error: err.message,
31
+ loading: false,
32
+ };
33
+ }
34
+ };
package/types.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type {
2
- CiDescriptor,
3
2
  AttachmentTestStepResult,
3
+ CiDescriptor,
4
4
  DefaultTreeGroup,
5
5
  HistoryTestResult,
6
6
  TestFixtureResult,
@@ -17,9 +17,9 @@ export type AwesomeReportOptions = {
17
17
  allureVersion: string;
18
18
  reportName?: string;
19
19
  logo?: string;
20
- theme?: "light" | "dark";
20
+ theme?: "light" | "dark" | "auto";
21
21
  groupBy?: string[];
22
- reportLanguage?: "en" | "ru";
22
+ reportLanguage?: "en";
23
23
  createdAt: number;
24
24
  reportUuid: string;
25
25
  layout?: Layout;