question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature Request] Support same collection with different EntityCollection

See original GitHub issue

First of all, great library!

Problem: I have a collection"Posts". I wanted to have a separate EntityCollectionView or page for allPosts and has initialFilters for pendingPosts

Ideal scenario on the navigation page. I have both “All Posts” and “Pending Posts”.

I tried creating a custom view

const pendingPostsCollection = buildCollection<Partial<Post>>({
      initialFilter: filterPendingPosts,
      name: 'Pending Posts',
      path: 'posts',
      permissions: editOnlyPermission,
      schema: pendingPosts,
      textSearchEnabled: true,
    });

    const customViews: CMSView[] = [
      {
        name: 'Pending Posts',
        path: ['pendingPosts'],
        // This can be any React component
        view: <EntityCollectionView collection={pendingPostsCollection} path="posts" />,
      },
    ];

But this implementation requires me to have an existing path for “posts” in navigation or else it doesn’t resolve any schema even tho I already passed in a collection (My guess is it’s binded somewhere on navigation).

However, if I do put a path for “posts” which is the “All Posts” EntityCollection. It resolves to the existing an existing schema “All Posts” EntityCollection and doesn’t work as intended since my initialFilters and customized pendingPostsSchema isn’t there.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
fgatti675commented, May 29, 2022

This feature will be available in version 2.0.0 since we hace introduced collection aliases, allowing developers to have multiple collections in the same path

1reaction
fgatti675commented, Mar 25, 2022

Hi @jeemercado We have big changes regarding how collections are resolved internally for version 2.0 and will keep this feature in mind. Yeah, right now the path acts as an id so it is hard to change this behaviour at this point. Thank you for the feedback!

Read more comments on GitHub >

github_iconTop Results From Across the Web

EntityCollection Class (Microsoft.Xrm.Sdk)
Initializes a new instance of the EntityCollection class setting the list of entities. Properties. Entities. Gets the collection of entities. EntityName. Gets ...
Read more >
Add Record To Entity Collection - Microsoft Dynamics CRM ...
Hello,. I want to add a record (let's call it "sampleRecord") to an Entity Collection (let's call it "sampleCollection"), but somehow I ...
Read more >
Feature Requests: Content Collections | Help Center | Wix.com
The Wix Support Center has everything you need to help you create a free website. Learn more about Feature Requests: Content Collections now!...
Read more >
Databinding with Windows Forms and ASP.NET, SelfServicing
NET feature which can drastically increase productivity when it is implemented ... Every entity collection returns its DefaultView when this request comes.
Read more >
how to EXTEND Custom Entity Collection Reducers in @ngrx ...
You've approached this the same way I did initially: trying to register a custom reducer to handle the additionalCollectionState properties.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found