-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Show user even when add new user is cancel #719
Comments
Hi, I would like to take up this issue. @tangollama |
@kartik95 It's yours. Thanks for pitching in! |
I have a doubt, since documentation is not present in each file (which I would strongly recommend to have). In the 'edit-panel.hbs' component, what is the difference between cancelButtonText and cancel? Anyways, both are performing the same action 'cancel'. Also, can anyone make me go through the workflow? It is kind of difficult to get it without the documentation. |
@kartik95 Perhaps we could fix the problem in either of the two ways:
My personal preference is the latter, which is removing the unsaved new records. But I can be wrong since I'm also new to Ember. |
@kartik95 the reason for the two is that you can override what text appears for the cancel button on an edit screen by setting the cancelButtonText in your controller. In the case of the edit controller for the user edit screen, it is extending app/controllers/abstract-edit-controller which defines cancelButtonText as a computed property that displays either Cancel or Return depending on the state of the data model. As far as this issue is concerned, I took a look at it and it turns out it is an issue with a with edit-panel component. I'll unpack it below. |
@kartik95 So here is what is happening. I'll try to go into some detail, so forgive me if some of this information is obvious. The user edit route is defined here: If you take a look at the template for this route: You will see that the whole thing is wrapped in a component, cancel: function() {
this.sendAction('editPanelProps.cancelAction');
}, So what ends up happening is that editPanelProps.cancelAction fires - but what is that? The abstract-edit-controller defines cancelAction as |
@kartik95 Here is the TLDR of what needs to be fixed here:
cancelAction: 'cancel', b) Change https://github.com/HospitalRun/hospitalrun-frontend/blob/master/app/components/edit-panel.js#L7 to: this.sendAction('cancelAction');
Let me know if this makes sense |
You pretty much explained the whole issue. Thanks a lot 😄 |
Fixed the bug. PR #729 |
@kartik95 thanks for contributing. I added the hacktoberfest label. |
Expected behavior:
Should not show user when add user is cancel
Actual behavior:
User is being shown even if you cancel add user
Steps to reproduce:
Screenshots (if applicable):
OS and Browser:
OS X 10.11.6
Chrome Version 53.0.2785.143 (64-bit)
The text was updated successfully, but these errors were encountered: