diff --git a/frontend/src/components/Tags/Tags.tsx b/frontend/src/components/Tags/Tags.tsx index ac38e0e58c..7257594e7e 100644 --- a/frontend/src/components/Tags/Tags.tsx +++ b/frontend/src/components/Tags/Tags.tsx @@ -5,7 +5,6 @@ import { Button } from 'antd'; import { Tag } from 'antd/lib'; import Input from 'components/Input'; import { Check, X } from 'lucide-react'; -import { TweenOneGroup } from 'rc-tween-one'; import React, { Dispatch, SetStateAction, useState } from 'react'; function Tags({ tags, setTags }: AddTagsProps): JSX.Element { @@ -46,41 +45,19 @@ function Tags({ tags, setTags }: AddTagsProps): JSX.Element { func(value); }; - const forMap = (tag: string): React.ReactElement => ( - - { - e.preventDefault(); - handleClose(tag); - }} - > - {tag} - - - ); - - const tagChild = tags.map(forMap); - - const renderTagsAnimated = (): React.ReactElement => ( - { - if (e.type === 'appear' || e.type === 'enter') { - (e.target as any).style = 'display: inline-block'; - } - }} - > - {tagChild} - - ); - return (
- {renderTagsAnimated()} + {tags.map((tag) => ( + handleClose(tag)} + > + {tag} + + ))} + {inputVisible && (
+
+ + + + Find your ingestion URL and learn more about sending data to SigNoz{' '} + + here + + +
+
Ingestion Keys - Create and manage ingestion keys for the SigNoz Cloud + Create and manage ingestion keys for the SigNoz Cloud{' '} + + {' '} + Learn more +
diff --git a/frontend/src/container/IngestionSettings/__tests__/MultiIngestionSettings.test.tsx b/frontend/src/container/IngestionSettings/__tests__/MultiIngestionSettings.test.tsx new file mode 100644 index 0000000000..36979a6e3f --- /dev/null +++ b/frontend/src/container/IngestionSettings/__tests__/MultiIngestionSettings.test.tsx @@ -0,0 +1,45 @@ +import { render, screen } from 'tests/test-utils'; + +import MultiIngestionSettings from '../MultiIngestionSettings'; + +describe('MultiIngestionSettings Page', () => { + beforeEach(() => { + render(); + }); + + afterEach(() => { + jest.clearAllMocks(); + }); + + it('renders MultiIngestionSettings page without crashing', () => { + expect( + screen.getByText( + 'Find your ingestion URL and learn more about sending data to SigNoz', + ), + ).toBeInTheDocument(); + + expect(screen.getByText('Ingestion Keys')).toBeInTheDocument(); + + expect( + screen.getByText('Create and manage ingestion keys for the SigNoz Cloud'), + ).toBeInTheDocument(); + + const overviewLink = screen.getByRole('link', { name: /here/i }); + expect(overviewLink).toHaveAttribute( + 'href', + 'https://signoz.io/docs/ingestion/signoz-cloud/overview/', + ); + expect(overviewLink).toHaveAttribute('target', '_blank'); + expect(overviewLink).toHaveClass('learn-more'); + expect(overviewLink).toHaveAttribute('rel', 'noreferrer'); + + const aboutKeyslink = screen.getByRole('link', { name: /Learn more/i }); + expect(aboutKeyslink).toHaveAttribute( + 'href', + 'https://signoz.io/docs/ingestion/signoz-cloud/keys/', + ); + expect(aboutKeyslink).toHaveAttribute('target', '_blank'); + expect(aboutKeyslink).toHaveClass('learn-more'); + expect(aboutKeyslink).toHaveAttribute('rel', 'noreferrer'); + }); +}); diff --git a/frontend/src/pages/Settings/utils.ts b/frontend/src/pages/Settings/utils.ts index 4d54c05603..d789e197d0 100644 --- a/frontend/src/pages/Settings/utils.ts +++ b/frontend/src/pages/Settings/utils.ts @@ -26,7 +26,10 @@ export const getRoutes = ( settings.push(...organizationSettings(t)); } - if (isGatewayEnabled && userRole === USER_ROLES.ADMIN) { + if ( + isGatewayEnabled && + (userRole === USER_ROLES.ADMIN || userRole === USER_ROLES.EDITOR) + ) { settings.push(...multiIngestionSettings(t)); }