-
Notifications
You must be signed in to change notification settings - Fork 24
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
189 share hangout links #190
base: develop
Are you sure you want to change the base?
189 share hangout links #190
Conversation
This pull request is automatically deployed with Now. Latest deployment for this branch: https://websiteone-fe-git-fork-jmpainter-189-share-hangout-links.agileventures1.now.sh |
great @jmpainter thanks for getting started on this so quickly and making some real progress! Do we need to turn I understand that you did it to calls Are you concerned about calling Just some ideas, and open for discussion and what others think, but I wanted to get back to you. I did find this article, which I haven't completely gone through, but I did see disables the button unless there is something added to the form input. |
Yes, this is a much better setup |
hey @jmpainter, this is currently failing the build with this output
I think you know this, but you can run |
import CustomRingLoader from './CustomRingLoader' | ||
import Videos from './Videos' | ||
import { postEventLink } from '../actions/postEventLinkAction' | ||
import SingleFieldForm from './SingleFieldForm' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @jmpainter thanks for following my suggestion to make this into a child functional component!
Am I right to assume that you are calling it SingleFieldForm
with the idea that it can be reused elsewhere in the code base?
I saw that you are passing down the label and placeholder, so you could use this same component for say sharing the YouTube
links :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, my idea was that SingleFieldForm could be used in other places. In this situation I thought this approach needed review and I knew that it broke tests, but I wanted it to be looked at before committing the time to write tests. Would there be a better way to handle this kind of situation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was actually saying that as a positive! I like that you are thinking ahead!! great job!!
As you said, we need to have tests to get it to pass the checks, but really nice start. I'll pull it down and see if I can get the back end ready
SingleFieldForm.test.js - added with tests for SingleFieldForm EventSummary.js - returned to un-Redux connected component (no longer needed since EventInfo is dispatching the postEventLink action) Not sure about Coveralls |
ecf73b6
to
74116f7
Compare
hey @jmpainter, I am gonna see if I can get this working with the backend, as we discussed. So there were some merge conflicts that I did a rebase locally, but when you rebase you need to force push, so you might notice I was added as a co-collaborator on your other commits, hope that is ok. |
Yes, sure - no problem. |
74116f7
to
22f2114
Compare
@jmpainter, just to keep you in the loop with the progress I've made. If you test it out, please only create events associated with the project I removed your validation for an empty field in favor of using semantic-ui-react Also, made some other changes, let me know if you have any doubts as to why, or if you think I can revert any changes I made. At the moment, the only thing(potentially) keeping this from getting merged in is testing the |
Thanks for getting this working with the back end. Looks good! I'll pull it down and take a look at it tomorrow to take a look at it and will see about writing the test for postEventLinkAction. |
It looks like right now we are not looking for any response coming from the /hangouts/:id endpoint in the postEventLinkAction. Would it be good to look for a success response and display a message to the user? |
Perhaps, at the moment in production we don't do that, but I wouldn't be opposed to it. I know it was successful cause Slack notifies me. We should definitely show an error message if there is one. |
I see - maybe the success message isn't necessary because this is more of an internal use thing. An error message could be useful. Right now SingleFieldForm's 'error' prop is not connected to anything. Maybe we should be using redux-form for SingleFieldForm since it is used elsewhere in the project. Or the error prop could be passed down from EventInfo.js - or maybe none if this is worth it right now? |
I think error handling would be nice, we could maybe just show a toaster with the error message, what do you think? |
If redux-form is intended to be used on all forms in the project, I'd go with that on singleFieldForm for consistency. Otherwise I'd go with passing the error prop to SingleFieldForm from EventInfo because this would be the simplest, is consistent with the redux-form approach, and would put the error message by the field. If other forms in the app are putting error messages by the responsible fields, I think that would be what the user would expect. |
I think it depends on the type of error, no? Have a look at the |
I see it now - had missed it before in a search. Then I'd go with the toast because that is the established pattern for the user and the boilerplate is in place. Redux-form generally doesn't work that way - the errors come from the backend into the store and come into the form to be displayed by the fields. So far only ProjectForm is using redux-form. I suppose that it could produce toasts instead. Probably it would be best to create all forms the same way - not sure what the long range plan is. |
I would agree it would be nice to have the forms use the same. But I'm not sure how the |
Redux-form is set up to use custom front end validators as well and feeds the errors from the front end and back end back to the form where they are displayed with the appropriate field. You can also have an overall form error displayed from the back end like for a 500 error. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, looks good, please review my comments and we shold be ready to merge
notify_hangout: true, | ||
project_id: props.projectId, | ||
event_id: props.id | ||
// token: props.cookies.get(process.env.SESSION || 'WebsiteOne_session') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need this line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, actually this brings up a good point.
At the moment, I have not tested that this works with a user signed in through GitHub OAuth.
For any actions where a user needs to be authenticated and they are signed in through OAuth, we are passing the JWT
token in the params, instead of the headers, but I'm sure there is a better way to access the headers that are sent to the backend to decode them, just haven't figured that out yet.... I think it's a bug related to the OAuth, that can be dealt with in a separate ticket. So the above line can be removed.
/> | ||
<Route path='/events/:slug' component={EventInfo} /> | ||
{/* <Route path='/events/:slug' component={EventInfo} /> */} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need this line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it's an oversight, I believe.
@joaopapereira, @jmpainter and I discussed this Now that we are using We had a doubt about error handling, should we be using What do you think? |
I am ok with holding off the merge |
Any progress on this @jmpainter?? |
App.js - cookies passed to EventInfo
EventInfo.js - cookies passed to EventSummary
EventSummary.js - converted to class based component. Form added for hangout link entry if user is logged in. Basic validation of form has been implemented. Connected to redux to dispatch postEventLink
postEventLinkAction.js - new asyc action created to update event with hangout link - not completely implemented due to changes required on back end
types.js - POST_EVENT_LINK type added
Is this approach on track?
Tests have not been updated yet, I'm waiting for approval for this direction
fixes #189