Skip to content

Commit

Permalink
Move ELSER text expansion callout's code (elastic#171678)
Browse files Browse the repository at this point in the history
## Summary

Move ELSER text expansion callout's code into a subfolder
  • Loading branch information
Mikep86 authored Nov 22, 2023
1 parent 8eaebb6 commit a9c41e5
Show file tree
Hide file tree
Showing 17 changed files with 33 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import { InferenceConfiguration } from './inference_config';
import { EMPTY_PIPELINE_CONFIGURATION, MLInferenceLogic } from './ml_inference_logic';
import { MlModelSelectOption } from './model_select_option';
import { PipelineSelectOption } from './pipeline_select_option';
import { TextExpansionCallOut } from './text_expansion_callout';
import { TextExpansionCallOut } from './text_expansion_callout/text_expansion_callout';
import { MODEL_REDACTED_VALUE, MODEL_SELECT_PLACEHOLDER } from './utils';

const MODEL_SELECT_PLACEHOLDER_VALUE = 'model_placeholder$$';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { setMockValues } from '../../../../../__mocks__/kea_logic';
import { setMockValues } from '../../../../../../__mocks__/kea_logic';

import React from 'react';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
import { i18n } from '@kbn/i18n';
import { FormattedMessage, FormattedHTMLMessage } from '@kbn/i18n-react';

import { docLinks } from '../../../../../shared/doc_links';
import { docLinks } from '../../../../../../shared/doc_links';

import { TextExpansionCallOutState, TextExpansionDismissButton } from './text_expansion_callout';
import { TextExpansionCalloutLogic } from './text_expansion_callout_logic';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { setMockValues } from '../../../../../__mocks__/kea_logic';
import { setMockValues } from '../../../../../../__mocks__/kea_logic';

import React from 'react';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { setMockValues } from '../../../../../__mocks__/kea_logic';
import { setMockValues } from '../../../../../../__mocks__/kea_logic';

import React from 'react';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { setMockValues } from '../../../../../__mocks__/kea_logic';
import { setMockValues } from '../../../../../../__mocks__/kea_logic';

