refactor(editor-ui): Create first PH experiment (#3969)

This commit is contained in:
Iván Ovejero 2022-09-01 10:05:22 +02:00 committed by GitHub
parent 10cdf60202
commit ee519b0c08
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 65 deletions

View file

@ -9,38 +9,11 @@ declare module 'vue/types/vue' {
declare global {
interface Window {
rudderanalytics: RudderStack;
featureFlag: FeatureFlag;
posthog: posthog;
}
}
/**
* Simplified version of:
* https://github.com/PostHog/posthog-js/blob/master/src/module.d.ts
*/
/* tslint:disable-next-line */
interface posthog {
identify(
uniqueId?: string,
userPropertiesToSet?: object,
userPropertiesToSetOnce?: object,
): void;
reset(resetDeviceId?: boolean): void;
capture(
eventName: string,
properties?: object,
options?: object,
): unknown;
isFeatureEnabled(key: string, options?: object): boolean;
register(properties: object, days?: number): void;
people: {
set(
prop: object | string,
to?: object,
callback?: Function,
): unknown;
posthog: {
isFeatureEnabled(flagName: string): boolean;
getFeatureFlag(flagName: string): boolean | string;
};
getFeatureFlag?: (flagName: string) => boolean;
}
}
export interface IUserNodesPanelSession {
@ -54,13 +27,6 @@ interface IUserNodesPanelSessionData {
filterMode: string;
}
interface FeatureFlag {
getAll(): string[];
get(flagName: string): boolean | undefined;
isEnabled(flagName: string): boolean | undefined;
reload(): void;
}
/**
* Simplified version of:
* https://github.com/rudderlabs/rudder-sdk-js/blob/master/dist/rudder-sdk-js/index.d.ts

View file

@ -2051,13 +2051,9 @@ export default mixins(
this.setZoomLevel(1);
if (
window.posthog && window.featureFlag && window.posthog.getFeatureFlag &&
!window.featureFlag.isEnabled('show-welcome-note')
) {
return;
}
const flagAvailable = window.posthog !== undefined && window.posthog.getFeatureFlag !== undefined;
if (flagAvailable && window.posthog.getFeatureFlag('welcome-note') === 'test') {
setTimeout(() => {
this.$store.commit('setNodeViewOffsetPosition', {newOffset: [0, 0]});
// For novice users (onboardingFlowEnabled == true)
@ -2080,6 +2076,7 @@ export default mixins(
});
}
}, 0);
}
},
async initView (): Promise<void> {
if (this.$route.params.action === 'workflowSave') {