@allurereport/web-awesome 3.14.2 → 3.14.3

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 (35) hide show
  1. package/dist/multi/{573.app-cb512132662837474569.js → 573.app-225efc203ca9260d018d.js} +1 -1
  2. package/dist/multi/{954.app-cb512132662837474569.js → 954.app-225efc203ca9260d018d.js} +1 -1
  3. package/dist/multi/app-225efc203ca9260d018d.js +2 -0
  4. package/dist/multi/{app-cb512132662837474569.js.LICENSE.txt → app-225efc203ca9260d018d.js.LICENSE.txt} +1 -1
  5. package/dist/multi/manifest.json +24 -24
  6. package/dist/single/app-97d4c81e44ac2854f0d3.js +2 -0
  7. package/dist/single/{app-900ff87d87c31bf52cf4.js.LICENSE.txt → app-97d4c81e44ac2854f0d3.js.LICENSE.txt} +1 -1
  8. package/dist/single/manifest.json +1 -1
  9. package/package.json +6 -6
  10. package/src/components/ReportGlobalAttachments/index.tsx +29 -27
  11. package/src/components/ReportGlobalErrors/index.tsx +29 -27
  12. package/test/components/ReportGlobals.test.tsx +78 -2
  13. package/dist/multi/app-cb512132662837474569.js +0 -2
  14. package/dist/single/app-900ff87d87c31bf52cf4.js +0 -2
  15. /package/dist/multi/{173.app-cb512132662837474569.js → 173.app-225efc203ca9260d018d.js} +0 -0
  16. /package/dist/multi/{174.app-cb512132662837474569.js → 174.app-225efc203ca9260d018d.js} +0 -0
  17. /package/dist/multi/{252.app-cb512132662837474569.js → 252.app-225efc203ca9260d018d.js} +0 -0
  18. /package/dist/multi/{282.app-cb512132662837474569.js → 282.app-225efc203ca9260d018d.js} +0 -0
  19. /package/dist/multi/{29.app-cb512132662837474569.js → 29.app-225efc203ca9260d018d.js} +0 -0
  20. /package/dist/multi/{310.app-cb512132662837474569.js → 310.app-225efc203ca9260d018d.js} +0 -0
  21. /package/dist/multi/{416.app-cb512132662837474569.js → 416.app-225efc203ca9260d018d.js} +0 -0
  22. /package/dist/multi/{507.app-cb512132662837474569.js → 507.app-225efc203ca9260d018d.js} +0 -0
  23. /package/dist/multi/{527.app-cb512132662837474569.js → 527.app-225efc203ca9260d018d.js} +0 -0
  24. /package/dist/multi/{600.app-cb512132662837474569.js → 600.app-225efc203ca9260d018d.js} +0 -0
  25. /package/dist/multi/{605.app-cb512132662837474569.js → 605.app-225efc203ca9260d018d.js} +0 -0
  26. /package/dist/multi/{638.app-cb512132662837474569.js → 638.app-225efc203ca9260d018d.js} +0 -0
  27. /package/dist/multi/{672.app-cb512132662837474569.js → 672.app-225efc203ca9260d018d.js} +0 -0
  28. /package/dist/multi/{686.app-cb512132662837474569.js → 686.app-225efc203ca9260d018d.js} +0 -0
  29. /package/dist/multi/{725.app-cb512132662837474569.js → 725.app-225efc203ca9260d018d.js} +0 -0
  30. /package/dist/multi/{741.app-cb512132662837474569.js → 741.app-225efc203ca9260d018d.js} +0 -0
  31. /package/dist/multi/{749.app-cb512132662837474569.js → 749.app-225efc203ca9260d018d.js} +0 -0
  32. /package/dist/multi/{755.app-cb512132662837474569.js → 755.app-225efc203ca9260d018d.js} +0 -0
  33. /package/dist/multi/{894.app-cb512132662837474569.js → 894.app-225efc203ca9260d018d.js} +0 -0
  34. /package/dist/multi/{943.app-cb512132662837474569.js → 943.app-225efc203ca9260d018d.js} +0 -0
  35. /package/dist/multi/{980.app-cb512132662837474569.js → 980.app-225efc203ca9260d018d.js} +0 -0
