Skip to content
This repository has been archived by the owner on Sep 8, 2020. It is now read-only.

Fixing issues #3, #9, #11 #17

Closed
wants to merge 17 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
21856d0
#9 - Added route to deal with non-matching path and a new component f…
sfrankian May 27, 2018
26008e5
#11 Fixed people request to work properly and added a redirect if a '…
sfrankian May 27, 2018
0161211
Merge remote-tracking branch 'upstream/master'
sfrankian May 27, 2018
0e8f56c
Added vue-notification to package.json which makes the error notifica…
sfrankian May 27, 2018
db1d933
Changed title of profile page from 'Person n' to name retrived from A…
sfrankian May 27, 2018
86154cb
#3 added person profile page. Still need to add links to related reso…
sfrankian May 28, 2018
c732690
Fixed error in function that fetches person details from the API
sfrankian May 28, 2018
9c96db7
#3 changed rendering of person component to only show vehicles if per…
sfrankian May 28, 2018
a9de522
Simplifying API get request
sfrankian May 28, 2018
0c2314a
#3 Finished (just need to write tests). Because planet/starship compo…
sfrankian May 28, 2018
b980b0c
#3 - forgot to make homeworld a link.
sfrankian May 28, 2018
cf8ee4f
Made person template conditionally render based on whether we have re…
sfrankian May 28, 2018
9d55696
Removed console.logs and added a few comments
sfrankian May 28, 2018
99133ed
Added another cypress test and created a file to run unit tests on th…
sfrankian May 28, 2018
5abaca4
Fixed test description name to be Person, not home
sfrankian May 30, 2018
0402e4a
Fixed person tests to check for correct rendering
sfrankian May 30, 2018
1086e79
Adding package.json and package-lock.json so that CI can pass
sfrankian May 30, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
#3 changed rendering of person component to only show vehicles if per…
…son has them
sfrankian committed May 28, 2018
commit 9c96db7d22b40d7c16b151f23f97204458567422
41 changes: 22 additions & 19 deletions src/components/Person.vue
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
<template>
<div class="container">
<h1>{{results.name}}</h1>

<ul class="list-group">
<li class="list-group-item">Birth year: {{ results.birth_year }}</li>
<li class="list-group-item">Height: {{ results.height }}</li>
<li class="list-group-item">Mass: {{ results.mass }}</li>
<li class="list-group-item">Eye color: {{ results.eye_color }}</li>
<li class="list-group-item">Skin color: {{ results.skin_color }}</li>
</ul>
<ul class="list-group">
<li v-for="vehicle in results.vehicles" class="list-group-item">
{{vehicle}}
</li>
</ul>
<div class="row pt-3 pl-3">
<router-link
:to="`/`">
<button>Return home</button>
</router-link>
<div class="card p-3">
<h1>{{results.name}}</h1>
<h4>Biography</h4>
<ul class="list-group pb-3" id="bio">
<li class="list-group-item">Birth year: {{ results.birth_year }}</li>
<li class="list-group-item">Height: {{ results.height }}</li>
<li class="list-group-item">Mass: {{ results.mass }}</li>
<li class="list-group-item">Eye color: {{ results.eye_color }}</li>
<li class="list-group-item">Skin color: {{ results.skin_color }}</li>
</ul>
<ul class="list-group">
<h4 v-if="results.vehicles.length !== 0">Vehicles</h4> <!-- Only show vehicles if person has vehicles -->
<li v-for="vehicle in results.vehicles" class="list-group-item">
<a :href="vehicle">{{ vehicle }}</a>
</li>
</ul>
<div class="row pt-3 pl-3">
<router-link
:to="`/`">
<button>Return home</button>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tip: you can make router-link into a button with the as property.

</router-link>
</div>
</div>
</div>
</template>