@@ -14,6 +14,9 @@ import {
1414 FormGroup ,
1515 HelperText ,
1616 HelperTextItem ,
17+ Modal ,
18+ ModalBody ,
19+ ModalHeader ,
1720 Slider ,
1821 SliderOnChangeEvent ,
1922 Spinner ,
@@ -28,7 +31,6 @@ import {
2831} from '../redux-actions' ;
2932import { State } from '../redux-reducers' ;
3033import CopyAction from './CopyAction' ;
31- import Modal from './Modal' ;
3234
3335const DEFAULT_MAX_EVENTS = 10 ;
3436
@@ -128,60 +130,63 @@ const AttachEventsModal: React.FC<Props> = ({ isOpen, kind, name, namespace, onC
128130 ) ;
129131
130132 return (
131- < Modal isOpen = { isOpen } onClose = { onClose } title = { t ( 'Configure events attachment' ) } >
132- < Content component = "p" >
133- { t (
134- 'You can specify the most recent number of events from this resource to include as an attachment for detailed troubleshooting and analysis.' ,
135- ) }
136- </ Content >
137- < Form >
138- { isLoading && < Spinner size = "md" /> }
139- { ! isLoading &&
140- ( events . length === 0 ? (
141- < HelperText >
142- < HelperTextItem > { t ( 'No events' ) } </ HelperTextItem >
143- </ HelperText >
144- ) : (
145- < >
146- < FormGroup label = { t ( 'Most recent {{numEvents}} events' , { numEvents } ) } >
147- < Slider
148- max = { events . length }
149- min = { 1 }
150- onChange = { onInputNumEventsChange }
151- showTicks = { events . length <= 40 }
152- value = { numEvents }
153- />
154- </ FormGroup >
155- < CodeBlock
156- actions = {
157- < >
158- < CodeBlockAction />
159- < CodeBlockAction >
160- < CopyAction value = { yaml } />
161- </ CodeBlockAction >
162- </ >
163- }
164- className = "ols-plugin__code-block ols-plugin__code-block--preview"
165- >
166- < CodeBlockCode
167- className = "ols-plugin__code-block-code"
168- style = { { whiteSpace : 'pre' } }
133+ < Modal isOpen = { isOpen } onClose = { onClose } variant = "small" >
134+ < ModalHeader title = { t ( 'Configure events attachment' ) } />
135+ < ModalBody >
136+ < Content component = "p" >
137+ { t (
138+ 'You can specify the most recent number of events from this resource to include as an attachment for detailed troubleshooting and analysis.' ,
139+ ) }
140+ </ Content >
141+ < Form >
142+ { isLoading && < Spinner size = "md" /> }
143+ { ! isLoading &&
144+ ( events . length === 0 ? (
145+ < HelperText >
146+ < HelperTextItem > { t ( 'No events' ) } </ HelperTextItem >
147+ </ HelperText >
148+ ) : (
149+ < >
150+ < FormGroup label = { t ( 'Most recent {{numEvents}} events' , { numEvents } ) } >
151+ < Slider
152+ max = { events . length }
153+ min = { 1 }
154+ onChange = { onInputNumEventsChange }
155+ showTicks = { events . length <= 40 }
156+ value = { numEvents }
157+ />
158+ </ FormGroup >
159+ < CodeBlock
160+ actions = {
161+ < >
162+ < CodeBlockAction />
163+ < CodeBlockAction >
164+ < CopyAction value = { yaml } />
165+ </ CodeBlockAction >
166+ </ >
167+ }
168+ className = "ols-plugin__code-block ols-plugin__code-block--preview"
169169 >
170- { yaml }
171- </ CodeBlockCode >
172- </ CodeBlock >
173- </ >
174- ) ) }
175- { error && < Error title = { t ( 'Failed to load events' ) } > { error } </ Error > }
176- < ActionGroup >
177- < Button isDisabled = { numEvents < 1 } onClick = { onSubmit } type = "submit" variant = "primary" >
178- { t ( 'Attach' ) }
179- </ Button >
180- < Button onClick = { onClose } type = "submit" variant = "link" >
181- { t ( 'Cancel' ) }
182- </ Button >
183- </ ActionGroup >
184- </ Form >
170+ < CodeBlockCode
171+ className = "ols-plugin__code-block-code"
172+ style = { { whiteSpace : 'pre' } }
173+ >
174+ { yaml }
175+ </ CodeBlockCode >
176+ </ CodeBlock >
177+ </ >
178+ ) ) }
179+ { error && < Error title = { t ( 'Failed to load events' ) } > { error } </ Error > }
180+ < ActionGroup >
181+ < Button isDisabled = { numEvents < 1 } onClick = { onSubmit } type = "submit" variant = "primary" >
182+ { t ( 'Attach' ) }
183+ </ Button >
184+ < Button onClick = { onClose } type = "submit" variant = "link" >
185+ { t ( 'Cancel' ) }
186+ </ Button >
187+ </ ActionGroup >
188+ </ Form >
189+ </ ModalBody >
185190 </ Modal >
186191 ) ;
187192} ;
0 commit comments