-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AB#1083 Move countries to locations table
- Add a new location type for countries and insert countries from STANAG 1059 in the locations table; set a few old ones to 'inactive'. - Replace people.country with a foreign key reference to locations.uuid. - Migrate existing countries, using exact matches and some heuristics; keeping the old country names if we don't have an exact match, to give users the opportunity to correct this themselves.
- Loading branch information
Showing
53 changed files
with
1,304 additions
and
349 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { Icon } from "@blueprintjs/core" | ||
import { IconNames } from "@blueprintjs/icons" | ||
import LinkTo from "components/LinkTo" | ||
import PropTypes from "prop-types" | ||
import React from "react" | ||
|
||
const CountryDisplay = ({ country, obsoleteCountry, plain }) => { | ||
const icon = ( | ||
<Icon | ||
icon={IconNames.FLAG} | ||
style={{ marginLeft: 5, marginRight: 5, height: "1em" }} | ||
/> | ||
) | ||
return ( | ||
<> | ||
{country && | ||
(plain ? ( | ||
<span> | ||
{icon} | ||
{country.name} | ||
</span> | ||
) : ( | ||
<LinkTo modelType="Location" model={country} showIcon={false}> | ||
{icon} | ||
{country.name} | ||
</LinkTo> | ||
))} | ||
{obsoleteCountry && <em> (old value: {obsoleteCountry})</em>} | ||
</> | ||
) | ||
} | ||
|
||
CountryDisplay.propTypes = { | ||
country: PropTypes.object, | ||
obsoleteCountry: PropTypes.string, | ||
plain: PropTypes.bool | ||
} | ||
|
||
export default CountryDisplay |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.