diff --git a/frontend/webapp/components/overview/actions/actions.table/actions.table.row.tsx b/frontend/webapp/components/overview/actions/actions.table/actions.table.row.tsx index 8d89c227b..383712998 100644 --- a/frontend/webapp/components/overview/actions/actions.table/actions.table.row.tsx +++ b/frontend/webapp/components/overview/actions/actions.table/actions.table.row.tsx @@ -6,7 +6,7 @@ import styled, { css } from 'styled-components'; import { KeyvalCheckbox, KeyvalText } from '@/design.system'; import ActionRowDynamicContent from './action.row.dynamic.content'; import { TapList } from '@/components/setup/destination/tap.list/tap.list'; -import { MONITORING_OPTIONS } from '@/components/setup/destination/utils'; +import { MONITORING_OPTIONS } from '@/utils/constants/monitors'; import { ActionIcon } from '../action.icon'; const StyledTr = styled.tr` diff --git a/frontend/webapp/components/overview/destination/manage.destination.header/manage.destination.header.tsx b/frontend/webapp/components/overview/destination/manage.destination.header/manage.destination.header.tsx index fb221b83d..90bcb5abd 100644 --- a/frontend/webapp/components/overview/destination/manage.destination.header/manage.destination.header.tsx +++ b/frontend/webapp/components/overview/destination/manage.destination.header/manage.destination.header.tsx @@ -3,6 +3,7 @@ import styled from 'styled-components'; import { KeyvalImage, KeyvalText } from '@/design.system'; import theme from '@/styles/palette'; import { LinkIcon } from '@keyval-dev/design-system'; +import { DOCS_LINK } from '@/utils'; const ManageDestinationHeaderWrapper = styled.div` display: flex; @@ -10,11 +11,7 @@ const ManageDestinationHeaderWrapper = styled.div` align-items: center; border-radius: 25px; margin: 24px 0; - background: radial-gradient( - 78.09% 72.18% at 100% -0%, - rgba(150, 242, 255, 0.4) 0%, - rgba(150, 242, 255, 0) 61.91% - ), + background: radial-gradient(78.09% 72.18% at 100% -0%, rgba(150, 242, 255, 0.4) 0%, rgba(150, 242, 255, 0) 61.91%), linear-gradient(180deg, #2e4c55 0%, #303355 100%); `; @@ -27,9 +24,7 @@ const IMAGE_STYLE: React.CSSProperties = { marginLeft: 16, }; -export function ManageDestinationHeader({ - data: { image_url, display_name, type }, -}) { +export function ManageDestinationHeader({ data: { image_url, display_name, type } }) { return ( @@ -37,15 +32,9 @@ export function ManageDestinationHeader({ {display_name} -
- window.open(`https://docs.odigos.io/backends/${type}`, '_blank') - } - > +
window.open(`${DOCS_LINK}/backends/${type}`, '_blank')}> - find out more about {display_name} in{' '} - our docs + find out more about {display_name} in our docs
diff --git a/frontend/webapp/components/overview/destination/managed.destination.table/destinations.table.row.tsx b/frontend/webapp/components/overview/destination/managed.destination.table/destinations.table.row.tsx index 3112f6964..7963c7861 100644 --- a/frontend/webapp/components/overview/destination/managed.destination.table/destinations.table.row.tsx +++ b/frontend/webapp/components/overview/destination/managed.destination.table/destinations.table.row.tsx @@ -3,7 +3,7 @@ import theme from '@/styles/palette'; import { Destination } from '@/types'; import styled, { css } from 'styled-components'; import { KeyvalImage, KeyvalText } from '@/design.system'; -import { MONITORING_OPTIONS } from '@/components/setup/destination/utils'; +import { MONITORING_OPTIONS } from '@/utils/constants/monitors'; import { TapList } from '@/components/setup/destination/tap.list/tap.list'; import { ConditionCheck } from '@/components/common'; diff --git a/frontend/webapp/components/setup/destination/destination.card/destination.card.tsx b/frontend/webapp/components/setup/destination/destination.card/destination.card.tsx index 163416787..a8586dac7 100644 --- a/frontend/webapp/components/setup/destination/destination.card/destination.card.tsx +++ b/frontend/webapp/components/setup/destination/destination.card/destination.card.tsx @@ -1,7 +1,7 @@ import React, { useMemo } from 'react'; import { KeyvalCard, KeyvalImage, KeyvalText } from '@/design.system'; import { TapList } from '../tap.list/tap.list'; -import { MONITORING_OPTIONS } from '../utils'; +import { MONITORING_OPTIONS } from '../../../../utils/constants/monitors'; import { ApplicationNameWrapper, DestinationCardContentWrapper, diff --git a/frontend/webapp/containers/main/actions/choose-action-body/action-custom-fields.tsx b/frontend/webapp/containers/main/actions/choose-action-body/action-custom-fields.tsx new file mode 100644 index 000000000..c3c94f01b --- /dev/null +++ b/frontend/webapp/containers/main/actions/choose-action-body/action-custom-fields.tsx @@ -0,0 +1,68 @@ +import styled from 'styled-components'; +import { InputList, KeyValueInputsList, Text } from '@/reuseable-components'; +import { ActionsType } from '@/types'; + +interface ActionCustomFieldsProps { + actionType?: ActionsType; + value: any; + setValue: (value: any) => void; +} + +const FieldWrapper = styled.div` + width: 100%; + margin: 8px 0; +`; + +const FieldTitle = styled(Text)` + margin-bottom: 12px; +`; + +const ActionCustomFields: React.FC = ({ actionType, value, setValue }) => { + switch (actionType) { + case ActionsType.ADD_CLUSTER_INFO: + return ( + + Attributes to add + setValue(arr)} /> + + ); + + case ActionsType.DELETE_ATTRIBUTES: + return ( + + Attributes to delete + setValue(arr)} /> + + ); + + case ActionsType.RENAME_ATTRIBUTES: + return ( + + Attributes to rename + setValue(arr)} /> + + ); + + case ActionsType.PII_MASKING: + return ( + + Attributes to mask + setValue(arr)} /> + + ); + + case ActionsType.ERROR_SAMPLER: + return null; + + case ActionsType.PROBABILISTIC_SAMPLER: + return null; + + case ActionsType.LATENCY_SAMPLER: + return null; + + default: + return null; + } +}; + +export default ActionCustomFields; diff --git a/frontend/webapp/containers/main/actions/choose-action-body/index.tsx b/frontend/webapp/containers/main/actions/choose-action-body/index.tsx new file mode 100644 index 000000000..682a4bfb4 --- /dev/null +++ b/frontend/webapp/containers/main/actions/choose-action-body/index.tsx @@ -0,0 +1,69 @@ +import React from 'react'; +import styled from 'styled-components'; +import ActionCustomFields from './action-custom-fields'; +import { ActionFormData } from '@/hooks/actions/useActionFormData'; +import { type ActionOption } from '../choose-action-modal/action-options'; +import { DocsButton, Input, Text, TextArea } from '@/reuseable-components'; +import { MonitoringCheckboxes } from '@/reuseable-components/monitoring-checkboxes'; + +const Description = styled(Text)` + color: ${({ theme }) => theme.text.grey}; + line-height: 150%; + display: flex; +`; + +const FieldWrapper = styled.div` + width: 100%; + margin: 8px 0; +`; + +const FieldTitle = styled(Text)` + margin-bottom: 12px; +`; + +interface ChooseActionContentProps { + action: ActionOption; + formData: ActionFormData; + handleFormChange: (key: keyof ActionFormData, val: any) => void; +} + +const ChooseActionBody: React.FC = ({ action, formData, handleFormChange }) => { + return ( + <> + + {action.docsDescription} + + + + + handleFormChange('signals', value)} + /> + + + + Action name + handleFormChange('name', value)} + /> + + + handleFormChange('details', JSON.stringify(val))} + /> + + + Notes +