Skip to content

Commit b781f09

Browse files
committed
move projectTypeOptions to config file for NewProject
1 parent 2616fed commit b781f09

File tree

3 files changed

+35
-11
lines changed

3 files changed

+35
-11
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import {
2+
ProjectType,
3+
PROJECT_TYPE_BUILD_AREA,
4+
PROJECT_TYPE_FOOTPRINT,
5+
PROJECT_TYPE_CHANGE_DETECTION,
6+
PROJECT_TYPE_COMPLETENESS,
7+
} from '#utils/common';
8+
9+
const PROJECT_CONFIG_NAME = process.env.REACT_APP_PROJECT_CONFIG_NAME as string;
10+
11+
const defaultProjectTypeOptions: {
12+
value: ProjectType;
13+
label: string;
14+
}[] = [
15+
{ value: PROJECT_TYPE_BUILD_AREA, label: 'Build Area' },
16+
{ value: PROJECT_TYPE_FOOTPRINT, label: 'Footprint' },
17+
{ value: PROJECT_TYPE_CHANGE_DETECTION, label: 'Change Detection' },
18+
{ value: PROJECT_TYPE_COMPLETENESS, label: 'Completeness' },
19+
];
20+
21+
const developmentProjectTypeOptions: {
22+
value: ProjectType;
23+
label: string;
24+
}[] = [
25+
{ value: PROJECT_TYPE_BUILD_AREA, label: 'Build Area' },
26+
{ value: PROJECT_TYPE_FOOTPRINT, label: 'Footprint' },
27+
{ value: PROJECT_TYPE_CHANGE_DETECTION, label: 'Change Detection' },
28+
// { value: PROJECT_TYPE_COMPLETENESS, label: 'Completeness' },
29+
];
30+
31+
const projectTypeOptions = PROJECT_CONFIG_NAME === 'development' ? developmentProjectTypeOptions : defaultProjectTypeOptions;
32+
33+
export default projectTypeOptions;

manager-dashboard/app/views/NewProject/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ import {
6262
projectFormSchema,
6363
ProjectFormType,
6464
PartialProjectFormType,
65-
projectTypeOptions,
6665
projectInputTypeOptions,
6766
filterOptions,
6867
PROJECT_INPUT_TYPE_UPLOAD,
@@ -78,6 +77,8 @@ import {
7877
import useProjectOptions from './useProjectOptions';
7978
import styles from './styles.css';
8079

80+
import projectTypeOptions from '#base/configs/projectTypes';
81+
8182
const defaultProjectFormValue: PartialProjectFormType = {
8283
projectType: PROJECT_TYPE_BUILD_AREA,
8384
projectNumber: 1,

manager-dashboard/app/views/NewProject/utils.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,6 @@ export interface ProjectFormType {
5858
tileServerB?: TileServer;
5959
}
6060

61-
export const projectTypeOptions: {
62-
value: ProjectType;
63-
label: string;
64-
}[] = [
65-
{ value: PROJECT_TYPE_BUILD_AREA, label: 'Build Area' },
66-
{ value: PROJECT_TYPE_FOOTPRINT, label: 'Footprint' },
67-
{ value: PROJECT_TYPE_CHANGE_DETECTION, label: 'Change Detection' },
68-
{ value: PROJECT_TYPE_COMPLETENESS, label: 'Completeness' },
69-
];
70-
7161
export const PROJECT_INPUT_TYPE_UPLOAD = 'aoi_file';
7262
export const PROJECT_INPUT_TYPE_LINK = 'link';
7363
export const PROJECT_INPUT_TYPE_TASKING_MANAGER_ID = 'TMId';

0 commit comments

Comments
 (0)