Skip to content

Commit 72462d2

Browse files
committed
When upstream, just using konveyor-forklift instead of ENV variable for default namespace
Signed-off-by: Jeff Puzzo <[email protected]>
1 parent 608690f commit 72462d2

File tree

2 files changed

+6
-16
lines changed

2 files changed

+6
-16
lines changed

packages/forklift-console-plugin/src/components/common/ProjectNameSelect.tsx

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React from 'react';
2-
import { Namespace, useForkliftTranslation } from 'src/utils';
1+
import React, { FC, ReactNode } from 'react';
2+
import { useForkliftTranslation } from 'src/utils';
33

44
import { FormGroupWithHelpText, TypeaheadSelect, TypeaheadSelectOption } from '@kubev2v/common';
55
import {
@@ -15,10 +15,10 @@ interface ProjectNameSelectProps {
1515
options: TypeaheadSelectOption[];
1616
onSelect: (value: string) => void;
1717
isDisabled?: boolean;
18-
popoverHelpContent?: React.ReactNode;
18+
popoverHelpContent?: ReactNode;
1919
}
2020

21-
export const ProjectNameSelect: React.FC<ProjectNameSelectProps> = ({
21+
export const ProjectNameSelect: FC<ProjectNameSelectProps> = ({
2222
value,
2323
options,
2424
isDisabled,
@@ -27,15 +27,6 @@ export const ProjectNameSelect: React.FC<ProjectNameSelectProps> = ({
2727
}) => {
2828
const { t } = useForkliftTranslation();
2929

30-
// Fallback to "default" when the initial value does not exist within options
31-
React.useEffect(() => {
32-
const hasOptionValue = options.find((option) => option.name === value);
33-
34-
if (!hasOptionValue) {
35-
onSelect(Namespace.Default);
36-
}
37-
}, []);
38-
3930
return (
4031
<FormGroupWithHelpText
4132
label={t('Project')}

packages/forklift-console-plugin/src/utils/namespaces.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@ import { Namespace } from './constants';
22
import { isUpstream } from './env';
33

44
/**
5-
* When using an upstream build, use the env default namespace
6-
* with a fallback of 'default', otherwise use 'openshift-mtv'.
5+
* When using an upstream build use 'konveyor-forklift', otherwise 'openshift-mtv'.
76
* @returns string
87
*/
98
export const getDefaultNamespace = (): string => {
109
const isUserUpstream = isUpstream();
1110

1211
if (isUserUpstream) {
13-
return process.env.DEFAULT_NAMESPACE || Namespace.Default;
12+
return Namespace.KonveyorForklift;
1413
}
1514

1615
return Namespace.OpenshiftMtv;

0 commit comments

Comments
 (0)