Skip to content
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

Update Flash component and withMessages container #1973

Merged
merged 1 commit into from May 3, 2018

Conversation

bernardodiasc
Copy link
Contributor

While testing the Posting edit action with latest from devel I stumbled on an issue:

Form.jsx:517
TypeError: Cannot read property 'id' of undefined
    at Flash._this.getProperties (Flash.jsx:33)
    at Flash.render (Flash.jsx:44)
    at finishClassComponent (modules.js?hash=ffcdd80922dc5d0dd7afe11426e1665a70c9d671:94083)
    at updateClassComponent (modules.js?hash=ffcdd80922dc5d0dd7afe11426e1665a70c9d671:94051)
    at beginWork (modules.js?hash=ffcdd80922dc5d0dd7afe11426e1665a70c9d671:94676)
    at performUnitOfWork (modules.js?hash=ffcdd80922dc5d0dd7afe11426e1665a70c9d671:97508)
    at workLoop (modules.js?hash=ffcdd80922dc5d0dd7afe11426e1665a70c9d671:97537)
    at renderRoot (modules.js?hash=ffcdd80922dc5d0dd7afe11426e1665a70c9d671:97568)
    at performWorkOnRoot (modules.js?hash=ffcdd80922dc5d0dd7afe11426e1665a70c9d671:98143)
    at performWork (modules.js?hash=ffcdd80922dc5d0dd7afe11426e1665a70c9d671:98064)

These js undefined errors breaks the entire application frontend.


Hi @SachaG, please let me know if this helps or if you have something different in mind.

I noticed recent changes here a086e6e and found a fix. Not sure how much this would overall affect the platform tho.

As far as I understood, the flash action now will be triggered like this

this.props.flash({ id: 'posts.edit_success', type: 'success', properties: { title: post.title } });

@SachaG
Copy link
Contributor

SachaG commented May 3, 2018

Yes that looks correct :) See also http://docs.vulcanjs.org/errors.html

Btw I do think errorObject is a better name than messageObject because that object itself can have a message property. So I thought naming everything "message" could get confusing…

@SachaG SachaG merged commit c67b7c1 into VulcanJS:devel May 3, 2018
@bernardodiasc
Copy link
Contributor Author

Btw I do think errorObject is a better name than messageObject because that object itself can have a message property. So I thought naming everything "message" could get confusing…

Got it, sounds good to me as well. I changed because this object can also hold success messages, not only the error messages :)

@SachaG
Copy link
Contributor

SachaG commented May 3, 2018

Yeah, I hesitated for the same reason… but I couldn't find another better name…

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.

None yet

2 participants