mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[Security Assistant] Knowledge base conflict fix (#195659)
## Summary Fixes on merge fail https://buildkite.com/elastic/kibana-on-merge/builds/51840
This commit is contained in:
parent
8e986a6dd9
commit
1bf3f2a0b0
2 changed files with 19 additions and 2 deletions
|
@ -78,3 +78,20 @@ export const useInvalidateKnowledgeBaseStatus = () => {
|
|||
});
|
||||
}, [queryClient]);
|
||||
};
|
||||
|
||||
/**
|
||||
* Helper for determining if Knowledge Base setup is complete.
|
||||
*
|
||||
* Note: Consider moving to API
|
||||
*
|
||||
* @param kbStatus ReadKnowledgeBaseResponse
|
||||
*/
|
||||
export const isKnowledgeBaseSetup = (kbStatus: ReadKnowledgeBaseResponse | undefined): boolean => {
|
||||
return (
|
||||
(kbStatus?.elser_exists &&
|
||||
kbStatus?.security_labs_exists &&
|
||||
kbStatus?.index_exists &&
|
||||
kbStatus?.pipeline_exists) ??
|
||||
false
|
||||
);
|
||||
};
|
||||
|
|
|
@ -46,7 +46,7 @@ import { useFlyoutModalVisibility } from '../../assistant/common/components/assi
|
|||
import { IndexEntryEditor } from './index_entry_editor';
|
||||
import { DocumentEntryEditor } from './document_entry_editor';
|
||||
import { KnowledgeBaseSettings } from '../knowledge_base_settings';
|
||||
import { ESQL_RESOURCE, SetupKnowledgeBaseButton } from '../setup_knowledge_base_button';
|
||||
import { SetupKnowledgeBaseButton } from '../setup_knowledge_base_button';
|
||||
import { useDeleteKnowledgeBaseEntries } from '../../assistant/api/knowledge_base/entries/use_delete_knowledge_base_entries';
|
||||
import {
|
||||
isSystemEntry,
|
||||
|
@ -73,7 +73,7 @@ export const KnowledgeBaseSettingsManagement: React.FC<Params> = React.memo(({ d
|
|||
toasts,
|
||||
} = useAssistantContext();
|
||||
const [hasPendingChanges, setHasPendingChanges] = useState(false);
|
||||
const { data: kbStatus, isFetched } = useKnowledgeBaseStatus({ http, resource: ESQL_RESOURCE });
|
||||
const { data: kbStatus, isFetched } = useKnowledgeBaseStatus({ http });
|
||||
const isKbSetup = isKnowledgeBaseSetup(kbStatus);
|
||||
|
||||
// Only needed for legacy settings management
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue