diff --git a/src/ui/control/attribution_control.js b/src/ui/control/attribution_control.js index aaf59ab99b0..6491a8bb76c 100644 --- a/src/ui/control/attribution_control.js +++ b/src/ui/control/attribution_control.js @@ -103,7 +103,7 @@ class AttributionControl { } return acc; }, `?`); - editLink.href = `https://www.mapbox.com/feedback/${paramString}${this._map._hash ? this._map._hash.getHashString(true) : ''}`; + editLink.href = `${config.FEEDBACK_URL}/${paramString}${this._map._hash ? this._map._hash.getHashString(true) : ''}`; } } diff --git a/src/util/config.js b/src/util/config.js index f2ef586a804..0d8ad3017f8 100644 --- a/src/util/config.js +++ b/src/util/config.js @@ -3,6 +3,7 @@ type Config = {| API_URL: string, EVENTS_URL: string, + FEEDBACK_URL: string, REQUIRE_ACCESS_TOKEN: boolean, ACCESS_TOKEN: ?string, MAX_PARALLEL_IMAGE_REQUESTS: number @@ -17,6 +18,7 @@ const config: Config = { return 'https://events.mapbox.com/events/v2'; } }, + FEEDBACK_URL: 'https://apps.mapbox.com/feedback', REQUIRE_ACCESS_TOKEN: true, ACCESS_TOKEN: null, MAX_PARALLEL_IMAGE_REQUESTS: 16 diff --git a/test/unit/ui/control/attribution.test.js b/test/unit/ui/control/attribution.test.js index b5c71bfbeb9..5316a11b650 100644 --- a/test/unit/ui/control/attribution.test.js +++ b/test/unit/ui/control/attribution.test.js @@ -109,17 +109,18 @@ test('AttributionControl dedupes attributions that are substrings of others', (t }); test('AttributionControl has the correct edit map link', (t) => { + config.FEEDBACK_URL = "https://feedback.com"; const map = createMap(t); const attribution = new AttributionControl(); map.addControl(attribution); map.on('load', () => { - map.addSource('1', { type: 'geojson', data: { type: 'FeatureCollection', features: [] }, attribution: 'Improve this map'}); + map.addSource('1', { type: 'geojson', data: { type: 'FeatureCollection', features: [] }, attribution: 'Improve this map'}); map.addLayer({ id: '1', type: 'fill', source: '1' }); map.on('data', (e) => { if (e.dataType === 'source' && e.sourceDataType === 'metadata') { - t.equal(attribution._editLink.href, 'https://www.mapbox.com/feedback/?owner=mapbox&id=streets-v10&access_token=pk.123#/0/0/0', 'edit link contains map location data'); + t.equal(attribution._editLink.href, 'https://feedback.com/?owner=mapbox&id=streets-v10&access_token=pk.123#/0/0/0', 'edit link contains map location data'); map.setZoom(2); - t.equal(attribution._editLink.href, 'https://www.mapbox.com/feedback/?owner=mapbox&id=streets-v10&access_token=pk.123#/0/0/2', 'edit link updates on mapmove'); + t.equal(attribution._editLink.href, 'https://feedback.com/?owner=mapbox&id=streets-v10&access_token=pk.123#/0/0/2', 'edit link updates on mapmove'); t.end(); } });