diff --git a/plugins/scaffolder/src/components/ActionsPage/ActionsPage.tsx b/plugins/scaffolder/src/components/ActionsPage/ActionsPage.tsx index 98beeaa997..df8ca2d760 100644 --- a/plugins/scaffolder/src/components/ActionsPage/ActionsPage.tsx +++ b/plugins/scaffolder/src/components/ActionsPage/ActionsPage.tsx @@ -25,17 +25,7 @@ import { Header, Page, } from '@backstage/core-components'; -import { - Accordion, - AccordionGroup, - AccordionPanel, - AccordionTrigger, - Flex, - List, - ListRow, - SearchField, - Text, -} from '@backstage/ui'; +import { Box, Flex, List, ListRow, SearchField, Text } from '@backstage/ui'; import { ScaffolderPageContextMenu } from '@backstage/plugin-scaffolder-react/alpha'; import { useNavigate } from 'react-router-dom'; import { @@ -66,46 +56,46 @@ function ActionDetail({ action }: { action: Action }) { } return ( - + {hasInput && ( - - - - - - + + + {t('actionsPage.action.input')} + + + )} {hasOutput && ( - - - - - - + + + {t('actionsPage.action.output')} + + + )} {hasExamples && ( - - - - - - + + + {t('actionsPage.action.examples')} + + + )} - + ); } @@ -176,57 +166,75 @@ export const ActionPageContent = () => { ); } - return ( - - - { - if (selection === 'all') { - return; + const listElement = ( + { + if (selection === 'all') { + return; + } + const selected = [...selection][0] as string | undefined; + setSelectedActionId(prev => (prev === selected ? undefined : selected)); + }} + > + {filteredActions.map(action => ( + - prev === selected ? undefined : selected, - ); - }} - > - {filteredActions.map(action => ( - - {action.id} - - ))} - - {selectedAction && ( - - - - {selectedAction.id} - - {selectedAction.description && ( - - {selectedAction.description} - - )} - - + > + {action.id} + + ))} + + ); + + if (!selectedAction) { + return ( + + + {listElement} + + ); + } + + return ( + + + + + {listElement} - )} + + + + + {selectedAction.id} + + {selectedAction.description && ( + + {selectedAction.description} + + )} + + + ); };