The Funnel-Builder's Update Modal Window. This needs to have the form correctly mapped to the AJAX Output for the edit-job AJAX call. Also, start creating the action for the "save" button that saves the Modal window contents - simply make it execute a function the pre-written .click() JS Methods, and connect using the pre-written AJAX Calls, to the pre-created local JSON Endpoints to create, update and delete jobs - (you can lookup the exact endpoint in routes.rb and look for the funnel_builder API's various methods - they all start with api_ prefix).
Verify and finish setting up the the Modal Window for new Jobs, and edit jobs - by implementing the pre-created partial (specified below) - and remove the duplicate form code. I even wrote the line of code to load the partial with the form, but it is commented out. So the same form needs to be used for edit and new job modals, and this partial needs to be loaded into the modal (already created it but not used yet. Here is the partial file: /app/views/funnel_builder/_node_modal_form.html.erb - so make the Edit Job Modal and the new Job Modal load this partial as the modal's contents.
Make the Edit Job Button load the currently selected Job's AJAX Response into the form fields, so it populates the Form fields based on the loaded AJAX Data for that Job. It used to work but stopped working for some reason the past few days.
Connect the Submit button for the Edit-Job Modal and New-Job Modal so it submits the content of the form to the Funnel_Builder Controllerapi_create and api_update methods. The Modal's form should get sent, using AJAX, depending on which modal is open, to either the api_create JSON Endpoint or the api_update endpoint, so it either createa s a new job or edits a new job, using the form data, that you populated in the previous step (for the job_edit, the job_new obviously does not populate the modal's form with anything because its creating a new job, so there's obviously no data to load)
Create a Yes/No Dialog for Deleting Jobs. Just edit the delete-job modal window to have a simple "Are you sure you want to delete this Job" with Delete and Cancel Buttons. Make the delete button onclick() execute a javascript function that executes a JSON call to the fb_delete endpoint. Have it pass the job_id through the AJAX Call. You can see how to get the currently selected job's ID From the UI
Clean up the Funnel-Builder UI so it looks nice. Make the Edit and Delete buttons only load when you have selected a job. Otherwise they should not be displayed.
Work-on the following UI Components:
funnel_builder
API's various methods - they all start withapi_
prefix)./app/views/funnel_builder/_node_modal_form.html.erb
- so make the Edit Job Modal and the new Job Modal load this partial as the modal's contents.Funnel_Builder Controller
api_create
andapi_update
methods. The Modal's form should get sent, using AJAX, depending on which modal is open, to either theapi_create
JSON Endpoint or theapi_update
endpoint, so it either createa s a new job or edits a new job, using the form data, that you populated in the previous step (for the job_edit, the job_new obviously does not populate the modal's form with anything because its creating a new job, so there's obviously no data to load)