Pull request: fix edit static lease
Updates #6534 Squashed commit of the following: commit 1ca6cdc37a865ff0beab2d1f4fb0d44528bd4df3 Author: Ildar Kamalov <ik@adguard.com> Date: Wed Dec 20 15:41:27 2023 +0300 ADG-7889 fix edit static lease
This commit is contained in:
@@ -3,7 +3,7 @@ import { connect } from 'react-redux';
|
||||
import PropTypes from 'prop-types';
|
||||
import ReactTable from 'react-table';
|
||||
import { Trans, withTranslation } from 'react-i18next';
|
||||
import { LEASES_TABLE_DEFAULT_PAGE_SIZE } from '../../../helpers/constants';
|
||||
import { LEASES_TABLE_DEFAULT_PAGE_SIZE, MODAL_TYPE } from '../../../helpers/constants';
|
||||
import { sortIp } from '../../../helpers/helpers';
|
||||
import { toggleLeaseModal } from '../../../actions';
|
||||
|
||||
@@ -18,7 +18,10 @@ class Leases extends Component {
|
||||
|
||||
convertToStatic = (data) => () => {
|
||||
const { dispatch } = this.props;
|
||||
dispatch(toggleLeaseModal(data));
|
||||
dispatch(toggleLeaseModal({
|
||||
type: MODAL_TYPE.ADD_LEASE,
|
||||
config: data,
|
||||
}));
|
||||
}
|
||||
|
||||
makeStatic = ({ row }) => {
|
||||
|
||||
@@ -181,6 +181,7 @@ export const MODAL_TYPE = {
|
||||
ADD_REWRITE: 'ADD_REWRITE',
|
||||
EDIT_REWRITE: 'EDIT_REWRITE',
|
||||
EDIT_LEASE: 'EDIT_LEASE',
|
||||
ADD_LEASE: 'ADD_LEASE',
|
||||
};
|
||||
|
||||
export const CLIENT_ID = {
|
||||
|
||||
@@ -128,7 +128,8 @@ const dhcp = handleActions(
|
||||
const newState = {
|
||||
...state,
|
||||
isModalOpen: !state.isModalOpen,
|
||||
leaseModalConfig: payload,
|
||||
modalType: payload?.type || '',
|
||||
leaseModalConfig: payload?.config,
|
||||
};
|
||||
return newState;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user