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

Release #6950

Merged
merged 40 commits into from
Oct 7, 2023
Merged

Release #6950

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
9fd1ace
chore(deps): bump dayjs from ^1.10.6 to ^1.11.5
rahul-rocket Oct 3, 2023
467f7cf
Merge branch 'develop' into fix/date-range-picker
rahul-rocket Oct 4, 2023
9307067
fix: date picker custom ranges
rahul-rocket Oct 4, 2023
a924320
fix: single and double range class
rahul-rocket Oct 4, 2023
fe4f5e8
feat: #6932 Added Task By Id API with rootEpic field
badalkhatri0924 Oct 4, 2023
c3a84da
jitsu backend api intergration
nelsonBlack Oct 5, 2023
3109c05
chore(deps): downgrade dayjs from ^1.11.5 to ^1.11.4
rahul-rocket Oct 5, 2023
f2a885f
Fix dataSource spelling
nelsonBlack Oct 5, 2023
71126fe
"editor.formatOnSave": set true
nelsonBlack Oct 5, 2023
160e516
fix: Typo, added Permission, Rearranged Routes in Controller
badalkhatri0924 Oct 5, 2023
8500f5a
fix: Deepscan issue
badalkhatri0924 Oct 5, 2023
456cab0
Merge pull request #6933 from ever-co/feat/#6932-root-epic
rahul-rocket Oct 5, 2023
014a4d3
fix: shift date ranges utc to local dates
adkif Oct 5, 2023
8a96e20
Org ActiveTaskId update method added
Gramosx Oct 5, 2023
922ebfc
Pr review fixes
nelsonBlack Oct 5, 2023
4f3aebb
fix: #6937 missing DTO and permission and improved code
rahul-rocket Oct 6, 2023
2b235b2
Merge branch 'develop' into feature/#6924-jitsu-backend-intergration
rahul-rocket Oct 6, 2023
294abba
fix(configure.ts): #6924 build issue for web app
rahul-rocket Oct 6, 2023
2ed8191
fix: #6924 unnecessary provider import (we already defined)
rahul-rocket Oct 6, 2023
f282244
fix: #6924 revert provider injection
rahul-rocket Oct 6, 2023
0c44ea9
Merge branch 'develop' into fix/date-range-picker
rahul-rocket Oct 6, 2023
0c6de4c
fix: date range picker improvement
rahul-rocket Oct 6, 2023
701bef4
Merge pull request #6942 from ever-co/fix/date-range-picker
rahul-rocket Oct 6, 2023
abecd7f
Old permission removed , logic fixes
Gramosx Oct 6, 2023
0e0f507
fix: #6924 jitsu independent instance
rahul-rocket Oct 6, 2023
4725c8f
fix: #6924 config environment for jitsu config
rahul-rocket Oct 6, 2023
efff88a
fix: import path
rahul-rocket Oct 6, 2023
2062015
fix: #6924 if keys are not defined don't create instance
rahul-rocket Oct 6, 2023
f470b5e
Fixes ,removal of permission
Gramosx Oct 6, 2023
dc54195
fix: #6924 added more tracked logs
rahul-rocket Oct 6, 2023
d1e158a
Merge pull request #6938 from ever-co/feat/6937-update-org-team-activ…
rahul-rocket Oct 6, 2023
a1a9447
feat: #6924 add more envs for debug mode (jitsu integration)
rahul-rocket Oct 6, 2023
6e35554
fix: #6924 remove log
rahul-rocket Oct 6, 2023
a45a19c
fix: #6924 use debug default false
rahul-rocket Oct 6, 2023
66c1ad1
feat(@gauzy/config): adds jitsu debug options
rahul-rocket Oct 6, 2023
f5aad49
fix: #6924 added more logs for jitsu configuration
rahul-rocket Oct 6, 2023
2499348
fix: #6924 added node-fetch for backend jitsu API
rahul-rocket Oct 6, 2023
753f82b
fix: #6924 missing node-fetch for jitsu configuration
rahul-rocket Oct 7, 2023
e887ca0
fix: #6924 rename env vars
rahul-rocket Oct 7, 2023
aacb641
Merge pull request #6935 from ever-co/feature/#6924-jitsu-backend-int…
rahul-rocket Oct 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .env.compose
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,12 @@ HUBSTAFF_CLIENT_ID=
HUBSTAFF_CLIENT_SECRET=
HUBSTAFF_PERSONAL_ACCESS_TOKEN=

# Jitsu Configuration
JITSU_BROWSER_HOST=
# Jitsu Browser Configuration
JITSU_BROWSER_URL=
JITSU_BROWSER_WRITE_KEY=

# Jitsu Server Configuration
JITSU_SERVER_URL=
JITSU_SERVER_WRITE_KEY=
JITSU_SERVER_DEBUG=
JITSU_SERVER_ECHO_EVENTS=
10 changes: 8 additions & 2 deletions .env.docker
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,12 @@ HUBSTAFF_CLIENT_ID=
HUBSTAFF_CLIENT_SECRET=
HUBSTAFF_PERSONAL_ACCESS_TOKEN=

# Jitsu Configuration
JITSU_BROWSER_HOST=
# Jitsu Browser Configuration
JITSU_BROWSER_URL=
JITSU_BROWSER_WRITE_KEY=

# Jitsu Server Configuration
JITSU_SERVER_URL=
JITSU_SERVER_WRITE_KEY=
JITSU_SERVER_DEBUG=
JITSU_SERVER_ECHO_EVENTS=
10 changes: 8 additions & 2 deletions .env.local
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,12 @@ HUBSTAFF_CLIENT_ID=
HUBSTAFF_CLIENT_SECRET=
HUBSTAFF_PERSONAL_ACCESS_TOKEN=

# Jitsu Configuration
JITSU_BROWSER_HOST=
# Jitsu Browser Configuration
JITSU_BROWSER_URL=
JITSU_BROWSER_WRITE_KEY=

# Jitsu Server Configuration
JITSU_SERVER_URL=
JITSU_SERVER_WRITE_KEY=
JITSU_SERVER_DEBUG=
JITSU_SERVER_ECHO_EVENTS=
10 changes: 8 additions & 2 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,12 @@ HUBSTAFF_CLIENT_ID=
HUBSTAFF_CLIENT_SECRET=
HUBSTAFF_PERSONAL_ACCESS_TOKEN=

# Jitsu Configuration
JITSU_BROWSER_HOST=
# Jitsu Browser Configuration
JITSU_BROWSER_URL=
JITSU_BROWSER_WRITE_KEY=

# Jitsu Server Configuration
JITSU_SERVER_URL=
JITSU_SERVER_WRITE_KEY=
JITSU_SERVER_DEBUG=
JITSU_SERVER_ECHO_EVENTS=
22 changes: 7 additions & 15 deletions .scripts/configure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,19 @@ import { CloudinaryConfiguration } from '@cloudinary/angular-5.x';

