Skip to content

Commit

Permalink
Merge pull request #7203 from ever-co/develop
Browse files Browse the repository at this point in the history
* feat: feat/#7175-translate-date translate date when language change

* fix: improved social logins configs types

* Feat/#7192 jira integration (#7196)

* WIP: JIRA Integration

* WIP: JIRA Integration

* Updated Jira Integration

* Removed Unused Code

* fix: Deepscan issues

* Updated Jira config file

---------

Co-authored-by: Ruslan K <[email protected]>

---------

Co-authored-by: CoderNadir <[email protected]>
Co-authored-by: RAHUL RATHORE <[email protected]>
Co-authored-by: Rahul R <[email protected]>
Co-authored-by: Badal Khatri <[email protected]>
  • Loading branch information
5 people authored Nov 28, 2023
2 parents af4a290 + e9389d9 commit 1d02d49
Show file tree
Hide file tree
Showing 22 changed files with 1,643 additions and 135 deletions.
10 changes: 8 additions & 2 deletions apps/gauzy/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { AfterViewInit, Component, OnInit } from '@angular/core';
import { Router, ActivatedRoute, NavigationEnd } from '@angular/router';
import { SeoService } from './@core/utils/seo.service';
import { TranslateService } from '@ngx-translate/core';
import { LangChangeEvent, TranslateService } from '@ngx-translate/core';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { IDateRangePicker, ILanguage, LanguagesEnum } from '@gauzy/contracts';
import { isNotEmpty } from '@gauzy/common-angular';
Expand All @@ -26,6 +26,7 @@ import {
import { environment } from '../environments/environment';
import { JitsuService } from './@core/services/analytics/jitsu.service';
import { union } from 'underscore';
import { moment } from './@core/moment-extend';

@UntilDestroy({ checkProperties: true })
@Component({
Expand Down Expand Up @@ -59,14 +60,19 @@ export class AppComponent implements OnInit, AfterViewInit {
this.jitsuService.trackPageViews();
this.seoService.trackCanonicalChanges();

// -- Translate date when language change
this.translate.onLangChange.subscribe(
(langChangeEvent: LangChangeEvent) => moment.locale(langChangeEvent.lang)
)

this.store.systemLanguages$
.pipe(untilDestroyed(this))
.subscribe((languages) => {
//Returns the language code name from the browser, e.g. "en", "bg", "he", "ru"
const browserLang = this.translate.getBrowserLang();

//Gets default enum languages, e.g. "en", "bg", "he", "ru"
const defaultLanguages = Object.values(LanguagesEnum);
const defaultLanguages: string[] = Object.values(LanguagesEnum);

//Gets system languages
let systemLanguages: string[] = _.pluck(languages, 'code');
Expand Down
11 changes: 11 additions & 0 deletions packages/common/src/interfaces/IJiraIntegrationConfig.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Configuration options for Jira integration.
*/
export interface IJiraIntegrationConfig {
readonly appName: string;
readonly appDescription: string;
readonly appKey: string;
readonly baseUrl: string;
readonly vendorName: string;
readonly vendorUrl: string;
}
1 change: 1 addition & 0 deletions packages/common/src/interfaces/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ export * from './IUpworkConfig';
export * from './IWasabiConfig';
export * from './IHubstaffConfig';
export * from './IJitsuConfig';
export * from './IJiraIntegrationConfig';
4 changes: 2 additions & 2 deletions packages/config/src/config/facebook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { IFacebookConfig } from '@gauzy/common';
/**
* Register Facebook OAuth configuration using @nestjs/config
*/
export default registerAs('facebook', () => ({
export default registerAs('facebook', (): IFacebookConfig => ({
// Facebook OAuth Client ID
clientId: process.env.FACEBOOK_CLIENT_ID,

Expand All @@ -13,4 +13,4 @@ export default registerAs('facebook', () => ({

// Callback URL for handling the OAuth response after authentication
callbackURL: process.env.FACEBOOK_CALLBACK_URL || `${process.env.API_BASE_URL}/api/auth/facebook/callback`
}) as IFacebookConfig);
}));
4 changes: 2 additions & 2 deletions packages/config/src/config/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { IGithubConfig } from '@gauzy/common';
/**
* Register GitHub OAuth configuration using @nestjs/config
*/
export default registerAs('github', () => ({
export default registerAs('github', (): IGithubConfig => ({
// GitHub OAuth Client ID
clientId: process.env.GAUZY_GITHUB_OAUTH_CLIENT_ID,

Expand All @@ -16,4 +16,4 @@ export default registerAs('github', () => ({

// User Agent for GitHub API requests
userAgent: process.env.CLIENT_BASE_URL
}) as IGithubConfig);
}));
4 changes: 2 additions & 2 deletions packages/config/src/config/google.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { IGoogleConfig } from '@gauzy/common';
/**
* Register Google OAuth configuration using @nestjs/config
*/
export default registerAs('google', () => ({
export default registerAs('google', (): IGoogleConfig => ({
// Google OAuth Client ID
clientId: process.env.GOOGLE_CLIENT_ID,

Expand All @@ -13,4 +13,4 @@ export default registerAs('google', () => ({

// Callback URL for handling the OAuth response after authentication
callbackURL: process.env.GOOGLE_CALLBACK_URL || `${process.env.API_BASE_URL}/api/auth/google/callback`
}) as IGoogleConfig);
}));
12 changes: 2 additions & 10 deletions packages/config/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,9 @@ import linkedin from './linkedin';
import microsoft from './microsoft';
import setting from './setting';
import twitter from './twitter';
import jira from './jira';

/**
* This array contains individual configuration modules for different social login providers.
*/
export default [
app,
facebook,
github,
google,
linkedin,
microsoft,
setting,
twitter
];
export default [app, facebook, github, google, linkedin, microsoft, setting, twitter, jira];
17 changes: 17 additions & 0 deletions packages/config/src/config/jira.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { registerAs } from '@nestjs/config';
import { IJiraIntegrationConfig } from '@gauzy/common';

/**
* Register Jira configuration using @nestjs/config
*/
export default registerAs(
'jira',
(): IJiraIntegrationConfig => ({
appName: process.env.GAUZY_JIRA_APP_NAME,
appDescription: process.env.GAUZY_JIRA_APP_DESCRIPTION,
appKey: process.env.GAUZY_JIRA_APP_KEY,
baseUrl: process.env.GAUZY_JIRA_APP_BASE_URL,
vendorName: process.env.GAUZY_JIRA_APP_BASE_VENDOR_NAME,
vendorUrl: process.env.GAUZY_JIRA_APP_BASE_VENDOR_URL
})
);
4 changes: 2 additions & 2 deletions packages/config/src/config/linkedin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ILinkedinConfig } from '@gauzy/common';
/**
* Register LinkedIn OAuth configuration using @nestjs/config
*/
export default registerAs('linkedin', () => ({
export default registerAs('linkedin', (): ILinkedinConfig => ({
// LinkedIn OAuth Client ID
clientId: process.env.LINKEDIN_CLIENT_ID,

Expand All @@ -13,4 +13,4 @@ export default registerAs('linkedin', () => ({

// Callback URL for handling the OAuth response after authentication
callbackURL: process.env.LINKEDIN_CALLBACK_URL || `${process.env.API_BASE_URL}/api/auth/linkedin/callback`
}) as ILinkedinConfig);
}));
4 changes: 2 additions & 2 deletions packages/config/src/config/microsoft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { IMicrosoftConfig } from '@gauzy/common';
/**
* Register Microsoft OAuth configuration using @nestjs/config
*/
export default registerAs('microsoft', () => ({
export default registerAs('microsoft', (): IMicrosoftConfig => ({
/** The URL for the Microsoft Graph API */
graphApiURL: process.env.MICROSOFT_GRAPH_API_URL || 'https://graph.microsoft.com/v1.0',

Expand All @@ -22,4 +22,4 @@ export default registerAs('microsoft', () => ({

/** Callback URL for handling the OAuth response after authentication */
callbackURL: process.env.MICROSOFT_CALLBACK_URL || `${process.env.API_BASE_URL}/api/auth/microsoft/callback`
}) as IMicrosoftConfig);
}));
4 changes: 2 additions & 2 deletions packages/config/src/config/twitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ITwitterConfig } from '@gauzy/common';
/**
* Register Twitter OAuth configuration using @nestjs/config
*/
export default registerAs('twitter', () => ({
export default registerAs('twitter', (): ITwitterConfig => ({
// Twitter API Key (Consumer Key)
consumerKey: process.env.TWITTER_CLIENT_ID,

Expand All @@ -13,4 +13,4 @@ export default registerAs('twitter', () => ({

// Callback URL for handling the OAuth response after authentication
callbackURL: process.env.TWITTER_CALLBACK_URL || `${process.env.API_BASE_URL}/api/auth/twitter/callback`
}) as ITwitterConfig);
}));
10 changes: 10 additions & 0 deletions packages/config/src/environments/environment.prod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,16 @@ export const environment: IEnvironment = {
webhookUrl: process.env.GAUZY_GITHUB_WEBHOOK_URL || `${process.env.API_BASE_URL}/api/integration/github/webhook`
},

jira: {
/** Jira Integration Configuration */
appName: process.env.GAUZY_JIRA_APP_NAME,
appDescription: process.env.GAUZY_JIRA_APP_DESCRIPTION,
appKey: process.env.GAUZY_JIRA_APP_KEY,
baseUrl: process.env.GAUZY_JIRA_APP_BASE_URL,
vendorName: process.env.GAUZY_JIRA_APP_BASE_VENDOR_NAME,
vendorUrl: process.env.GAUZY_JIRA_APP_BASE_VENDOR_URL
},

fiverrConfig: {
clientId: process.env.FIVERR_CLIENT_ID,
clientSecret: process.env.FIVERR_CLIENT_SECRET
Expand Down
10 changes: 10 additions & 0 deletions packages/config/src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,16 @@ export const environment: IEnvironment = {
webhookUrl: process.env.GAUZY_GITHUB_WEBHOOK_URL || `${process.env.API_BASE_URL}/api/integration/github/webhook`
},

jira: {
/** Jira Integration Configuration */
appName: process.env.GAUZY_JIRA_APP_NAME,
appDescription: process.env.GAUZY_JIRA_APP_DESCRIPTION,
appKey: process.env.GAUZY_JIRA_APP_KEY,
baseUrl: process.env.GAUZY_JIRA_APP_BASE_URL,
vendorName: process.env.GAUZY_JIRA_APP_BASE_VENDOR_NAME,
vendorUrl: process.env.GAUZY_JIRA_APP_BASE_VENDOR_URL
},

fiverrConfig: {
clientId: process.env.FIVERR_CLIENT_ID,
clientSecret: process.env.FIVERR_CLIENT_SECRET
Expand Down
2 changes: 2 additions & 0 deletions packages/config/src/environments/ienvironment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
IUnleashConfig,
IUpworkConfig,
IWasabiConfig,
IJiraIntegrationConfig
} from '@gauzy/common';

export type LogLevel = 'debug' | 'info' | 'warn' | 'error';
Expand Down Expand Up @@ -97,6 +98,7 @@ export interface IEnvironment {
wasabiConfig?: IWasabiConfig;
cloudinaryConfig?: ICloudinaryConfig;
github: IGithubIntegrationConfig /** Github Configuration */;
jira: IJiraIntegrationConfig /** Jira Configuration */;
fiverrConfig: IFiverrConfig;
keycloakConfig: IKeycloakConfig;
auth0Config: IAuth0Config;
Expand Down
1 change: 1 addition & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"apollo-server-core": "^3.10.1",
"apollo-server-express": "^3.5.0",
"apollo-server-fastify": "^3.5.0",
"atlassian-connect-express": "^8.5.0",
"app-root-path": "^3.0.0",
"archiver": "^5.3.0",
"aws-sdk": "^2.1082.0",
Expand Down
Loading

0 comments on commit 1d02d49

Please sign in to comment.