mirror of
				https://github.com/cse110-fa22-group29/cse110-fa22-group29.git
				synced 2025-10-30 19:46:49 +00:00 
			
		
		
		
	fixed the update form, and update functionality, and formatted
Co-authored-by: Kara Hoagland <KH-Cl@users.noreply.github.com> Co-authored-by: Arthur Lu <learthurgo@gmail.com>
This commit is contained in:
		| @@ -27,14 +27,13 @@ | ||||
|  | ||||
| 		<!--- meal --> | ||||
| 		<div class = "meal-name"> | ||||
| 			<h1 id="d-mealName"> Salad (default name) </h1> | ||||
| 	  		<h1 id="d-restaurant"> Salad Inc. (default name) </h1> | ||||
| 			<h1 id="d-mealName"></h1> | ||||
| 	  		<h1 id="d-restaurant"></h1> | ||||
| 		</div>  | ||||
| 			 | ||||
| 		<div class = "meal-pics-and-tags"> | ||||
| 			<!-- image source -->  | ||||
| 			<img src = https://images.pexels.com/photos/1640777/pexels-photo-1640777.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1,  | ||||
| 			alt = "Meal Photo Corrupted" width=40% height=40% id="d-mealImg"> | ||||
| 			<img width=40% height=40% id="d-mealImg"/> | ||||
|  | ||||
| 			<div class = "tag-container", id="d-tags"> | ||||
|  | ||||
| @@ -42,8 +41,8 @@ | ||||
| 		</div> | ||||
|  | ||||
| 		<div class = "stars-and-comments"> | ||||
| 			<img src = "./assets/images/icons/5-star.svg" width=10% height=10% id="d-rating"> | ||||
| 			<p id = "d-comments"> Default comment </p> | ||||
| 			<img width=10% height=10% id="d-rating"/> | ||||
| 			<p id = "d-comments"></p> | ||||
| 		</div> | ||||
|  | ||||
| 		<main> | ||||
|   | ||||
| @@ -87,7 +87,7 @@ class ReviewCard extends HTMLElement { | ||||
| 		flex-flow: row wrap; | ||||
| 	} | ||||
| 	   | ||||
| 	.tag { | ||||
| 	.a-tag { | ||||
| 		background-color:#94da97; | ||||
| 		border-radius: 7px; | ||||
| 		color: #94da97; | ||||
| @@ -195,7 +195,7 @@ class ReviewCard extends HTMLElement { | ||||
| 		if(data["tags"]){ | ||||
| 			for (let i = 0; i < data["tags"].length; i++) { | ||||
| 				let newTag = document.createElement("label"); | ||||
| 				newTag.setAttribute("class","tag"); | ||||
| 				newTag.setAttribute("class","a-tag"); | ||||
| 				newTag.innerHTML = data["tags"][i]; | ||||
| 				tagContainer.append(newTag); | ||||
| 			} | ||||
|   | ||||
| @@ -44,7 +44,7 @@ function setupInfo(){ | ||||
| 	if(currReview["tags"]){ | ||||
| 		for (let i = 0; i < currReview["tags"].length; i++) { | ||||
| 			let newTag = document.createElement("label"); | ||||
| 			newTag.setAttribute("class","tag"); | ||||
| 			newTag.setAttribute("class","d-tag"); | ||||
| 			newTag.innerHTML = currReview["tags"][i]; | ||||
| 			tagContainer.append(newTag); | ||||
| 		} | ||||
| @@ -67,7 +67,7 @@ function setupUpdate(){ | ||||
| 	let updateBtn = document.getElementById("update-btn"); | ||||
| 	let currID = JSON.parse(sessionStorage.getItem("currID")); | ||||
| 	let currReview = getReviewFromStorage(currID); | ||||
| 	let form = document.getElementById("update-food-entry"); | ||||
| 	let form = document.getElementById("new-food-entry"); | ||||
| 	let updateDiv = document.getElementById("update-form"); | ||||
| 	updateBtn.addEventListener("click", function(){ | ||||
| 		//update function | ||||
| @@ -171,7 +171,7 @@ function setupUpdate(){ | ||||
|  | ||||
| 			updateReviewToStorage(currID, newData); | ||||
|  | ||||
| 			form.style.display = "none"; | ||||
| 			updateDiv.classList.add("hidden"); | ||||
|  | ||||
| 		}); | ||||
|  | ||||
|   | ||||
| @@ -59,7 +59,7 @@ export async function checkCorrectness(root, prefix, expected){ | ||||
| 	assert.strictEqual(await restaurant_text.jsonValue(), expected.restaurant); | ||||
|  | ||||
| 	// Check tags | ||||
| 	let tags = await root.$$(".tag"); | ||||
| 	let tags = await root.$$(`.${prefix}-tag`); | ||||
| 	assert.strictEqual(await tags.length, expected.tags.length); | ||||
| 	for(let i = 0; i < expected.tags.length; i++){ | ||||
| 		let tag_text = await tags[i].getProperty("innerText"); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user