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] Adapt settings ui to saved object version type change #30082

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
73 changes: 71 additions & 2 deletions x-pack/plugins/infra/common/graphql/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface InfraSource {
/** The id of the source */
id: string;
/** The version number the source configuration was last persisted with */
version?: number | null;
version?: string | null;
/** The timestamp the source configuration was last persisted at */
updatedAt?: number | null;
/** The raw configuration of the source */
Expand All @@ -34,6 +34,8 @@ export interface InfraSource {
logEntriesBetween: InfraLogEntryInterval;
/** A consecutive span of summary buckets within an interval */
logSummaryBetween: InfraLogSummaryInterval;

logItem: InfraLogItem;
/** A hierarchy of hosts, pods, containers, services or arbitrary groups */
map?: InfraResponse | null;

Expand Down Expand Up @@ -177,6 +179,22 @@ export interface InfraLogSummaryBucket {
entriesCount: number;
}

export interface InfraLogItem {
/** The ID of the document */
id: string;
/** The index where the document was found */
index: string;
/** An array of flattened fields and values */
fields: InfraLogItemField[];
}

export interface InfraLogItemField {
/** The flattened field name */
field: string;
/** The value for the Field as a string */
value: string;
}

export interface InfraResponse {
nodes: InfraNode[];
}
Expand All @@ -197,6 +215,10 @@ export interface InfraNodeMetric {
name: InfraMetricType;

value: number;

avg: number;

max: number;
}

export interface InfraMetricData {
Expand Down Expand Up @@ -395,6 +417,9 @@ export interface LogSummaryBetweenInfraSourceArgs {
/** The query to filter the log entries by */
filterQuery?: string | null;
}
export interface LogItemInfraSourceArgs {
id: string;
}
export interface MapInfraSourceArgs {
timerange: InfraTimerangeInput;

Expand Down Expand Up @@ -456,6 +481,7 @@ export enum InfraPathType {
hosts = 'hosts',
pods = 'pods',
containers = 'containers',
custom = 'custom',
}

export enum InfraMetricType {
Expand Down Expand Up @@ -521,6 +547,45 @@ export type InfraLogMessageSegment = InfraLogMessageFieldSegment | InfraLogMessa
// Documents
// ====================================================

export namespace FlyoutItemQuery {
export type Variables = {
sourceId: string;
itemId: string;
};

export type Query = {
__typename?: 'Query';

source: Source;
};

export type Source = {
__typename?: 'InfraSource';

id: string;

logItem: LogItem;
};

export type LogItem = {
__typename?: 'InfraLogItem';

id: string;

index: string;

fields: Fields[];
};

export type Fields = {
__typename?: 'InfraLogItemField';

field: string;

value: string;
};
}

export namespace MetadataQuery {
export type Variables = {
sourceId: string;
Expand Down Expand Up @@ -658,6 +723,10 @@ export namespace WaffleNodesQuery {
name: InfraMetricType;

value: number;

avg: number;

max: number;
};
}

Expand Down Expand Up @@ -845,7 +914,7 @@ export namespace SourceFields {

id: string;

version?: number | null;
version?: string | null;

updatedAt?: number | null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ const createContainerProps = memoizeLast((sourceId: string, apolloClient: Apollo
undefined,
getDerivedIndexPattern: () => getDerivedIndexPattern,
getVersion: () => state => (state && state.source && state.source.version) || undefined,
getExists: () => state =>
(state && state.source && typeof state.source.version === 'number') || false,
getExists: () => state => (state && state.source && !!state.source.version) || false,
});

const effects = inferEffectMap<State>()({
Expand Down Expand Up @@ -219,7 +218,7 @@ interface WithSourceProps {
metricIndicesExist?: boolean;
sourceId: string;
update: (changes: UpdateSourceInput[]) => Promise<any>;
version?: number;
version?: string;
}>;
}

Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/infra/public/graphql/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,7 @@ export namespace SourceFields {

id: string;

version?: number | null;
version?: string | null;

updatedAt?: number | null;

Expand Down