Skip to content

Commit 5c77de4

Browse files
committed
fix: address remaining inconsistencies after PR feedback
1 parent 6e71534 commit 5c77de4

File tree

8 files changed

+18
-23
lines changed

8 files changed

+18
-23
lines changed

ui/src/pages/captures/upload-images-dialog/select-images-section/select-images-section.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export const SelectImagesSection = ({
4343

4444
return (
4545
<FormSection title={TITLE} description={DESCRIPTION}>
46-
<div className={styles.collection}>
46+
<div className={styles.captures}>
4747
{images.map(({ file }) => (
4848
<Card key={file.name}>
4949
<div className={styles.cardContent}>

ui/src/pages/captures/upload-images-dialog/select-images-section/styles.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
@import 'src/design-system/variables/colors.scss';
33
@import 'src/design-system/variables/typography.scss';
44

5-
.collection {
5+
.captures {
66
display: grid;
77
grid-template-columns: 1fr 1fr 1fr;
88
gap: 16px;

ui/src/pages/captures/upload-images-dialog/upload-images-dialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ const SectionUpload = ({
290290
description="Your captures will be uploaded and added to the selected monitoring station. If processing is enabled, a job will start in the background."
291291
>
292292
<div className="grid grid-cols-2 gap-8">
293-
<InputValue label="Images" value={images.length} />
293+
<InputValue label="Captures" value={images.length} />
294294
<InputValue label="Station" value={deployment?.name} />
295295
<div className="space-y-4">
296296
<div className="flex items-center gap-2">

ui/src/pages/project/capture-sets/capture-sets.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const CaptureSets = () => {
4949
const canCreate = userPermissions?.includes(UserPermission.Create)
5050

5151
useEffect(() => {
52-
// If any collection has a job in progress, we want to poll the endpoint so we can show job updates
52+
// If any capture set has a job in progress, we want to poll the endpoint so we can show job updates
5353
if (captureSets?.some(({ hasJobInProgress }) => hasJobInProgress)) {
5454
setPoll(true)
5555
} else {

ui/src/pages/project/entities/details-form/collection-details-form.tsx renamed to ui/src/pages/project/entities/details-form/capture-set-details-form.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
FormSection,
88
} from 'components/form/layout/layout'
99
import { FormConfig } from 'components/form/types'
10-
import { Collection } from 'data-services/models/capture-set'
10+
import { CaptureSet } from 'data-services/models/capture-set'
1111
import { SaveButton } from 'design-system/components/button/save-button'
1212
import { InputContent } from 'design-system/components/input/input'
1313
import { DatePicker } from 'design-system/components/select/date-picker'
@@ -26,7 +26,7 @@ import { snakeCaseToSentenceCase } from 'utils/snakeCaseToSentenceCase'
2626
import { useFormError } from 'utils/useFormError'
2727
import { DetailsFormProps, FormValues } from './types'
2828

29-
type CollectionFormValues = FormValues & {
29+
type CaptureSetFormValues = FormValues & {
3030
method: string
3131
kwargs: {
3232
date_start: string | undefined
@@ -125,24 +125,24 @@ const config: FormConfig = {
125125
},
126126
}
127127

128-
export const CollectionDetailsForm = ({
128+
export const CaptureSetDetailsForm = ({
129129
entity,
130130
error,
131131
isLoading,
132132
isSuccess,
133133
onSubmit,
134134
}: DetailsFormProps) => {
135-
const collection = entity as Collection | undefined
135+
const captureSet = entity as CaptureSet | undefined
136136
const { control, handleSubmit, setError, watch } =
137-
useForm<CollectionFormValues>({
137+
useForm<CaptureSetFormValues>({
138138
defaultValues: {
139139
name: entity?.name ?? '',
140140
description: entity?.description ?? '',
141141
kwargs: {
142142
minute_interval: 10,
143143
size: 100,
144144
...Object.fromEntries(
145-
Object.entries(collection?.kwargs || {}).map(([key, value]) => {
145+
Object.entries(captureSet?.kwargs || {}).map(([key, value]) => {
146146
const fieldConfig = config[`kwargs.${key}`]
147147
const formValue = fieldConfig?.toFormValue
148148
? fieldConfig.toFormValue(value)
@@ -151,7 +151,7 @@ export const CollectionDetailsForm = ({
151151
})
152152
),
153153
},
154-
method: collection?.method ?? SERVER_SAMPLING_METHODS[0],
154+
method: captureSet?.method ?? SERVER_SAMPLING_METHODS[0],
155155
},
156156
mode: 'onChange',
157157
})

ui/src/pages/project/entities/details-form/constants.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CollectionDetailsForm } from './collection-details-form'
1+
import { CaptureSetDetailsForm } from './capture-set-details-form'
22
import { ExportDetailsForm } from './export-details-form'
33
import { ProcessingServiceDetailsForm } from './processing-service-details-form'
44
import { StorageDetailsForm } from './storage-details-form'
@@ -7,7 +7,7 @@ import { DetailsFormProps } from './types'
77
export const customFormMap: {
88
[key: string]: (props: DetailsFormProps) => JSX.Element
99
} = {
10-
'capture set': CollectionDetailsForm,
10+
'capture set': CaptureSetDetailsForm,
1111
export: ExportDetailsForm,
1212
service: ProcessingServiceDetailsForm,
1313
storage: StorageDetailsForm,

ui/src/pages/project/sidebar/useSidebarSections.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,5 @@ export const useSidebarSections = (project: ProjectDetails) => {
135135
)
136136
}, [location.pathname, sidebarSections])
137137

138-
sidebarSections
139-
.map(({ items }) => items)
140-
.flat()
141-
.find((item) => !!matchPath(item.path, location.pathname))
142-
143138
return { sidebarSections, activeItem }
144139
}

ui/src/utils/useFilters.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const AVAILABLE_FILTERS: {
2121
},
2222
{
2323
label: translate(STRING.FIELD_LABEL_CAPTURE_SET),
24-
field: 'source_image_collection', // This is for viewing jobs by capture set. @TODO: Can we update this key to "capture_set_id" streamline?
24+
field: 'source_image_collection', // This is for viewing jobs by capture set. @TODO: Can we update this key to "capture_set_id" to streamline?
2525
},
2626
{
2727
label: translate(STRING.FIELD_LABEL_CAPTURE_SET),
@@ -70,8 +70,8 @@ export const AVAILABLE_FILTERS: {
7070
},
7171
},
7272
{
73-
label: 'Source image',
74-
field: 'detections__source_image', // This is for viewing Occurrences by source image. @TODO: Can we update this key to "source_image" to streamline?
73+
label: translate(STRING.FIELD_LABEL_CAPTURE),
74+
field: 'detections__source_image', // This is for viewing occurrences by capture. @TODO: Can we update this key to "capture_id" to streamline?
7575
},
7676
{
7777
label: 'Session',
@@ -106,8 +106,8 @@ export const AVAILABLE_FILTERS: {
106106
field: 'not_taxa_list_id',
107107
},
108108
{
109-
label: 'Source image',
110-
field: 'source_image_single', // This is for viewing Jobs by source image. @TODO: Can we update this key to "source_image" to streamline?
109+
label: translate(STRING.FIELD_LABEL_CAPTURE),
110+
field: 'source_image_single', // This is for viewing jobs by capture. @TODO: Can we update this key to "capture_id" to streamline?
111111
},
112112
{
113113
label: 'Status',

0 commit comments

Comments
 (0)