Skip to content

Commit d0c3a60

Browse files
authored
Merge pull request #611 from mapswipe/configurable-manager-dashboard
Configure project types available in manager dashboard
2 parents d983fbf + 2f28c36 commit d0c3a60

File tree

5 files changed

+35
-23
lines changed

5 files changed

+35
-23
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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 mapswipeProjectTypeOptions: {
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 crowdmapProjectTypeOptions: {
22+
value: ProjectType;
23+
label: string;
24+
}[] = [
25+
{ value: PROJECT_TYPE_BUILD_AREA, label: 'Build Area' },
26+
{ value: PROJECT_TYPE_COMPLETENESS, label: 'Completeness' },
27+
];
28+
29+
const projectTypeOptions = PROJECT_CONFIG_NAME === 'crowdmap' ? crowdmapProjectTypeOptions : mapswipeProjectTypeOptions;
30+
31+
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';

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,11 @@ import {
5555
tutorialFormSchema,
5656
TutorialFormType,
5757
PartialTutorialFormType,
58-
projectTypeOptions,
5958
} from './utils';
6059
import styles from './styles.css';
6160

61+
import projectTypeOptions from '#base/configs/projectTypes';
62+
6263
const defaultTutorialFormValue: PartialTutorialFormType = {
6364
projectType: PROJECT_TYPE_BUILD_AREA,
6465
zoomLevel: 18,

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

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,10 @@ import {
1717
getNoMoreThanNCharacterCondition,
1818
ProjectType,
1919
PROJECT_TYPE_BUILD_AREA,
20-
PROJECT_TYPE_FOOTPRINT,
2120
PROJECT_TYPE_CHANGE_DETECTION,
2221
PROJECT_TYPE_COMPLETENESS,
2322
} from '#utils/common';
2423

25-
export const projectTypeOptions: {
26-
value: ProjectType;
27-
label: string;
28-
}[] = [
29-
{ value: PROJECT_TYPE_BUILD_AREA, label: 'Build Area' },
30-
{ value: PROJECT_TYPE_FOOTPRINT, label: 'Footprint' },
31-
{ value: PROJECT_TYPE_CHANGE_DETECTION, label: 'Change Detection' },
32-
{ value: PROJECT_TYPE_COMPLETENESS, label: 'Completeness' },
33-
];
34-
3524
// FIXME: include here
3625
export interface TutorialFormType {
3726
lookFor: string;

0 commit comments

Comments
 (0)