Skip to content

Commit

Permalink
Merge pull request #7540 from ever-co/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
evereq authored Feb 15, 2024
2 parents d10ef80 + 2d4e7ed commit 3cb615f
Show file tree
Hide file tree
Showing 202 changed files with 4,447 additions and 2,302 deletions.
641 changes: 322 additions & 319 deletions .circleci/config.yml

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions .deploy/api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ COPY --chown=node:node packages/plugins/integration-hubstaff/package.json ./pack
COPY --chown=node:node packages/plugins/integration-upwork/package.json ./packages/plugins/integration-upwork/
COPY --chown=node:node packages/plugins/integration-github/package.json ./packages/plugins/integration-github/
COPY --chown=node:node packages/plugins/integration-jira/package.json ./packages/plugins/integration-jira/
COPY --chown=node:node packages/plugins/jitsu-analytics/package.json ./packages/plugins/jitsu-analytics/
COPY --chown=node:node packages/plugins/sentry-tracing/package.json ./packages/plugins/sentry-tracing/
COPY --chown=node:node packages/plugins/product-reviews/package.json ./packages/plugins/product-reviews/
COPY --chown=node:node packages/plugins/knowledge-base/package.json ./packages/plugins/knowledge-base/
COPY --chown=node:node packages/plugins/changelog/package.json ./packages/plugins/changelog/
Expand Down Expand Up @@ -189,6 +191,8 @@ COPY --chown=node:node packages/plugins/integration-hubstaff/package.json ./pack
COPY --chown=node:node packages/plugins/integration-upwork/package.json ./packages/plugins/integration-upwork/
COPY --chown=node:node packages/plugins/integration-github/package.json ./packages/plugins/integration-github/
COPY --chown=node:node packages/plugins/integration-jira/package.json ./packages/plugins/integration-jira/
COPY --chown=node:node packages/plugins/jitsu-analytics/package.json ./packages/plugins/jitsu-analytics/
COPY --chown=node:node packages/plugins/sentry-tracing/package.json ./packages/plugins/sentry-tracing/
COPY --chown=node:node packages/plugins/product-reviews/package.json ./packages/plugins/product-reviews/
COPY --chown=node:node packages/plugins/knowledge-base/package.json ./packages/plugins/knowledge-base/
COPY --chown=node:node packages/plugins/changelog/package.json ./packages/plugins/changelog/
Expand Down
2 changes: 2 additions & 0 deletions .deploy/webapp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ COPY --chown=node:node packages/plugins/integration-hubstaff/package.json ./pack
COPY --chown=node:node packages/plugins/integration-upwork/package.json ./packages/plugins/integration-upwork/
COPY --chown=node:node packages/plugins/integration-github/package.json ./packages/plugins/integration-github/
COPY --chown=node:node packages/plugins/integration-jira/package.json ./packages/plugins/integration-jira/
COPY --chown=node:node packages/plugins/jitsu-analytics/package.json ./packages/plugins/jitsu-analytics/
COPY --chown=node:node packages/plugins/sentry-tracing/package.json ./packages/plugins/sentry-tracing/
COPY --chown=node:node packages/plugins/product-reviews/package.json ./packages/plugins/product-reviews/
COPY --chown=node:node packages/plugins/knowledge-base/package.json ./packages/plugins/knowledge-base/
COPY --chown=node:node packages/plugins/changelog/package.json ./packages/plugins/changelog/
Expand Down
6 changes: 4 additions & 2 deletions apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@
"seed:prod:build": "yarn ng run api:seed -c=production"
},
"dependencies": {
"@gauzy/changelog": "^0.1.0",
"@gauzy/changelog-plugin": "^0.1.0",
"@gauzy/core": "^0.1.0",
"@gauzy/knowledge-base": "^0.1.0",
"@gauzy/jitsu-analytics-plugin": "^0.1.0",
"@gauzy/knowledge-base-plugin": "^0.1.0",
"@gauzy/sentry-plugin": "^0.1.0",
"dotenv": "^16.0.3",
"yargs": "^17.5.0"
},
Expand Down
51 changes: 37 additions & 14 deletions apps/api/src/plugin-config.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
import {
IPluginConfig,
DEFAULT_API_PORT,
DEFAULT_GRAPHQL_API_PATH,
DEFAULT_API_HOST,
DEFAULT_API_BASE_URL
} from '@gauzy/common';
import { dbTypeOrmConnectionConfig, dbMikroOrmConnectionConfig } from '@gauzy/config';
import * as path from 'path';
import { KnowledgeBasePlugin } from '@gauzy/knowledge-base';
import { ChangelogPlugin } from '@gauzy/changelog';
import * as chalk from 'chalk';
import { ApplicationPluginConfig, DEFAULT_API_PORT, DEFAULT_GRAPHQL_API_PATH, DEFAULT_API_HOST, DEFAULT_API_BASE_URL } from '@gauzy/common';
import { dbTypeOrmConnectionConfig, dbMikroOrmConnectionConfig, environment } from '@gauzy/config';
import { ChangelogPlugin } from '@gauzy/changelog-plugin';
import { JitsuAnalyticsPlugin } from '@gauzy/jitsu-analytics-plugin';
import { KnowledgeBasePlugin } from '@gauzy/knowledge-base-plugin';
import { SentryService } from '@gauzy/sentry-plugin';
import { Sentry as SentryPlugin } from './sentry';
import { version } from './../version';

