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

Missing inheritFilters field for Collection for InitialData #2484

Closed
rsat opened this issue Oct 24, 2023 · 3 comments
Closed

Missing inheritFilters field for Collection for InitialData #2484

rsat opened this issue Oct 24, 2023 · 3 comments
Assignees

Comments

@rsat
Copy link

rsat commented Oct 24, 2023

Describe the bug

When importing data or populating there is no option to set inheritFilters to false. Probably this was kept from before the inheritFilters was introduced

export interface CollectionDefinition {
name: string;
description?: string;
slug?: string;
private?: boolean;
filters?: CollectionFilterDefinition[];
parentName?: string;
assetPaths?: string[];
}

const collection = await this.collectionService.create(ctx, {
translations: [
{
languageCode: ctx.languageCode,
name: collectionDef.name,
description: collectionDef.description || '',
slug: collectionDef.slug ?? collectionDef.name,
},
],
isPrivate: collectionDef.private || false,
parentId,
assetIds: assets.map(a => a.id.toString()),
featuredAssetId: assets.length ? assets[0].id.toString() : undefined,
filters,
});
collectionMap.set(collectionDef.name, collection);

To Reproduce
Steps to reproduce the behavior:

  1. Import data with collections
  2. All collections are set to InheritFilters to true by default when importing data.

Expected behavior

Imported Collections should keep setting inheritFilters to true by default but should be able to set as false if desired.

Environment (please complete the following information):

  • @vendure/core version: 2.1.1
  • Nodejs version 16.20
  • Database (mysql/postgres etc): postgres

Additional context
Could create the pull request with the fix for approval

@rsat rsat added the type: bug 🐛 Something isn't working label Oct 24, 2023
@rsat rsat changed the title Missing inheritFilters fields for Collection for InitialData Missing inheritFilters field for Collection for InitialData Oct 24, 2023
@michaelbromley michaelbromley added @vendure/core type: feature ✨ contributions welcome next minor Candidate for the next minor release and removed type: bug 🐛 Something isn't working labels Nov 17, 2023
@michaelbromley
Copy link
Member

Hi Ricardo!

You're right - the format has not been updated when we added the inheritFilters toggle in v2. If you are willing to make a PR then that would be very welcome!

@bhardwajakshit
Copy link
Contributor

@michaelbromley, Raised a PR for this: #2534

@michaelbromley
Copy link
Member

@bhardwajakshit thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants