Skip to content

Commit

Permalink
Remove Accordion from Microservice Configuration Setup
Browse files Browse the repository at this point in the history
  • Loading branch information
N00bG1rl committed Sep 25, 2023
1 parent 938d278 commit 705964d
Showing 1 changed file with 29 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { useNavigate } from 'react-router-dom';

import { Box } from '@mui/material';

import { Accordion, AlertDialog, Button, Form, FullPageLoadingSpinner } from '@dolittle/design-system';
import { AlertDialog, Button, Form, FullPageLoadingSpinner } from '@dolittle/design-system';

import { canDeleteMicroservice, deleteMicroservice, MicroserviceStore } from '../../../../stores/microservice';

Expand Down Expand Up @@ -122,36 +122,34 @@ export const SetupSection = ({ application, currentMicroservice }: SetupSectionP
handleSuccess={() => window.location.reload()}
/>

<Accordion id='setup-accordion' title='Configuration Setup' defaultExpanded>
<Form<MicroserviceFormParameters>
initialValues={{
microserviceName,
developmentEnvironment: microserviceEnvironment,
runtimeVersion: currentRuntimeImageNumber,
headImage: microserviceInfo?.headImage,
headPort: microserviceInfo?.headPort,
entrypoint: '',
isPublic: hasPublicUrl,
headArguments: headArgumentValues,
ingressPath: cleanedIngressPath,
hasM3Connector: hasM3ConnectorOption,
}}
onSubmit={handleMicroserviceEdit}
sx={{ '& .MuiFormControl-root': { my: 1 } }}
>
<Box sx={{ 'mb': 3, '& button': { 'mr': 2, ':last-of-type': { mr: 0 } } }}>
<Button label='edit' disabled={editMicroserviceMode} startWithIcon='EditRounded' onClick={() => setEditMicroserviceMode(true)} />
<Button label='save' type='submit' disabled={!editMicroserviceMode} startWithIcon='SaveRounded' onClick={() => setEditMicroserviceMode(false)} />
<Button label='Restart Microservice' startWithIcon='RestartAltRounded' onClick={() => setRestartDialogIsOpen(true)} />
<Button label='Delete Microservice' startWithIcon='DeleteRounded' onClick={() => setDeleteDialogIsOpen(true)} />
</Box>

<SetupFields environments={availableEnvironments} hasDashedBorder isEditMode={!editMicroserviceMode} isDisabled />
<ContainerImageFields hasDashedBorder isEditMode={!editMicroserviceMode} isDisabled />
<PublicUrlFields hasDashedBorder hasPublicUrl={hasPublicUrl} isDisabled />
{hasM3ConnectorOption && <HasM3ConnectorField isDisabled />}
</Form>
</Accordion>
<Form<MicroserviceFormParameters>
initialValues={{
microserviceName,
developmentEnvironment: microserviceEnvironment,
runtimeVersion: currentRuntimeImageNumber,
headImage: microserviceInfo?.headImage,
headPort: microserviceInfo?.headPort,
entrypoint: '',
isPublic: hasPublicUrl,
headArguments: headArgumentValues,
ingressPath: cleanedIngressPath,
hasM3Connector: hasM3ConnectorOption,
}}
onSubmit={handleMicroserviceEdit}
sx={{ 'ml': 2, '& .MuiFormControl-root': { my: 1 } }}
>
<Box sx={{ 'mb': 3, '& button': { 'mr': 2, ':last-of-type': { mr: 0 } } }}>
<Button label='edit' disabled={editMicroserviceMode} startWithIcon='EditRounded' onClick={() => setEditMicroserviceMode(true)} />
<Button label='save' type='submit' disabled={!editMicroserviceMode} startWithIcon='SaveRounded' onClick={() => setEditMicroserviceMode(false)} />
<Button label='Restart Microservice' startWithIcon='RestartAltRounded' onClick={() => setRestartDialogIsOpen(true)} />
<Button label='Delete Microservice' startWithIcon='DeleteRounded' onClick={() => setDeleteDialogIsOpen(true)} />
</Box>

<SetupFields environments={availableEnvironments} hasDashedBorder isEditMode={!editMicroserviceMode} isDisabled />
<ContainerImageFields hasDashedBorder isEditMode={!editMicroserviceMode} isDisabled />
<PublicUrlFields hasDashedBorder hasPublicUrl={hasPublicUrl} isDisabled />
{hasM3ConnectorOption && <HasM3ConnectorField isDisabled />}
</Form>
</>
);
};

0 comments on commit 705964d

Please sign in to comment.