Skip to content

Commit

Permalink
fix: translation, tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hermanwikner committed Jul 16, 2024
1 parent c8ffade commit 53873a7
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const DOCUMENT_VALUE: SanityDocument = {
],
}

test.describe('Tree Editing with nested objects', () => {
test.describe('Array editing with nested objects', () => {
// test('should navigate and display nested objects correctly', async ({mount, page}) => {
// // Mount the TreeEditingStory component with initial open path
// await mount(
Expand Down
2 changes: 1 addition & 1 deletion packages/sanity/src/core/form/studio/FormBuilder.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const schemaTypes = [
}),
]

jest.mock('./tree-editing/context/enabled/useTreeEditingEnabled')
jest.mock('./array-editing/context/enabled/useTreeEditingEnabled')

describe('FormBuilder', () => {
const mockedUseTreeEditingEnabled = useTreeEditingEnabled as jest.Mock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ const schema = Schema.compile({
],
})

describe('tree-editing: findArrayTypePaths', () => {
describe('array-editing: findArrayTypePaths', () => {
test('should find array type paths in nested objects', () => {
const rootObject = schema.get('testDocument').fields[0]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ export function ArrayEditingDialog(props: ArrayEditingDialogProps): JSX.Element
<Flex align="center" justify="flex-end" paddingX={3} paddingY={2} sizing="border">
<Button
data-testid="array-editing-done"
text={t('array-editing-dialog.sidebar.action.done')}
text={t('array-editing-dialog.footer.action.done')}
onClick={onClose}
/>
</Flex>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ export function ArrayEditingBreadcrumbsMenu(props: ArrayEditingBreadcrumbsMenuPr
return (
<CommandList
activeItemDataAttr="data-hovered"
ariaLabel={t('Array-editing-dialog.breadcrumbs.menu')}
ariaLabel={t('array-editing-dialog.breadcrumbs.menu')}
autoFocus={supportsTouch ? undefined : 'input'}
data-testid="Array-editing-breadcrumbs-menu"
data-testid="array-editing-breadcrumbs-menu"
getItemDisabled={getItemDisabled}
itemHeight={ITEM_HEIGHT}
items={items}
Expand Down
23 changes: 5 additions & 18 deletions packages/sanity/src/core/i18n/bundles/studio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ import {type LocaleResourceBundle} from '../types'
* @hidden
*/
export const studioLocaleStrings = defineLocalesResources('studio', {
/** Accessibility label for the breadcrumb menu */
'array-editing-dialog.breadcrumbs.menu': 'Breadcrumb menu',
/** Label to close the dialog */
'array-editing-dialog.footer.action.done': 'Done',

/** Menu item for deleting the asset */
'asset-source.asset-list.menu.delete': 'Delete',
/** Menu item for showing where a particular asset is used */
Expand Down Expand Up @@ -1643,24 +1648,6 @@ export const studioLocaleStrings = defineLocalesResources('studio', {
'timeline.since-version-missing': 'Since: unknown version',
/** Aria label for the action buttons in the PTE toolbar */
'toolbar.portable-text.action-button-aria-label': '{{action}}',
/** Accessibility label for the breadcrumb menu */
'tree-editing-dialog.breadcrumbs.menu': 'Breadcrumb menu',
/** Title placeholder for search input in array of objects */
'tree-editing-dialog.search-placeholder': 'Search',
/** Menu aria label for the search menu */
'tree-editing-dialog.search.menu-label': 'Search menu',
/** Title label for when no search results are found on the tree of objects */
'tree-editing-dialog.search.no-results-title': 'No results found',
/** Label to close the sidebar */
'tree-editing-dialog.sidebar.action.close': 'Close sidebar',
/** Collapse label the menu item in the sidebar */
'tree-editing-dialog.sidebar.action.collapse': 'Collapse',
/** Label to close the dialog */
'tree-editing-dialog.sidebar.action.done': 'Done',
/** Exapnd label the menu item in the sidebar */
'tree-editing-dialog.sidebar.action.expand': 'Expand',
/** Label to open the sidebar */
'tree-editing-dialog.sidebar.action.open': 'Open sidebar',
/** Label for the button showed after trial ended */
'user-menu.action.free-trial-finished': 'Upgrade from free',
/** Label for button showing the free trial days left */
Expand Down

0 comments on commit 53873a7

Please sign in to comment.