diff --git a/webpack/assets/javascripts/react_app/components/Editor/__tests__/integration.test.js b/webpack/assets/javascripts/react_app/components/Editor/__tests__/integration.test.js index 98d9bd3d83d..bc30f74c525 100644 --- a/webpack/assets/javascripts/react_app/components/Editor/__tests__/integration.test.js +++ b/webpack/assets/javascripts/react_app/components/Editor/__tests__/integration.test.js @@ -41,6 +41,6 @@ describe('Editor integration test', () => { maximizeBtn.simulate('click'); integrationTestHelper.takeStoreAndLastActionSnapshot('entered fullscreen'); - expect(component.find('.editor-modal.in').length).toBeGreaterThan(0); + expect(component.find('.editor-modal').length).toBeGreaterThan(0); }); }); diff --git a/webpack/assets/javascripts/react_app/components/Editor/components/EditorModal.js b/webpack/assets/javascripts/react_app/components/Editor/components/EditorModal.js index 90b40860c36..693b9c420bd 100644 --- a/webpack/assets/javascripts/react_app/components/Editor/components/EditorModal.js +++ b/webpack/assets/javascripts/react_app/components/Editor/components/EditorModal.js @@ -1,5 +1,5 @@ import React from 'react'; -import { Modal, Icon, Button } from 'patternfly-react'; +import { Modal, Title } from '@patternfly/react-core'; import PropTypes from 'prop-types'; import EditorView from './EditorView'; @@ -26,27 +26,32 @@ const EditorModal = ({ liveAutocompletion, title, toggleModal, -}) => ( - - -

{title}

- +}) => { + const header = ( +
+ + {title} + {selectedView === 'diff' && ( changeDiffViewType(viewType)} /> )} - - +
+ ); + return ( + {selectedView === 'diff' ? (
)} - - -); + + ); +}; EditorModal.propTypes = { changeDiffViewType: PropTypes.func.isRequired, diff --git a/webpack/assets/javascripts/react_app/components/Editor/components/__tests__/__snapshots__/EditorModal.test.js.snap b/webpack/assets/javascripts/react_app/components/Editor/components/__tests__/__snapshots__/EditorModal.test.js.snap index 1931b507466..17d79cfab2c 100644 --- a/webpack/assets/javascripts/react_app/components/Editor/components/__tests__/__snapshots__/EditorModal.test.js.snap +++ b/webpack/assets/javascripts/react_app/components/Editor/components/__tests__/__snapshots__/EditorModal.test.js.snap @@ -2,152 +2,102 @@ exports[`EditorModal should render renders EditorModal diff 1`] = ` - -

- - - - + actions={Array []} + appendTo={[Function]} + aria-describedby="" + aria-label="" + aria-labelledby="editor-modal-h4" + className="diff monokai editor-modal" + hasNoBodyWrapper={false} + header={
- + + +
-
+ } + id="editor-modal" + isOpen={false} + onClose={[Function]} + ouiaId="editor-modal-component" + ouiaSafe={true} + position="top" + showClose={true} + title="" + titleIconVariant={null} + titleLabel="" + variant="primary" +> +
+ +
`; exports[`EditorModal should render renders EditorModal editor 1`] = ` + + + +

} - onHide={[Function]} - renderBackdrop={[Function]} - restoreFocus={true} - show={false} + id="editor-modal" + isOpen={false} + onClose={[Function]} + ouiaId="editor-modal-component" + ouiaSafe={true} + position="top" + showClose={true} + title="" + titleIconVariant={null} + titleLabel="" + variant="primary" > - -

- - - - - + `; diff --git a/webpack/assets/javascripts/react_app/components/Editor/editor.scss b/webpack/assets/javascripts/react_app/components/Editor/editor.scss index 993c931a59c..c3129ca00df 100644 --- a/webpack/assets/javascripts/react_app/components/Editor/editor.scss +++ b/webpack/assets/javascripts/react_app/components/Editor/editor.scss @@ -25,71 +25,40 @@ } } +#editor-modal{ + margin: 15px; + max-width: unset; +} + .editor-modal { - .modal-content { - height: -webkit-fill-available; + .pf-c-modal-box__body{ + padding: 0; } - .modal-header { - #diff-toggle-buttons { - margin-bottom: unset; - margin-right: 15px; - - button { - outline: none; - } - } - - #editor-modal-h4 { - margin-top: 4px; - margin-bottom: 0; - float: left; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - max-width: 700px; - } + .pf-c-modal-box__header{ + margin-right: 0; + padding-bottom: 10px; + padding-top: 10px; } + .pf-c-button.pf-m-plain{ + top: 7px; + } +} - .modal-dialog { - padding: 15px; - width: auto !important; - - .input.modal-body { - background-color: #363636; - } - - .modal-body { - padding: 0; - overflow: auto; - height: 100%; +.monokai:not(.diff) { - .ace_editor { - border: none !important; - } + header { + background-color: var(--pf-v5-global--palette--black-800); - #diff-table { - max-height: 80vh; - - div { - border: none; - } - } + h4 { + color: var(--pf-v5-global--palette--white); } + } - .input.modal-header.monokai, - .preview.modal-header.monokai { - background-color: #363636; - - h4 { - color: #fff; - } - - .pficon-close { - color: #fff; - } - } + button { + color: var(--pf-v5-global--palette--white); } + } .navbar-editor {