From bbb12147d4b4a4d6e42270f95db6068651a5a628 Mon Sep 17 00:00:00 2001 From: Samuel Hassine Date: Tue, 30 Jan 2024 15:00:42 +0100 Subject: [PATCH] [backend/frontend] Fix the analyst workbenches (#5749) --- .../common/files/workbench/WorkbenchFileContent.jsx | 3 ++- .../components/common/files/workbench/WorkbenchFileViewer.jsx | 2 +- .../src/modules/internal/document/document-domain.ts | 1 + .../opencti-graphql/src/resolvers/stixCoreObject.js | 4 ++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/opencti-platform/opencti-front/src/private/components/common/files/workbench/WorkbenchFileContent.jsx b/opencti-platform/opencti-front/src/private/components/common/files/workbench/WorkbenchFileContent.jsx index 7801005727d7..efdc2f641acd 100644 --- a/opencti-platform/opencti-front/src/private/components/common/files/workbench/WorkbenchFileContent.jsx +++ b/opencti-platform/opencti-front/src/private/components/common/files/workbench/WorkbenchFileContent.jsx @@ -4101,6 +4101,7 @@ const WorkbenchFileContentComponent = ({ label={t_i18n('Connector')} fullWidth containerstyle={{ width: '100%' }} + disabled={connectors.filter((n) => n.active).length === 0} > {connectors.map((connector) => ( n.active).length === 0} > {t_i18n('Create')} diff --git a/opencti-platform/opencti-front/src/private/components/common/files/workbench/WorkbenchFileViewer.jsx b/opencti-platform/opencti-front/src/private/components/common/files/workbench/WorkbenchFileViewer.jsx index 06d766c2ee67..1cff61771816 100644 --- a/opencti-platform/opencti-front/src/private/components/common/files/workbench/WorkbenchFileViewer.jsx +++ b/opencti-platform/opencti-front/src/private/components/common/files/workbench/WorkbenchFileViewer.jsx @@ -63,7 +63,7 @@ const WorkbenchFileViewerBase = ({ {t('Analyst workbenches')} setOpenCreate(true)} classes={{ root: classes.createButton }} diff --git a/opencti-platform/opencti-graphql/src/modules/internal/document/document-domain.ts b/opencti-platform/opencti-graphql/src/modules/internal/document/document-domain.ts index 1b7113ab36be..9c62e834e545 100644 --- a/opencti-platform/opencti-graphql/src/modules/internal/document/document-domain.ts +++ b/opencti-platform/opencti-graphql/src/modules/internal/document/document-domain.ts @@ -65,6 +65,7 @@ interface FilesOptions extends EntityOptions { modifiedSince?: string | null prefixMimeTypes?: string[] maxFileSize?: number + isPending?: boolean excludedPaths?: string[] orderBy?: string orderMode?: OrderingMode diff --git a/opencti-platform/opencti-graphql/src/resolvers/stixCoreObject.js b/opencti-platform/opencti-graphql/src/resolvers/stixCoreObject.js index 07f6e5954f18..58f6b863a26b 100644 --- a/opencti-platform/opencti-graphql/src/resolvers/stixCoreObject.js +++ b/opencti-platform/opencti-graphql/src/resolvers/stixCoreObject.js @@ -117,8 +117,8 @@ const stixCoreObjectResolvers = { return paginatedForPathWithEnrichment(context, context.user, `import/${stixCoreObject.entity_type}/${stixCoreObject.id}`, stixCoreObject.id, opts); }, pendingFiles: (stixCoreObject, { first }, context) => { - const opts = { first, entity_type: stixCoreObject.entity_type }; - return paginatedForPathWithEnrichment(context, context.user, `import/pending/${stixCoreObject.entity_type}/${stixCoreObject.id}`, stixCoreObject.id, opts); + const opts = { first, entity_type: stixCoreObject.entity_type, entity_id: stixCoreObject.id }; + return paginatedForPathWithEnrichment(context, context.user, 'import/pending', stixCoreObject.id, opts); }, exportFiles: (stixCoreObject, { first }, context) => { const opts = { first, entity_type: stixCoreObject.entity_type };