From 8bc56fbbe2620200d2395e8ef9d94a7b8d333a74 Mon Sep 17 00:00:00 2001 From: Maciej Ziarkowski Date: Thu, 24 Oct 2019 12:20:48 +0100 Subject: [PATCH] Add edit history frontend routing --- app/src/frontend/app.tsx | 2 +- app/src/frontend/map-app.tsx | 9 ++++++++- app/src/parse.ts | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/src/frontend/app.tsx b/app/src/frontend/app.tsx index 5e681574..b1428cbc 100644 --- a/app/src/frontend/app.tsx +++ b/app/src/frontend/app.tsx @@ -105,7 +105,7 @@ class App extends React.Component { // TODO: add proper types - ( + ( { interface MapAppState { category: string; revision_id: number; - building: any; + building: Building; building_like: boolean; } @@ -234,6 +236,11 @@ class MapApp extends React.Component { /> + + + + + diff --git a/app/src/parse.ts b/app/src/parse.ts index db2a3493..a8c680c7 100644 --- a/app/src/parse.ts +++ b/app/src/parse.ts @@ -23,7 +23,7 @@ function strictParseInt(value) { * @returns {number|undefined} */ function parseBuildingURL(url) { - const re = /\/(\d+)$/; + const re = /\/(\d+)(\/history)?$/; const matches = re.exec(url); if (matches && matches.length >= 2) {