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

Controller for the content picker field, add a content type parameter #15754

Open
chinasqzl opened this issue Apr 15, 2024 · 7 comments
Open
Milestone

Comments

@chinasqzl
Copy link
Contributor

Contract parts, when you make up two different content types of purchase and sales contracts, the selected partner is different, and you need to read the settings of the contract parts under the content type to extend the IContentPickerResultProvider

@Piedone
Copy link
Member

Piedone commented Apr 15, 2024

Please fill out the issue template (you can get it from here) fully, because I'm unclear on what your issue is about.

@chinasqzl
Copy link
Contributor Author

chinasqzl commented Apr 16, 2024

Is your feature request related to a problem? Please describe.

public class ContractPart : ContentPart{
public ContentPickerField Partner { get; set; } = new();
}
public class ContractPartSettings
{
public string Type { get; set; } //Sale or Purchase
}

When the contract is a purchase, the partner is the supplier content type, and when it is a sale, the partner is the customer content type, and now ContentPickerAdminController.SearchContentItems() can only get the parts, but it can't get the parts of which content type, and it can't read the ContractPartSettings, so you can't do pickers for more scenarios

image

Describe the solution you'd like

Contract parts, when you make up two different content types of purchase and sales contracts, the selected partner is different, and you need to read the settings of the contract parts under the content type to extend the IContentPickerResultProvider

Describe alternatives you've considered

ContentPickerAdminController.SearchContentItems , Add the type parameter
public async Task SearchContentItems(string type,string part, string field, string query)

image

@Piedone
Copy link
Member

Piedone commented Apr 16, 2024

I think conceptually this is a similar issue to #9444. I this for named/reusable parts?

@chinasqzl
Copy link
Contributor Author

chinasqzl commented Apr 17, 2024

It's not the same, adding a type parameter, mainly for the ContentPickerAdminController.SearchContentItems() you can get the settings in the part, and pass in the IContentPickerResultProvider.Search(), the part is composed of multiple content types, and the settings in the part are not different

@Piedone
Copy link
Member

Piedone commented Apr 17, 2024

Yeah, but isn't this something useful for named/reusable parts? Because GetPartDefinitionAsync(part).Fields will be the same as GetTypeDefinitionAsync(type).Parts.FirstOrDefault(p => p.Name == part).PartDefinition.Fields except for reusable parts.

@chinasqzl
Copy link
Contributor Author

chinasqzl commented Apr 18, 2024

That's right, you need to add the parameters of the technical name of the part

Copy link

We triaged this issue and set the milestone according to the priority we think is appropriate (see the docs on how we triage and prioritize issues).

This indicates when the core team may start working on it. However, if you'd like to contribute, we'd warmly welcome you to do that anytime. See our guide on contributions here.

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

2 participants