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

Can we set Stereotype as a dropdown menu? #16005

Closed
hyzx86 opened this issue May 7, 2024 · 12 comments
Closed

Can we set Stereotype as a dropdown menu? #16005

hyzx86 opened this issue May 7, 2024 · 12 comments
Milestone

Comments

@hyzx86
Copy link
Contributor

hyzx86 commented May 7, 2024

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

Now , the Stereotype is a text box, which is not user-friendly when making changes.

For example, I can't always figure out if it's UserCustomSettings or CustomUserSettings 🤣

Describe the solution you'd like

Maybe we have some way to get all the Stereotypes that are currently supported by the system, and then list them.

@Piedone
Copy link
Member

Piedone commented May 7, 2024

The issue is that stereotypes are by convention, and there's no list of the ones available currently. We could have a combobox suggesting the usual ones like you mention (or at least have them documented in a hint below it), but those values wouldn't always do something (since they depend on the currently enabled features).

@hishamco
Copy link
Member

hishamco commented May 7, 2024

I was thinking about that in the past, @Piedone even the are by convention we can populate the once that we use in the source and well documents, also we could add ability to register a new one

If this might be helpful which I think I can submit a PR

@hyzx86
Copy link
Contributor Author

hyzx86 commented May 8, 2024

@hishamco , Great! this PR is also waiting for an autofill component interaction, I can copy your homework when you're done!🤣

#15636

@sebastienros
Copy link
Member

We could have a list of string in a content manager options object where feature can add custom values for supported stereotypes. Maybe even a class with a translated description. Keep the textbox though, and some autocomplete for hints.

@sebastienros sebastienros added this to the 2.x milestone May 9, 2024
@hishamco
Copy link
Member

hishamco commented May 9, 2024

My idea is to add a textbox with autocomplete as Seb mentioned, I didn't think about translated description but it's good addition

@hishamco hishamco self-assigned this May 9, 2024
@hyzx86
Copy link
Contributor Author

hyzx86 commented May 10, 2024

@hishamco
How do you plan to implement this AutoComplete component? I'm in need of a similar UI component for another PR : #15636 ,I know there are a lot of beautiful and powerful 3rd party UI components out there, but what are the requirements for us to introduce these front-end components?

@Skrypt I've noticed that you guys do a lot of VUE-related contributions, are there any plans to release such a component library?

Here's a low-code framework from baidu. It uses json to build pages,
But it has a larger dependency package,It's really not cost-effective if we only use one of its autocomplete components

https://aisuda.bce.baidu.com/amis/zh-CN/components/form/input-text#%E8%87%AA%E5%8A%A8%E8%A1%A5%E5%85%A8

@hyzx86
Copy link
Contributor Author

hyzx86 commented May 10, 2024

Well, HTML comes with an autocomplete feature.
It is currently supported by most major browsers
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist

hyzx86 added a commit to hyzx86/OrchardCore that referenced this issue May 10, 2024
@hishamco
Copy link
Member

Exactly, my aim is to use a textbox with autofill using datalist element

@hishamco
Copy link
Member

BTW @hyzx86 I noticed a draft PR, while I assigned this issue to me, so to save time and avoid duplicating the work if you want to handle this let me know so I can unassign myself from this issue

@hyzx86
Copy link
Contributor Author

hyzx86 commented May 10, 2024

@hishamco , I have created a PR at here #16005

@hishamco
Copy link
Member

You mean #106025, but I hope the second time you check if the issue is assigned by someone else or not to save time

@hishamco hishamco removed their assignment May 10, 2024
@hyzx86
Copy link
Contributor Author

hyzx86 commented May 10, 2024

但是还没完成,关于如何添加模块中已定义的 Stereotype ,我想听听你们的建议

I noticed that there is a default implementation here, but it's based on the types that have already been created, and the list is blank if it's a new tenant

https://github.com/OrchardCMS/OrchardCore/blob/main/src/OrchardCore.Modules/OrchardCore.ContentTypes/Services/StereotypeService.cs

I plan to tweak this function to internally generate a HasSet to avoid duplicate values, and then add an implementation of IStereotypesProvider to a different module such as CustomSettingsStereotypeProvider , CustomUserSettingsStereotypeProvider.

I'm just wondering if it's worth it. Why not use IOptions just to add a string?

@MikeAlhayek , I see that you added this feature. Do you have a better suggestion about the realization of this?😊

@hyzx86 hyzx86 closed this as completed May 11, 2024
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

4 participants