File tree Expand file tree Collapse file tree 3 files changed +29
-2
lines changed
packages/ui/src/views/List Expand file tree Collapse file tree 3 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -163,7 +163,7 @@ export const DefaultListView: React.FC<ListViewClientProps> = (props) => {
163
163
] )
164
164
165
165
useEffect ( ( ) => {
166
- if ( drawerDepth <= 1 ) {
166
+ if ( ! drawerDepth ) {
167
167
setStepNav ( [
168
168
{
169
169
label : labels ?. plural ,
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import type { CollectionConfig } from 'payload'
3
3
import { slateEditor } from '@payloadcms/richtext-slate'
4
4
5
5
import { slugPluralLabel , slugSingularLabel } from '../shared.js'
6
- import { postsCollectionSlug } from '../slugs.js'
6
+ import { postsCollectionSlug , uploadCollectionSlug } from '../slugs.js'
7
7
8
8
export const Posts : CollectionConfig = {
9
9
slug : postsCollectionSlug ,
@@ -182,6 +182,11 @@ export const Posts: CollectionConfig = {
182
182
} ,
183
183
} ,
184
184
} ,
185
+ {
186
+ name : 'upload' ,
187
+ type : 'upload' ,
188
+ relationTo : uploadCollectionSlug ,
189
+ } ,
185
190
{
186
191
name : 'hiddenField' ,
187
192
type : 'text' ,
Original file line number Diff line number Diff line change @@ -262,6 +262,28 @@ describe('Document View', () => {
262
262
} )
263
263
} )
264
264
265
+ describe ( 'breadcrumbs' , ( ) => {
266
+ test ( 'List drawer should not effect underlying breadcrumbs' , async ( ) => {
267
+ await navigateToDoc ( page , postsUrl )
268
+
269
+ expect ( await page . locator ( '.step-nav.app-header__step-nav a' ) . nth ( 1 ) . innerText ( ) ) . toBe (
270
+ 'Posts' ,
271
+ )
272
+
273
+ await page . locator ( '#field-upload button.upload__listToggler' ) . click ( )
274
+ await expect ( page . locator ( '[id^=list-drawer_1_]' ) ) . toBeVisible ( )
275
+ await wait ( 100 ) // wait for the component to re-render
276
+
277
+ await expect (
278
+ page . locator ( '.step-nav.app-header__step-nav .step-nav__last' ) ,
279
+ ) . not . toContainText ( 'Uploads' )
280
+
281
+ expect ( await page . locator ( '.step-nav.app-header__step-nav a' ) . nth ( 1 ) . innerText ( ) ) . toBe (
282
+ 'Posts' ,
283
+ )
284
+ } )
285
+ } )
286
+
265
287
describe ( 'custom document views' , ( ) => {
266
288
test ( 'collection — should render custom tab view' , async ( ) => {
267
289
await page . goto ( customViewsURL . create )
You can’t perform that action at this time.
0 commit comments