-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature(signup): Signup a new business
Allows a new business to create their primary business location, add additional locations, and add additional employees
- Loading branch information
Showing
35 changed files
with
875 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,3 +38,5 @@ yarn-debug.log* | |
mapdata/n* | ||
mapdata/*.rb | ||
!mapdata/mapdata.json | ||
.env | ||
.env.development |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<template> | ||
<md-input> | ||
</md-input> | ||
</template> | ||
<script> | ||
import initGoogle from '../services/google' | ||
export default { | ||
name: 'GoogleMapInput', | ||
mounted() { | ||
let vm = this | ||
initGoogle.then(google => { | ||
let autocomplete = new google.maps.places.Autocomplete(vm.$refs.placesSearch) | ||
}) | ||
}, | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<template> | ||
<div id="location-finder"> | ||
<div id="search-result" ref="searchResult"> | ||
</div> | ||
<md-field> | ||
<label>Business Name and City</label> | ||
<md-input @keypress='addressSearch' v-model='address' /> | ||
</md-field> | ||
</div> | ||
</template> | ||
<script> | ||
import initGoogle from '../services/google' | ||
export default { | ||
name: 'LocationFinder', | ||
data() { | ||
return { | ||
places: null, | ||
address: '', | ||
} | ||
}, | ||
mounted() { | ||
initGoogle.then(google => { | ||
this.places = new google.maps.places.PlacesService(this.$refs.searchResult) | ||
}) | ||
}, | ||
methods: { | ||
addressSearch(e) { | ||
if (e.key !== 'Enter') { | ||
return | ||
} | ||
e.preventDefault() | ||
if (this.address.length > 3 && this.address.indexOf(' ') > 0) { | ||
// https://developers.google.com/maps/documentation/javascript/reference/places-service#FindPlaceFromQueryRequest | ||
// Uses the Basic Data SKU https://developers.google.com/maps/billing/gmp-billing#basic-data | ||
let searchRequest = { | ||
fields: [ | ||
// 'address_components', | ||
'formatted_address', | ||
'name', | ||
'place_id', | ||
// 'url', | ||
// 'utc_offset', | ||
// 'vicinity', | ||
], | ||
query: this.address, | ||
} | ||
if (this.places) { | ||
this.places.findPlaceFromQuery(searchRequest, (results) => { | ||
this.$emit('results', results) | ||
}) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<template> | ||
<div id="location-selector"> | ||
<LocationFinder v-on:results='handleResults' /> | ||
<md-list> | ||
<md-list-item | ||
v-for='(l, id) in locationResults' | ||
:key='l.place_id' | ||
@click='() => selectBusinessLocation(id, l)' | ||
:class='selectedLocationIndex === id ? "selected-location": ""' | ||
> | ||
<div class="md-list-item-text"> | ||
<span>{{l.name}}</span> | ||
<span>{{l.formatted_address}}</span> | ||
</div> | ||
</md-list-item> | ||
</md-list> | ||
</div> | ||
</template> | ||
<script> | ||
import LocationFinder from './LocationFinder.vue' | ||
export default { | ||
name: 'LocationSelector', | ||
components: {LocationFinder}, | ||
data() { | ||
return { | ||
selectedLocationIndex: -1, | ||
location: null, | ||
locationResults: [], | ||
} | ||
}, | ||
methods: { | ||
handleResults(locationResults) { | ||
this.locationResults = locationResults | ||
}, | ||
selectBusinessLocation(index, googlePlacesLocation) { | ||
if (this.selectedLocationIndex === index) { | ||
this.selectedLocationIndex = -1 | ||
this.$emit('locationSelected', null) | ||
return | ||
} | ||
this.selectedLocationIndex = index | ||
this.$emit('locationSelected', googlePlacesLocation) | ||
}, | ||
} | ||
} | ||
</script> | ||
<style scoped> | ||
.selected-location { | ||
background-color: rgba(255, 201,135, .3); | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.