-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GEN-1730]: add "describe odigos" to UI (#1988)
This pull request introduces a new feature to describe Odigos and includes various changes to integrate this feature into the application. The most important changes include the addition of a new `DescribeOdigos` component, updates to existing components to incorporate this new feature, and the creation of a GraphQL query and hook for fetching Odigos data. ### New Feature: Describe Odigos * [`frontend/webapp/components/describe-odigos/index.tsx`](diffhunk://#diff-2e0eca8180f4d2737c72f676dc6caa03ab9295ad5a2d82a90d399e344e0b580eR1-R16): Added the `DescribeOdigos` component which includes an icon button to trigger the display of Odigos information. * [`frontend/webapp/graphql/queries/describe.ts`](diffhunk://#diff-1dd956050209ccf1d679de5ca93cc29b9ccddc56c27947dbf5f9255ea4b8d0c5R3-R143): Created a new GraphQL query `DESCRIBE_ODIGOS` to fetch Odigos data. * [`frontend/webapp/hooks/describe/useDescribeOdigos.ts`](diffhunk://#diff-f96e0d4e8e6b30c653c21364c7479cd8656417588a42c68aa9346c90e838d4ccR1-R15): Added a custom hook `useDescribeOdigos` to use the `DESCRIBE_ODIGOS` query. ### Component Integration * [`frontend/webapp/components/main/header/index.tsx`](diffhunk://#diff-2c96f91ec30d2116981a9c0a562820ff9fd87c8292cb5dca11a45d6fb2ac6c04L9-R9): Integrated the `DescribeOdigos` component into the main header. [[1]](diffhunk://#diff-2c96f91ec30d2116981a9c0a562820ff9fd87c8292cb5dca11a45d6fb2ac6c04L9-R9) [[2]](diffhunk://#diff-2c96f91ec30d2116981a9c0a562820ff9fd87c8292cb5dca11a45d6fb2ac6c04R45) * [`frontend/webapp/components/overview/all-drawers/index.tsx`](diffhunk://#diff-bf25245ffa5cb1c7ea54b941a97fc9f53caf28b7154cb4eda9b88c7b6f0944d1L2-R10): Updated the `AllDrawers` component to include a case for `DRAWER_OTHER_TYPES.DESCRIBE_ODIGOS`, which renders the `DescribeDrawer` component. [[1]](diffhunk://#diff-bf25245ffa5cb1c7ea54b941a97fc9f53caf28b7154cb4eda9b88c7b6f0944d1L2-R10) [[2]](diffhunk://#diff-bf25245ffa5cb1c7ea54b941a97fc9f53caf28b7154cb4eda9b88c7b6f0944d1R25-R27) ### Reusable Component Enhancements * [`frontend/webapp/reuseable-components/icon-button/index.tsx`](diffhunk://#diff-d02358b5454137fd2842c4765b1b55d50282fea6338be0617b67385956097896R1-R63): Created a new `IconButton` component with optional ping animation to be used in various parts of the application. ### Code Refactoring and Cleanup * [`frontend/webapp/components/index.ts`](diffhunk://#diff-9a255ecda06fb13562b464a919eb789a51ea8728251b2aa31c28babfd8f3405dL1-R7): Reordered exports for better organization and added export for the new `describe-odigos` component. * [`frontend/webapp/components/notification/notification-manager.tsx`](diffhunk://#diff-57b5151297ef94f210fd8223cf1e64f73a19c43cc5f57f94cc74338251942c35L9-R10): Replaced the custom `BellIcon` with the new `IconButton` component for consistency. [[1]](diffhunk://#diff-57b5151297ef94f210fd8223cf1e64f73a19c43cc5f57f94cc74338251942c35L9-R10) [[2]](diffhunk://#diff-57b5151297ef94f210fd8223cf1e64f73a19c43cc5f57f94cc74338251942c35L109-R87) * [`frontend/webapp/containers/main/overview/overview-drawer/index.tsx`](diffhunk://#diff-2410bbb07cf40a69a4bc6a34db093cdfcc2cb9d4b98b144a37a2c6a3e1a511ffL69-R71): Made several properties optional and added conditional checks to handle undefined properties gracefully. [[1]](diffhunk://#diff-2410bbb07cf40a69a4bc6a34db093cdfcc2cb9d4b98b144a37a2c6a3e1a511ffL69-R71) [[2]](diffhunk://#diff-2410bbb07cf40a69a4bc6a34db093cdfcc2cb9d4b98b144a37a2c6a3e1a511ffR90-R95) [[3]](diffhunk://#diff-732721edf7c32d883ffefa52d6e43339c6ee328c88c3cb5f0d87f6760347b599L17-R22) [[4]](diffhunk://#diff-732721edf7c32d883ffefa52d6e43339c6ee328c88c3cb5f0d87f6760347b599L37-R37) [[5]](diffhunk://#diff-732721edf7c32d883ffefa52d6e43339c6ee328c88c3cb5f0d87f6760347b599L55-R55) [[6]](diffhunk://#diff-732721edf7c32d883ffefa52d6e43339c6ee328c88c3cb5f0d87f6760347b599L67-R67) [[7]](diffhunk://#diff-732721edf7c32d883ffefa52d6e43339c6ee328c88c3cb5f0d87f6760347b599L81-R81) [[8]](diffhunk://#diff-732721edf7c32d883ffefa52d6e43339c6ee328c88c3cb5f0d87f6760347b599L90-R90) [[9]](diffhunk://#diff-732721edf7c32d883ffefa52d6e43339c6ee328c88c3cb5f0d87f6760347b599L106-R114) [[10]](diffhunk://#diff-732721edf7c32d883ffefa52d6e43339c6ee328c88c3cb5f0d87f6760347b599L116-R124)
- Loading branch information
1 parent
053aa80
commit 851beb4
Showing
22 changed files
with
393 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from 'react'; | ||
import Image from 'next/image'; | ||
import theme from '@/styles/theme'; | ||
import { IconButton } from '@/reuseable-components'; | ||
import { DRAWER_OTHER_TYPES, useDrawerStore } from '@/store'; | ||
|
||
export const DescribeOdigos = () => { | ||
const { setSelectedItem } = useDrawerStore(); | ||
const handleClick = () => setSelectedItem({ type: DRAWER_OTHER_TYPES.DESCRIBE_ODIGOS, id: DRAWER_OTHER_TYPES.DESCRIBE_ODIGOS }); | ||
|
||
return ( | ||
<IconButton onClick={handleClick} withPing pingColor={theme.colors.majestic_blue}> | ||
<Image src='/brand/odigos-icon.svg' alt='logo' width={16} height={16} /> | ||
</IconButton> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
export * from './setup'; | ||
export * from './overview'; | ||
export * from './common'; | ||
export * from './describe-odigos'; | ||
export * from './main'; | ||
export * from './modals'; | ||
export * from './notification'; | ||
export * from './overview'; | ||
export * from './setup'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
frontend/webapp/components/overview/all-drawers/describe-drawer.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
import { useDescribeOdigos } from '@/hooks'; | ||
import { DATA_CARDS, safeJsonStringify } from '@/utils'; | ||
import { DataCard, DataCardFieldTypes } from '@/reuseable-components'; | ||
import OverviewDrawer from '@/containers/main/overview/overview-drawer'; | ||
|
||
interface Props {} | ||
|
||
const DataContainer = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
gap: 12px; | ||
`; | ||
|
||
export const DescribeDrawer: React.FC<Props> = () => { | ||
const { data: describe } = useDescribeOdigos(); | ||
|
||
return ( | ||
<OverviewDrawer title={DATA_CARDS.DESCRIBE_ODIGOS} titleTooltip='' imageUri='/brand/odigos-icon.svg'> | ||
<DataContainer> | ||
<DataCard | ||
title='' | ||
data={[ | ||
{ | ||
type: DataCardFieldTypes.CODE, | ||
value: JSON.stringify({ language: 'json', code: safeJsonStringify(describe) }), | ||
}, | ||
]} | ||
/> | ||
</DataContainer> | ||
</OverviewDrawer> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.