Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Upgrade Assistant] Reorganize folder structure #94843

Merged
Merged
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@import 'tabs/checkup/index';
@import 'tabs/overview/index';
@import 'es_deprecations/index';
@import 'overview/index';
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@

import { IconColor } from '@elastic/eui';
import { invert } from 'lodash';
import { DeprecationInfo } from '../../../../../common/types';
import { DeprecationInfo } from '../../../../common/types';

export const LEVEL_MAP: { [level: string]: number } = {
warning: 0,
critical: 1,
};

export const REVERSE_LEVEL_MAP: { [idx: number]: DeprecationInfo['level'] } = invert(
LEVEL_MAP
) as any;
interface ReverseLevelMap {
[idx: number]: DeprecationInfo['level'];
}

export const REVERSE_LEVEL_MAP: ReverseLevelMap = invert(LEVEL_MAP) as ReverseLevelMap;

export const COLOR_MAP: { [level: string]: IconColor } = {
warning: 'default',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ import React, { FunctionComponent, useState } from 'react';
import { i18n } from '@kbn/i18n';
import { EuiButton, EuiFieldSearch, EuiFlexGroup, EuiFlexItem, EuiCallOut } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { DeprecationInfo } from '../../../../../common/types';
import { GroupByOption, LevelFilterOption } from '../../types';
import { DeprecationInfo } from '../../../../common/types';
import { validateRegExpString } from '../../lib/utils';
import { GroupByOption, LevelFilterOption } from '../types';
import { FilterBar } from './filter_bar';
import { GroupByBar } from './group_by_bar';

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

interface CheckupControlsProps {
allDeprecations?: DeprecationInfo[];
isLoading: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import {
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';

import { LoadingErrorBanner } from '../../error_banner';
import { useAppContext } from '../../../app_context';
import { GroupByOption, LevelFilterOption, UpgradeAssistantTabProps } from '../../types';
import { LoadingErrorBanner } from '../error_banner';
import { useAppContext } from '../../app_context';
import { GroupByOption, LevelFilterOption, UpgradeAssistantTabProps } from '../types';
import { CheckupControls } from './controls';
import { GroupedDeprecations } from './deprecations/grouped';

Expand All @@ -34,7 +34,7 @@ export interface CheckupTabProps extends UpgradeAssistantTabProps {
* Displays a list of deprecations that filterable and groupable. Can be used for cluster,
* nodes, or indices checkups.
*/
export const CheckupTab: FunctionComponent<CheckupTabProps> = ({
export const DeprecationTab: FunctionComponent<CheckupTabProps> = ({
alertBanner,
checkupLabel,
deprecations,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import {
EuiTitle,
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { EnrichedDeprecationInfo } from '../../../../../common/types';
import { AppContext } from '../../../app_context';
import { ReindexButton } from './reindex';
import { AppContext } from '../../../../app_context';
import { EnrichedDeprecationInfo } from '../../../../../../common/types';
import { FixIndexSettingsButton } from './index_settings';

interface DeprecationCellProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import React, { Fragment, FunctionComponent } from 'react';
import { EuiText } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';

import { EnrichedDeprecationInfo } from '../../../../../../common/types';
import { EnrichedDeprecationInfo } from '../../../../../common/types';

export const DeprecationCountSummary: FunctionComponent<{
deprecations: EnrichedDeprecationInfo[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import React from 'react';
import { mountWithIntl, shallowWithIntl } from '@kbn/test/jest';
import { EuiBadge, EuiPagination } from '@elastic/eui';

import { DeprecationInfo, EnrichedDeprecationInfo } from '../../../../../../common/types';
import { GroupByOption, LevelFilterOption } from '../../../types';
import { DeprecationInfo, EnrichedDeprecationInfo } from '../../../../../common/types';
import { GroupByOption, LevelFilterOption } from '../../types';
import { DeprecationAccordion, filterDeps, GroupedDeprecations } from './grouped';

describe('filterDeps', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import {
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';

import { DeprecationInfo, EnrichedDeprecationInfo } from '../../../../../../common/types';
import { GroupByOption, LevelFilterOption } from '../../../types';
import { DeprecationInfo, EnrichedDeprecationInfo } from '../../../../../common/types';
import { GroupByOption, LevelFilterOption } from '../../types';

import { DeprecationCountSummary } from './count_summary';
import { DeprecationHealth } from './health';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import React, { FunctionComponent } from 'react';
import { EuiBadge, EuiToolTip } from '@elastic/eui';
import { i18n } from '@kbn/i18n';

import { DeprecationInfo } from '../../../../../../common/types';
import { DeprecationInfo } from '../../../../../common/types';
import { COLOR_MAP, LEVEL_MAP, REVERSE_LEVEL_MAP } from '../constants';

const LocalizedLevels: { [level: string]: string } = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import React, { useState, useRef } from 'react';
import { i18n } from '@kbn/i18n';
import { EuiCode, EuiConfirmModal } from '@elastic/eui';
import { useAppContext } from '../../../../../app_context';
import { useAppContext } from '../../../../app_context';

interface Props {
children: (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import React from 'react';

import { EuiBasicTable } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { EnrichedDeprecationInfo } from '../../../../../common/types';
import { AppContext } from '../../../app_context';
import { ReindexButton } from './reindex';
import { AppContext } from '../../../../app_context';
import { EnrichedDeprecationInfo } from '../../../../../../common/types';
import { FixIndexSettingsButton } from './index_settings';

const PAGE_SIZES = [10, 25, 50, 100, 250, 500, 1000];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import { shallow } from 'enzyme';
import React from 'react';

import { EnrichedDeprecationInfo } from '../../../../../../common/types';
import { GroupByOption } from '../../../types';
import { EnrichedDeprecationInfo } from '../../../../../common/types';
import { GroupByOption } from '../../types';
import { DeprecationList } from './list';

describe('DeprecationList', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

import React, { FunctionComponent } from 'react';

import { DeprecationInfo, EnrichedDeprecationInfo } from '../../../../../../common/types';
import { GroupByOption } from '../../../types';
import { DeprecationInfo, EnrichedDeprecationInfo } from '../../../../../common/types';
import { GroupByOption } from '../../types';

import { COLOR_MAP, LEVEL_MAP } from '../constants';
import { DeprecationCell } from './cell';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ import { Subscription } from 'rxjs';
import { EuiButton, EuiLoadingSpinner, EuiText, EuiToolTip } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { DocLinksStart, HttpSetup } from 'src/core/public';
import { API_BASE_PATH } from '../../../../../../../common/constants';
import { API_BASE_PATH } from '../../../../../../common/constants';
import {
EnrichedDeprecationInfo,
ReindexStatus,
UIReindexOption,
} from '../../../../../../../common/types';
import { LoadingState } from '../../../../types';
} from '../../../../../../common/types';
import { LoadingState } from '../../../types';
import { ReindexFlyout } from './flyout';
import { ReindexPollingService, ReindexState } from './polling_service';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { shallow } from 'enzyme';
import { cloneDeep } from 'lodash';
import React from 'react';

import { ReindexStatus } from '../../../../../../../../common/types';
import { LoadingState } from '../../../../../types';
import { ReindexStatus } from '../../../../../../../common/types';
import { LoadingState } from '../../../../types';
import { ReindexState } from '../polling_service';
import { ChecklistFlyoutStep } from './checklist_step';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import {
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';

import { ReindexStatus } from '../../../../../../../../common/types';
import { LoadingState } from '../../../../../types';
import { ReindexStatus } from '../../../../../../../common/types';
import { LoadingState } from '../../../../types';
import { ReindexState } from '../polling_service';
import { ReindexProgress } from './progress';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
EuiTitle,
} from '@elastic/eui';

import { EnrichedDeprecationInfo, ReindexStatus } from '../../../../../../../../common/types';
import { EnrichedDeprecationInfo, ReindexStatus } from '../../../../../../../common/types';

import { ReindexState } from '../polling_service';
import { ChecklistFlyoutStep } from './checklist_step';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { shallow } from 'enzyme';
import React from 'react';

import { IndexGroup, ReindexStatus, ReindexStep } from '../../../../../../../../common/types';
import { IndexGroup, ReindexStatus, ReindexStep } from '../../../../../../../common/types';
import { ReindexState } from '../polling_service';
import { ReindexProgress } from './progress';

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

import { IndexGroup, ReindexStatus, ReindexStep } from '../../../../../../../../common/types';
import { LoadingState } from '../../../../../types';
import { IndexGroup, ReindexStatus, ReindexStep } from '../../../../../../../common/types';
import { LoadingState } from '../../../../types';
import { ReindexState } from '../polling_service';
import { StepProgress, StepProgressStep } from './step_progress';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import { I18nProvider } from '@kbn/i18n/react';
import { mount, shallow } from 'enzyme';
import React from 'react';

import { ReindexWarning } from '../../../../../../../../common/types';
import { mockKibanaSemverVersion } from '../../../../../../../../common/constants';
import { ReindexWarning } from '../../../../../../../common/types';
import { mockKibanaSemverVersion } from '../../../../../../../common/constants';

import { idForWarning, WarningsFlyoutStep } from './warnings_step';

jest.mock('../../../../../../app_context', () => {
jest.mock('../../../../../app_context', () => {
const { docLinksServiceMock } = jest.requireActual(
'../../../../../../../../../../../src/core/public/doc_links/doc_links_service.mock'
'../../../../../../../../../../src/core/public/doc_links/doc_links_service.mock'
);

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { DocLinksStart } from 'kibana/public';
import { ReindexWarning, ReindexWarningTypes } from '../../../../../../../../common/types';
import { ReindexWarning, ReindexWarningTypes } from '../../../../../../../common/types';

export const hasReindexWarning = (
warnings: ReindexWarning[],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import {
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';

import { ReindexWarning, ReindexWarningTypes } from '../../../../../../../../common/types';
import { useAppContext } from '../../../../../../app_context';
import { ReindexWarning, ReindexWarningTypes } from '../../../../../../../common/types';
import { useAppContext } from '../../../../../app_context';
import {
CustomTypeNameWarningCheckbox,
DeprecatedSettingWarningCheckbox,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { ReindexStatus, ReindexStep } from '../../../../../../../common/types';
import { ReindexStatus, ReindexStep } from '../../../../../../common/types';
import { ReindexPollingService } from './polling_service';
import { httpServiceMock } from 'src/core/public/mocks';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
import { BehaviorSubject } from 'rxjs';

import { HttpSetup } from 'src/core/public';
import { API_BASE_PATH } from '../../../../../../../common/constants';
import { API_BASE_PATH } from '../../../../../../common/constants';
import {
IndexGroup,
ReindexOperation,
ReindexStatus,
ReindexStep,
ReindexWarning,
} from '../../../../../../../common/types';
import { LoadingState } from '../../../../types';
} from '../../../../../../common/types';
import { LoadingState } from '../../../types';

const POLL_INTERVAL = 1000;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

import { mount, shallow } from 'enzyme';
import React from 'react';
import { DeprecationInfo } from '../../../../../common/types';
import { DeprecationInfo } from '../../../../common/types';

import { LevelFilterOption } from '../../types';
import { LevelFilterOption } from '../types';
import { FilterBar } from './filter_bar';

const defaultProps = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import React from 'react';
import { EuiFilterButton, EuiFilterGroup, EuiFlexItem } from '@elastic/eui';
import { i18n } from '@kbn/i18n';

import { DeprecationInfo } from '../../../../../common/types';
import { LevelFilterOption } from '../../types';
import { DeprecationInfo } from '../../../../common/types';
import { LevelFilterOption } from '../types';

const LocalizedOptions: { [option: string]: string } = {
all: i18n.translate('xpack.upgradeAssistant.checkupTab.controls.filterBar.allButtonLabel', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { mount, shallow } from 'enzyme';
import React from 'react';

import { GroupByOption } from '../../types';
import { GroupByOption } from '../types';
import { GroupByBar } from './group_by_bar';

const defaultProps = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import React from 'react';
import { EuiFilterButton, EuiFilterGroup, EuiFlexItem } from '@elastic/eui';
import { i18n } from '@kbn/i18n';

import { GroupByOption } from '../../types';
import { GroupByOption } from '../types';

const LocalizedOptions: { [option: string]: string } = {
message: i18n.translate('xpack.upgradeAssistant.checkupTab.controls.groupByBar.byIssueLabel', {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

export { DeprecationTab } from './deprecation_tab';
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import React, { useEffect, useState } from 'react';
import { EuiLoadingSpinner, EuiSwitch } from '@elastic/eui';
import { i18n } from '@kbn/i18n';

import { useAppContext } from '../../../app_context';
import { ResponseError } from '../../../lib/api';
import { useAppContext } from '../../app_context';
import { ResponseError } from '../../lib/api';

export const DeprecationLoggingToggle: React.FunctionComponent = () => {
const { api } = useAppContext();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
* 2.0.
*/

export { CheckupTab } from './checkup_tab';
export { OverviewTab } from './overview';
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import {
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';

import { useAppContext } from '../../../app_context';
import { LoadingErrorBanner } from '../../error_banner';
import { UpgradeAssistantTabProps } from '../../types';
import { useAppContext } from '../../app_context';
import { LoadingErrorBanner } from '../error_banner';
import { UpgradeAssistantTabProps } from '../types';
import { Steps } from './steps';

export const OverviewTab: FunctionComponent<UpgradeAssistantTabProps> = (props) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import {
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';

import { UpgradeAssistantTabProps } from '../../types';
import { useAppContext } from '../../app_context';
import { UpgradeAssistantTabProps } from '../types';
import { DeprecationLoggingToggle } from './deprecation_logging_toggle';
import { useAppContext } from '../../../app_context';

// Leaving these here even if unused so they are picked up for i18n static analysis
// Keep this until last minor release (when next major is also released).
Expand Down
Loading