diff --git a/src/main/webapp/app/home/ci-cd/ci-cd.component.ts b/src/main/webapp/app/home/ci-cd/ci-cd.component.ts index dedf5994..d03dd046 100644 --- a/src/main/webapp/app/home/ci-cd/ci-cd.component.ts +++ b/src/main/webapp/app/home/ci-cd/ci-cd.component.ts @@ -52,14 +52,14 @@ export class CiCdComponent implements OnInit { ngOnInit(): void { this.gitConfig = this.gitConfigurationService.gitConfig; if (this.gitConfig) { - this.gitlabConfigured = this.gitConfig.gitlabConfigured || false; - this.githubConfigured = this.gitConfig.githubConfigured || false; + this.gitlabConfigured = this.gitConfig.gitlabConfigured ?? false; + this.githubConfigured = this.gitConfig.githubConfigured ?? false; } this.gitConfigurationService.sharedData.subscribe((gitConfig: GitConfigurationModel) => { this.gitConfig = gitConfig; - this.gitlabConfigured = gitConfig.gitlabConfigured || false; - this.githubConfigured = gitConfig.githubConfigured || false; + this.gitlabConfigured = gitConfig.gitlabConfigured ?? false; + this.githubConfigured = gitConfig.githubConfigured ?? false; }); } diff --git a/src/main/webapp/app/home/generator/generator.component.ts b/src/main/webapp/app/home/generator/generator.component.ts index d926ddc9..d2dbbd30 100644 --- a/src/main/webapp/app/home/generator/generator.component.ts +++ b/src/main/webapp/app/home/generator/generator.component.ts @@ -124,13 +124,13 @@ export class GeneratorComponent implements OnInit { this.languageOptions = GeneratorComponent.getAllSupportedLanguageOptions(); this.gitConfig = this.gitConfigurationService.gitConfig; if (this.gitConfig) { - this.gitlabConfigured = this.gitConfig.gitlabConfigured || false; - this.githubConfigured = this.gitConfig.githubConfigured || false; + this.gitlabConfigured = this.gitConfig.gitlabConfigured ?? false; + this.githubConfigured = this.gitConfig.githubConfigured ?? false; } this.gitConfigurationService.sharedData.subscribe((gitConfig: GitConfigurationModel) => { if (gitConfig) { - this.gitlabConfigured = gitConfig.gitlabConfigured || false; - this.githubConfigured = gitConfig.githubConfigured || false; + this.gitlabConfigured = gitConfig.gitlabConfigured ?? false; + this.githubConfigured = gitConfig.githubConfigured ?? false; } }); } @@ -273,8 +273,8 @@ export class GeneratorComponent implements OnInit { changeDatabaseType(): void { if (this.model.databaseType === 'sql') { - this.model.prodDatabaseType = AllProdDatabaseTypes.find(type => !this.isProdDatabaseOptionHidden('sql', type)) || 'mysql'; - this.model.devDatabaseType = AllDevDatabaseTypes.find(type => !this.isDevDatabaseOptionHidden('sql', type)) || 'h2Disk'; + this.model.prodDatabaseType = AllProdDatabaseTypes.find(type => !this.isProdDatabaseOptionHidden('sql', type)) ?? 'mysql'; + this.model.devDatabaseType = AllDevDatabaseTypes.find(type => !this.isDevDatabaseOptionHidden('sql', type)) ?? 'h2Disk'; this.model.cacheProvider = 'ehcache'; this.model.enableHibernateCache = true; } else if (this.model.databaseType === 'mongodb') { @@ -310,7 +310,7 @@ export class GeneratorComponent implements OnInit { if (this.model.databaseType === 'sql') { // Find first allowed dev database type - this.model.devDatabaseType = AllDevDatabaseTypes.find(type => !this.isDevDatabaseOptionHidden('sql', type)) || 'h2Disk'; + this.model.devDatabaseType = AllDevDatabaseTypes.find(type => !this.isDevDatabaseOptionHidden('sql', type)) ?? 'h2Disk'; } else if (this.model.prodDatabaseType === 'mongodb') { this.model.devDatabaseType = 'mongodb'; this.model.cacheProvider = 'no'; diff --git a/src/main/webapp/app/home/generator/jhipster.configuration.model.ts b/src/main/webapp/app/home/generator/jhipster.configuration.model.ts index 3871ed3a..b6042719 100644 --- a/src/main/webapp/app/home/generator/jhipster.configuration.model.ts +++ b/src/main/webapp/app/home/generator/jhipster.configuration.model.ts @@ -54,8 +54,8 @@ export class JHipsterConfigurationModel { constructor(data?: Partial) { if (data) { const dataCopy = { ...data }; - dataCopy.testFrameworks = [...(data.testFrameworks || [])]; - dataCopy.languages = [...(data.languages || [])]; + dataCopy.testFrameworks = [...(data.testFrameworks ?? [])]; + dataCopy.languages = [...(data.languages ?? [])]; Object.assign(this, data); } } diff --git a/src/main/webapp/app/home/git/git.component.ts b/src/main/webapp/app/home/git/git.component.ts index 0ed08720..48118165 100644 --- a/src/main/webapp/app/home/git/git.component.ts +++ b/src/main/webapp/app/home/git/git.component.ts @@ -36,12 +36,12 @@ export class GitComponent implements OnInit { } ngOnInit(): void { - this.gitlabConfigured = this.gitConfig.gitlabConfigured || false; - this.githubConfigured = this.gitConfig.githubConfigured || false; + this.gitlabConfigured = this.gitConfig.gitlabConfigured ?? false; + this.githubConfigured = this.gitConfig.githubConfigured ?? false; this.gitConfigurationService.sharedData.subscribe((gitConfig: GitConfigurationModel) => { this.gitConfig = gitConfig; - this.gitlabConfigured = gitConfig.gitlabConfigured || false; - this.githubConfigured = gitConfig.githubConfigured || false; + this.gitlabConfigured = gitConfig.gitlabConfigured ?? false; + this.githubConfigured = gitConfig.githubConfigured ?? false; }); this.gitConfig.availableGitProviders.forEach((provider: any) => { diff --git a/src/main/webapp/app/home/jdl-metadata/jdl-studio.component.ts b/src/main/webapp/app/home/jdl-metadata/jdl-studio.component.ts index 35d6a5cb..086eeba7 100644 --- a/src/main/webapp/app/home/jdl-metadata/jdl-studio.component.ts +++ b/src/main/webapp/app/home/jdl-metadata/jdl-studio.component.ts @@ -105,15 +105,15 @@ export class ApplyJdlStudioComponent implements OnInit, OnDestroy { private jdlService: JdlService ) { this.gitConfig = this.gitConfigurationService.gitConfig; - this.gitlabConfigured = this.gitConfig.gitlabConfigured || false; - this.githubConfigured = this.gitConfig.githubConfigured || false; + this.gitlabConfigured = this.gitConfig.gitlabConfigured ?? false; + this.githubConfigured = this.gitConfig.githubConfigured ?? false; } ngOnInit(): void { this.gitConfigurationService.sharedData.subscribe((gitConfig: GitConfigurationModel) => { this.gitConfig = gitConfig; - this.gitlabConfigured = gitConfig.gitlabConfigured || false; - this.githubConfigured = gitConfig.githubConfigured || false; + this.gitlabConfigured = gitConfig.gitlabConfigured ?? false; + this.githubConfigured = gitConfig.githubConfigured ?? false; }); this.subscription = this.route.params.subscribe(params => { diff --git a/src/main/webapp/app/shared/git-provider/git-provider.component.ts b/src/main/webapp/app/shared/git-provider/git-provider.component.ts index 305008c9..21485fbc 100644 --- a/src/main/webapp/app/shared/git-provider/git-provider.component.ts +++ b/src/main/webapp/app/shared/git-provider/git-provider.component.ts @@ -145,7 +145,7 @@ export class JhiGitProviderComponent implements OnInit { this.data.selectedGitProvider = 'GitHub'; } - this.refreshGitCompanyListByGitProvider(this.data.selectedGitProvider || ''); + this.refreshGitCompanyListByGitProvider(this.data.selectedGitProvider ?? ''); } refreshGitCompanyListByGitProvider(gitProvider: string): void { if (gitProvider.length === 0) { diff --git a/src/main/webapp/app/shared/model/yo-rc.model.ts b/src/main/webapp/app/shared/model/yo-rc.model.ts index 29a36e16..018dc89d 100644 --- a/src/main/webapp/app/shared/model/yo-rc.model.ts +++ b/src/main/webapp/app/shared/model/yo-rc.model.ts @@ -107,17 +107,17 @@ export class YoRC implements IYoRC { public hasCucumber?: boolean, public owner?: IGeneratorIdentity ) { - this.enableHibernateCache = this.enableHibernateCache || false; - this.websocket = this.websocket || false; - this.searchEngine = this.searchEngine || false; - this.messageBroker = this.messageBroker || false; - this.serviceDiscoveryType = this.serviceDiscoveryType || false; - this.enableSwaggerCodegen = this.enableSwaggerCodegen || false; - this.withAdminUi = this.withAdminUi || false; - this.useSass = this.useSass || false; - this.enableTranslation = this.enableTranslation || false; - this.hasProtractor = this.hasProtractor || false; - this.hasGatling = this.hasGatling || false; - this.hasCucumber = this.hasCucumber || false; + this.enableHibernateCache = this.enableHibernateCache ?? false; + this.websocket = this.websocket ?? false; + this.searchEngine = this.searchEngine ?? false; + this.messageBroker = this.messageBroker ?? false; + this.serviceDiscoveryType = this.serviceDiscoveryType ?? false; + this.enableSwaggerCodegen = this.enableSwaggerCodegen ?? false; + this.withAdminUi = this.withAdminUi ?? false; + this.useSass = this.useSass ?? false; + this.enableTranslation = this.enableTranslation ?? false; + this.hasProtractor = this.hasProtractor ?? false; + this.hasGatling = this.hasGatling ?? false; + this.hasCucumber = this.hasCucumber ?? false; } }