const { jitsu } = environment;

let assetPath: any;
let assetPublicPath: any;

console.log(chalk.magenta(`API Version %s`), version);
console.log('Plugin Config -> __dirname: ' + __dirname);
console.log('Plugin Config -> process.cwd: ' + process.cwd());

Expand All @@ -29,10 +31,9 @@ if (__dirname.startsWith('/srv/gauzy')) {

console.log('Plugin Config -> assetPath: ' + assetPath);
console.log('Plugin Config -> assetPublicPath: ' + assetPublicPath);

console.log('DB Synchronize: ' + process.env.DB_SYNCHRONIZE);

export const pluginConfig: IPluginConfig = {
export const pluginConfig: ApplicationPluginConfig = {
apiConfigOptions: {
host: process.env.API_HOST || DEFAULT_API_HOST,
port: process.env.API_PORT || DEFAULT_API_PORT,
Expand All @@ -43,7 +44,7 @@ export const pluginConfig: IPluginConfig = {
playground: true,
debug: true,
apolloServerPlugins: []
}
},
},
dbConnectionOptions: {
retryAttempts: 100,
Expand All @@ -59,5 +60,27 @@ export const pluginConfig: IPluginConfig = {
assetPath: assetPath,
assetPublicPath: assetPublicPath
},
plugins: [KnowledgeBasePlugin, ChangelogPlugin]
...(environment.sentry && environment.sentry.dsn ? {
logger: new SentryService(SentryPlugin.options)
} : {}),
plugins: [
// Indicates the inclusion or intention to use the ChangelogPlugin in the codebase.
ChangelogPlugin,
// Indicates the inclusion or intention to use the KnowledgeBasePlugin in the codebase.
KnowledgeBasePlugin,
// Initializes the Jitsu Analytics Plugin by providing a configuration object.
JitsuAnalyticsPlugin.init({
config: {
host: jitsu.serverHost,
writeKey: jitsu.serverWriteKey,
debug: jitsu.debug,
echoEvents: jitsu.echoEvents
}
}),
...(environment.sentry && environment.sentry.dsn
? [
SentryPlugin
]
: []),
]
};
28 changes: 28 additions & 0 deletions apps/api/src/sentry.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { environment } from '@gauzy/config';
import { SentryPlugin, DefaultSentryIntegrations } from '@gauzy/sentry-plugin';
import { version } from '../version';

/**
* Initializes and configures the Sentry module.
* @returns The configured Sentry instance.
*/
export function initializeSentry(): typeof SentryPlugin {
return SentryPlugin.init({
dsn: environment.sentry.dsn,
debug: process.env.SENTRY_DEBUG === 'true' || !environment.production,
environment: environment.production ? 'production' : 'development',
release: 'gauzy@' + version,
logLevels: ['error'],
integrations: [
...DefaultSentryIntegrations
],
tracesSampleRate: process.env.SENTRY_TRACES_SAMPLE_RATE ? parseInt(process.env.SENTRY_TRACES_SAMPLE_RATE) : 0.01,
profilesSampleRate: process.env.SENTRY_PROFILE_SAMPLE_RATE ? parseInt(process.env.SENTRY_PROFILE_SAMPLE_RATE) : 1,
close: {
enabled: true,
timeout: 3000 // Time in milliseconds to forcefully quit the application
}
});
}

export const Sentry = initializeSentry();
14 changes: 14 additions & 0 deletions apps/api/version.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* @description
* Current version of the Gauzy API.
*
* @example
* ```
* import { version } from './version';
*
* console.log('Gauzy API version:', version);
* ```
*
* @since 0.1.0
*/
export const version: string = require('./package.json').version;
6 changes: 4 additions & 2 deletions apps/desktop/src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
"../../../packages/desktop-libs",
"../../../packages/plugins/knowledge-base",
"../../../packages/plugins/changelog",
"../../../packages/plugins/jitsu-analytics",
"../../../packages/plugins/sentry-tracing",
"../../../packages/common",
"../../../packages/config",
"../../../packages/contracts",
Expand Down Expand Up @@ -136,11 +138,11 @@
"@datorama/akita-ngdevtools": "^7.0.0",
"@electron/remote": "^2.0.8",
"@gauzy/auth": "^0.1.0",
"@gauzy/changelog": "^0.1.0",
"@gauzy/changelog-plugin": "^0.1.0",
"@gauzy/core": "^0.1.0",
"@gauzy/desktop-libs": "^0.1.0",
"@gauzy/desktop-window": "^0.1.0",
"@gauzy/knowledge-base": "^0.1.0",
"@gauzy/knowledge-base-plugin": "^0.1.0",
"@nestjs/platform-express": "^10.3.0",
"@sentry/electron": "^4.17.0",
"@sentry/node": "^7.90.0",
Expand Down
2 changes: 1 addition & 1 deletion apps/gauzy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"@fullcalendar/timegrid": "~6.1.10",
"@gauzy/common-angular": "^0.1.0",
"@gauzy/contracts": "^0.1.0",
"@jitsu/js": "^1.3.0",
"@jitsu/js": "^1.8.2",
"@kurkle/color": "^0.2.0",
"@nebular/auth": "^12.0.0",
"@nebular/bootstrap": "^9.1.0-rc.6",
Expand Down
11 changes: 0 additions & 11 deletions apps/gauzy/src/app/@core/services/organization-teams.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,4 @@ export class OrganizationTeamsService {
})
);
}

