From 0f59b55f3e0453d8a9e1489da371fb6e600f979b Mon Sep 17 00:00:00 2001 From: Marcin Maciaszczyk Date: Thu, 19 Dec 2024 15:37:51 +0100 Subject: [PATCH 1/4] s/Service Accounts/Service accounts --- assets/src/components/kubernetes/rbac/Rbac.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/src/components/kubernetes/rbac/Rbac.tsx b/assets/src/components/kubernetes/rbac/Rbac.tsx index 2ba4e960b8..3164b5a9b4 100644 --- a/assets/src/components/kubernetes/rbac/Rbac.tsx +++ b/assets/src/components/kubernetes/rbac/Rbac.tsx @@ -35,7 +35,7 @@ const directory = [ { path: ROLE_BINDINGS_REL_PATH, label: 'Role bindings' }, { path: CLUSTER_ROLES_REL_PATH, label: 'Cluster roles' }, { path: CLUSTER_ROLE_BINDINGS_REL_PATH, label: 'Cluster role bindings' }, - { path: SERVICE_ACCOUNTS_REL_PATH, label: 'Service Accounts' }, + { path: SERVICE_ACCOUNTS_REL_PATH, label: 'Service accounts' }, ] as const export default function Rbac() { From bb8d23031e498d1b09efe15e1d5a7914d30172c3 Mon Sep 17 00:00:00 2001 From: Marcin Maciaszczyk Date: Fri, 20 Dec 2024 11:45:22 +0100 Subject: [PATCH 2/4] hide configuration step if there are no configuration fields --- .../pr/automations/CreatePrModal.tsx | 44 +++++++++++-------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/assets/src/components/pr/automations/CreatePrModal.tsx b/assets/src/components/pr/automations/CreatePrModal.tsx index a3ecf1982e..98d5ce23c6 100644 --- a/assets/src/components/pr/automations/CreatePrModal.tsx +++ b/assets/src/components/pr/automations/CreatePrModal.tsx @@ -30,6 +30,7 @@ import { Body1BoldP, Body1P } from 'components/utils/typography/Text' import { PrConfigurationFields } from './PrConfigurationFields' import { validateAndFilterConfig } from './prConfigurationUtils' +import { isEmpty } from 'lodash' function CreateSuccess({ pr }: { pr: PullRequestFragment }) { const theme = useTheme() @@ -60,7 +61,10 @@ function CreatePrModalBase({ onClose: Nullable<() => void> }) { const configuration = prAutomation.configuration || [] - const [currentStep, setCurrentStep] = useState('config') + const hasConfiguration = !isEmpty(configuration) + const [currentStep, setCurrentStep] = useState( + hasConfiguration ? 'config' : 'review' + ) const stepIndex = steps.findIndex((s) => s.key === currentStep) const [configVals, setConfigVals] = useState( Object.fromEntries( @@ -184,12 +188,14 @@ function CreatePrModalBase({ > Create - + {hasConfiguration && ( + + )}