pixel-react 1.1.4 → 1.1.5
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/lib/components/AddResourceButton/type.d.ts +1 -1
- package/lib/components/AllProjectsDropdown/AllProjectsDropdown.d.ts +2 -1
- package/lib/components/AllProjectsDropdown/AllProjectsDropdown.stories.d.ts +1 -0
- package/lib/components/AllProjectsDropdown/types.d.ts +10 -0
- package/lib/components/Button/Button.stories.d.ts +1 -0
- package/lib/components/Button/types.d.ts +1 -1
- package/lib/components/Drawer/Drawer.stories.d.ts +3 -0
- package/lib/components/Drawer/Types.d.ts +25 -1
- package/lib/components/Icon/Icon.d.ts +1 -1
- package/lib/components/MachineInputField/MachineInputField.d.ts +4 -0
- package/lib/components/MachineInputField/MachineInputField.stories.d.ts +6 -0
- package/lib/components/MachineInputField/index.d.ts +1 -0
- package/lib/components/MachineInputField/types.d.ts +11 -0
- package/lib/components/MenuOption/MenuOption.d.ts +1 -1
- package/lib/components/MenuOption/MenuOption.stories.d.ts +1 -0
- package/lib/components/MenuOption/types.d.ts +7 -0
- package/lib/components/Modal/types.d.ts +1 -0
- package/lib/components/SequentialConnectingBranch/SequentialConnectingBranch.d.ts +4 -0
- package/lib/components/SequentialConnectingBranch/SequentialConnectingBranch.stories.d.ts +6 -0
- package/lib/components/SequentialConnectingBranch/components/AddBrowserModal/AddBrowserModal.d.ts +4 -0
- package/lib/components/SequentialConnectingBranch/components/AddBrowserModal/types.d.ts +3 -0
- package/lib/components/SequentialConnectingBranch/components/Branches/Branches.d.ts +4 -0
- package/lib/components/SequentialConnectingBranch/components/Branches/types.d.ts +16 -0
- package/lib/components/SequentialConnectingBranch/components/ConnectingBranches/ConnectingBranches.d.ts +4 -0
- package/lib/components/SequentialConnectingBranch/components/ConnectingBranches/types.d.ts +9 -0
- package/lib/components/SequentialConnectingBranch/components/DatasetListModal/DatasetListModal.d.ts +4 -0
- package/lib/components/SequentialConnectingBranch/components/DatasetListModal/types.d.ts +3 -0
- package/lib/components/SequentialConnectingBranch/index.d.ts +1 -0
- package/lib/components/SequentialConnectingBranch/types.d.ts +32 -0
- package/lib/components/Tabs/types.d.ts +1 -0
- package/lib/index.d.ts +99 -7
- package/lib/index.esm.js +789 -174
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +790 -173
- package/lib/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/assets/Themes/BaseTheme.scss +18 -2
- package/src/assets/Themes/DarkTheme.scss +11 -3
- package/src/assets/icons/add_locator.svg +5 -0
- package/src/assets/icons/android.svg +9 -0
- package/src/assets/icons/browser_stack.svg +9 -0
- package/src/assets/icons/chrome.svg +12 -0
- package/src/assets/icons/dataset_list.svg +3 -0
- package/src/assets/icons/drag_icon.svg +5 -0
- package/src/assets/icons/label_plus.svg +3 -0
- package/src/assets/icons/mac.svg +9 -0
- package/src/assets/icons/manual_locator.svg +8 -0
- package/src/assets/icons/windows.svg +6 -0
- package/src/assets/styles/_colors.scss +4 -4
- package/src/components/AddResourceButton/type.ts +1 -1
- package/src/components/AllProjectsDropdown/AllProjectsDropdown.scss +2 -2
- package/src/components/AllProjectsDropdown/AllProjectsDropdown.stories.tsx +99 -1
- package/src/components/AllProjectsDropdown/AllProjectsDropdown.tsx +30 -56
- package/src/components/AllProjectsDropdown/types.ts +10 -0
- package/src/components/Button/Button.scss +4 -0
- package/src/components/Button/Button.stories.tsx +7 -0
- package/src/components/Button/types.ts +2 -2
- package/src/components/Drawer/Drawer.scss +22 -11
- package/src/components/Drawer/Drawer.stories.tsx +41 -0
- package/src/components/Drawer/Drawer.tsx +67 -40
- package/src/components/Drawer/Types.ts +25 -1
- package/src/components/GridLayout/GridLayout.scss +0 -2
- package/src/components/GridLayout/GridLayout.tsx +15 -8
- package/src/components/Icon/Icon.tsx +39 -33
- package/src/components/Icon/iconList.ts +25 -6
- package/src/components/InputWithDropdown/InputWithDropdown.scss +1 -1
- package/src/components/InputWithDropdown/InputWithDropdown.tsx +2 -1
- package/src/components/MachineInputField/MachineInputField.scss +44 -0
- package/src/components/MachineInputField/MachineInputField.stories.tsx +32 -0
- package/src/components/MachineInputField/MachineInputField.tsx +71 -0
- package/src/components/MachineInputField/index.ts +1 -0
- package/src/components/MachineInputField/types.ts +12 -0
- package/src/components/MenuOption/MenuOption.scss +14 -0
- package/src/components/MenuOption/MenuOption.stories.tsx +21 -0
- package/src/components/MenuOption/MenuOption.tsx +5 -3
- package/src/components/MenuOption/types.ts +9 -0
- package/src/components/MiniModal/MiniModal.tsx +1 -1
- package/src/components/Modal/Modal.tsx +2 -0
- package/src/components/Modal/modal.scss +2 -2
- package/src/components/Modal/types.ts +1 -0
- package/src/components/Select/Select.tsx +2 -2
- package/src/components/SequentialConnectingBranch/SequentialConnectingBranch.scss +117 -0
- package/src/components/SequentialConnectingBranch/SequentialConnectingBranch.stories.tsx +62 -0
- package/src/components/SequentialConnectingBranch/SequentialConnectingBranch.tsx +210 -0
- package/src/components/SequentialConnectingBranch/components/AddBrowserModal/AddBrowserModal.scss +51 -0
- package/src/components/SequentialConnectingBranch/components/AddBrowserModal/AddBrowserModal.tsx +107 -0
- package/src/components/SequentialConnectingBranch/components/AddBrowserModal/types.ts +5 -0
- package/src/components/SequentialConnectingBranch/components/Branches/Branches.scss +184 -0
- package/src/components/SequentialConnectingBranch/components/Branches/Branches.tsx +203 -0
- package/src/components/SequentialConnectingBranch/components/Branches/types.ts +18 -0
- package/src/components/SequentialConnectingBranch/components/ConnectingBranches/ConnectingBranches.scss +3 -0
- package/src/components/SequentialConnectingBranch/components/ConnectingBranches/ConnectingBranches.tsx +66 -0
- package/src/components/SequentialConnectingBranch/components/ConnectingBranches/types.ts +10 -0
- package/src/components/SequentialConnectingBranch/components/DatasetListModal/DatasetListModal.scss +31 -0
- package/src/components/SequentialConnectingBranch/components/DatasetListModal/DatasetListModal.tsx +85 -0
- package/src/components/SequentialConnectingBranch/components/DatasetListModal/types.ts +4 -0
- package/src/components/SequentialConnectingBranch/index.ts +1 -0
- package/src/components/SequentialConnectingBranch/types.ts +42 -0
- package/src/components/Tabs/Tabs.stories.tsx +24 -25
- package/src/components/Tabs/Tabs.tsx +3 -10
- package/src/components/Tabs/types.ts +7 -1
- package/src/index.ts +5 -0
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
import { checkEmpty } from '../../../../utils/checkEmpty/checkEmpty';
|
|
3
|
+
import { BranchesProps } from './types';
|
|
4
|
+
import { Fragment } from 'react/jsx-runtime';
|
|
5
|
+
import { ffid } from '../../../../utils/ffID/ffid';
|
|
6
|
+
import { ExecutionContext } from '../../types';
|
|
7
|
+
import MachineInputField from '../../../MachineInputField';
|
|
8
|
+
import Icon from '../../../Icon';
|
|
9
|
+
import Typography from '../../../Typography';
|
|
10
|
+
import Button from '../../../Button';
|
|
11
|
+
import './Branches.scss';
|
|
12
|
+
|
|
13
|
+
const Branches = ({
|
|
14
|
+
machineInstances,
|
|
15
|
+
rowIndex,
|
|
16
|
+
machineColumnCount,
|
|
17
|
+
machineColumnWidth,
|
|
18
|
+
nextRowMachineInstance,
|
|
19
|
+
previousRowMachineInstance,
|
|
20
|
+
onAddBrowser,
|
|
21
|
+
onDeleteBrowser,
|
|
22
|
+
onAddRunBrowser,
|
|
23
|
+
}: BranchesProps) => {
|
|
24
|
+
const evenRow = rowIndex % 2 === 0;
|
|
25
|
+
const lastMachineInstance = checkEmpty(
|
|
26
|
+
machineInstances[machineColumnCount - 1]
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
const getBorderStyle = (
|
|
30
|
+
currentBranch: ExecutionContext | {} | undefined,
|
|
31
|
+
nextBranch: ExecutionContext | {} | undefined
|
|
32
|
+
) => {
|
|
33
|
+
if (
|
|
34
|
+
currentBranch &&
|
|
35
|
+
nextBranch &&
|
|
36
|
+
'id' in currentBranch &&
|
|
37
|
+
'id' in nextBranch
|
|
38
|
+
) {
|
|
39
|
+
return currentBranch.id === nextBranch.id ? 'dotted' : 'solid';
|
|
40
|
+
}
|
|
41
|
+
return 'solid';
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const showMiddleArrow = (index: number) =>
|
|
45
|
+
machineInstances.length - 1 !== index && machineColumnCount > 1;
|
|
46
|
+
|
|
47
|
+
const getGridTemplateColumnStyle = () => {
|
|
48
|
+
if (machineColumnCount === 1) {
|
|
49
|
+
return `24px ${machineColumnWidth}px 24px`;
|
|
50
|
+
}
|
|
51
|
+
return `24px ${machineColumnWidth}px repeat(${
|
|
52
|
+
machineColumnCount - 1
|
|
53
|
+
}, 40px ${machineColumnWidth}px) 24px`;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<div
|
|
58
|
+
className={classNames({
|
|
59
|
+
'ff-connecting-branch-grid': evenRow,
|
|
60
|
+
'ff-connecting-branch-grid-reverse': !evenRow,
|
|
61
|
+
})}
|
|
62
|
+
style={{
|
|
63
|
+
gridTemplateColumns: getGridTemplateColumnStyle(),
|
|
64
|
+
}}
|
|
65
|
+
>
|
|
66
|
+
<div className="ff-connecting-branch-start-wrapper">
|
|
67
|
+
<div
|
|
68
|
+
className={classNames({
|
|
69
|
+
'ff-connecting-branch-arrow': evenRow,
|
|
70
|
+
'ff-connecting-branch-arrow-reverse': !evenRow,
|
|
71
|
+
})}
|
|
72
|
+
></div>
|
|
73
|
+
<div
|
|
74
|
+
className={classNames({
|
|
75
|
+
'ff-connecting-branch-container': evenRow,
|
|
76
|
+
'ff-connecting-branch-container-reverse': !evenRow,
|
|
77
|
+
})}
|
|
78
|
+
style={{
|
|
79
|
+
border: `1px ${getBorderStyle(
|
|
80
|
+
machineInstances[0],
|
|
81
|
+
previousRowMachineInstance
|
|
82
|
+
)} var(--ff-connecting-branch-color)`,
|
|
83
|
+
borderTop: 'none',
|
|
84
|
+
borderLeft: `${!evenRow && 'none'}`,
|
|
85
|
+
borderRight: `${evenRow && 'none'}`,
|
|
86
|
+
}}
|
|
87
|
+
></div>
|
|
88
|
+
</div>
|
|
89
|
+
{machineInstances?.map((machineInstance, index) => {
|
|
90
|
+
const {
|
|
91
|
+
executionEnv = 'Local',
|
|
92
|
+
browserName = 'Local',
|
|
93
|
+
browserVersion = '1',
|
|
94
|
+
runCount = 0,
|
|
95
|
+
id = '',
|
|
96
|
+
} = machineInstance as ExecutionContext;
|
|
97
|
+
return (
|
|
98
|
+
<Fragment key={ffid()}>
|
|
99
|
+
{!checkEmpty(machineInstance) ? (
|
|
100
|
+
<div>
|
|
101
|
+
<div className="ff-connecting-branch-input-point-wrapper">
|
|
102
|
+
<div
|
|
103
|
+
className={classNames({
|
|
104
|
+
'ff-connecting-branch-point': evenRow,
|
|
105
|
+
'ff-connecting-branch-point-reverse': !evenRow,
|
|
106
|
+
})}
|
|
107
|
+
></div>
|
|
108
|
+
<MachineInputField
|
|
109
|
+
width="180px"
|
|
110
|
+
runCount={runCount}
|
|
111
|
+
key={ffid()}
|
|
112
|
+
options={[
|
|
113
|
+
{ label: executionEnv, type: executionEnv },
|
|
114
|
+
{ label: browserVersion, type: browserName },
|
|
115
|
+
]}
|
|
116
|
+
contentReverse={!evenRow}
|
|
117
|
+
/>
|
|
118
|
+
</div>
|
|
119
|
+
<div
|
|
120
|
+
className={classNames({
|
|
121
|
+
'ff-connecting-branch-datalist': evenRow,
|
|
122
|
+
'ff-connecting-branch-datalist-reverse': !evenRow,
|
|
123
|
+
})}
|
|
124
|
+
>
|
|
125
|
+
<Icon name="datalist_icon" className="ff-connecting-icon" />
|
|
126
|
+
<Typography
|
|
127
|
+
className="ff-connecting-text"
|
|
128
|
+
color="var(--ff-connecting-branch-color)"
|
|
129
|
+
>
|
|
130
|
+
Dataset List
|
|
131
|
+
</Typography>
|
|
132
|
+
<Icon
|
|
133
|
+
name="plus_icon"
|
|
134
|
+
className="ff-connecting-icon"
|
|
135
|
+
onClick={() => onAddRunBrowser(id)}
|
|
136
|
+
color="var(--ff-connecting-branch-color)"
|
|
137
|
+
/>
|
|
138
|
+
<Typography
|
|
139
|
+
className="ff-connecting-text"
|
|
140
|
+
color="var(--ff-connecting-branch-color)"
|
|
141
|
+
>
|
|
142
|
+
Run
|
|
143
|
+
</Typography>
|
|
144
|
+
<Icon
|
|
145
|
+
name="delete"
|
|
146
|
+
className="ff-connecting-delete-icon"
|
|
147
|
+
onClick={() => onDeleteBrowser(id, runCount)}
|
|
148
|
+
color="var(--ff-connecting-branch-delete-color)"
|
|
149
|
+
/>
|
|
150
|
+
</div>
|
|
151
|
+
</div>
|
|
152
|
+
) : (
|
|
153
|
+
<div className="ff-connecting-branch-browser-button">
|
|
154
|
+
<Button
|
|
155
|
+
variant="tertiary"
|
|
156
|
+
label="Browser / Devices"
|
|
157
|
+
onClick={onAddBrowser}
|
|
158
|
+
/>
|
|
159
|
+
</div>
|
|
160
|
+
)}
|
|
161
|
+
{showMiddleArrow(index) && (
|
|
162
|
+
<div
|
|
163
|
+
className="ff-connecting-branch-middle-arrow"
|
|
164
|
+
style={{
|
|
165
|
+
borderTop: `1px ${getBorderStyle(
|
|
166
|
+
machineInstance,
|
|
167
|
+
machineInstances[index + 1]
|
|
168
|
+
)} var(--ff-connecting-branch-color)`,
|
|
169
|
+
}}
|
|
170
|
+
>
|
|
171
|
+
<div
|
|
172
|
+
className={classNames({
|
|
173
|
+
'ff-connecting-branch-arrow': evenRow,
|
|
174
|
+
'ff-connecting-branch-arrow-reverse': !evenRow,
|
|
175
|
+
})}
|
|
176
|
+
></div>
|
|
177
|
+
</div>
|
|
178
|
+
)}
|
|
179
|
+
</Fragment>
|
|
180
|
+
);
|
|
181
|
+
})}
|
|
182
|
+
{!lastMachineInstance && (
|
|
183
|
+
<div
|
|
184
|
+
className={classNames({
|
|
185
|
+
'ff-connecting-branch-end-arrow': evenRow,
|
|
186
|
+
'ff-connecting-branch-end-arrow-reverse': !evenRow,
|
|
187
|
+
})}
|
|
188
|
+
style={{
|
|
189
|
+
border: `1px ${getBorderStyle(
|
|
190
|
+
machineInstances[machineColumnCount - 1],
|
|
191
|
+
nextRowMachineInstance
|
|
192
|
+
)} var(--ff-connecting-branch-color)`,
|
|
193
|
+
borderBottom: 'none',
|
|
194
|
+
borderLeft: `${evenRow && 'none'}`,
|
|
195
|
+
borderRight: `${!evenRow && 'none'}`,
|
|
196
|
+
}}
|
|
197
|
+
></div>
|
|
198
|
+
)}
|
|
199
|
+
</div>
|
|
200
|
+
);
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
export default Branches;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ExecutionContext } from '../../types';
|
|
2
|
+
|
|
3
|
+
export interface BranchesProps {
|
|
4
|
+
machineInstances: ExecutionContext[] | {}[];
|
|
5
|
+
rowIndex: number;
|
|
6
|
+
machineColumnCount: number;
|
|
7
|
+
machineColumnWidth: number;
|
|
8
|
+
nextRowMachineInstance?: ExecutionContext | {} | undefined;
|
|
9
|
+
previousRowMachineInstance?: ExecutionContext | {} | undefined;
|
|
10
|
+
onAddBrowser: () => void;
|
|
11
|
+
onDeleteBrowser: (id: string, runCount: number) => void;
|
|
12
|
+
onAddRunBrowser: (id: string) => void;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface branchTypeProps {
|
|
16
|
+
currentBranch: ExecutionContext | undefined | {};
|
|
17
|
+
nextBranch: ExecutionContext | undefined | {};
|
|
18
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { ExecutionContext } from '../../types';
|
|
3
|
+
import { ConnectingBranchesProps } from './types';
|
|
4
|
+
import { Fragment } from 'react/jsx-runtime';
|
|
5
|
+
import {ffid} from '../../../../utils/ffID/ffid';
|
|
6
|
+
import Branches from '../Branches/Branches';
|
|
7
|
+
import './ConnectingBranches.scss';
|
|
8
|
+
|
|
9
|
+
const ConnectingBranches = ({
|
|
10
|
+
machineBranchInstances,
|
|
11
|
+
machineColumnCount,
|
|
12
|
+
machineColumnWidth,
|
|
13
|
+
onAddBrowser,
|
|
14
|
+
onDeleteBrowser,
|
|
15
|
+
onAddRunBrowser,
|
|
16
|
+
}: ConnectingBranchesProps) => {
|
|
17
|
+
const [machineInstance, setMachineInstance] = useState<
|
|
18
|
+
ExecutionContext[] | {}[]
|
|
19
|
+
>(machineBranchInstances);
|
|
20
|
+
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
setMachineInstance(machineBranchInstances);
|
|
23
|
+
}, [machineBranchInstances]);
|
|
24
|
+
|
|
25
|
+
const getMachineBranchInstancesChunk = (
|
|
26
|
+
machineBranchInstances: ExecutionContext[] | {}[],
|
|
27
|
+
chunkSize: number
|
|
28
|
+
) => {
|
|
29
|
+
const machineBranchInstancesChunk = [];
|
|
30
|
+
for (let i = 0; i < machineBranchInstances.length; i += chunkSize) {
|
|
31
|
+
machineBranchInstancesChunk.push(
|
|
32
|
+
machineBranchInstances.slice(i, i + chunkSize)
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
return machineBranchInstancesChunk;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const machineInstancesRow = getMachineBranchInstancesChunk(
|
|
39
|
+
machineInstance,
|
|
40
|
+
machineColumnCount
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<div className="ff-connecting-branch-grid-wrapper">
|
|
45
|
+
{machineInstancesRow.map((machineInstances, index) => (
|
|
46
|
+
<Fragment key={ffid()}>
|
|
47
|
+
<Branches
|
|
48
|
+
machineInstances={machineInstances}
|
|
49
|
+
rowIndex={index}
|
|
50
|
+
machineColumnCount={machineColumnCount}
|
|
51
|
+
machineColumnWidth={machineColumnWidth}
|
|
52
|
+
onAddBrowser={onAddBrowser}
|
|
53
|
+
onDeleteBrowser={onDeleteBrowser}
|
|
54
|
+
onAddRunBrowser={onAddRunBrowser}
|
|
55
|
+
nextRowMachineInstance={machineInstancesRow[index + 1]?.[0]}
|
|
56
|
+
previousRowMachineInstance={
|
|
57
|
+
machineInstancesRow[index - 1]?.[machineColumnCount - 1]
|
|
58
|
+
}
|
|
59
|
+
/>
|
|
60
|
+
</Fragment>
|
|
61
|
+
))}
|
|
62
|
+
</div>
|
|
63
|
+
);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export default ConnectingBranches;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ExecutionContext } from '../../types';
|
|
2
|
+
|
|
3
|
+
export interface ConnectingBranchesProps {
|
|
4
|
+
machineBranchInstances: ExecutionContext[] | {}[];
|
|
5
|
+
machineColumnCount: number;
|
|
6
|
+
machineColumnWidth: number;
|
|
7
|
+
onAddBrowser: () => void;
|
|
8
|
+
onDeleteBrowser: (id: string, runCount: number) => void;
|
|
9
|
+
onAddRunBrowser: (id: string) => void;
|
|
10
|
+
}
|
package/src/components/SequentialConnectingBranch/components/DatasetListModal/DatasetListModal.scss
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
.ff-datalist-modal-header-wrapper,
|
|
2
|
+
.ff-datalist-modal-child-wrapper,
|
|
3
|
+
.ff-datalist-modal-footer-wrapper {
|
|
4
|
+
margin: 0 8px;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.ff-datalist-modal-header-wrapper {
|
|
8
|
+
width: 255px;
|
|
9
|
+
border-bottom: 1px solid var(--ff-connecting-branch-modal-border);
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.ff-datalist-modal-child-wrapper {
|
|
15
|
+
.variable {
|
|
16
|
+
margin: 8px 0;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.ff-datalist-modal-footer-wrapper {
|
|
21
|
+
display: flex;
|
|
22
|
+
justify-content: space-between;
|
|
23
|
+
border-top: 1px solid var(--ff-connecting-branch-modal-border);
|
|
24
|
+
|
|
25
|
+
.datalist-button-wrapper {
|
|
26
|
+
display: flex;
|
|
27
|
+
gap: 10px;
|
|
28
|
+
margin-top: 4px;
|
|
29
|
+
justify-content: flex-end;
|
|
30
|
+
}
|
|
31
|
+
}
|
package/src/components/SequentialConnectingBranch/components/DatasetListModal/DatasetListModal.tsx
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { forwardRef, RefObject } from 'react';
|
|
2
|
+
import MiniModal from '../../../MiniModal';
|
|
3
|
+
import Typography from '../../../Typography';
|
|
4
|
+
import './DatasetListModal.scss';
|
|
5
|
+
import Select from '../../../Select';
|
|
6
|
+
import Checkbox from '../../../Checkbox';
|
|
7
|
+
import Button from '../../../Button';
|
|
8
|
+
import { DatasetListModalProps } from './types';
|
|
9
|
+
|
|
10
|
+
const DatasetListModal = forwardRef<HTMLButtonElement, DatasetListModalProps>(
|
|
11
|
+
(props, ref) => {
|
|
12
|
+
const selectOptions = [
|
|
13
|
+
{ label: 'Project Environment Variable' },
|
|
14
|
+
{ label: 'Global Variables' },
|
|
15
|
+
{ label: 'Test Data Set' },
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
const renderSelectOptions = () =>
|
|
19
|
+
selectOptions.map(({ label }, idx) => (
|
|
20
|
+
<Select
|
|
21
|
+
key={idx}
|
|
22
|
+
optionsList={[]}
|
|
23
|
+
onChange={() => {}}
|
|
24
|
+
label={label}
|
|
25
|
+
className="variable"
|
|
26
|
+
/>
|
|
27
|
+
));
|
|
28
|
+
|
|
29
|
+
const renderFooterContent = () => (
|
|
30
|
+
<div className="ff-datalist-modal-footer-wrapper">
|
|
31
|
+
<Checkbox checked={false} label="Set as Default" />
|
|
32
|
+
<div className="datalist-button-wrapper">
|
|
33
|
+
<Button label="Cancel" variant="tertiary" />
|
|
34
|
+
<Button label="Update" variant="primary" />
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<div>
|
|
41
|
+
<MiniModal
|
|
42
|
+
anchorRef={ref as RefObject<HTMLButtonElement>}
|
|
43
|
+
headerProps={
|
|
44
|
+
<div className="ff-datalist-modal-header-wrapper">
|
|
45
|
+
<Typography
|
|
46
|
+
as="span"
|
|
47
|
+
color="var(--ff-connecting-branch-modal-header)"
|
|
48
|
+
fontWeight="semi-bold"
|
|
49
|
+
fontSize={12}
|
|
50
|
+
lineHeight="38px"
|
|
51
|
+
>
|
|
52
|
+
Data Sets
|
|
53
|
+
</Typography>
|
|
54
|
+
</div>
|
|
55
|
+
}
|
|
56
|
+
childContent={
|
|
57
|
+
<div className="ff-datalist-modal-child-wrapper">
|
|
58
|
+
{renderSelectOptions()}
|
|
59
|
+
</div>
|
|
60
|
+
}
|
|
61
|
+
footerContent={renderFooterContent()}
|
|
62
|
+
cancelButtonProps={{
|
|
63
|
+
text: 'Cancel',
|
|
64
|
+
|
|
65
|
+
// TODO: DEMO PURPOSE AND WILL BE REMOVED IN THE FUTURE
|
|
66
|
+
onClick: props?.onUpdateDatasetList,
|
|
67
|
+
}}
|
|
68
|
+
proceedButtonProps={{
|
|
69
|
+
text: 'Proceed',
|
|
70
|
+
// TODO: DEMO PURPOSE AND WILL BE REMOVED IN THE FUTURE
|
|
71
|
+
onClick: props?.onUpdateDatasetList,
|
|
72
|
+
}}
|
|
73
|
+
modalPosition="right"
|
|
74
|
+
isPopOver
|
|
75
|
+
leftTopArrow
|
|
76
|
+
extraRightSpace={{ leftTopArrow: 40 }}
|
|
77
|
+
extraLeftSpace={{ rightAlignModal: 110 }}
|
|
78
|
+
{...props}
|
|
79
|
+
/>
|
|
80
|
+
</div>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
export default DatasetListModal;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './SequentialConnectingBranch';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Option } from '../Select/types';
|
|
2
|
+
|
|
3
|
+
export interface SequentialConnectingBranchProps {
|
|
4
|
+
machineInstances?: ExecutionContext[] | {}[];
|
|
5
|
+
machineColumnWidth?: number;
|
|
6
|
+
machineColumnCount?: number;
|
|
7
|
+
machineInstance: ExecutionContext;
|
|
8
|
+
selectedMachine?: string; // TODO: type will change in the future
|
|
9
|
+
onMachineSelectionChange?: (selectedMachine: Option) => void; // TODO: function will change in the future
|
|
10
|
+
machineOptionsList?: Option[];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// Type for machine information
|
|
14
|
+
export interface MachineInfo {
|
|
15
|
+
osName: string;
|
|
16
|
+
osVersion: string;
|
|
17
|
+
hostName: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Type for device information
|
|
21
|
+
export interface DeviceInfo {
|
|
22
|
+
// Define properties as needed; assuming it can have various structures.
|
|
23
|
+
// For example:
|
|
24
|
+
// deviceName: string;
|
|
25
|
+
// deviceType: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface ExecutionContext {
|
|
29
|
+
id: string;
|
|
30
|
+
clientId: string;
|
|
31
|
+
runCount: number;
|
|
32
|
+
executionEnv?: 'Local'; // Change to specific enum if more environments exist
|
|
33
|
+
browserName?: 'Local' | 'mac' | 'android' | 'Google Chrome';
|
|
34
|
+
browserVersion: string;
|
|
35
|
+
systemUrl: string;
|
|
36
|
+
machineInfo: MachineInfo;
|
|
37
|
+
deviceInfo: DeviceInfo[];
|
|
38
|
+
headless: boolean;
|
|
39
|
+
peVariableSetId: string;
|
|
40
|
+
globalVariableSetId: string;
|
|
41
|
+
testDataSetId: string;
|
|
42
|
+
}
|
|
@@ -39,15 +39,15 @@ const TabContentFour = () => (
|
|
|
39
39
|
</div>
|
|
40
40
|
);
|
|
41
41
|
|
|
42
|
+
const tabsData = [
|
|
43
|
+
{ id: 'tab-1', label: 'Tab--1', component: <TabContentOne /> },
|
|
44
|
+
{ id: 'tab-2', label: 'Tab--2', component: <TabContentTwo /> },
|
|
45
|
+
{ id: 'tab-3', label: 'Tab--3', component: <TabContentThree /> },
|
|
46
|
+
];
|
|
47
|
+
|
|
42
48
|
export const DefaultTabs: Story = {
|
|
43
49
|
render: () => {
|
|
44
|
-
const [activeTabIdDefault, setActiveTabIdDefault] = useState<string>('
|
|
45
|
-
|
|
46
|
-
const tabsData = [
|
|
47
|
-
{ label: 'Tab--1', component: <TabContentOne /> },
|
|
48
|
-
{ label: 'Tab--2', component: <TabContentTwo /> },
|
|
49
|
-
{ label: 'Tab--3', component: <TabContentThree /> },
|
|
50
|
-
];
|
|
50
|
+
const [activeTabIdDefault, setActiveTabIdDefault] = useState<string>('tab-1');
|
|
51
51
|
|
|
52
52
|
return (
|
|
53
53
|
<Tabs
|
|
@@ -60,14 +60,14 @@ export const DefaultTabs: Story = {
|
|
|
60
60
|
};
|
|
61
61
|
export const CapsuleTabs: Story = {
|
|
62
62
|
render: () => {
|
|
63
|
-
const [activeTabIdCapsule, setActiveTabIdCapsule] = useState<string>('
|
|
63
|
+
const [activeTabIdCapsule, setActiveTabIdCapsule] = useState<string>('tab-1');
|
|
64
64
|
|
|
65
65
|
const tabsDataForCapsule = [
|
|
66
|
-
{ label: 'Loremipsum_1', component: <TabContentOne /> },
|
|
67
|
-
{ label: 'Loremipsum_2', component: <TabContentTwo /> },
|
|
68
|
-
{ label: 'Loremipsum_3', component: <TabContentThree /> },
|
|
69
|
-
{ label: 'Loremipsum_4', component: <TabContentFour /> },
|
|
70
|
-
{ label: 'Loremipsum_5', component: <TabContentFour /> },
|
|
66
|
+
{ id: 'tab-1', label: 'Loremipsum_1', component: <TabContentOne /> },
|
|
67
|
+
{ id: 'tab-2', label: 'Loremipsum_2', component: <TabContentTwo /> },
|
|
68
|
+
{ id: 'tab-3', label: 'Loremipsum_3', component: <TabContentThree /> },
|
|
69
|
+
{ id: 'tab-4', label: 'Loremipsum_4', component: <TabContentFour /> },
|
|
70
|
+
{ id: 'tab-5', label: 'Loremipsum_5', component: <TabContentFour /> },
|
|
71
71
|
];
|
|
72
72
|
|
|
73
73
|
return (
|
|
@@ -83,12 +83,17 @@ export const CapsuleTabs: Story = {
|
|
|
83
83
|
|
|
84
84
|
export const TabsWithDisabledTab: Story = {
|
|
85
85
|
render: () => {
|
|
86
|
-
const [activeTabId, setActiveTabId] = useState<string>('
|
|
86
|
+
const [activeTabId, setActiveTabId] = useState<string>('tab-1');
|
|
87
87
|
|
|
88
88
|
const tabsDataWithOneDisableAttribute = [
|
|
89
|
-
{ label: 'Tab--1', component: <TabContentOne /> },
|
|
90
|
-
{
|
|
91
|
-
|
|
89
|
+
{ id: 'tab-1', label: 'Tab--1', component: <TabContentOne /> },
|
|
90
|
+
{
|
|
91
|
+
id: 'tab-2',
|
|
92
|
+
label: 'Tab--2',
|
|
93
|
+
component: <TabContentTwo />,
|
|
94
|
+
disabled: true,
|
|
95
|
+
},
|
|
96
|
+
{ id: 'tab-3', label: 'Tab--3', component: <TabContentThree /> },
|
|
92
97
|
];
|
|
93
98
|
|
|
94
99
|
return (
|
|
@@ -103,13 +108,7 @@ export const TabsWithDisabledTab: Story = {
|
|
|
103
108
|
|
|
104
109
|
export const WithoutBorder: Story = {
|
|
105
110
|
render: () => {
|
|
106
|
-
const [activeTabIdDefault, setActiveTabIdDefault] = useState<string>('
|
|
107
|
-
|
|
108
|
-
const tabsData = [
|
|
109
|
-
{ label: 'Tab--1', component: <TabContentOne /> },
|
|
110
|
-
{ label: 'Tab--2', component: <TabContentTwo /> },
|
|
111
|
-
{ label: 'Tab--3', component: <TabContentThree /> },
|
|
112
|
-
];
|
|
111
|
+
const [activeTabIdDefault, setActiveTabIdDefault] = useState<string>('tab-1');
|
|
113
112
|
|
|
114
113
|
return (
|
|
115
114
|
<div style={{ display: 'flex', gap: '10px' }}>
|
|
@@ -132,4 +131,4 @@ export const WithoutBorder: Story = {
|
|
|
132
131
|
},
|
|
133
132
|
};
|
|
134
133
|
|
|
135
|
-
export default meta;
|
|
134
|
+
export default meta;
|
|
@@ -11,13 +11,6 @@ const Tabs = ({
|
|
|
11
11
|
onTabClick,
|
|
12
12
|
noBorder = false,
|
|
13
13
|
}: TabsProps) => {
|
|
14
|
-
const tabs = tabsData.map((tab, index) => ({
|
|
15
|
-
id: index.toString(),
|
|
16
|
-
label: tab.label,
|
|
17
|
-
component: tab.component,
|
|
18
|
-
disabled: tab.disabled,
|
|
19
|
-
}));
|
|
20
|
-
|
|
21
14
|
return (
|
|
22
15
|
<div className={`ff-tabs-container`}>
|
|
23
16
|
<div
|
|
@@ -25,7 +18,7 @@ const Tabs = ({
|
|
|
25
18
|
'ff-tab-row--no-border': noBorder,
|
|
26
19
|
})}
|
|
27
20
|
>
|
|
28
|
-
{
|
|
21
|
+
{tabsData.map((tab) => (
|
|
29
22
|
<button
|
|
30
23
|
key={tab.id}
|
|
31
24
|
onClick={() => !tab.disabled && onTabClick(tab.id)}
|
|
@@ -60,10 +53,10 @@ const Tabs = ({
|
|
|
60
53
|
))}
|
|
61
54
|
</div>
|
|
62
55
|
<div className={`ff-tab-content`}>
|
|
63
|
-
{
|
|
56
|
+
{tabsData.find((tab) => tab.id === activeTabId)?.component}
|
|
64
57
|
</div>
|
|
65
58
|
</div>
|
|
66
59
|
);
|
|
67
60
|
};
|
|
68
61
|
|
|
69
|
-
export default Tabs;
|
|
62
|
+
export default Tabs;
|
|
@@ -21,7 +21,12 @@ export interface TabsProps {
|
|
|
21
21
|
/**
|
|
22
22
|
* An array of tab objects containing label, component, and optional disabled status.
|
|
23
23
|
*/
|
|
24
|
-
tabsData: {
|
|
24
|
+
tabsData: {
|
|
25
|
+
id: string;
|
|
26
|
+
label: string;
|
|
27
|
+
component?: JSX.Element;
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
}[];
|
|
25
30
|
/**
|
|
26
31
|
* Defines the styling variant of the tabs.
|
|
27
32
|
*/
|
|
@@ -40,3 +45,4 @@ export interface TabsProps {
|
|
|
40
45
|
*/
|
|
41
46
|
noBorder?: boolean;
|
|
42
47
|
}
|
|
48
|
+
|
package/src/index.ts
CHANGED
|
@@ -46,6 +46,8 @@ import Paper from './components/Paper';
|
|
|
46
46
|
import DashboardDonutChart from './components/Charts/DashboardDonutChart';
|
|
47
47
|
import Recaptcha from './components/FF_Captcha/Recaptcha';
|
|
48
48
|
import NLPInput from './components/NLPInput';
|
|
49
|
+
import MachineInputField from './components/MachineInputField';
|
|
50
|
+
import SequentialConnectingBranch from './components/SequentialConnectingBranch';
|
|
49
51
|
|
|
50
52
|
// Utils imports
|
|
51
53
|
import { checkEmpty } from './utils/checkEmpty/checkEmpty';
|
|
@@ -119,6 +121,9 @@ export {
|
|
|
119
121
|
Paper,
|
|
120
122
|
Recaptcha,
|
|
121
123
|
NLPInput,
|
|
124
|
+
MachineInputField,
|
|
125
|
+
SequentialConnectingBranch,
|
|
126
|
+
|
|
122
127
|
// utils exports
|
|
123
128
|
checkEmpty,
|
|
124
129
|
getExtension,
|