if (!env.IS_DOCKER) {
if (!env.GOOGLE_MAPS_API_KEY) {
console.warn(
'WARNING: No Google Maps API Key defined in the .env file. Google Maps may not be working!'
);
console.warn('WARNING: No Google Maps API Key defined in the .env file. Google Maps may not be working!');
}

if (!env.SENTRY_DSN) {
console.warn(
'WARNING: No Sentry DSN defined in the .env file. Sentry logging may not be working!'
);
console.warn('WARNING: No Sentry DSN defined in the .env file. Sentry logging may not be working!');
}

if (!env.CLOUDINARY_CLOUD_NAME || !env.CLOUDINARY_API_KEY) {
console.warn(
'WARNING: No Cloudinary API keys defined in the .env file.'
);
console.warn('WARNING: No Cloudinary API keys defined in the .env file.');
}

if (!env.JITSU_BROWSER_HOST || !env.JITSU_BROWSER_WRITE_KEY) {
console.warn(
'WARNING: No Jitsu keys defined in the .env file. Jitsu analytics may not be working!'
);
if (!env.JITSU_BROWSER_URL || !env.JITSU_BROWSER_WRITE_KEY) {
console.warn('WARNING: No Jitsu keys defined for browser in the .env file. Jitsu analytics may not be working!');
}

envFileContent += `
Expand Down Expand Up @@ -149,7 +141,7 @@ if (!env.IS_DOCKER) {

FILE_PROVIDER: '${env.FILE_PROVIDER}',

JITSU_BROWSER_HOST: '${env.JITSU_BROWSER_HOST}',
JITSU_BROWSER_URL: '${env.JITSU_BROWSER_URL}',
JITSU_BROWSER_WRITE_KEY: '${env.JITSU_BROWSER_WRITE_KEY}',

GAUZY_GITHUB_APP_NAME: '${env.GAUZY_GITHUB_APP_NAME}',
Expand Down Expand Up @@ -256,7 +248,7 @@ if (!env.IS_DOCKER) {

FILE_PROVIDER: '${env.FILE_PROVIDER}',

JITSU_BROWSER_HOST: '${env.JITSU_BROWSER_HOST}',
JITSU_BROWSER_URL: '${env.JITSU_BROWSER_URL}',
JITSU_BROWSER_WRITE_KEY: '${env.JITSU_BROWSER_WRITE_KEY}',

GAUZY_GITHUB_APP_NAME: '${env.GAUZY_GITHUB_APP_NAME}',
Expand Down
6 changes: 3 additions & 3 deletions .scripts/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ export type Env = Readonly<{

FILE_PROVIDER: string;

// Jitsu Analytics
JITSU_BROWSER_HOST: string;
// Jitsu Browser Configurations
JITSU_BROWSER_URL: string;
JITSU_BROWSER_WRITE_KEY: string;

GAUZY_GITHUB_APP_NAME: string;
Expand Down Expand Up @@ -141,7 +141,7 @@ export const env: Env = cleanEnv(

FILE_PROVIDER: str({ default: 'LOCAL' }),

JITSU_BROWSER_HOST: str({ default: '' }),
JITSU_BROWSER_URL: str({ default: '' }),
JITSU_BROWSER_WRITE_KEY: str({ default: '' }),

GAUZY_GITHUB_APP_NAME: str({ default: '' }),
Expand Down
2 changes: 1 addition & 1 deletion apps/gauzy-e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
},
"dependencies": {
"@faker-js/faker": "8.0.0-alpha.0",
"dayjs": "^1.11.4",
"resolve": "^1.20.0"
},
"scripts": {
Expand Down Expand Up @@ -66,7 +67,6 @@
"cypress": "^9.4.1",
"cypress-cucumber-preprocessor": "^4.3.1",
"cypress-file-upload": "^5.0.8",
"dayjs": "^1.10.6",
"jasmine-core": "^3.6.0",
"jasmine-spec-reporter": "^6.0.0",
"jest": "^26.4.2",
Expand Down
5 changes: 3 additions & 2 deletions apps/gauzy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"@fullcalendar/timegrid": "^5.11.2",
"@gauzy/common-angular": "^0.1.0",
"@gauzy/contracts": "^0.1.0",
"@jitsu/js": "^1.3.0",
"@kurkle/color": "^0.2.0",
"@nebular/auth": "^9.0.3",
"@nebular/bootstrap": "^9.0.3",
Expand Down Expand Up @@ -94,6 +95,7 @@
"d3-selection-multi": "^1.0.1",
"date-fns": "^2.28.0",
"date-holidays": "^1.6.1",
"dayjs": "^1.11.4",
"detect-passive-events": "^1.0.4",
"echarts": "^5.0.1",
"eva-icons": "^1.1.3",
Expand Down Expand Up @@ -164,8 +166,7 @@
"uuid": "^8.3.2",
"web-animations-js": "^2.3.2",
"yargs": "^17.5.0",
"zone.js": "~0.11.4",
"@jitsu/js": "^1.3.0"
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-builders/custom-webpack": "^13.0.0",
Expand Down
25 changes: 14 additions & 11 deletions apps/gauzy/src/app/@core/services/analytics/event.type.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
interface IUserCreatedEvent {
eventType: 'UserCreated';
eventType: JitsuAnalyticsEventsEnum.USER_CREATED;
userId: string;
email: string;
}

interface IButtonClickedEvent {
eventType: 'ButtonClicked';
eventType: JitsuAnalyticsEventsEnum.BUTTON_CLICKED;
url: string;
userId: string;
userEmail: string;
Expand All @@ -16,28 +16,28 @@ interface IMenuItemClickedEvent extends IButtonClickedEvent {
}

interface IPageViewEvent {
eventType: 'PageView';
eventType: JitsuAnalyticsEventsEnum.PAGE_VIEW;
url: string;
periodicity: string;
}

interface IPageCreatedEvent {
eventType: 'PageCreated';
eventType: JitsuAnalyticsEventsEnum.PAGE_CREATED;
slug: string;
}

interface IUserUpgradedEvent {
eventType: 'UserUpgraded';
eventType: JitsuAnalyticsEventsEnum.USER_UPGRADED;
email: string;
}

interface IUserClickDownloadAppEvent {
eventType: 'UserClickDownloadApp';
eventType: JitsuAnalyticsEventsEnum.USER_CLICK_DOWNLOAD_APP;
email: string;
}

interface IUserSignedInEvent {
eventType: 'UserSignedIn';
eventType: JitsuAnalyticsEventsEnum.USER_SIGNED_IN;
email: string;
}

Expand All @@ -54,8 +54,11 @@ type JitsuAnalyticsEvents =
export default JitsuAnalyticsEvents;

export enum JitsuAnalyticsEventsEnum {
USER_CREATED = 'User Created',
BUTTON_CLICKED = 'Button_Clicked',
PAGE_VIEW = 'Page_View',
PAGE_CREATED = 'Page Created',
USER_CREATED = 'UserCreated',
USER_SIGNED_IN = 'UserSignedIn',
USER_CLICK_DOWNLOAD_APP = 'UserClickDownloadApp',
USER_UPGRADED = 'UserUpgraded',
BUTTON_CLICKED = 'ButtonClicked',
PAGE_VIEW = 'PageView',
PAGE_CREATED = 'PageCreated'
}
24 changes: 13 additions & 11 deletions apps/gauzy/src/app/@core/services/analytics/jitsu.service.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Injectable } from '@angular/core';
import { NavigationEnd, Router } from '@angular/router';
import { jitsuAnalytics, emptyAnalytics, AnalyticsInterface } from '@jitsu/js';
import { filter } from 'rxjs/operators';
import { Location } from '@angular/common';
import { filter } from 'rxjs/operators';
import { jitsuAnalytics, emptyAnalytics, AnalyticsInterface } from '@jitsu/js';
import { environment } from '@env/environment';
import JitsuAnalyticsEvents, { JitsuAnalyticsEventsEnum } from './event.type';

Expand All @@ -11,15 +11,17 @@ import JitsuAnalyticsEvents, { JitsuAnalyticsEventsEnum } from './event.type';
})
export class JitsuService {
private jitsuClient: AnalyticsInterface;
constructor(private location: Location, private router: Router) {
this.jitsuClient =
environment.JITSU_BROWSER_HOST &&
environment.JITSU_BROWSER_WRITE_KEY
? jitsuAnalytics({
host: environment.JITSU_BROWSER_HOST,
writeKey: environment.JITSU_BROWSER_WRITE_KEY,
})
: emptyAnalytics;

constructor(
private readonly location: Location,
private readonly router: Router
) {
this.jitsuClient = environment.JITSU_BROWSER_URL && environment.JITSU_BROWSER_WRITE_KEY ? jitsuAnalytics({
host: environment.JITSU_BROWSER_URL,
writeKey: environment.JITSU_BROWSER_WRITE_KEY,
debug: false,
echoEvents: false
}) : emptyAnalytics;
}

async identify(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import {
Output,
} from '@angular/core';
import { Router } from '@angular/router';
import { NbSidebarService } from '@nebular/theme';
import JitsuAnalyticsEvents from 'apps/gauzy/src/app/@core/services/analytics/event.type';
import { JitsuService } from 'apps/gauzy/src/app/@core/services/analytics/jitsu.service';
import { Store } from 'apps/gauzy/src/app/@core/services/store.service';
import { IUser } from 'packages/contracts/dist';
import { tap } from 'rxjs/operators';
import { NbSidebarService } from '@nebular/theme';
import { IUser } from '@gauzy/contracts';
import JitsuAnalyticsEvents, { JitsuAnalyticsEventsEnum } from './../../../../../@core/services/analytics/event.type';
import { JitsuService } from './../../../../../@core/services/analytics/jitsu.service';
import { Store } from './../../../../../@core/services/store.service';
import { IMenuItem } from '../../interface/menu-item.interface';

@Component({
Expand All @@ -30,19 +30,17 @@ export class MenuItemComponent implements OnInit, AfterViewChecked {
private _selected: boolean;
private _user: IUser;

@Output()
public collapsedChange: EventEmitter<any> = new EventEmitter();
@Output()
public selectedChange: EventEmitter<any> = new EventEmitter();
@Output() public collapsedChange: EventEmitter<any> = new EventEmitter();
@Output() public selectedChange: EventEmitter<any> = new EventEmitter();

constructor(
private router: Router,
private sidebarService: NbSidebarService,
private cdr: ChangeDetectorRef,
private location: Location,
private jitsuService: JitsuService,
private readonly router: Router,
private readonly sidebarService: NbSidebarService,
private readonly cdr: ChangeDetectorRef,
private readonly location: Location,
private readonly jitsuService: JitsuService,
private readonly store: Store
) {}
) { }

ngOnInit(): void {
this._user = this.store.user;
Expand All @@ -60,20 +58,31 @@ export class MenuItemComponent implements OnInit, AfterViewChecked {
this.cdr.detectChanges();
}

/**
* Track a click event.
* @param item The item that was clicked.
* @param user The user who clicked the item.
*/
public jitsuTrackClick() {
const clickEvent: JitsuAnalyticsEvents = {
eventType: 'ButtonClicked',
eventType: JitsuAnalyticsEventsEnum.BUTTON_CLICKED,
url: this.item.url ?? this.item.link,
userId: this._user.id,
userEmail: this._user.email,
menuItemName: this.item.title,
};

// Track the click event
this.jitsuService.trackEvents(clickEvent.eventType, clickEvent);

// Identify the user
this.jitsuService.identify(this._user.id, {
email: this._user.email,
fullName: this._user.name,
timeZone: this._user.timeZone,
});

// Group the user
this.jitsuService.group(this._user.id, {
email: this._user.email,
fullName: this._user.name,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Represents a date range with a start date and end date.
export interface IDateRangePicker {
startDate: Date; // The start date of the date range.
endDate: Date; // The end date of the date range.
isCustomDate?: boolean; // Optional flag to indicate if it's a custom date range.
}

// Represents a time period with a start date and end date using moment.js.
export interface TimePeriod {
startDate: moment.Moment; // The start date of the time period.
endDate: moment.Moment; // The end date of the time period.
}

// Represents a collection of date ranges where each range is indexed by a string key.
export interface DateRanges {
[index: string]: [moment.Moment, moment.Moment]; // Key-value pairs of date ranges.
}

// Enum defining keys for common date range options.
export enum DateRangeKeyEnum {
TODAY = 'Today',
YESTERDAY = 'Yesterday',
CURRENT_WEEK = 'Current week',
LAST_WEEK = 'Last week',
CURRENT_MONTH = 'Current month',
LAST_MONTH = 'Last month'
}
Loading