Skip to content

Commit 0d869b5

Browse files
authored
Merge pull request #360 from mapbox/develop
0.58.0 release
2 parents 71167ea + 375316e commit 0d869b5

File tree

7 files changed

+382
-348
lines changed

7 files changed

+382
-348
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "osmcha-frontend",
3-
"version": "0.56.3",
3+
"version": "0.58.0",
44
"license": "ISC",
55
"engines": {
66
"node": ">=7.0"
@@ -17,7 +17,7 @@
1717
"@turf/bbox": "^5.1.5",
1818
"@turf/simplify": "^5.1.5",
1919
"animate.css": "^3.5.2",
20-
"changeset-map": "^1.3.4",
20+
"changeset-map": "^1.3.6",
2121
"date-input-polyfill": "^2.14.0",
2222
"history": "^4.6.3",
2323
"immutable": "^3.8.1",

src/components/filters/multi_select.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export class MultiSelect extends React.PureComponent {
130130
export class MappingTeamMultiSelect extends MultiSelect {
131131
getAsyncOptions = () => {
132132
if (!this.props.dataURL) return;
133-
return fetch(`${API_URL}/${this.props.dataURL}/?trusted=true`, {
133+
return fetch(`${API_URL}/${this.props.dataURL}/`, {
134134
method: 'GET',
135135
headers: {
136136
'Content-Type': 'application/json',
@@ -141,7 +141,17 @@ export class MappingTeamMultiSelect extends MultiSelect {
141141
return response.json();
142142
})
143143
.then(json => {
144-
const data = json.map(d => ({ ...d, label: d.name, value: d.name }));
144+
const data = json.map(d => {
145+
if (d.trusted) {
146+
return { ...d, label: `${d.name} (verified)`, value: d.name };
147+
} else {
148+
return {
149+
...d,
150+
label: d.name.replace('(verified)', ''),
151+
value: d.name
152+
};
153+
}
154+
});
145155
return { options: data };
146156
});
147157
};

src/config/constants.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { API_URL } from './';
33

44
export const PAGE_SIZE = 75;
5-
export const overpassBase = '//overpass-api.de/api/interpreter';
5+
export const overpassBase = '//overpass.maptime.in/api/interpreter';
66
export const osmBase = '//www.openstreetmap.org/api/0.6/';
77
export const mapboxAccessToken =
88
'pk.eyJ1Ijoib3BlbnN0cmVldG1hcCIsImEiOiJjam10OXpmc2YwMXI5M3BqeTRiMDBqMHVyIn0.LIcIDe3TZLSDdTWDoojzNg';
@@ -20,3 +20,8 @@ export const whosThat =
2020
export const nominatimUrl = 'https://nominatim.openstreetmap.org/search.php';
2121

2222
export const DEFAULT_FROM_DATE = 7;
23+
24+
// exclude changesets newer than x minutes. It's needed because of the difference
25+
// between the time a changeset is processed by OSMCha and the time its map
26+
// visualization is available
27+
export const DELAY_TO_EXCLUDE = 5;

src/config/filters.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@
250250
"icontains": false,
251251
"range": false,
252252
"all": false,
253-
"display": "Hide trusted mapping teams",
253+
"display": "Hide verified mapping teams",
254254
"type": "radio",
255255
"options": [
256256
{
@@ -262,8 +262,8 @@
262262
"value": "False"
263263
}
264264
],
265-
"description": "If Yes, it will exclude the changesets created by users that are part of trusted mapping teams",
266-
"placeholder": "Exclude changesets created by users from trusted teams"
265+
"description": "If Yes, it will exclude the changesets created by users that are part of verified mapping teams",
266+
"placeholder": "Exclude changesets created by users from verified teams"
267267
},
268268
{
269269
"name": "create",

src/store/auth_actions.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,11 @@ export function* watchAuth(): any {
110110
if (status.get('status') !== 'success') {
111111
yield put(
112112
modal({
113-
title: 'Status alert',
113+
title: 'OSMCha Status',
114114
description: status.get('message'),
115115
kind: status.get('status'),
116-
autoDismiss: 20
116+
autoDismiss: 20,
117+
position: 'br'
117118
})
118119
);
119120
}

src/store/changesets_page_actions.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
import { put, call, takeLatest, select, all } from 'redux-saga/effects';
33
import { delay } from 'redux-saga';
44

5+
import moment from 'moment';
56
import { fromJS, List, Map } from 'immutable';
67
import { fetchChangesetsPage } from '../network/changesets_page';
78
import { filtersSelector } from './filters_actions';
89

910
import { modal } from './modal_actions';
1011

12+
import { DELAY_TO_EXCLUDE } from '../config/constants';
1113
import type { RootStateType } from './';
1214
import type { filtersType } from '../components/filters';
1315

@@ -107,6 +109,11 @@ export function* fetchChangesetsPageSaga({
107109
nocache
108110
);
109111
}
112+
const newFeatures = thisPage.features.filter(
113+
i => moment().diff(i.properties.date, 'minutes') > DELAY_TO_EXCLUDE
114+
);
115+
thisPage.count -= thisPage.features.length - newFeatures.length;
116+
thisPage.features = newFeatures;
110117
yield put(
111118
action(CHANGESETS_PAGE.fetched, {
112119
data: fromJS(thisPage),

0 commit comments

Comments
 (0)