Skip to content

Commit

Permalink
[Enterprise Search] Update connector jobs with nested connector (#145251
Browse files Browse the repository at this point in the history
)
  • Loading branch information
sphilipse authored Nov 15, 2022
1 parent 2e7b789 commit aef304e
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 21 deletions.
13 changes: 9 additions & 4 deletions x-pack/plugins/enterprise_search/common/types/connectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,18 +140,23 @@ export interface ConnectorSyncJob {
cancelation_requested_at: string | null;
canceled_at: string | null;
completed_at: string | null;
connector_id: string;
connector: {
configuration: ConnectorConfiguration;
filtering: FilteringRules | null;
id: string;
index_name: string;
language: string;
pipeline: IngestPipelineParams | null;
service_type: string;
};
created_at: string;
deleted_document_count: number;
error: string | null;
filtering: FilteringRules | null;
id: string;
index_name: string;
indexed_document_count: number;
indexed_document_volume: number;
last_seen: string;
metadata: Record<string, unknown>;
pipeline: IngestPipelineParams | null;
started_at: string;
status: SyncStatus;
trigger_method: TriggerMethod;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,26 @@ export const syncJob: ConnectorSyncJob = {
cancelation_requested_at: null,
canceled_at: null,
completed_at: '2022-09-05T15:59:39.816+00:00',
connector_id: 'we2284IBjobuR2-lAuXh',
connector: {
configuration: {},
filtering: null,
id: 'we2284IBjobuR2-lAuXh',
index_name: 'indexName',
language: '',
pipeline: null,
service_type: '',
},
created_at: '2022-09-05T14:59:39.816+00:00',
deleted_document_count: 20,
error: null,
filtering: null,
id: 'id',
index_name: 'indexName',
indexed_document_count: 50,
indexed_document_volume: 40,
last_seen: '2022-09-05T15:59:39.816+00:00',
metadata: {},
pipeline: null,
trigger_method: TriggerMethod.ON_DEMAND,
started_at: '2022-09-05T14:59:39.816+00:00',
status: SyncStatus.COMPLETED,
trigger_method: TriggerMethod.ON_DEMAND,
worker_hostname: 'hostname_fake',
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ export const SyncJobFlyout: React.FC<SyncJobFlyoutProps> = ({ onClose, syncJob }
</EuiFlexItem>
<EuiFlexItem>
<FilteringPanel
advancedSnippet={syncJob.filtering?.advanced_snippet}
filteringRules={syncJob.filtering?.rules ?? []}
advancedSnippet={syncJob.connector?.filtering?.advanced_snippet}
filteringRules={syncJob.connector?.filtering?.rules ?? []}
/>
</EuiFlexItem>
{syncJob.pipeline && (
{syncJob.connector?.pipeline && (
<EuiFlexItem>
<PipelinePanel pipeline={syncJob.pipeline} />
<PipelinePanel pipeline={syncJob.connector.pipeline} />
</EuiFlexItem>
)}
</EuiFlexGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,23 @@ describe('SyncJobsViewLogic', () => {
cancelation_requested_at: null,
canceled_at: null,
completed_at: '2022-09-05T15:59:39.816+00:00',
connector_id: 'we2284IBjobuR2-lAuXh',
connector: {
configuration: {},
filtering: null,
id: 'we2284IBjobuR2-lAuXh',
index_name: 'indexName',
language: 'something',
pipeline: null,
service_type: '',
},
created_at: '2022-09-05T14:59:39.816+00:00',
deleted_document_count: 20,
error: null,
filtering: null,
id: 'id',
index_name: 'indexName',
indexed_document_count: 50,
indexed_document_volume: 40,
last_seen: '2022-09-05T15:59:39.816+00:00',
metadata: {},
pipeline: null,
started_at: '2022-09-05T14:59:39.816+00:00',
status: SyncStatus.COMPLETED,
trigger_method: TriggerMethod.ON_DEMAND,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('fetchSyncJobs lib', () => {
index: '.elastic-connectors-sync-jobs',
query: {
term: {
connector_id: 'id',
'connector.id': 'id',
},
},
size: 10,
Expand Down Expand Up @@ -90,7 +90,7 @@ describe('fetchSyncJobs lib', () => {
index: '.elastic-connectors-sync-jobs',
query: {
term: {
connector_id: 'id',
'connector.id': 'id',
},
},
size: 10,
Expand Down Expand Up @@ -127,7 +127,7 @@ describe('fetchSyncJobs lib', () => {
index: '.elastic-connectors-sync-jobs',
query: {
term: {
connector_id: 'id',
'connector.id': 'id',
},
},
size: 10,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const fetchSyncJobsByConnectorId = async (
index: CONNECTORS_JOBS_INDEX,
query: {
term: {
connector_id: connectorId,
'connector.id': connectorId,
},
},
size,
Expand Down

0 comments on commit aef304e

Please sign in to comment.