Skip to content

Commit

Permalink
fix(tasks): copy changes for Tasks feature (#6085)
Browse files Browse the repository at this point in the history
  • Loading branch information
jtpetty authored Mar 20, 2024
1 parent 4767b32 commit 3ab20ef
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
12 changes: 9 additions & 3 deletions packages/sanity/src/tasks/i18n/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const tasksLocaleStrings = defineLocalesResources('tasks', {
/** Text used in the assignee input when searching and no users are found */
'form.input.assignee.search.no-users.text': 'No users found',
/** Placeholder text used in the search box in the assignee input */
'form.input.assignee.search.placeholder': 'Search username',
'form.input.assignee.search.placeholder': 'Select username',
/** Text used in the assignee input when user is not authorized */
'form.input.assignee.unauthorized.text': 'Unauthorized',
/** Text used in the assignee input when user is not found */
Expand All @@ -56,13 +56,13 @@ const tasksLocaleStrings = defineLocalesResources('tasks', {
/** The label used in the date input to remove the current value */
'form.input.date.buttons.remove.text': 'Remove',
/** Placeholder text used in the description input */
'form.input.description.placeholder': 'Optional additional description',
'form.input.description.placeholder': 'Add description',
/** The label used in the target input to remove the current value */
'form.input.target.buttons.remove.text': 'Remove target content',
/** The text used in the target input when encountering a schema error */
'form.input.target.error.schema-not-found': 'Schema not found',
/** The placeholder text used in the target input for the search component */
'form.input.target.search.placeholder': 'Search document',
'form.input.target.search.placeholder': 'Select document',
/** The placeholder text for the title input */
'form.input.title.placeholder': 'Task title',
/** The status error message presented when the user does not supply a title */
Expand Down Expand Up @@ -95,6 +95,12 @@ const tasksLocaleStrings = defineLocalesResources('tasks', {
'panel.navigation.tooltip': 'Open tasks',
/** Title of the Tasks panel */
'panel.title': 'Tasks',
/** Label for the Assigned Tab */
'tab.assigned.label': 'Assigned',
/** Label for the Active Document Tab */
'tab.document.label': 'Active Document',
/** Label for the Subscribed Tab */
'tab.subscribed.label': 'Subscribed',
})

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const targetContentField = (mode: FormMode) =>
defineField({
type: 'object',
name: 'target',
title: 'Target content',
title: 'Target',
components: {
field: (props: ObjectFieldProps) => <TargetField {...props} mode={mode} />,
},
Expand Down Expand Up @@ -102,8 +102,8 @@ export const taskSchema = (mode: FormMode) =>
{
type: 'string',
name: 'assignedTo',
title: 'Assigned to',
placeholder: 'Search username',
title: 'Assign to',
placeholder: 'Select username',
components: {
field: FieldWrapper,
input: AssigneeCreateFormField,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import {TabList, Text} from '@sanity/ui'
import {useCallback, useEffect, useMemo, useState} from 'react'
import {useTranslation} from 'sanity'
import {type CSSProperties} from 'styled-components'

import {Tab} from '../../../../../ui-components'
import {tasksLocaleNamespace} from '../../../../i18n'
import {type SidebarTabsIds, useTasks} from '../../context'

const LIST_STYLES: CSSProperties = {
Expand Down Expand Up @@ -57,23 +59,25 @@ export function TasksListTabs({activeTabId, onChange}: TasksListTabsProps) {
}
}, [activeDocumentId, documentTabIsDisabled, onChange])

const {t} = useTranslation(tasksLocaleNamespace)

const tabs: TasksListTab[] = useMemo(
() => [
{
id: 'assigned',
label: 'Assigned',
label: t('tab.assigned.label'),
},
{
id: 'subscribed',
label: 'Subscribed',
label: t('tab.subscribed.label'),
},
{
id: 'document',
label: 'Open Document',
label: t('tab.document.label'),
isDisabled: documentTabIsDisabled,
},
],
[documentTabIsDisabled],
[documentTabIsDisabled, t],
)

const handleTabChange = useCallback(
Expand Down

0 comments on commit 3ab20ef

Please sign in to comment.