Skip to content

Commit

Permalink
Automate calculation of general land use.
Browse files Browse the repository at this point in the history
  • Loading branch information
matkoniecz committed Dec 12, 2024
1 parent 8929a8d commit 4c25de8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
21 changes: 20 additions & 1 deletion app/src/frontend/building/data-containers/land-use.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { CategoryViewProps } from './category-view-props';
import Verification from '../data-components/verification';
import { useDisplayPreferences } from '../../displayPreferences-context';
import { DataEntryGroup } from '../data-components/data-entry-group';
import InfoBox from '../../components/info-box';

/**
* Use view/edit section
Expand Down Expand Up @@ -102,13 +103,32 @@ const LandUseView: React.FunctionComponent<CategoryViewProps> = (props) => {
/>
</DataEntryGroup>
<DataEntryGroup name="General Land Use" collapsed={subcat==null || subcat!="2"}>
{/*deprecate this field somehow */}
<Fragment>
<div className="data-title">
<div className="data-title-text">
<div className="data-title-text">
<label>
<span>Is the building residential, non-residential or mixed? (automatically generated from Specific Land Use/s)</span>
</label>
</div>
</div>
</div>
</Fragment>
<InfoBox type='success'>
<Fragment>
{["Mixed Use", "Residential"].includes(props.building.current_landuse_order) ? props.building.current_landuse_order : "Non-residential"}
</Fragment>
</InfoBox>
{(props.mapColourScale != "is_domestic") ?
<button className={`map-switcher-inline disabled-state btn btn-outline btn-outline-dark key-button`} onClick={switchToIsDomesticMapStyle}>
{"Click to see residential, non-residential and mixed-use buildings."}
</button>
:
<></>
}
{/* switched to automatically filled based on specific landuse data*/
/*
<SelectDataEntry
title={dataFields.is_domestic.title}
slug="is_domestic"
Expand All @@ -119,7 +139,6 @@ const LandUseView: React.FunctionComponent<CategoryViewProps> = (props) => {
onChange={props.onChange}
tooltip={dataFields.is_domestic.tooltip}
/>
{/*
<Verification
slug="is_domestic"
allow_verify={props.user !== undefined && props.building.is_domestic !== null && !props.edited}
Expand Down
3 changes: 2 additions & 1 deletion app/src/frontend/building/multi-edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ import InfoBox from '../components/info-box';
import { allFieldsConfig } from '../config/data-fields-config';

import DataEntry from './data-components/data-entry';
import { Console } from 'console';

interface MultiEditProps {
category: string;
}

const MultiEdit: React.FC<MultiEditProps> = (props) => {
const [data, error] = useMultiEditData();

console.log(data);
return (
<section className='data-section'>
<header className={`section-header view ${props.category} background-${props.category}`}>
Expand Down

0 comments on commit 4c25de8

Please sign in to comment.