@allurereport/web-awesome 3.0.1 → 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-bae2a0fe5738d77cd976.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-996d3b5869f8fc942b66.js.LICENSE.txt → app-3ca67f29d0f1166c08ca.js.LICENSE.txt} +7 -0
- package/dist/single/manifest.json +1 -1
- package/package.json +7 -7
- 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 +27 -13
- package/src/components/ReportBody/index.tsx +1 -1
- 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 +1 -1
- package/src/components/SectionPicker/index.tsx +1 -1
- package/src/components/SplitLayout/index.tsx +7 -3
- package/src/components/TestResult/TrEnvironmentItem/index.tsx +2 -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/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 +14 -9
- package/src/index.html +19 -18
- package/src/index.tsx +20 -27
- package/src/locales/az.json +39 -11
- package/src/locales/de.json +39 -11
- package/src/locales/en.json +39 -11
- package/src/locales/es.json +39 -11
- package/src/locales/fr.json +39 -11
- package/src/locales/he.json +39 -11
- package/src/locales/hy.json +39 -11
- package/src/locales/it.json +39 -11
- package/src/locales/ja.json +39 -11
- package/src/locales/ka.json +39 -11
- package/src/locales/kr.json +39 -11
- package/src/locales/nl.json +39 -11
- package/src/locales/pl.json +39 -11
- package/src/locales/pt.json +39 -11
- package/src/locales/ru.json +39 -11
- package/src/locales/sv.json +39 -11
- package/src/locales/tr.json +39 -11
- package/src/locales/ua.json +39 -11
- package/src/locales/zh.json +39 -11
- 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 +20 -13
- package/src/stores/treeFilters/actions.ts +48 -52
- package/src/stores/treeFilters/constants.ts +11 -5
- package/src/stores/treeFilters/model.ts +51 -0
- package/src/stores/treeFilters/store.ts +260 -60
- 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/treeFilters.ts +48 -66
- package/test/components/Header.test.tsx +49 -58
- package/test/utils/treeFilters.test.ts +18 -321
- package/types.d.ts +2 -1
- package/dist/multi/173.app-bae2a0fe5738d77cd976.js +0 -1
- package/dist/multi/174.app-bae2a0fe5738d77cd976.js +0 -1
- package/dist/multi/252.app-bae2a0fe5738d77cd976.js +0 -1
- package/dist/multi/282.app-bae2a0fe5738d77cd976.js +0 -1
- package/dist/multi/29.app-bae2a0fe5738d77cd976.js +0 -1
- package/dist/multi/416.app-bae2a0fe5738d77cd976.js +0 -1
- package/dist/multi/527.app-bae2a0fe5738d77cd976.js +0 -1
- package/dist/multi/600.app-bae2a0fe5738d77cd976.js +0 -1
- package/dist/multi/605.app-bae2a0fe5738d77cd976.js +0 -1
- package/dist/multi/638.app-bae2a0fe5738d77cd976.js +0 -1
- package/dist/multi/672.app-bae2a0fe5738d77cd976.js +0 -1
- package/dist/multi/686.app-bae2a0fe5738d77cd976.js +0 -1
- package/dist/multi/725.app-bae2a0fe5738d77cd976.js +0 -1
- package/dist/multi/741.app-bae2a0fe5738d77cd976.js +0 -1
- package/dist/multi/755.app-bae2a0fe5738d77cd976.js +0 -1
- package/dist/multi/894.app-bae2a0fe5738d77cd976.js +0 -1
- package/dist/multi/91.app-bae2a0fe5738d77cd976.js +0 -1
- package/dist/multi/943.app-bae2a0fe5738d77cd976.js +0 -1
- package/dist/multi/980.app-bae2a0fe5738d77cd976.js +0 -1
- package/dist/multi/app-bae2a0fe5738d77cd976.js +0 -2
- package/dist/multi/styles-bbf68b2ba63c38b53c38.css +0 -48
- package/dist/single/app-996d3b5869f8fc942b66.js +0 -2
- package/src/components/ReportBody/Filters.tsx +0 -122
- package/src/stores/theme.ts +0 -30
- package/src/stores/treeFilters/index.ts +0 -3
- package/src/stores/treeFilters/types.ts +0 -12
- package/test/stores/treeFilters.test.ts +0 -302
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allurereport/web-awesome",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "The static files for Allure Awesome Report",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"allure",
|
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
"IE 11"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@allurereport/charts-api": "3.0
|
|
35
|
-
"@allurereport/core-api": "3.0
|
|
36
|
-
"@allurereport/plugin-api": "3.0
|
|
37
|
-
"@allurereport/web-commons": "3.0
|
|
38
|
-
"@allurereport/web-components": "3.0
|
|
39
|
-
"@preact/signals": "^2.
|
|
34
|
+
"@allurereport/charts-api": "3.1.0",
|
|
35
|
+
"@allurereport/core-api": "3.1.0",
|
|
36
|
+
"@allurereport/plugin-api": "3.1.0",
|
|
37
|
+
"@allurereport/web-commons": "3.1.0",
|
|
38
|
+
"@allurereport/web-components": "3.1.0",
|
|
39
|
+
"@preact/signals": "^2.6.1",
|
|
40
40
|
"clsx": "^2.1.1",
|
|
41
41
|
"d3-shape": "^3.2.0",
|
|
42
42
|
"i18next": "^24.0.2",
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
:root {
|
|
2
2
|
--shadow-small: 0px 2px 10px 0px rgba(48, 57, 64, 0.08);
|
|
3
|
+
--shadow-small-01: 0px 1px 2px 0px rgba(16, 24, 40, 0.1);
|
|
4
|
+
--shadow-small-02: 0px 1px 3px 0px rgba(16, 24, 40, 0.06);
|
|
3
5
|
--shadow-medium: 0px 8px 24px 0px rgba(48, 57, 64, 0.12);
|
|
6
|
+
--shadow-large: 0px 2px 24px 0px rgba(48, 57, 64, 0.12);
|
|
4
7
|
--shadow-raised: 0px 2px 6px 0px rgba(48, 57, 64, 0.08);
|
|
5
8
|
|
|
6
9
|
--color-change-transition-duration: 0.15s;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Loadable, PageLoader } from "@allurereport/web-components";
|
|
2
2
|
import MainReport from "@/components/MainReport";
|
|
3
3
|
import TestResult from "@/components/TestResult";
|
|
4
|
-
import {
|
|
4
|
+
import { testResultRoute } from "@/stores/router";
|
|
5
5
|
import { testResultStore } from "@/stores/testResults";
|
|
6
6
|
import { treeStore } from "@/stores/tree";
|
|
7
7
|
import * as styles from "./styles.scss";
|
|
@@ -11,30 +11,34 @@ export type BaseLayoutProps = {
|
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
export const BaseLayout = () => {
|
|
14
|
-
const
|
|
14
|
+
const { matches, params } = testResultRoute.value;
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
16
|
+
if (matches) {
|
|
17
|
+
const testResultId = params.testResultId;
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<div className={styles.layout} data-testid="base-layout">
|
|
21
|
+
<Loadable
|
|
22
|
+
source={testResultStore}
|
|
23
|
+
renderLoader={() => <PageLoader />}
|
|
24
|
+
transformData={(data) => data[testResultId]}
|
|
25
|
+
renderData={(testResult) => (
|
|
26
|
+
<>
|
|
27
|
+
<div className={styles.wrapper} key={testResult?.id}>
|
|
28
|
+
<TestResult testResult={testResult} />
|
|
29
|
+
</div>
|
|
30
|
+
</>
|
|
31
|
+
)}
|
|
32
|
+
/>
|
|
33
|
+
</div>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
34
36
|
|
|
35
37
|
return (
|
|
36
38
|
<div className={styles.layout} data-testid="base-layout">
|
|
37
|
-
{
|
|
39
|
+
<div className={styles.wrapper}>
|
|
40
|
+
<Loadable source={treeStore} renderLoader={() => <PageLoader />} renderData={() => <MainReport />} />
|
|
41
|
+
</div>
|
|
38
42
|
</div>
|
|
39
43
|
);
|
|
40
44
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
|
2
2
|
import { ChartType } from "@allurereport/charts-api";
|
|
3
3
|
import { type UIChartData } from "@allurereport/web-commons";
|
|
4
|
+
import { themeStore } from "@allurereport/web-commons";
|
|
4
5
|
import {
|
|
5
6
|
CurrentStatusChartWidget,
|
|
6
7
|
DurationDynamicsChartWidget,
|
|
@@ -20,13 +21,15 @@ import {
|
|
|
20
21
|
TrSeveritiesChartWidget,
|
|
21
22
|
TreeMapChartWidget,
|
|
22
23
|
} from "@allurereport/web-components";
|
|
24
|
+
import { computed } from "@preact/signals";
|
|
23
25
|
import { useEffect } from "preact/hooks";
|
|
24
|
-
import { themeStore } from "@/stores";
|
|
25
26
|
import { chartsStore, fetchChartsData } from "@/stores/chart";
|
|
26
27
|
import { currentEnvironment } from "@/stores/env";
|
|
27
28
|
import { useI18n } from "@/stores/locale";
|
|
28
29
|
import * as styles from "./styles.scss";
|
|
29
30
|
|
|
31
|
+
const currentTheme = computed(() => themeStore.value.current);
|
|
32
|
+
|
|
30
33
|
const getChartWidgetByType = (
|
|
31
34
|
chartData: UIChartData,
|
|
32
35
|
{ t, empty }: Record<string, (key: string, options?: any) => string>,
|
|
@@ -210,7 +213,7 @@ export const Charts = () => {
|
|
|
210
213
|
}, []);
|
|
211
214
|
|
|
212
215
|
return (
|
|
213
|
-
<ThemeProvider theme={
|
|
216
|
+
<ThemeProvider theme={currentTheme.value}>
|
|
214
217
|
<Loadable
|
|
215
218
|
source={chartsStore}
|
|
216
219
|
renderLoader={() => <PageLoader />}
|
|
@@ -1,23 +1,29 @@
|
|
|
1
1
|
import { getReportOptions } from "@allurereport/web-commons";
|
|
2
2
|
import { Text } from "@allurereport/web-components";
|
|
3
|
-
import {
|
|
3
|
+
import { useState } from "preact/hooks";
|
|
4
4
|
import type { AwesomeReportOptions } from "types";
|
|
5
5
|
import { currentLocaleIso } from "@/stores";
|
|
6
6
|
import * as styles from "./styles.scss";
|
|
7
7
|
|
|
8
8
|
export const FooterVersion = () => {
|
|
9
|
-
const [createdAt
|
|
10
|
-
const [currentVersion, setCurrentVersion] = useState<string>();
|
|
11
|
-
|
|
12
|
-
useEffect(() => {
|
|
9
|
+
const [createdAt] = useState(() => {
|
|
13
10
|
const reportOptions = getReportOptions<AwesomeReportOptions>();
|
|
14
11
|
if (reportOptions?.createdAt) {
|
|
15
|
-
|
|
12
|
+
return Number(reportOptions.createdAt);
|
|
16
13
|
}
|
|
14
|
+
|
|
15
|
+
return undefined;
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const [currentVersion] = useState<string>(() => {
|
|
19
|
+
const reportOptions = getReportOptions<AwesomeReportOptions>();
|
|
20
|
+
|
|
17
21
|
if (reportOptions?.allureVersion) {
|
|
18
|
-
|
|
22
|
+
return reportOptions.allureVersion as string;
|
|
19
23
|
}
|
|
20
|
-
|
|
24
|
+
|
|
25
|
+
return undefined;
|
|
26
|
+
});
|
|
21
27
|
|
|
22
28
|
const formattedCreatedAt = new Date(createdAt as number).toLocaleDateString(currentLocaleIso.value as string, {
|
|
23
29
|
month: "numeric",
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { computed } from "@preact/signals";
|
|
1
2
|
import type { ClassValue } from "clsx";
|
|
2
3
|
import clsx from "clsx";
|
|
3
4
|
import { HeaderControls } from "@/components/HeaderControls";
|
|
4
5
|
import { SectionPicker } from "@/components/SectionPicker";
|
|
5
6
|
import { TrBreadcrumbs } from "@/components/TestResult/TrHeader/TrBreadcrumbs";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
7
|
+
import { testResultRoute } from "@/stores/router";
|
|
8
|
+
import { currentTrId } from "@/stores/testResult";
|
|
8
9
|
import { testResultStore } from "@/stores/testResults";
|
|
9
10
|
import { CiInfo } from "./CiInfo";
|
|
10
11
|
import * as styles from "./styles.scss";
|
|
@@ -13,14 +14,15 @@ interface HeaderProps {
|
|
|
13
14
|
className?: ClassValue;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
const isTestResultRoute = computed(() => testResultRoute.value.matches);
|
|
18
|
+
const testResult = computed(() => testResultStore.value?.data?.[currentTrId.value]);
|
|
18
19
|
|
|
20
|
+
export const Header = ({ className }: HeaderProps) => {
|
|
19
21
|
return (
|
|
20
22
|
<div className={clsx(styles.above, className)}>
|
|
21
|
-
|
|
22
|
-
{!
|
|
23
|
-
{
|
|
23
|
+
<SectionPicker />
|
|
24
|
+
{!isTestResultRoute.value && <CiInfo />}
|
|
25
|
+
{isTestResultRoute.value && <TrBreadcrumbs testResult={testResult.value} />}
|
|
24
26
|
<HeaderControls className={styles.right} />
|
|
25
27
|
</div>
|
|
26
28
|
);
|
|
@@ -1,20 +1,23 @@
|
|
|
1
|
+
import { themeStore, toggleUserTheme } from "@allurereport/web-commons";
|
|
1
2
|
import { LanguagePicker, ThemeButton } from "@allurereport/web-components";
|
|
3
|
+
import { computed } from "@preact/signals";
|
|
2
4
|
import { EnvironmentPicker } from "@/components/EnvironmentPicker";
|
|
3
5
|
import ToggleLayout from "@/components/ToggleLayout";
|
|
4
6
|
import { currentLocale, setLocale } from "@/stores/locale";
|
|
5
|
-
import { getTheme, themeStore, toggleTheme } from "@/stores/theme";
|
|
6
7
|
|
|
7
8
|
interface HeaderControlsProps {
|
|
8
9
|
className?: string;
|
|
9
10
|
}
|
|
10
11
|
|
|
12
|
+
const selectedTheme = computed(() => themeStore.value.selected);
|
|
13
|
+
|
|
11
14
|
export const HeaderControls = ({ className }: HeaderControlsProps) => {
|
|
12
15
|
return (
|
|
13
16
|
<div className={className}>
|
|
14
17
|
<EnvironmentPicker />
|
|
15
18
|
<LanguagePicker locale={currentLocale.value} setLocale={setLocale} />
|
|
16
19
|
<ToggleLayout />
|
|
17
|
-
<ThemeButton theme={
|
|
20
|
+
<ThemeButton theme={selectedTheme.value} toggleTheme={toggleUserTheme} />
|
|
18
21
|
</div>
|
|
19
22
|
);
|
|
20
23
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { Button, Menu, Text, allureIcons } from "@allurereport/web-components";
|
|
1
|
+
import { Button, ButtonLink, Menu, Text, allureIcons } from "@allurereport/web-components";
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import type { FunctionalComponent } from "preact";
|
|
4
4
|
import { useState } from "preact/hooks";
|
|
5
5
|
import { MetadataButton } from "@/components/MetadataButton";
|
|
6
6
|
import type { MetadataProps } from "@/components/ReportMetadata";
|
|
7
7
|
import { useI18n } from "@/stores/locale";
|
|
8
|
+
import { getTagsFilterUrl } from "@/stores/treeFilters/utils";
|
|
8
9
|
import { copyToClipboard } from "@/utils/copyToClipboard";
|
|
9
10
|
import * as styles from "./styles.scss";
|
|
10
11
|
|
|
@@ -50,8 +51,22 @@ export const Metadata: FunctionalComponent<MetadataProps> = ({ envInfo }) => {
|
|
|
50
51
|
);
|
|
51
52
|
};
|
|
52
53
|
|
|
53
|
-
const
|
|
54
|
-
const {
|
|
54
|
+
const OpenFilterUrlButton: FunctionalComponent<{ url: string }> = ({ url }) => {
|
|
55
|
+
const { t } = useI18n("filters");
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<ButtonLink
|
|
59
|
+
href={url}
|
|
60
|
+
target="_blank"
|
|
61
|
+
style="ghost"
|
|
62
|
+
icon={allureIcons.lineGeneralLinkExternal}
|
|
63
|
+
text={t("goto_filter")}
|
|
64
|
+
/>
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const MetadataTooltip = (props: { value: string; name: string }) => {
|
|
69
|
+
const { value, name } = props;
|
|
55
70
|
const { t } = useI18n("ui");
|
|
56
71
|
|
|
57
72
|
return (
|
|
@@ -59,6 +74,7 @@ const MetadataTooltip = (props: { value: string }) => {
|
|
|
59
74
|
<div className={styles["metadata-tooltip-value"]}>
|
|
60
75
|
<Text>{value}</Text>
|
|
61
76
|
</div>
|
|
77
|
+
{name === "tag" && <OpenFilterUrlButton url={getTagsFilterUrl([value])} />}
|
|
62
78
|
<Button
|
|
63
79
|
style={"outline"}
|
|
64
80
|
icon={allureIcons.lineGeneralCopy3}
|
|
@@ -70,9 +86,10 @@ const MetadataTooltip = (props: { value: string }) => {
|
|
|
70
86
|
};
|
|
71
87
|
|
|
72
88
|
const MetaDataKeyLabel: FunctionalComponent<{
|
|
89
|
+
name: string;
|
|
73
90
|
size?: "s" | "m";
|
|
74
91
|
value: string;
|
|
75
|
-
}> = ({ size = "s", value }) => {
|
|
92
|
+
}> = ({ name, size = "s", value }) => {
|
|
76
93
|
return (
|
|
77
94
|
<Menu
|
|
78
95
|
size="xl"
|
|
@@ -85,7 +102,7 @@ const MetaDataKeyLabel: FunctionalComponent<{
|
|
|
85
102
|
)}
|
|
86
103
|
>
|
|
87
104
|
<Menu.Section>
|
|
88
|
-
<MetadataTooltip value={value} />
|
|
105
|
+
<MetadataTooltip value={value} name={name} />
|
|
89
106
|
</Menu.Section>
|
|
90
107
|
</Menu>
|
|
91
108
|
);
|
|
@@ -110,12 +127,12 @@ const MetadataKeyValue: FunctionalComponent<{
|
|
|
110
127
|
{values?.length ? (
|
|
111
128
|
<div className={styles["report-metadata-values"]} data-testid={"metadata-item-value"}>
|
|
112
129
|
{values.map((item) => (
|
|
113
|
-
<MetaDataKeyLabel key={item} value={item} />
|
|
130
|
+
<MetaDataKeyLabel key={item} value={item} name={title} />
|
|
114
131
|
))}
|
|
115
132
|
</div>
|
|
116
133
|
) : (
|
|
117
134
|
<div className={styles["report-metadata-values"]} data-testid={"metadata-item-value"}>
|
|
118
|
-
<MetaDataKeyLabel value={value} />
|
|
135
|
+
<MetaDataKeyLabel value={value} name={title} />
|
|
119
136
|
</div>
|
|
120
137
|
)}
|
|
121
138
|
</div>
|
|
@@ -1,21 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { setTreeQuery, treeQuery } from "@/stores/treeFilters";
|
|
4
|
-
import { Filters } from "./Filters";
|
|
1
|
+
import { ReportFilters } from "../ReportFilters";
|
|
2
|
+
import { ReportSearch } from "../ReportSearch";
|
|
5
3
|
import * as styles from "./styles.scss";
|
|
6
4
|
|
|
7
|
-
const Search = () => {
|
|
8
|
-
const { t } = useI18n("search");
|
|
9
|
-
const query = treeQuery.value;
|
|
10
|
-
|
|
11
|
-
return <SearchBox placeholder={t("search-placeholder")} value={query} onChange={setTreeQuery} />;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
5
|
export const HeaderActions = () => {
|
|
15
6
|
return (
|
|
16
7
|
<div className={styles.headerActions}>
|
|
17
|
-
<
|
|
18
|
-
<
|
|
8
|
+
<ReportSearch />
|
|
9
|
+
<ReportFilters />
|
|
19
10
|
</div>
|
|
20
11
|
);
|
|
21
12
|
};
|
|
@@ -2,22 +2,33 @@ import { DropdownButton, Link, Menu, SvgIcon, Text, allureIcons } from "@allurer
|
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import type { ComponentChildren } from "preact";
|
|
4
4
|
import { useI18n } from "@/stores/locale";
|
|
5
|
-
import {
|
|
5
|
+
import { type SortByDirection, type SortByField, type SortBy as TSortBy, setSortBy, sortBy } from "@/stores/treeSort";
|
|
6
6
|
import * as styles from "./styles.scss";
|
|
7
7
|
|
|
8
8
|
const BtnWrapper = ({ children }: { children: ComponentChildren }) => {
|
|
9
9
|
return <div className={styles.sortByBtnWrap}>{children}</div>;
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
+
const setSortByField = (value: SortByField) => {
|
|
13
|
+
const direction = sortBy.peek().split(",")[1];
|
|
14
|
+
setSortBy(`${value},${direction}` as TSortBy);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const setDirection = (value: SortByDirection) => {
|
|
18
|
+
setSortBy(`${sortBy.peek().split(",")[0]},${value}` as TSortBy);
|
|
19
|
+
};
|
|
20
|
+
|
|
12
21
|
export const SortBy = () => {
|
|
13
22
|
const { t: sortByLocale } = useI18n("sort-by");
|
|
14
23
|
const { t: sortByValuesLocale } = useI18n("sort-by.values");
|
|
15
24
|
const { t: sortByDirectionsLocale } = useI18n("sort-by.directions");
|
|
16
|
-
const
|
|
17
|
-
const direction =
|
|
25
|
+
const sortByValue = sortBy.value.split(",")[0] as SortByField;
|
|
26
|
+
const direction = sortBy.value.split(",")[1] as SortByDirection;
|
|
18
27
|
|
|
19
|
-
const displayedSortByValue = sortByValuesLocale(
|
|
20
|
-
const displayedDirection = sortByDirectionsLocale(
|
|
28
|
+
const displayedSortByValue = sortByValuesLocale(sortByValue === "name" ? "alphabet" : sortByValue);
|
|
29
|
+
const displayedDirection = sortByDirectionsLocale(
|
|
30
|
+
`${sortByValue === "name" ? "alphabet" : sortByValue}-${direction}-short`,
|
|
31
|
+
);
|
|
21
32
|
|
|
22
33
|
return (
|
|
23
34
|
<div>
|
|
@@ -65,16 +76,19 @@ export const SortBy = () => {
|
|
|
65
76
|
)}
|
|
66
77
|
>
|
|
67
78
|
<Menu.Section>
|
|
68
|
-
<Menu.ItemWithCheckmark onClick={() =>
|
|
79
|
+
<Menu.ItemWithCheckmark onClick={() => setSortByField("order")} isChecked={sortByValue === "order"}>
|
|
69
80
|
{sortByValuesLocale("order")}
|
|
70
81
|
</Menu.ItemWithCheckmark>
|
|
71
|
-
<Menu.ItemWithCheckmark
|
|
82
|
+
<Menu.ItemWithCheckmark
|
|
83
|
+
onClick={() => setSortByField("duration")}
|
|
84
|
+
isChecked={sortByValue === "duration"}
|
|
85
|
+
>
|
|
72
86
|
{sortByValuesLocale("duration")}
|
|
73
87
|
</Menu.ItemWithCheckmark>
|
|
74
|
-
<Menu.ItemWithCheckmark onClick={() =>
|
|
88
|
+
<Menu.ItemWithCheckmark onClick={() => setSortByField("status")} isChecked={sortByValue === "status"}>
|
|
75
89
|
{sortByValuesLocale("status")}
|
|
76
90
|
</Menu.ItemWithCheckmark>
|
|
77
|
-
<Menu.ItemWithCheckmark onClick={() =>
|
|
91
|
+
<Menu.ItemWithCheckmark onClick={() => setSortByField("name")} isChecked={sortByValue === "name"}>
|
|
78
92
|
{sortByValuesLocale("alphabet")}
|
|
79
93
|
</Menu.ItemWithCheckmark>
|
|
80
94
|
</Menu.Section>
|
|
@@ -106,18 +120,18 @@ export const SortBy = () => {
|
|
|
106
120
|
>
|
|
107
121
|
<Menu.Section>
|
|
108
122
|
<Menu.ItemWithCheckmark
|
|
109
|
-
onClick={() =>
|
|
123
|
+
onClick={() => setDirection("asc")}
|
|
110
124
|
leadingIcon={allureIcons.lineArrowsSortLineAsc}
|
|
111
125
|
isChecked={direction === "asc"}
|
|
112
126
|
>
|
|
113
|
-
{sortByDirectionsLocale(`${
|
|
127
|
+
{sortByDirectionsLocale(`${sortByValue}-asc`)}
|
|
114
128
|
</Menu.ItemWithCheckmark>
|
|
115
129
|
<Menu.ItemWithCheckmark
|
|
116
|
-
onClick={() =>
|
|
130
|
+
onClick={() => setDirection("desc")}
|
|
117
131
|
leadingIcon={allureIcons.lineArrowsSortLineDesc}
|
|
118
132
|
isChecked={direction === "desc"}
|
|
119
133
|
>
|
|
120
|
-
{sortByDirectionsLocale(`${
|
|
134
|
+
{sortByDirectionsLocale(`${sortByValue}-desc`)}
|
|
121
135
|
</Menu.ItemWithCheckmark>
|
|
122
136
|
</Menu.Section>
|
|
123
137
|
</Menu>
|
|
@@ -3,7 +3,7 @@ import { Counter, Loadable } from "@allurereport/web-components";
|
|
|
3
3
|
import { reportStatsStore, statsByEnvStore } from "@/stores";
|
|
4
4
|
import { currentEnvironment } from "@/stores/env";
|
|
5
5
|
import { useI18n } from "@/stores/locale";
|
|
6
|
-
import { setTreeStatus, treeStatus } from "@/stores/treeFilters";
|
|
6
|
+
import { setTreeStatus, treeStatus } from "@/stores/treeFilters/store";
|
|
7
7
|
import { ReportTab, ReportTabsList } from "../ReportTabs";
|
|
8
8
|
import { TreeList } from "../Tree";
|
|
9
9
|
import { HeaderActions } from "./HeaderActions";
|