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] Show all integration assets on detail page #182180

Merged
merged 17 commits into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from 13 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
16 changes: 8 additions & 8 deletions x-pack/plugins/fleet/common/constants/epm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import type { AllowedAssetTypes } from '../types/models';
import { ElasticsearchAssetType, KibanaAssetType } from '../types/models';
import type { DisplayedAssetTypes } from '../types/models';
import { ElasticsearchAssetType, KibanaSavedObjectType } from '../types/models';

export const PACKAGES_SAVED_OBJECT_TYPE = 'epm-packages';
export const ASSETS_SAVED_OBJECT_TYPE = 'epm-packages-assets';
Expand Down Expand Up @@ -87,11 +87,11 @@ export const installationStatuses = {
NotInstalled: 'not_installed',
} as const;

export const allowedAssetTypes: AllowedAssetTypes = [
KibanaAssetType.dashboard,
KibanaAssetType.search,
KibanaAssetType.visualization,
ElasticsearchAssetType.transform,
// These asset types are allowed to be shown on Integration details > Assets tab
// This array also controls the order in which the asset types are displayed
export const displayedAssetTypes: DisplayedAssetTypes = [
...Object.values(KibanaSavedObjectType),
...Object.values(ElasticsearchAssetType),
];

export const allowedAssetTypesLookup = new Set<string>(allowedAssetTypes);
export const displayedAssetTypesLookup = new Set<string>(displayedAssetTypes);
2 changes: 1 addition & 1 deletion x-pack/plugins/fleet/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export type {
FleetServerAgentComponentStatus,
AssetSOObject,
SimpleSOAssetType,
AllowedAssetTypes,
DisplayedAssetTypes,
} from './types';

export { ElasticsearchAssetType } from './types';
46 changes: 23 additions & 23 deletions x-pack/plugins/fleet/common/openapi/bundled.json
Original file line number Diff line number Diff line change
Expand Up @@ -6295,33 +6295,33 @@
"type": "object",
"deprecated": true,
"properties": {
"response": {
"items": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"type": {
"$ref": "#/components/schemas/saved_object_type"
},
"updatedAt": {
"type": "string"
},
"attributes": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"description": {
"type": "string"
}
"type": "object",
"properties": {
"id": {
"type": "string"
},
"type": {
"$ref": "#/components/schemas/saved_object_type"
},
"updatedAt": {
"type": "string"
},
"attributes": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"description": {
"type": "string"
}
}
},
"appLink": {
"type": "string"
}
}
}
Expand Down
36 changes: 18 additions & 18 deletions x-pack/plugins/fleet/common/openapi/bundled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3971,26 +3971,26 @@ components:
type: object
deprecated: true
properties:
response:
items:
type: array
items:
type: array
items:
type: object
properties:
id:
type: string
type:
$ref: '#/components/schemas/saved_object_type'
updatedAt:
type: string
attributes:
type: object
properties:
title:
type: string
description:
type: string
type: object
properties:
id:
type: string
type:
$ref: '#/components/schemas/saved_object_type'
updatedAt:
type: string
attributes:
type: object
properties:
title:
type: string
description:
type: string
appLink:
type: string
required:
- items
get_categories_response:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@ title: Bulk get assets response
type: object
deprecated: true
properties:
response:
items:
type: array
items:
type: array
items:
type: object
properties:
id:
type: string
type:
$ref: ./saved_object_type.yaml
updatedAt:
type: string
attributes:
type: object
properties:
title:
type: string
description:
type: string
type: object
properties:
id:
type: string
type:
$ref: ./saved_object_type.yaml
updatedAt:
type: string
attributes:
type: object
properties:
title:
type: string
description:
type: string
appLink:
type: string
required:
- items
22 changes: 9 additions & 13 deletions x-pack/plugins/fleet/common/types/models/epm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,65 +53,61 @@ export type AssetType =
*/
export enum KibanaAssetType {
dashboard = 'dashboard',
lens = 'lens',
visualization = 'visualization',
search = 'search',
indexPattern = 'index_pattern',
map = 'map',
lens = 'lens',
mlModule = 'ml_module',
securityRule = 'security_rule',
cloudSecurityPostureRuleTemplate = 'csp_rule_template',
mlModule = 'ml_module',
tag = 'tag',
osqueryPackAsset = 'osquery_pack_asset',
osquerySavedQuery = 'osquery_saved_query',
tag = 'tag',
}

/*
Enum of saved object types that are allowed to be installed
*/
export enum KibanaSavedObjectType {
dashboard = 'dashboard',
lens = 'lens',
visualization = 'visualization',
search = 'search',
indexPattern = 'index-pattern',
map = 'map',
lens = 'lens',
mlModule = 'ml-module',
securityRule = 'security-rule',
cloudSecurityPostureRuleTemplate = 'csp-rule-template',
tag = 'tag',
osqueryPackAsset = 'osquery-pack-asset',
osquerySavedQuery = 'osquery-saved-query',
tag = 'tag',
}

export enum ElasticsearchAssetType {
index = 'index',
indexTemplate = 'index_template',
componentTemplate = 'component_template',
ingestPipeline = 'ingest_pipeline',
indexTemplate = 'index_template',
ilmPolicy = 'ilm_policy',
transform = 'transform',
dataStreamIlmPolicy = 'data_stream_ilm_policy',
transform = 'transform',
mlModel = 'ml_model',
}
export type FleetElasticsearchAssetType = Exclude<
ElasticsearchAssetType,
ElasticsearchAssetType.index
>;

export type AllowedAssetTypes = [
KibanaAssetType.dashboard,
KibanaAssetType.search,
KibanaAssetType.visualization,
ElasticsearchAssetType.transform
];
export type DisplayedAssetTypes = Array<`${KibanaSavedObjectType | ElasticsearchAssetType}`>;

// Defined as part of the removing public references to saved object schemas
export interface SimpleSOAssetType {
id: string;
type: ElasticsearchAssetType | KibanaSavedObjectType;
updatedAt?: string;
attributes: {
service?: string;
title?: string;
description?: string;
};
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/fleet/common/types/rest_spec/epm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ export interface GetBulkAssetsRequest {
}

export interface GetBulkAssetsResponse {
items: SimpleSOAssetType[];
items: Array<SimpleSOAssetType & { appLink?: string }>;
}

export interface GetInputsTemplatesRequest {
Expand Down

This file was deleted.

Loading