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

Dt-6141: dynamically add city zones if config file flag assembleGeoJsonZones is true #4935

Closed
wants to merge 5 commits into from

Conversation

Dvun
Copy link
Contributor

@Dvun Dvun commented Jan 22, 2024

Proposed Changes

  • dynamically add city zones if config file flag assembleGeoJsonZones is true

Pull Request Check List

  • A reasonable set of unit tests is included
  • Console does not show new warnings/errors
  • Changes are documented or they are self explanatory
  • This pull request does not have any merge conflicts
  • All existing tests pass in CI build
  • Code coverage does not decrease (unless measured incorrectly)

Review

  • Read and verify the code changes
  • Test the functionality by running the UI locally with all popular browsers available in your platform
  • Check that the implementation matches the design, when such one is defined in a Jira issue
  • Merge the pull request

Copy link
Member

@vesameskanen vesameskanen left a comment

Choose a reason for hiding this comment

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

Hyvä alku! Muutama vika pitää vielä korjata.

app/config.js Outdated

if (additionalConfig.default.geoJson) {
if (additionalConfig.default.geoJson.layerConfigUrl) {
fetchDataFromGeoJsonUrl(
Copy link
Member

Choose a reason for hiding this comment

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

Tämä ei toimi. Fetch on asynkroninen. Koodin suoritus jatkuu eikä haettu geojson ehdi tulla mukaan lippuvyöhykkeisiin.

app/config.js Outdated
}
});
}
if (additionalConfig.default.assembleGeoJsonZones) {
Copy link
Member

Choose a reason for hiding this comment

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

Tämä ei toimi. Konfiguraation pusketaan keskeneräinen kokelma. Kokoa gejson zonet ensin, ja lisää ne vasta kun pyydettyä konfiguraatiota koostetaan getNamedConfiguration funktiossa.

app/config.js Outdated
function pushDataToGeoJsonLayers(layer, nameInConfig) {
const nameWithCapitalLetter =
nameInConfig.charAt(0).toUpperCase() + nameInConfig.slice(1);
geoLayers.push({
Copy link
Member

Choose a reason for hiding this comment

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

Tämä menee väärin. Karttavalitsimessa pitää näkyä yksi 'Vyöhykkeet' valinta eikä yli 10 kpl. Koosta varsinainen geojson geometria yhteen layeriin.

@@ -108,6 +108,18 @@ class MapLayersDialogContent extends React.Component {
this.updateSetting({ geoJson });
};

updateGeoJsonSettings = (arr, target) => {
Copy link
Member

Choose a reason for hiding this comment

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

En ymmärrä mitä tässä on tarkoitus tapahtua. Komponentissa on kaksi samannimistä funktiota 'updateGeoJsonSettings'. Alempi ylikirjoittaa ensimmäisen. Se, että data haetan monesta urlista ei pitöisi vaikuttaa asetuksiin ollenkaan.

app/server.js Outdated
if (config.useAssembledGeoJsonZones) {
config.geoJson = config.assembledGeoJsons;
}
delete config.assembledGeoJsons;
Copy link
Member

Choose a reason for hiding this comment

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

Ihmettelit miksi vyöhykkeet näkyy vain kerran. Syy on tässä: kun vyöhykedata on toimitettu jollekin clientille kerrran, se tuhotaan.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Totta :)

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