Skip to content

Commit

Permalink
addressing comments made on 12/19
Browse files Browse the repository at this point in the history
Signed-off-by: Kama Huang <[email protected]>
  • Loading branch information
Kama Huang committed Dec 20, 2024
1 parent d66d230 commit 9999d01
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 35 deletions.
23 changes: 13 additions & 10 deletions common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,17 +286,20 @@ export const MULTIMODAL_SEARCH_QUERY_NEURAL = {
},
};
export const MULTIMODAL_SEARCH_QUERY_BOOL = {
_source: {
excludes: [VECTOR_FIELD_PATTERN],
},
query: {
neural: {
[VECTOR_FIELD_PATTERN]: {
query_text: QUERY_TEXT_PATTERN,
query_image: QUERY_IMAGE_PATTERN,
model_id: MODEL_ID_PATTERN,
k: DEFAULT_K,
},
bool: {
must: [
{
match: {
[TEXT_FIELD_PATTERN]: QUERY_TEXT_PATTERN,
},
},
{
match: {
[IMAGE_FIELD_PATTERN]: QUERY_IMAGE_PATTERN,
},
},
],
},
},
};
Expand Down
2 changes: 1 addition & 1 deletion opensearch_dashboards.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "flowFrameworkDashboards",
"version": "2.19.0.0",
"opensearchDashboardsVersion": "2.18.0",
"opensearchDashboardsVersion": "2.19.0",
"server": true,
"ui": true,
"requiredBundles": [],
Expand Down
2 changes: 1 addition & 1 deletion public/pages/workflow_detail/components/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export function WorkflowDetailHeader(props: WorkflowDetailHeaderProps) {

// get & render the data source component, if applicable
let DataSourceComponent: ReactElement | null = null;
if (dataSourceEnabled && getDataSourceManagementPlugin()) {
if (dataSourceEnabled && getDataSourceManagementPlugin() && dataSourceId) {
const DataSourceMenu = getDataSourceManagementPlugin().ui.getDataSourceMenu<
DataSourceViewConfig
>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,9 @@ import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { ProcessorsList } from '../processors_list';
import { PROCESSOR_CONTEXT, WorkflowConfig } from '../../../../../common';
import { ProcessorsTitle } from '../../../../general_components';
import { SavedObject } from '../../../../../../../src/core/public';
import { DataSourceAttributes } from '../../../../../../../src/plugins/data_source/common/data_sources';

interface EnrichDataProps {
uiConfig: WorkflowConfig;
setUiConfig: (uiConfig: WorkflowConfig) => void;
dataSource?: SavedObject<DataSourceAttributes>;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@ export function IngestInputs(props: IngestInputsProps) {
<EuiHorizontalRule margin="none" />
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EnrichData
uiConfig={props.uiConfig}
setUiConfig={props.setUiConfig}
dataSource={(props.workflow as any)?.dataSource}
/>
<EnrichData uiConfig={props.uiConfig} setUiConfig={props.setUiConfig} />
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiHorizontalRule margin="none" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ interface ProcessorsListProps {
uiConfig: WorkflowConfig;
setUiConfig: (uiConfig: WorkflowConfig) => void;
context: PROCESSOR_CONTEXT;
onProcessorsChange?: (count: number) => void;
}

const PANEL_ID = 0;
Expand Down Expand Up @@ -95,7 +94,6 @@ export function ProcessorsList(props: ProcessorsListProps) {
: props.uiConfig.search.enrichResponse.processors;

setProcessors(currentProcessors || []);
props.onProcessorsChange?.(currentProcessors?.length || 0);
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,10 @@ import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { ProcessorsTitle } from '../../../../general_components';
import { PROCESSOR_CONTEXT, WorkflowConfig } from '../../../../../common';
import { ProcessorsList } from '../processors_list';
import { SavedObject } from '../../../../../../../src/core/public';
import { DataSourceAttributes } from '../../../../../../../src/plugins/data_source/common/data_sources';

interface EnrichSearchRequestProps {
uiConfig: WorkflowConfig;
setUiConfig: (uiConfig: WorkflowConfig) => void;
dataSource?: SavedObject<DataSourceAttributes>;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,10 @@ import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { ProcessorsTitle } from '../../../../general_components';
import { PROCESSOR_CONTEXT, WorkflowConfig } from '../../../../../common';
import { ProcessorsList } from '../processors_list';
import { SavedObject } from '../../../../../../../src/core/public';
import { DataSourceAttributes } from '../../../../../../../src/plugins/data_source/common/data_sources';

interface EnrichSearchResponseProps {
uiConfig: WorkflowConfig;
setUiConfig: (uiConfig: WorkflowConfig) => void;
dataSource?: SavedObject<DataSourceAttributes>;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,10 @@ import {
} from '../../../../../common';
import { catIndices, useAppDispatch } from '../../../../store';
import { getDataSourceId } from '../../../../utils';
import { SavedObject } from '../../../../../../../src/core/public';
import { DataSourceAttributes } from '../../../../../../../src/plugins/data_source/common/data_sources';

interface SearchInputsProps {
uiConfig: WorkflowConfig;
setUiConfig: (uiConfig: WorkflowConfig) => void;
dataSource?: SavedObject<DataSourceAttributes>;
}

/**
Expand Down Expand Up @@ -48,7 +45,6 @@ export function SearchInputs(props: SearchInputsProps) {
<EnrichSearchRequest
uiConfig={props.uiConfig}
setUiConfig={props.setUiConfig}
dataSource={props.dataSource}
/>
</EuiFlexItem>
<EuiFlexItem grow={false}>
Expand All @@ -58,7 +54,6 @@ export function SearchInputs(props: SearchInputsProps) {
<EnrichSearchResponse
uiConfig={props.uiConfig}
setUiConfig={props.setUiConfig}
dataSource={props.dataSource}
/>
</EuiFlexItem>
</EuiFlexGroup>
Expand Down
1 change: 0 additions & 1 deletion public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import {
setHeaderActionMenu,
} from './services';
import { configureRoutes } from './route_service';
import { dataSourceFilterFn } from './utils';

export class FlowFrameworkDashboardsPlugin
implements
Expand Down

0 comments on commit 9999d01

Please sign in to comment.