@allurereport/web-awesome 3.0.0 → 3.1.0
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/dist/multi/173.app-79c65c7bff941abcbc51.js +1 -0
- package/dist/multi/174.app-79c65c7bff941abcbc51.js +1 -0
- package/dist/multi/252.app-79c65c7bff941abcbc51.js +1 -0
- package/dist/multi/282.app-79c65c7bff941abcbc51.js +1 -0
- package/dist/multi/29.app-79c65c7bff941abcbc51.js +1 -0
- package/dist/multi/416.app-79c65c7bff941abcbc51.js +1 -0
- package/dist/multi/527.app-79c65c7bff941abcbc51.js +1 -0
- package/dist/multi/600.app-79c65c7bff941abcbc51.js +1 -0
- package/dist/multi/605.app-79c65c7bff941abcbc51.js +1 -0
- package/dist/multi/638.app-79c65c7bff941abcbc51.js +1 -0
- package/dist/multi/672.app-79c65c7bff941abcbc51.js +1 -0
- package/dist/multi/686.app-79c65c7bff941abcbc51.js +1 -0
- package/dist/multi/725.app-79c65c7bff941abcbc51.js +1 -0
- package/dist/multi/741.app-79c65c7bff941abcbc51.js +1 -0
- package/dist/multi/755.app-79c65c7bff941abcbc51.js +1 -0
- package/dist/multi/894.app-79c65c7bff941abcbc51.js +1 -0
- package/dist/multi/91.app-79c65c7bff941abcbc51.js +1 -0
- package/dist/multi/943.app-79c65c7bff941abcbc51.js +1 -0
- package/dist/multi/980.app-79c65c7bff941abcbc51.js +1 -0
- package/dist/multi/app-79c65c7bff941abcbc51.js +2 -0
- package/dist/multi/{app-9931797d1602fc52db5b.js.LICENSE.txt → app-79c65c7bff941abcbc51.js.LICENSE.txt} +7 -0
- package/dist/multi/manifest.json +21 -21
- package/dist/multi/styles-9e390bad7ce54a807a8e.css +49 -0
- package/dist/single/app-3ca67f29d0f1166c08ca.js +2 -0
- package/dist/single/{app-6199dc1c2fd3bddc2526.js.LICENSE.txt → app-3ca67f29d0f1166c08ca.js.LICENSE.txt} +7 -0
- package/dist/single/manifest.json +1 -1
- package/package.json +8 -8
- package/src/assets/scss/palette.scss +102 -102
- package/src/assets/scss/vars.scss +3 -0
- package/src/components/BaseLayout/index.tsx +25 -21
- package/src/components/BaseLayout/styles.scss +1 -0
- package/src/components/Charts/index.tsx +5 -2
- package/src/components/Footer/FooterVersion.tsx +14 -8
- package/src/components/Header/index.tsx +9 -7
- package/src/components/HeaderControls/index.tsx +5 -2
- package/src/components/MainReport/styles.scss +1 -0
- package/src/components/Metadata/index.tsx +24 -7
- package/src/components/ReportBody/HeaderActions.tsx +4 -13
- package/src/components/ReportBody/SortBy.tsx +28 -17
- package/src/components/ReportBody/index.tsx +12 -17
- package/src/components/ReportBody/styles.scss +4 -1
- package/src/components/ReportFilters/BaseFilters.tsx +345 -0
- package/src/components/ReportFilters/RetryFlaky.tsx +29 -0
- package/src/components/ReportFilters/TagsFilter.tsx +41 -0
- package/src/components/ReportFilters/TransitionFilter.tsx +49 -0
- package/src/components/ReportFilters/index.tsx +44 -0
- package/src/components/ReportFilters/styles.scss +55 -0
- package/src/components/ReportSearch/index.tsx +29 -0
- package/src/components/ReportTabs/index.tsx +37 -0
- package/src/components/SectionPicker/index.tsx +1 -1
- package/src/components/SplitLayout/index.tsx +7 -5
- package/src/components/TestResult/TestStepsEmpty/index.tsx +1 -7
- package/src/components/TestResult/TrEmpty/index.tsx +1 -7
- package/src/components/TestResult/TrEnvironmentItem/index.tsx +2 -2
- package/src/components/TestResult/TrError/index.tsx +9 -2
- package/src/components/TestResult/TrHeader/TrBreadcrumbs.tsx +2 -2
- package/src/components/TestResult/TrHistory/TrHistoryItem.tsx +38 -7
- package/src/components/TestResult/TrHistory/index.tsx +18 -8
- package/src/components/TestResult/TrHistory/styles.scss +4 -7
- package/src/components/TestResult/TrInfo/styles.scss +1 -0
- package/src/components/TestResult/TrNavigation/index.tsx +109 -68
- package/src/components/TestResult/TrNavigation/styles.scss +15 -25
- package/src/components/TestResult/TrPwTraces/PwTraceButton.tsx +1 -8
- package/src/components/TestResult/TrRetriesView/TrRetriesItem.tsx +2 -3
- package/src/components/TestResult/TrRetriesView/index.tsx +4 -3
- package/src/components/TestResult/TrSteps/TrAttachment.tsx +5 -3
- package/src/components/TestResult/TrSteps/TrAttachmentInfo.tsx +10 -3
- package/src/components/TestResult/TrSteps/TrStep.tsx +3 -3
- package/src/components/TestResult/TrTabs/index.tsx +7 -23
- package/src/components/TestResult/index.tsx +9 -4
- package/src/components/TestResult/styles.scss +1 -0
- package/src/components/Tree/index.tsx +22 -25
- package/src/index.html +19 -18
- package/src/index.tsx +20 -28
- package/src/locales/az.json +42 -12
- package/src/locales/de.json +42 -12
- package/src/locales/en.json +42 -12
- package/src/locales/es.json +42 -12
- package/src/locales/fr.json +42 -12
- package/src/locales/he.json +42 -12
- package/src/locales/hy.json +42 -12
- package/src/locales/it.json +42 -12
- package/src/locales/ja.json +42 -12
- package/src/locales/ka.json +42 -12
- package/src/locales/kr.json +42 -12
- package/src/locales/nl.json +42 -12
- package/src/locales/pl.json +42 -12
- package/src/locales/pt.json +42 -12
- package/src/locales/ru.json +42 -12
- package/src/locales/sv.json +42 -12
- package/src/locales/tr.json +42 -12
- package/src/locales/ua.json +42 -12
- package/src/locales/zh.json +42 -12
- package/src/stores/chart.ts +2 -2
- package/src/stores/env.ts +6 -6
- package/src/stores/envInfo.ts +2 -2
- package/src/stores/globals.ts +1 -1
- package/src/stores/index.ts +0 -1
- package/src/stores/layout.ts +20 -11
- package/src/stores/locale.ts +2 -1
- package/src/stores/qualityGate.ts +2 -2
- package/src/stores/router.ts +25 -91
- package/src/stores/sections.ts +32 -45
- package/src/stores/stats.ts +4 -4
- package/src/stores/testResult.ts +5 -0
- package/src/stores/testResults.ts +7 -5
- package/src/stores/tree.ts +49 -126
- package/src/stores/treeFilters/actions.ts +63 -0
- package/src/stores/treeFilters/constants.ts +13 -0
- package/src/stores/treeFilters/model.ts +51 -0
- package/src/stores/treeFilters/store.ts +273 -0
- package/src/stores/treeFilters/utils.ts +132 -0
- package/src/stores/treeSort.ts +71 -0
- package/src/stores/variables.ts +3 -3
- package/src/utils/persist.ts +23 -0
- package/src/utils/tree.ts +12 -5
- package/src/utils/treeFilters.ts +48 -54
- package/test/components/Header.test.tsx +49 -58
- package/test/utils/treeFilters.test.ts +18 -176
- package/types.d.ts +4 -1
- package/dist/multi/173.app-9931797d1602fc52db5b.js +0 -1
- package/dist/multi/174.app-9931797d1602fc52db5b.js +0 -1
- package/dist/multi/252.app-9931797d1602fc52db5b.js +0 -1
- package/dist/multi/282.app-9931797d1602fc52db5b.js +0 -1
- package/dist/multi/29.app-9931797d1602fc52db5b.js +0 -1
- package/dist/multi/416.app-9931797d1602fc52db5b.js +0 -1
- package/dist/multi/527.app-9931797d1602fc52db5b.js +0 -1
- package/dist/multi/600.app-9931797d1602fc52db5b.js +0 -1
- package/dist/multi/605.app-9931797d1602fc52db5b.js +0 -1
- package/dist/multi/638.app-9931797d1602fc52db5b.js +0 -1
- package/dist/multi/672.app-9931797d1602fc52db5b.js +0 -1
- package/dist/multi/686.app-9931797d1602fc52db5b.js +0 -1
- package/dist/multi/725.app-9931797d1602fc52db5b.js +0 -1
- package/dist/multi/741.app-9931797d1602fc52db5b.js +0 -1
- package/dist/multi/755.app-9931797d1602fc52db5b.js +0 -1
- package/dist/multi/894.app-9931797d1602fc52db5b.js +0 -1
- package/dist/multi/91.app-9931797d1602fc52db5b.js +0 -1
- package/dist/multi/943.app-9931797d1602fc52db5b.js +0 -1
- package/dist/multi/980.app-9931797d1602fc52db5b.js +0 -1
- package/dist/multi/app-9931797d1602fc52db5b.js +0 -2
- package/dist/multi/styles-8fe37354d1c2270c691e.css +0 -48
- package/dist/single/app-6199dc1c2fd3bddc2526.js +0 -2
- package/src/components/ReportBody/Filters.tsx +0 -71
- package/src/components/Tabs/index.tsx +0 -62
- package/src/stores/theme.ts +0 -30
- /package/src/components/{Tabs → ReportTabs}/styles.scss +0 -0
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { Button, Menu, Toggle, TooltipWrapper, allureIcons } from "@allurereport/web-components";
|
|
2
|
-
import { useI18n } from "@/stores/locale";
|
|
3
|
-
import { type TreeFilters, setTreeFilter, treeFiltersStore } from "@/stores/tree";
|
|
4
|
-
import * as styles from "./styles.scss";
|
|
5
|
-
|
|
6
|
-
const filterIcons: Record<TreeFilters, string> = {
|
|
7
|
-
flaky: allureIcons.lineIconBomb2,
|
|
8
|
-
retry: allureIcons.lineArrowsRefreshCcw1,
|
|
9
|
-
new: allureIcons.lineAlertsNew,
|
|
10
|
-
fixed: allureIcons.lineAlertsFixed,
|
|
11
|
-
regressed: allureIcons.lineAlertsRegressed,
|
|
12
|
-
malfunctioned: allureIcons.lineAlertsMalfunctioned,
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
const MENU_KEYS = ["flaky", "retry", "new", "fixed", "regressed", "malfunctioned"] as TreeFilters[];
|
|
16
|
-
|
|
17
|
-
export const Filters = () => {
|
|
18
|
-
const { t } = useI18n("filters");
|
|
19
|
-
const { t: tooltip } = useI18n("filters.description");
|
|
20
|
-
const hasFilter = MENU_KEYS.some((key) => treeFiltersStore.value.filter[key]);
|
|
21
|
-
|
|
22
|
-
const renderFilterItem = (filter: TreeFilters, value: boolean) => {
|
|
23
|
-
return (
|
|
24
|
-
<TooltipWrapper data-testid="filter-tooltip" tooltipText={tooltip(filter)}>
|
|
25
|
-
<Menu.Item
|
|
26
|
-
closeMenuOnClick={false}
|
|
27
|
-
ariaLabel={t("enable-filter", { filter: t(filter) })}
|
|
28
|
-
onClick={() => {
|
|
29
|
-
setTreeFilter(filter, !value);
|
|
30
|
-
}}
|
|
31
|
-
leadingIcon={filterIcons[filter]}
|
|
32
|
-
rightSlot={
|
|
33
|
-
<div className={styles.filterToggle}>
|
|
34
|
-
<Toggle
|
|
35
|
-
focusable={false}
|
|
36
|
-
value={value}
|
|
37
|
-
label={t("enable-filter", { filter: t(filter) })}
|
|
38
|
-
data-testid={`${filter}-filter`}
|
|
39
|
-
onChange={(changeValue) => setTreeFilter(filter, changeValue)}
|
|
40
|
-
/>
|
|
41
|
-
</div>
|
|
42
|
-
}
|
|
43
|
-
>
|
|
44
|
-
{t(filter)}
|
|
45
|
-
</Menu.Item>
|
|
46
|
-
</TooltipWrapper>
|
|
47
|
-
);
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
return (
|
|
51
|
-
<Menu
|
|
52
|
-
menuTrigger={({ isOpened, onClick }) => (
|
|
53
|
-
<div className={hasFilter && styles.filtersBtnWithFilters}>
|
|
54
|
-
<Button
|
|
55
|
-
icon={allureIcons.lineGeneralSettings1}
|
|
56
|
-
text={t("more-filters")}
|
|
57
|
-
size="m"
|
|
58
|
-
style="outline"
|
|
59
|
-
isActive={isOpened}
|
|
60
|
-
data-testid="filters-button"
|
|
61
|
-
onClick={onClick}
|
|
62
|
-
/>
|
|
63
|
-
</div>
|
|
64
|
-
)}
|
|
65
|
-
>
|
|
66
|
-
<Menu.Section data-testid="filters-menu">
|
|
67
|
-
{MENU_KEYS.map((key: TreeFilters) => renderFilterItem(key, treeFiltersStore.value.filter[key]))}
|
|
68
|
-
</Menu.Section>
|
|
69
|
-
</Menu>
|
|
70
|
-
);
|
|
71
|
-
};
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { Text } from "@allurereport/web-components";
|
|
2
|
-
import { type ComponentChildren, createContext } from "preact";
|
|
3
|
-
import { useContext, useState } from "preact/hooks";
|
|
4
|
-
import { setTreeStatus } from "@/stores/tree";
|
|
5
|
-
import type { AwesomeStatus } from "../../../types";
|
|
6
|
-
import * as styles from "./styles.scss";
|
|
7
|
-
|
|
8
|
-
type TabsContextT = {
|
|
9
|
-
currentTab: string | undefined;
|
|
10
|
-
setCurrentTab: (tab: string) => void;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const TabsContext = createContext<TabsContextT | null>(null);
|
|
14
|
-
|
|
15
|
-
export const useTabsContext = () => {
|
|
16
|
-
const context = useContext(TabsContext);
|
|
17
|
-
|
|
18
|
-
if (!context) {
|
|
19
|
-
throw new Error("Tabs' components must be used within a Tabs component");
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
return context;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const TabsProvider = (props: { initialTab?: string; children: ComponentChildren }) => {
|
|
26
|
-
const { children, initialTab } = props;
|
|
27
|
-
const [currentTab, setCurrentTab] = useState<string | undefined>(initialTab);
|
|
28
|
-
|
|
29
|
-
return <TabsContext.Provider value={{ currentTab, setCurrentTab }}>{children}</TabsContext.Provider>;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export const Tabs = (props: { children: ComponentChildren; initialTab?: string }) => {
|
|
33
|
-
return <TabsProvider {...props} />;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export const TabsList = (props: { children: ComponentChildren }) => {
|
|
37
|
-
return <div className={styles.tabsList}>{props.children}</div>;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export const Tab = (props: { id: string; children: ComponentChildren }) => {
|
|
41
|
-
const { id, children, ...rest } = props;
|
|
42
|
-
const { currentTab, setCurrentTab } = useTabsContext();
|
|
43
|
-
const isCurrentTab = currentTab === id;
|
|
44
|
-
const handleTabClick = () => {
|
|
45
|
-
if (isCurrentTab) {
|
|
46
|
-
setCurrentTab("total");
|
|
47
|
-
setTreeStatus("total");
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
setCurrentTab(id);
|
|
52
|
-
setTreeStatus(id as AwesomeStatus);
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
return (
|
|
56
|
-
<button {...rest} className={styles.tab} onClick={handleTabClick} aria-current={isCurrentTab ? true : undefined}>
|
|
57
|
-
<Text type="paragraph" size="m" bold>
|
|
58
|
-
{children}
|
|
59
|
-
</Text>
|
|
60
|
-
</button>
|
|
61
|
-
);
|
|
62
|
-
};
|
package/src/stores/theme.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { getReportOptions } from "@allurereport/web-commons";
|
|
2
|
-
import type { Theme } from "@allurereport/web-components";
|
|
3
|
-
import { signal } from "@preact/signals";
|
|
4
|
-
import type { AwesomeReportOptions } from "../../types.js";
|
|
5
|
-
|
|
6
|
-
export const themeStore = signal<Theme>("auto");
|
|
7
|
-
|
|
8
|
-
export const setTheme = (mode: "light" | "dark" | "auto") => {
|
|
9
|
-
themeStore.value = mode;
|
|
10
|
-
|
|
11
|
-
try {
|
|
12
|
-
window.localStorage.setItem("theme", mode);
|
|
13
|
-
} catch {}
|
|
14
|
-
|
|
15
|
-
document.documentElement.setAttribute("data-theme", mode);
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export const toggleTheme = () => {
|
|
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);
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const getTheme = () => {
|
|
26
|
-
const { theme } = getReportOptions<AwesomeReportOptions>() ?? {};
|
|
27
|
-
const themeFromLS = (window.localStorage.getItem("theme") as Theme | null) || (theme as Theme);
|
|
28
|
-
|
|
29
|
-
setTheme(themeFromLS);
|
|
30
|
-
};
|
|
File without changes
|