add other_team and other_team_source_link

This commit is contained in:
Ed Chalstrey 2022-06-10 13:13:23 +01:00
parent 69f470552f
commit 0611eaa9ce
5 changed files with 60 additions and 2 deletions

View File

@ -366,6 +366,14 @@ export const buildingAttributesConfig = valueType<DataFieldConfig>()({ /* eslint
builder_source_link: {
edit: true,
verify: true
},
other_team: {
edit: true,
verify: true
},
other_team_source_link: {
edit: true,
verify: true
}
});

View File

@ -242,6 +242,42 @@ const TeamView: React.FunctionComponent<CategoryViewProps> = (props) => {
user_verified_as={props.user_verified.builder_source_link}
verified_count={props.building.verified.builder_source_link}
/>
<MultiDataEntry
title={dataFields.other_team.title}
slug="other_team"
value={props.building.other_team}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
placeholder=""
editableEntries={true}
/>
<Verification
slug="other_team"
allow_verify={props.user !== undefined && props.building.other_team !== null && !props.edited}
onVerify={props.onVerify}
user_verified={props.user_verified.hasOwnProperty("other_team")}
user_verified_as={props.user_verified.other_team}
verified_count={props.building.verified.other_team}
/>
<MultiDataEntry
title={dataFields.other_team_source_link.title}
slug="other_team_source_link"
value={props.building.other_team_source_link}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
placeholder="https://..."
editableEntries={true}
/>
<Verification
slug="other_team_source_link"
allow_verify={props.user !== undefined && props.building.other_team_source_link !== null && !props.edited}
onVerify={props.onVerify}
user_verified={props.user_verified.hasOwnProperty("other_team_source_link")}
user_verified_as={props.user_verified.other_team_source_link}
verified_count={props.building.verified.other_team_source_link}
/>
</form>
);
};

View File

@ -718,6 +718,16 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */
title: "Source builder/ construction team",
example: ["", "", ""],
},
other_team: {
category: Category.Team,
title: "Other significant members of the team",
example: ["", "", ""],
},
other_team_source_link: {
category: Category.Team,
title: "Source other significant team members",
example: ["", "", ""],
},
};
export const allFieldsConfig = {...dataFields, ...buildingUserFields};

View File

@ -8,4 +8,6 @@ ALTER TABLE buildings DROP COLUMN IF EXISTS lead_designer_type;
ALTER TABLE buildings DROP COLUMN IF EXISTS designer_awards;
ALTER TABLE buildings DROP COLUMN IF EXISTS awards_source_link;
ALTER TABLE buildings DROP COLUMN IF EXISTS builder;
ALTER TABLE buildings DROP COLUMN IF EXISTS builder_source_link;
ALTER TABLE buildings DROP COLUMN IF EXISTS builder_source_link;
ALTER TABLE buildings DROP COLUMN IF EXISTS other_team;
ALTER TABLE buildings DROP COLUMN IF EXISTS other_team_source_link;

View File

@ -8,4 +8,6 @@ ALTER TABLE buildings ADD COLUMN IF NOT EXISTS lead_designer_type varchar;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS designer_awards boolean null;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS awards_source_link text[];
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS builder text[];
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS builder_source_link text[];
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS builder_source_link text[];
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS other_team text[];
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS other_team_source_link text[];