Skip to content

Commit

Permalink
fix ts issues
Browse files Browse the repository at this point in the history
  • Loading branch information
darnautov committed Oct 18, 2021
1 parent 75a7663 commit d08e6fd
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { Storage } from '../../../../../../src/plugins/kibana_utils/public';
import type { AppDependencies } from '../app_dependencies';
import { MlSharedContext } from './shared_context';
import type { GetMlSharedImportsReturnType } from '../../shared_imports';
import type { TriggersAndActionsUIPublicPluginStart } from '../../../../triggers_actions_ui/public';

const coreSetup = coreMock.createSetup();
const coreStart = coreMock.createStart();
Expand All @@ -43,6 +44,7 @@ const appDependencies: AppDependencies = {
savedObjectsPlugin: savedObjectsPluginMock.createStartContract(),
share: { urlGenerators: { getUrlGenerator: jest.fn() } } as unknown as SharePluginStart,
ml: {} as GetMlSharedImportsReturnType,
triggersActionsUi: {} as jest.Mocked<TriggersAndActionsUIPublicPluginStart>,
};

export const useAppDependencies = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
} from '@elastic/eui';

import { APP_CREATE_TRANSFORM_CLUSTER_PRIVILEGES } from '../../../../common/constants';
import { TransformPivotConfig } from '../../../../common/types/transform';
import { TransformConfigUnion } from '../../../../common/types/transform';

import { isHttpFetchError } from '../../common/request';
import { useApi } from '../../hooks/use_api';
Expand Down Expand Up @@ -50,7 +50,7 @@ export const CloneTransformSection: FC<Props> = ({ match, location }) => {

const transformId = match.params.transformId;

const [transformConfig, setTransformConfig] = useState<TransformPivotConfig>();
const [transformConfig, setTransformConfig] = useState<TransformConfigUnion>();
const [errorMessage, setErrorMessage] = useState<string>();
const [isInitialized, setIsInitialized] = useState(false);
const { error: searchItemsError, searchItems, setSavedObjectId } = useSearchItems(undefined);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import type { TransformId, TransformPivotConfig } from '../../../../../../common/types/transform';
import type { TransformConfigUnion, TransformId } from '../../../../../../common/types/transform';

export type EsIndexName = string;
export type IndexPatternTitle = string;
Expand Down Expand Up @@ -55,7 +55,7 @@ export function getDefaultStepDetailsState(): StepDetailsExposedState {

export function applyTransformConfigToDetailsState(
state: StepDetailsExposedState,
transformConfig?: TransformPivotConfig
transformConfig?: TransformConfigUnion
): StepDetailsExposedState {
// apply the transform configuration to wizard DETAILS state
if (transformConfig !== undefined) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
isEsIndices,
isPostTransformsPreviewResponseSchema,
} from '../../../../../../common/api_schemas/type_guards';
import { TransformId, TransformPivotConfig } from '../../../../../../common/types/transform';
import { TransformId } from '../../../../../../common/types/transform';
import { isValidIndexName } from '../../../../../../common/utils/es_utils';

import { getErrorMessage } from '../../../../../../common/utils/errors';
Expand Down Expand Up @@ -158,7 +158,7 @@ export const StepDetailsForm: FC<StepDetailsFormProps> = React.memo(
),
});
} else {
setTransformIds(resp.transforms.map((transform: TransformPivotConfig) => transform.id));
setTransformIds(resp.transforms.map((transform) => transform.id));
}

const indices = await api.getEsIndices();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { i18n } from '@kbn/i18n';

import { EuiSteps, EuiStepStatus } from '@elastic/eui';

import { TransformPivotConfig } from '../../../../../../common/types/transform';
import type { TransformConfigUnion } from '../../../../../../common/types/transform';

import { getCreateTransformRequestBody } from '../../../../common';
import { SearchItems } from '../../../../hooks/use_search_items';
Expand Down Expand Up @@ -81,7 +81,7 @@ const StepDefine: FC<DefinePivotStepProps> = ({
};

interface WizardProps {
cloneConfig?: TransformPivotConfig;
cloneConfig?: TransformConfigUnion;
searchItems: SearchItems;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { getMlSharedImports } from '../../../../../shared_imports';

// FLAKY https://github.com/elastic/kibana/issues/112922
describe.skip('Transform: Transform List <ExpandedRow />', () => {
const onAlertEdit = jest.fn();
// Set timezone to US/Eastern for consistent test results.
beforeEach(() => {
moment.tz.setDefault('US/Eastern');
Expand All @@ -38,7 +39,7 @@ describe.skip('Transform: Transform List <ExpandedRow />', () => {

render(
<MlSharedContext.Provider value={mlShared}>
<ExpandedRow item={item} />
<ExpandedRow item={item} onAlertEdit={onAlertEdit} />
</MlSharedContext.Provider>
);

Expand Down

0 comments on commit d08e6fd

Please sign in to comment.