Skip to content
This repository has been archived by the owner on Apr 30, 2018. It is now read-only.

feat(formly-form): Use arrays for fieldTransforms #461

Merged
merged 1 commit into from
Sep 11, 2015
Merged

feat(formly-form): Use arrays for fieldTransforms #461

merged 1 commit into from
Sep 11, 2015

Conversation

BarryThePenguin
Copy link
Contributor

Documentation and deprecation warnings for both options and formConfig.extras
Fixes #458

@BarryThePenguin
Copy link
Contributor Author

I might add some more tests when I get time

Another thought I had was specifying fieldTransforms as a keyed object, that way you can have specific transforms applied to different fields...

formConfig.extras.fieldTransforms = {
    transformOne: () => { },
    transformTwo: () => { },
};

...

fields = [{
    name: 'one',
    fieldTransforms: ['transformOne']
}, {
    name: 'two',
    fieldTransforms: ['transformTwo']
}]

@kentcdodds
Copy link
Member

Thanks for this. Can't merge now, but will look more closely later. The problem with object is order isn't consistent/garunteed... Though I like the idea, I think we'll wait for someone to have aause case before we implement something like that.

Thanks again! I'll look at this later. In the mean time, could I ask for your feedback on ease of contributing?

setupModels();

angular.forEach($scope.fields, attachKey); // attaches a key based on the index if a key isn't specified
angular.forEach($scope.fields, setupWatchers); // setup watchers for all fields
}

function warn() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason you didn't just inject the formlyWarn service and use that instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No reason, just didn't see it there. Will switch it out

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's impressive that you created almost exactly what I had. Haha, I thought it was copy/paste code 😀

@kentcdodds
Copy link
Member

Odd... Travis says that the build passed, but if I look at the output, it shows that two tests failed...

@BarryThePenguin
Copy link
Contributor Author

Hmm... I do have ghooks disabled (on Windows). Will look at it later. I'm in no hurry to get this merged, just happy to contribute

@kentcdodds
Copy link
Member

I'm happy to have you contribute! Looks like they're failing locally. I'll try to see what's going on. I'll let you know. Thanks for contributing :-)

@kentcdodds
Copy link
Member

I've found the problem. I'll submit a PR to your branch :-)

Documentation and deprecation warnings for both options and formConfig.extras

Fixes #458
@kentcdodds
Copy link
Member

Perfect! Thank you!

@kentcdodds kentcdodds merged commit 9a35781 into formly-js:master Sep 11, 2015
@BarryThePenguin
Copy link
Contributor Author

Thanks for the assistance! I'll try some feedback...

I find structure really helpful, code style, contribution guidelines, have always been helpful when I've contributed to projects in the past. Since using formly and seeing first-timers-only gain momentum, it's only recently I've realised how helpful these ideas are for the community.

Using ghooks to run linting, tests, etc is really helpful. Saves all the nitpicking 'why did you add that tab/space/symbol/emoji'. Super beneficial. The downside is making it work in everyone's dev environment/setup. How can we improve that experience for people, especially when the node/npm world is so modular and projects have so many dependencies, for example commitizen/cz-cli#10.

How much hand-holding should there be? I think it's enough to reply to people's queries with a quick link or short description of where to find the solution. From what I've seen in Gitter, you do a good job.

From this side of the world it looks like you're making good things. Look after yourself

@kentcdodds
Copy link
Member

:-D thanks for the feedback! I'm glad that overall it was a good
experience. Thanks again for contributing. Let's do this again sometime :-D

  • Kent C. Dodds

(Sent from my mobile device, please forgive typos or brevity)
On Sep 11, 2015 12:25 AM, "Jonathan Haines" notifications@github.com
wrote:

Thanks for the assistance! I'll try some feedback...

I find structure really helpful, code style, contribution guidelines, have
always been helpful when I've contributed to projects in the past. Since
using formly and seeing first-timers-only gain momentum, it's only recently
I've realised how helpful these ideas are for the community.

Using ghooks to run linting, tests, etc is really helpful. Saves all the
nitpicking 'why did you add that tab/space/symbol/emoji'. Super beneficial.
The downside is making it work in everyone's dev environment/setup. How can
we improve that experience for people, especially when the node/npm world
is so modular and projects have so many dependencies, for example
commitizen/cz-cli#10 commitizen/cz-cli#10.

How much hand-holding should there be? I think it's enough to reply to
people's queries with a quick link or short description of where to find
the solution. From what I've seen in Gitter, you do a good job.

From this side of the world it looks like you're making good things. Look
after yourself


Reply to this email directly or view it on GitHub
#461 (comment)
.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants