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

Runtime Config Session Tracking Support #869

Merged
merged 7 commits into from
Jul 1, 2021

Conversation

cea2aj
Copy link
Member

@cea2aj cea2aj commented Jun 30, 2021

Add support for 'sessionTrackingEnabled' in the runtime config

This PR moves the canonicalization of the runtime config listeners into RuntimeConfig itself. The waiting for Answers to initialize is also moved out of the listeners and into AnswersExperience.

Note: Currently when sessionTrackingEnabled is set, the ordering of the verticals on the universal results page changes. I suspect this is an issue with the answers-search-ui and therefore the issue is not related to this PR.

J=SLAP-1410
TEST=manual

Test both setting both 'analyticsEventsEnabled' and 'sessionTrackingEnabled' from an iframe integration and a standard integration

@coveralls
Copy link

coveralls commented Jun 30, 2021

Coverage Status

Coverage increased (+0.1%) to 6.753% when pulling 752b74a on dev/runtime-session-tracking into 00034ef on develop.

static/js/utils.js Outdated Show resolved Hide resolved
tests/static/js/utils.js Outdated Show resolved Hide resolved
static/js/runtime-config-listeners/analytics.js Outdated Show resolved Hide resolved
static/js/utils.js Show resolved Hide resolved
static/js/runtime-config-listeners/analytics.js Outdated Show resolved Hide resolved
static/js/HitchhikerJS.js Outdated Show resolved Hide resolved
@cea2aj cea2aj requested a review from oshi97 June 30, 2021 22:17
Copy link
Contributor

@oshi97 oshi97 left a comment

Choose a reason for hiding this comment

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

curious what other people think but looks great to me!

*/
export default {
key: 'analyticsEventsEnabled',
valueType: 'boolean',
Copy link
Contributor

Choose a reason for hiding this comment

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

love the valueType! way better than what I was thinking

static/js/utils.js Outdated Show resolved Hide resolved
static/js/answers-experience.js Outdated Show resolved Hide resolved
import { canonicalizeBoolean } from './utils';

/**
* @typedef {Object} RuntimeConfigListener
Copy link
Contributor

Choose a reason for hiding this comment

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

😮 typescript prep

Copy link
Contributor

@yen-tt yen-tt left a comment

Choose a reason for hiding this comment

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

Nice! I like the valueType field addition and the mapping step that automatically add the wait for Answers init instead of specifying that manually in each listener object. Makes it simpler to add more runtimeConfig listeners later. lgtm!

@cea2aj cea2aj merged commit bbf19b5 into develop Jul 1, 2021
@cea2aj cea2aj deleted the dev/runtime-session-tracking branch July 1, 2021 14:33
@cea2aj cea2aj mentioned this pull request Aug 24, 2021
cea2aj added a commit that referenced this pull request Aug 24, 2021
### Features
- Support for new languages including Chinese (Traditional), Chinese (Simplified), Russian, Polish, Portuguese, Dutch, Arabic, Korean, Swedish, and Hindi (#918) (#900)
- A loading indicator can now be enabled on the search bar (#875)
- Voice search support (#894)
- Analytics, session tracking, and query source can now be toggled through Runtime Config (#869) (#879)
- Added validation to ensure that parts of global_config and page configs are valid (#888)
- Font preloads are now located in the layouts/preload-fonts.hbs file (#893)
- Global config now includes "sessionTrackingEnabled" and "analyticsEventsEnabled" (#898)
- Added a partial for additional Answers configuration (#903)
- Map pins now support custom label colors (#922)

### Enhancements
- The full-page-map "Search This Area" functionality is better optimized when a user quickly zooms in or out of the map (#861)
- Improved build time during development mode (#865)
- Icons were updated from components to Handlebars partials to improve performance (#874)

### Bugfixes
- When upgrading the theme version, the global config will no longer contain duplicate options which are commented out (#916)
- When upgrading the theme, the tests folders are now removed which improves build performance (#913)
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.

5 participants