Skip to content

Commit

Permalink
[Fleet] Fix uninstall package validation accross space (#188749)
Browse files Browse the repository at this point in the history
  • Loading branch information
nchaulet authored Jul 23, 2024
1 parent 647b222 commit f675a8a
Show file tree
Hide file tree
Showing 13 changed files with 526 additions and 377 deletions.
4 changes: 4 additions & 0 deletions x-pack/plugins/fleet/common/types/models/epm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,10 @@ export type PackageInfo =
| Installable<Merge<RegistryPackage, EpmPackageAdditions>>
| Installable<Merge<ArchivePackage, EpmPackageAdditions>>;

export interface PackageMetadata {
has_policies: true;
}

export type IntegrationCardReleaseLabel = 'beta' | 'preview' | 'ga' | 'rc';

export type PackageVerificationStatus = 'verified' | 'unverified' | 'unknown';
Expand Down
2 changes: 2 additions & 0 deletions x-pack/plugins/fleet/common/types/rest_spec/epm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import type {
SimpleSOAssetType,
AssetSOObject,
InstallResultStatus,
PackageMetadata,
} from '../models/epm';

export interface GetCategoriesRequest {
Expand Down Expand Up @@ -97,6 +98,7 @@ export interface GetInfoRequest {

export interface GetInfoResponse {
item: PackageInfo;
metadata?: PackageMetadata;
// deprecated in 8.0
response?: PackageInfo;
}
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/fleet/cypress/e2e/install_assets.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ describe('Install unverified package assets', () => {
if (res.body?.item?.status) {
res.body.item.status = 'not_installed';
}
res.body.metadata = { has_policies: false };
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ export function Detail() {
pkgVersion,
{
prerelease: prereleaseIntegrationsEnabled,
withMetadata: true,
},
{
enabled: !authz.fleet.readSettings || !isSettingsInitialLoading, // Load only after settings are loaded
Expand Down Expand Up @@ -785,7 +786,11 @@ export function Detail() {
/>
</Route>
<Route path={INTEGRATIONS_ROUTING_PATHS.integration_details_settings}>
<SettingsPage packageInfo={packageInfo} startServices={services} />
<SettingsPage
packageInfo={packageInfo}
packageMetadata={packageInfoData?.metadata}
startServices={services}
/>
</Route>
<Route path={INTEGRATIONS_ROUTING_PATHS.integration_details_assets}>
<AssetsPage packageInfo={packageInfo} refetchPackageInfo={refetchPackageInfo} />
Expand Down
Loading

0 comments on commit f675a8a

Please sign in to comment.