add builder and builder_source_link

This commit is contained in:
Ed Chalstrey 2022-06-10 11:37:52 +01:00
parent 2f2c0b949f
commit e5c0e4e0c0
5 changed files with 62 additions and 2 deletions

View File

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

View File

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

View File

@ -708,6 +708,16 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */
tooltip: "URL for source for designer award(s)", tooltip: "URL for source for designer award(s)",
example: ["", "", ""], example: ["", "", ""],
}, },
builder: {
category: Category.Team,
title: "Name of builder/ construction team",
example: ["", "", ""],
},
builder_source_link: {
category: Category.Team,
title: "Source builder/ construction team",
example: ["", "", ""],
},
}; };
export const allFieldsConfig = {...dataFields, ...buildingUserFields}; export const allFieldsConfig = {...dataFields, ...buildingUserFields};

View File

@ -6,4 +6,6 @@ ALTER TABLE buildings DROP COLUMN IF EXISTS designers;
ALTER TABLE buildings DROP COLUMN IF EXISTS designers_source_link; ALTER TABLE buildings DROP COLUMN IF EXISTS designers_source_link;
ALTER TABLE buildings DROP COLUMN IF EXISTS lead_designer_type; 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 designer_awards;
ALTER TABLE buildings DROP COLUMN IF EXISTS awards_source_link; 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;

View File

@ -6,4 +6,6 @@ ALTER TABLE buildings ADD COLUMN IF NOT EXISTS designers text[];
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS designers_source_link text[]; ALTER TABLE buildings ADD COLUMN IF NOT EXISTS designers_source_link text[];
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS lead_designer_type varchar; 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 designer_awards boolean null;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS awards_source_link text[]; 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[];