diff --git a/.cypress/integration/9_integrations.spec.js b/.cypress/integration/9_integrations.spec.js index 6a6ad2fd5..4e93bf181 100644 --- a/.cypress/integration/9_integrations.spec.js +++ b/.cypress/integration/9_integrations.spec.js @@ -52,6 +52,22 @@ describe('Basic sanity test for integrations plugin', () => { cy.get('[data-test-subj="fields"]').click(); cy.get('[data-test-subj="nginx-fields"]').should('exist') }) + + it('Uses the search of assets and fields tables', () => { + moveToAvailableNginxIntegration(); + cy.get('input[type="search"]').eq(0).focus().type('ss4o{enter}'); + cy.get('.euiTableRow').should('have.length', 1);//Filters correctly to the index pattern + cy.get('[data-test-subj="fields"]').click(); + cy.get('input[type="search"]').eq(0).focus().clear().type('severity.observe') + cy.get('.euiTableRow').should('have.length', 2);//Filters correctly to the field name + }) + + it('Uses the filter of assets table', () => { + moveToAvailableNginxIntegration(); + cy.get('.euiFilterGroup').trigger('mouseover').click(); + cy.get('.euiFilterSelectItem').contains('visualization').click(); + cy.get('.euiTableRow').should('have.length', 4);//Filters correctly to visualization types + }) }); describe('Tests the add nginx integration instance flow', () => { @@ -73,6 +89,8 @@ describe('Tests the add nginx integration instance flow', () => { it('Navigates to installed integrations page and verifies that nginx-test exists', () => { moveToAddedIntegrations(); cy.contains(testInstance).should('exist'); + cy.get('input[type="search"]').eq(0).focus().type(`${testInstance}{enter}`); + cy.get('.euiTableRow').should('have.length', 1);//Filters correctly to the test integration instance cy.get(`[data-test-subj="${testInstance}IntegrationLink"]`).click(); }) diff --git a/public/components/integrations/components/added_integration_table.tsx b/public/components/integrations/components/added_integration_table.tsx index 4f99e848b..3072bbf39 100644 --- a/public/components/integrations/components/added_integration_table.tsx +++ b/public/components/integrations/components/added_integration_table.tsx @@ -139,12 +139,20 @@ export function AddedIntegrationsTable(props: AddedIntegrationsTableProps) { ], }; + const entries = integrations.map((integration) => { + const id = integration.id; + const templateName = integration.templateName; + const creationDate = integration.creationDate; + const name = integration.name; + return { id, templateName, creationDate, name, data: { templateName, name } }; + }); + return ( - {integrations && integrations.length > 0 ? ( + {entries && entries.length > 0 ? ( ( - {_.truncate(record.attributes.title ? record.attributes.title : '(Unnamed)', { + {_.truncate(record.name, { length: 100, })} @@ -54,7 +54,6 @@ export function IntegrationAssets(props: any) { { field: 'type', name: 'Type', - sortable: true, truncateText: true, render: (_value, record) => ( @@ -64,6 +63,17 @@ export function IntegrationAssets(props: any) { }, ] as Array>; + const entries = assets?.savedObjects + ? assets.savedObjects + .filter((x: any) => x.type !== undefined) + .map((asset: any) => { + const name = asset.attributes.title ? asset.attributes.title : '(Unnamed)'; + const type = asset.type; + const id = asset.id; + return { name, type, id, data: { name, type } }; + }) + : []; + return ( @@ -71,9 +81,7 @@ export function IntegrationAssets(props: any) { x.type !== undefined) : [] - } + items={entries} columns={tableColumns} pagination={{ initialPageSize: 10,