add BuildingEditSummaryBrief to Age category
This commit is contained in:
parent
b2373c6abb
commit
cee05b5979
@ -8,6 +8,7 @@ import TextboxDataEntry from '../data-components/textbox-data-entry';
|
|||||||
import Verification from '../data-components/verification';
|
import Verification from '../data-components/verification';
|
||||||
import YearDataEntry from '../data-components/year-data-entry';
|
import YearDataEntry from '../data-components/year-data-entry';
|
||||||
import withCopyEdit from '../data-container';
|
import withCopyEdit from '../data-container';
|
||||||
|
import BuildingEditSummaryBrief from '../edit-history/building-edit-summary';
|
||||||
|
|
||||||
import { CategoryViewProps } from './category-view-props';
|
import { CategoryViewProps } from './category-view-props';
|
||||||
|
|
||||||
@ -22,6 +23,7 @@ const AgeView: React.FunctionComponent<CategoryViewProps> = (props) => {
|
|||||||
){
|
){
|
||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
|
<BuildingEditSummaryBrief/>
|
||||||
<YearDataEntry
|
<YearDataEntry
|
||||||
year={props.building.date_year}
|
year={props.building.date_year}
|
||||||
upper={props.building.date_upper}
|
upper={props.building.date_upper}
|
||||||
@ -93,6 +95,7 @@ const AgeView: React.FunctionComponent<CategoryViewProps> = (props) => {
|
|||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
|
<BuildingEditSummaryBrief/>
|
||||||
<YearDataEntry
|
<YearDataEntry
|
||||||
year={props.building.date_year}
|
year={props.building.date_year}
|
||||||
upper={props.building.date_upper}
|
upper={props.building.date_upper}
|
||||||
|
@ -82,6 +82,30 @@ const BuildingEditSummary: React.FunctionComponent<BuildingEditSummaryProps> = (
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const BuildingEditSummaryBrief: React.FunctionComponent<BuildingEditSummaryProps> = ({
|
||||||
|
historyEntry,
|
||||||
|
showBuildingId = false,
|
||||||
|
hyperlinkCategories = false
|
||||||
|
}) => {
|
||||||
|
const entriesWithMetadata = enrichHistoryEntries(historyEntry.forward_patch, historyEntry.reverse_patch);
|
||||||
|
const entriesByCategory = arrayToDictionary(entriesWithMetadata, x => x.category);
|
||||||
|
|
||||||
|
const categoryHyperlinkTemplate = hyperlinkCategories && historyEntry.building_id != undefined ?
|
||||||
|
`/edit/$category/${historyEntry.building_id}` :
|
||||||
|
undefined;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="edit-history-entry">
|
||||||
|
<h2 className="edit-history-timestamp">Edited on {formatDate(parseDate(historyEntry.revision_timestamp))}</h2>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
export {
|
export {
|
||||||
BuildingEditSummary
|
BuildingEditSummary
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export {
|
||||||
|
BuildingEditSummaryBrief
|
||||||
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user