feat: event tracking using posthog and created application provider to render multiple wrappers (#2757)

* fix: event tracker changes

* fix: App provider implementation using wrappers

* fix: updating packages

* fix: handling warning

* fix: wrapper fixes and minor optimization changes

* fix: chore app-provider clearnup

* fix: cleanup

* fix: removing jitsu tracking

* fix: minor updates

* fix: adding event to posthog event tracker (#2802)

* dev: posthog event tracker update intitiate

* fix: adding events for posthog integration

* fix: event payload

---------

Co-authored-by: Ramesh Kumar Chandra <31303617+rameshkumarchandra@users.noreply.github.com>
This commit is contained in:
sriram veeraghanta 2023-11-20 13:29:54 +05:30
parent 33be52792f
commit 78fee22fec
114 changed files with 825 additions and 2768 deletions

View file

@ -4,8 +4,7 @@ import { RootStore } from "../root";
import { IState } from "types";
// services
import { ProjectService, ProjectStateService } from "services/project";
import { groupBy, orderArrayBy, groupByField } from "helpers/array.helper";
import { orderStateGroups } from "helpers/state.helper";
import { groupByField } from "helpers/array.helper";
export interface IProjectStateStore {
loader: boolean;
@ -104,12 +103,7 @@ export class ProjectStateStore implements IProjectStateStore {
createState = async (workspaceSlug: string, projectId: string, data: Partial<IState>) => {
try {
const response = await this.stateService.createState(
workspaceSlug,
projectId,
data,
this.rootStore.user.currentUser!
);
const response = await this.stateService.createState(workspaceSlug, projectId, data);
runInAction(() => {
this.states = {
@ -143,13 +137,7 @@ export class ProjectStateStore implements IProjectStateStore {
};
});
const response = await this.stateService.patchState(
workspaceSlug,
projectId,
stateId,
data,
this.rootStore.user.currentUser!
);
const response = await this.stateService.patchState(workspaceSlug, projectId, stateId, data);
return response;
} catch (error) {
@ -179,7 +167,7 @@ export class ProjectStateStore implements IProjectStateStore {
});
// deleting using api
await this.stateService.deleteState(workspaceSlug, projectId, stateId, this.rootStore.user.currentUser!);
await this.stateService.deleteState(workspaceSlug, projectId, stateId);
} catch (error) {
console.log("Failed to delete state from project store");
// reverting back to original label list
@ -259,13 +247,7 @@ export class ProjectStateStore implements IProjectStateStore {
};
});
await this.stateService.patchState(
workspaceSlug,
projectId,
stateId,
{ sequence: newSequence },
this.rootStore.user.currentUser!
);
await this.stateService.patchState(workspaceSlug, projectId, stateId, { sequence: newSequence });
} catch (err) {
console.log("Failed to move state position");
// reverting back to old state group if api fails