Skip to content

Commit

Permalink
Merge pull request #822 from ashera96/endpoints-ui-fix
Browse files Browse the repository at this point in the history
Fix Endpoints UI crash issue when configuring load balanced/failover endpoints
  • Loading branch information
ashera96 authored Oct 22, 2024
2 parents 756f377 + 4c26345 commit 3e2f550
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
InputAdornment,
TextField,
} from '@mui/material';
import { FormattedMessage } from 'react-intl';
import { FormattedMessage, useIntl } from 'react-intl';
import PropTypes from 'prop-types';
import { isRestricted } from 'AppData/AuthManager';
import APIContext from 'AppComponents/Apis/Details/components/ApiContext';
Expand Down Expand Up @@ -74,10 +74,10 @@ function GenericEndpointAdd(props) {
addEndpoint,
endpointType,
category,
intl,
} = props;
const [serviceUrl, setServiceUrl] = useState('');
const { api } = useContext(APIContext);
const intl = useIntl();

/**
* The method to handle endpoint add button click action.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import {
Dialog,
DialogContent,
DialogTitle,
Accordion,
AccordionSummary,
Accordion,
AccordionSummary,
AccordionDetails,
Grid,
Icon,
Expand All @@ -32,7 +32,7 @@ import {
} from '@mui/material';
import PropTypes from 'prop-types';
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
import { FormattedMessage, injectIntl } from 'react-intl';
import { FormattedMessage, useIntl } from 'react-intl';
import cloneDeep from 'lodash.clonedeep';
import { isRestricted } from 'AppData/AuthManager';
import APIContext from 'AppComponents/Apis/Details/components/ApiContext';
Expand Down Expand Up @@ -134,12 +134,12 @@ function LoadbalanceFailoverConfig(props) {
toggleESConfig,
globalEpType,
handleEndpointCategorySelect,
intl,
} = props;
const { api } = useContext(APIContext);
const [isConfigExpanded, setConfigExpand] = useState(false);
const [endpointType, setEndpointType] = useState(props);
const [isLBConfigOpen, setLBConfigOpen] = useState(false);
const intl = useIntl();

const endpointTypes = [
{
Expand Down Expand Up @@ -456,7 +456,6 @@ LoadbalanceFailoverConfig.propTypes = {
toggleESConfig: PropTypes.func.isRequired,
handleEndpointCategorySelect: PropTypes.func.isRequired,
globalEpType: PropTypes.shape({}).isRequired,
intl: PropTypes.shape({}).isRequired,
};

export default injectIntl((LoadbalanceFailoverConfig));
export default LoadbalanceFailoverConfig;

0 comments on commit 3e2f550

Please sign in to comment.