From 389fc46dad9e08fa29de1ea3f60c820916f1cb1e Mon Sep 17 00:00:00 2001 From: Ben Elferink Date: Tue, 22 Oct 2024 14:50:42 +0300 Subject: [PATCH 1/5] fix: semicolon --- .../action-custom-fields.tsx | 36 ++--- .../main/actions/choose-action-body/index.tsx | 40 +++--- .../choose-action-modal/action-options.ts | 22 +-- .../actions/choose-action-modal/index.tsx | 46 +++--- .../webapp/hooks/actions/useActionFormData.ts | 48 +++---- .../auto-complete-input/index.tsx | 134 +++++++++--------- .../{DocsButton.tsx => docs-button.tsx} | 12 +- .../reuseable-components/button/index.tsx | 20 +-- .../checkbox-list/index.tsx | 40 +++--- frontend/webapp/reuseable-components/index.ts | 2 +- .../reuseable-components/input-list/index.tsx | 82 +++++------ .../key-value-input-list/index.tsx | 92 ++++++------ .../reuseable-components/text/index.tsx | 46 +++--- 13 files changed, 310 insertions(+), 310 deletions(-) rename frontend/webapp/reuseable-components/button/{DocsButton.tsx => docs-button.tsx} (81%) 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 index 7d782038c..637a332c9 100644 --- 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 @@ -1,21 +1,21 @@ -import styled from 'styled-components' -import { InputList, KeyValueInputsList, Text } from '@/reuseable-components' -import type { ActionsType } from '@/types' +import styled from 'styled-components'; +import { InputList, KeyValueInputsList, Text } from '@/reuseable-components'; +import type { ActionsType } from '@/types'; interface ActionCustomFieldsProps { - actionType?: ActionsType - value: any - setValue: (value: any) => void + 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) { @@ -25,7 +25,7 @@ const ActionCustomFields: React.FC = ({ actionType, val Attributes to add setValue(arr)} /> - ) + ); case 'DeleteAttribute': return ( @@ -33,7 +33,7 @@ const ActionCustomFields: React.FC = ({ actionType, val Attributes to delete setValue(arr)} /> - ) + ); case 'RenameAttribute': return ( @@ -41,7 +41,7 @@ const ActionCustomFields: React.FC = ({ actionType, val Attributes to rename setValue(arr)} /> - ) + ); case 'PiiMasking': return ( @@ -49,20 +49,20 @@ const ActionCustomFields: React.FC = ({ actionType, val Attributes to mask setValue(arr)} /> - ) + ); case 'ErrorSampler': - return null + return null; case 'ProbabilisticSampler': - return null + return null; case 'LatencySampler': - return null + return null; default: - return null + return null; } -} +}; -export default ActionCustomFields +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 index 4e2b20eef..2e2e6865e 100644 --- a/frontend/webapp/containers/main/actions/choose-action-body/index.tsx +++ b/frontend/webapp/containers/main/actions/choose-action-body/index.tsx @@ -1,38 +1,38 @@ -import React, { Fragment, useEffect, useMemo } from 'react' -import styled from 'styled-components' -import { CheckboxList, DocsButton, Input, Text, TextArea } from '@/reuseable-components' -import { MONITORING_OPTIONS } from '@/components/setup/destination/utils' -import { useActionFormData } from '@/hooks/actions/useActionFormData' -import ActionCustomFields from './action-custom-fields' -import { type ActionOption } from '../choose-action-modal/action-options' +import React, { Fragment, useEffect } from 'react'; +import styled from 'styled-components'; +import { CheckboxList, DocsButton, Input, Text, TextArea } from '@/reuseable-components'; +import { MONITORING_OPTIONS } from '@/components/setup/destination/utils'; +import { useActionFormData } from '@/hooks/actions/useActionFormData'; +import ActionCustomFields from './action-custom-fields'; +import { type ActionOption } from '../choose-action-modal/action-options'; 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 + action: ActionOption; } const ChooseActionBody: React.FC = ({ action }) => { - const { formData, handleFormChange, resetFormData, exportedSignals, setExportedSignals } = useActionFormData() + const { formData, handleFormChange, resetFormData, exportedSignals, setExportedSignals } = useActionFormData(); useEffect(() => { return () => { - resetFormData() - } - }, []) + resetFormData(); + }; + }, []); return ( @@ -47,8 +47,8 @@ const ChooseActionBody: React.FC = ({ action }) => { monitors={MONITORING_OPTIONS} exportedSignals={exportedSignals} handleSignalChange={(id, val) => { - const found = MONITORING_OPTIONS.find((item) => item.id === id) - if (found) setExportedSignals((prev) => ({ ...prev, [found.type]: val })) + const found = MONITORING_OPTIONS.find((item) => item.id === id); + if (found) setExportedSignals((prev) => ({ ...prev, [found.type]: val })); }} /> @@ -73,7 +73,7 @@ const ChooseActionBody: React.FC = ({ action }) => {