@@ -43,12 +43,13 @@ import {
43
43
EuiButton ,
44
44
EuiToolTip ,
45
45
EuiButtonEmpty ,
46
+ EuiPortal ,
46
47
} from '@elastic/eui' ;
47
48
import { FormattedMessage } from '@osd/i18n/react' ;
48
49
import { isEmpty } from 'lodash' ;
49
50
import { i18n } from '@osd/i18n' ;
51
+ import { DocLinksStart , ToastsStart } from 'opensearch-dashboards/public' ;
50
52
import { toMountPoint } from '../../../../../opensearch_dashboards_react/public' ;
51
- import { DocLinksStart , ToastsStart } from '../../../../../../core/public' ;
52
53
53
54
import { getCategoryName } from '../../lib' ;
54
55
import { Field , getEditableValue } from '../field' ;
@@ -335,63 +336,75 @@ export class Form extends PureComponent<FormProps> {
335
336
) ;
336
337
} ;
337
338
338
- renderBottomBar = ( ) => {
339
+ renderNotificationBar = ( ) => {
340
+ const sibling = document . getElementById ( 'globalBannerList' ) ! ;
339
341
const areChangesInvalid = this . areChangesInvalid ( ) ;
342
+
340
343
return (
341
- < EuiBottomBar data-test-subj = "advancedSetting-bottomBar" >
342
- < EuiFlexGroup
343
- justifyContent = "spaceBetween"
344
- alignItems = "center"
345
- responsive = { false }
346
- gutterSize = "s"
347
- >
348
- < EuiFlexItem grow = { false } className = "mgtAdvancedSettingsForm__unsavedCount" >
349
- < p id = "aria-describedby.countOfUnsavedSettings" > { this . renderCountOfUnsaved ( ) } </ p >
350
- </ EuiFlexItem >
351
- < EuiFlexItem />
352
- < EuiFlexItem grow = { false } >
353
- < EuiButtonEmpty
354
- color = "ghost"
355
- size = "s"
356
- iconType = "cross"
357
- onClick = { this . clearAllUnsaved }
358
- aria-describedby = "aria-describedby.countOfUnsavedSettings"
359
- data-test-subj = "advancedSetting-cancelButton"
360
- >
361
- { i18n . translate ( 'advancedSettings.form.cancelButtonLabel' , {
362
- defaultMessage : 'Cancel changes' ,
363
- } ) }
364
- </ EuiButtonEmpty >
365
- </ EuiFlexItem >
366
- < EuiFlexItem grow = { false } >
367
- < EuiToolTip
368
- content = {
369
- areChangesInvalid &&
370
- i18n . translate ( 'advancedSettings.form.saveButtonTooltipWithInvalidChanges' , {
371
- defaultMessage : 'Fix invalid settings before saving.' ,
372
- } )
373
- }
344
+ < EuiPortal insert = { { sibling, position : 'after' } } >
345
+ < div className = "mgtAdvancedSettingsForm__notificationBarMask" >
346
+ < div className = "mgtAdvancedSettingsForm__notificationBarArea" >
347
+ < EuiBottomBar
348
+ data-test-subj = "advancedSetting-bottomBar"
349
+ position = "sticky"
350
+ className = "mgtAdvancedSettingsForm__notificationBar"
374
351
>
375
- < EuiButton
376
- className = "mgtAdvancedSettingsForm__button"
377
- disabled = { areChangesInvalid }
378
- color = "secondary"
379
- fill
380
- size = "s"
381
- iconType = "check"
382
- onClick = { this . saveAll }
383
- aria-describedby = "aria-describedby.countOfUnsavedSettings"
384
- isLoading = { this . state . loading }
385
- data-test-subj = "advancedSetting-saveButton"
352
+ < EuiFlexGroup
353
+ justifyContent = "spaceBetween"
354
+ alignItems = "center"
355
+ responsive = { false }
356
+ gutterSize = "s"
386
357
>
387
- { i18n . translate ( 'advancedSettings.form.saveButtonLabel' , {
388
- defaultMessage : 'Save changes' ,
389
- } ) }
390
- </ EuiButton >
391
- </ EuiToolTip >
392
- </ EuiFlexItem >
393
- </ EuiFlexGroup >
394
- </ EuiBottomBar >
358
+ < EuiFlexItem grow = { false } className = "mgtAdvancedSettingsForm__unsavedCount" >
359
+ < p id = "aria-describedby.countOfUnsavedSettings" > { this . renderCountOfUnsaved ( ) } </ p >
360
+ </ EuiFlexItem >
361
+ < EuiFlexItem />
362
+ < EuiFlexItem grow = { false } >
363
+ < EuiButtonEmpty
364
+ color = "ghost"
365
+ size = "s"
366
+ iconType = "cross"
367
+ onClick = { this . clearAllUnsaved }
368
+ aria-describedby = "aria-describedby.countOfUnsavedSettings"
369
+ data-test-subj = "advancedSetting-cancelButton"
370
+ >
371
+ { i18n . translate ( 'advancedSettings.form.cancelButtonLabel' , {
372
+ defaultMessage : 'Cancel changes' ,
373
+ } ) }
374
+ </ EuiButtonEmpty >
375
+ </ EuiFlexItem >
376
+ < EuiFlexItem grow = { false } >
377
+ < EuiToolTip
378
+ content = {
379
+ areChangesInvalid &&
380
+ i18n . translate ( 'advancedSettings.form.saveButtonTooltipWithInvalidChanges' , {
381
+ defaultMessage : 'Fix invalid settings before saving.' ,
382
+ } )
383
+ }
384
+ >
385
+ < EuiButton
386
+ className = "mgtAdvancedSettingsForm__button"
387
+ disabled = { areChangesInvalid }
388
+ color = "secondary"
389
+ fill
390
+ size = "s"
391
+ iconType = "check"
392
+ onClick = { this . saveAll }
393
+ aria-describedby = "aria-describedby.countOfUnsavedSettings"
394
+ isLoading = { this . state . loading }
395
+ data-test-subj = "advancedSetting-saveButton"
396
+ >
397
+ { i18n . translate ( 'advancedSettings.form.saveButtonLabel' , {
398
+ defaultMessage : 'Save changes' ,
399
+ } ) }
400
+ </ EuiButton >
401
+ </ EuiToolTip >
402
+ </ EuiFlexItem >
403
+ </ EuiFlexGroup >
404
+ </ EuiBottomBar >
405
+ </ div >
406
+ </ div >
407
+ </ EuiPortal >
395
408
) ;
396
409
} ;
397
410
@@ -426,7 +439,7 @@ export class Form extends PureComponent<FormProps> {
426
439
} )
427
440
: this . maybeRenderNoSettings ( clearQuery ) }
428
441
</ div >
429
- { hasUnsavedChanges && this . renderBottomBar ( ) }
442
+ { hasUnsavedChanges && this . renderNotificationBar ( ) }
430
443
</ Fragment >
431
444
) ;
432
445
}
0 commit comments