Skip to content

Commit fa96b13

Browse files
Merge pull request #14288 from qmonmert/fix/sonar-code-smell
Sonar: fix code smells
2 parents 82b7917 + d65511e commit fa96b13

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

generators/client/templates/angular/src/main/webapp/app/admin/configuration/configuration.component.ts.ejs

+3-1
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@ export class ConfigurationComponent implements OnInit {
4444
}
4545

4646
filterAndSortBeans(): void {
47+
const beansAscendingValue = this.beansAscending ? -1 : 1;
48+
const beansAscendingValueReverse = this.beansAscending ? 1 : -1;
4749
this.beans = this.allBeans
4850
.filter(bean => !this.beansFilter || bean.prefix.toLowerCase().includes(this.beansFilter.toLowerCase()))
49-
.sort((a, b) => (a.prefix < b.prefix ? (this.beansAscending ? -1 : 1) : this.beansAscending ? 1 : -1));
51+
.sort((a, b) => (a.prefix < b.prefix ? beansAscendingValue : beansAscendingValueReverse));
5052
}
5153
}

generators/client/templates/angular/src/main/webapp/app/layouts/navbar/navbar.component.ts.ejs

+4-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export class NavbarComponent implements OnInit {
4343
languages = LANGUAGES;
4444
<%_ } _%>
4545
openAPIEnabled?: boolean;
46-
version: string;
46+
version = '';
4747

4848
constructor(
4949
private loginService: LoginService,
@@ -55,7 +55,9 @@ export class NavbarComponent implements OnInit {
5555
private profileService: ProfileService,
5656
private router: Router
5757
) {
58-
this.version = VERSION ? (VERSION.toLowerCase().startsWith('v') ? VERSION : 'v' + VERSION) : '';
58+
if (VERSION) {
59+
this.version = VERSION.toLowerCase().startsWith('v') ? VERSION : 'v' + VERSION;
60+
}
5961
}
6062

6163
ngOnInit(): void {

0 commit comments

Comments
 (0)