Hide prominent display of likes counts
it remains accessible from map (approximate values) and from history tag of given object removal is motivated by desire to avoid misleading "0 people likes this building" - true about database state but not true about world in general exact phrasing is also a bit problematic in general
This commit is contained in:
parent
e8ff5df818
commit
ee16977b66
@ -1,7 +1,6 @@
|
|||||||
import React, { Fragment } from 'react';
|
import React, { Fragment } from 'react';
|
||||||
import { NavLink } from 'react-router-dom';
|
import { NavLink } from 'react-router-dom';
|
||||||
|
|
||||||
import { AggregationDescriptionConfig, buildingUserFields, dataFields } from '../../config/data-fields-config';
|
|
||||||
import { CopyProps } from '../data-containers/category-view-props';
|
import { CopyProps } from '../data-containers/category-view-props';
|
||||||
import { DataTitleCopyable } from './data-title';
|
import { DataTitleCopyable } from './data-title';
|
||||||
|
|
||||||
@ -11,8 +10,6 @@ interface UserOpinionEntryProps {
|
|||||||
title: string;
|
title: string;
|
||||||
mode: 'view' | 'edit' | 'multi-edit';
|
mode: 'view' | 'edit' | 'multi-edit';
|
||||||
userValue: boolean;
|
userValue: boolean;
|
||||||
aggregateValue: number;
|
|
||||||
aggregationDescriptions: AggregationDescriptionConfig;
|
|
||||||
copy: CopyProps;
|
copy: CopyProps;
|
||||||
onChange: (key: string, value: boolean) => void;
|
onChange: (key: string, value: boolean) => void;
|
||||||
}
|
}
|
||||||
@ -34,28 +31,6 @@ const UserOpinionEntry: React.FunctionComponent<UserOpinionEntryProps> = (props)
|
|||||||
onChange={e => props.onChange(props.slug, e.target.checked)}
|
onChange={e => props.onChange(props.slug, e.target.checked)}
|
||||||
/> Yes
|
/> Yes
|
||||||
</label>
|
</label>
|
||||||
<div>
|
|
||||||
<label>
|
|
||||||
<span style={{fontStyle: 'italic'}}>
|
|
||||||
{
|
|
||||||
(props.aggregateValue)?
|
|
||||||
(props.aggregateValue === 1)?
|
|
||||||
`1 person `
|
|
||||||
: `${props.aggregateValue} people `
|
|
||||||
: `0 people so far `
|
|
||||||
}
|
|
||||||
</span>
|
|
||||||
<span>
|
|
||||||
{
|
|
||||||
(props.aggregateValue)?
|
|
||||||
(props.aggregateValue === 1)?
|
|
||||||
props.aggregationDescriptions.one
|
|
||||||
: props.aggregationDescriptions.many
|
|
||||||
: props.aggregationDescriptions.zero
|
|
||||||
}
|
|
||||||
</span>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -32,8 +32,6 @@ const CommunityView: React.FunctionComponent<CategoryViewProps> = (props) => {
|
|||||||
title={buildingUserFields.community_like.title}
|
title={buildingUserFields.community_like.title}
|
||||||
|
|
||||||
userValue={props.building.community_like}
|
userValue={props.building.community_like}
|
||||||
aggregateValue={props.building.likes_total}
|
|
||||||
aggregationDescriptions={dataFields.likes_total.aggregationDescriptions}
|
|
||||||
|
|
||||||
onChange={props.onSaveChange}
|
onChange={props.onSaveChange}
|
||||||
mode={props.mode}
|
mode={props.mode}
|
||||||
@ -76,8 +74,6 @@ const CommunityView: React.FunctionComponent<CategoryViewProps> = (props) => {
|
|||||||
title={buildingUserFields.community_local_significance.title}
|
title={buildingUserFields.community_local_significance.title}
|
||||||
|
|
||||||
userValue={props.building.community_local_significance}
|
userValue={props.building.community_local_significance}
|
||||||
aggregateValue={props.building.community_local_significance_total}
|
|
||||||
aggregationDescriptions={dataFields.community_local_significance_total.aggregationDescriptions}
|
|
||||||
|
|
||||||
onChange={props.onSaveChange}
|
onChange={props.onSaveChange}
|
||||||
mode={props.mode}
|
mode={props.mode}
|
||||||
|
@ -1,12 +1,6 @@
|
|||||||
import { Category } from './categories-config';
|
import { Category } from './categories-config';
|
||||||
|
|
||||||
|
|
||||||
export interface AggregationDescriptionConfig {
|
|
||||||
zero: string;
|
|
||||||
one: string;
|
|
||||||
many: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This interface is used only in code which uses dataFields, not in the dataFields definition itself
|
* This interface is used only in code which uses dataFields, not in the dataFields definition itself
|
||||||
* Cannot make dataFields an indexed type ({[key: string]: DataFieldDefinition}),
|
* Cannot make dataFields an indexed type ({[key: string]: DataFieldDefinition}),
|
||||||
@ -65,14 +59,6 @@ export interface DataFieldDefinition {
|
|||||||
* By default this is false - fields are treated as not user-specific.
|
* By default this is false - fields are treated as not user-specific.
|
||||||
*/
|
*/
|
||||||
perUser?: boolean;
|
perUser?: boolean;
|
||||||
|
|
||||||
/**
|
|
||||||
* Only for fields that are aggregations of a building-user field.
|
|
||||||
* specify what text should be added to the number of users calculated by the aggregation.
|
|
||||||
* E.g. for user likes, if zero="like this building" then for a building with 0 likes,
|
|
||||||
* the result will be "0 people like this building"
|
|
||||||
*/
|
|
||||||
aggregationDescriptions?: AggregationDescriptionConfig;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const buildingUserFields = {
|
export const buildingUserFields = {
|
||||||
@ -516,29 +502,6 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */
|
|||||||
//tooltip: ,
|
//tooltip: ,
|
||||||
},
|
},
|
||||||
|
|
||||||
likes_total: {
|
|
||||||
category: Category.Community,
|
|
||||||
title: "Total number of likes",
|
|
||||||
example: 100,
|
|
||||||
tooltip: "People who like the building and think it contributes to the city.",
|
|
||||||
aggregationDescriptions: {
|
|
||||||
zero: "like this building",
|
|
||||||
one: "likes this building",
|
|
||||||
many: "like this building"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
community_local_significance_total: {
|
|
||||||
category: Category.Community,
|
|
||||||
title: "People who think the building should be recorded as one of local significance",
|
|
||||||
example: 100,
|
|
||||||
aggregationDescriptions: {
|
|
||||||
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"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
community_activities: {
|
community_activities: {
|
||||||
category: Category.Community,
|
category: Category.Community,
|
||||||
title: "Has the building ever been used for community activities?",
|
title: "Has the building ever been used for community activities?",
|
||||||
|
Loading…
Reference in New Issue
Block a user