Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
29 changes: 29 additions & 0 deletions feedback.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Project 3 Feedback

## Back-end Technology

>**Progressing:** Lacking more than one model

## Front-end Technology

>**Performing:** Front-end makes appropriate use of Angular controllers and states with ui-router.

## Code Quality

>**Progressing:** Code lacks proper formatting, includes commented out, non-functional code, or otherwise contains major issues of quality (DRY, naming, etc)

## Deployment and Functionality

>**Excelling:** App has advanced functionality that works with minimal errors, and may make use of advanced tools such as APIs, plugins, etc. App may be deployed to a service other than Heroku (e.g. Digital Ocean).


## Planning / Process / Submission

>**Progressing:** App is submitted, with basic evidence of planning. Documentation exists, but lacks common areas such as setup instructions, description of application functionality and link to deployed application

Overall, you guys built an awesome app and should be very proud of the work you did!
I hope you continue to build on this, and work together to implement the rest of your desired features.

Please review inline code comments prefixed with my initials `NHO:`:
- [API](https://github.com/AWhitleyGA/RentMapAPI/compare/master...nolds9:feedback)
- [Angular](https://github.com/KhoiLe89/RentMapApp/compare/master...nolds9:feedback)
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
<script src="https://code.jquery.com/jquery-3.1.1.js" integrity="sha256-16cdPddA6VdVInumRGo6IbivbERE8p7CQR3HzTBuELA=" crossorigin="anonymous"></script>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBNYErfLDCAvSnyYNvLIVMQWo45_L6zE1E&libraries=visualization,places"></script>
<script src="js/fusiontips.js"></script>
<title></title>
<!-- NHO: missing title -->
<title>RentApp</title>
</head>
<body ui-view>
</body>
Expand Down
22 changes: 17 additions & 5 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,20 @@ function FavoriteFactoryFunction($resource) {
return $resource("https://evening-woodland-89369.herokuapp.com/places/:zip.json")
}

// NHO: reminder to remove unused / commented out code
// "https://evening-woodland-89369.herokuapp.com/places/:zip.json"

// "http://localhost:3000/places/:zip.json"


function HomeControllerFunction(){

// NHO: is this doing anything? if its just a static page you probably do not need a controller...
}

function MapControllerFunction(FavoriteFactory){
// NHO: this controller is really bloated, especially with a lot of third-party code
// is there any way to abstract this into different files?
// NHO: could also move your data fetching logic to a custom service
this.filters = []
this.activeFilters = {
restaurant: false,
Expand All @@ -47,11 +51,12 @@ function MapControllerFunction(FavoriteFactory){
bar: false,
}
this.renderFilters = () => {
markersArray.forEach((marker) => {
marker.setMap(null)
})
markersArray.forEach((marker) => {
marker.setMap(null)
})
this.filters.forEach((filter) => {
var icon = 'null'
// NHO: could use an object to map name of filters to images to reduce this code!
switch(filter) {
case 'restaurant':
icon = 'dining.png'
Expand All @@ -68,7 +73,9 @@ function MapControllerFunction(FavoriteFactory){
case 'bar':
icon = 'bars.png'
break;
// NHO: might recommend setting a default for this switch statemet
}
// NHO: feel like we could move this code to map.js or some other utility file
console.log(icon)
var request = {
location: searchLocation,
Expand Down Expand Up @@ -99,6 +106,7 @@ function MapControllerFunction(FavoriteFactory){
google.maps.event.addListener(marker, 'click', function() {
service.getDetails(place, function(result, status) {
if (status !== google.maps.places.PlacesServiceStatus.OK) {
// NHO: might want to display to user some notification, like "No Results Found" etc...
console.error(status);
return;
}
Expand All @@ -120,12 +128,14 @@ function MapControllerFunction(FavoriteFactory){
console.log(this.activeFilters)
this.renderFilters()
}
// NHO: this works but would recommend doing this the "angular" way utilizing `ng-init`
$(document).ready(() =>{
initMap()
console.log('fire')
})

this.create = function(){
// NHO: where are areaName, state, ZIPVal, and rentVal defined?
this.favorite = new FavoriteFactory({name: areaName, state: state, zip: ZIPVal, rent: rentVal})
console.log(this.favorite)
this.favorite.$save()
Expand All @@ -137,11 +147,13 @@ function FavoritesControllerFunction(FavoriteFactory, $state){
// console.log(this.favorites)

this.delete = function(favorite){
// NHO: these console.logs are fine for during the development phase
// but would remove them during production / before you show code to potential employers
console.log(this.favorites)
console.log(favorite)
// this.favorites.$remove(favorite)
favorite.$remove({zip: favorite.zip}).then(function(){
$state.reload();
$state.reload(); // NHO: nice!
})

}
Expand Down
6 changes: 6 additions & 0 deletions js/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ function initMap() {
});

google.maps.event.addListener(layer, 'click', function(fEvent) {
// NHO: one idea might be to update the browser's location so that the user could share / deep link
// to a particular ZIP / see all associated data

ZIPVal = fEvent.row['ZIP'].value;
rentVal = fEvent.row['Rent'].value;
Expand All @@ -82,6 +84,7 @@ function initMap() {

console.log(ZIPVal, rentVal, lat, long, state, county, studioRent, oneBedRent, twoBedRent, threeBedRent)

// NHO: is there any way to pass this data to view with Angular?
$('.zip-code').text(ZIPVal)
$('.area-name').text(areaName)
$('.county-state-name').text(county+', '+state)
Expand All @@ -105,6 +108,8 @@ function initMap() {

function initAutocomplete() {

// NHO: reminder to remove commented out / unused code!

// var map = new google.maps.Map(document.getElementById('map'), {
// center: {lat: 38.9072, lng: -77.0369},
// zoom: 12,
Expand Down Expand Up @@ -154,6 +159,7 @@ function initMap() {
scaledSize: new google.maps.Size(25, 25),
};

// NHO: is there anyway to reusue the addMarker function defined in the mapController?
// Create a marker for each place.
markers.push(new google.maps.Marker({
map: map,
Expand Down
5 changes: 0 additions & 5 deletions js/ng-views/favorites.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,4 @@
<div><p>Avg. Rent: ${{favorite.rent}}</p></div>
<button data-ng-click="vm.delete(favorite)">Delete</button>
</div>





</div>
2 changes: 2 additions & 0 deletions js/places.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// NHO: reminder to remove unused / commented out code

// // function performSearch(ZIPbound) {
// // var ZIPVal = ZIPbound.row['ZIP'].value;
// // var request = {
Expand Down