Skip to content

Commit

Permalink
remove unneeded installationVersion from package
Browse files Browse the repository at this point in the history
  • Loading branch information
neptunian committed Apr 30, 2020
1 parent be907b3 commit 15001d4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
1 change: 0 additions & 1 deletion x-pack/plugins/ingest_manager/common/types/models/epm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ export interface RegistryVarsEntry {
interface PackageAdditions {
title: string;
latestVersion: string;
installedVersion?: string;
assets: AssetsGroupedByServiceByType;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ const Text = styled.span`
type HeaderProps = PackageInfo & { iconType?: IconType };

export function Header(props: HeaderProps) {
const { iconType, name, title, version, installedVersion, latestVersion } = props;
const { iconType, name, title, version, latestVersion } = props;

let installedVersion;
if ('savedObject' in props) {
installedVersion = props.savedObject.attributes.version;
}
const hasWriteCapabilites = useCapabilities().write;
const { toListView } = useLinks();
const ADD_DATASOURCE_URI = useLink(`${EPM_PATH}/${name}-${version}/add-datasource`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ export function Detail() {
const packageInfo = response.data?.response;
const title = packageInfo?.title;
const name = packageInfo?.name;
const installedVersion = packageInfo?.installedVersion;
let installedVersion;
if (packageInfo && 'savedObject' in packageInfo) {
installedVersion = packageInfo.savedObject.attributes.version;
}
const status: InstallStatus = packageInfo?.status as any;

// track install status state
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export function createInstallableFrom<T>(
? {
...from,
status: InstallationStatus.installed,
installedVersion: savedObject.attributes.version,
savedObject,
}
: {
Expand Down

0 comments on commit 15001d4

Please sign in to comment.