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

Bug 1960686: Fix hot loop in global config page #8935

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 5 additions & 6 deletions frontend/public/components/cluster-settings/global-config.tsx
Expand Up @@ -57,12 +57,11 @@ const GlobalConfigPage_: React.FC<GlobalConfigPageProps & GlobalConfigPageExtens
const [textFilter, setTextFilter] = React.useState('');
const { t } = useTranslation();

const oauthMenuItems = _.map(addIDPItems, (label: string, id: string) => ({
label: t('public~{{label}}', { label }),
href: `/settings/idp/${id}`,
}));

React.useEffect(() => {
const oauthMenuItems = _.map(addIDPItems, (label: string, id: string) => ({
label: t('public~{{label}}', { label }),
href: `/settings/idp/${id}`,
}));
const editYAMLMenuItem = (name: string, resourceLink: string) => ({
label: t('global-config~Edit {{name}} resource', { name }),
href: `${resourceLink}/yaml`,
Expand Down Expand Up @@ -134,7 +133,7 @@ const GlobalConfigPage_: React.FC<GlobalConfigPageProps & GlobalConfigPageExtens
}
});
return () => (isSubscribed = false);
}, [configResources, errors, globalConfigs, oauthMenuItems, t]);
}, [configResources, globalConfigs, t]);
const visibleItems = items.filter(({ label, description = '' }) => {
return (
fuzzyCaseInsensitive(textFilter, label) ||
Expand Down