mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-23 16:49:40 +02:00
Better isolation of services, to avoid hitting network during test runs
1. All services are disabled in testing now to prevent network accesses 2. Only services are enabled when needed to test something 3. Many changes throughout code to allow iD to run with services disabled (e.g. check for osm service instead of assuming context.connection() will work) 4. Actually export the services so we can disable and enable them
This commit is contained in:
@@ -26,6 +26,9 @@ export function uiCommit(context) {
|
||||
|
||||
|
||||
function commit(selection) {
|
||||
var osm = context.connection();
|
||||
if (!osm) return;
|
||||
|
||||
if (!changeset) {
|
||||
var detected = utilDetect(),
|
||||
tags = {
|
||||
@@ -87,7 +90,7 @@ export function uiCommit(context) {
|
||||
|
||||
commentField.node().select();
|
||||
|
||||
context.connection().userChangesets(function (err, changesets) {
|
||||
osm.userChangesets(function (err, changesets) {
|
||||
if (err) return;
|
||||
|
||||
var comments = changesets.map(function(changeset) {
|
||||
@@ -174,7 +177,7 @@ export function uiCommit(context) {
|
||||
.html(t('commit.upload_explanation'));
|
||||
|
||||
|
||||
context.connection().userDetails(function(err, user) {
|
||||
osm.userDetails(function(err, user) {
|
||||
if (err) return;
|
||||
|
||||
var userLink = d3.select(document.createElement('div'));
|
||||
@@ -190,7 +193,7 @@ export function uiCommit(context) {
|
||||
.append('a')
|
||||
.attr('class','user-info')
|
||||
.text(user.display_name)
|
||||
.attr('href', context.connection().userURL(user.display_name))
|
||||
.attr('href', osm.userURL(user.display_name))
|
||||
.attr('tabindex', -1)
|
||||
.attr('target', '_blank');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user