-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Implement missing forms selectpart and options #7281
Conversation
src/OrchardCore.Modules/OrchardCore.Forms/Views/Items/SelectPart.Fields.Edit.cshtml
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Forms/Views/Items/SelectPart.Fields.Edit.cshtml
Outdated
Show resolved
Hide resolved
@deanmarcussen I have started working on this too. Can you add my request here? Support for e.g. type being Dropdown list, radio list, List box, checkbox list? |
I thought about those, but I saw this as a Maybe not? it could be extended for optgroup, but I had to do this for a client, and wanted to keep it simple, so thought I'd push it up after. Feel free to take over the pr, I am short of time to do anything much more to it |
@deanmarcussen No worries, I can add my PR on top of your feature.
Technically if we map |
Yes, I essentially agree, but currently the form part's are matched to a tag type. i.e. the input part supports radio buttons etc. Hence why I felt we should probably continue that. Otherwise we're changing our minds partway through, and they become a strange mix. |
Might be worth asking @sfmskywalker what the original design intentions of the forms module was? |
OK, But IMO - using radio/checkbox with input and making list of choices and maintaining It's kinda too much expectation from non technical form designer. |
@deanmarcussen anyway continue with your PR, I'll create PR for my request. |
src/OrchardCore.Modules/OrchardCore.Forms/Views/Items/SelectPart.cshtml
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Forms/Drivers/SelectPartDisplayDriver.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Forms/Drivers/SelectPartDisplayDriver.cs
Show resolved
Hide resolved
Why not just add a bag of SelectItems / OptGroups ? |
I like that Vue.js component I wonder who did it? 🙈 @ns8482e Is there a functional reason why you added this style? OrchardCore/src/OrchardCore.Modules/OrchardCore.Flows/Assets/scss/flows.edit.scss Lines 4 to 6 in 583467a
See #7292 for fix. |
src/OrchardCore.Modules/OrchardCore.Forms/Assets/js/SelectOptionsEditor/selectOptionsEditor.js
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Forms/wwwroot/Scripts/selectOptionsEditor.js
Show resolved
Hide resolved
Yeah it could definitely use a SelectListItem / OptGroups but I believe the Vue.js component doesn't do it for now. We'd need to be able to add OptGroups when we click on the small edit icon and then display a list of those OptGroups as a new column in the Option items. I think it's fine enough for now while we wait on someone to work on adding this on the Vue.js component. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM after small fixes
To reduce white space - when used in smaller columns like 25%, 33% |
But why not simply use Widgets and a bag instead of writing a custom implementation ? |
@jptissot That would be for listing ContentItems right? Then this would be more like a ContentPicker. |
No, I mean the Select has a Bag (named Options) of SelectItem / SelectOptGroup and you build those as Content Items instead of adding a custom editor for Options. |
Yes a content item picker... in then end what you get is a content item list right? |
Yes, I saw your comment on the issue @jptissot , that you had resolved it that way. It tends to be the way I build sites as well, bags, bagcontainers, and bagitems, to create lists inside content. The reason I didn't for this was because you do end up with content items, which makes the templating more complex, and the part becomes not hard typed. i.e. you can't just have an array on it, it becomes an array of content items. As I said, I'm reasonably easy on this pr, I needed it for a client, so figured I'd push it back to OC afterwards. If you guys think it should be done differently, then I don't mind closing it, but the issues have sat there for a year and a half without anyone doing anything to fix it ;) |
Then it’s kinda data source to |
I think we should have both options. These are 2 different option lists which makes sense to have. |
@jptissot Will it break your actual SelectPart because of naming? Maybe we could name this one as SimpleSelectPart and come up with a ContentItemSelectPart later on ... |
@Skrypt |
Ok I understand now why we debate on the implementation. OrchardCore/src/OrchardCore.Modules/OrchardCore.Forms/Migrations.cs Lines 76 to 84 in 7de0dbe
I think we can use the same metadata for every Driver we would implement here? |
I guess yes, you can have multiple drivers contribute in rendering for the same Part. |
So here what I'm saying is that we should probably decide if that's the name we want to use for the Basic implementation which uses the Vue.js viewcomponent. |
You mean |
Ok so I'm leaving you decide if this PR needs more work or not. I'm fine with it. Better have something than nothing too. |
Fixes #3297
Fixes #4094
Similar ui to the predefined text field list settings.
I chose not to do it with
SelectListItem
and / oroptgroup
to keep everything simple, and consistent with the rest of the forms module.