@teambit/defender.ui.test-page 0.0.25 → 0.0.27
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/tests-page.js
CHANGED
|
@@ -36,6 +36,7 @@ const design_ui_empty_box_1 = require("@teambit/design.ui.empty-box");
|
|
|
36
36
|
const mdx_ui_mdx_layout_1 = require("@teambit/mdx.ui.mdx-layout");
|
|
37
37
|
const design_ui_alert_card_1 = require("@teambit/design.ui.alert-card");
|
|
38
38
|
const defender_ui_test_loader_1 = require("@teambit/defender.ui.test-loader");
|
|
39
|
+
const lanes_hooks_use_viewed_lane_from_url_1 = require("@teambit/lanes.hooks.use-viewed-lane-from-url");
|
|
39
40
|
const classnames_1 = __importDefault(require("classnames"));
|
|
40
41
|
const react_1 = __importStar(require("react"));
|
|
41
42
|
const defender_ui_test_table_1 = require("@teambit/defender.ui.test-table");
|
|
@@ -94,8 +95,11 @@ function TestsPage({ className, emptyState }) {
|
|
|
94
95
|
var _a, _b, _c, _d;
|
|
95
96
|
const query = (0, ui_foundation_ui_react_router_use_query_1.useQuery)();
|
|
96
97
|
const component = (0, react_1.useContext)(component_1.ComponentContext);
|
|
98
|
+
const viewedLaneFromUrl = (0, lanes_hooks_use_viewed_lane_from_url_1.useViewedLaneFromUrl)();
|
|
97
99
|
const queryHasVersion = query.get('version');
|
|
98
|
-
|
|
100
|
+
// when viewing component tests outside of a lane without a specific version, we want to show the tests of the latest version of the component
|
|
101
|
+
// otherwise, we want to show the tests of the version that is currently viewed
|
|
102
|
+
const id = queryHasVersion || viewedLaneFromUrl ? component.id.toString() : component.id.toStringWithoutVersion();
|
|
99
103
|
const onTestsChanged = (0, client_1.useSubscription)(TESTS_SUBSCRIPTION_CHANGED, {
|
|
100
104
|
variables: { id },
|
|
101
105
|
});
|
package/dist/tests-page.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tests-page.js","sourceRoot":"","sources":["../tests-page.tsx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AChD,kBAAkB,EAClB;QACA,OAAO,CACL,uCAAK,SAAS,EAAE,IAAA,oBAAU,EAAC,gCAAM,CAAC,SAAS,EAAE,SAAS,CAAC;YACrD;gBACE,8BAAC,0BAAE,IAAC,SAAS,EAAE,gCAAM,CAAC,KAAK,YAAY;gBACvC,8BAAC,+BAAS,IAAC,gBAAgB,QAAC,SAAS,EAAE,gCAAM,CAAC,SAAS,GAAI;gBAC3D,8BAAC,gCAAS,IACR,KAAK,EAAC,MAAM,EACZ,KAAK,EAAC,iFACgD;oBAEtD,8BAAC,6BAAS;wBACR,8BAAC,kBAAkB,OAAG,CACZ,CACF,CACR,CACF,CACP,CAAC;KACH;IAED,iFAAiF;IACjF,IAAI,WAAW,KAAK,IAAI,IAAI,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,YAAY,MAAK,IAAI,EAAE;QAC3D,OAAO,CACL,8BAAC,8BAAQ,IACP,KAAK,EAAC,6CAAwC,EAC9C,QAAQ,EAAC,2CAA2C,EACpD,IAAI,EAAE,wEAAwE,GAC9E,CACH,CAAC;KACH;IAED,OAAO,CACL,uCAAK,SAAS,EAAE,IAAA,oBAAU,EAAC,gCAAM,CAAC,SAAS,EAAE,SAAS,CAAC;QACrD;YACE,8BAAC,0BAAE,IAAC,SAAS,EAAE,gCAAM,CAAC,KAAK,YAAY;YACvC,8BAAC,+BAAS,IAAC,gBAAgB,QAAC,SAAS,EAAE,gCAAM,CAAC,SAAS,GAAI;YAC3D,8BAAC,kCAAS,IAAC,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,gCAAM,CAAC,SAAS,GAAI,CAChE,CACF,CACP,CAAC;AACJ,CAAC;AAzED,8BAyEC"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/defender.ui.test-page",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.27",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/defender/ui/test-page",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.defender",
|
|
8
8
|
"name": "ui/test-page",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.27"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"classnames": "2.2.6",
|
|
@@ -15,10 +15,11 @@
|
|
|
15
15
|
"@teambit/design.ui.empty-box": "0.0.363",
|
|
16
16
|
"@teambit/design.ui.separator": "0.0.354",
|
|
17
17
|
"@teambit/documenter.ui.heading": "4.1.1",
|
|
18
|
-
"@teambit/defender.ui.test-loader": "0.0.
|
|
19
|
-
"@teambit/defender.ui.test-table": "0.0.
|
|
20
|
-
"@teambit/
|
|
21
|
-
"@teambit/
|
|
18
|
+
"@teambit/defender.ui.test-loader": "0.0.504",
|
|
19
|
+
"@teambit/defender.ui.test-table": "0.0.510",
|
|
20
|
+
"@teambit/lanes.hooks.use-viewed-lane-from-url": "0.0.209",
|
|
21
|
+
"@teambit/mdx.ui.mdx-layout": "1.0.6",
|
|
22
|
+
"@teambit/ui-foundation.ui.react-router.use-query": "0.0.501"
|
|
22
23
|
},
|
|
23
24
|
"devDependencies": {
|
|
24
25
|
"@types/classnames": "2.2.11",
|
package/tests-page.tsx
CHANGED
|
@@ -8,6 +8,7 @@ import { MDXLayout } from '@teambit/mdx.ui.mdx-layout';
|
|
|
8
8
|
import { AlertCard } from '@teambit/design.ui.alert-card';
|
|
9
9
|
import { TestLoader } from '@teambit/defender.ui.test-loader';
|
|
10
10
|
import { EmptyStateSlot } from '@teambit/tester';
|
|
11
|
+
import { useViewedLaneFromUrl } from '@teambit/lanes.hooks.use-viewed-lane-from-url';
|
|
11
12
|
import classNames from 'classnames';
|
|
12
13
|
import React, { HTMLAttributes, useContext } from 'react';
|
|
13
14
|
import { TestTable } from '@teambit/defender.ui.test-table';
|
|
@@ -73,10 +74,13 @@ export function TestsPage({ className, emptyState }: TestsPageProps) {
|
|
|
73
74
|
const query = useRouterQuery();
|
|
74
75
|
|
|
75
76
|
const component = useContext(ComponentContext);
|
|
77
|
+
const viewedLaneFromUrl = useViewedLaneFromUrl();
|
|
76
78
|
|
|
77
79
|
const queryHasVersion = query.get('version');
|
|
78
80
|
|
|
79
|
-
|
|
81
|
+
// when viewing component tests outside of a lane without a specific version, we want to show the tests of the latest version of the component
|
|
82
|
+
// otherwise, we want to show the tests of the version that is currently viewed
|
|
83
|
+
const id = queryHasVersion || viewedLaneFromUrl ? component.id.toString() : component.id.toStringWithoutVersion();
|
|
80
84
|
|
|
81
85
|
const onTestsChanged = useSubscription(TESTS_SUBSCRIPTION_CHANGED, {
|
|
82
86
|
variables: { id },
|
|
File without changes
|