Skip to content

Commit

Permalink
feat: Add new event hooks (#5530)
Browse files Browse the repository at this point in the history
* feat: Add new event hooks

* fix: update event
  • Loading branch information
mutdmour authored Feb 21, 2023
1 parent 3ae005c commit d47d008
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
5 changes: 4 additions & 1 deletion packages/editor-ui/src/components/ParameterInputFull.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,9 @@ import { INodeParameters, INodeProperties, INodePropertyMode, IParameterLabel }
import { BaseTextKey } from '@/plugins/i18n';
import { mapStores } from 'pinia';
import { useNDVStore } from '@/stores/ndv';
import { externalHooks } from '@/mixins/externalHooks';
export default mixins(showMessage).extend({
export default mixins(showMessage, externalHooks).extend({
name: 'parameter-input-full',
components: {
ParameterOptions,
Expand Down Expand Up @@ -326,6 +327,8 @@ export default mixins(showMessage).extend({
hasExpressionMapping(prevValue),
success: true,
});
this.$externalHooks().run('parameterInputFull.mappedData');
}
this.forceShowExpression = false;
}, 200);
Expand Down
2 changes: 1 addition & 1 deletion packages/editor-ui/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ export const ASSUMPTION_EXPERIMENT = {
};

export const ONBOARDING_EXPERIMENT = {
name: 'onboarding-checklist',
name: 'checklist_001',
control: 'control',
variant: 'variant',
};
Expand Down
6 changes: 6 additions & 0 deletions packages/editor-ui/src/stores/posthog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { useSettingsStore } from './settings';
import { FeatureFlags } from 'n8n-workflow';
import { EXPERIMENTS_TO_TRACK } from '@/constants';
import { useTelemetryStore } from './telemetry';
import { runExternalHook } from '@/mixins/externalHooks';
import { useWebhooksStore } from './webhooks';

export const usePostHogStore = defineStore('posthog', () => {
const usersStore = useUsersStore();
Expand Down Expand Up @@ -104,6 +106,10 @@ export const usePostHogStore = defineStore('posthog', () => {
});

trackedDemoExp.value[name] = variant;
runExternalHook('posthog.featureFlagsUpdated', useWebhooksStore(), {
name,
variant,
});
};

watch(
Expand Down

0 comments on commit d47d008

Please # to comment.