getAllByEmployee(
id: IOrganizationTeam['id'],
where?: IOrganizationTeamFindInput
): Promise<IOrganizationTeam[]> {
return firstValueFrom(
this.http.get<IOrganizationTeam[]>(`${API_PREFIX}/organization-team/employee/${id}`, {
params: toParams({ ...where })
})
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ export class ExpensesReportGridComponent extends BaseSelectorFilterComponent
}
const request: IGetTimeLogReportInput = {
...this.getFilterRequest(this.request),
groupBy: this.groupBy
groupBy: this.groupBy,
...(this.filters?.categoryId ? { categoryId: this.filters?.categoryId } : {}),
};
this.payloads$.next(request);
}
Expand Down
57 changes: 26 additions & 31 deletions apps/gauzy/src/app/@shared/team-select/team/team.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ import { OrganizationTeamStore } from '../../../@core/services/organization-team
}
]
})
export class TeamSelectorComponent
implements OnInit, OnDestroy {
export class TeamSelectorComponent implements OnInit, OnDestroy {

teams: IOrganizationTeam[] = [];
selectedTeam: IOrganizationTeam;
hasAddTeam$: Observable<boolean>;
Expand Down Expand Up @@ -131,13 +131,13 @@ export class TeamSelectorComponent
onChanged = new EventEmitter<IOrganizationTeam>();

constructor(
private readonly organizationTeams: OrganizationTeamsService,
private readonly _router: Router,
private readonly _activatedRoute: ActivatedRoute,
private readonly _organizationTeamsService: OrganizationTeamsService,
private readonly store: Store,
private readonly toastrService: ToastrService,
private readonly _organizationTeamStore: OrganizationTeamStore,
private readonly _truncatePipe: TruncatePipe,
private readonly router: Router,
private readonly activatedRoute: ActivatedRoute
private readonly _truncatePipe: TruncatePipe
) { }

ngOnInit(): void {
Expand All @@ -153,22 +153,20 @@ export class TeamSelectorComponent
.pipe(
switchMap(() => this.getTeams()),
tap(() => {
if (this.activatedRoute.snapshot.queryParams.teamId) {
this.selectTeamById(this.activatedRoute.snapshot.queryParams.teamId);
if (this._activatedRoute.snapshot.queryParams.teamId) {
this.selectTeamById(this._activatedRoute.snapshot.queryParams.teamId);
}
}),
untilDestroyed(this)
)
.subscribe();

this.activatedRoute.queryParams
this._activatedRoute.queryParams
.pipe(
filter((query) => !!query.teamId),
tap(({ teamId }) => this.selectTeamById(teamId)),
untilDestroyed(this)
)
.subscribe();

this.store.selectedOrganization$
.pipe(
distinctUntilChange(),
Expand Down Expand Up @@ -215,30 +213,27 @@ export class TeamSelectorComponent
const { id: organizationId } = this.organization;

if (this.employeeId) {
this.teams = await this.organizationTeams.getAllByEmployee(
this.employeeId,
{
organizationId,
tenantId,
...(this.organizationContactId
? {
organizationContactId:
this.organizationContactId
}
: {})
}
);
} else {
const { items = [] } = await this.organizationTeams.getAll([], {
// Fetch teams from the service
const { items = [] } = await this._organizationTeamsService.getMyTeams({
organizationId,
tenantId,
...(this.organizationContactId
// Additional parameters based on selectedEmployeeId
...(this.employeeId
? {
organizationContactId: this.organizationContactId
members: {
employeeId: this.employeeId
}
}
: {})
});
this.teams = items;
} else {
const { items = [] } = await this._organizationTeamsService.getAll([], {
organizationId,
tenantId,
...(this.organizationContactId ? { organizationContactId: this.organizationContactId } : {})
});
this.teams = items;
}

//Insert All Employees Option
Expand Down Expand Up @@ -293,7 +288,7 @@ export class TeamSelectorComponent
request['members'] = [member];
}

const team = await this.organizationTeams.create(request);
const team = await this._organizationTeamsService.create(request);

this.teams = this.teams.concat([team]);
this.teamId = team.id;
Expand Down Expand Up @@ -360,8 +355,8 @@ export class TeamSelectorComponent
}

private setAttributesToParams(params: Object) {
this.router.navigate([], {
relativeTo: this.activatedRoute,
this._router.navigate([], {
relativeTo: this._activatedRoute,
queryParams: { ...params },
queryParamsHandling: 'merge',
});
Expand Down
18 changes: 9 additions & 9 deletions apps/gauzy/src/app/pages/contacts/contacts.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,17 @@ <h4>
</ng-template>
</ng-template>
<ng-template #visible>
<button
(click)="invite()"
nbButton
class="action info"
size="small"
status="basic"
>
<ng-template ngxPermissionsOnly="ORG_CONTACT_EDIT">
<button
(click)="invite()"
nbButton
class="action info"
size="small"
status="basic"
>
<nb-icon class="mr-1" icon="email-outline"></nb-icon>
{{ 'BUTTONS.INVITE' | translate }}
</button>
<ng-template ngxPermissionsOnly="ORG_CONTACT_EDIT">
</button>
<button
(click)="add()"
nbButton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ <h4>
<strong>
{{ selectedTimeZoneName }} {{ selectedTimeZoneOffset }}
</strong>
<a style="cursor: pointer" (click)="selectTimezone()">{{
<a style="cursor: pointer; color: var(--link-text-color)" (click)="selectTimezone()">{{
'PUBLIC_APPOINTMENTS.CHANGE' | translate
}}</a>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ <h5>
></ga-timer-picker>
</div>
<div class="col">
<button nbButton status="primary" (click)="setSchedule()">
<button nbButton status="primary" (click)="setSchedule()"
[disabled]="!createForm.startTime || !createForm.endTime ? true : false" >
{{ 'BUTTONS.SET' | translate }}
</button>
</div>
Expand Down
Loading

0 comments on commit 3cb615f

Please sign in to comment.