diff --git a/assets/images/marker-icon-2x-blue.png b/assets/images/marker-icon-2x-blue.png index 0015b64..c8a380d 100644 Binary files a/assets/images/marker-icon-2x-blue.png and b/assets/images/marker-icon-2x-blue.png differ diff --git a/assets/images/marker-icon-2x-red.png b/assets/images/marker-icon-2x-red.png index 1c26e9f..8acebd5 100644 Binary files a/assets/images/marker-icon-2x-red.png and b/assets/images/marker-icon-2x-red.png differ diff --git a/components/Business.vue b/components/Business.vue index fee2176..e0f2fd3 100644 --- a/components/Business.vue +++ b/components/Business.vue @@ -60,7 +60,7 @@ :href="business.website" @click="trackOutboundLink(business.website)" > - {{ business.website }} + Visit website

@@ -77,12 +77,14 @@

-

+

- {{ business.address }}, {{ business.city }} - {{ business.postcode }} + + {{ business.localAreaName }}, + + {{ business.city }}

@@ -124,6 +126,14 @@ export default { } }, computed: { + showAddress() { + // We have a special value of all dots to indicate this should be omitted. + return ( + this.business && this.business.address + // eslint-disable-next-line + //this.business.address.replaceAll('.', '').length + ) + }, distance() { const location = this.$store.getters['businesses/searchLocation'] diff --git a/components/BusinessModal.vue b/components/BusinessModal.vue index 46b5e10..f9108f4 100644 --- a/components/BusinessModal.vue +++ b/components/BusinessModal.vue @@ -38,7 +38,7 @@ >({{ $t('source') }})

-

+

{{ business.description }}

@@ -99,10 +99,12 @@

-

+

- {{ business.address }}, {{ business.city }} - {{ business.postcode }} + + {{ business.localAreaName }}, + + {{ business.city }} ({{ roundedPlural(distance) }}) @@ -114,17 +116,29 @@

- +
- {{ $t('qualifications') }}: + {{ $t('qualifications') }}:
- {{ $t('qualifications') }}: {{ business.qualifications }} + {{ $t('qualifications') }}: {{ business.qualifications }}
+ +

+ + + {{ $t('endorsement') }}: + {{ business.communityEndorsement }} + +

+

{{ $t('lastUpdated') }}: {{ updated }} @@ -163,6 +177,24 @@ export default { business() { return this.id ? this.$store.getters['businesses/get'](this.id) : null }, + showDescription() { + // We have a special value of all dots to indicate this should be omitted. + return ( + this.business && + this.business.description && + // eslint-disable-next-line + this.business.description.replaceAll('.', '').length + ) + }, + showAddress() { + // We have a special value of all dots to indicate this should be omitted. + return ( + this.business && + this.business.address && + // eslint-disable-next-line + this.business.address.replaceAll('.', '').length + ) + }, distance() { const location = this.$store.getters['businesses/searchLocation'] @@ -206,9 +238,7 @@ export default { }, completeAddress() { return this.business - ? [this.business.address, this.business.city, this.business.postcode] - .filter(Boolean) - .join(', ') + ? [this.business.address, this.business.city].filter(Boolean).join(', ') : null }, html() { diff --git a/components/BusinessPage.vue b/components/BusinessPage.vue index f4476b9..6e4a037 100644 --- a/components/BusinessPage.vue +++ b/components/BusinessPage.vue @@ -139,9 +139,11 @@ import { mapGetters } from 'vuex' import Map from '@/components/Map' import BusinessList from '@/components/BusinessList' import { - BOUNDS_LONDON, + BOUNDS_UK, BOUNDS_WALES, + REGION_LONDON, REGION_WALES, + SEARCH_HINT_UK, SEARCH_HINT_LONDON, SEARCH_HINT_WALES, } from '@/regions' @@ -191,7 +193,7 @@ export default { break } default: { - bounds = BOUNDS_LONDON + bounds = BOUNDS_UK break } } @@ -268,7 +270,7 @@ export default { ] break } - default: { + case REGION_LONDON: { ret = [ { value: 1, @@ -293,6 +295,35 @@ export default { ] break } + default: { + ret = [ + { + value: 1, + text: '1 ' + this.$t('mile'), + }, + { + value: 2, + text: '2 ' + this.$t('miles'), + }, + { + value: 5, + text: '5 ' + this.$t('miles'), + }, + { + value: 10, + text: '10 ' + this.$t('miles'), + }, + { + value: 20, + text: '20 ' + this.$t('miles'), + }, + { + value: 2000, + text: this.$t('allLondon'), + }, + ] + break + } } return ret @@ -305,10 +336,14 @@ export default { ret = SEARCH_HINT_WALES break } - default: { + case REGION_LONDON: { ret = SEARCH_HINT_LONDON break } + default: { + ret = SEARCH_HINT_UK + break + } } return ret @@ -414,9 +449,7 @@ export default { // Track the select. const business = this.$store.getters['businesses/get'](uid) - const value = [business.name, business.address, business.postcode].join( - ', ' - ) + const value = [business.name, business.address].join(', ') this.$ga.event('map', 'select_' + this.region, value) }, showMoreInfo() { @@ -509,6 +542,7 @@ export default { .business-list-container { background-color: #f7f5ed; + margin-top: 10px; } .business-list-container__results-header { diff --git a/components/Map.vue b/components/Map.vue index 8b4a3b2..e45645a 100644 --- a/components/Map.vue +++ b/components/Map.vue @@ -1,28 +1,31 @@ diff --git a/components/MoreInfoModal.vue b/components/MoreInfoModal.vue index ccd2516..fe21b2c 100644 --- a/components/MoreInfoModal.vue +++ b/components/MoreInfoModal.vue @@ -6,7 +6,7 @@ >No time to fix it yourself or to bring it to a Restart Party in London? - Search the Restart Repair Directory to find a reliable repair business in + Search the Restart Reuse Directory to find a reliable repair business in your area.

@@ -24,7 +24,7 @@ Learn more about the Repair DirectoryLearn more about the Reuse Directory, and let us know what you think. Noticed a bug? Get in touch.

  • diff --git a/ecosystem.config.js b/ecosystem.config.js index 8f54dd2..85a8905 100644 --- a/ecosystem.config.js +++ b/ecosystem.config.js @@ -2,14 +2,14 @@ module.exports = { apps: [ { - name: 'Repair Directory', + name: 'Reuse Directory', exec_mode: 'cluster', instances: 'max', script: './node_modules/nuxt/bin/nuxt.js', args: 'start', env: { NODE_ENV: 'production', - PORT: '3000', + PORT: '3100', }, }, ], diff --git a/lang/en.js b/lang/en.js index dc480a4..081dbb3 100644 --- a/lang/en.js +++ b/lang/en.js @@ -1,35 +1,37 @@ export default { shareResults: 'Share results', - whereAreYouLooking: 'Where are you looking?', + whereAreYouLooking: 'Where are you based?', positiveReviews: 'positive reviews', findBusinessGeneric: 'Find a business to repair your broken devices.', findBusinessWales: 'Find a Welsh business to repair your broken devices.', findBusinessLondon: 'Find a London business to repair your broken devices.', + findBusinessUK: 'Donate your tech to help reduce digital exclusion.', moreInfo: 'More info', enterAPostcodeOrArea: 'Enter a postcode or area', searchRadius: 'Search radius?', - allLondon: 'All London', + allLondon: 'All UK', allWales: 'All Wales', mile: 'mile', miles: 'miles', - whatDoYouNeedToFix: 'What do you need to fix?', + whatDoYouNeedToFix: 'What do you want to donate?', showAllProductCategories: 'Show all product categories', search: 'Search', - resultsInYourArea: 'results in your area', + resultsInYourArea: 'results for your search', viewMoreInfo: 'View more info', source: 'source', warranty: 'Warranty', lastUpdated: 'Last updated', close: 'Close', - shareBusiness: 'Share business', - qualifications: 'Qualifications', + shareBusiness: 'Share organisation', + qualifications: 'How to donate', + endorsement: 'Who receives the devices', helpUsGrow: 'Help us grow!', - submitABusiness: 'Submit a business', + submitABusiness: 'Submit an organisation', noBusinesses: - 'Unfortunately, there are currently no businesses in the Repair Directory that match your search criteria.', + 'Unfortunately, there are currently no organisations in the Reuse Directory that match your search criteria.', widerRadius: 'Try selecting a wider search radius.', stillNoResults: - 'If you still don’t obtain results, it means that we don’t know of a repair business for this item that meets our listing criteria.', + 'If you still don’t obtain results, it means that we don’t know of an organisation for this item that meets our listing criteria.', share: 'Share', email: 'Email', copy: 'Copy', diff --git a/layouts/default.vue b/layouts/default.vue index 36f64dc..01bfee7 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -67,7 +67,6 @@ } .rd-more-info-modal-header .fa-icon { - color: white !important; color: {{ styles.moreInfoModalHeaderText }} !important; } diff --git a/mixins/global.js b/mixins/global.js index ed1540d..2707fec 100644 --- a/mixins/global.js +++ b/mixins/global.js @@ -13,7 +13,7 @@ Vue.mixin({ break } default: { - ret = this.$t('findBusinessLondon') + ret = this.$t('findBusinessUK') } } diff --git a/nuxt.config.js b/nuxt.config.js index bab4e2e..a02291b 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -4,7 +4,7 @@ const proxyConfig = () => { return { '/api/': process.env.API ? process.env.API - : 'https://map.restarters.net/map/', + : 'https://reuse.restarters.net/map/', } } @@ -12,13 +12,13 @@ export default { target: 'server', head: { - title: 'Repair Directory', + title: 'Reuse Directory', meta: [ { charset: 'utf-8' }, { name: 'viewport', content: 'width=device-width, initial-scale=1' }, { hid: 'description', name: 'description', content: '' }, - { name: 'apple-mobile-web-app-title', content: 'Repair Directory' }, - { name: 'og:site_name', content: 'Repair Directory' }, + { name: 'apple-mobile-web-app-title', content: 'Reuse Directory' }, + { name: 'og:site_name', content: 'Reuse Directory' }, ], link: [ { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }, @@ -40,7 +40,6 @@ export default { plugins: [ { src: '~/mixins/global.js' }, { src: '~/plugins/axios-baseurl' }, - { src: '@/plugins/vue-google-maps', ssr: false }, { src: '@/plugins/vue2-leaflet', ssr: false }, { src: '@/plugins/vue-star-rating', ssr: false }, { src: '@/plugins/vue-social-sharing', ssr: false }, @@ -130,12 +129,10 @@ export default { env: { // This will be used on the client in axios-baseurl to send requests to the same API endpoing that the server-side // code uses. - API: process.env.API || 'https://map.restarters.net/map/', + API: process.env.API || 'https://reuse.restarters.net/map/', }, build: { - transpile: [/^vue2-google-maps($|\/)/], - extend(config, ctx) { // Run ESLint on save if (ctx.isDev && ctx.isClient) { @@ -153,11 +150,7 @@ export default { }, googleAnalytics: { - id: 'UA-46050944-3', - disabled: () => { - // temporary measure until got cookie passthrough from parent site - return window.location.href.includes('londonrepairs.org') - }, + id: 'UA-46050944-8', // Enable debug in development mode so that we can see what events are tracked. debug: { diff --git a/package-lock.json b/package-lock.json index 433dfc1..3bfaec3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2806,27 +2806,6 @@ "object.assign": "^4.1.0" } }, - "babel-runtime": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", - "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", - "requires": { - "core-js": "^2.4.0", - "regenerator-runtime": "^0.11.0" - }, - "dependencies": { - "core-js": { - "version": "2.6.12", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", - "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==" - }, - "regenerator-runtime": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", - "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" - } - } - }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", @@ -7530,11 +7509,6 @@ "object-visit": "^1.0.0" } }, - "marker-clusterer-plus": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/marker-clusterer-plus/-/marker-clusterer-plus-2.1.4.tgz", - "integrity": "sha1-+O/3TVmdqzt9Dj/tUmTqDnBPXWc=" - }, "md5.js": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", @@ -11936,15 +11910,6 @@ "resolved": "https://registry.npmjs.org/vue-template-es2015-compiler/-/vue-template-es2015-compiler-1.9.1.tgz", "integrity": "sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw==" }, - "vue2-google-maps": { - "version": "0.10.7", - "resolved": "https://registry.npmjs.org/vue2-google-maps/-/vue2-google-maps-0.10.7.tgz", - "integrity": "sha512-y5aBJTAsfGvpsbfgPaeWU7o7QbOeINZKsP6SB9qrBe8U8EYBFO/bTWo3rcMq/NOtgT/XssV3Nwg/2u3no6jWbw==", - "requires": { - "babel-runtime": "^6.26.0", - "marker-clusterer-plus": "^2.1.4" - } - }, "vue2-leaflet": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/vue2-leaflet/-/vue2-leaflet-2.6.0.tgz", diff --git a/package.json b/package.json index 1e62cdb..0e152d6 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,6 @@ "vue-scrollto": "^2.20.0", "vue-social-sharing": "^2.4.7", "vue-star-rating": "^1.7.0", - "vue2-google-maps": "^0.10.7", "vue2-leaflet": "^2.6.0" }, "devDependencies": { diff --git a/pages/businesses/_id.vue b/pages/businesses/_id.vue index 82b61d8..58d4414 100644 --- a/pages/businesses/_id.vue +++ b/pages/businesses/_id.vue @@ -34,7 +34,7 @@ export default { if (this.business) { return this.buildHead(this.business.name, this.business.description) } else { - return this.buildHead('Repair Directory', TAGLINE_GENERIC) + return this.buildHead('Reuse Directory', TAGLINE_GENERIC) } }, } diff --git a/pages/index.vue b/pages/index.vue index f427443..0fd6599 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -56,7 +56,7 @@ export default { if (business) { return this.buildHead(business.name, business.description) } else { - return this.buildHead('Repair Directory', TAGLINE_GENERIC) + return this.buildHead('Reuse Directory', TAGLINE_GENERIC) } }, } diff --git a/plugins/vue-awesome.js b/plugins/vue-awesome.js index 8a8e19f..6ad37ee 100644 --- a/plugins/vue-awesome.js +++ b/plugins/vue-awesome.js @@ -9,11 +9,13 @@ require('vue-awesome/icons/copy') require('vue-awesome/icons/envelope') require('vue-awesome/icons/globe') require('vue-awesome/icons/graduation-cap') +require('vue-awesome/icons/laptop') require('vue-awesome/icons/map-marker') require('vue-awesome/icons/phone') require('vue-awesome/icons/question-circle') require('vue-awesome/icons/share') require('vue-awesome/icons/times') +require('vue-awesome/icons/user') require('vue-awesome/icons/brands/discourse') require('vue-awesome/icons/brands/facebook') diff --git a/plugins/vue-google-maps.js b/plugins/vue-google-maps.js deleted file mode 100644 index fdc94d8..0000000 --- a/plugins/vue-google-maps.js +++ /dev/null @@ -1,11 +0,0 @@ -import Vue from 'vue' -import * as VueGoogleMaps from 'vue2-google-maps' - -Vue.use(VueGoogleMaps, { - load: { - key: 'AIzaSyBqzOdSRgPAZO6wC_oxOOkb7lkarq0PjT8', - libraries: 'places', - }, - - installComponents: true, -}) diff --git a/regions.js b/regions.js index 9d7aceb..9681e61 100644 --- a/regions.js +++ b/regions.js @@ -3,15 +3,18 @@ export const REGION_LONDON = 'London' export const REGION_WALES = 'Wales' +export const REGION_UK = 'UK' export const SEARCH_HINT_LONDON = 'London, UK' export const SEARCH_HINT_WALES = 'Wales, UK' +export const SEARCH_HINT_UK = 'UK' export const TAGLINE_GENERIC = 'Find a business to repair your broken devices.' export const TAGLINE_LONDON = 'Find a London business to repair your broken devices.' export const TAGLINE_WALES = 'Find a Welsh business to repair your broken devices.' +export const TAGLINE_UK = 'Donate your tech to help reduce digital exclusion.' // The bounds control which businesses we want to show. At the moment we only support London and Wales, which // are sufficiently far apart that we can distinguish between them using a box rather than a polygon. @@ -37,53 +40,13 @@ export const BOUNDS_WALES = { }, } -// The distances are manually chosen. -export const DISTANCES_LONDON = [ - { - value: 1, - text: '1 mile', - }, - { - value: 2, - text: '2 miles', - }, - { - value: 5, - text: '5 miles', - }, - { - value: 10, - text: '10 miles', - }, - { - value: 18, - text: 'All London', - }, -] - -export const DISTANCES_WALES = [ - { - value: 3, - text: '3 miles', - }, - { - value: 5, - text: '5 miles', - }, - { - value: 10, - text: '10 miles', - }, - { - value: 20, - text: '20 miles', - }, - { - value: 30, - text: '30 miles', +export const BOUNDS_UK = { + sw: { + lat: 49.959999905, + lng: -7.57216793459, }, - { - value: 200, - text: 'All Wales', + ne: { + lat: 58.6350001085, + lng: 1.68153079591, }, -] +} diff --git a/store/index.js b/store/index.js index fe82d78..cbc4939 100644 --- a/store/index.js +++ b/store/index.js @@ -1,5 +1,5 @@ // Strict Vuex stores can have a horrible perf cost. -import { REGION_LONDON } from '@/regions' +import { REGION_UK } from '@/regions' export const strict = false @@ -13,7 +13,7 @@ export const actions = { // This method is called by the fetch method in the page mixin, or manually if that's overriden. await store.dispatch('config/set', { key: 'region', - value: route.query.rd_region || REGION_LONDON, + value: route.query.rd_region || REGION_UK, }) await store.dispatch('config/set', {