-
Notifications
You must be signed in to change notification settings - Fork 18
Conversation
Also made changes in the cf api tests to move similar functionality for the fetch error tests. This was done to reduce duplication.
I separated the service instance store and the service store to make the code easier to follow. The other alternative would be to make new getAll and get methods on the existing service store for instances vs services and store both in separate places which would be more code. This way keeps all stores in a similar state.
Notes: - Changed file name of ServiceInstanceList to service_instance_list because it's a more accurate name and allows a separate service_list file here. - Used the pattern of having a wrapper component that maintains state from store and would be call to fetch data because it's a good react practice and allows more separation. - Had to split the services response because that's how it wil come in from actual API.
} | ||
|
||
_handleDelete = (instanceGuid, ev) => { | ||
ev.preventDefault(); |
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.
what does the preventDefault() do for the event?
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.
Prevent default ensures that the default action for the event doesn't happen. So if you have an a tag with a link, then the default action would be for the browser to go to the link. Prevent default will stop that from happening. In general, it's used to ensure browser consistent behavior, although often it's not strictly required.
This was added by mistake and not needed as the button is re-declared below.
case serviceActionTypes.SERVICE_INSTANCES_RECEIVED: | ||
var updates = this.formatSplitResponse(action.serviceInstances); | ||
case serviceActionTypes.SERVICES_RECEIVED: | ||
var updates = this.formatSplitResponse(action.services); |
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.
updates
-> services
Check commits for more information on decision making.