Skip to content

Commit

Permalink
fix: allow upstream package comparison (#61)
Browse files Browse the repository at this point in the history
This change ensures the Compare Revision dropdown on the Package Revision Page lists the upstream package anytime the upstream package is known.
  • Loading branch information
ChristopherFry committed Jun 29, 2022
1 parent c4c1976 commit 292b98d
Showing 1 changed file with 26 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,34 +211,34 @@ export const PackageRevisionPage = ({ mode }: PackageRevisionPageProps) => {

let upgradeAvailable = false;

if (isLatestPublishedRevision(thisPackageRevision)) {
const upstream = getUpstreamPackageRevisionDetails(thisPackageRevision);

if (upstream) {
const upstreamPackage = findPackageRevision(
thisPackageRevisions,
upstream.packageName,
upstream.revision,
);

if (upstreamPackage) {
diffItems.push({
label: `Upstream (${getPackageRevisionTitle(upstreamPackage)})`,
value: upstreamPackage.metadata.name,
});
}
const upstream = getUpstreamPackageRevisionDetails(thisPackageRevision);

const allUpstreamRevisions = filterPackageRevisions(
thisPackageRevisions,
upstream.packageName,
);
latestPublishedUpstream.current =
findLatestPublishedRevision(allUpstreamRevisions);
if (upstream) {
const upstreamPackage = findPackageRevision(
thisPackageRevisions,
upstream.packageName,
upstream.revision,
);

if (
upstream.revision !== latestPublishedUpstream.current?.spec.revision
) {
upgradeAvailable = true;
if (upstreamPackage) {
diffItems.push({
label: `Upstream (${getPackageRevisionTitle(upstreamPackage)})`,
value: upstreamPackage.metadata.name,
});

if (isLatestPublishedRevision(thisPackageRevision)) {
const allUpstreamRevisions = filterPackageRevisions(
thisPackageRevisions,
upstream.packageName,
);
latestPublishedUpstream.current =
findLatestPublishedRevision(allUpstreamRevisions);

if (
upstream.revision !== latestPublishedUpstream.current?.spec.revision
) {
upgradeAvailable = true;
}
}
}
}
Expand Down

0 comments on commit 292b98d

Please sign in to comment.