Skip to content

Commit 3ab20ef

Browse files
authoredMar 20, 2024
fix(tasks): copy changes for Tasks feature (#6085)
1 parent 4767b32 commit 3ab20ef

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed
 

‎packages/sanity/src/tasks/i18n/resources.ts

+9-3
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const tasksLocaleStrings = defineLocalesResources('tasks', {
4646
/** Text used in the assignee input when searching and no users are found */
4747
'form.input.assignee.search.no-users.text': 'No users found',
4848
/** Placeholder text used in the search box in the assignee input */
49-
'form.input.assignee.search.placeholder': 'Search username',
49+
'form.input.assignee.search.placeholder': 'Select username',
5050
/** Text used in the assignee input when user is not authorized */
5151
'form.input.assignee.unauthorized.text': 'Unauthorized',
5252
/** Text used in the assignee input when user is not found */
@@ -56,13 +56,13 @@ const tasksLocaleStrings = defineLocalesResources('tasks', {
5656
/** The label used in the date input to remove the current value */
5757
'form.input.date.buttons.remove.text': 'Remove',
5858
/** Placeholder text used in the description input */
59-
'form.input.description.placeholder': 'Optional additional description',
59+
'form.input.description.placeholder': 'Add description',
6060
/** The label used in the target input to remove the current value */
6161
'form.input.target.buttons.remove.text': 'Remove target content',
6262
/** The text used in the target input when encountering a schema error */
6363
'form.input.target.error.schema-not-found': 'Schema not found',
6464
/** The placeholder text used in the target input for the search component */
65-
'form.input.target.search.placeholder': 'Search document',
65+
'form.input.target.search.placeholder': 'Select document',
6666
/** The placeholder text for the title input */
6767
'form.input.title.placeholder': 'Task title',
6868
/** The status error message presented when the user does not supply a title */
@@ -95,6 +95,12 @@ const tasksLocaleStrings = defineLocalesResources('tasks', {
9595
'panel.navigation.tooltip': 'Open tasks',
9696
/** Title of the Tasks panel */
9797
'panel.title': 'Tasks',
98+
/** Label for the Assigned Tab */
99+
'tab.assigned.label': 'Assigned',
100+
/** Label for the Active Document Tab */
101+
'tab.document.label': 'Active Document',
102+
/** Label for the Subscribed Tab */
103+
'tab.subscribed.label': 'Subscribed',
98104
})
99105

100106
/**

‎packages/sanity/src/tasks/src/tasks/components/form/addonWorkspace/taskSchema.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const targetContentField = (mode: FormMode) =>
1717
defineField({
1818
type: 'object',
1919
name: 'target',
20-
title: 'Target content',
20+
title: 'Target',
2121
components: {
2222
field: (props: ObjectFieldProps) => <TargetField {...props} mode={mode} />,
2323
},
@@ -102,8 +102,8 @@ export const taskSchema = (mode: FormMode) =>
102102
{
103103
type: 'string',
104104
name: 'assignedTo',
105-
title: 'Assigned to',
106-
placeholder: 'Search username',
105+
title: 'Assign to',
106+
placeholder: 'Select username',
107107
components: {
108108
field: FieldWrapper,
109109
input: AssigneeCreateFormField,

‎packages/sanity/src/tasks/src/tasks/components/sidebar/TasksListTabs.tsx

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import {TabList, Text} from '@sanity/ui'
22
import {useCallback, useEffect, useMemo, useState} from 'react'
3+
import {useTranslation} from 'sanity'
34
import {type CSSProperties} from 'styled-components'
45

56
import {Tab} from '../../../../../ui-components'
7+
import {tasksLocaleNamespace} from '../../../../i18n'
68
import {type SidebarTabsIds, useTasks} from '../../context'
79

810
const LIST_STYLES: CSSProperties = {
@@ -57,23 +59,25 @@ export function TasksListTabs({activeTabId, onChange}: TasksListTabsProps) {
5759
}
5860
}, [activeDocumentId, documentTabIsDisabled, onChange])
5961

62+
const {t} = useTranslation(tasksLocaleNamespace)
63+
6064
const tabs: TasksListTab[] = useMemo(
6165
() => [
6266
{
6367
id: 'assigned',
64-
label: 'Assigned',
68+
label: t('tab.assigned.label'),
6569
},
6670
{
6771
id: 'subscribed',
68-
label: 'Subscribed',
72+
label: t('tab.subscribed.label'),
6973
},
7074
{
7175
id: 'document',
72-
label: 'Open Document',
76+
label: t('tab.document.label'),
7377
isDisabled: documentTabIsDisabled,
7478
},
7579
],
76-
[documentTabIsDisabled],
80+
[documentTabIsDisabled, t],
7781
)
7882

7983
const handleTabChange = useCallback(

0 commit comments

Comments
 (0)
Please sign in to comment.