Skip to content

Fix #3608 improved tooltip customization in TOC#3618

Merged
tdipisa merged 2 commits intogeosolutions-it:masterfrom
MV88:3608_improvements
Mar 14, 2019
Merged

Fix #3608 improved tooltip customization in TOC#3618
tdipisa merged 2 commits intogeosolutions-it:masterfrom
MV88:3608_improvements

Conversation

@MV88
Copy link
Copy Markdown
Contributor

@MV88 MV88 commented Mar 13, 2019

Description

This pr enhances the way tooltips for TOC nodes are configured and customized

As described in TOC plugin documentation you can:

  • disable the tooltip input fields by adding
{
"name": "TOC",
  "cfg": {
    "layersOptions": {
      "showTooltipOption": false
    }
  }
}

or customize some options like max length of the tooltip or the join string

{
"name": "TOC",
  "cfg": {
    "layersOptions": {
      "truncateLength": 200,
      "joinStr": " : "
    }
  }
}

Issues

Please check if the PR fulfills these requirements

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

  • Bugfix (there were a bug when updating description in a group/subgroup)
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior? (You can also link to an open issue here)
you cannot setup tooltip options for each node and subgroup

What is the new behavior?
you can change tooltip options for each node (groups, subgroups, and layers)

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

  • Yes
  • No

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

Other information:
also added some English translation to non supported ones

this is a screenshot of the new UI
image

image

@MV88 MV88 self-assigned this Mar 13, 2019
@MV88 MV88 requested a review from offtherailz March 13, 2019 11:52
@coveralls
Copy link
Copy Markdown

coveralls commented Mar 13, 2019

Coverage Status

Coverage increased (+0.006%) to 80.94% when pulling 748d338 on MV88:3608_improvements into cd62de6 on geosolutions-it:master.

Copy link
Copy Markdown
Member

@offtherailz offtherailz left a comment

Choose a reason for hiding this comment

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

  • Can be the 2 tooltip select put inline?
  • I see a lot of changes to the translation files. There was something missing? If so, please specify this in the PR

onSelect: PropTypes.func,
titleTooltip: PropTypes.bool,
tooltipOptions: PropTypes.object
truncateLength: PropTypes.number,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

use a tooltipOptions object to wrap all the things and change the names (joinString --> separator) (truncateLength --> maxLength)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@tdipisa should we align the two tooltips?

@offtherailz regarding the translations, i just added some missing translations to the non mantained ones

"nodeType": "groups",
"options": {}
};
const flat = [
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please remove all the layers not necessary for this test

"singleTile": "Single Tile",
"cached": "Gebruik cache-opties",
"styleCustom": "Gebruik een stijl genaamd \"{value} \"",
"styleCustom": "G ebruik een stijl genaamd \"{value} \"",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think there is a typo here

Suggested change
"styleCustom": "G ebruik een stijl genaamd \"{value} \"",
"styleCustom": "Gebruik een stijl genaamd \"{value} \"",

* adds or update node property in a nested node
* similar to deepchange but it overrides a whole group of options instead of one
*/
const deepOptionsChange = (nodes, findId, propValues = {}) => {
Copy link
Copy Markdown
Member

@offtherailz offtherailz Mar 13, 2019

Choose a reason for hiding this comment

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

I think this can be implemented by iterating on propValues keys for deepChange (or vice-versa deepChange can be implemented using this). There is a little of redundancy.
It's deepChange enough tested to replace the implementation? otherwise you can skip, maybe comment

* also added tocitem settings in hte dcoma config
@geosolutions-it geosolutions-it deleted a comment Mar 13, 2019
@tdipisa tdipisa merged commit 9aa0e0a into geosolutions-it:master Mar 14, 2019
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.

TOC mouse over tooltip customization

5 participants