Closed badoet closed 8 years ago
Does Lumx really not work with formly v7?
Looks like these templates need to update to handle some of the breaking changes in v7. https://github.com/formly-js/angular-formly/releases/tag/v7.0.0
Shouldn't be a huge deal. Anyone with slight knowledge of angular-formly should be able to do it.
I'm pretty sure that the only necessary changes will be to change any instance of validateOptions
and replace it with the new apiCheck api. Like so:
here:
{
name: 'input',
validateOptions: {
label: apiCheck.string,
icon: apiCheck.string,
fixedLabel: apiCheck.boolean,
disabled: apiCheck.boolean,
className: apiCheck.string,
theme: apiCheck.oneOf(['light', 'dark']),
type: apiCheck.oneOf(['text', 'number', 'email', 'password', 'url', 'tel']),
required: apiCheck.boolean
}
}
Should be something like this:
{
name: 'input',
apiCheck: function(check) {
return {
templateOptions: {
label: check.string,
icon: check.string,
fixedLabel: check.boolean,
disabled: check.boolean,
className: check.string,
theme: check.oneOf(['light', 'dark']),
type: check.oneOf(['text', 'number', 'email', 'password', 'url', 'tel']),
required: check.boolean
}
};
}
}
@kentcdodds Looks like the last push of code for this was 4 months ago. Do you think I should even look into Lumx Formly? While it looks awesome and very modern...I don't want to get invested with something that isn't supported and updated.
@holtjonathan, if you look at it, it's really not all that complicated. I don't know where @ShMcK stands on supporting the repository, but for the most part it's "done" aside from updating it for infrequent breaking changes in the formly core api. You could either fork it, or, if @ShMcK is ok with it, I could give you push access and you could take it over.
@kentcdodds That makes sense (about it being 'done'). I am not quite ready to incorporate Lumx into my site, I was just doing some research on the cool things that Formly could do. When I get around to trying Lumx out and if it still isn't supported I would be okay with forking/taking over if @ShMcK doesn't want to do it any longer.
Ping us here when you get to that point. I'm sure @ShMcK would be fine with you helping out. He'll need to add you to the collaborators on npm to publish on npm though.
I'm okay with letting someone else take over the project. I'm no longer using LumX in any projects, so I haven't kept up with changes.
Otherwise, I'll review and accept any needed pull requests and publish accordingly.
i end up rolling without using formly. more manageable with plain html
more manageable with plain html
@badoet, heh, I'd be surprised if that's true
@ShMcK, let's wait for anyone else to chime in who wants to implement a fix to upgrade these templates, we'll see if they're keen on taking the project over or would prefer to just PR it. Thanks for staying open!
@kentcdodds, I'll make the proposed upgrade later today, as you've already pointed out the simple necessary changes. Thanks!
But again if someone is actively using the templates and interested in maintaining them, this would be a better future course of action.
:+1:
Formly-Lumx is now updated to work with 7.1.2.
Awesome! Thanks @shmck
@ShMcK and @kentcdodds ,
I finally got around to looking into this library. I pulled down the latest and it still complains about the validateOptions
issue:
ncaught Error: angular-formly: formlyConfig.setType apiCheck failed! `value` at `Argument 1` cannot have extra properties: `validateOptions`.It is limited to `name`, `template`, `templateUrl`, `controller`, `link`, `defaultOptions`, `extends`, `wrapper`, `data`, `apiCheck`, `apiCheckInstance`, `apiCheckFunction`, `apiCheckOptions`, `overwriteOk` settype-validation-failed
You passed:
{
"name": "lx-checkbox",
"templateUrl": "fields/formly-fields-lx-checkbox.html"
}
Just a heads up as we thought this was resolved.
And nevermind. I see the changes were done within the index.js
file. I was including the formlyLumx.js
file (where the changes have not been made).
Yes, that was my fault. I'm sorry for the trouble.
I had forgotten to run the webpack
build after updating.
I realize you probably don't care to take the time to set this up for this repo, but automating releases (<-- free egghead lesson) makes maintaining a library much easier :-)
semantic-release-cli
. Very useful. I wish I read this earlier.
:+1: It's incredible :-)