[8.6] [Enterprise Search] Make sync jobs use filtering array (#146405) (#146426)

# Backport

This will backport the following commits from `main` to `8.6`:
- [[Enterprise Search] Make sync jobs use filtering array
(#146405)](https://github.com/elastic/kibana/pull/146405)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Sander
Philipse","email":"94373878+sphilipse@users.noreply.github.com"},"sourceCommit":{"committedDate":"2022-11-28T16:07:19Z","message":"[Enterprise
Search] Make sync jobs use filtering array (#146405)\n\nThis fixes a bug
where sync jobs were using an object to access the\r\nfiltering property
instead of an
object.","sha":"01a4c7a43d621b3cf9a69de6a23077a4781bbe74","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:EnterpriseSearch","v8.6.0","v8.7.0"],"number":146405,"url":"https://github.com/elastic/kibana/pull/146405","mergeCommit":{"message":"[Enterprise
Search] Make sync jobs use filtering array (#146405)\n\nThis fixes a bug
where sync jobs were using an object to access the\r\nfiltering property
instead of an
object.","sha":"01a4c7a43d621b3cf9a69de6a23077a4781bbe74"}},"sourceBranch":"main","suggestedTargetBranches":["8.6"],"targetPullRequestStates":[{"branch":"8.6","label":"v8.6.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/146405","number":146405,"mergeCommit":{"message":"[Enterprise
Search] Make sync jobs use filtering array (#146405)\n\nThis fixes a bug
where sync jobs were using an object to access the\r\nfiltering property
instead of an
object.","sha":"01a4c7a43d621b3cf9a69de6a23077a4781bbe74"}}]}]
BACKPORT-->

Co-authored-by: Sander Philipse <94373878+sphilipse@users.noreply.github.com>
This commit is contained in:
Kibana Machine 2022-11-28 12:12:32 -05:00 committed by GitHub
parent 5ea653ecf3
commit e7de9cfded
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View file

@ -142,7 +142,7 @@ export interface ConnectorSyncJob {
completed_at: string | null;
connector: {
configuration: ConnectorConfiguration;
filtering: FilteringRules | null;
filtering: FilteringRules[] | null;
id: string;
index_name: string;
language: string;

View file

@ -33,6 +33,7 @@ interface SyncJobFlyoutProps {
}
export const SyncJobFlyout: React.FC<SyncJobFlyoutProps> = ({ onClose, syncJob }) => {
const filtering = syncJob?.connector.filtering ? syncJob.connector.filtering[0] : null;
const visible = !!syncJob;
return visible ? (
<EuiFlyout onClose={onClose}>
@ -88,8 +89,8 @@ export const SyncJobFlyout: React.FC<SyncJobFlyoutProps> = ({ onClose, syncJob }
</EuiFlexItem>
<EuiFlexItem>
<FilteringPanel
advancedSnippet={syncJob.connector?.filtering?.advanced_snippet}
filteringRules={syncJob.connector?.filtering?.rules ?? []}
advancedSnippet={filtering?.advanced_snippet}
filteringRules={filtering?.rules ?? []}
/>
</EuiFlexItem>
{syncJob.connector?.pipeline && (