-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This pull request includes several updates to the frontend web application, focusing on adding new components, refactoring existing ones, and updating styles. The most important changes include the addition of new dropdown components, updates to modals and notifications, and various refactoring tasks to improve code readability and maintainability. ### New Components and Features: * Added `LanguageDropdown` component to the dropdowns directory. (`frontend/webapp/components/common/dropdowns/language-dropdown/index.tsx`) * Exported the new `LanguageDropdown` from the dropdowns index. (`frontend/webapp/components/common/dropdowns/index.ts`) ### Refactoring and Code Simplification: * Renamed and refactored `build-card-from-action-spec.ts` to `build-card.ts` and updated its usage. (`frontend/webapp/containers/main/actions/action-drawer/build-card.ts`, `frontend/webapp/containers/main/actions/action-drawer/index.tsx`) [[1]](diffhunk://#diff-dc7aa9e456bfd94740ecdfc9843bd6440126ab0d2c3cea06ccb0c825796d0ba7L3-R3) [[2]](diffhunk://#diff-5f56695cd2d0ca6bcd28f372653c71d8c4dab572b08715c1f36b7acc5cf50f60R2-R50) * Moved `AllDrawers` and `AllModals` components from containers to components directory and updated imports accordingly. (`frontend/webapp/components/overview/all-drawers/index.tsx`, `frontend/webapp/components/overview/all-modals/index.tsx`) [[1]](diffhunk://#diff-bf25245ffa5cb1c7ea54b941a97fc9f53caf28b7154cb4eda9b88c7b6f0944d1L3-R4) [[2]](diffhunk://#diff-e669f68767681c3105913e5f1a53f358e0f77a9f8c866cef2dbe5c507188380bL3-R4) ### Style Updates: * Updated background color for `HeaderContainer` in both main and setup headers to use `darker_grey`. (`frontend/webapp/components/main/header/index.tsx`, `frontend/webapp/components/setup/header/index.tsx`) [[1]](diffhunk://#diff-2c96f91ec30d2116981a9c0a562820ff9fd87c8292cb5dca11a45d6fb2ac6c04L19-R19) [[2]](diffhunk://#diff-b797fa218a1303de084fa2eed814d4512fb9cb215a914c0adfaee658d7558db9L21-R21) ### Modals and Notifications: * Updated `CancelWarning` and `DeleteWarning` modal button texts to be more descriptive. (`frontend/webapp/components/modals/cancel-warning/index.tsx`, `frontend/webapp/components/modals/delete-warning/index.tsx`) [[1]](diffhunk://#diff-c197a79280b54ef188b35a5e804a91ff95db0b8137b0f2c7f8dacd545a4f4650L18-R20) [[2]](diffhunk://#diff-4f8fac3da993d379d6710a6607b6f25708649cb2da5b4a5f433f8e62dde1d03fL27-R32) * Refactored `ToastList` component and updated its export method. (`frontend/webapp/components/notification/toast-list.tsx`, `frontend/webapp/components/notification/index.ts`) [[1]](diffhunk://#diff-c6ead7587d1e5c52295c921dde2a1a5b9b06977ab3900c7dbf475c47cc1c664cL20-R20) [[2]](diffhunk://#diff-b0bf2162cde911ad526b7496ce073fa39b64f7f7e030241c3a59610d7dea2081R1-R4) ### Utility and Hook Updates: * Added `BACKEND_BOOLEAN` utility to the `ErrorDropdown` component for better readability and consistency. (`frontend/webapp/components/common/dropdowns/error-dropdown/index.tsx`) [[1]](diffhunk://#diff-587e573502656d446fed8f02b5190cd43c67a9261dcb74cd077f37cbe8b93839R4) [[2]](diffhunk://#diff-587e573502656d446fed8f02b5190cd43c67a9261dcb74cd077f37cbe8b93839L24-R25) These changes collectively improve the structure, readability, and functionality of the frontend web application. --------- Co-authored-by: Alon Braymok <138359965+alonkeyval@users.noreply.github.com>
- Loading branch information
1 parent
921a378
commit 1205f01
Showing
89 changed files
with
1,321 additions
and
960 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export * from './error-dropdown'; | ||
export * from './language-dropdown'; | ||
export * from './monitor-dropdown'; | ||
export * from './namespace-dropdown'; | ||
export * from './type-dropdown'; |
34 changes: 34 additions & 0 deletions
34
frontend/webapp/components/common/dropdowns/language-dropdown/index.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, { useMemo } from 'react'; | ||
import { useSourceCRUD } from '@/hooks'; | ||
import { DropdownOption } from '@/types'; | ||
import { Dropdown } from '@/reuseable-components'; | ||
|
||
interface Props { | ||
title?: string; | ||
value?: DropdownOption[]; | ||
onSelect: (val: DropdownOption) => void; | ||
onDeselect: (val: DropdownOption) => void; | ||
isMulti?: boolean; | ||
required?: boolean; | ||
showSearch?: boolean; | ||
} | ||
|
||
export const LanguageDropdown: React.FC<Props> = ({ title = 'Programming Languages', value, onSelect, onDeselect, ...props }) => { | ||
const { sources } = useSourceCRUD(); | ||
|
||
const options = useMemo(() => { | ||
const payload: DropdownOption[] = []; | ||
|
||
sources.forEach(({ instrumentedApplicationDetails: { containers } }) => { | ||
containers.forEach(({ language }) => { | ||
if (!payload.find((opt) => opt.id === language)) { | ||
payload.push({ id: language, value: language }); | ||
} | ||
}); | ||
}); | ||
|
||
return payload.sort((a, b) => a.id.localeCompare(b.id)); | ||
}, [sources]); | ||
|
||
return <Dropdown title={title} placeholder='All' options={options} value={value} onSelect={onSelect} onDeselect={onDeselect} {...props} />; | ||
}; |
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
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,4 @@ | ||
export * from './notification-manager'; | ||
import ToastList from './toast-list'; | ||
|
||
export { ToastList }; |
This file was deleted.
Oops, something went wrong.
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
5 changes: 1 addition & 4 deletions
5
...iners/main/overview/all-drawers/index.tsx → ...components/overview/all-drawers/index.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
5 changes: 1 addition & 4 deletions
5
...ainers/main/overview/all-modals/index.tsx → .../components/overview/all-modals/index.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
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,6 @@ | ||
export * from './add-entity'; | ||
import AllDrawers from './all-drawers'; | ||
import AllModals from './all-modals'; | ||
export * from './monitors-legend'; | ||
|
||
export { AllDrawers, AllModals }; |
This file was deleted.
Oops, something went wrong.
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
21 changes: 21 additions & 0 deletions
21
frontend/webapp/containers/main/actions/action-drawer/build-drawer-item.ts
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,21 @@ | ||
import { safeJsonParse } from '@/utils'; | ||
import type { ActionDataParsed, ActionInput } from '@/types'; | ||
|
||
const buildDrawerItem = (id: string, formData: ActionInput, drawerItem: ActionDataParsed): ActionDataParsed => { | ||
const { type, name, notes, signals, disable, details } = formData; | ||
const {} = drawerItem; | ||
|
||
return { | ||
id, | ||
type, | ||
spec: { | ||
actionName: name, | ||
notes: notes, | ||
signals: signals, | ||
disabled: disable, | ||
...safeJsonParse(details, {}), | ||
}, | ||
}; | ||
}; | ||
|
||
export default buildDrawerItem; |
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.