Skip to content

Commit

Permalink
Ensure upgrade page displays as upgrade even without from prop
Browse files Browse the repository at this point in the history
  • Loading branch information
kpollich committed Aug 26, 2021
1 parent 2d815e1 commit ceb5ad8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ export const EditPackagePolicyPage = memo(() => {

export const EditPackagePolicyForm = memo<{
packagePolicyId: string;
isUpgrade?: boolean;
from?: EditPackagePolicyFrom;
}>(({ packagePolicyId, from = 'edit' }) => {
}>(({ packagePolicyId, isUpgrade = false, from = 'edit' }) => {
const { application, notifications } = useStartServices();
const {
agents: { enabled: isFleetEnabled },
Expand All @@ -99,9 +100,6 @@ export const EditPackagePolicyForm = memo<{
>();
const [dryRunData, setDryRunData] = useState<UpgradePackagePolicyDryRunResponse>();

const isUpgrade =
from === 'upgrade-from-fleet-policy-list' || from === 'upgrade-from-integrations-policy-list';

const policyId = agentPolicy?.id ?? '';

// Retrieve agent policy, package, and package policy info
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ export const UpgradePackagePolicyPage = memo(() => {
from = 'upgrade-from-integrations-policy-list';
}

return <EditPackagePolicyForm packagePolicyId={packagePolicyId} from={from} />;
return <EditPackagePolicyForm packagePolicyId={packagePolicyId} from={from} isUpgrade />;
});

0 comments on commit ceb5ad8

Please sign in to comment.