Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Endpoints UI crash issue when configuring load balanced/failover endpoints #822

Merged
merged 1 commit into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
Loading