import React from 'react';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ import {
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';

import { KibanaLogic } from '../../../../../shared/kibana';
import { KibanaLogic } from '../../../../../../shared/kibana';

import { TRAINED_MODELS_PATH } from '../utils';

import {
TextExpansionCallOutState,
TextExpansionDismissButton,
FineTuneModelsButton,
} from './text_expansion_callout';
import { TRAINED_MODELS_PATH } from './utils';

export const ModelStarted = ({
dismiss,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { setMockValues } from '../../../../../__mocks__/kea_logic';
import { setMockValues } from '../../../../../../__mocks__/kea_logic';

import React from 'react';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ import { useValues } from 'kea';
import { EuiButtonEmpty, EuiButtonIcon } from '@elastic/eui';
import { i18n } from '@kbn/i18n';

import { KibanaLogic } from '../../../../../shared/kibana';
import { IndexViewLogic } from '../../index_view_logic';
import { KibanaLogic } from '../../../../../../shared/kibana';
import { IndexViewLogic } from '../../../index_view_logic';

import { TRAINED_MODELS_PATH } from '../utils';

import { DeployModel } from './deploy_model';
import { ModelDeployed } from './model_deployed';
Expand All @@ -22,7 +24,6 @@ import { ModelStarted } from './model_started';
import { useTextExpansionCallOutData } from './text_expansion_callout_data';
import { TextExpansionCalloutLogic } from './text_expansion_callout_logic';
import { TextExpansionErrors } from './text_expansion_errors';
import { TRAINED_MODELS_PATH } from './utils';

export interface TextExpansionCallOutState {
dismiss: () => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { useCallback, useEffect, useState } from 'react';

import { useValues } from 'kea';

import { IndexViewLogic } from '../../index_view_logic';
import { IndexViewLogic } from '../../../index_view_logic';

import { TextExpansionCallOutProps, TextExpansionCallOutState } from './text_expansion_callout';
import { TextExpansionCalloutLogic } from './text_expansion_callout_logic';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
* 2.0.
*/

import { LogicMounter } from '../../../../../__mocks__/kea_logic';
import { LogicMounter } from '../../../../../../__mocks__/kea_logic';

import { HttpResponse } from '@kbn/core/public';

import { ErrorResponse, HttpError, Status } from '../../../../../../../common/types/api';
import { MlModelDeploymentState } from '../../../../../../../common/types/ml';
import { CreateTextExpansionModelApiLogic } from '../../../../api/ml_models/text_expansion/create_text_expansion_model_api_logic';
import { FetchTextExpansionModelApiLogic } from '../../../../api/ml_models/text_expansion/fetch_text_expansion_model_api_logic';
import { StartTextExpansionModelApiLogic } from '../../../../api/ml_models/text_expansion/start_text_expansion_model_api_logic';
import { ErrorResponse, HttpError, Status } from '../../../../../../../../common/types/api';
import { MlModelDeploymentState } from '../../../../../../../../common/types/ml';
import { CreateTextExpansionModelApiLogic } from '../../../../../api/ml_models/text_expansion/create_text_expansion_model_api_logic';
import { FetchTextExpansionModelApiLogic } from '../../../../../api/ml_models/text_expansion/fetch_text_expansion_model_api_logic';
import { StartTextExpansionModelApiLogic } from '../../../../../api/ml_models/text_expansion/start_text_expansion_model_api_logic';

import {
getTextExpansionError,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,26 @@ import { kea, MakeLogicType } from 'kea';

import { i18n } from '@kbn/i18n';

import { HttpError, Status } from '../../../../../../../common/types/api';
import { MlModelDeploymentState } from '../../../../../../../common/types/ml';
import { getErrorsFromHttpResponse } from '../../../../../shared/flash_messages/handle_api_errors';
import { HttpError, Status } from '../../../../../../../../common/types/api';
import { MlModelDeploymentState } from '../../../../../../../../common/types/ml';
import { getErrorsFromHttpResponse } from '../../../../../../shared/flash_messages/handle_api_errors';

import { KibanaLogic } from '../../../../../shared/kibana';
import { KibanaLogic } from '../../../../../../shared/kibana';

import {
CreateTextExpansionModelApiLogic,
CreateTextExpansionModelApiLogicActions,
CreateTextExpansionModelResponse,
} from '../../../../api/ml_models/text_expansion/create_text_expansion_model_api_logic';
} from '../../../../../api/ml_models/text_expansion/create_text_expansion_model_api_logic';
import {
FetchTextExpansionModelApiLogic,
FetchTextExpansionModelApiLogicActions,
FetchTextExpansionModelResponse,
} from '../../../../api/ml_models/text_expansion/fetch_text_expansion_model_api_logic';
} from '../../../../../api/ml_models/text_expansion/fetch_text_expansion_model_api_logic';
import {
StartTextExpansionModelApiLogic,
StartTextExpansionModelApiLogicActions,
} from '../../../../api/ml_models/text_expansion/start_text_expansion_model_api_logic';
} from '../../../../../api/ml_models/text_expansion/start_text_expansion_model_api_logic';

const FETCH_TEXT_EXPANSION_MODEL_POLLING_DURATION = 5000; // 5 seconds
const FETCH_TEXT_EXPANSION_MODEL_POLLING_DURATION_ON_FAILURE = 30000; // 30 seconds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { setMockValues } from '../../../../../__mocks__/kea_logic';
import { setMockValues } from '../../../../../../__mocks__/kea_logic';

import React from 'react';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import { EuiCallOut, EuiLink } from '@elastic/eui';

import { i18n } from '@kbn/i18n';

import { HttpLogic } from '../../../../../shared/http';
import { HttpLogic } from '../../../../../../shared/http';

import { SendEnterpriseSearchTelemetry } from '../../../../../shared/telemetry';
import { ML_NOTIFICATIONS_PATH } from '../../../../routes';
import { SendEnterpriseSearchTelemetry } from '../../../../../../shared/telemetry';
import { ML_NOTIFICATIONS_PATH } from '../../../../../routes';

export const TextExpansionErrors = ({ error }: { error: { title: string; message: string } }) => {
const { http } = useValues(HttpLogic);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { IndexNameLogic } from '../index_name_logic';

import { InferencePipelineCard } from './inference_pipeline_card';
import { AddMLInferencePipelineButton } from './ml_inference/add_ml_inference_button';
import { TextExpansionCallOut } from './ml_inference/text_expansion_callout';
import { TextExpansionCallOut } from './ml_inference/text_expansion_callout/text_expansion_callout';
import { PipelinesLogic } from './pipelines_logic';

export const MlInferencePipelineProcessorsCard: React.FC = () => {
Expand Down

0 comments on commit a9c41e5

Please sign in to comment.