webpack/scenes/ContentViews/Copy/CopyContentViewForm.js in katello-4.2.2 vs webpack/scenes/ContentViews/Copy/CopyContentViewForm.js in katello-4.3.0.rc1

- old
+ new

@@ -2,10 +2,11 @@ import React, { useState } from 'react'; import useDeepCompareEffect from 'use-deep-compare-effect'; import PropTypes from 'prop-types'; import { useDispatch, useSelector } from 'react-redux'; import { Redirect } from 'react-router-dom'; +import { translate as __ } from 'foremanReact/common/I18n'; import { Form, FormGroup, TextInput, ActionGroup, Button } from '@patternfly/react-core'; import { selectCopyContentViewError, selectCopyContentViews, selectCopyContentViewStatus, } from './ContentViewCopySelectors'; @@ -38,30 +39,41 @@ })); }; if (redirect) { const { id } = response; - return (<Redirect to={`/labs/content_views/${id}`} />); + return (<Redirect to={`/content_views/${id}`} />); } return ( - <Form> - <FormGroup label="Name" isRequired fieldId="name"> + <Form onSubmit={(e) => { + e.preventDefault(); + onSubmit(); + }} + > + <FormGroup label={__('Name')} isRequired fieldId="name"> <TextInput isRequired type="text" id="name" aria-label="input_name" name="name" value={name} - onChange={value => setName(value)} + onChange={setName} /> </FormGroup> <ActionGroup> - <Button aria-label="copy_content_view" variant="primary" isDisabled={saving} onClick={() => onSubmit()}>Copy content view</Button> - <Button variant="link" onClick={() => setModalOpen(false)}>Cancel</Button> + <Button + aria-label="copy_content_view" + variant="primary" + isDisabled={saving} + type="submit" + > + {__('Copy content view')} + </Button> + <Button variant="link" onClick={() => setModalOpen(false)}>{__('Cancel')}</Button> </ActionGroup> - </Form> + </Form > ); }; CopyContentViewForm.propTypes = { cvId: PropTypes.string,