Angular Material: OneOf Enum Control Renderer#2551
Angular Material: OneOf Enum Control Renderer#2551daniel-shuy wants to merge 5 commits intoeclipsesource:masterfrom
Conversation
✅ Deploy Preview for jsonforms-examples ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
sdirix
left a comment
There was a problem hiding this comment.
Thank you for your contribution! ❤️
packages/angular-material/src/library/controls/one-of-enum.renderer.ts
Outdated
Show resolved
Hide resolved
3f7d65d to
e94da20
Compare
e94da20 to
fc55e41
Compare
|
The modification of the |
fc55e41 to
bf1d6ed
Compare
| templateUrl: './enum.renderer.html', | ||
| styleUrls: ['./enum.renderer.scss'], |
There was a problem hiding this comment.
Every other renderer in this package uses inline template: and styles:. I'd prefer a shared const for the template and styles strings that both @Component decorators reference, which is what I originally suggested. That keeps the convention consistent and removes the need for the .eslintrc.js restructuring.
There was a problem hiding this comment.
Ok, I've made the changes as you suggested and reverted the changes to .eslintrc.js, but note that the shared consts will be treated as literal strings by IDEs/editors (no syntax highlighting, code completion, etc)
Renamed
AutocompleteControlRenderertoEnumControlRendererto be consistent with other renderer setsThe
OneOfEnumControlRendererhas the same implementation as theEnumControlRenderer, the only difference being that it takes inEnumOption[]instead ofstring[], so that a different label can be displayed instead of the value:jsonforms/packages/core/src/mappers/renderer.ts
Lines 320 to 323 in 3a9bc74
oneOf.constis mapped toEnumOption.valueoneOf.titleis mapped toEnumOption.label