sanity-io / orderable-document-list

Drag-and-drop Document Ordering without leaving the Editing surface
MIT License
75 stars 22 forks source link

No handler defined for action #13

Closed 58bits closed 2 years ago

58bits commented 2 years ago

Not sure what's up, whether it's something at our end but we have everything working - except the actions in the drop down menu....

image

Trying to Create a New Team Member, Show Increments, or Reset Order, shows the following console errors...

No handler defined for action: undefined No handler defined for action: showIncrements No handler defined for action: resetOrder

Our desk structure is...

import S from '@sanity/desk-tool/structure-builder'
import { orderableDocumentListDeskItem } from '@sanity/orderable-document-list'

export default () =>
  S.list()
    .title('Base')
    .items([
      // ...S.documentTypeListItems(),
      S.documentTypeListItem('post'),
      S.documentTypeListItem('author'),
      S.documentTypeListItem('category'),
      orderableDocumentListDeskItem({
        type: 'team_member',
        title: 'Team Members',
      }),
    ])

And our schema for team_members...

import {
  orderRankField,
  orderRankOrdering,
} from '@sanity/orderable-document-list'

export default {
  name: 'team_member',
  title: 'Team Member',
  type: 'document',
  // Optional: The plugin also exports a set of 'orderings' for use in other Document Lists
  orderings: [orderRankOrdering],
  fields: [
    // Minimum required configuration
    orderRankField({ type: 'team_member' }),
    {
      name: 'name',
      title: 'Name',
      type: 'string',
    },
    {
      name: 'qualifications',
      title: 'Qualifications',
      type: 'string',
      options: {
        maxLength: 96,
      },
    },
    {
      name: 'position',
      title: 'Position',
      type: 'string',
      options: {
        maxLength: 96,
      },
    },
    {
      name: 'slug',
      title: 'Slug',
      type: 'slug',
      options: {
        source: 'name',
        maxLength: 96,
      },
    },
    {
      name: 'image',
      title: 'Image',
      type: 'image',
      options: {
        hotspot: true,
      },
    },
    {
      name: 'bio',
      title: 'Bio',
      type: 'array',
      of: [
        {
          title: 'Block',
          type: 'block',
          styles: [{ title: 'Normal', value: 'normal' }],
          lists: [],
        },
      ],
    },
  ],
  preview: {
    select: {
      title: 'name',
      media: 'image',
    },
  },
}
SimeonGriggs commented 2 years ago

Thanks for reporting, what version of the Studio are you using? We've seen this error in earlier versions but it should be fixed on at least 2.23.0 and above?

58bits commented 2 years ago

Hi @SimeonGriggs - thanks for the reply.

I'm using version 2.23.3 of the Sanity CLI (as this the same as the version of Studio?)

SimeonGriggs commented 2 years ago

Can you also try updating the plugin to 0.0.4?

58bits commented 2 years ago

Hi @SimeonGriggs - I believe I'm already using 0.0.4 version of the plugin...

"@sanity/orderable-document-list": "^0.0.4",

Best,

Tony

SimeonGriggs commented 2 years ago

Hey! Turns out this was in issue in the Studio, which was fixed in yesterday's 2.25.0 release 🎉

Upgrade your Studio to fix.

58bits commented 2 years ago

@SimeonGriggs - okay thanks - I'll give it a try!

58bits commented 2 years ago

@SimeonGriggs - sorry - but still no luck. The same error, as well as new React errors The input component for type "team_member" has no associated ref element. Please check the implementation of "Unknown" I'd be glad to jump on a call show you what it looks like from this end if you thought that would help.

SimeonGriggs commented 2 years ago

Just to be completely sure, can you nuke your node_modules and package-lock.json and reinstall with latest-everything?

58bits commented 2 years ago

Hi @SimeonGriggs - that did it! Thank you! The UI updated as well. I'm still getting a The input component for type "team_member" has no associated ref element. Please check the implementation of "Unknown" [ error message in the console, but I'll take a look at this separately. Thanks for the help.

SimeonGriggs commented 2 years ago

Excellent.

Well, other than that other error. I'll take a look at that. Feel free to file a new Issue.

muadz-mr commented 1 year ago

Until today, I am still getting a The input component for type "banner" has no associated ref element. Please check the implementation of "Unknown" [ error message in the console. And a bunch of other React component related errors.

I am using Sanity Studio 2.35.0 and package version "@sanity/orderable-document-list": "^0.0.10";

Do I need to upgrade both Studio and package to the latest one? or React package itself?