Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions manager-dashboard/app/Base/configs/projectTypes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import {
ProjectType,
PROJECT_TYPE_BUILD_AREA,
PROJECT_TYPE_FOOTPRINT,
PROJECT_TYPE_CHANGE_DETECTION,
PROJECT_TYPE_COMPLETENESS,
} from '#utils/common';

const PROJECT_CONFIG_NAME = process.env.REACT_APP_PROJECT_CONFIG_NAME as string;

const mapswipeProjectTypeOptions: {
value: ProjectType;
label: string;
}[] = [
{ value: PROJECT_TYPE_BUILD_AREA, label: 'Build Area' },
{ value: PROJECT_TYPE_FOOTPRINT, label: 'Footprint' },
{ value: PROJECT_TYPE_CHANGE_DETECTION, label: 'Change Detection' },
{ value: PROJECT_TYPE_COMPLETENESS, label: 'Completeness' },
];

const crowdmapProjectTypeOptions: {
value: ProjectType;
label: string;
}[] = [
{ value: PROJECT_TYPE_BUILD_AREA, label: 'Build Area' },
{ value: PROJECT_TYPE_COMPLETENESS, label: 'Completeness' },
];

const projectTypeOptions = PROJECT_CONFIG_NAME === 'crowdmap' ? crowdmapProjectTypeOptions : mapswipeProjectTypeOptions;

export default projectTypeOptions;
3 changes: 2 additions & 1 deletion manager-dashboard/app/views/NewProject/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ import {
projectFormSchema,
ProjectFormType,
PartialProjectFormType,
projectTypeOptions,
projectInputTypeOptions,
filterOptions,
PROJECT_INPUT_TYPE_UPLOAD,
Expand All @@ -78,6 +77,8 @@ import {
import useProjectOptions from './useProjectOptions';
import styles from './styles.css';

import projectTypeOptions from '#base/configs/projectTypes';

const defaultProjectFormValue: PartialProjectFormType = {
projectType: PROJECT_TYPE_BUILD_AREA,
projectNumber: 1,
Expand Down
10 changes: 0 additions & 10 deletions manager-dashboard/app/views/NewProject/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,6 @@ export interface ProjectFormType {
tileServerB?: TileServer;
}

export const projectTypeOptions: {
value: ProjectType;
label: string;
}[] = [
{ value: PROJECT_TYPE_BUILD_AREA, label: 'Build Area' },
{ value: PROJECT_TYPE_FOOTPRINT, label: 'Footprint' },
{ value: PROJECT_TYPE_CHANGE_DETECTION, label: 'Change Detection' },
{ value: PROJECT_TYPE_COMPLETENESS, label: 'Completeness' },
];

export const PROJECT_INPUT_TYPE_UPLOAD = 'aoi_file';
export const PROJECT_INPUT_TYPE_LINK = 'link';
export const PROJECT_INPUT_TYPE_TASKING_MANAGER_ID = 'TMId';
Expand Down
3 changes: 2 additions & 1 deletion manager-dashboard/app/views/NewTutorial/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,11 @@ import {
tutorialFormSchema,
TutorialFormType,
PartialTutorialFormType,
projectTypeOptions,
} from './utils';
import styles from './styles.css';

import projectTypeOptions from '#base/configs/projectTypes';

const defaultTutorialFormValue: PartialTutorialFormType = {
projectType: PROJECT_TYPE_BUILD_AREA,
zoomLevel: 18,
Expand Down
11 changes: 0 additions & 11 deletions manager-dashboard/app/views/NewTutorial/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,10 @@ import {
getNoMoreThanNCharacterCondition,
ProjectType,
PROJECT_TYPE_BUILD_AREA,
PROJECT_TYPE_FOOTPRINT,
PROJECT_TYPE_CHANGE_DETECTION,
PROJECT_TYPE_COMPLETENESS,
} from '#utils/common';

export const projectTypeOptions: {
value: ProjectType;
label: string;
}[] = [
{ value: PROJECT_TYPE_BUILD_AREA, label: 'Build Area' },
{ value: PROJECT_TYPE_FOOTPRINT, label: 'Footprint' },
{ value: PROJECT_TYPE_CHANGE_DETECTION, label: 'Change Detection' },
{ value: PROJECT_TYPE_COMPLETENESS, label: 'Completeness' },
];

// FIXME: include here
export interface TutorialFormType {
lookFor: string;
Expand Down