Skip to content

Commit 5e95a42

Browse files
authored
Update terminology (#559)
* feat: make it possible to show extra info in table headers * copy: update all copy to use latest terminology * feat: add tooltip to jobs page header and status table column * copy: sync copy after updates in doc
1 parent 758294c commit 5e95a42

File tree

7 files changed

+92
-65
lines changed

7 files changed

+92
-65
lines changed

ui/src/design-system/components/table/table-header/table-header.module.scss

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020
}
2121

2222
.columnName {
23+
display: flex;
24+
align-items: center;
25+
justify-content: center;
26+
gap: 8px;
27+
2328
span {
2429
@include paragraph-medium();
2530
font-weight: 600;
@@ -33,7 +38,6 @@
3338
position: relative;
3439

3540
.columnName {
36-
display: block;
3741
position: relative;
3842
}
3943

@@ -48,19 +52,13 @@
4852
}
4953

5054
.iconWrapper {
51-
position: absolute;
52-
top: 50%;
53-
right: -6px;
55+
display: flex;
56+
align-items: center;
57+
justify-content: center;
5458
transform-origin: center;
55-
transform: translate(100%, -50%);
56-
visibility: hidden;
57-
58-
&.visible {
59-
visibility: visible;
60-
}
6159

6260
&.ascending {
63-
transform: translate(100%, -50%) rotate(180deg);
61+
transform: rotate(180deg);
6462
}
6563
}
6664

ui/src/design-system/components/table/table-header/table-header.tsx

Lines changed: 52 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import classNames from 'classnames'
22
import { Icon, IconTheme, IconType } from 'design-system/components/icon/icon'
3+
import { Tooltip } from 'design-system/components/tooltip/tooltip'
34
import { TableColumn, TableSortSettings } from '../types'
45
import styles from './table-header.module.scss'
56

@@ -36,22 +37,32 @@ const BasicTableHeader = <T,>({
3637
column,
3738
visuallyHidden,
3839
}: Omit<TableHeaderProps<T>, 'sortSettings' | 'onSortClick'>) => (
39-
<th
40-
key={column.id}
41-
style={{ textAlign: column.styles?.textAlign, width: column.styles?.width }}
42-
className={styles.tableHeader}
43-
>
44-
<div
45-
className={classNames(styles.content, {
46-
[styles.visuallyHidden]: visuallyHidden,
47-
})}
48-
style={{ padding: column.styles?.padding }}
40+
<Tooltip content={column.tooltip}>
41+
<th
42+
key={column.id}
43+
style={{
44+
textAlign: column.styles?.textAlign,
45+
width: column.styles?.width,
46+
}}
47+
className={styles.tableHeader}
4948
>
50-
<div className={styles.columnName}>
51-
<span>{column.name}</span>
49+
<div
50+
className={classNames(styles.content, {
51+
[styles.visuallyHidden]: visuallyHidden,
52+
})}
53+
style={{ padding: column.styles?.padding }}
54+
>
55+
<div className={styles.columnName}>
56+
<span>{column.name}</span>
57+
{column.tooltip ? (
58+
<div className={styles.iconWrapper}>
59+
<Icon type={IconType.Info} theme={IconTheme.Neutral} />
60+
</div>
61+
) : null}
62+
</div>
5263
</div>
53-
</div>
54-
</th>
64+
</th>
65+
</Tooltip>
5566
)
5667

5768
const SortableTableHeader = <T,>({
@@ -78,25 +89,34 @@ const SortableTableHeader = <T,>({
7889
[styles.active]: sortActive,
7990
})}
8091
>
81-
<button
82-
className={classNames(styles.content, styles.sortButton, {
83-
[styles.visuallyHidden]: visuallyHidden,
84-
})}
85-
style={{ padding: column.styles?.padding }}
86-
onClick={onSortClick}
87-
>
88-
<div className={styles.columnName}>
89-
<span>{column.name}</span>
90-
<div
91-
className={classNames(styles.iconWrapper, {
92-
[styles.visible]: sortActive,
93-
[styles.ascending]: sortActive && sortSettings?.order === 'asc',
94-
})}
95-
>
96-
<Icon type={IconType.Sort} theme={IconTheme.Neutral} />
92+
<Tooltip content={column.tooltip}>
93+
<button
94+
className={classNames(styles.content, styles.sortButton, {
95+
[styles.visuallyHidden]: visuallyHidden,
96+
})}
97+
style={{ padding: column.styles?.padding }}
98+
onClick={onSortClick}
99+
>
100+
<div className={styles.columnName}>
101+
<span>{column.name}</span>
102+
{column.tooltip && !sortActive ? (
103+
<div className={styles.iconWrapper}>
104+
<Icon type={IconType.Info} theme={IconTheme.Neutral} />
105+
</div>
106+
) : null}
107+
{sortActive ? (
108+
<div
109+
className={classNames(styles.iconWrapper, {
110+
[styles.ascending]:
111+
sortActive && sortSettings?.order === 'asc',
112+
})}
113+
>
114+
<Icon type={IconType.Sort} theme={IconTheme.Neutral} />
115+
</div>
116+
) : null}
97117
</div>
98-
</div>
99-
</button>
118+
</button>
119+
</Tooltip>
100120
</th>
101121
)
102122
}

