Skip to content

Commit

Permalink
feat(manager-dashboard): add creator id input to mapillary image filters
Browse files Browse the repository at this point in the history
  • Loading branch information
ofr1tz committed Dec 17, 2024
1 parent e90ebe5 commit 88de7c2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
15 changes: 12 additions & 3 deletions manager-dashboard/app/views/NewProject/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,8 @@ function NewProject(props: Props) {
valuesToCopy.geometry = res.geometry;
}

valuesToCopy.startTimestamp = valuesToCopy.dateRange?.startDate || null;
valuesToCopy.endTimestamp = valuesToCopy.dateRange?.endDate || null;
valuesToCopy.startTimestamp = valuesToCopy.dateRange?.startDate ?? null;
valuesToCopy.endTimestamp = valuesToCopy.dateRange?.endDate ?? null;

const storage = getStorage();
const timestamp = (new Date()).getTime();
Expand Down Expand Up @@ -720,13 +720,22 @@ function NewProject(props: Props) {
>
<DateRangeInput
name={'dateRange' as const}
value={value?.dateRange} // TODO type issue
value={value?.dateRange}
onChange={setFieldValue}
error={error?.dateRange}
label="Date range"
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."
disabled={submissionPending || projectTypeEmpty}
/>
<NumberInput
name={'creatorId' as const}
value={value?.creatorId}
onChange={setFieldValue}
error={error?.creatorId}
label="Image Creator ID"
hint="Provide a valid Mapillary creator ID to filter for images belonging to a specific Mapillary user."
disabled={submissionPending || projectTypeEmpty}
/>
<NumberInput
name={'organizationId' as const}
value={value?.organizationId}
Expand Down
8 changes: 8 additions & 0 deletions manager-dashboard/app/views/NewProject/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export interface ProjectFormType {
startTimestamp?: string | null;
endTimestamp?: string | null;
organizationId?: number;
creatorId?: number;
isPano?: boolean;
samplingThreshold?: number;
}
Expand Down Expand Up @@ -284,6 +285,13 @@ export const projectFormSchema: ProjectFormSchema = {
dateRange: {
required: false,
},
creatorId: {
required: false,
validations: [
integerCondition,
greaterThanCondition(0),
],
},
organizationId: {
required: false,
validations: [
Expand Down

0 comments on commit 88de7c2

Please sign in to comment.