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

[EPM] Fix package version requirement structure #49172

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
11 changes: 8 additions & 3 deletions x-pack/legacy/plugins/integrations_manager/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,14 @@ export interface ScreenshotItem {
// https://github.com/elastic/integrations-registry/blob/master/docs/api/package.json
export type ServiceName = 'kibana' | 'elasticsearch' | 'filebeat' | 'metricbeat';
export type RequirementVersion = string;

export interface ServiceVersion {
ruflin marked this conversation as resolved.
Show resolved Hide resolved
version: ServiceRequirements;
ruflin marked this conversation as resolved.
Show resolved Hide resolved
}

export interface ServiceRequirements {
ruflin marked this conversation as resolved.
Show resolved Hide resolved
'version.min': RequirementVersion;
'version.max': RequirementVersion;
min: RequirementVersion;
max: RequirementVersion;
}

// from /categories
Expand All @@ -55,7 +60,7 @@ export interface CategorySummaryItem {
count: number;
}

export type RequirementsByServiceName = Record<ServiceName, ServiceRequirements>;
export type RequirementsByServiceName = Record<ServiceName, ServiceVersion>;
ruflin marked this conversation as resolved.
Show resolved Hide resolved
export interface AssetParts {
pkgkey: string;
service: ServiceName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ export function Requirements(props: RequirementsProps) {
</EuiFlexItem>
<EuiFlexItem grow={false}>
<div>
<VersionBadge version={requirement['version.min']} />
<VersionBadge version={requirement.version.min} />
<span>{' - '}</span>
<VersionBadge version={requirement['version.max']} />
<VersionBadge version={requirement.version.max} />
</div>
</EuiFlexItem>
</EuiFlexGroup>
Expand Down