Skip to content

Commit

Permalink
[EPM] Fix package version requirement structure
Browse files Browse the repository at this point in the history
In elastic/package-registry#134 the API structure changes. This PR should adjust to the new structure.
  • Loading branch information
ruflin committed Oct 24, 2019
1 parent 7d9389b commit 458749d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
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 {
version: ServiceRequirements;
}

export interface ServiceRequirements {
'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>;
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

0 comments on commit 458749d

Please sign in to comment.