Skip to content

Commit

Permalink
Improve look of collections form
Browse files Browse the repository at this point in the history
  • Loading branch information
mihow committed Apr 16, 2024
1 parent eacadaf commit 554d225
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 32 deletions.
20 changes: 13 additions & 7 deletions ui/src/pages/overview/collections/collection-columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,14 @@ export const columns: (projectId: string) => TableColumn<Collection>[] = (
},
renderCell: (item: Collection) => <BasicTableCell value={item.numImages} />,
},
{
id: 'created-at',
name: translate(STRING.FIELD_LABEL_CREATED_AT),
sortField: 'created_at',
renderCell: (item: Collection) => <BasicTableCell value={item.createdAt} />,
},
{
id: 'updated-at',
name: translate(STRING.FIELD_LABEL_UPDATED_AT),
sortField: 'updated_at',
renderCell: (item: Collection) => <BasicTableCell value={item.updatedAt} />,
},
{
id: 'actions',
id: 'collection-actions',
name: '',
styles: {
padding: '16px',
Expand All @@ -72,6 +66,18 @@ export const columns: (projectId: string) => TableColumn<Collection>[] = (
{item.canUpdate && (
<PopulateCollection collectionId={item.id} />
)}
</div>
),
},
{
id: 'actions',
name: '',
styles: {
padding: '16px',
width: '100%',
},
renderCell: (item: Collection) => (
<div className={styles.entityActions}>
{item.canUpdate && editableSamplingMethods.includes(item.method) && (
<UpdateEntityDialog
collection={API_ROUTES.COLLECTIONS}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { FormField } from 'components/form/form-field'
import {
FormActions,
FormError,
FormRow,
FormSection,
} from 'components/form/layout/layout'
import { FormConfig } from 'components/form/types'
Expand Down Expand Up @@ -122,31 +123,68 @@ export const CollectionDetailsForm = ({
/>
)}
<FormSection>
<FormField name="name" type="text" config={config} control={control} />
<FormField
name="description"
type="text"
config={config}
control={control}
/>
<FormField
name="kwargs.max_num"
type="number"
config={config}
control={control}
/>
<FormField
name="kwargs.minute_interval"
type="number"
config={config}
control={control}
/>
<FormField
name="method"
type="text"
config={config}
control={control}
/>
<FormRow>
<FormField name="name" type="text" config={config} control={control} />
<FormField
name="description"
type="text"
config={config}
control={control}
/>
</FormRow>
</FormSection>
<FormSection>
<FormRow>
<FormField
name="kwargs.max_num"
type="number"
config={config}
control={control}
/>
<FormField
name="kwargs.minute_interval"
type="number"
config={config}
control={control}
/>
</FormRow>
<FormRow>

<FormField
name="kwargs.month_start"
type="number"
config={config}
control={control}
/>
<FormField
name="kwargs.month_end"
type="number"
config={config}
control={control}
/>
</FormRow>
<FormRow>
<FormField
name="kwargs.hour_start"
type="number"
config={config}
control={control}
/>
<FormField
name="kwargs.hour_end"
type="number"
config={config}
control={control}
/>
</FormRow>
<FormRow>
<FormField
name="method"
type="text"
config={config}
control={control}
/>
</FormRow>
</FormSection>
<FormActions>
<Button
Expand Down
4 changes: 4 additions & 0 deletions ui/src/utils/language.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export enum STRING {
LOGOUT,
NEXT,
PROCESS_NOW,
POPULATE,
QUEUED,
REFRESH,
RESET,
RETRY,
Expand Down Expand Up @@ -193,6 +195,8 @@ const ENGLISH_STRINGS: { [key in STRING]: string } = {
[STRING.LOGOUT]: 'Logout',
[STRING.NEXT]: 'Next',
[STRING.PROCESS_NOW]: 'Process now',
[STRING.POPULATE]: 'Populate',
[STRING.QUEUED]: 'Queued',
[STRING.REFRESH]: 'Refresh',
[STRING.RESET]: 'Reset',
[STRING.RETRY]: 'Retry',
Expand Down

0 comments on commit 554d225

Please sign in to comment.