microsoft-search / pnp-modern-search

Home of PnP Modern Search solutions, helping you move from classic to modern SharePoint and beyond
https://microsoft-search.github.io/pnp-modern-search
Other
387 stars 340 forks source link

Layout Type Adaptive Card displays Missing slots warning #4038

Open leichtin opened 1 week ago

leichtin commented 1 week ago

Version used Ex: 4.13.1

Describe the bug Warning "The following slots have not been configured: Id" when changing to Adaptive Cards layout. Webpart then does not display anything.

To Reproduce

  1. Insert PnP Search Webpart
  2. Search query {searchTerms} * (just to get everything as a test)
  3. On page 2 select available Layout "Adaptive Card"
  4. Warning "The following slots have not been configured: Id" is shown

Expected behavior When using adaptive cards layout, mandatory standard fields should alredy be mapped.

Screenshots

Screenshot 2024-10-11 110534

Desktop (please complete the following information):

Additional context Changing line 50 in results template from $root.slots['IId']))[0]} to $root.slots['ItemId']))[0]} removes the warning but doing the same in a custom json still displays the warning "The following slots have not been configured:" but without the missing field.

marcoschmucker commented 1 week ago

We have the same issue with 4.13.1 - cannot be used, @wobba

jblueml commented 4 days ago

In my opinion the missing slot warning works as intended: there's a reference to a slot named "Id" in the (default) AC-layout-template "List" and there's no (default) slot named "Id"). image

@wobba The question is rather, whether this 'id' attribute for the items-collection is really necessary in this standard layout template. I've tested this with a AC-layout-template without this line and it worked for me (with version 4.12.2).

BUT: There seems to be a general problem with adaptive-card-rendering in version 4.13.1, which leads to the misbehaviour described by @leichtin and @marcoschmucker.

Simply switching the template-type to "Adaptive Cards" in a freshly added results-webpart leads to not changing and rendering the default results-layout "List" and the following error in the browser console is logged: image

I saw, in TemplateService.ts, that packages for adaptive card-handling (adaptivecards, adaptive-expressions, adaptivecards-templating) are imported on demand.

Could that be a packaging-issue finally? image