Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
BenElferink committed Nov 25, 2024
2 parents cbbf379 + c0939f7 commit 85508e1
Show file tree
Hide file tree
Showing 68 changed files with 906 additions and 1,226 deletions.
4 changes: 2 additions & 2 deletions frontend/webapp/app/(setup)/choose-destination/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
import React from 'react';
import { SideMenu } from '@/components';
import { SideMenuWrapper } from '../styled';
import { ChooseDestinationContainer } from '@/containers/main';
import { AddDestinationContainer } from '@/containers/main';

export default function ChooseDestinationPage() {
return (
<>
<SideMenuWrapper>
<SideMenu currentStep={3} />
</SideMenuWrapper>
<ChooseDestinationContainer />
<AddDestinationContainer />
</>
);
}

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions frontend/webapp/components/destinations/index.ts

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion frontend/webapp/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
export * from './setup';
export * from './overview';
export * from './common';
export * from './destinations';
export * from './main';
export * from './modals';
export * from './notification';
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import React, { useMemo, useState } from 'react';
import { ActionFormBody } from '../';
import styled from 'styled-components';
import { getActionIcon } from '@/utils';
import { useDrawerStore } from '@/store';
import { CardDetails } from '@/components';
import type { ActionDataParsed } from '@/types';
import { ChooseActionBody } from '../choose-action-body';
import { useActionCRUD, useActionFormData } from '@/hooks';
import OverviewDrawer from '../../overview/overview-drawer';
import { ACTION_OPTIONS } from '../action-modal/action-options';
import buildCardFromActionSpec from './build-card-from-action-spec';
import { ACTION_OPTIONS } from '../choose-action-modal/action-options';

interface Props {}

Expand Down Expand Up @@ -36,7 +36,10 @@ const ActionDrawer: React.FC<Props> = () => {
}

const { item } = selectedItem as { item: ActionDataParsed };
const found = ACTION_OPTIONS.find(({ type }) => type === item.type) || ACTION_OPTIONS.find(({ id }) => id === 'sampler')?.items?.find(({ type }) => type === item.type);
const found =
ACTION_OPTIONS.find(({ type }) => type === item.type) ||
ACTION_OPTIONS.find(({ id }) => id === 'attributes')?.items?.find(({ type }) => type === item.type) ||
ACTION_OPTIONS.find(({ id }) => id === 'sampler')?.items?.find(({ type }) => type === item.type);

if (!found) return undefined;

Expand Down Expand Up @@ -86,7 +89,7 @@ const ActionDrawer: React.FC<Props> = () => {
>
{isEditing && thisAction ? (
<FormContainer>
<ChooseActionBody
<ActionFormBody
isUpdate
action={thisAction}
formData={formData}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import React from 'react';
import styled from 'styled-components';
import { type ActionInput } from '@/types';
import ActionCustomFields from './custom-fields';
import { type ActionOption } from '../choose-action-modal/action-options';
import { type ActionOption } from '../action-modal/action-options';
import { DocsButton, Input, Text, TextArea, MonitoringCheckboxes, SectionTitle, ToggleButtons } from '@/reuseable-components';

interface ChooseActionContentProps {
interface Props {
isUpdate?: boolean;
action: ActionOption;
formData: ActionInput;
Expand All @@ -23,7 +23,7 @@ const FieldTitle = styled(Text)`
margin-bottom: 12px;
`;

const ChooseActionBody: React.FC<ChooseActionContentProps> = ({ isUpdate, action, formData, handleFormChange }) => {
export const ActionFormBody: React.FC<Props> = ({ isUpdate, action, formData, handleFormChange }) => {
return (
<Container>
{isUpdate && (
Expand All @@ -45,5 +45,3 @@ const ChooseActionBody: React.FC<ChooseActionContentProps> = ({ isUpdate, action
</Container>
);
};

export { ChooseActionBody };
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { ChooseActionBody } from '../';
import { ActionFormBody } from '../';
import React, { useMemo, useState } from 'react';
import { CenterThis, ModalBody } from '@/styles';
import { useActionCRUD, useActionFormData } from '@/hooks/actions';
import { ACTION_OPTIONS, type ActionOption } from './action-options';
import { AutocompleteInput, Modal, NavigationButtons, Divider, FadeLoader, SectionTitle } from '@/reuseable-components';

interface AddActionModalProps {
interface Props {
isOpen: boolean;
onClose: () => void;
}

export const AddActionModal: React.FC<AddActionModalProps> = ({ isOpen, onClose }) => {
export const ActionModal: React.FC<Props> = ({ isOpen, onClose }) => {
const { formData, handleFormChange, resetFormData, validateForm } = useActionFormData();
const { createAction, loading } = useActionCRUD({ onSuccess: handleClose });
const [selectedItem, setSelectedItem] = useState<ActionOption | undefined>(undefined);
Expand Down Expand Up @@ -64,7 +64,7 @@ export const AddActionModal: React.FC<AddActionModalProps> = ({ isOpen, onClose
<FadeLoader cssOverride={{ scale: 2 }} />
</CenterThis>
) : (
<ChooseActionBody action={selectedItem} formData={formData} handleFormChange={handleFormChange} />
<ActionFormBody action={selectedItem} formData={formData} handleFormChange={handleFormChange} />
)}
</div>
) : null}
Expand Down
6 changes: 3 additions & 3 deletions frontend/webapp/containers/main/actions/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * from './choose-action-modal';
export * from './choose-action-body';
export * from './action-drawer-container';
export * from './action-modal';
export * from './action-form-body';
export * from './action-drawer';

This file was deleted.

Loading

0 comments on commit 85508e1

Please sign in to comment.