Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc AREMI fixes #5187

Merged
merged 15 commits into from
Feb 1, 2021
Merged

Misc AREMI fixes #5187

merged 15 commits into from
Feb 1, 2021

Conversation

nf-s
Copy link
Contributor

@nf-s nf-s commented Jan 28, 2021

Misc AREMI fixes

  • Fix CkanCatalogGroup.groupBy = "none" members
  • Fix TableMixin region mapping feature props and make Long/Lat features use column titles (if it exists) to match v7 behaviour.
    • This includes an awful thing in FeatureInfoSection.jsx. In v7 - we used to add this to each Feature - properties._terria_columnAliases = tableStructure.getColumnAliases() - which I think is worse...
  • Add support for CkanItemReference wms_layer property
  • Add support for ArcGisMapServerCatalogGroup to use sublayerIds.
  • Remove wordBreak="break-all" from Box surrounding DataPreview
    • This is because were getting weird breaks in Description and other elements that didn't reverse this

Checklist

  • Small bug fixes - so no tests.
  • I've updated CHANGES.md with what I changed.

Comment on lines 90 to 101
// Alises is a map from `key` (which exists in propertyData.properties) to some `aliasKey` which needs to resolve to `key`
// and Yes, this is awful, but not that much worse than what was done in V7
let aliases = [];
if (TableMixin.isMixedInto(this.props.catalogItem)) {
aliases = this.props.catalogItem.columns
.filter(col => col.name && col.title && col.name !== col.title)
.map(col => [col.name, col.title]);
}
aliases.forEach(aliasMap => {
propertyData[aliasMap[0]] = propertyData[aliasMap[1]];
});

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should aliasMap[1] keys be removed from propertyData? And is it possible or likely that an aliasMap[0] could also be an aliasMap[1] later in aliases and hence the key will be overwritten in propertyData?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need both in propertyData - as some feature templates use column name and others use column title (even if both are defined).
Overwriting aliases is definitely possible, but it seems unlikely someone would name a column.title after a different column.name. I have added this so at least we aren't overriding properties which are defined:

propertyData[aliasMap[0]] = propertyData[aliasMap[0]] ?? propertyData[aliasMap[1]];

I have also shallow cloned propertyData so we aren't messing with feature.propertes|currentProperties|...

@tephenavies tephenavies merged commit a6e2dff into next Feb 1, 2021
@tephenavies tephenavies deleted the aremi-fixes branch February 1, 2021 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants