11import React , { useEffect , useState } from 'react'
2- import cx from 'classnames'
32
43import { useDispatch , useSelector } from 'react-redux'
54import { useParams } from 'react-router-dom'
@@ -19,9 +18,9 @@ import DryRunJobTransformations from 'uiSrc/pages/rdi/pipeline-management/compon
1918import { createAxiosError , formatLongName , yamlToJson } from 'uiSrc/utils'
2019import { addErrorNotification } from 'uiSrc/slices/app/notifications'
2120
22- import { Text } from 'uiSrc/components/base/text'
23- import { FlexItem , Row } from 'uiSrc/components/base/layout/flex'
24- import { EmptyButton , IconButton } from 'uiSrc/components/base/forms/buttons'
21+ import { Text , Title } from 'uiSrc/components/base/text'
22+ import { Col , FlexItem , Row } from 'uiSrc/components/base/layout/flex'
23+ import { IconButton } from 'uiSrc/components/base/forms/buttons'
2524import {
2625 PlayFilledIcon ,
2726 CancelSlimIcon ,
@@ -35,7 +34,8 @@ import {
3534 RiSelectOption ,
3635 defaultValueRender ,
3736} from 'uiSrc/components/base/forms/select/RiSelect'
38- import styles from './styles.module.scss'
37+ import { DryRunPanelContainer } from 'uiSrc/pages/rdi/pipeline-management/components/jobs-panel/styles'
38+ import { Button , TextButton } from '@redis-ui/components'
3939
4040export interface Props {
4141 job : string
@@ -157,7 +157,7 @@ const DryRunJobPanel = (props: Props) => {
157157 label : (
158158 < RiTooltip
159159 content = {
160- < Text color = "subdued" size = "s" >
160+ < Text >
161161 Displays the results of the transformations you defined. The data
162162 is presented in JSON format.
163163 < br />
@@ -176,7 +176,7 @@ const DryRunJobPanel = (props: Props) => {
176176 label : (
177177 < RiTooltip
178178 content = {
179- < Text color = "subdued" size = "s" >
179+ < Text >
180180 Displays the list of Redis commands that will be generated based
181181 on your job details.
182182 < br />
@@ -198,91 +198,101 @@ const DryRunJobPanel = (props: Props) => {
198198 }
199199
200200 return (
201- < div
202- className = { cx ( styles . panel , { [ styles . fullScreen ] : isFullScreen } ) }
201+ < DryRunPanelContainer
202+ grow
203+ gap = "xxl"
203204 data-testid = "dry-run-panel"
205+ isFullScreen = { isFullScreen }
204206 >
205- < div className = { styles . panelInner } >
206- < div className = { styles . header } >
207- < Text className = { styles . title } > Test transformation logic</ Text >
208- < div >
209- < IconButton
210- icon = { isFullScreen ? ShrinkIcon : ExtendIcon }
211- aria-label = "toggle fullscrenn dry run panel"
212- className = { styles . fullScreenBtn }
213- onClick = { handleFullScreen }
214- data-testid = "fullScreen-dry-run-btn"
215- />
216- < IconButton
217- icon = { CancelSlimIcon }
218- aria-label = "close dry run panel"
219- className = { styles . closeBtn }
220- onClick = { onClose }
221- data-testid = "close-dry-run-btn"
222- />
223- </ div >
224- </ div >
225- < div className = { styles . body } >
226- < Text className = { styles . text } >
227- Add input data in JSON format to test the transformation logic.
228- </ Text >
229- < div className = { styles . codeLabel } >
230- < Text > Input</ Text >
231- </ div >
207+ { /* Header */ }
208+ < FlexItem >
209+ < Row align = "center" justify = "between" >
210+ < Title size = "L" color = "primary" >
211+ Test transformation logic
212+ </ Title >
213+ < FlexItem >
214+ < Row gap = "s" >
215+ < IconButton
216+ icon = { isFullScreen ? ShrinkIcon : ExtendIcon }
217+ aria-label = "toggle fullscrenn dry run panel"
218+ onClick = { handleFullScreen }
219+ data-testid = "fullScreen-dry-run-btn"
220+ />
221+ < IconButton
222+ icon = { CancelSlimIcon }
223+ aria-label = "close dry run panel"
224+ onClick = { onClose }
225+ data-testid = "close-dry-run-btn"
226+ />
227+ </ Row >
228+ </ FlexItem >
229+ </ Row >
230+ < Text >
231+ Add input data to test the transformation logic.
232+ </ Text >
233+ </ FlexItem >
234+ { /* Input section */ }
235+ < FlexItem >
236+ < Col gap = "s" >
237+ < Title size = "S" color = "primary" >
238+ Input
239+ </ Title >
232240 < MonacoJson
233241 value = { input }
234242 onChange = { setInput }
235243 disabled = { false }
236- wrapperClassName = { styles . inputCode }
237244 data-testid = "input-value"
245+ fullHeight
238246 />
239247 < Row responsive justify = "end" >
240248 < FlexItem >
241249 < RiTooltip
242250 content = { isFormValid ? null : 'Input should have JSON format' }
243251 position = "top"
244252 >
245- < EmptyButton
253+ < TextButton
254+ variant = "primary-inline"
246255 onClick = { handleDryRun }
247- icon = { PlayFilledIcon }
248- iconSide = "right"
249- size = "small"
250256 disabled = { isDryRunning || ! isFormValid }
251- loading = { isDryRunning }
252- className = { cx ( styles . actionBtn , styles . runBtn ) }
253257 data-testid = "dry-run-btn"
254258 >
259+ < Button . Icon icon = { PlayFilledIcon } customSize = "12" />
255260 Dry run
256- </ EmptyButton >
261+ </ TextButton >
257262 </ RiTooltip >
258263 </ FlexItem >
259264 </ Row >
260- < div className = { styles . codeLabel } >
261- { isSelectAvailable && (
262- < RiSelect
263- options = { targetOptions }
264- valueRender = { defaultValueRender }
265- value = { selectedTarget }
266- onChange = { ( value ) => setSelectedTarget ( value ) }
267- data-testid = "target-select"
268- />
269- ) }
265+ </ Col >
266+ </ FlexItem >
267+ { /* Results section */ }
268+ < FlexItem grow >
269+ < Col gap = "m" >
270+ { isSelectAvailable && (
271+ < RiSelect
272+ options = { targetOptions }
273+ valueRender = { defaultValueRender }
274+ value = { selectedTarget }
275+ onChange = { ( value ) => setSelectedTarget ( value ) }
276+ data-testid = "target-select"
277+ />
278+ ) }
279+ < FlexItem grow >
270280 < Tabs
271281 tabs = { tabs }
272282 value = { selectedTab }
273283 onChange = { handleTabChange }
274284 data-testid = "pipeline-jobs-tabs"
275285 />
276- </ div >
277- { selectedTab === PipelineJobsTabs . Transformations && (
278- < DryRunJobTransformations />
279- ) }
280- { selectedTab === PipelineJobsTabs . Output && (
281- < DryRunJobCommands target = { selectedTarget } />
282- ) }
283- </ div >
284- </ div >
285- </ div >
286+ { selectedTab === PipelineJobsTabs . Transformations && (
287+ < DryRunJobTransformations />
288+ ) }
289+ { selectedTab === PipelineJobsTabs . Output && (
290+ < DryRunJobCommands target = { selectedTarget } />
291+ ) }
292+ </ FlexItem >
293+ </ Col >
294+ </ FlexItem >
295+ </ DryRunPanelContainer >
286296 )
287297}
288298
0 commit comments