@allurereport/plugin-awesome 3.0.0-beta.25 → 3.0.0-beta.26

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.
@@ -2,12 +2,13 @@ import { hasLabels } from "@allurereport/web-commons";
2
2
  const DEFAULT_MIN_DURATION = 1;
3
3
  const HOST_LABEL = "host";
4
4
  const THREAD_LABEL = "thread";
5
+ const DEFAULT_TIMELINE_OPTIONS = {
6
+ minDuration: DEFAULT_MIN_DURATION,
7
+ };
5
8
  export const generateTimeline = async (writer, store, options) => {
6
- if (!options.timeline) {
7
- return;
8
- }
9
+ const { timeline = DEFAULT_TIMELINE_OPTIONS } = options;
10
+ const { minDuration = DEFAULT_MIN_DURATION } = timeline;
9
11
  const testResults = await store.allTestResults({ includeHidden: true });
10
- const { minDuration = DEFAULT_MIN_DURATION } = options.timeline;
11
12
  const result = [];
12
13
  for (const test of testResults) {
13
14
  const hasStart = Number.isInteger(test.start);
@@ -32,7 +33,7 @@ export const generateTimeline = async (writer, store, options) => {
32
33
  environment: test.environment,
33
34
  start: test.start,
34
35
  stop: test.stop,
35
- duration: duration,
36
+ duration,
36
37
  });
37
38
  }
38
39
  await writer.writeWidget("timeline.json", result);
@@ -1,3 +1,4 @@
1
+ import { defaultChartsConfig } from "@allurereport/charts-api";
1
2
  import { compareBy, createBaseUrlScript, createFontLinkTag, createReportDataScript, createScriptTag, createStylesLinkTag, incrementStatistic, nullsLast, ordinal, } from "@allurereport/core-api";
2
3
  import { createTreeByLabels, createTreeByLabelsAndTitlePath, createTreeByTitlePath, filterTree, preciseTreeLabels, sortTree, transformTree, } from "@allurereport/plugin-api";
3
4
  import { generateCharts, getPieChartValues } from "@allurereport/web-commons";
@@ -274,18 +275,12 @@ export const generateQualityGateResults = async (writer, qualityGateResults = []
274
275
  await writer.writeWidget("quality-gate.json", qualityGateResults);
275
276
  };
276
277
  export const generateStaticFiles = async (payload) => {
277
- const { id, reportName = "Allure Report", reportLanguage = "en", singleFile, logo = "", theme = "auto", groupBy, reportFiles, reportDataFiles, reportUuid, allureVersion, layout = "base", charts = [], timeline, defaultSection = "", ci, } = payload;
278
+ const { id, reportName = "Allure Report", reportLanguage = "en", singleFile, logo = "", theme = "auto", groupBy, reportFiles, reportDataFiles, reportUuid, allureVersion, layout = "base", defaultSection = "", ci, } = payload;
278
279
  const compile = Handlebars.compile(template);
279
280
  const manifest = await readTemplateManifest(payload.singleFile);
280
281
  const headTags = [];
281
282
  const bodyTags = [];
282
- const sections = [];
283
- if (charts.length) {
284
- sections.push("charts");
285
- }
286
- if (timeline) {
287
- sections.push("timeline");
288
- }
283
+ const sections = ["charts", "timeline"];
289
284
  if (!payload.singleFile) {
290
285
  for (const key in manifest) {
291
286
  const fileName = manifest[key];
@@ -352,10 +347,7 @@ export const generateStaticFiles = async (payload) => {
352
347
  }
353
348
  };
354
349
  export const generateAllCharts = async (writer, store, options, context) => {
355
- const { charts } = options;
356
- if (!charts) {
357
- return;
358
- }
350
+ const { charts = defaultChartsConfig } = options;
359
351
  const generatedChartsData = await generateCharts(charts, store, context.reportName, randomUUID);
360
352
  if (Object.keys(generatedChartsData.general).length > 0) {
361
353
  await writer.writeWidget("charts.json", generatedChartsData);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allurereport/plugin-awesome",
3
- "version": "3.0.0-beta.25",
3
+ "version": "3.0.0-beta.26",
4
4
  "description": "Allure Awesome Plugin – brand new HTML report with modern design and new features",
5
5
  "keywords": [
6
6
  "allure",
@@ -30,11 +30,11 @@
30
30
  "test": "rimraf ./out && vitest run"
31
31
  },
32
32
  "dependencies": {
33
- "@allurereport/charts-api": "3.0.0-beta.25",
34
- "@allurereport/core-api": "3.0.0-beta.25",
35
- "@allurereport/plugin-api": "3.0.0-beta.25",
36
- "@allurereport/web-awesome": "3.0.0-beta.25",
37
- "@allurereport/web-commons": "3.0.0-beta.25",
33
+ "@allurereport/charts-api": "3.0.0-beta.26",
34
+ "@allurereport/core-api": "3.0.0-beta.26",
35
+ "@allurereport/plugin-api": "3.0.0-beta.26",
36
+ "@allurereport/web-awesome": "3.0.0-beta.26",
37
+ "@allurereport/web-commons": "3.0.0-beta.26",
38
38
  "d3-shape": "^3.2.0",
39
39
  "handlebars": "^4.7.8"
40
40
  },