Allow community to mark expected applications
This commit is contained in:
parent
b64a83a010
commit
3cb5ee5dca
@ -520,6 +520,47 @@
|
|||||||
<LineSymbolizer stroke="#888" stroke-width="3.0"/>
|
<LineSymbolizer stroke="#888" stroke-width="3.0"/>
|
||||||
</Rule>
|
</Rule>
|
||||||
</Style>
|
</Style>
|
||||||
|
<Style name="community_expected_planning_application_total">
|
||||||
|
<Rule>
|
||||||
|
<Filter>[community_expected_planning_application_total] >= 100</Filter>
|
||||||
|
<PolygonSymbolizer fill="#bd0026" />
|
||||||
|
</Rule>
|
||||||
|
<Rule>
|
||||||
|
<Filter>[community_expected_planning_application_total] >= 50 and [community_expected_planning_application_total] < 100</Filter>
|
||||||
|
<PolygonSymbolizer fill="#e31a1c" />
|
||||||
|
</Rule>
|
||||||
|
<Rule>
|
||||||
|
<Filter>[community_expected_planning_application_total] >= 20 and [community_expected_planning_application_total] < 50</Filter>
|
||||||
|
<PolygonSymbolizer fill="#fc4e2a" />
|
||||||
|
</Rule>
|
||||||
|
<Rule>
|
||||||
|
<Filter>[community_expected_planning_application_total] >= 10 and [community_expected_planning_application_total] < 20</Filter>
|
||||||
|
<PolygonSymbolizer fill="#fd8d3c" />
|
||||||
|
</Rule>
|
||||||
|
<Rule>
|
||||||
|
<Filter>[community_expected_planning_application_total] >= 3 and [community_expected_planning_application_total] < 10</Filter>
|
||||||
|
<PolygonSymbolizer fill="#feb24c" />
|
||||||
|
</Rule>
|
||||||
|
<Rule>
|
||||||
|
<Filter>[community_expected_planning_application_total] = 2</Filter>
|
||||||
|
<PolygonSymbolizer fill="#fed976" />
|
||||||
|
</Rule>
|
||||||
|
<Rule>
|
||||||
|
<Filter>[community_expected_planning_application_total] = 1</Filter>
|
||||||
|
<PolygonSymbolizer fill="#ffe8a9" />
|
||||||
|
</Rule>
|
||||||
|
|
||||||
|
<Rule>
|
||||||
|
<MaxScaleDenominator>17061</MaxScaleDenominator>
|
||||||
|
<MinScaleDenominator>4264</MinScaleDenominator>
|
||||||
|
<LineSymbolizer stroke="#888" stroke-width="1.0"/>
|
||||||
|
</Rule>
|
||||||
|
<Rule>
|
||||||
|
<MaxScaleDenominator>4264</MaxScaleDenominator>
|
||||||
|
<MinScaleDenominator>0</MinScaleDenominator>
|
||||||
|
<LineSymbolizer stroke="#888" stroke-width="3.0"/>
|
||||||
|
</Rule>
|
||||||
|
</Style>
|
||||||
<Style name="community_in_public_ownership">
|
<Style name="community_in_public_ownership">
|
||||||
<Rule>
|
<Rule>
|
||||||
<Filter>[in_public_ownership] = true</Filter>
|
<Filter>[in_public_ownership] = true</Filter>
|
||||||
|
4
app/package-lock.json
generated
4
app/package-lock.json
generated
@ -22865,9 +22865,7 @@
|
|||||||
"version": "1.6.1",
|
"version": "1.6.1",
|
||||||
"resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-1.6.1.tgz",
|
"resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-1.6.1.tgz",
|
||||||
"integrity": "sha512-4CjkH20If1lhR5CGtqkrVg3bbOtFEG80X9v6jDOIUhbzzbB+UzPBGy8GQhUNVZ0yvMHdMpawCOcy5ydGMsagGQ==",
|
"integrity": "sha512-4CjkH20If1lhR5CGtqkrVg3bbOtFEG80X9v6jDOIUhbzzbB+UzPBGy8GQhUNVZ0yvMHdMpawCOcy5ydGMsagGQ==",
|
||||||
"requires": {
|
"requires": {}
|
||||||
"ajv": "^7.0.0"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"alphanum-sort": {
|
"alphanum-sort": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
|
@ -24,5 +24,11 @@ export const aggregationsConfig: { [key in keyof typeof buildingUserAttributesCo
|
|||||||
aggregateFieldName: 'community_local_significance_total',
|
aggregateFieldName: 'community_local_significance_total',
|
||||||
aggregationMethod: 'countTrue'
|
aggregationMethod: 'countTrue'
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
community_expected_planning_application: [
|
||||||
|
{
|
||||||
|
aggregateFieldName: 'community_expected_planning_application_total',
|
||||||
|
aggregationMethod: 'countTrue'
|
||||||
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
@ -303,6 +303,11 @@ export const buildingAttributesConfig = valueType<DataFieldConfig>()({ /* eslint
|
|||||||
derivedEdit: true,
|
derivedEdit: true,
|
||||||
verify: false
|
verify: false
|
||||||
},
|
},
|
||||||
|
community_expected_planning_application_total: {
|
||||||
|
edit: false,
|
||||||
|
derivedEdit: true,
|
||||||
|
verify: false
|
||||||
|
},
|
||||||
community_activities_current: {
|
community_activities_current: {
|
||||||
edit: true,
|
edit: true,
|
||||||
verify: false
|
verify: false
|
||||||
@ -403,6 +408,11 @@ export const buildingUserAttributesConfig = valueType<DataFieldConfig>()({
|
|||||||
perUser: true,
|
perUser: true,
|
||||||
edit: true,
|
edit: true,
|
||||||
verify: false
|
verify: false
|
||||||
|
},
|
||||||
|
community_expected_planning_application: {
|
||||||
|
perUser: true,
|
||||||
|
edit: true,
|
||||||
|
verify: false
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -90,7 +90,8 @@ const withCopyEdit: (wc: React.ComponentType<CategoryViewProps>) => DataContaine
|
|||||||
'planning_list_cat',
|
'planning_list_cat',
|
||||||
'planning_list_grade',
|
'planning_list_grade',
|
||||||
'likes_total',
|
'likes_total',
|
||||||
'community_local_significance_total'
|
'community_local_significance_total',
|
||||||
|
'community_expected_planning_application_total'
|
||||||
]
|
]
|
||||||
for (let key in dataFields) {
|
for (let key in dataFields) {
|
||||||
let fieldName = props.building == undefined ? undefined : props.building[key];
|
let fieldName = props.building == undefined ? undefined : props.building[key];
|
||||||
|
@ -81,6 +81,17 @@ const CommunityView: React.FunctionComponent<CategoryViewProps> = (props) => {
|
|||||||
mode={props.mode}
|
mode={props.mode}
|
||||||
copy={props.copy}
|
copy={props.copy}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<UserOpinionEntry
|
||||||
|
slug='community_expected_planning_application'
|
||||||
|
title={buildingUserFields.community_expected_planning_application.title}
|
||||||
|
|
||||||
|
userValue={props.building.community_expected_planning_application}
|
||||||
|
|
||||||
|
onChange={props.onSaveChange}
|
||||||
|
mode={props.mode}
|
||||||
|
copy={props.copy}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<InfoBox>Can you help add information on community use of buildings?</InfoBox>
|
<InfoBox>Can you help add information on community use of buildings?</InfoBox>
|
||||||
|
@ -139,6 +139,22 @@ export const categoryMapsConfig: {[key in Category]: CategoryMapDefinition[]} =
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
mapStyle: 'community_expected_planning_application_total',
|
||||||
|
legend: {
|
||||||
|
title: 'Expected planning application',
|
||||||
|
description: 'People who think the building will be affected by a planning application in the near future',
|
||||||
|
elements: [
|
||||||
|
{ color: '#bd0026', text: '100+' },
|
||||||
|
{ color: '#e31a1c', text: '50–99' },
|
||||||
|
{ color: '#fc4e2a', text: '20–49' },
|
||||||
|
{ color: '#fd8d3c', text: '10–19' },
|
||||||
|
{ color: '#feb24c', text: '3–9' },
|
||||||
|
{ color: '#fed976', text: '2' },
|
||||||
|
{ color: '#ffe8a9', text: '1'}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
mapStyle: 'community_in_public_ownership',
|
mapStyle: 'community_in_public_ownership',
|
||||||
legend: {
|
legend: {
|
||||||
|
@ -105,6 +105,12 @@ export const buildingUserFields = {
|
|||||||
category: Category.Community,
|
category: Category.Community,
|
||||||
title: "Do you think this building should be recorded as a local heritage asset?",
|
title: "Do you think this building should be recorded as a local heritage asset?",
|
||||||
example: true
|
example: true
|
||||||
|
},
|
||||||
|
community_expected_planning_application: {
|
||||||
|
perUser: true,
|
||||||
|
category: Category.Community,
|
||||||
|
title: "Do you expect this site to be affected by a planning application in the near future?",
|
||||||
|
example: true
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -562,6 +568,12 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */
|
|||||||
example: 100,
|
example: 100,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
community_expected_planning_application_total: {
|
||||||
|
category: Category.Community,
|
||||||
|
title: "People who think the building will be affected by a planning application in the near future",
|
||||||
|
example: 100,
|
||||||
|
},
|
||||||
|
|
||||||
community_activities_current: {
|
community_activities_current: {
|
||||||
category: Category.Community,
|
category: Category.Community,
|
||||||
title: "Are activities open to the community currently taking place in the building?",
|
title: "Are activities open to the community currently taking place in the building?",
|
||||||
|
@ -9,6 +9,7 @@ export type BuildingMapTileset = 'date_year' |
|
|||||||
'location' |
|
'location' |
|
||||||
'likes' |
|
'likes' |
|
||||||
'community_local_significance_total' |
|
'community_local_significance_total' |
|
||||||
|
'community_expected_planning_application_total' |
|
||||||
'community_in_public_ownership' |
|
'community_in_public_ownership' |
|
||||||
'planning_combined' |
|
'planning_combined' |
|
||||||
'sust_dec' |
|
'sust_dec' |
|
||||||
|
@ -115,6 +115,15 @@ const LAYER_QUERIES = {
|
|||||||
WHERE
|
WHERE
|
||||||
community_local_significance_total > 0
|
community_local_significance_total > 0
|
||||||
`,
|
`,
|
||||||
|
community_expected_planning_application_total: `
|
||||||
|
SELECT
|
||||||
|
geometry_id,
|
||||||
|
community_expected_planning_application_total
|
||||||
|
FROM
|
||||||
|
buildings
|
||||||
|
WHERE
|
||||||
|
community_expected_planning_application_total > 0
|
||||||
|
`,
|
||||||
community_in_public_ownership: `
|
community_in_public_ownership: `
|
||||||
SELECT
|
SELECT
|
||||||
geometry_id,
|
geometry_id,
|
||||||
|
5
migrations/030.planning_expected.down.sql
Normal file
5
migrations/030.planning_expected.down.sql
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
ALTER TABLE building_user_attributes
|
||||||
|
DROP COLUMN IF EXISTS community_expected_planning_application;
|
||||||
|
|
||||||
|
ALTER TABLE buildings
|
||||||
|
DROP COLUMN IF EXISTS community_expected_planning_application_total;
|
5
migrations/030.planning_expected.up.sql
Normal file
5
migrations/030.planning_expected.up.sql
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
ALTER TABLE building_user_attributes
|
||||||
|
ADD COLUMN community_expected_planning_application BOOLEAN NULL;
|
||||||
|
|
||||||
|
ALTER TABLE buildings
|
||||||
|
ADD COLUMN community_expected_planning_application_total INT DEFAULT 0;
|
Loading…
Reference in New Issue
Block a user