feat: Add demo experiment to help users activate (#5141)

* feat: enable posthog for dev process

* feat: inject sticky in demo

* feat: update url

* feat: update pos

* feat: add demo button

* feat: add callout

* feat: hide behind exp

* fix: fix zoom to fit

* fix: fix zoom reset when moving to new view

* fix: use constant for test

* feat: add tracking

* feat: fix tracking

* feat: fix tracking

* fix canvas centering

* feat: update time

* feat: update bg color

* feat: update copy

* feat: update btm padding

* feat: replace thumbnail

* feat: increase height of sticky

* chore: clean up props

* fix: revert canvas change

* chore: address feedback

* chore: remove extra space

* test: fix unit tests
This commit is contained in:
Mutasem Aldmour
2023-01-13 11:56:29 +01:00
committed by GitHub
parent 94be3b61cb
commit c2eb519398
12 changed files with 108 additions and 55 deletions

View File

@@ -30,7 +30,7 @@
import Modals from './components/Modals.vue';
import LoadingView from './views/LoadingView.vue';
import Telemetry from './components/Telemetry.vue';
import { HIRING_BANNER, LOCAL_STORAGE_THEME, VIEWS } from './constants';
import { HIRING_BANNER, LOCAL_STORAGE_THEME, POSTHOG_ASSUMPTION_TEST, VIEWS } from './constants';
import mixins from 'vue-typed-mixins';
import { showMessage } from '@/mixins/showMessage';
@@ -179,6 +179,17 @@ export default mixins(showMessage, userHelpers, restApi, historyHelper).extend({
window.document.body.classList.add(`theme-${theme}`);
}
},
trackExperiments() {
const assumption = window.posthog?.getFeatureFlag?.(POSTHOG_ASSUMPTION_TEST);
const isVideo = assumption === 'assumption-video';
const isDemo = assumption === 'assumption-demo';
if (isVideo) {
this.$telemetry.track('User is part of video experiment');
} else if (isDemo) {
this.$telemetry.track('User is part of demo experiment');
}
},
},
async mounted() {
this.setTheme();
@@ -195,6 +206,10 @@ export default mixins(showMessage, userHelpers, restApi, historyHelper).extend({
if (this.defaultLocale !== 'en') {
await this.nodeTypesStore.getNodeTranslationHeaders();
}
setTimeout(() => {
this.trackExperiments();
}, 0);
},
watch: {
$route(route) {