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

#9825: Add an config option to enable mapInfo highlight by default #9829

Merged
merged 3 commits into from
Jan 9, 2024

Conversation

mahmoudadel54
Copy link
Contributor

Description

This PR enables mapInfo highlight in identify by default if the option 'identifyHighlight' is added to config file.
The PR includes:

  • Adding an option called "identifyHighlight" to enable/disable mapInfo highlight by default in localConfig file
  • implement initiate highlight value based on the added option and the default is 'false'
  • write unit tests based on change

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (check one with "x", remove the others)

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

Issue

#9825

What is the current behavior?
#9825

What is the new behavior?
Now if the config option 'identifyHighlight' is defined by true, the mapInfo highlight in identify side bar will be active by default.

Breaking change

Does this PR introduce a breaking change? (check one with "x", remove the other)

  • Yes, and I documented them in migration notes
  • No

* Description:
- Adding an option called "identifyHighlight" to enable/disable mapInfo highlight by default in localConfig file
- implement intiate highlight value based on the added option and the default is false
- write unit tests based on change
* Description:
- fix FE test failure by editing a unit test in identifyContainer that test calling initiateOrResetHighlight on close identify
Copy link
Contributor

@MV88 MV88 left a comment

Choose a reason for hiding this comment

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

it works, but please refactor this by reusing the INIT_PLUGIN action

generally when there is a cfg prop that needs to initialize the state and then change due to user actions we follow this approach

  • only when plugin mounts (where connect is ) we call an onMount onInit action
  • in the reducer we initialize the configuration
  • we then user another action to change a specific prop value and a selector to fetch the value

Also please remember to avoid touching localConfig.json if not needed. undefined or null are falsy values as well, and it's better not not list props in cfg if not needed and use the default value associated to it at plugin level

web/client/configs/localConfig.json Outdated Show resolved Hide resolved
web/client/plugins/Identify.jsx Outdated Show resolved Hide resolved
web/client/plugins/Identify.jsx Outdated Show resolved Hide resolved
* Description:
- resolve review comments by using INIT_PLUGIN action instead of the new created one
- Remove the new created action ' INIT_IDENTIFY_HIGHLIGHT' and its dependent code
- Remove the added config from localConfig file
@mahmoudadel54 mahmoudadel54 requested a review from MV88 December 21, 2023 13:48
@MV88 MV88 merged commit c72e60f into geosolutions-it:master Jan 9, 2024
4 checks passed
@MV88
Copy link
Contributor

MV88 commented Jan 9, 2024

@ElenaGallo please test in DEV using a context and customizing the cfg of Identify plugin with "highlightEnabledFromTheStart": true

@tdipisa tdipisa added the BackportNeeded Commits provided for an issue need to be backported to the milestone's stable branch label Jan 9, 2024
@tdipisa
Copy link
Member

tdipisa commented Jan 9, 2024

@ElenaGallo let us know for the backport

@ElenaGallo
Copy link
Contributor

Test passed, @mahmoudadel54 please backport to 2023.02.xx. Thanks

mahmoudadel54 added a commit to mahmoudadel54/MapStore2 that referenced this pull request Jan 11, 2024
…t by default (geosolutions-it#9829)

* geosolutions-it#9825: Add option to enable mapInfo highlight by default
* Description:
- Adding an option called "identifyHighlight" to enable/disable mapInfo highlight by default in localConfig file
- implement intiate highlight value based on the added option and the default is false
- write unit tests based on change

* geosolutions-it#9825: Add option to enable mapInfo highlight by default
* Description:
- fix FE test failure by editing a unit test in identifyContainer that test calling initiateOrResetHighlight on close identify

* geosolutions-it#9825: Add option to enable mapInfo highlight by default
* Description:
- resolve review comments by using INIT_PLUGIN action instead of the new created one
- Remove the new created action ' INIT_IDENTIFY_HIGHLIGHT' and its dependent code
- Remove the added config from localConfig file
@mahmoudadel54
Copy link
Contributor Author

Test passed, @mahmoudadel54 please backport to 2023.02.xx. Thanks

Backport is done ---> #9871

MV88 pushed a commit that referenced this pull request Jan 11, 2024
…9829) (#9871)

* #9825: Add option to enable mapInfo highlight by default
* Description:
- Adding an option called "identifyHighlight" to enable/disable mapInfo highlight by default in localConfig file
- implement intiate highlight value based on the added option and the default is false
- write unit tests based on change

* #9825: Add option to enable mapInfo highlight by default
* Description:
- fix FE test failure by editing a unit test in identifyContainer that test calling initiateOrResetHighlight on close identify

* #9825: Add option to enable mapInfo highlight by default
* Description:
- resolve review comments by using INIT_PLUGIN action instead of the new created one
- Remove the new created action ' INIT_IDENTIFY_HIGHLIGHT' and its dependent code
- Remove the added config from localConfig file
@ElenaGallo ElenaGallo removed the BackportNeeded Commits provided for an issue need to be backported to the milestone's stable branch label Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Options to enable mapInfo highlight by default
4 participants