Skip to content

Commit 905dcde

Browse files
committed
feat(manager-dashboard): add mapillary image filter inputs (wip)
1 parent 78c4908 commit 905dcde

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

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

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ import NonFieldError from '#components/NonFieldError';
5151
import AnimatedSwipeIcon from '#components/AnimatedSwipeIcon';
5252
import ExpandableContainer from '#components/ExpandableContainer';
5353
import AlertBanner from '#components/AlertBanner';
54+
import Checkbox from '#components/Checkbox';
5455
import {
5556
valueSelector,
5657
labelSelector,
@@ -106,6 +107,7 @@ const defaultProjectFormValue: PartialProjectFormType = {
106107
// maxTasksPerUser: -1,
107108
inputType: PROJECT_INPUT_TYPE_UPLOAD,
108109
filter: FILTER_BUILDINGS,
110+
isPano: false,
109111
};
110112

111113
interface Props {
@@ -719,15 +721,34 @@ function NewProject(props: Props) {
719721
<InputSection
720722
heading="Mapillary Image Filters"
721723
>
724+
<div>time range input</div>
722725
<NumberInput
723726
name={'organizationId' as const}
724727
value={value?.organizationId}
725728
onChange={setFieldValue}
726729
error={error?.organizationId}
727730
label="Mapillary Organization ID"
728-
hint="Provide a valid Mapillary organization ID to filter for images belonging to a specific organization."
731+
hint="Provide a valid Mapillary organization ID to filter for images belonging to a specific organization. Empty indicates that no filter is set on organization."
729732
disabled={submissionPending || projectTypeEmpty}
730733
/>
734+
<div className={styles.inputGroup}>
735+
<NumberInput
736+
name={'samplingThreshold' as const}
737+
value={value?.samplingThreshold}
738+
onChange={setFieldValue}
739+
error={error?.samplingThreshold}
740+
label="Image Sampling Threshold"
741+
hint="What should be the minimum distance (in km) between images on the same Mapillary sequence? Empty indicates that all images on each sequence are used."
742+
disabled={submissionPending || projectTypeEmpty}
743+
/>
744+
<Checkbox
745+
name={'isPano' as const}
746+
value={value?.isPano}
747+
label="Only use 360 degree panorama images."
748+
onChange={setFieldValue}
749+
disabled={submissionPending || projectTypeEmpty}
750+
/>
751+
</div>
731752
</InputSection>
732753
)}
733754

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ export interface ProjectFormType {
7777
tileServerB?: TileServer;
7878
customOptions?: CustomOptionsForProject;
7979
organizationId?: number;
80+
isPano?: boolean;
81+
samplingThreshold?: number;
8082
}
8183

8284
export const PROJECT_INPUT_TYPE_UPLOAD = 'aoi_file';
@@ -280,6 +282,11 @@ export const projectFormSchema: ProjectFormSchema = {
280282
greaterThanCondition(0),
281283
],
282284
},
285+
samplingThreshold: {
286+
validation: [
287+
greaterThanCondition(0),
288+
],
289+
},
283290
};
284291

285292
baseSchema = addCondition(

0 commit comments

Comments
 (0)