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

[Infra UI] Removed unused saved object attribute and unused source configuration code #169430

Merged
merged 7 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions x-pack/plugins/infra/common/source_configuration/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ export const defaultSourceConfiguration: InfraSourceConfiguration = {
type: 'index_name',
indexName: LOGS_INDEX_PATTERN,
},
fields: {
message: ['message', '@message'],
},
inventoryDefaultView: '0',
metricsExplorerDefaultView: '0',
logColumns: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,8 @@

/* eslint-disable @typescript-eslint/no-empty-interface */

import { omit } from 'lodash';
import * as rt from 'io-ts';

/**
* Source configuration config file properties.
* These are properties that can appear in the kibana.yml file.
* This is a legacy method of providing properties, and will be deprecated in the future (v 8.0.0).
*/

export const sourceConfigurationConfigFilePropertiesRT = rt.type({
sources: rt.type({
default: rt.partial({
fields: rt.partial({
message: rt.array(rt.string),
}),
}),
}),
});

export type SourceConfigurationConfigFileProperties = rt.TypeOf<
typeof sourceConfigurationConfigFilePropertiesRT
>;

/**
* Log columns
*/
Expand Down Expand Up @@ -104,47 +83,22 @@ export type LogIndexNameReference = rt.TypeOf<typeof logIndexNameReferenceRT>;
export const logIndexReferenceRT = rt.union([logIndexPatternReferenceRT, logIndexNameReferenceRT]);
export type LogIndexReference = rt.TypeOf<typeof logIndexReferenceRT>;

/**
* Fields
*/

const SourceConfigurationFieldsRT = rt.type({
message: rt.array(rt.string),
});

/**
* Properties that represent a full source configuration, which is the result of merging static values with
* saved values.
*/
export const SourceConfigurationRT = rt.type({
name: rt.string,
description: rt.string,
metricAlias: rt.string,
logIndices: logIndexReferenceRT,
inventoryDefaultView: rt.string,
metricsExplorerDefaultView: rt.string,
fields: SourceConfigurationFieldsRT,
logColumns: rt.array(SourceConfigurationColumnRuntimeType),
anomalyThreshold: rt.number,
});

/**
* Stored source configuration as read from and written to saved objects
*/
const SavedSourceConfigurationFieldsRuntimeType = rt.partial(
omit(SourceConfigurationFieldsRT.props, ['message'])
);

export type InfraSavedSourceConfigurationFields = rt.TypeOf<
typeof SavedSourceConfigurationFieldsRuntimeType
>;

export const SavedSourceConfigurationRuntimeType = rt.intersection([
rt.partial(omit(SourceConfigurationRT.props, ['fields'])),
rt.partial({
fields: SavedSourceConfigurationFieldsRuntimeType,
}),
]);
export const SavedSourceConfigurationRuntimeType = rt.partial(SourceConfigurationRT.props);

export interface InfraSavedSourceConfiguration
extends rt.TypeOf<typeof SavedSourceConfigurationRuntimeType> {}
Expand All @@ -154,10 +108,8 @@ export interface InfraSavedSourceConfiguration
* hardcoded defaults.
*/

const StaticSourceConfigurationFieldsRuntimeType = rt.partial(SourceConfigurationFieldsRT.props);
export const StaticSourceConfigurationRuntimeType = rt.partial({
...SourceConfigurationRT.props,
fields: StaticSourceConfigurationFieldsRuntimeType,
});

export interface InfraStaticSourceConfiguration
Expand All @@ -167,11 +119,8 @@ export interface InfraStaticSourceConfiguration
* Full source configuration type after all cleanup has been done at the edges
*/

export type InfraSourceConfigurationFields = rt.TypeOf<typeof SourceConfigurationFieldsRT>;

export const SourceConfigurationRuntimeType = rt.type({
...SourceConfigurationRT.props,
fields: SourceConfigurationFieldsRT,
logColumns: rt.array(SourceConfigurationColumnRuntimeType),
});

Expand Down
86 changes: 0 additions & 86 deletions x-pack/plugins/infra/server/deprecations.test.ts

This file was deleted.

Loading
Loading