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

[Backport 2.17] Fix getting started cards re-direction to integrations #2149

Merged
merged 1 commit into from
Sep 9, 2024
Merged
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 @@ -3,25 +3,26 @@
* SPDX-License-Identifier: Apache-2.0
*/

import React, { useState, useEffect } from 'react';
import {
EuiBadge,
EuiCard,
EuiFieldSearch,
EuiFilterButton,
EuiFilterGroup,
EuiFilterSelectItem,
EuiPopover,
EuiPopoverTitle,
EuiFlexGroup,
EuiFlexItem,
EuiCard,
EuiText,
EuiBadge,
EuiPopover,
EuiPopoverTitle,
EuiSpacer,
EuiText,
} from '@elastic/eui';
import React, { useEffect, useState } from 'react';
import { observabilityIntegrationsID } from '../../../../common/constants/shared';
import { coreRefs } from '../../../../public/framework/core_refs';

export const IntegrationCards = () => {
const [integrationData, setIntegrationData] = useState<any[]>([]);

Check warning on line 25 in public/components/getting_started/components/getting_started_integrationCards.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
const [loading, setLoading] = useState(true);
const [query, setQuery] = useState('');
const [isPopoverOpen, setIsPopoverOpen] = useState(false);
Expand All @@ -33,7 +34,7 @@
const response = await coreRefs.http!.get(`/api/integrations/repository`);
const data = response.data.hits;
setIntegrationData(data);
const categories = Array.from(new Set(data.flatMap((item: any) => item.labels ?? [])));

Check warning on line 37 in public/components/getting_started/components/getting_started_integrationCards.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
setItems(categories.map((name) => ({ name, checked: false })));
} catch (error) {
console.error('Error fetching integration data:', error);
Expand Down Expand Up @@ -148,7 +149,11 @@
description={integration.description}
data-test-subj={`integration_card_${integration.name.toLowerCase()}`}
titleElement="span"
href={`/app/integrations#/available/${integration.name}`}
onClick={() =>
coreRefs?.application?.navigateToApp(observabilityIntegrationsID, {
path: `#/available/${integration.name}`,
})
}
footer={
<div>
{integration.labels &&
Expand Down
Loading