@@ -1,4 +1,4 @@
1
- /*! @license DOMPurify 3.4.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.0/LICENSE */
1
+ /*! @license DOMPurify 3.4.11 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.11/LICENSE */
2
2
 
3
3
  /**
4
4
  * Prism: Lightweight, robust, elegant syntax highlighting
@@ -1,3 +1,3 @@
1
1
  {
2
- "main.js": "app-900ff87d87c31bf52cf4.js"
2
+ "main.js": "app-97d4c81e44ac2854f0d3.js"
3
3
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allurereport/web-awesome",
3
- "version": "3.14.2",
3
+ "version": "3.14.3",
4
4
  "description": "The static files for Allure Awesome Report",
5
5
  "keywords": [
6
6
  "allure",
@@ -30,11 +30,11 @@
30
30
  "lint:fix": "oxlint --import-plugin --fix src test features stories"
31
31
  },
32
32
  "dependencies": {
33
- "@allurereport/charts-api": "3.14.2",
34
- "@allurereport/core-api": "3.14.2",
35
- "@allurereport/plugin-api": "3.14.2",
36
- "@allurereport/web-commons": "3.14.2",
37
- "@allurereport/web-components": "3.14.2",
33
+ "@allurereport/charts-api": "3.14.3",
34
+ "@allurereport/core-api": "3.14.3",
35
+ "@allurereport/plugin-api": "3.14.3",
36
+ "@allurereport/web-commons": "3.14.3",
37
+ "@allurereport/web-components": "3.14.3",
38
38
  "@preact/signals": "^2.6.1",
39
39
  "clsx": "^2.1.1",
40
40
  "d3-shape": "^3.2.0",
@@ -39,6 +39,33 @@ export const ReportGlobalAttachments = () => {
39
39
  <div className={styles["report-global-attachments"]}>{renderAttachmentList(attachments)}</div>
40
40
  );
41
41
 
42
+ const renderAttachmentSections = (entries: Array<[string, PluginGlobalAttachment[]]>) => (
43
+ <div className={styles["report-global-attachments"]}>
44
+ {entries.map(([environmentId, envAttachments]) => {
45
+ const isOpened = !collapsedEnvs.includes(environmentId);
46
+ const toggleEnv = () => {
47
+ setCollapsedEnvs((prev) =>
48
+ isOpened ? prev.concat(environmentId) : prev.filter((currentId) => currentId !== environmentId),
49
+ );
50
+ };
51
+
52
+ return (
53
+ <div key={environmentId} className={styles["report-global-attachments-section"]}>
54
+ <MetadataButton
55
+ isOpened={isOpened}
56
+ setIsOpen={toggleEnv}
57
+ title={`${tEnvironments("environment", { count: 1 })}: "${environmentNameById(environmentId)}"`}
58
+ titleTooltipText={environmentNameById(environmentId)}
59
+ truncateTitle
60
+ counter={envAttachments.length}
61
+ />
62
+ {isOpened ? renderAttachmentList(envAttachments) : null}
63
+ </div>
64
+ );
65
+ })}
66
+ </div>
67
+ );
68
+
42
69
  return (
43
70
  <Loadable
44
71
  source={globalsStore}
@@ -50,7 +77,7 @@ export const ReportGlobalAttachments = () => {
50
77
  return <div className={styles["report-global-attachments-empty"]}>{t("no-attachments-results")}</div>;
51
78
  }
52
79
 
53
- return renderAttachmentsContent(currentEnvAttachments);
80
+ return renderAttachmentSections([[currentEnvironment.value, currentEnvAttachments]]);
54
81
  }
55
82
 
56
83
  const entries = Object.entries(attachmentsByEnv).filter(([, envAttachments]) => envAttachments.length > 0);
@@ -71,32 +98,7 @@ export const ReportGlobalAttachments = () => {
71
98
  return <div className={styles["report-global-attachments-empty"]}>{t("no-attachments-results")}</div>;
72
99
  }
73
100
 
74
- return (
75
- <div className={styles["report-global-attachments"]}>
76
- {entries.map(([environmentId, envAttachments]) => {
77
- const isOpened = !collapsedEnvs.includes(environmentId);
78
- const toggleEnv = () => {
79
- setCollapsedEnvs((prev) =>
80
- isOpened ? prev.concat(environmentId) : prev.filter((currentId) => currentId !== environmentId),
81
- );
82
- };
83
-
84
- return (
85
- <div key={environmentId} className={styles["report-global-attachments-section"]}>
86
- <MetadataButton
87
- isOpened={isOpened}
88
- setIsOpen={toggleEnv}
89
- title={`${tEnvironments("environment", { count: 1 })}: "${environmentNameById(environmentId)}"`}
90
- titleTooltipText={environmentNameById(environmentId)}
91
- truncateTitle
92
- counter={envAttachments.length}
93
- />
94
- {isOpened ? renderAttachmentList(envAttachments) : null}
95
- </div>
96
- );
97
- })}
98
- </div>
99
- );
101
+ return renderAttachmentSections(entries);
100
102
  }}
101
103
  />
102
104
  );
@@ -30,6 +30,33 @@ export const ReportGlobalErrors = () => {
30
30
  <div className={styles["report-global-errors-container"]}>{renderErrors(errors)}</div>
31
31
  );
32
32
 
33
+ const renderErrorSections = (entries: Array<[string, PluginGlobalError[]]>) => (
34
+ <div className={styles["report-global-errors-container"]}>
35
+ {entries.map(([environmentId, envErrors]) => {
36
+ const isOpened = !collapsedEnvs.includes(environmentId);
37
+ const toggleEnv = () => {
38
+ setCollapsedEnvs((prev) =>
39
+ isOpened ? prev.concat(environmentId) : prev.filter((currentId) => currentId !== environmentId),
40
+ );
41
+ };
42
+
43
+ return (
44
+ <div key={environmentId} className={styles["report-global-errors-section"]}>
45
+ <MetadataButton
46
+ isOpened={isOpened}
47
+ setIsOpen={toggleEnv}
48
+ title={`${tEnvironments("environment", { count: 1 })}: "${environmentNameById(environmentId)}"`}
49
+ titleTooltipText={environmentNameById(environmentId)}
50
+ truncateTitle
51
+ counter={envErrors.length}
52
+ />
53
+ {isOpened ? renderErrors(envErrors) : null}
54
+ </div>
55
+ );
56
+ })}
57
+ </div>
58
+ );
59
+
33
60
  return (
34
61
  <Loadable
35
62
  source={globalsStore}
@@ -41,7 +68,7 @@ export const ReportGlobalErrors = () => {
41
68
  return <div className={styles["report-global-errors-empty"]}>{t("no-global-errors-results")}</div>;
42
69
  }
43
70
 
44
- return renderErrorsContent(currentEnvErrors);
71
+ return renderErrorSections([[currentEnvironment.value, currentEnvErrors]]);
45
72
  }
46
73
 
47
74
  const entries = Object.entries(errorsByEnv).filter(([, envErrors]) => envErrors.length > 0);
@@ -62,32 +89,7 @@ export const ReportGlobalErrors = () => {
62
89
  return <div className={styles["report-global-errors-empty"]}>{t("no-global-errors-results")}</div>;
63
90
  }
64
91
 
65
- return (
66
- <div className={styles["report-global-errors-container"]}>
67
- {entries.map(([environmentId, envErrors]) => {
68
- const isOpened = !collapsedEnvs.includes(environmentId);
69
- const toggleEnv = () => {
70
- setCollapsedEnvs((prev) =>
71
- isOpened ? prev.concat(environmentId) : prev.filter((currentId) => currentId !== environmentId),
72
- );
73
- };
74
-
75
- return (
76
- <div key={environmentId} className={styles["report-global-errors-section"]}>
77
- <MetadataButton
78
- isOpened={isOpened}
79
- setIsOpen={toggleEnv}
80
- title={`${tEnvironments("environment", { count: 1 })}: "${environmentNameById(environmentId)}"`}
81
- titleTooltipText={environmentNameById(environmentId)}
82
- truncateTitle
83
- counter={envErrors.length}
84
- />
85
- {isOpened ? renderErrors(envErrors) : null}
86
- </div>
87
- );
88
- })}
89
- </div>
90
- );
92
+ return renderErrorSections(entries);
91
93
  }}
92
94
  />
93
95
  );
@@ -15,10 +15,10 @@ const environmentNames: Record<string, string> = {
15
15
  qa_env: "QA",
16
16
  };
17
17
 
18
- const setupGlobalsComponent = async (data: Record<string, unknown>) => {
18
+ const setupGlobalsComponent = async (data: Record<string, unknown>, selectedEnvironment = "") => {
19
19
  vi.resetModules();
20
20
 
21
- const currentEnvironment = signal("");
21
+ const currentEnvironment = signal(selectedEnvironment);
22
22
  const globalsStore = signal({
23
23
  loading: false,
24
24
  error: undefined,
@@ -164,4 +164,80 @@ describe("components > Report globals", () => {
164
164
  expect(screen.getByText('environment: "QA" (1)')).toBeInTheDocument();
165
165
  expect(screen.getByText('environment: "Prod" (1)')).toBeInTheDocument();
166
166
  }, 15000);
167
+
168
+ it("should keep only selected attachment bucket", async () => {
169
+ await setupGlobalsComponent(
170
+ {
171
+ attachments: [],
172
+ attachmentsByEnv: {
173
+ default: [
174
+ {
175
+ id: "default",
176
+ name: "default.log",
177
+ originalFileName: "default.log",
178
+ ext: ".log",
179
+ used: true,
180
+ missed: false,
181
+ environment: "default",
182
+ },
183
+ ],
184
+ qa_env: [
185
+ {
186
+ id: "qa",
187
+ name: "qa.log",
188
+ originalFileName: "qa.log",
189
+ ext: ".log",
190
+ used: true,
191
+ missed: false,
192
+ environment: "QA",
193
+ },
194
+ ],
195
+ prod_env: [
196
+ {
197
+ id: "prod",
198
+ name: "prod.log",
199
+ originalFileName: "prod.log",
200
+ ext: ".log",
201
+ used: true,
202
+ missed: false,
203
+ environment: "Prod",
204
+ },
205
+ ],
206
+ },
207
+ },
208
+ "qa_env",
209
+ );
210
+
211
+ const { ReportGlobalAttachments } = await import("@/components/ReportGlobalAttachments");
212
+
213
+ render(<ReportGlobalAttachments />);
214
+
215
+ expect(screen.getByText('environment: "QA" (1)')).toBeInTheDocument();
216
+ expect(screen.queryByText('environment: "default" (1)')).not.toBeInTheDocument();
217
+ expect(screen.queryByText('environment: "Prod" (1)')).not.toBeInTheDocument();
218
+ expect(screen.getByText("qa.log")).toBeInTheDocument();
219
+ }, 15000);
220
+
221
+ it("should keep only selected error bucket", async () => {
222
+ await setupGlobalsComponent(
223
+ {
224
+ errors: [],
225
+ errorsByEnv: {
226
+ default: [{ message: "Default failure", environment: "default" }],
227
+ qa_env: [{ message: "QA failure", environment: "QA" }],
228
+ prod_env: [{ message: "Prod failure", environment: "Prod" }],
229
+ },
230
+ },
231
+ "qa_env",
232
+ );
233
+
234
+ const { ReportGlobalErrors } = await import("@/components/ReportGlobalErrors");
235
+
236
+ render(<ReportGlobalErrors />);
237
+
238
+ expect(screen.getByText('environment: "QA" (1)')).toBeInTheDocument();
239
+ expect(screen.queryByText('environment: "default" (1)')).not.toBeInTheDocument();
240
+ expect(screen.queryByText('environment: "Prod" (1)')).not.toBeInTheDocument();
241
+ expect(screen.getByText("QA failure")).toBeInTheDocument();
242
+ }, 15000);
167
243
  });