code-challenge
code-challenge copied to clipboard
Datamade code challenge - JP Martinez Submission
Overview
In this PR I'm adding a submission for the Datamade Coding Challenge for the role of Developer. I was able to successfully (up to the reviewer) steps 1,2 and 5. For steps 3 and 4 I modified the html to include html tags for the error message and add id tags to html tags to retrieve them easier.
Notes
Due to unfamiliarity with Java, and to be honest about my current technical skills I was not able to complete this sections 3 and 4 in the suggested time.
Given a high level understanding of Java, here is a brief description of the logic I would apply:
- Retrieve the form with class
address-form, and from the form retrieve the information for the input withname=address - After submitting the form, do one of two actions depending on the validity of the input, (1( display the table with the parsed results or (2) display
anerror message - If the input is correct, retrieve from the response JSON the dictionary with the parsed components and the address_type that is returned by
AddressParse.get(). For the parsed components iterate over the dictionary where each elements is fitted into a row with a<tr>tag, and then the key and value are '' tags within the <tr>tag; these elements are included in thetableelement in thedivwith idaddress_results. For the address_type, we insert as text_content in the<p>tag with idparse_type.- If the input is incorrect, we insert as text_content in the
<p>tag with idaddress_errorthe element from the response JSON associated with the error as returned inAddressParse.get() - If the input is incorrect, we insert as text_content in the