@teambit/defender.ui.test-compare 0.0.1
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/compare-tests-page.tsx +131 -0
- package/compare-tests.module.scss +29 -0
- package/compare-tests.tsx +80 -0
- package/dist/compare-tests-page.d.ts +9 -0
- package/dist/compare-tests-page.js +99 -0
- package/dist/compare-tests-page.js.map +1 -0
- package/dist/compare-tests.d.ts +6 -0
- package/dist/compare-tests.js +79 -0
- package/dist/compare-tests.js.map +1 -0
- package/dist/compare-tests.module.scss +29 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/tsconfig.json +32 -0
- package/index.ts +1 -0
- package/package-tar/teambit-defender.ui.test-compare-0.0.1.tgz +0 -0
- package/package.json +86 -0
- package/preview-1654572446572.js +1 -0
- package/tsconfig.json +32 -0
- package/types/asset.d.ts +29 -0
- package/types/style.d.ts +42 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import React, { HTMLAttributes } from 'react';
|
|
2
|
+
import { gql, useQuery, useSubscription } from '@apollo/client';
|
|
3
|
+
import { ComponentModel } from '@teambit/component';
|
|
4
|
+
import { EmptyStateSlot } from '@teambit/compositions';
|
|
5
|
+
import { TestLoader } from '@teambit/defender.ui.test-loader';
|
|
6
|
+
import { TestTable } from '@teambit/defender.ui.test-table';
|
|
7
|
+
import { AlertCard } from '@teambit/design.ui.alert-card';
|
|
8
|
+
import { EmptyBox } from '@teambit/design.ui.empty-box';
|
|
9
|
+
import { MDXLayout } from '@teambit/mdx.ui.mdx-layout';
|
|
10
|
+
import { styles } from '@teambit/tester';
|
|
11
|
+
import classNames from 'classnames';
|
|
12
|
+
|
|
13
|
+
export type CompareTestsPageProps = {
|
|
14
|
+
component: ComponentModel;
|
|
15
|
+
emptyState: EmptyStateSlot;
|
|
16
|
+
isCompareVersionWorkspace?: boolean;
|
|
17
|
+
} & HTMLAttributes<HTMLDivElement>;
|
|
18
|
+
|
|
19
|
+
const TESTS_SUBSCRIPTION_CHANGED = gql`
|
|
20
|
+
subscription OnTestsChanged($id: String!) {
|
|
21
|
+
testsChanged(id: $id) {
|
|
22
|
+
testsResults {
|
|
23
|
+
testFiles {
|
|
24
|
+
file
|
|
25
|
+
duration
|
|
26
|
+
pass
|
|
27
|
+
failed
|
|
28
|
+
pending
|
|
29
|
+
errorStr
|
|
30
|
+
tests {
|
|
31
|
+
ancestor
|
|
32
|
+
duration
|
|
33
|
+
status
|
|
34
|
+
name
|
|
35
|
+
error
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
`;
|
|
42
|
+
|
|
43
|
+
const GET_COMPONENT = gql`
|
|
44
|
+
query ($id: String!) {
|
|
45
|
+
getHost {
|
|
46
|
+
id # for GQL caching
|
|
47
|
+
getTests(id: $id) {
|
|
48
|
+
loading
|
|
49
|
+
testsResults {
|
|
50
|
+
testFiles {
|
|
51
|
+
file
|
|
52
|
+
duration
|
|
53
|
+
pass
|
|
54
|
+
failed
|
|
55
|
+
pending
|
|
56
|
+
errorStr
|
|
57
|
+
tests {
|
|
58
|
+
ancestor
|
|
59
|
+
duration
|
|
60
|
+
status
|
|
61
|
+
name
|
|
62
|
+
error
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
`;
|
|
70
|
+
|
|
71
|
+
export function CompareTestsPage(props: CompareTestsPageProps) {
|
|
72
|
+
const { component, emptyState, className, isCompareVersionWorkspace } = props;
|
|
73
|
+
|
|
74
|
+
const id = !isCompareVersionWorkspace ? component.id.toString() : component.id.toStringWithoutVersion();
|
|
75
|
+
|
|
76
|
+
const onTestsChanged = useSubscription(TESTS_SUBSCRIPTION_CHANGED, { variables: { id } });
|
|
77
|
+
|
|
78
|
+
const { data } = useQuery(GET_COMPONENT, {
|
|
79
|
+
variables: { id },
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
const testData = onTestsChanged.data?.testsChanged || data?.getHost?.getTests;
|
|
83
|
+
const testResults = testData?.testsResults?.testFiles;
|
|
84
|
+
|
|
85
|
+
// TODO: change loading EmptyBox
|
|
86
|
+
if (testData?.loading) return <TestLoader />;
|
|
87
|
+
|
|
88
|
+
const env = component.environment?.id;
|
|
89
|
+
const EmptyStateTemplate = emptyState.get(env || '');
|
|
90
|
+
|
|
91
|
+
if (
|
|
92
|
+
(testResults === null || testData?.testsResults === null) &&
|
|
93
|
+
component.host === 'teambit.workspace/workspace' &&
|
|
94
|
+
EmptyStateTemplate
|
|
95
|
+
) {
|
|
96
|
+
return (
|
|
97
|
+
<div className={classNames(styles.testsPage, className)}>
|
|
98
|
+
<div>
|
|
99
|
+
<AlertCard
|
|
100
|
+
level="info"
|
|
101
|
+
title="There are no
|
|
102
|
+
tests for this Component. Learn how to add tests:"
|
|
103
|
+
>
|
|
104
|
+
<MDXLayout>
|
|
105
|
+
<EmptyStateTemplate />
|
|
106
|
+
</MDXLayout>
|
|
107
|
+
</AlertCard>
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// TODO: get the docs domain from the community aspect and pass it here as a prop
|
|
114
|
+
if (testResults === null || testData?.testsResults === null) {
|
|
115
|
+
return (
|
|
116
|
+
<EmptyBox
|
|
117
|
+
title="This component doesn’t have any tests."
|
|
118
|
+
linkText="Learn how to add tests to your components"
|
|
119
|
+
link={`https://bit.dev/docs/dev-services-overview/tester/tester-overview`}
|
|
120
|
+
/>
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return (
|
|
125
|
+
<div className={classNames(styles.testsPage, className)}>
|
|
126
|
+
<div>
|
|
127
|
+
<TestTable testResults={testResults} className={styles.testBlock} />
|
|
128
|
+
</div>
|
|
129
|
+
</div>
|
|
130
|
+
);
|
|
131
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
.checkboxContainer {
|
|
2
|
+
margin-top: 16px;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.subView {
|
|
6
|
+
height: 100%;
|
|
7
|
+
background-color: white;
|
|
8
|
+
overflow: auto;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.loader {
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
height: 100%;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.toggleContainer {
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
margin-bottom: 8px;
|
|
21
|
+
|
|
22
|
+
.toggle {
|
|
23
|
+
margin-right: 8px;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.splitLayout {
|
|
28
|
+
margin-top: 8px;
|
|
29
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { CompareSplitLayoutPreset, useComponentCompare } from '@teambit/component.ui.compare';
|
|
2
|
+
import { EmptyStateSlot } from '@teambit/compositions';
|
|
3
|
+
import { Toggle } from '@teambit/design.ui.input.toggle';
|
|
4
|
+
import { RoundLoader } from '@teambit/design.ui.round-loader';
|
|
5
|
+
import React, { HTMLAttributes, UIEvent, useMemo, useRef, useState } from 'react';
|
|
6
|
+
import { CompareTestsPage } from './compare-tests-page';
|
|
7
|
+
import styles from './compare-tests.module.scss';
|
|
8
|
+
|
|
9
|
+
export type CompareTestsProps = {
|
|
10
|
+
emptyState: EmptyStateSlot;
|
|
11
|
+
} & HTMLAttributes<HTMLDivElement>;
|
|
12
|
+
|
|
13
|
+
export function CompareTests(props: CompareTestsProps) {
|
|
14
|
+
const { emptyState } = props;
|
|
15
|
+
const componentCompare = useComponentCompare();
|
|
16
|
+
const [isScrollingSynced, setIsScrollingSynced] = useState<boolean>(true);
|
|
17
|
+
|
|
18
|
+
const leftPanelRef = useRef<HTMLDivElement>(null);
|
|
19
|
+
const rightPanelRef = useRef<HTMLDivElement>(null);
|
|
20
|
+
|
|
21
|
+
function handleLeftPanelScroll(event: UIEvent<HTMLDivElement>) {
|
|
22
|
+
if (!isScrollingSynced) return;
|
|
23
|
+
rightPanelRef.current?.scrollTo({ top: event.currentTarget.scrollTop, left: event.currentTarget.scrollLeft });
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function handleRightPanelScroll(event: UIEvent<HTMLDivElement>) {
|
|
27
|
+
if (!isScrollingSynced) return;
|
|
28
|
+
leftPanelRef.current?.scrollTo({ top: event.currentTarget.scrollTop, left: event.currentTarget.scrollLeft });
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function handleScrollingSyncChange() {
|
|
32
|
+
rightPanelRef.current?.scrollTo({ top: leftPanelRef.current?.scrollTop, left: leftPanelRef.current?.scrollLeft });
|
|
33
|
+
setIsScrollingSynced((prev) => !prev);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const BaseLayout = useMemo(() => {
|
|
37
|
+
if (componentCompare?.base === undefined) {
|
|
38
|
+
return <></>;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<div className={styles.subView} ref={leftPanelRef} onScroll={handleLeftPanelScroll}>
|
|
43
|
+
<CompareTestsPage component={componentCompare.base} emptyState={emptyState} />
|
|
44
|
+
</div>
|
|
45
|
+
);
|
|
46
|
+
}, [componentCompare?.base, isScrollingSynced]);
|
|
47
|
+
|
|
48
|
+
const CompareLayout = useMemo(() => {
|
|
49
|
+
if (componentCompare?.compare === undefined) {
|
|
50
|
+
return <></>;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<div className={styles.subView} ref={rightPanelRef} onScroll={handleRightPanelScroll}>
|
|
55
|
+
<CompareTestsPage
|
|
56
|
+
component={componentCompare.compare}
|
|
57
|
+
isCompareVersionWorkspace={componentCompare.compareIsLocalChanges}
|
|
58
|
+
emptyState={emptyState}
|
|
59
|
+
/>
|
|
60
|
+
</div>
|
|
61
|
+
);
|
|
62
|
+
}, [componentCompare?.compare, isScrollingSynced]);
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<>
|
|
66
|
+
{componentCompare?.loading && (
|
|
67
|
+
<div className={styles.loader}>
|
|
68
|
+
<RoundLoader />
|
|
69
|
+
</div>
|
|
70
|
+
)}
|
|
71
|
+
<div className={styles.checkboxContainer}>
|
|
72
|
+
<div className={styles.toggleContainer}>
|
|
73
|
+
<Toggle checked={isScrollingSynced} onInputChanged={handleScrollingSyncChange} className={styles.toggle} />
|
|
74
|
+
Synchronize Scrolling
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
<CompareSplitLayoutPreset base={BaseLayout} compare={CompareLayout} className={styles.splitLayout} />
|
|
78
|
+
</>
|
|
79
|
+
);
|
|
80
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { ComponentModel } from '@teambit/component';
|
|
3
|
+
import { EmptyStateSlot } from '@teambit/compositions';
|
|
4
|
+
export declare type CompareTestsPageProps = {
|
|
5
|
+
component: ComponentModel;
|
|
6
|
+
emptyState: EmptyStateSlot;
|
|
7
|
+
isCompareVersionWorkspace?: boolean;
|
|
8
|
+
} & HTMLAttributes<HTMLDivElement>;
|
|
9
|
+
export declare function CompareTestsPage(props: CompareTestsPageProps): JSX.Element;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.CompareTestsPage = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const client_1 = require("@apollo/client");
|
|
9
|
+
const defender_ui_test_loader_1 = require("@teambit/defender.ui.test-loader");
|
|
10
|
+
const defender_ui_test_table_1 = require("@teambit/defender.ui.test-table");
|
|
11
|
+
const design_ui_alert_card_1 = require("@teambit/design.ui.alert-card");
|
|
12
|
+
const design_ui_empty_box_1 = require("@teambit/design.ui.empty-box");
|
|
13
|
+
const mdx_ui_mdx_layout_1 = require("@teambit/mdx.ui.mdx-layout");
|
|
14
|
+
const tester_1 = require("@teambit/tester");
|
|
15
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
16
|
+
const TESTS_SUBSCRIPTION_CHANGED = (0, client_1.gql) `
|
|
17
|
+
subscription OnTestsChanged($id: String!) {
|
|
18
|
+
testsChanged(id: $id) {
|
|
19
|
+
testsResults {
|
|
20
|
+
testFiles {
|
|
21
|
+
file
|
|
22
|
+
duration
|
|
23
|
+
pass
|
|
24
|
+
failed
|
|
25
|
+
pending
|
|
26
|
+
errorStr
|
|
27
|
+
tests {
|
|
28
|
+
ancestor
|
|
29
|
+
duration
|
|
30
|
+
status
|
|
31
|
+
name
|
|
32
|
+
error
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
`;
|
|
39
|
+
const GET_COMPONENT = (0, client_1.gql) `
|
|
40
|
+
query ($id: String!) {
|
|
41
|
+
getHost {
|
|
42
|
+
id # for GQL caching
|
|
43
|
+
getTests(id: $id) {
|
|
44
|
+
loading
|
|
45
|
+
testsResults {
|
|
46
|
+
testFiles {
|
|
47
|
+
file
|
|
48
|
+
duration
|
|
49
|
+
pass
|
|
50
|
+
failed
|
|
51
|
+
pending
|
|
52
|
+
errorStr
|
|
53
|
+
tests {
|
|
54
|
+
ancestor
|
|
55
|
+
duration
|
|
56
|
+
status
|
|
57
|
+
name
|
|
58
|
+
error
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
`;
|
|
66
|
+
function CompareTestsPage(props) {
|
|
67
|
+
var _a, _b, _c, _d;
|
|
68
|
+
const { component, emptyState, className, isCompareVersionWorkspace } = props;
|
|
69
|
+
const id = !isCompareVersionWorkspace ? component.id.toString() : component.id.toStringWithoutVersion();
|
|
70
|
+
const onTestsChanged = (0, client_1.useSubscription)(TESTS_SUBSCRIPTION_CHANGED, { variables: { id } });
|
|
71
|
+
const { data } = (0, client_1.useQuery)(GET_COMPONENT, {
|
|
72
|
+
variables: { id },
|
|
73
|
+
});
|
|
74
|
+
const testData = ((_a = onTestsChanged.data) === null || _a === void 0 ? void 0 : _a.testsChanged) || ((_b = data === null || data === void 0 ? void 0 : data.getHost) === null || _b === void 0 ? void 0 : _b.getTests);
|
|
75
|
+
const testResults = (_c = testData === null || testData === void 0 ? void 0 : testData.testsResults) === null || _c === void 0 ? void 0 : _c.testFiles;
|
|
76
|
+
// TODO: change loading EmptyBox
|
|
77
|
+
if (testData === null || testData === void 0 ? void 0 : testData.loading)
|
|
78
|
+
return react_1.default.createElement(defender_ui_test_loader_1.TestLoader, null);
|
|
79
|
+
const env = (_d = component.environment) === null || _d === void 0 ? void 0 : _d.id;
|
|
80
|
+
const EmptyStateTemplate = emptyState.get(env || '');
|
|
81
|
+
if ((testResults === null || (testData === null || testData === void 0 ? void 0 : testData.testsResults) === null) &&
|
|
82
|
+
component.host === 'teambit.workspace/workspace' &&
|
|
83
|
+
EmptyStateTemplate) {
|
|
84
|
+
return (react_1.default.createElement("div", { className: (0, classnames_1.default)(tester_1.styles.testsPage, className) },
|
|
85
|
+
react_1.default.createElement("div", null,
|
|
86
|
+
react_1.default.createElement(design_ui_alert_card_1.AlertCard, { level: "info", title: "There are no\n tests for this Component. Learn how to add tests:" },
|
|
87
|
+
react_1.default.createElement(mdx_ui_mdx_layout_1.MDXLayout, null,
|
|
88
|
+
react_1.default.createElement(EmptyStateTemplate, null))))));
|
|
89
|
+
}
|
|
90
|
+
// TODO: get the docs domain from the community aspect and pass it here as a prop
|
|
91
|
+
if (testResults === null || (testData === null || testData === void 0 ? void 0 : testData.testsResults) === null) {
|
|
92
|
+
return (react_1.default.createElement(design_ui_empty_box_1.EmptyBox, { title: "This component doesn\u2019t have any tests.", linkText: "Learn how to add tests to your components", link: `https://bit.dev/docs/dev-services-overview/tester/tester-overview` }));
|
|
93
|
+
}
|
|
94
|
+
return (react_1.default.createElement("div", { className: (0, classnames_1.default)(tester_1.styles.testsPage, className) },
|
|
95
|
+
react_1.default.createElement("div", null,
|
|
96
|
+
react_1.default.createElement(defender_ui_test_table_1.TestTable, { testResults: testResults, className: tester_1.styles.testBlock }))));
|
|
97
|
+
}
|
|
98
|
+
exports.CompareTestsPage = CompareTestsPage;
|
|
99
|
+
//# sourceMappingURL=compare-tests-page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compare-tests-page.js","sourceRoot":"","sources":["../compare-tests-page.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA8C;AAC9C,2CAAgE;AAGhE,8EAA8D;AAC9D,4EAA4D;AAC5D,wEAA0D;AAC1D,sEAAwD;AACxD,kEAAuD;AACvD,4CAAyC;AACzC,4DAAoC;AAQpC,MAAM,0BAA0B,GAAG,IAAA,YAAG,EAAA;;;;;;;;;;;;;;;;;;;;;;CAsBrC,CAAC;AAEF,MAAM,aAAa,GAAG,IAAA,YAAG,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BxB,CAAC;AAEF,SAAgB,gBAAgB,CAAC,KAA4B;;IAC3D,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,yBAAyB,EAAE,GAAG,KAAK,CAAC;IAE9E,MAAM,EAAE,GAAG,CAAC,yBAAyB,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,sBAAsB,EAAE,CAAC;IAExG,MAAM,cAAc,GAAG,IAAA,wBAAe,EAAC,0BAA0B,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAE1F,MAAM,EAAE,IAAI,EAAE,GAAG,IAAA,iBAAQ,EAAC,aAAa,EAAE;QACvC,SAAS,EAAE,EAAE,EAAE,EAAE;KAClB,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,CAAA,MAAA,cAAc,CAAC,IAAI,0CAAE,YAAY,MAAI,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,OAAO,0CAAE,QAAQ,CAAA,CAAC;IAC9E,MAAM,WAAW,GAAG,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,YAAY,0CAAE,SAAS,CAAC;IAEtD,gCAAgC;IAChC,IAAI,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,OAAO;QAAE,OAAO,8BAAC,oCAAU,OAAG,CAAC;IAE7C,MAAM,GAAG,GAAG,MAAA,SAAS,CAAC,WAAW,0CAAE,EAAE,CAAC;IACtC,MAAM,kBAAkB,GAAG,UAAU,CAAC,GAAG,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC;IAErD,IACE,CAAC,WAAW,KAAK,IAAI,IAAI,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,YAAY,MAAK,IAAI,CAAC;QACzD,SAAS,CAAC,IAAI,KAAK,6BAA6B;QAChD,kBAAkB,EAClB;QACA,OAAO,CACL,uCAAK,SAAS,EAAE,IAAA,oBAAU,EAAC,eAAM,CAAC,SAAS,EAAE,SAAS,CAAC;YACrD;gBACE,8BAAC,gCAAS,IACR,KAAK,EAAC,MAAM,EACZ,KAAK,EAAC,qFACoD;oBAE1D,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,mEAAmE,GACzE,CACH,CAAC;KACH;IAED,OAAO,CACL,uCAAK,SAAS,EAAE,IAAA,oBAAU,EAAC,eAAM,CAAC,SAAS,EAAE,SAAS,CAAC;QACrD;YACE,8BAAC,kCAAS,IAAC,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,eAAM,CAAC,SAAS,GAAI,CAChE,CACF,CACP,CAAC;AACJ,CAAC;AA5DD,4CA4DC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { EmptyStateSlot } from '@teambit/compositions';
|
|
2
|
+
import { HTMLAttributes } from 'react';
|
|
3
|
+
export declare type CompareTestsProps = {
|
|
4
|
+
emptyState: EmptyStateSlot;
|
|
5
|
+
} & HTMLAttributes<HTMLDivElement>;
|
|
6
|
+
export declare function CompareTests(props: CompareTestsProps): JSX.Element;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.CompareTests = void 0;
|
|
26
|
+
const component_ui_compare_1 = require("@teambit/component.ui.compare");
|
|
27
|
+
const design_ui_input_toggle_1 = require("@teambit/design.ui.input.toggle");
|
|
28
|
+
const design_ui_round_loader_1 = require("@teambit/design.ui.round-loader");
|
|
29
|
+
const react_1 = __importStar(require("react"));
|
|
30
|
+
const compare_tests_page_1 = require("./compare-tests-page");
|
|
31
|
+
const compare_tests_module_scss_1 = __importDefault(require("./compare-tests.module.scss"));
|
|
32
|
+
function CompareTests(props) {
|
|
33
|
+
const { emptyState } = props;
|
|
34
|
+
const componentCompare = (0, component_ui_compare_1.useComponentCompare)();
|
|
35
|
+
const [isScrollingSynced, setIsScrollingSynced] = (0, react_1.useState)(true);
|
|
36
|
+
const leftPanelRef = (0, react_1.useRef)(null);
|
|
37
|
+
const rightPanelRef = (0, react_1.useRef)(null);
|
|
38
|
+
function handleLeftPanelScroll(event) {
|
|
39
|
+
var _a;
|
|
40
|
+
if (!isScrollingSynced)
|
|
41
|
+
return;
|
|
42
|
+
(_a = rightPanelRef.current) === null || _a === void 0 ? void 0 : _a.scrollTo({ top: event.currentTarget.scrollTop, left: event.currentTarget.scrollLeft });
|
|
43
|
+
}
|
|
44
|
+
function handleRightPanelScroll(event) {
|
|
45
|
+
var _a;
|
|
46
|
+
if (!isScrollingSynced)
|
|
47
|
+
return;
|
|
48
|
+
(_a = leftPanelRef.current) === null || _a === void 0 ? void 0 : _a.scrollTo({ top: event.currentTarget.scrollTop, left: event.currentTarget.scrollLeft });
|
|
49
|
+
}
|
|
50
|
+
function handleScrollingSyncChange() {
|
|
51
|
+
var _a, _b, _c;
|
|
52
|
+
(_a = rightPanelRef.current) === null || _a === void 0 ? void 0 : _a.scrollTo({ top: (_b = leftPanelRef.current) === null || _b === void 0 ? void 0 : _b.scrollTop, left: (_c = leftPanelRef.current) === null || _c === void 0 ? void 0 : _c.scrollLeft });
|
|
53
|
+
setIsScrollingSynced((prev) => !prev);
|
|
54
|
+
}
|
|
55
|
+
const BaseLayout = (0, react_1.useMemo)(() => {
|
|
56
|
+
if ((componentCompare === null || componentCompare === void 0 ? void 0 : componentCompare.base) === undefined) {
|
|
57
|
+
return react_1.default.createElement(react_1.default.Fragment, null);
|
|
58
|
+
}
|
|
59
|
+
return (react_1.default.createElement("div", { className: compare_tests_module_scss_1.default.subView, ref: leftPanelRef, onScroll: handleLeftPanelScroll },
|
|
60
|
+
react_1.default.createElement(compare_tests_page_1.CompareTestsPage, { component: componentCompare.base, emptyState: emptyState })));
|
|
61
|
+
}, [componentCompare === null || componentCompare === void 0 ? void 0 : componentCompare.base, isScrollingSynced]);
|
|
62
|
+
const CompareLayout = (0, react_1.useMemo)(() => {
|
|
63
|
+
if ((componentCompare === null || componentCompare === void 0 ? void 0 : componentCompare.compare) === undefined) {
|
|
64
|
+
return react_1.default.createElement(react_1.default.Fragment, null);
|
|
65
|
+
}
|
|
66
|
+
return (react_1.default.createElement("div", { className: compare_tests_module_scss_1.default.subView, ref: rightPanelRef, onScroll: handleRightPanelScroll },
|
|
67
|
+
react_1.default.createElement(compare_tests_page_1.CompareTestsPage, { component: componentCompare.compare, isCompareVersionWorkspace: componentCompare.compareIsLocalChanges, emptyState: emptyState })));
|
|
68
|
+
}, [componentCompare === null || componentCompare === void 0 ? void 0 : componentCompare.compare, isScrollingSynced]);
|
|
69
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
70
|
+
(componentCompare === null || componentCompare === void 0 ? void 0 : componentCompare.loading) && (react_1.default.createElement("div", { className: compare_tests_module_scss_1.default.loader },
|
|
71
|
+
react_1.default.createElement(design_ui_round_loader_1.RoundLoader, null))),
|
|
72
|
+
react_1.default.createElement("div", { className: compare_tests_module_scss_1.default.checkboxContainer },
|
|
73
|
+
react_1.default.createElement("div", { className: compare_tests_module_scss_1.default.toggleContainer },
|
|
74
|
+
react_1.default.createElement(design_ui_input_toggle_1.Toggle, { checked: isScrollingSynced, onInputChanged: handleScrollingSyncChange, className: compare_tests_module_scss_1.default.toggle }),
|
|
75
|
+
"Synchronize Scrolling")),
|
|
76
|
+
react_1.default.createElement(component_ui_compare_1.CompareSplitLayoutPreset, { base: BaseLayout, compare: CompareLayout, className: compare_tests_module_scss_1.default.splitLayout })));
|
|
77
|
+
}
|
|
78
|
+
exports.CompareTests = CompareTests;
|
|
79
|
+
//# sourceMappingURL=compare-tests.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compare-tests.js","sourceRoot":"","sources":["../compare-tests.tsx"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
.checkboxContainer {
|
|
2
|
+
margin-top: 16px;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.subView {
|
|
6
|
+
height: 100%;
|
|
7
|
+
background-color: white;
|
|
8
|
+
overflow: auto;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.loader {
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
height: 100%;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.toggleContainer {
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
margin-bottom: 8px;
|
|
21
|
+
|
|
22
|
+
.toggle {
|
|
23
|
+
margin-right: 8px;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.splitLayout {
|
|
28
|
+
margin-top: 8px;
|
|
29
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CompareTests } from './compare-tests';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CompareTests = void 0;
|
|
4
|
+
var compare_tests_1 = require("./compare-tests");
|
|
5
|
+
Object.defineProperty(exports, "CompareTests", { enumerable: true, get: function () { return compare_tests_1.CompareTests; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,iDAA+C;AAAtC,6GAAA,YAAY,OAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"lib": [
|
|
4
|
+
"es2019",
|
|
5
|
+
"DOM",
|
|
6
|
+
"ES6",
|
|
7
|
+
"DOM.Iterable"
|
|
8
|
+
],
|
|
9
|
+
"target": "es2015",
|
|
10
|
+
"module": "CommonJS",
|
|
11
|
+
"jsx": "react",
|
|
12
|
+
"allowJs": true,
|
|
13
|
+
"composite": true,
|
|
14
|
+
"declaration": true,
|
|
15
|
+
"sourceMap": true,
|
|
16
|
+
"skipLibCheck": true,
|
|
17
|
+
"experimentalDecorators": true,
|
|
18
|
+
"outDir": "dist",
|
|
19
|
+
"moduleResolution": "node",
|
|
20
|
+
"esModuleInterop": true,
|
|
21
|
+
"rootDir": ".",
|
|
22
|
+
"resolveJsonModule": true
|
|
23
|
+
},
|
|
24
|
+
"exclude": [
|
|
25
|
+
"dist",
|
|
26
|
+
"package.json"
|
|
27
|
+
],
|
|
28
|
+
"include": [
|
|
29
|
+
"**/*",
|
|
30
|
+
"**/*.json"
|
|
31
|
+
]
|
|
32
|
+
}
|
package/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CompareTests } from './compare-tests';
|
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@teambit/defender.ui.test-compare",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
|
+
"componentId": {
|
|
6
|
+
"scope": "teambit.defender",
|
|
7
|
+
"name": "ui/test-compare",
|
|
8
|
+
"version": "0.0.1"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"classnames": "2.2.6",
|
|
12
|
+
"core-js": "^3.0.0",
|
|
13
|
+
"@teambit/design.ui.input.toggle": "1.0.12",
|
|
14
|
+
"@teambit/defender.ui.test-loader": "0.0.490",
|
|
15
|
+
"@teambit/defender.ui.test-table": "0.0.495",
|
|
16
|
+
"@teambit/design.ui.alert-card": "0.0.16",
|
|
17
|
+
"@teambit/design.ui.empty-box": "0.0.353",
|
|
18
|
+
"@teambit/mdx.ui.mdx-layout": "0.0.500",
|
|
19
|
+
"@teambit/component.ui.compare": "0.0.1",
|
|
20
|
+
"@teambit/design.ui.round-loader": "0.0.346"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@types/classnames": "2.2.11",
|
|
24
|
+
"@types/react": "^17.0.8",
|
|
25
|
+
"@types/mocha": "9.1.0",
|
|
26
|
+
"@types/testing-library__jest-dom": "5.9.5",
|
|
27
|
+
"@babel/runtime": "7.12.18",
|
|
28
|
+
"@types/jest": "^26.0.0",
|
|
29
|
+
"@types/react-dom": "^17.0.5",
|
|
30
|
+
"@types/node": "12.20.4"
|
|
31
|
+
},
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"@apollo/client": "^3.0.0",
|
|
34
|
+
"react-dom": "^16.8.0 || ^17.0.0",
|
|
35
|
+
"react": "^16.8.0 || ^17.0.0"
|
|
36
|
+
},
|
|
37
|
+
"license": "Apache-2.0",
|
|
38
|
+
"bit": {
|
|
39
|
+
"bindingPrefix": "@teambit",
|
|
40
|
+
"env": {},
|
|
41
|
+
"overrides": {
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"@teambit/legacy": "-",
|
|
44
|
+
"core-js": "^3.0.0",
|
|
45
|
+
"react-dom": "-",
|
|
46
|
+
"react": "-"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@teambit/legacy": "-",
|
|
50
|
+
"@types/mocha": "9.1.0",
|
|
51
|
+
"@types/testing-library__jest-dom": "5.9.5",
|
|
52
|
+
"@babel/runtime": "7.12.18",
|
|
53
|
+
"@types/jest": "^26.0.0",
|
|
54
|
+
"@types/react-dom": "^17.0.5",
|
|
55
|
+
"@types/react": "^17.0.8",
|
|
56
|
+
"@types/node": "12.20.4",
|
|
57
|
+
"react-dom": "-",
|
|
58
|
+
"react": "-"
|
|
59
|
+
},
|
|
60
|
+
"peerDependencies": {
|
|
61
|
+
"react-dom": "^16.8.0 || ^17.0.0",
|
|
62
|
+
"react": "^16.8.0 || ^17.0.0"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"private": false,
|
|
67
|
+
"engines": {
|
|
68
|
+
"node": ">=12.22.0"
|
|
69
|
+
},
|
|
70
|
+
"repository": {
|
|
71
|
+
"type": "git",
|
|
72
|
+
"url": "https://github.com/teambit/bit"
|
|
73
|
+
},
|
|
74
|
+
"keywords": [
|
|
75
|
+
"bit",
|
|
76
|
+
"components",
|
|
77
|
+
"collaboration",
|
|
78
|
+
"web",
|
|
79
|
+
"react",
|
|
80
|
+
"react-components",
|
|
81
|
+
"angular",
|
|
82
|
+
"angular-components",
|
|
83
|
+
"vue",
|
|
84
|
+
"vue-components"
|
|
85
|
+
]
|
|
86
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"lib": [
|
|
4
|
+
"es2019",
|
|
5
|
+
"DOM",
|
|
6
|
+
"ES6",
|
|
7
|
+
"DOM.Iterable"
|
|
8
|
+
],
|
|
9
|
+
"target": "es2015",
|
|
10
|
+
"module": "CommonJS",
|
|
11
|
+
"jsx": "react",
|
|
12
|
+
"allowJs": true,
|
|
13
|
+
"composite": true,
|
|
14
|
+
"declaration": true,
|
|
15
|
+
"sourceMap": true,
|
|
16
|
+
"skipLibCheck": true,
|
|
17
|
+
"experimentalDecorators": true,
|
|
18
|
+
"outDir": "dist",
|
|
19
|
+
"moduleResolution": "node",
|
|
20
|
+
"esModuleInterop": true,
|
|
21
|
+
"rootDir": ".",
|
|
22
|
+
"resolveJsonModule": true
|
|
23
|
+
},
|
|
24
|
+
"exclude": [
|
|
25
|
+
"dist",
|
|
26
|
+
"package.json"
|
|
27
|
+
],
|
|
28
|
+
"include": [
|
|
29
|
+
"**/*",
|
|
30
|
+
"**/*.json"
|
|
31
|
+
]
|
|
32
|
+
}
|
package/types/asset.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
declare module '*.png' {
|
|
2
|
+
const value: any;
|
|
3
|
+
export = value;
|
|
4
|
+
}
|
|
5
|
+
declare module '*.svg' {
|
|
6
|
+
import type { FunctionComponent, SVGProps } from 'react';
|
|
7
|
+
|
|
8
|
+
export const ReactComponent: FunctionComponent<SVGProps<SVGSVGElement> & { title?: string }>;
|
|
9
|
+
const src: string;
|
|
10
|
+
export default src;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// @TODO Gilad
|
|
14
|
+
declare module '*.jpg' {
|
|
15
|
+
const value: any;
|
|
16
|
+
export = value;
|
|
17
|
+
}
|
|
18
|
+
declare module '*.jpeg' {
|
|
19
|
+
const value: any;
|
|
20
|
+
export = value;
|
|
21
|
+
}
|
|
22
|
+
declare module '*.gif' {
|
|
23
|
+
const value: any;
|
|
24
|
+
export = value;
|
|
25
|
+
}
|
|
26
|
+
declare module '*.bmp' {
|
|
27
|
+
const value: any;
|
|
28
|
+
export = value;
|
|
29
|
+
}
|
package/types/style.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
declare module '*.module.css' {
|
|
2
|
+
const classes: { readonly [key: string]: string };
|
|
3
|
+
export default classes;
|
|
4
|
+
}
|
|
5
|
+
declare module '*.module.scss' {
|
|
6
|
+
const classes: { readonly [key: string]: string };
|
|
7
|
+
export default classes;
|
|
8
|
+
}
|
|
9
|
+
declare module '*.module.sass' {
|
|
10
|
+
const classes: { readonly [key: string]: string };
|
|
11
|
+
export default classes;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare module '*.module.less' {
|
|
15
|
+
const classes: { readonly [key: string]: string };
|
|
16
|
+
export default classes;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
declare module '*.less' {
|
|
20
|
+
const classes: { readonly [key: string]: string };
|
|
21
|
+
export default classes;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare module '*.css' {
|
|
25
|
+
const classes: { readonly [key: string]: string };
|
|
26
|
+
export default classes;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
declare module '*.sass' {
|
|
30
|
+
const classes: { readonly [key: string]: string };
|
|
31
|
+
export default classes;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
declare module '*.scss' {
|
|
35
|
+
const classes: { readonly [key: string]: string };
|
|
36
|
+
export default classes;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
declare module '*.mdx' {
|
|
40
|
+
const component: any;
|
|
41
|
+
export default component;
|
|
42
|
+
}
|