},
] as const;
+ const [samlDefinitions, githubDefinitions] = React.useMemo(
+ () => [
+ definitions.filter((def) => def.subCategory === SAML),
+ definitions.filter((def) => def.subCategory === AlmKeys.GitHub),
+ ],
+ [definitions],
+ );
+
return (
<>
<header className="page-header">
id={getTabPanelId(tab.key)}
>
<div className="big-padded-top big-padded-left big-padded-right">
- {tab.key === SAML && (
- <SamlAuthenticationTab
- definitions={definitions.filter((def) => def.subCategory === SAML)}
- />
- )}
+ {tab.key === SAML && <SamlAuthenticationTab definitions={samlDefinitions} />}
{tab.key === AlmKeys.GitHub && (
<GithubAuthenticationTab
currentTab={currentTab}
- definitions={definitions.filter((def) => def.subCategory === AlmKeys.GitHub)}
+ definitions={githubDefinitions}
/>
)}
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
-import { isEqual } from 'lodash';
import { getValue, getValues, resetSettingValue, setSettingValue } from '../api/settings';
import { ExtendedSettingDefinition } from '../types/settings';
type SettingValue = string | boolean | string[];
export function useGetValuesQuery(keys: string[]) {
- return useQuery(
- ['settings', 'values', keys] as const,
- ({ queryKey: [_a, _b, keys] }) => {
- return getValues({ keys });
- },
- { structuralSharing: (prev, next) => (isEqual(prev, next) ? prev : next) },
- );
+ return useQuery(['settings', 'values', keys] as const, ({ queryKey: [_a, _b, keys] }) => {
+ return getValues({ keys });
+ });
}
export function useGetValueQuery(key: string) {