Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Entity Item Ref Extension #18265

Open
wants to merge 25 commits into
base: v15/dev
Choose a base branch
from

Conversation

madsrasmussen
Copy link
Contributor

@madsrasmussen madsrasmussen commented Feb 7, 2025

This PR introduces a new extension point and a new element to render the extension "Entity Item Ref."

The extension point is used to render a list of references based on the "Item" model. The extension point will be used in pickers and reference lists where we, in some cases, can get a list of different entity types and therefore cannot hardcode the rendering of the list.

The item ref makes a lookup in the extension registry based on the "entity type" on the model and finds a matching extension. It is thereby possible to use a rendering specific to the type. If no matching extension can be found, it will use a default rendering.

The many changes is this PR is also caused be some item repositories/types being moved around

Here are some key areas to look at:

Manifest:

{
  type: 'entityItemRef',
  alias: 'Umb.EntityItemRef.Document',
  name: 'Document Entity Item Reference',
  element: () => import('./document-item-ref.element.js'),
  forEntityTypes: [UMB_DOCUMENT_ENTITY_TYPE],
},

Using the element:

<uui-ref-list>
  <umb-entity-item-ref .item=${itemGoesHere}>

    <uui-action-bar slot="actions">
      <!-- actions goes here -->
    </uui-action-bar>

  </umb-entity-item-ref>
</uui-ref-list>

The PR implements the new umb-entity-item-ref element for three pickers as a test:

  • Document
  • Member
  • User

In addition, I have also aligned the UX of the pickers so they all support opening the workspace from the item and respect the section permissions.

What to test:
Please ensure that the pickers mentioned above work as expected.

@madsrasmussen madsrasmussen marked this pull request as ready for review February 10, 2025 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant