Open laurenskling opened 5 years ago
Hi @laurenskling. Did you working on it or I can check and create PR?
@scipe i actually did work on it a while ago, now you mention it. I got some stuff fixed for this, but I wasn't too happy with the look. A block without a count and button will be way smaller... I'll set up a PR today, you can see
Expected behavior
According to docs https://github.com/keystonejs/keystone/blob/master/docs/documentation/Configuration/AdminUI-Options.md#navigation I can add an external link. I would expect to see a tile that goes to the link, but does not contain list things like items count and an add button.
Actual/Current behavior
You can only add an external link by putting the object into an array. Because this code: https://github.com/keystonejs/keystone/blob/master/lib/core/initNav.js#L32 will not wrap the Object with an array, and https://github.com/keystonejs/keystone/blob/master/lib/core/initNav.js#L40 _.map will actually map over the Object itself, thus crashing on line 42.
When rendering the tile, https://github.com/keystonejs/keystone/blob/master/admin/client/App/screens/Home/components/Lists.js#L18 this code will see no
listData
(because there is no list for it) and fallbackisNoCreate
tofalse
, thus rendering a create button. The count is always rendered, which doesn't really make sense with a externalLink.Steps to reproduce the actual/current behavior
The example will break:
It builds with the array fix and will show count and add button:
Environment