Skip to content

Commit

Permalink
Fix linting, and switch this back
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisronline committed Jan 13, 2020
1 parent 53cacd3 commit b750b2c
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 4 deletions.
2 changes: 1 addition & 1 deletion x-pack/legacy/plugins/monitoring/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ export const TELEMETRY_COLLECTION_INTERVAL = 86400000;
* as the only way to see the new UI and actually run Kibana alerts. It will
* be false until all alerts have been migrated, then it will be removed
*/
export const KIBANA_ALERTING_ENABLED = true;
export const KIBANA_ALERTING_ENABLED = false;

/**
* The prefix for all alert types used by monitoring
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ describe('Step3', () => {
isSaving: false,
isDisabled: false,
save: jest.fn(),
error: null,
};

it('should render normally', () => {
Expand All @@ -38,4 +39,10 @@ describe('Step3', () => {
const component = shallow(<Step3 {...defaultProps} {...customProps} />);
expect(component).toMatchSnapshot();
});

it('should show an error', () => {
const customProps = { error: 'Test error' };
const component = shallow(<Step3 {...defaultProps} {...customProps} />);
expect(component).toMatchSnapshot();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { ALERT_EMAIL_SERVICES } from '../../../common/constants';
export interface EmailActionData {
service: string;
host: string;
port: number | string; // support a string to ensure the user can backspace to an empty field
port: number | ''; // support a string to ensure the user can backspace to an empty field
secure: boolean;
from: string;
user: string;
Expand Down
10 changes: 8 additions & 2 deletions x-pack/legacy/plugins/monitoring/public/lib/setup_mode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,15 @@ import chrome from 'ui/chrome';
import { toastNotifications } from 'ui/notify';
import { i18n } from '@kbn/i18n';
import { npSetup } from 'ui/new_platform';
import { PluginsSetup } from 'ui/new_platform/new_platform';
import { CloudSetup } from '../../../../../plugins/cloud/public';
import { ajaxErrorHandlersProvider } from './ajax_error_handler';
import { SetupModeEnterButton } from '../components/setup_mode/enter_button';

interface PluginsSetupWithCloud extends PluginsSetup {
cloud: CloudSetup;
}

function isOnPage(hash: string) {
return contains(window.location.hash, hash);
}
Expand Down Expand Up @@ -95,7 +101,7 @@ export const updateSetupModeData = async (uuid?: string, fetchWithoutClusterUuid
const oldData = setupModeState.data;
const data = await fetchCollectionData(uuid, fetchWithoutClusterUuid);
setupModeState.data = data;
const { cloud } = npSetup.plugins;
const { cloud } = npSetup.plugins as PluginsSetupWithCloud;
const isCloudEnabled = !!(cloud && cloud.isCloudEnabled);
const hasPermissions = get(data, '_meta.hasPermissions', false);
if (isCloudEnabled || !hasPermissions) {
Expand Down Expand Up @@ -176,7 +182,7 @@ export const setSetupModeMenuItem = () => {
}

const globalState = angularState.injector.get('globalState');
const { cloud } = npSetup.plugins;
const { cloud } = npSetup.plugins as PluginsSetupWithCloud;
const isCloudEnabled = !!(cloud && cloud.isCloudEnabled);
const enabled = !globalState.inSetupMode && !isCloudEnabled;

Expand Down

0 comments on commit b750b2c

Please sign in to comment.