From 529ce96e420fa1dae1d8494ee3de8af63149c509 Mon Sep 17 00:00:00 2001 From: Maciej Ziarkowski Date: Tue, 3 Dec 2019 18:17:04 +0000 Subject: [PATCH] Add current land use frontend (read-only) --- app/src/frontend/building/building-view.tsx | 2 +- .../frontend/building/data-containers/use.tsx | 55 +++++++++++-------- .../edit-history/field-edit-summary.tsx | 3 + app/src/frontend/data_fields.ts | 13 +++++ 4 files changed, 50 insertions(+), 23 deletions(-) diff --git a/app/src/frontend/building/building-view.tsx b/app/src/frontend/building/building-view.tsx index d21f7115..797e8b69 100644 --- a/app/src/frontend/building/building-view.tsx +++ b/app/src/frontend/building/building-view.tsx @@ -43,7 +43,7 @@ const BuildingView: React.FunctionComponent = (props) => { case 'use': return = (props) => ( -

{props.intro}

-
    -
  • Single or multiple use?
  • - { - // "disabled": true, - // "slug": "use_multi", - // "type": "checkbox" - } -
  • Type of use/s
  • - { - // "disabled": true, - // "slug": "use_type", - // "type": "text_multi" - } -
  • Number of self-contained units
  • - { - // "disabled": true, - // "slug": "use_number_scu", - // "type": "number", - // "step": 1 - } -
+ + + +
); const UseContainer = withCopyEdit(UseView); diff --git a/app/src/frontend/building/edit-history/field-edit-summary.tsx b/app/src/frontend/building/edit-history/field-edit-summary.tsx index 2612d6cb..d7808022 100644 --- a/app/src/frontend/building/edit-history/field-edit-summary.tsx +++ b/app/src/frontend/building/edit-history/field-edit-summary.tsx @@ -10,6 +10,9 @@ function formatValue(value: any) { if(typeof value === 'boolean') { return value ? 'Yes' : 'No'; } + if(Array.isArray(value)) { + return value.map(v => `"${v}"`).join(', '); + } return value; } diff --git a/app/src/frontend/data_fields.ts b/app/src/frontend/data_fields.ts index 716292f0..7e46cdad 100644 --- a/app/src/frontend/data_fields.ts +++ b/app/src/frontend/data_fields.ts @@ -153,6 +153,19 @@ export const dataFields = { title: "Longitude", }, + current_landuse_class: { + category: Category.LandUse, + title: "Current Land Use Class" + }, + current_landuse_group: { + category: Category.LandUse, + title: "Current Land Use Group" + }, + current_landuse_order: { + category: Category.LandUse, + title: "Current Land Use Order" + }, + building_attachment_form: { category: Category.Type, title: "Building configuration (attachment)?",