sanity-io / dashboard-widget-document-list

Dashboard widget for the Sanity Content Studio which displays a list of documents
MIT License
17 stars 8 forks source link

Incorrect URL for drafts #9

Closed seelts closed 4 years ago

seelts commented 4 years ago

Seems like this widget constructs wrong url for draft documents. It includes "draft." to the URL where only id should be used.

For example I'm getting http://localhost:3333/desk/__edit__drafts.59ea3747-6734-462c-9383-88935545a15b%2Ctype%3DlandingPage instead of http://localhost:3333/desk/__edit__59ea3747-6734-462c-9383-88935545a15b%2Ctype%3DlandingPage

image
Stack trace:
TypeError: Cannot read property 'patch' of null
    at http://localhost:3333/static/js/app.bundle.js:180015:37
    at renderWithHooks (/static/js/vendor.bundle.js:19834:18)
    at mountIndeterminateComponent (/static/js/vendor.bundle.js:22514:13)
    at beginWork (/static/js/vendor.bundle.js:23638:16)
    at HTMLUnknownElement.callCallback (/static/js/vendor.bundle.js:5197:14)
    at Object.invokeGuardedCallbackDev (/static/js/vendor.bundle.js:5246:16)
    at invokeGuardedCallback (/static/js/vendor.bundle.js:5301:31)
    at beginWork$1 (/static/js/vendor.bundle.js:28243:7)
    at performUnitOfWork (/static/js/vendor.bundle.js:27194:12)
    at workLoopSync (/static/js/vendor.bundle.js:27170:22)
Component stack:
    in Unknown
    in StreamingComponent
    in StreamingComponent (created by Context.Consumer)
    in WithInitialValueWrapper (created by Pane)
    in Pane (created by DeskToolPanes)
    in SplitPaneWrapper (created by DeskToolPanes)
    in div (created by Pane)
    in Pane (created by SplitPane)
    in div (created by SplitPane)
    in SplitPane (created by PanesSplitController)
    in div (created by PanesSplitController)
    in div (created by Pane)
    in Pane (created by SplitPane)
    in div (created by SplitPane)
    in SplitPane (created by PanesSplitController)
    in div (created by PanesSplitController)
    in PanesSplitController (created by DeskToolPanes)
    in div (created by DeskToolPanes)
    in DeskToolPanes (created by DeskTool)
    in div (created by DeskTool)
    in DeskTool (created by withRouter(DeskTool))
    in withRouter(DeskTool) (created by DeskToolPaneStateSyncer)
    in DeskToolPaneStateSyncer (created by RenderTool)
    in RenderTool (created by SchemaErrorReporter)
    in RouteScope (created by SchemaErrorReporter)
    in div (created by SchemaErrorReporter)
    in div (created by SchemaErrorReporter)
    in div (created by SchemaErrorReporter)
    in SchemaErrorReporter (created by DefaultLayout)
    in DefaultLayout (created by withRouter(DefaultLayout))
    in withRouter(DefaultLayout) (created by DefaultLayoutContainer)
    in RouterProvider (created by DefaultLayoutContainer)
    in LoginWrapper (created by DefaultLayoutContainer)
    in DefaultLayoutContainer (created by SanityRoot)
    in SnackbarProvider (created by SanityRoot)
    in div (created by SanityRoot)
    in SanityRoot
    in AppContainer
seelts commented 4 years ago

Also https://sanity-io-land.slack.com/archives/C9Z7RC3V1/p1589492818235000 and https://sanity-io-land.slack.com/archives/C9Z7RC3V1/p1591567207394000

seelts commented 4 years ago

Closed because of https://github.com/sanity-io/dashboard-widget-document-list/commit/04f87b1e77cd9a7b313e117b14286b67b3cee15c