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

[Fleet] Fix upgrade link in Fleet policy table #110228

Merged
merged 2 commits into from
Aug 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ export const PackagePoliciesTable: React.FunctionComponent<Props> = ({
upgradePackagePolicyHref={`${getHref('upgrade_package_policy', {
policyId: agentPolicy.id,
packagePolicyId: packagePolicy.id,
})}`}
})}?from=fleet-policy-list`}
/>
);
},
Expand Down
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 />;
});