mirror of
https://github.com/langgenius/dify.git
synced 2026-06-27 07:12:31 +08:00
fix: public and Knowledge no mask
This commit is contained in:
parent
d764b16d06
commit
31ee7bb467
@ -306,6 +306,19 @@ describe('AgentConfigurePublishBar', () => {
|
||||
expect(onPublish).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('should keep published state when the published detail updates before the active snapshot is refreshed', () => {
|
||||
renderPublishBar({
|
||||
activeConfigIsPublished: true,
|
||||
activeConfigSnapshot: null,
|
||||
})
|
||||
|
||||
expect(screen.getByText('agentV2.agentDetail.configure.publishBar.upToDate')).toBeInTheDocument()
|
||||
expect(screen.getByRole('button', { name: 'agentV2.agentDetail.configure.publishBar.published' })).toBeDisabled()
|
||||
expect(hotkeyRegistrations.get('Mod+Shift+P')?.options).toEqual(
|
||||
expect.objectContaining({ enabled: false, ignoreInputs: false }),
|
||||
)
|
||||
})
|
||||
|
||||
it('should initialize unpublished state when active config is not published', async () => {
|
||||
const { onPublish } = renderPublishBar({
|
||||
activeConfigIsPublished: false,
|
||||
|
||||
@ -227,7 +227,11 @@ export function AgentKnowledgeRetrievalDialog({
|
||||
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={onOpenChange}>
|
||||
<DialogContent className="flex h-[520px] max-h-[calc(100dvh-2rem)] w-[400px] flex-col overflow-hidden p-0">
|
||||
<DialogContent
|
||||
backdropProps={{ forceRender: true }}
|
||||
backdropClassName="fixed"
|
||||
className="flex h-[520px] max-h-[calc(100dvh-2rem)] w-[400px] flex-col overflow-hidden p-0"
|
||||
>
|
||||
<DialogTitle className="sr-only">
|
||||
{t('agentDetail.configure.knowledgeRetrieval.dialog.title')}
|
||||
</DialogTitle>
|
||||
|
||||
@ -63,7 +63,7 @@ function getPublishState({
|
||||
return 'publishing'
|
||||
|
||||
if (!activeConfigSnapshot)
|
||||
return 'draft'
|
||||
return activeConfigIsPublished ? 'published' : 'draft'
|
||||
|
||||
if (!activeConfigIsPublished || isDirty)
|
||||
return 'unpublished'
|
||||
|
||||
Loading…
Reference in New Issue
Block a user