[8.x] [Uptime] Delete dead code (#193339) (#193355)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Uptime] Delete dead code
(#193339)](https://github.com/elastic/kibana/pull/193339)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Justin
Kambic","email":"jk@elastic.co"},"sourceCommit":{"committedDate":"2024-09-18T20:07:29Z","message":"[Uptime]
Delete dead code (#193339)\n\n## Summary\r\n\r\nRemoves code that is
unused from the Uptime
plugin.","sha":"d84eda1063394a7fbfe4a936becca5d21c1e2d45","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","ci:project-deploy-observability","Team:obs-ux-management","v8.16.0"],"title":"[Uptime]
Delete dead
code","number":193339,"url":"https://github.com/elastic/kibana/pull/193339","mergeCommit":{"message":"[Uptime]
Delete dead code (#193339)\n\n## Summary\r\n\r\nRemoves code that is
unused from the Uptime
plugin.","sha":"d84eda1063394a7fbfe4a936becca5d21c1e2d45"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/193339","number":193339,"mergeCommit":{"message":"[Uptime]
Delete dead code (#193339)\n\n## Summary\r\n\r\nRemoves code that is
unused from the Uptime
plugin.","sha":"d84eda1063394a7fbfe4a936becca5d21c1e2d45"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Justin Kambic <jk@elastic.co>
This commit is contained in:
Kibana Machine 2024-10-15 02:42:03 +11:00 committed by GitHub
parent d7bae15bde
commit d6293f1d62
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 0 additions and 155 deletions

View file

@ -1,12 +0,0 @@
/*
* 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 const STEP_END_FILTER = {
terms: {
'synthetics.type': ['step/end'],
},
};

View file

@ -1,22 +0,0 @@
/*
* 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 const AGENT_NAME = 'agent.name';
export const MONITOR_ID = 'monitor.id';
export const MONITOR_NAME = 'monitor.name';
export const MONITOR_TYPE = 'monitor.type';
export const URL_FULL = 'url.full';
export const URL_PORT = 'url.port';
export const OBSERVER_GEO_NAME = 'observer.geo.name';
export const ERROR_MESSAGE = 'error.message';
export const STATE_ID = 'monitor.state.id';
export const CERT_COMMON_NAME = 'tls.server.x509.subject.common_name';
export const CERT_ISSUER_NAME = 'tls.server.x509.issuer.common_name';
export const CERT_VALID_NOT_AFTER = 'tls.server.x509.not_after';
export const CERT_VALID_NOT_BEFORE = 'tls.server.x509.not_before';
export const CERT_HASH_SHA256 = 'tls.server.hash.sha256';

View file

@ -1,13 +0,0 @@
/*
* 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.
*/
/* Formats kibana space id into a valid Fleet-compliant data-stream namespace */
import { INVALID_NAMESPACE_CHARACTERS } from '@kbn/fleet-plugin/common';
export const formatKibanaNamespace = (spaceId: string) => {
const namespaceRegExp = new RegExp(INVALID_NAMESPACE_CHARACTERS, 'g');
return spaceId.replace(namespaceRegExp, '_');
};

View file

@ -1,8 +0,0 @@
/*
* 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 { formatKibanaNamespace } from './format_space_name';

View file

@ -1,12 +0,0 @@
/*
* 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.
*/
import { schema, TypeOf } from '@kbn/config-schema';
export const StatusRulePramsSchema = schema.object({});
export type StatusRuleParams = TypeOf<typeof StatusRulePramsSchema>;

View file

@ -1,38 +0,0 @@
/*
* 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.
*/
import * as t from 'io-ts';
/**
* This utility function can be used to turn a TypeScript enum into a io-ts codec.
*
* @example
* import { PathReporter } from "io-ts/lib/PathReporter";
*
* enum Thing {
* FOO = "foo",
* BAR = "bar"
* }
*
* const ThingCodec = tEnum<Thing>("Thing", Thing);
*
* console.log(PathReporter.report(ThingCodec.decode('invalidvalue')));
* // prints [ 'Invalid value "invalidvalue" supplied to : Thing' ]
* console.log(PathReporter.report(ThingCodec.decode('foo')));
* // prints [ 'No errors!' ]
*/
export function tEnum<EnumType>(enumName: string, theEnum: Record<string, string | number>) {
const isEnumValue = (input: unknown): input is EnumType =>
Object.values<unknown>(theEnum).includes(input);
return new t.Type<EnumType>(
enumName,
isEnumValue,
(input, context) => (isEnumValue(input) ? t.success(input) : t.failure(input, context)),
t.identity
);
}

View file

@ -1,15 +0,0 @@
/*
* 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.
*/
import { i18n } from '@kbn/i18n';
export const getTitle = (name?: string) => {
const appName = i18n.translate('xpack.uptime.title', {
defaultMessage: 'Uptime',
});
return `${appName} ${name ? '| ' + name : ''} - Kibana`;
};

View file

@ -1,32 +0,0 @@
/*
* 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.
*/
import * as observabilitySharedPublic from '@kbn/observability-shared-plugin/public';
jest.mock('@kbn/observability-shared-plugin/public', () => {
const originalModule = jest.requireActual('@kbn/observability-shared-plugin/public');
return {
...originalModule,
useFetcher: jest.fn().mockReturnValue({
data: null,
status: 'success',
}),
useTrackPageview: jest.fn(),
};
});
export function spyOnUseFetcher(
payload: unknown,
status = observabilitySharedPublic.FETCH_STATUS.SUCCESS
) {
return jest.spyOn(observabilitySharedPublic, 'useFetcher').mockReturnValue({
status,
data: payload,
refetch: () => null,
});
}

View file

@ -47033,7 +47033,6 @@
"xpack.uptime.synthetics.waterfallChart.labels.timings.ssl": "TLS",
"xpack.uptime.synthetics.waterfallChart.labels.timings.wait": "En attente (TTFB)",
"xpack.uptime.syntheticsFeatureCatalogueTitle": "Synthetics",
"xpack.uptime.title": "Uptime",
"xpack.uptime.tls.ageExpression.description": "ou antérieur à (jours) : ",
"xpack.uptime.tls.criteriaExpression.value": "le moniteur correspondant",
"xpack.uptime.tls.expirationExpression.description": "possède un certificat expirant dans (jours) : ",

View file

@ -46771,7 +46771,6 @@
"xpack.uptime.synthetics.waterfallChart.labels.timings.ssl": "TLS",
"xpack.uptime.synthetics.waterfallChart.labels.timings.wait": "待機中TTFB",
"xpack.uptime.syntheticsFeatureCatalogueTitle": "Synthetics",
"xpack.uptime.title": "アップタイム",
"xpack.uptime.tls.ageExpression.description": "または次の日数を経過:",
"xpack.uptime.tls.criteriaExpression.value": "一致するモニター",
"xpack.uptime.tls.expirationExpression.description": "次の日数以内に有効期限切れになる証明書があります:",

View file

@ -46824,7 +46824,6 @@
"xpack.uptime.synthetics.waterfallChart.labels.timings.ssl": "TLS",
"xpack.uptime.synthetics.waterfallChart.labels.timings.wait": "等待中 (TTFB)",
"xpack.uptime.syntheticsFeatureCatalogueTitle": "Synthetics",
"xpack.uptime.title": "运行时间",
"xpack.uptime.tls.ageExpression.description": "或早于以下天数:",
"xpack.uptime.tls.criteriaExpression.value": "正在匹配监测",
"xpack.uptime.tls.expirationExpression.description": "具有的证书将在以下天数内到期:",