Change public ownership sources field to array

This commit is contained in:
Maciej Ziarkowski 2021-10-08 13:19:48 +01:00
parent a4d1afab81
commit 22cac99675
5 changed files with 14 additions and 14 deletions

View File

@ -288,7 +288,7 @@ export const buildingAttributesConfig = valueType<DataFieldConfig>()({ /* eslint
edit: true,
verify: true
},
community_public_ownership_source: {
community_public_ownership_sources: {
edit: true,
verify: false
}

View File

@ -12,7 +12,7 @@ import { buildingUserFields, dataFields } from '../../config/data-fields-config'
import './community.css';
import SelectDataEntry from '../data-components/select-data-entry';
import Verification from '../data-components/verification';
import DataEntry from '../data-components/data-entry';
import { MultiDataEntry } from '../data-components/multi-data-entry/multi-data-entry';
/**
* Community view/edit section
@ -127,15 +127,15 @@ const CommunityView: React.FunctionComponent<CategoryViewProps> = (props) => {
user_verified_as={props.user_verified.community_public_ownership}
verified_count={props.building.verified.community_public_ownership}
/>
<DataEntry
slug='community_public_ownership_source'
title={dataFields.community_public_ownership_source.title}
<MultiDataEntry
slug='community_public_ownership_sources'
title={dataFields.community_public_ownership_sources.title}
isUrl={true}
placeholder={'https://...'}
editableEntries={true}
value={props.building.community_public_ownership_source}
value={props.building.community_public_ownership_sources}
onChange={props.onChange}
mode={props.mode}
/>
</>

View File

@ -533,9 +533,9 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */
title: "People who think the building should be recorded as one of local significance",
example: 100,
aggregationDescriptions: {
zero: "think this building is of local significance",
one: "thinks this building is of local significance",
many: "think this building is of local significance"
zero: "think this building should be classified as a locally listed heritage asset",
one: "thinks this building should be classified as a locally listed heritage asset",
many: "think this building should be classified as a locally listed heritage asset"
}
},
@ -557,10 +557,10 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */
example: "Not in public/community ownership"
},
community_public_ownership_source: {
community_public_ownership_sources: {
category: Category.Community,
title: "Community ownership source link",
example: "https://example.com"
example: ["https://example.com"]
},
dynamics_has_demolished_buildings: {

View File

@ -33,5 +33,5 @@ DROP COLUMN IF EXISTS community_public_ownership;
DROP TYPE IF EXISTS public_ownership_type;
ALTER TABLE buildings
DROP COLUMN IF EXISTS community_public_ownership_source;
DROP COLUMN IF EXISTS community_public_ownership_sources;

View File

@ -55,4 +55,4 @@ ALTER TABLE buildings
ADD COLUMN community_public_ownership public_ownership_type;
ALTER TABLE buildings
ADD COLUMN community_public_ownership_source VARCHAR;
ADD COLUMN community_public_ownership_sources VARCHAR[];