Skip to content

Commit 88de7c2

Browse files
committed
feat(manager-dashboard): add creator id input to mapillary image filters
1 parent e90ebe5 commit 88de7c2

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

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

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,8 @@ function NewProject(props: Props) {
318318
valuesToCopy.geometry = res.geometry;
319319
}
320320

321-
valuesToCopy.startTimestamp = valuesToCopy.dateRange?.startDate || null;
322-
valuesToCopy.endTimestamp = valuesToCopy.dateRange?.endDate || null;
321+
valuesToCopy.startTimestamp = valuesToCopy.dateRange?.startDate ?? null;
322+
valuesToCopy.endTimestamp = valuesToCopy.dateRange?.endDate ?? null;
323323

324324
const storage = getStorage();
325325
const timestamp = (new Date()).getTime();
@@ -720,13 +720,22 @@ function NewProject(props: Props) {
720720
>
721721
<DateRangeInput
722722
name={'dateRange' as const}
723-
value={value?.dateRange} // TODO type issue
723+
value={value?.dateRange}
724724
onChange={setFieldValue}
725725
error={error?.dateRange}
726726
label="Date range"
727727
hint="Choose a date range to filter images by the date they were captured at. Empty indicates that images of all capture dates are used."
728728
disabled={submissionPending || projectTypeEmpty}
729729
/>
730+
<NumberInput
731+
name={'creatorId' as const}
732+
value={value?.creatorId}
733+
onChange={setFieldValue}
734+
error={error?.creatorId}
735+
label="Image Creator ID"
736+
hint="Provide a valid Mapillary creator ID to filter for images belonging to a specific Mapillary user."
737+
disabled={submissionPending || projectTypeEmpty}
738+
/>
730739
<NumberInput
731740
name={'organizationId' as const}
732741
value={value?.organizationId}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ export interface ProjectFormType {
8282
startTimestamp?: string | null;
8383
endTimestamp?: string | null;
8484
organizationId?: number;
85+
creatorId?: number;
8586
isPano?: boolean;
8687
samplingThreshold?: number;
8788
}
@@ -284,6 +285,13 @@ export const projectFormSchema: ProjectFormSchema = {
284285
dateRange: {
285286
required: false,
286287
},
288+
creatorId: {
289+
required: false,
290+
validations: [
291+
integerCondition,
292+
greaterThanCondition(0),
293+
],
294+
},
287295
organizationId: {
288296
required: false,
289297
validations: [

0 commit comments

Comments
 (0)