hopscotch icon indicating copy to clipboard operation
hopscotch copied to clipboard

Configs! step vs tour vs global vs defaults

Open eoneill opened this issue 10 years ago • 3 comments

this sounds like a mess, we should have a consistent interface for setting hopscotch configs at each level

eoneill avatar Mar 13 '14 00:03 eoneill

+1

kate2753 avatar Mar 13 '14 00:03 kate2753

As part of breaking things apart in #72, I could see us creating a config class that acts as an accessor for other components to read from or set to. Probably similar to HopscotchBubble, each callout or Hopscotch would own its own config class. Or maybe HopscotchBubble creates its own config instance when it's created.

Dunno if there are any utils that are relying on global configs, though. We'll have to explore this more and see what relies on configs and where their configs are coming from. In general, though, does the above sound like it's going in the right direction?

timlindvall avatar Mar 25 '14 01:03 timlindvall

I've created a simple version of the config on gh72 branch

https://github.com/linkedin/hopscotch/blob/gh72/src/es/modules/config.js

The idea with this approach is that config can inherit from another config. So we will have a hierarchy of configs defaultConfig, globalConfig (hopscotch.configure), tourConfig (tour level options) and calloutConfig(standalone callout options, or specific step options. Inherits from globalConfig if it's a standalone callout).

We still need unit tests for this module, but it's 70% there :)

kate2753 avatar Oct 01 '15 19:10 kate2753