mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[Cloud Security][BUG] Uneditable policy name field (#159905)
This commit is contained in:
parent
c191104ba1
commit
03392ddc83
2 changed files with 6 additions and 2 deletions
|
@ -257,6 +257,7 @@ const useEnsureDefaultNamespace = ({
|
|||
updatePolicy(policy);
|
||||
}, [newPolicy, input, updatePolicy]);
|
||||
};
|
||||
|
||||
const usePolicyTemplateInitialName = ({
|
||||
isEditPage,
|
||||
isLoading,
|
||||
|
@ -286,11 +287,14 @@ const usePolicyTemplateInitialName = ({
|
|||
if (newPolicy.name === currentIntegrationName) {
|
||||
return;
|
||||
}
|
||||
|
||||
updatePolicy({
|
||||
...newPolicy,
|
||||
name: currentIntegrationName,
|
||||
});
|
||||
}, [isLoading, integration, isEditPage, packagePolicyList, newPolicy, updatePolicy]);
|
||||
// since this useEffect should only run on initial mount updatePolicy and newPolicy shouldn't re-trigger it
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [isLoading, integration, isEditPage, packagePolicyList]);
|
||||
};
|
||||
|
||||
const getSelectedOption = (
|
||||
|
|
|
@ -187,7 +187,7 @@ export const getMaxPackageName = (
|
|||
packageName: string,
|
||||
packagePolicies?: Array<{ name: string }>
|
||||
) => {
|
||||
// Retrieve highest number appended to package policy name and increment it by one
|
||||
// Retrieve the highest number appended to package policy name and increment it by one
|
||||
const pkgPoliciesNamePattern = new RegExp(`${packageName}-(\\d+)`);
|
||||
|
||||
const maxPkgPolicyName = Math.max(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue