pixel-react 1.1.3 → 1.1.5
Sign up to get free protection for your applications and to get access to all the features.
- package/.yarn/install-state.gz +0 -0
- package/lib/components/AddButton/AddButton.d.ts +5 -0
- package/lib/components/AddButton/AddButton.stories.d.ts +6 -0
- package/lib/components/AddButton/index.d.ts +1 -0
- package/lib/components/AddButton/types.d.ts +4 -0
- 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/AppHeader/types.d.ts +14 -10
- 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 +113 -17
- package/lib/index.esm.js +1244 -312
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +1245 -311
- package/lib/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/rollup.config.mjs +2 -8
- 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/AppHeader/AppHeader.stories.tsx +20 -10
- package/src/components/AppHeader/AppHeader.tsx +24 -17
- package/src/components/AppHeader/types.ts +17 -13
- package/src/components/Button/Button.scss +4 -0
- package/src/components/Button/Button.stories.tsx +7 -0
- package/src/components/Button/index.ts +1 -1
- 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
- package/lib/index.css +0 -404
- package/lib/index.esm.css +0 -404
@@ -256,4 +256,25 @@ export const MenuOptionPlacementRight: Story = {
|
|
256
256
|
},
|
257
257
|
};
|
258
258
|
|
259
|
+
|
260
|
+
export const MenuOptionCustom: Story = {
|
261
|
+
args: {
|
262
|
+
iconName: 'more',
|
263
|
+
dropdownPlacement: 'bottom',
|
264
|
+
variant:'dark',
|
265
|
+
options: [
|
266
|
+
{
|
267
|
+
label: 'Option1',
|
268
|
+
value: 'opt1',
|
269
|
+
icon: 'success',
|
270
|
+
},
|
271
|
+
{
|
272
|
+
label: 'Option2',
|
273
|
+
value: 'opt2',
|
274
|
+
icon: 'success',
|
275
|
+
},
|
276
|
+
],
|
277
|
+
},
|
278
|
+
};
|
279
|
+
|
259
280
|
export default meta;
|
@@ -51,6 +51,7 @@ const MenuOption = ({
|
|
51
51
|
iconButtonSize = 20,
|
52
52
|
iconButtonBorderRadius = 7,
|
53
53
|
iconSize = 16,
|
54
|
+
variant = 'light',
|
54
55
|
}: MenuOptionProps) => {
|
55
56
|
const [isClicked, setIsClicked] = useState(false);
|
56
57
|
const menuRef = useRef<HTMLDivElement>(null);
|
@@ -90,6 +91,7 @@ const MenuOption = ({
|
|
90
91
|
<div
|
91
92
|
className={classNames('ff-menuicon-container', {
|
92
93
|
'ff-menuicon-container-clicked': isClicked,
|
94
|
+
dark: variant === 'dark',
|
93
95
|
})}
|
94
96
|
onClick={onIconClickHandler}
|
95
97
|
style={{
|
@@ -103,9 +105,9 @@ const MenuOption = ({
|
|
103
105
|
width={iconSize}
|
104
106
|
name={iconName}
|
105
107
|
color={
|
106
|
-
isClicked
|
107
|
-
|
108
|
-
|
108
|
+
isClicked === (variant === 'dark')
|
109
|
+
? 'var(--menu-option-icon-clicked)'
|
110
|
+
: 'var(--menu-option-icon-color)'
|
109
111
|
}
|
110
112
|
/>
|
111
113
|
</div>
|
@@ -110,6 +110,15 @@ interface MenuOptionProps {
|
|
110
110
|
* @type {function}
|
111
111
|
* @optional
|
112
112
|
*/
|
113
|
+
|
114
|
+
variant?: 'dark' | 'light';
|
115
|
+
/**
|
116
|
+
* The variant of the menu option, either 'dark' or 'light'.
|
117
|
+
* @type {'dark' | 'light'}
|
118
|
+
* @default 'light'
|
119
|
+
* @optional
|
120
|
+
*/
|
121
|
+
|
113
122
|
onClick?: () => void;
|
114
123
|
|
115
124
|
/**
|
@@ -182,7 +182,7 @@ const MiniModal = forwardRef<HTMLDivElement, MiniEditModalProps>(
|
|
182
182
|
}}
|
183
183
|
>
|
184
184
|
{headerProps ? (
|
185
|
-
<Typography as="
|
185
|
+
<Typography as="div">{headerProps}</Typography>
|
186
186
|
) : (
|
187
187
|
<Typography as="header">
|
188
188
|
<Typography as="h2">Header text</Typography>
|
@@ -20,6 +20,7 @@ const Modal: React.FC<ModalProps> = ({
|
|
20
20
|
customWidth = '660px', // default width
|
21
21
|
customHeight = 'auto', // default height
|
22
22
|
children,
|
23
|
+
zIndex = 999,
|
23
24
|
}) => {
|
24
25
|
useEffect(() => {
|
25
26
|
const handleKeyDown = (e: KeyboardEvent) => {
|
@@ -49,6 +50,7 @@ const Modal: React.FC<ModalProps> = ({
|
|
49
50
|
return createPortal(
|
50
51
|
<div
|
51
52
|
className={`ff-modal-overlay ${overlayClassName || ''}`}
|
53
|
+
style={{ zIndex: zIndex }}
|
52
54
|
onClick={shouldCloseOnOverlayClick ? onClose : undefined}
|
53
55
|
>
|
54
56
|
<div
|
@@ -283,7 +283,7 @@ const Select = ({
|
|
283
283
|
>
|
284
284
|
{required && (
|
285
285
|
<Typography
|
286
|
-
color="var(
|
286
|
+
color="var(--error-light)"
|
287
287
|
className="ff-select-label--required"
|
288
288
|
>
|
289
289
|
*
|
@@ -327,7 +327,7 @@ const Select = ({
|
|
327
327
|
{required && (
|
328
328
|
<Typography
|
329
329
|
fontSize={8}
|
330
|
-
color={'var(
|
330
|
+
color={'var(--error-light)'}
|
331
331
|
className="ff-select-legend--required"
|
332
332
|
>
|
333
333
|
*
|
@@ -0,0 +1,117 @@
|
|
1
|
+
.ff-sequential-connecting-branch-wrapper {
|
2
|
+
.ff-connecting-select-branch-wrapper {
|
3
|
+
height: 66px;
|
4
|
+
box-sizing: border-box;
|
5
|
+
width: fit-content;
|
6
|
+
margin-bottom: 16px;
|
7
|
+
|
8
|
+
.ff-select-branch-wrapper {
|
9
|
+
position: relative;
|
10
|
+
display: flex;
|
11
|
+
box-sizing: border-box;
|
12
|
+
|
13
|
+
.ff-sequential-select-branch {
|
14
|
+
width: 240px;
|
15
|
+
}
|
16
|
+
|
17
|
+
.ff-select-branch-arrow {
|
18
|
+
position: relative;
|
19
|
+
display: flex;
|
20
|
+
align-items: center;
|
21
|
+
|
22
|
+
.ff-branch-arrow-wrapper {
|
23
|
+
width: 40px;
|
24
|
+
border-top: 1px solid var(--ff-connecting-branch-color);
|
25
|
+
margin-top: 4px;
|
26
|
+
position: relative;
|
27
|
+
|
28
|
+
.ff-branch-arrow {
|
29
|
+
width: 6px;
|
30
|
+
height: 6px;
|
31
|
+
background-color: var(--ff-connecting-branch-color);
|
32
|
+
clip-path: polygon(100% 50%, 0 100%, 0 0);
|
33
|
+
position: absolute;
|
34
|
+
right: -1px;
|
35
|
+
top: -3px;
|
36
|
+
}
|
37
|
+
}
|
38
|
+
|
39
|
+
.ff-select-branch-point {
|
40
|
+
width: 5px;
|
41
|
+
height: 5px;
|
42
|
+
border-radius: 50%;
|
43
|
+
background-color: var(--ff-connecting-branch-color);
|
44
|
+
position: absolute;
|
45
|
+
left: -3px;
|
46
|
+
z-index: 102;
|
47
|
+
top: 50%;
|
48
|
+
}
|
49
|
+
|
50
|
+
.branch-button {
|
51
|
+
margin-top: 4px;
|
52
|
+
}
|
53
|
+
}
|
54
|
+
|
55
|
+
.ff-select-branch-arrow-down {
|
56
|
+
position: absolute;
|
57
|
+
height: 38px;
|
58
|
+
|
59
|
+
.ff-select-branch-point {
|
60
|
+
position: absolute;
|
61
|
+
height: 5px;
|
62
|
+
width: 5px;
|
63
|
+
background-color: var(--ff-connecting-branch-color);
|
64
|
+
border-radius: 50%;
|
65
|
+
top: 50%;
|
66
|
+
left: -2px;
|
67
|
+
z-index: 102;
|
68
|
+
}
|
69
|
+
|
70
|
+
.ff-select-branch-arrow {
|
71
|
+
width: 0px;
|
72
|
+
height: 62px;
|
73
|
+
top: calc(50% + 1px);
|
74
|
+
border-left: 1px solid var(--ff-connecting-branch-color);
|
75
|
+
z-index: 102;
|
76
|
+
}
|
77
|
+
}
|
78
|
+
}
|
79
|
+
|
80
|
+
.ff-select-scope-datalist {
|
81
|
+
box-sizing: border-box;
|
82
|
+
width: 240px;
|
83
|
+
margin-top: 4px;
|
84
|
+
padding: 0px 4px;
|
85
|
+
display: flex;
|
86
|
+
justify-content: space-between;
|
87
|
+
|
88
|
+
.ff-scope-wrapper {
|
89
|
+
display: flex;
|
90
|
+
|
91
|
+
.ff-scope-text {
|
92
|
+
margin-left: 4px;
|
93
|
+
}
|
94
|
+
}
|
95
|
+
|
96
|
+
.ff-datalist-wrapper {
|
97
|
+
display: flex;
|
98
|
+
|
99
|
+
.ff-dataset-icon,
|
100
|
+
.ff-run-delete-icon,
|
101
|
+
.ff-datalist-text {
|
102
|
+
cursor: pointer;
|
103
|
+
}
|
104
|
+
|
105
|
+
.ff-datalist-text {
|
106
|
+
margin: 0px 12px 0px 4px;
|
107
|
+
}
|
108
|
+
}
|
109
|
+
}
|
110
|
+
}
|
111
|
+
|
112
|
+
.ff-sequential-branches-wrapper {
|
113
|
+
box-sizing: border-box;
|
114
|
+
width: fit-content;
|
115
|
+
height: fit-content;
|
116
|
+
}
|
117
|
+
}
|
@@ -0,0 +1,62 @@
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
2
|
+
import SequentialConnectingBranch from './SequentialConnectingBranch';
|
3
|
+
import {ffid} from '../../utils/ffID/ffid';
|
4
|
+
|
5
|
+
const meta: Meta<typeof SequentialConnectingBranch> = {
|
6
|
+
title: 'Components/SequentialConnectingBranch',
|
7
|
+
component: SequentialConnectingBranch,
|
8
|
+
parameters: {
|
9
|
+
layout: 'centered',
|
10
|
+
},
|
11
|
+
tags: ['autodocs'],
|
12
|
+
};
|
13
|
+
|
14
|
+
type Story = StoryObj<typeof SequentialConnectingBranch>;
|
15
|
+
|
16
|
+
export const Primary: Story = {
|
17
|
+
args: {
|
18
|
+
machineInstances: [
|
19
|
+
{
|
20
|
+
id: ffid(),
|
21
|
+
runCount: 1,
|
22
|
+
clientId: 'flinko-client-win-98ddb98f-2349-43ce-869e-c2d5350741a4',
|
23
|
+
executionEnv: 'Local',
|
24
|
+
browserName: 'Google Chrome',
|
25
|
+
browserVersion: '111.0.5563.112',
|
26
|
+
systemUrl: '',
|
27
|
+
machineInfo: {
|
28
|
+
osName: 'Windows 11 Pro',
|
29
|
+
osVersion: '10.0.22621',
|
30
|
+
hostName: 'TYSS-Kumuda',
|
31
|
+
},
|
32
|
+
deviceInfo: [],
|
33
|
+
headless: false,
|
34
|
+
peVariableSetId: 'UUID',
|
35
|
+
globalVariableSetId: 'UUID',
|
36
|
+
testDataSetId: 'UUID',
|
37
|
+
},
|
38
|
+
],
|
39
|
+
machineInstance: {
|
40
|
+
id: ffid(),
|
41
|
+
runCount: 1,
|
42
|
+
clientId: 'flinko-client-win-98ddb98f-2349-43ce-869e-c2d5350741a4',
|
43
|
+
executionEnv: 'Local',
|
44
|
+
browserName: 'Google Chrome',
|
45
|
+
browserVersion: '111.0.5563.112',
|
46
|
+
systemUrl: '',
|
47
|
+
machineInfo: {
|
48
|
+
osName: 'Windows 11 Pro',
|
49
|
+
osVersion: '10.0.22621',
|
50
|
+
hostName: 'TYSS-Kumuda',
|
51
|
+
},
|
52
|
+
deviceInfo: [],
|
53
|
+
headless: false,
|
54
|
+
peVariableSetId: 'UUID',
|
55
|
+
globalVariableSetId: 'UUID',
|
56
|
+
testDataSetId: 'UUID',
|
57
|
+
},
|
58
|
+
selectedMachine: 'test',
|
59
|
+
},
|
60
|
+
};
|
61
|
+
|
62
|
+
export default meta;
|
@@ -0,0 +1,210 @@
|
|
1
|
+
import classNames from 'classnames';
|
2
|
+
import { checkEmpty } from '../../utils/checkEmpty/checkEmpty';
|
3
|
+
import Button from '../Button';
|
4
|
+
import Icon from '../Icon';
|
5
|
+
import Select from '../Select';
|
6
|
+
import Typography from '../Typography';
|
7
|
+
import './SequentialConnectingBranch.scss';
|
8
|
+
import { useEffect, useRef, useState } from 'react';
|
9
|
+
import ConnectingBranches from './components/ConnectingBranches/ConnectingBranches';
|
10
|
+
import DatasetListModal from './components/DatasetListModal/DatasetListModal';
|
11
|
+
import AddBrowserModal from './components/AddBrowserModal/AddBrowserModal';
|
12
|
+
import { ExecutionContext, SequentialConnectingBranchProps } from './types';
|
13
|
+
import { Option } from '../Select/types';
|
14
|
+
import { ffid } from '../../utils/ffID/ffid';
|
15
|
+
|
16
|
+
const SequentialConnectingBranch = ({
|
17
|
+
machineInstances = [],
|
18
|
+
machineColumnWidth = 180,
|
19
|
+
machineColumnCount = 1,
|
20
|
+
machineInstance,
|
21
|
+
selectedMachine = '',
|
22
|
+
machineOptionsList = [],
|
23
|
+
onMachineSelectionChange = () => {},
|
24
|
+
}: SequentialConnectingBranchProps) => {
|
25
|
+
const dataListRef = useRef<HTMLButtonElement>(null);
|
26
|
+
const selectButtonRef = useRef<HTMLButtonElement>(null);
|
27
|
+
const defaultMachineColumnCount = Math.max(machineColumnCount, 1);
|
28
|
+
const defaultMachineColumnWidth = Math.max(machineColumnWidth, 180);
|
29
|
+
|
30
|
+
const isBrowserDetails = checkEmpty(machineInstances);
|
31
|
+
const [datasetListModal, setDatasetListModal] = useState(
|
32
|
+
!!selectedMachine && isBrowserDetails
|
33
|
+
);
|
34
|
+
const [addBrowserModal, setAddBrowserModal] = useState(false);
|
35
|
+
const [machineBranchInstances, setMachineBranchInstances] = useState<
|
36
|
+
ExecutionContext[] | {}[]
|
37
|
+
>(machineInstances);
|
38
|
+
|
39
|
+
// TODO: DEMO PURPOSE AND WILL BE REMOVED IN THE FUTURE
|
40
|
+
const onHandleSelect = (option: Option) => {
|
41
|
+
setDatasetListModal(true);
|
42
|
+
onMachineSelectionChange(option);
|
43
|
+
};
|
44
|
+
|
45
|
+
// TODO: DEMO PURPOSE AND WILL BE REMOVED IN THE FUTURE
|
46
|
+
const onUpdateDatasetList = () => {
|
47
|
+
setDatasetListModal(false);
|
48
|
+
setAddBrowserModal(true);
|
49
|
+
};
|
50
|
+
|
51
|
+
// TODO: DEMO PURPOSE AND WILL BE REMOVED IN THE FUTURE
|
52
|
+
const onUpdateAddBrowser = () => {
|
53
|
+
setAddBrowserModal(false);
|
54
|
+
setDatasetListModal(false);
|
55
|
+
};
|
56
|
+
|
57
|
+
// TODO: DEMO PURPOSE AND WILL BE REMOVED IN THE FUTURE
|
58
|
+
const onAddBrowser = () => {
|
59
|
+
const newMachineInstance = { ...machineInstance, id: ffid() };
|
60
|
+
console.log(newMachineInstance);
|
61
|
+
setMachineBranchInstances((prevInstances) => [
|
62
|
+
...prevInstances.slice(0, -1),
|
63
|
+
newMachineInstance,
|
64
|
+
{},
|
65
|
+
]);
|
66
|
+
};
|
67
|
+
|
68
|
+
// TODO: DEMO PURPOSE AND WILL BE REMOVED IN THE FUTURE
|
69
|
+
const onDeleteBrowser = (id: string, runCount: number) => {
|
70
|
+
const machineInstance = machineBranchInstances.filter((instance) => {
|
71
|
+
if ('id' in instance && 'runCount' in instance) {
|
72
|
+
return instance.id !== id || instance.runCount !== runCount;
|
73
|
+
}
|
74
|
+
return true;
|
75
|
+
});
|
76
|
+
setMachineBranchInstances(machineInstance);
|
77
|
+
};
|
78
|
+
|
79
|
+
// TODO: DEMO PURPOSE AND WILL BE REMOVED IN THE FUTURE
|
80
|
+
const onAddRunBrowser = (id: string) => {
|
81
|
+
const index = machineBranchInstances.findLastIndex(
|
82
|
+
(instance) => 'id' in instance && instance.id === id
|
83
|
+
);
|
84
|
+
|
85
|
+
if (index !== -1) {
|
86
|
+
const existingMachineInstance = machineBranchInstances[index];
|
87
|
+
|
88
|
+
if (existingMachineInstance && 'runCount' in existingMachineInstance) {
|
89
|
+
const newRunInstance = {
|
90
|
+
...existingMachineInstance,
|
91
|
+
runCount: (existingMachineInstance.runCount ?? 0) + 1,
|
92
|
+
};
|
93
|
+
|
94
|
+
setMachineBranchInstances((prevInstances) => [
|
95
|
+
...prevInstances.slice(0, index + 1),
|
96
|
+
newRunInstance,
|
97
|
+
...prevInstances.slice(index + 1),
|
98
|
+
]);
|
99
|
+
}
|
100
|
+
}
|
101
|
+
};
|
102
|
+
|
103
|
+
useEffect(() => {
|
104
|
+
setMachineBranchInstances([...machineBranchInstances, {}]);
|
105
|
+
}, []);
|
106
|
+
|
107
|
+
return (
|
108
|
+
<div className="ff-sequential-connecting-branch-wrapper">
|
109
|
+
<div className="ff-connecting-select-branch-wrapper">
|
110
|
+
<div className="ff-select-branch-wrapper">
|
111
|
+
<Select
|
112
|
+
onChange={onHandleSelect}
|
113
|
+
optionsList={machineOptionsList}
|
114
|
+
required={true}
|
115
|
+
label="Choose Machine"
|
116
|
+
showLabel={true}
|
117
|
+
className="ff-sequential-select-branch"
|
118
|
+
/>
|
119
|
+
{/* {isBrowserDetails && !!selectedMachine && ( */}
|
120
|
+
{!!selectedMachine && (
|
121
|
+
<div
|
122
|
+
className={classNames({
|
123
|
+
'ff-select-branch-arrow': isBrowserDetails,
|
124
|
+
'ff-select-branch-arrow-down': !isBrowserDetails,
|
125
|
+
})}
|
126
|
+
>
|
127
|
+
<div className="ff-select-branch-point"></div>
|
128
|
+
<div className="ff-select-branch-arrow">
|
129
|
+
<div className="ff-branch-arrow-wrapper">
|
130
|
+
{isBrowserDetails && <div className="ff-branch-arrow"></div>}
|
131
|
+
</div>
|
132
|
+
{addBrowserModal && (
|
133
|
+
<>
|
134
|
+
<Button
|
135
|
+
variant="tertiary"
|
136
|
+
label="Browser / Device"
|
137
|
+
size="small"
|
138
|
+
className="branch-button"
|
139
|
+
ref={selectButtonRef}
|
140
|
+
onClick={onAddBrowser}
|
141
|
+
/>
|
142
|
+
|
143
|
+
<AddBrowserModal
|
144
|
+
ref={selectButtonRef}
|
145
|
+
onUpdateAddBrowser={onUpdateAddBrowser}
|
146
|
+
/>
|
147
|
+
</>
|
148
|
+
)}
|
149
|
+
</div>
|
150
|
+
</div>
|
151
|
+
)}
|
152
|
+
</div>
|
153
|
+
<div className="ff-select-scope-datalist">
|
154
|
+
<div className="ff-scope-wrapper">
|
155
|
+
<Icon name="windows" />
|
156
|
+
<Typography
|
157
|
+
as="span"
|
158
|
+
fontSize={12}
|
159
|
+
color="var(--ff-connecting-branch-scope-color)"
|
160
|
+
className="ff-scope-text"
|
161
|
+
>
|
162
|
+
Private
|
163
|
+
</Typography>
|
164
|
+
</div>
|
165
|
+
|
166
|
+
<div className="ff-datalist-wrapper">
|
167
|
+
<Icon
|
168
|
+
name="datalist_icon"
|
169
|
+
className="ff-dataset-icon"
|
170
|
+
ref={dataListRef}
|
171
|
+
/>
|
172
|
+
{datasetListModal && (
|
173
|
+
<DatasetListModal
|
174
|
+
ref={dataListRef}
|
175
|
+
onUpdateDatasetList={onUpdateDatasetList}
|
176
|
+
/>
|
177
|
+
)}
|
178
|
+
<Typography
|
179
|
+
as="span"
|
180
|
+
fontSize={12}
|
181
|
+
color="var(--ff-connecting-branch-color)"
|
182
|
+
className="ff-datalist-text"
|
183
|
+
>
|
184
|
+
Dataset List
|
185
|
+
</Typography>
|
186
|
+
<Icon
|
187
|
+
name="delete"
|
188
|
+
className="ff-run-delete-icon"
|
189
|
+
color="var(--ff-connecting-branch-delete-color)"
|
190
|
+
/>
|
191
|
+
</div>
|
192
|
+
</div>
|
193
|
+
</div>
|
194
|
+
<div className="ff-sequential-branches-wrapper">
|
195
|
+
{!isBrowserDetails && (
|
196
|
+
<ConnectingBranches
|
197
|
+
machineBranchInstances={machineBranchInstances}
|
198
|
+
machineColumnCount={defaultMachineColumnCount}
|
199
|
+
machineColumnWidth={defaultMachineColumnWidth}
|
200
|
+
onAddBrowser={onAddBrowser}
|
201
|
+
onDeleteBrowser={onDeleteBrowser}
|
202
|
+
onAddRunBrowser={onAddRunBrowser}
|
203
|
+
/>
|
204
|
+
)}
|
205
|
+
</div>
|
206
|
+
</div>
|
207
|
+
);
|
208
|
+
};
|
209
|
+
|
210
|
+
export default SequentialConnectingBranch;
|
package/src/components/SequentialConnectingBranch/components/AddBrowserModal/AddBrowserModal.scss
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
.ff-connecting-datalist-modal-header-wrapper,
|
2
|
+
.ff-connecting-modal-child-wrapper {
|
3
|
+
width: 534px;
|
4
|
+
padding: 0 4px;
|
5
|
+
}
|
6
|
+
|
7
|
+
.ff-connecting-datalist-modal-header-wrapper {
|
8
|
+
border-bottom: 1px solid var(--ff-connecting-branch-modal-border);
|
9
|
+
margin-bottom: 4px;
|
10
|
+
}
|
11
|
+
|
12
|
+
.ff-connecting-modal-child-wrapper {
|
13
|
+
.ff-branch-select-input-wrapper {
|
14
|
+
display: flex;
|
15
|
+
align-items: center;
|
16
|
+
gap: 8px;
|
17
|
+
|
18
|
+
.ff-select-browser {
|
19
|
+
width: 263px;
|
20
|
+
}
|
21
|
+
|
22
|
+
.ff-branch-input-wrapper {
|
23
|
+
display: flex;
|
24
|
+
align-items: flex-end;
|
25
|
+
height: 38px;
|
26
|
+
|
27
|
+
.ff-input-browser {
|
28
|
+
width: 245px;
|
29
|
+
}
|
30
|
+
}
|
31
|
+
}
|
32
|
+
}
|
33
|
+
|
34
|
+
.ff-connecting-modal-footer-wrapper {
|
35
|
+
display: flex;
|
36
|
+
align-items: center;
|
37
|
+
justify-content: space-between;
|
38
|
+
padding: 0 8px;
|
39
|
+
margin-top: 8px;
|
40
|
+
border-top: 1px solid var(--ff-connecting-branch-modal-border);
|
41
|
+
|
42
|
+
.ff-branch-toggle-wrapper,
|
43
|
+
.ff-datalist-button-wrapper {
|
44
|
+
display: flex;
|
45
|
+
gap: 8px;
|
46
|
+
}
|
47
|
+
|
48
|
+
.ff-branch-toggle-wrapper {
|
49
|
+
gap: 4px;
|
50
|
+
}
|
51
|
+
}
|
package/src/components/SequentialConnectingBranch/components/AddBrowserModal/AddBrowserModal.tsx
ADDED
@@ -0,0 +1,107 @@
|
|
1
|
+
import { forwardRef, RefObject } from 'react';
|
2
|
+
import MiniModal from '../../../MiniModal';
|
3
|
+
import Typography from '../../../Typography';
|
4
|
+
import './AddBrowserModal.scss';
|
5
|
+
import Select from '../../../Select';
|
6
|
+
import Button from '../../../Button';
|
7
|
+
import Toggle from '../../../Toggle';
|
8
|
+
import Input from '../../../Input/Input';
|
9
|
+
import { AddBrowserModalProps } from './types';
|
10
|
+
|
11
|
+
const AddBrowserModal = forwardRef<HTMLButtonElement, AddBrowserModalProps>(
|
12
|
+
(props, ref) => {
|
13
|
+
// TODO: WILL BE REMOVE IN THE FUTURE
|
14
|
+
const selectOptions = [
|
15
|
+
{ label: 'Execution Environment', inputName: 'number of runs' },
|
16
|
+
{ label: 'Browser', inputName: 'Browser Version' },
|
17
|
+
{ label: 'Android Device', inputName: 'os version' },
|
18
|
+
{ label: 'IOS Device', inputName: 'os version-1' },
|
19
|
+
];
|
20
|
+
|
21
|
+
const renderSelectOptions = () => (
|
22
|
+
<div>
|
23
|
+
{selectOptions.map(({ label, inputName }, index) => (
|
24
|
+
<div className="ff-branch-select-input-wrapper" key={index}>
|
25
|
+
<Select
|
26
|
+
optionsList={[]}
|
27
|
+
onChange={() => {}}
|
28
|
+
label={label}
|
29
|
+
className="ff-select-browser"
|
30
|
+
/>
|
31
|
+
<div className="ff-branch-input-wrapper">
|
32
|
+
<Input
|
33
|
+
value="0"
|
34
|
+
label="Number of Runs"
|
35
|
+
type="number"
|
36
|
+
onChange={() => {}}
|
37
|
+
name={inputName}
|
38
|
+
className="ff-input-browser"
|
39
|
+
/>
|
40
|
+
</div>
|
41
|
+
</div>
|
42
|
+
))}
|
43
|
+
</div>
|
44
|
+
);
|
45
|
+
|
46
|
+
const renderFooterContent = () => (
|
47
|
+
<div className="ff-connecting-modal-footer-wrapper">
|
48
|
+
<div className="ff-branch-toggle-wrapper">
|
49
|
+
<Typography as="span" lineHeight="32px">
|
50
|
+
Run in Headless Mode
|
51
|
+
</Typography>
|
52
|
+
<Toggle />
|
53
|
+
</div>
|
54
|
+
<div className="ff-datalist-button-wrapper">
|
55
|
+
<Button label="Cancel" variant="tertiary" />
|
56
|
+
<Button label="Update" variant="primary" />
|
57
|
+
</div>
|
58
|
+
</div>
|
59
|
+
);
|
60
|
+
|
61
|
+
return (
|
62
|
+
<div>
|
63
|
+
<MiniModal
|
64
|
+
anchorRef={ref as RefObject<HTMLButtonElement>}
|
65
|
+
headerProps={
|
66
|
+
<div className="ff-connecting-datalist-modal-header-wrapper">
|
67
|
+
<Typography
|
68
|
+
as="span"
|
69
|
+
color="var(--ff-connecting-branch-modal-header)"
|
70
|
+
fontWeight="semi-bold"
|
71
|
+
fontSize={12}
|
72
|
+
lineHeight="38px"
|
73
|
+
>
|
74
|
+
Add Browser / Device
|
75
|
+
</Typography>
|
76
|
+
</div>
|
77
|
+
}
|
78
|
+
childContent={
|
79
|
+
<div className="ff-connecting-modal-child-wrapper">
|
80
|
+
{renderSelectOptions()}
|
81
|
+
</div>
|
82
|
+
}
|
83
|
+
footerContent={renderFooterContent()}
|
84
|
+
cancelButtonProps={{
|
85
|
+
text: 'Cancel',
|
86
|
+
|
87
|
+
// TODO: DEMO PURPOSE AND WILL BE REMOVED IN THE FUTURE
|
88
|
+
onClick: props.onUpdateAddBrowser,
|
89
|
+
}}
|
90
|
+
proceedButtonProps={{
|
91
|
+
text: 'Proceed',
|
92
|
+
// TODO: DEMO PURPOSE AND WILL BE REMOVED IN THE FUTURE
|
93
|
+
onClick: props.onUpdateAddBrowser,
|
94
|
+
}}
|
95
|
+
modalPosition="right"
|
96
|
+
isPopOver
|
97
|
+
leftTopArrow
|
98
|
+
extraRightSpace={{ leftTopArrow: 45 }}
|
99
|
+
extraLeftSpace={{ rightAlignModal: 115 }}
|
100
|
+
{...props}
|
101
|
+
/>
|
102
|
+
</div>
|
103
|
+
);
|
104
|
+
}
|
105
|
+
);
|
106
|
+
|
107
|
+
export default AddBrowserModal;
|