@allurereport/web-classic 3.0.0-beta.10
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.
- package/.babelrc--old.cjs +18 -0
- package/.babelrc.js +46 -0
- package/.eslintrc--old.cjs +125 -0
- package/.eslintrc.cjs +22 -0
- package/README.md +27 -0
- package/dist/multi/10.app-970f027d.js +1 -0
- package/dist/multi/222.app-970f027d.js +1 -0
- package/dist/multi/26.app-970f027d.js +1 -0
- package/dist/multi/302.app-970f027d.js +1 -0
- package/dist/multi/304.app-970f027d.js +1 -0
- package/dist/multi/369.app-970f027d.js +1 -0
- package/dist/multi/389.app-970f027d.js +1 -0
- package/dist/multi/498.app-970f027d.js +1 -0
- package/dist/multi/60.app-970f027d.js +1 -0
- package/dist/multi/643.app-970f027d.js +1 -0
- package/dist/multi/671.app-970f027d.js +1 -0
- package/dist/multi/725.app-970f027d.js +1 -0
- package/dist/multi/770.app-970f027d.js +1 -0
- package/dist/multi/848.app-970f027d.js +1 -0
- package/dist/multi/853.app-970f027d.js +1 -0
- package/dist/multi/872.app-970f027d.js +1 -0
- package/dist/multi/895.app-970f027d.js +1 -0
- package/dist/multi/920.app-970f027d.js +1 -0
- package/dist/multi/979.app-970f027d.js +1 -0
- package/dist/multi/991.app-970f027d.js +1 -0
- package/dist/multi/JetBrainsMono_vf-9e9649b6..woff2 +0 -0
- package/dist/multi/JetBrainsMono_vf-b9a9c326..woff +0 -0
- package/dist/multi/app-970f027d.js +2 -0
- package/dist/multi/app-970f027d.js.LICENSE.txt +25 -0
- package/dist/multi/manifest.json +28 -0
- package/dist/multi/pt-root-ui_vf-22fe60ca..woff +0 -0
- package/dist/multi/pt-root-ui_vf-9d251e8b..woff2 +0 -0
- package/dist/multi/styles-970f027d.css +283 -0
- package/dist/single/app-2babff54.js +2 -0
- package/dist/single/app-2babff54.js.LICENSE.txt +25 -0
- package/dist/single/manifest.json +3 -0
- package/package--old.json +106 -0
- package/package.json +107 -0
- package/postcss.config.js +5 -0
- package/src/assets/scss/_common.scss +142 -0
- package/src/assets/scss/code.scss +71 -0
- package/src/assets/scss/day.scss +51 -0
- package/src/assets/scss/fonts.scss +3 -0
- package/src/assets/scss/index.scss +9 -0
- package/src/assets/scss/night.scss +61 -0
- package/src/assets/scss/palette.scss +393 -0
- package/src/assets/scss/theme.scss +117 -0
- package/src/assets/scss/typography.scss +218 -0
- package/src/assets/scss/vars.scss +8 -0
- package/src/components/ArrowButton/index.tsx +36 -0
- package/src/components/ArrowButton/styles.scss +35 -0
- package/src/components/BaseLayout/index.tsx +23 -0
- package/src/components/BaseLayout/styles.scss +63 -0
- package/src/components/Behaviors/BehaviorsList.tsx +67 -0
- package/src/components/Behaviors/index.tsx +60 -0
- package/src/components/Behaviors/styles.scss +196 -0
- package/src/components/Categories/CategoriesList.tsx +67 -0
- package/src/components/Categories/index.tsx +60 -0
- package/src/components/Categories/styles.scss +196 -0
- package/src/components/Footer/FooterLogo.tsx +16 -0
- package/src/components/Footer/FooterVersion.tsx +33 -0
- package/src/components/Footer/index.tsx +13 -0
- package/src/components/Footer/styles.scss +14 -0
- package/src/components/Graphs/index.tsx +2 -0
- package/src/components/Header/index.tsx +14 -0
- package/src/components/Header/styles.scss +26 -0
- package/src/components/HeaderActions/Filters.tsx +90 -0
- package/src/components/HeaderActions/HeaderActions.tsx +59 -0
- package/src/components/HeaderActions/SortBy.tsx +128 -0
- package/src/components/HeaderActions/styles.scss +82 -0
- package/src/components/LanguagePicker/index.tsx +41 -0
- package/src/components/LanguagePicker/styles.scss +3 -0
- package/src/components/MainReport/index.tsx +19 -0
- package/src/components/Metadata/index.tsx +121 -0
- package/src/components/Metadata/styles.scss +146 -0
- package/src/components/MetadataButton/index.tsx +32 -0
- package/src/components/MetadataButton/styles.scss +53 -0
- package/src/components/Modal/ModalView.hbs +13 -0
- package/src/components/Modal/ModalView.js +43 -0
- package/src/components/Modal/index.tsx +174 -0
- package/src/components/Modal/styles.scss +126 -0
- package/src/components/Overview/index.tsx +9 -0
- package/src/components/Packages/PackagesList.tsx +67 -0
- package/src/components/Packages/index.tsx +59 -0
- package/src/components/Packages/styles.scss +196 -0
- package/src/components/ReportBody/Filters.tsx +92 -0
- package/src/components/ReportBody/HeaderActions.tsx +21 -0
- package/src/components/ReportBody/SortBy.tsx +132 -0
- package/src/components/ReportBody/context.tsx +106 -0
- package/src/components/ReportBody/index.tsx +71 -0
- package/src/components/ReportBody/styles.scss +64 -0
- package/src/components/ReportHeader/ReportHeaderLabelList.tsx +12 -0
- package/src/components/ReportHeader/ReportHeaderLogo.tsx +10 -0
- package/src/components/ReportHeader/ReportHeaderPie.tsx +14 -0
- package/src/components/ReportHeader/index.tsx +33 -0
- package/src/components/ReportHeader/styles.scss +49 -0
- package/src/components/ReportLogo/index.tsx +16 -0
- package/src/components/ReportLogo/styles.scss +20 -0
- package/src/components/ReportLogoFull/index.tsx +20 -0
- package/src/components/ReportLogoFull/styles.scss +7 -0
- package/src/components/ReportMetadata/MetadataItem.tsx +45 -0
- package/src/components/ReportMetadata/MetadataSummary.tsx +81 -0
- package/src/components/ReportMetadata/MetadataTestType.tsx +16 -0
- package/src/components/ReportMetadata/MetadataWithIcon.tsx +21 -0
- package/src/components/ReportMetadata/index.tsx +46 -0
- package/src/components/ReportMetadata/styles.scss +99 -0
- package/src/components/SideBySide/index.tsx +54 -0
- package/src/components/SideBySide/styles.scss +59 -0
- package/src/components/SideNav/SideNav.tsx +78 -0
- package/src/components/SideNav/SideNavView.hbs +39 -0
- package/src/components/SideNav/SideNavView.js +81 -0
- package/src/components/SideNav/styles.scss +126 -0
- package/src/components/Suites/index.tsx +62 -0
- package/src/components/Suites/styles.scss +10 -0
- package/src/components/Tabs/index.tsx +33 -0
- package/src/components/Tabs/styles.scss +56 -0
- package/src/components/TestResult/TestResultAttachmentsView/index.tsx +27 -0
- package/src/components/TestResult/TestResultAttachmentsView/styles.scss +12 -0
- package/src/components/TestResult/TestResultDescription/index.tsx +27 -0
- package/src/components/TestResult/TestResultDescription/styles.scss +12 -0
- package/src/components/TestResult/TestResultDropdown/index.tsx +23 -0
- package/src/components/TestResult/TestResultDropdown/styles.scss +34 -0
- package/src/components/TestResult/TestResultEmpty/index.tsx +33 -0
- package/src/components/TestResult/TestResultEmpty/styles.scss +25 -0
- package/src/components/TestResult/TestResultError/index.tsx +48 -0
- package/src/components/TestResult/TestResultError/styles.scss +51 -0
- package/src/components/TestResult/TestResultHeader/index.tsx +53 -0
- package/src/components/TestResult/TestResultHeader/styles.scss +43 -0
- package/src/components/TestResult/TestResultHistory/TestResultHistoryItem.tsx +67 -0
- package/src/components/TestResult/TestResultHistory/index.tsx +26 -0
- package/src/components/TestResult/TestResultHistory/styles.scss +63 -0
- package/src/components/TestResult/TestResultInfo/TestResultInfoStatuses.tsx +30 -0
- package/src/components/TestResult/TestResultInfo/index.tsx +79 -0
- package/src/components/TestResult/TestResultInfo/styles.scss +50 -0
- package/src/components/TestResult/TestResultLinks/index.tsx +56 -0
- package/src/components/TestResult/TestResultLinks/styles.scss +30 -0
- package/src/components/TestResult/TestResultMetadata/index.tsx +27 -0
- package/src/components/TestResult/TestResultMetadata/styles.scss +8 -0
- package/src/components/TestResult/TestResultNavigation/index.tsx +80 -0
- package/src/components/TestResult/TestResultNavigation/styles.scss +48 -0
- package/src/components/TestResult/TestResultOverview.tsx +40 -0
- package/src/components/TestResult/TestResultParameters/index.tsx +30 -0
- package/src/components/TestResult/TestResultParameters/styles.scss +8 -0
- package/src/components/TestResult/TestResultPrevStatuses/index.tsx +49 -0
- package/src/components/TestResult/TestResultPrevStatuses/styles.scss +57 -0
- package/src/components/TestResult/TestResultRetriesView/TestResultRetriesItem.tsx +49 -0
- package/src/components/TestResult/TestResultRetriesView/index.tsx +20 -0
- package/src/components/TestResult/TestResultRetriesView/styles.scss +69 -0
- package/src/components/TestResult/TestResultSetup/index.tsx +49 -0
- package/src/components/TestResult/TestResultSeverity/index.tsx +27 -0
- package/src/components/TestResult/TestResultSeverity/styles.scss +29 -0
- package/src/components/TestResult/TestResultStatus/index.tsx +26 -0
- package/src/components/TestResult/TestResultStatus/styles.scss +36 -0
- package/src/components/TestResult/TestResultSteps/HtmlAttachmentPreview.tsx +12 -0
- package/src/components/TestResult/TestResultSteps/attachment.tsx +68 -0
- package/src/components/TestResult/TestResultSteps/attachmentCode.tsx +20 -0
- package/src/components/TestResult/TestResultSteps/attachmentImage.tsx +32 -0
- package/src/components/TestResult/TestResultSteps/attachmentVideo.tsx +15 -0
- package/src/components/TestResult/TestResultSteps/index.tsx +49 -0
- package/src/components/TestResult/TestResultSteps/styles.scss +225 -0
- package/src/components/TestResult/TestResultSteps/testResultAttachment.tsx +77 -0
- package/src/components/TestResult/TestResultSteps/testResultAttachmentInfo.tsx +83 -0
- package/src/components/TestResult/TestResultSteps/testResultStep.tsx +78 -0
- package/src/components/TestResult/TestResultSteps/testResultStepInfo.tsx +30 -0
- package/src/components/TestResult/TestResultSteps/wrongAttachment.tsx +8 -0
- package/src/components/TestResult/TestResultTabs/index.tsx +59 -0
- package/src/components/TestResult/TestResultTabs/styles.scss +76 -0
- package/src/components/TestResult/TestResultTeardown/index.tsx +49 -0
- package/src/components/TestResult/TestResultView.hbs +32 -0
- package/src/components/TestResult/TestResultView.js +90 -0
- package/src/components/TestResult/index.tsx +54 -0
- package/src/components/TestResult/styles.scss +29 -0
- package/src/components/TestResultView/index.tsx +31 -0
- package/src/components/ThemeButton/ThemeButton.tsx +20 -0
- package/src/components/Timeline/index.tsx +2 -0
- package/src/components/Tree/Tree.tsx +76 -0
- package/src/components/Tree/TreeHeader.tsx +82 -0
- package/src/components/Tree/TreeItem.tsx +49 -0
- package/src/components/Tree/TreeItemIcon.tsx +32 -0
- package/src/components/Tree/index.tsx +60 -0
- package/src/components/Tree/styles.scss +185 -0
- package/src/favicon.ico +0 -0
- package/src/index.html +40 -0
- package/src/index.js +52 -0
- package/src/index.tsx +60 -0
- package/src/mixins.scss +128 -0
- package/src/rtl.scss +19 -0
- package/src/stores/behaviors.ts +127 -0
- package/src/stores/categories.ts +127 -0
- package/src/stores/chart.ts +32 -0
- package/src/stores/envInfo.ts +34 -0
- package/src/stores/index.ts +4 -0
- package/src/stores/locale.ts +83 -0
- package/src/stores/packages.ts +127 -0
- package/src/stores/router.ts +55 -0
- package/src/stores/stats.ts +36 -0
- package/src/stores/tabs.ts +7 -0
- package/src/stores/testResults.ts +66 -0
- package/src/stores/theme.ts +33 -0
- package/src/stores/tree.ts +127 -0
- package/src/stores/types.ts +5 -0
- package/src/styles.scss +91 -0
- package/src/translations/am.json +127 -0
- package/src/translations/az.json +127 -0
- package/src/translations/br.json +214 -0
- package/src/translations/constants.ts +124 -0
- package/src/translations/de.json +127 -0
- package/src/translations/en.json +128 -0
- package/src/translations/es.json +118 -0
- package/src/translations/fr.json +118 -0
- package/src/translations/he.json +118 -0
- package/src/translations/isv.json +216 -0
- package/src/translations/it.json +118 -0
- package/src/translations/ja.json +118 -0
- package/src/translations/ka.json +118 -0
- package/src/translations/kr.json +118 -0
- package/src/translations/nl.json +118 -0
- package/src/translations/pl.json +116 -0
- package/src/translations/pt.json +118 -0
- package/src/translations/ru.json +116 -0
- package/src/translations/sv.json +118 -0
- package/src/translations/tr.json +118 -0
- package/src/translations/zh.json +118 -0
- package/src/types/globals.d.ts +13 -0
- package/src/types/window.d.ts +8 -0
- package/src/utils/attachments.ts +156 -0
- package/src/utils/capitalize.ts +6 -0
- package/src/utils/copyToClipboard.ts +16 -0
- package/src/utils/isMac.ts +8 -0
- package/src/utils/navigate.ts +7 -0
- package/src/utils/statuses.js +1 -0
- package/src/utils/statuses.ts +55 -0
- package/src/utils/time.ts +17 -0
- package/src/utils/treeFilters.ts +139 -0
- package/src/variables.scss +71 -0
- package/test/utils/treeFilters.test.ts +448 -0
- package/tsconfig.json +25 -0
- package/types.d.ts +85 -0
- package/vitest.config.ts +18 -0
- package/webpack.config--old.js +127 -0
- package/webpack.config.js +108 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const values = ["failed", "broken", "passed", "skipped", "unknown"];
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { DefaultTreeGroup, DefaultTreeLeaf, TestStatus, TreeData } from "@allurereport/core-api";
|
|
2
|
+
|
|
3
|
+
export type Stats = Record<TestStatus, number> & { total?: number };
|
|
4
|
+
|
|
5
|
+
const emptyStat: Stats = { failed: 0, broken: 0, passed: 0, skipped: 0, unknown: 0 };
|
|
6
|
+
|
|
7
|
+
const statisticByIds = (tree: TreeData<DefaultTreeLeaf, DefaultTreeGroup>, ids: string[]): Stats => {
|
|
8
|
+
return ids
|
|
9
|
+
.map((id) => tree.leavesById[id])
|
|
10
|
+
.filter((v) => v)
|
|
11
|
+
.reduce(
|
|
12
|
+
(prev, current) => {
|
|
13
|
+
prev[current.status]++;
|
|
14
|
+
return prev;
|
|
15
|
+
},
|
|
16
|
+
{ ...emptyStat },
|
|
17
|
+
);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const mergeStats = (stat1: Stats, stat2: Stats): Stats => {
|
|
21
|
+
Object.keys(stat1).forEach((key) => {
|
|
22
|
+
stat1[key as TestStatus] += stat2[key as TestStatus];
|
|
23
|
+
});
|
|
24
|
+
return stat1;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const getGroupStatistics = (
|
|
28
|
+
tree: TreeData<DefaultTreeLeaf, DefaultTreeGroup>,
|
|
29
|
+
groupId: string,
|
|
30
|
+
statusFilter?: string,
|
|
31
|
+
): Stats => {
|
|
32
|
+
const group = tree.groupsById[groupId];
|
|
33
|
+
let stat: Stats = { ...emptyStat };
|
|
34
|
+
|
|
35
|
+
if (group?.leaves?.length) {
|
|
36
|
+
stat = mergeStats(stat, statisticByIds(tree, group.leaves));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (group?.groups?.length) {
|
|
40
|
+
for (const subGroupId of group.groups) {
|
|
41
|
+
const subGroupStat = getGroupStatistics(tree, subGroupId, statusFilter);
|
|
42
|
+
stat = mergeStats(stat, subGroupStat);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return stat;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const getStatistics = (tree: TreeData<DefaultTreeLeaf, DefaultTreeGroup>) =>
|
|
50
|
+
tree.root.groups
|
|
51
|
+
?.map((groupId) => {
|
|
52
|
+
const stat = getGroupStatistics(tree, groupId);
|
|
53
|
+
return { name: tree.groupsById[groupId].name, statistic: stat };
|
|
54
|
+
})
|
|
55
|
+
?.sort((a, b) => a.name.localeCompare(b.name)) ?? [];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useI18n } from "@/stores/locale";
|
|
2
|
+
|
|
3
|
+
const defaultOptions: Intl.DateTimeFormatOptions = {
|
|
4
|
+
month: "numeric",
|
|
5
|
+
day: "numeric",
|
|
6
|
+
year: "numeric",
|
|
7
|
+
hour: "numeric",
|
|
8
|
+
minute: "numeric",
|
|
9
|
+
second: "numeric",
|
|
10
|
+
hour12: false,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const timestampToDate = (timestamp: number, options = defaultOptions) => {
|
|
14
|
+
const date = new Date(timestamp);
|
|
15
|
+
const { t } = useI18n("ui");
|
|
16
|
+
return new Intl.DateTimeFormat("en-US", options).format(date).replace(",", ` ${t("at")}`);
|
|
17
|
+
};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import type { Comparator, DefaultTreeGroup, Statistic, TestStatus, TreeLeaf } from "@allurereport/core-api";
|
|
2
|
+
import {
|
|
3
|
+
alphabetically,
|
|
4
|
+
andThen,
|
|
5
|
+
byStatistic,
|
|
6
|
+
byStatus,
|
|
7
|
+
compareBy,
|
|
8
|
+
emptyStatistic,
|
|
9
|
+
incrementStatistic,
|
|
10
|
+
mergeStatistic,
|
|
11
|
+
ordinal,
|
|
12
|
+
reverse,
|
|
13
|
+
} from "@allurereport/core-api";
|
|
14
|
+
import type { TreeFiltersState, TreeSortBy } from "@/stores/tree";
|
|
15
|
+
import type { AwesomeRecursiveTree, AwesomeTree, AwesomeTreeGroup, AwesomeTreeLeaf } from "../../types";
|
|
16
|
+
|
|
17
|
+
export const isIncluded = (leaf: TreeLeaf<AwesomeTreeLeaf>, filterOptions: TreeFiltersState) => {
|
|
18
|
+
const queryMatched = !filterOptions?.query || leaf.name.toLowerCase().includes(filterOptions.query.toLowerCase());
|
|
19
|
+
const statusMatched =
|
|
20
|
+
!filterOptions?.status || filterOptions?.status === "total" || leaf.status === filterOptions.status;
|
|
21
|
+
const flakyMatched = !filterOptions?.filter?.flaky || leaf.flaky;
|
|
22
|
+
const retryMatched = !filterOptions?.filter?.retry || leaf.retry;
|
|
23
|
+
// TODO: at this moment we don't have a new field implementation even in the generator
|
|
24
|
+
// const newMatched = !filterOptions?.filter?.new || leaf.new;
|
|
25
|
+
|
|
26
|
+
return [queryMatched, statusMatched, flakyMatched, retryMatched].every(Boolean);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const leafComparatorByTreeSortBy = (sortBy: TreeSortBy): Comparator<TreeLeaf<AwesomeTreeLeaf>> => {
|
|
30
|
+
const typedCompareBy = compareBy<TreeLeaf<AwesomeTreeLeaf>>;
|
|
31
|
+
switch (sortBy) {
|
|
32
|
+
case "order":
|
|
33
|
+
return typedCompareBy("groupOrder", ordinal());
|
|
34
|
+
case "duration":
|
|
35
|
+
return typedCompareBy("duration", ordinal());
|
|
36
|
+
case "alphabet":
|
|
37
|
+
return typedCompareBy("name", alphabetically());
|
|
38
|
+
case "status":
|
|
39
|
+
return typedCompareBy("status", byStatus());
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const groupComparatorByTreeSortBy = (sortBy: TreeSortBy): Comparator<DefaultTreeGroup> => {
|
|
44
|
+
const typedCompareBy = compareBy<DefaultTreeGroup>;
|
|
45
|
+
switch (sortBy) {
|
|
46
|
+
case "alphabet":
|
|
47
|
+
return typedCompareBy("name", alphabetically());
|
|
48
|
+
case "order":
|
|
49
|
+
case "duration":
|
|
50
|
+
case "status":
|
|
51
|
+
return typedCompareBy("statistic", byStatistic());
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const leafComparator = (filterOptions: TreeFiltersState): Comparator<TreeLeaf<AwesomeTreeLeaf>> => {
|
|
56
|
+
const cmp = leafComparatorByTreeSortBy(filterOptions.sortBy);
|
|
57
|
+
const directional = filterOptions.direction === "asc" ? cmp : reverse(cmp);
|
|
58
|
+
// apply fallback sorting by name
|
|
59
|
+
return andThen([directional, compareBy("name", alphabetically())]);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export const groupComparator = (filterOptions: TreeFiltersState): Comparator<DefaultTreeGroup> => {
|
|
63
|
+
const cmp = groupComparatorByTreeSortBy(filterOptions.sortBy);
|
|
64
|
+
const directional = filterOptions.direction === "asc" ? cmp : reverse(cmp);
|
|
65
|
+
// apply fallback sorting by name
|
|
66
|
+
return andThen([directional, compareBy("name", alphabetically())]);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const filterLeaves = (
|
|
70
|
+
leaves: string[] = [],
|
|
71
|
+
leavesById: AwesomeTree["leavesById"],
|
|
72
|
+
filterOptions: TreeFiltersState,
|
|
73
|
+
) => {
|
|
74
|
+
const filteredLeaves = [...leaves]
|
|
75
|
+
.map((leafId) => leavesById[leafId])
|
|
76
|
+
.filter((leaf: TreeLeaf<AwesomeTreeLeaf>) => isIncluded(leaf, filterOptions));
|
|
77
|
+
|
|
78
|
+
const comparator = leafComparator(filterOptions);
|
|
79
|
+
return filteredLeaves.sort(comparator);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Fills the given tree from generator and returns recursive tree which includes leaves data instead of their IDs
|
|
84
|
+
* Filters leaves when `filterOptions` property is provided
|
|
85
|
+
* @param payload
|
|
86
|
+
*/
|
|
87
|
+
export const createRecursiveTree = (payload: {
|
|
88
|
+
group: AwesomeTreeGroup;
|
|
89
|
+
groupsById: AwesomeTree["groupsById"];
|
|
90
|
+
leavesById: AwesomeTree["leavesById"];
|
|
91
|
+
filterOptions?: TreeFiltersState;
|
|
92
|
+
}): AwesomeRecursiveTree => {
|
|
93
|
+
const { group, groupsById, leavesById, filterOptions } = payload;
|
|
94
|
+
const groupLeaves: string[] = group.leaves ?? [];
|
|
95
|
+
|
|
96
|
+
const leaves = filterLeaves(groupLeaves, leavesById, filterOptions);
|
|
97
|
+
const trees =
|
|
98
|
+
group.groups
|
|
99
|
+
?.map((groupId) =>
|
|
100
|
+
createRecursiveTree({
|
|
101
|
+
group: groupsById[groupId],
|
|
102
|
+
groupsById,
|
|
103
|
+
leavesById,
|
|
104
|
+
filterOptions,
|
|
105
|
+
}),
|
|
106
|
+
)
|
|
107
|
+
?.filter((rt) => !isRecursiveTreeEmpty(rt)) ?? [];
|
|
108
|
+
|
|
109
|
+
const statistic: Statistic = emptyStatistic();
|
|
110
|
+
trees.forEach((rt: AwesomeRecursiveTree) => {
|
|
111
|
+
if (rt.statistic) {
|
|
112
|
+
const additional: Statistic = rt.statistic;
|
|
113
|
+
mergeStatistic(statistic, additional);
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
leaves.forEach((leaf) => {
|
|
117
|
+
const status: TestStatus = leaf.status;
|
|
118
|
+
incrementStatistic(statistic, status);
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
return {
|
|
122
|
+
...group,
|
|
123
|
+
statistic,
|
|
124
|
+
leaves,
|
|
125
|
+
trees: trees.sort(groupComparator(filterOptions)),
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
export const isRecursiveTreeEmpty = (tree: AwesomeRecursiveTree): boolean => {
|
|
130
|
+
if (!tree.trees?.length && !tree.leaves?.length) {
|
|
131
|
+
return true;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
if (tree.leaves?.length) {
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
return tree.trees?.every((subTree) => isRecursiveTreeEmpty(subTree));
|
|
139
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
$brand-blue: #0044bb;
|
|
2
|
+
$brand-red: #ff0000;
|
|
3
|
+
|
|
4
|
+
$color-passed: #97cc64;
|
|
5
|
+
$color-failed: #fd5a3e;
|
|
6
|
+
$color-broken: #ffd050;
|
|
7
|
+
$color-skipped: #aaa;
|
|
8
|
+
$color-unknown: #d35ebe;
|
|
9
|
+
|
|
10
|
+
$background-light-passed: #eef9eb;
|
|
11
|
+
$background-light-failed: #ffe7e6;
|
|
12
|
+
$background-light-broken: #fffae6;
|
|
13
|
+
$background-light-skipped: #f2f2f2;
|
|
14
|
+
$background-light-unknown: #faebf7;
|
|
15
|
+
|
|
16
|
+
$background-passed: #a6e19d;
|
|
17
|
+
$background-failed: #ffaca6;
|
|
18
|
+
$background-broken: #ffeca0;
|
|
19
|
+
$background-skipped: #cccccc;
|
|
20
|
+
$background-unknown: #ecb7e2;
|
|
21
|
+
|
|
22
|
+
$header-bg: #fff;
|
|
23
|
+
$heading-bg: #f6f5f3;
|
|
24
|
+
$body-bg: #fff;
|
|
25
|
+
$content-bg: #fff;
|
|
26
|
+
$attachment-bg: #f8f8f9;
|
|
27
|
+
|
|
28
|
+
$border-color: #eceff1;
|
|
29
|
+
$border-accent-color: #e5e5e5;
|
|
30
|
+
|
|
31
|
+
$hover-color: #e4edfe;
|
|
32
|
+
$selected-color: #fffacd;
|
|
33
|
+
$summary-color: #f6f5f3;
|
|
34
|
+
|
|
35
|
+
$text-color: #000;
|
|
36
|
+
$text-muted-color: #999;
|
|
37
|
+
|
|
38
|
+
$gap-size: 16px;
|
|
39
|
+
$footer-gap-size: 32px;
|
|
40
|
+
|
|
41
|
+
$small-screen: 1000px;
|
|
42
|
+
$min-pane-size: 300px;
|
|
43
|
+
|
|
44
|
+
/* Sidebar **/
|
|
45
|
+
|
|
46
|
+
$sidebar-full-width: 180px;
|
|
47
|
+
$sidebar-collapsed: 60px;
|
|
48
|
+
|
|
49
|
+
$sidebar-separator-color: #4d4d4d;
|
|
50
|
+
$sidebar-active-accent-color: #64b5f6;
|
|
51
|
+
$app-nav-bg: #343434;
|
|
52
|
+
$sidebar-active-text-color: #fff;
|
|
53
|
+
$sidebar-hover-text-color: #fff;
|
|
54
|
+
$sidebar-brand-color: #fff;
|
|
55
|
+
$sidebar-text-shadow-color: #000;
|
|
56
|
+
|
|
57
|
+
/* Links */
|
|
58
|
+
|
|
59
|
+
$link-color: #000;
|
|
60
|
+
$link-color-hover: #f00;
|
|
61
|
+
|
|
62
|
+
/* Pane set */
|
|
63
|
+
|
|
64
|
+
$pane-bg-color: #fff;
|
|
65
|
+
$pane-shadow-color: #999;
|
|
66
|
+
$pane-overlay-bg: rgba(240, 240, 240, 0.4);
|
|
67
|
+
$pane-overlay-bg-hover: rgba(240, 240, 240, 0.2);
|
|
68
|
+
|
|
69
|
+
/* Tooltip */
|
|
70
|
+
$tooltip-bg: rgba(50, 50, 50, 0.8);
|
|
71
|
+
$tooltip-color: #fff;
|