ui/src/design-system/components/table/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export enum TextAlign {
1515
export interface TableColumn<T> {
1616
id: string
1717
name: string
18+
tooltip?: string
1819
sortField?: string
1920
styles?: {
2021
textAlign?: TextAlign

ui/src/pages/jobs/jobs-columns.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export const columns: (projectId: string) => TableColumn<Job>[] = (
3333
{
3434
id: 'status',
3535
name: translate(STRING.FIELD_LABEL_STATUS),
36+
tooltip: translate(STRING.TOOLTIP_STATUS),
3637
sortField: 'status',
3738
renderCell: (item: Job) => {
3839
const status = (() => {

ui/src/pages/jobs/jobs.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export const Jobs = () => {
4545
})}
4646
isLoading={isLoading}
4747
isFetching={isFetching}
48+
tooltip={translate(STRING.TOOLTIP_JOB)}
4849
>
4950
{canCreate ? <NewJobDialog /> : null}
5051
</PageHeader>

ui/src/utils/language.ts

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,12 @@ export enum STRING {
182182
TOOLTIP_COLLECTION,
183183
TOOLTIP_DEPLOYMENT,
184184
TOOLTIP_DEVICE_TYPE,
185+
TOOLTIP_JOB,
185186
TOOLTIP_OCCURRENCE,
186187
TOOLTIP_PIPELINE,
187188
TOOLTIP_SESSION,
188189
TOOLTIP_SITE,
190+
TOOLTIP_STATUS,
189191
TOOLTIP_STORAGE,
190192

191193
/* OTHER */
@@ -268,16 +270,16 @@ const ENGLISH_STRINGS: { [key in STRING]: string } = {
268270
/* FIELD_LABEL */
269271
[STRING.FIELD_LABEL_AVG_TEMP]: 'Avg temp',
270272
[STRING.FIELD_LABEL_BEST_SCORE]: 'Best score',
271-
[STRING.FIELD_LABEL_CAPTURES]: 'Captures',
273+
[STRING.FIELD_LABEL_CAPTURES]: 'Source images',
272274
[STRING.FIELD_LABEL_COMMENT]: 'Comment',
273275
[STRING.FIELD_LABEL_CONNECTION_STATUS]: 'Connection status',
274276
[STRING.FIELD_LABEL_CREATED_AT]: 'Created at',
275-
[STRING.FIELD_LABEL_DATA_SOURCE_CAPTURES]: 'Data source captures',
277+
[STRING.FIELD_LABEL_DATA_SOURCE_CAPTURES]: 'Data source images',
276278
[STRING.FIELD_LABEL_DATE]: 'Date',
277279
[STRING.FIELD_LABEL_DATE_OBSERVED]: 'Date observed',
278280
[STRING.FIELD_LABEL_DELAY]: 'Delay',
279281
[STRING.FIELD_LABEL_DEVICE]: 'Device type',
280-
[STRING.FIELD_LABEL_DEPLOYMENT]: 'Deployment',
282+
[STRING.FIELD_LABEL_DEPLOYMENT]: 'Station',
281283
[STRING.FIELD_LABEL_DESCRIPTION]: 'Description',
282284
[STRING.FIELD_LABEL_DETECTIONS]: 'Detections',
283285
[STRING.FIELD_LABEL_DURATION]: 'Duration',
@@ -312,7 +314,7 @@ const ENGLISH_STRINGS: { [key in STRING]: string } = {
312314
[STRING.FIELD_LABEL_SOURCE_IMAGE]: 'Source image',
313315
[STRING.FIELD_LABEL_SOURCE_IMAGES]: 'Source images',
314316
[STRING.FIELD_LABEL_DATA_SOURCE]: 'Data source',
315-
[STRING.FIELD_LABEL_SAMPLE_CAPTURES]: 'Sample captures',
317+
[STRING.FIELD_LABEL_SAMPLE_CAPTURES]: 'Sample images',
316318
[STRING.FIELD_LABEL_SCORE]: 'Score',
317319
[STRING.FIELD_LABEL_SNAPSHOTS]: 'Snapshots',
318320
[STRING.FIELD_LABEL_SPECIES]: 'Species',
@@ -328,7 +330,7 @@ const ENGLISH_STRINGS: { [key in STRING]: string } = {
328330
[STRING.FIELD_LABEL_TRAINING_IMAGES]: 'Reference images',
329331
[STRING.FIELD_LABEL_FIRST_DATE]: 'First date',
330332
[STRING.FIELD_LABEL_LAST_DATE]: 'Last date',
331-
[STRING.FIELD_LABEL_UPLOAD_CAPTURES]: 'Upload captures',
333+
[STRING.FIELD_LABEL_UPLOAD_CAPTURES]: 'Upload images',
332334
[STRING.FIELD_LABEL_UPDATED_AT]: 'Updated at',
333335
[STRING.FIELD_LABEL_VERSION]: 'Version',
334336
[STRING.FIELD_LABEL_VERSION_NAME]: 'Version',
@@ -338,8 +340,8 @@ const ENGLISH_STRINGS: { [key in STRING]: string } = {
338340
[STRING.ENTITY_DELETE]: 'Delete {{type}}',
339341
[STRING.ENTITY_DETAILS]: '{{type}} details',
340342
[STRING.ENTITY_EDIT]: 'Edit {{type}}',
341-
[STRING.ENTITY_TYPE_CAPTURE]: 'capture',
342-
[STRING.ENTITY_TYPE_DEPLOYMENT]: 'deployment',
343+
[STRING.ENTITY_TYPE_CAPTURE]: 'source image',
344+
[STRING.ENTITY_TYPE_DEPLOYMENT]: 'station',
343345
[STRING.ENTITY_TYPE_IDENTIFICATION]: 'identification',
344346
[STRING.ENTITY_TYPE_PIPELINE]: 'pipeline',
345347
[STRING.ENTITY_TYPE_JOB]: 'job',
@@ -350,18 +352,18 @@ const ENGLISH_STRINGS: { [key in STRING]: string } = {
350352
[STRING.MESSAGE_CAPTURE_FILENAME]:
351353
'Image filename must contain a timestamp in the format YYYYMMDDHHMMSS (e.g. 20210101120000-snapshot.jpg).',
352354
[STRING.MESSAGE_CAPTURE_LIMIT]:
353-
'A maximum of {{numCaptures}} captures can be uploaded through the web browser. Configure a data source to upload data in bulk.',
355+
'A maximum of {{numCaptures}} images can be uploaded through the web browser. Configure a data source to upload data in bulk.',
354356
[STRING.MESSAGE_CAPTURE_SYNC_HIDDEN]:
355-
'Deployment must be created before syncing captures.',
357+
'Station must be created before syncing images.',
356358
[STRING.MESSAGE_CAPTURE_TOO_MANY]:
357359
'To upload more than {{numCaptures}} images you must configure a data source.',
358360
[STRING.MESSAGE_CAPTURE_UPLOAD_HIDDEN]:
359-
'Deployment must be created before uploading captures.',
361+
'Station must be created before uploading images.',
360362
[STRING.MESSAGE_CHANGE_PASSWORD]:
361363
'Contact an administrator to change your email or password.',
362364
[STRING.MESSAGE_COULD_NOT_SAVE]: 'Could not save',
363365
[STRING.MESSAGE_DATA_SOURCE_NOT_CONFIGURED]:
364-
'A data source must be configured and saved before syncing captures.',
366+
'A data source must be configured and saved before syncing images.',
365367
[STRING.MESSAGE_DELETE_CONFIRM]:
366368
'Are you sure you want to delete this {{type}}?',
367369
[STRING.MESSAGE_HAS_ACCOUNT]: 'Already have an account?',
@@ -390,7 +392,7 @@ const ENGLISH_STRINGS: { [key in STRING]: string } = {
390392
[STRING.MESSAGE_VALUE_MISSING]: 'Please provide a value',
391393

392394
/* NAV_ITEM */
393-
[STRING.NAV_ITEM_DEPLOYMENTS]: 'Deployments',
395+
[STRING.NAV_ITEM_DEPLOYMENTS]: 'Stations',
394396
[STRING.NAV_ITEM_JOBS]: 'Jobs',
395397
[STRING.NAV_ITEM_OCCURRENCES]: 'Occurrences',
396398
[STRING.NAV_ITEM_OVERVIEW]: 'Overview',
@@ -421,21 +423,25 @@ const ENGLISH_STRINGS: { [key in STRING]: string } = {
421423

422424
/* TOOLTIPS */
423425
[STRING.TOOLTIP_COLLECTION]:
424-
'A collection is a group of captures. A collection contains all or some captures in a project. When a processing job is registered, a collection is picked. This list defines the collection options available.',
426+
'A collection is a group of source images. A collection contains all or some images in a project. When a processing job is registered, a collection is picked. This list defines the collection options available.',
425427
[STRING.TOOLTIP_DEPLOYMENT]:
426-
'A deployment is defined as one monitoring station.',
428+
'A monitoring station is a location where a device is deployed to take images of insects in the wild (at a “Site”).',
427429
[STRING.TOOLTIP_DEVICE_TYPE]:
428-
'A device type is the type of equipment used for monitoring, for example an AMI system. One or many deployments can be connected to a device type.',
430+
'A device type is the type of equipment or camera used for collecting source images. One or many deployments can be connected to a device type. Device type refers to the model version, category or description of a kind of hardware, not the serial number of an individual device.',
431+
[STRING.TOOLTIP_JOB]:
432+
'A job is a request for data processing that specifies the data to process and the pipeline to use.',
429433
[STRING.TOOLTIP_OCCURRENCE]:
430-
'An occurrence is a group of detections of one individual. One occurrence consists of one or many detections.',
434+
'An occurrence refers to when an individual is detected in a sequence of one or more images with no time interruption.',
431435
[STRING.TOOLTIP_PIPELINE]:
432-
'A pipeline is a set of algorithms used for processing. When a processing job is registered, a pipeline is picked. This list defines the pipeline options available.',
436+
'A pipeline is a set of algorithms used for processing. A pipeline is picked from a list of algorithm bundle options when a processing job is defined.',
433437
[STRING.TOOLTIP_SESSION]:
434-
'A session is a fixed period of time of monitoring for one deployment. The period is typically one night.',
438+
'A session is a fixed period of time of monitoring for one station. The period is typically one night.',
435439
[STRING.TOOLTIP_SITE]:
436-
'A site is a physical place where monitoring is taking place. One or many deployments can be connected to a site.',
440+
'A site is a physical location where monitoring is taking place. One or many stations can be connected to a site.',
441+
[STRING.TOOLTIP_STATUS]:
442+
'A status is the processing stage of a job once submitted: Created > Pending > Running > Done. A Failed status means the job stopped before it had finished.',
437443
[STRING.TOOLTIP_STORAGE]:
438-
'A storage is a place where captures are kept, for example a S3 bucket. One or many deployments can be connected to a storage.',
444+
'A storage is a place where source images are kept, for example a S3 bucket. One or many stations can be connected to a storage.',
439445

440446
/* OTHER */
441447
[STRING.ALGORITHMS]: 'Algorithms',

ui/src/utils/useFilters.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import { useSearchParams } from 'react-router-dom'
22

33
const AVAILABLE_FILTERS = [
44
{
5-
label: 'Deployment',
5+
label: 'Station',
66
field: 'deployment',
77
},
88
{
9-
label: 'Occurrence deployment',
9+
label: 'Occurrence station',
1010
field: 'occurrences__deployment',
1111
},
1212
{

0 commit comments

Comments
 (0)