diff --git a/src/components/organisms/NavigatorPane/NavigatorPane.tsx b/src/components/organisms/NavigatorPane/NavigatorPane.tsx index 45fd37c58b..64ed970271 100644 --- a/src/components/organisms/NavigatorPane/NavigatorPane.tsx +++ b/src/components/organisms/NavigatorPane/NavigatorPane.tsx @@ -7,6 +7,7 @@ import { helmChartsSelector, helmValuesSelector, kustomizationsSelector, + isInPreviewModeSelector, } from '@redux/selectors'; import {HelmValuesFile} from '@models/helm'; @@ -148,6 +149,7 @@ const NavigatorPane = () => { const helmValues = useSelector(helmValuesSelector); const kustomizations = useSelector(kustomizationsSelector); const isInClusterMode = useSelector(isInClusterModeSelector); + const isInPreviewMode = useSelector(isInPreviewModeSelector); const [isValidationsErrorsModalVisible, setValidationsErrorsVisible] = useState(false); const [currentValidationErrors, setCurrentValidationErrors] = useState([]); @@ -205,7 +207,7 @@ const NavigatorPane = () => { Navigator { const dispatch = useAppDispatch(); const isNewResourceWizardOpen = useAppSelector(state => state.ui.isNewResourceWizardOpen); @@ -15,7 +16,7 @@ const NewResourceWizard = () => { const [namespaces, setNamespaces] = useState([]); useEffect(() => { - setNamespaces([...new Set(['default', ...getNamespaces(resourceMap)])]); + setNamespaces([...new Set([NO_NAMESPACE, 'default', ...getNamespaces(resourceMap)])]); }, [resourceMap]); const [form] = Form.useForm(); @@ -53,7 +54,7 @@ const NewResourceWizard = () => { { name: data.name, kind: data.kind, - namespace: data.namespace, + namespace: data.namespace === NO_NAMESPACE ? undefined : data.namespace, apiVersion: data.apiVersion, }, dispatch @@ -94,7 +95,7 @@ const NewResourceWizard = () => { name="namespace" label="Namespace" tooltip={{title: 'Select the namespace', icon: }} - initialValue="default" + initialValue={NO_NAMESPACE} >