Skip to content

Fix fields exposition (temporary solution) #476

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

Merged

Conversation

lionel-bijaoui
Copy link
Member

@lionel-bijaoui lionel-bijaoui commented Jul 2, 2018

  • Please check if the PR fulfills these requirements
  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
    Fix the fact that, fields are not exposed
  • What is the current behavior? (You can also link to an open issue here)
    You cannot import fields like that VueFormGenerator.components['fieldInput']
  • What is the new behavior (if this is a feature change)?
    You should be able to do it like before
  • Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
  • Other information:

@lionel-bijaoui lionel-bijaoui mentioned this pull request Jul 2, 2018
fieldComponents[compName] = Fields(key).default;
});
}

export default {
name: "formGenerator",
components: { formGroup },
Copy link
Member

Choose a reason for hiding this comment

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

you're not actually exposing them in the FormGenerator.components property. Shouldn't components: { formGroup } be components: { fieldComponents }?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yikes sorry !

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, this break a lot of things :(

Copy link
Member Author

Choose a reason for hiding this comment

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

@zoul0813 I tried an alternative way to provide the same functionality.
It export fieldComponents, so you should be able to do that :

import { fieldComponents as VueFormGenerator } from 'vue-form-generator'; 
/* ... */
mixins: [ VueFormGenerator['fieldInput'] ],

or either

import { fieldComponents as coreFields} from 'vue-form-generator'; 
/* ... */
mixins: [ coreFields['fieldInput'] ],

Copy link
Member

Choose a reason for hiding this comment

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

"I" don't need this fix ... but if anyone did the same thing :)

Copy link
Member Author

Choose a reason for hiding this comment

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

This should work, have you tried it ?

Copy link
Member

Choose a reason for hiding this comment

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

haven't checked it, no ... but it looks like it will work just fine.

Should formGroup import the fieldComponents from index ... rather than repeating the same logic?

Copy link
Member Author

@lionel-bijaoui lionel-bijaoui Jul 3, 2018

Choose a reason for hiding this comment

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

I have refactored the code, they share a module which load the components

@lionel-bijaoui lionel-bijaoui requested a review from dflock July 3, 2018 08:57
@lionel-bijaoui lionel-bijaoui merged commit 63b2174 into vue-generators:master Jul 5, 2018
@lionel-bijaoui lionel-bijaoui deleted the lb_fix_field_exposition branch July 5, 2018 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants