Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate calculation of general land use. #1480

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
@@ -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
@@ -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"
@@ -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}
3 changes: 2 additions & 1 deletion app/src/frontend/building/multi-edit.tsx
Original file line number Diff line number Diff line change
@@ -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}`}>