Skip to content

Commit 3e0b9ff

Browse files
committed
fix tests
1 parent 3bcce42 commit 3e0b9ff

38 files changed

Lines changed: 9778 additions & 11536 deletions

File tree

.github/workflows/cloudfare.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
- name: Install Dependencies
4141
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
4242
run: |
43-
npm ci
43+
npm ci --legacy-peer-deps
4444
- name: Build
4545
run: |
4646
npm run webapp:build:prodcloudfare

.github/workflows/netlify.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
- name: Install Dependencies
4040
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
4141
run: |
42-
npm ci
42+
npm ci --legacy-peer-deps
4343
- name: Build
4444
run: |
4545
npm run webapp:build:prodnetlify

.github/workflows/node.js.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
- name: Install Dependencies
4040
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
4141
run: |
42-
npm ci
42+
npm ci --legacy-peer-deps
4343
# - name: Copy patch primeng
4444
# run: |
4545
# cp ./src/main/resources/primeng-galleria.mjs ./node_modules/primeng/fesm2022/primeng-galleria.mjs

package-lock.json

Lines changed: 9675 additions & 11456 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/webapp/app/account/password/password.component.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { AccountService } from 'app/core/auth/account.service';
1111
import { PasswordComponent } from './password.component';
1212
import { PasswordService } from './password.service';
1313
import { provideHttpClientTesting } from '@angular/common/http/testing';
14+
import { TranslateModule } from '@ngx-translate/core';
1415

1516
describe('PasswordComponent', () => {
1617
let comp: PasswordComponent;
@@ -19,7 +20,7 @@ describe('PasswordComponent', () => {
1920

2021
beforeEach(waitForAsync(() => {
2122
TestBed.configureTestingModule({
22-
imports: [ReactiveFormsModule, FormsModule, PasswordComponent],
23+
imports: [ReactiveFormsModule, FormsModule, PasswordComponent, TranslateModule.forRoot()],
2324
declarations: [],
2425
providers: [FormBuilder, AccountService, provideHttpClient(), provideHttpClientTesting()],
2526
})

src/main/webapp/app/account/password/password.component.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { Account } from 'app/core/auth/account.model';
77
import { PasswordService } from './password.service';
88
import { PasswordStrengthBarComponent } from './password-strength-bar/password-strength-bar.component';
99
import { AsyncPipe } from '@angular/common';
10-
import { TranslateDirective, TranslatePipe } from '@ngx-translate/core';
10+
import { TranslateDirective, TranslatePipe, TranslateService } from '@ngx-translate/core';
1111

1212
@Component({
1313
selector: 'jhi-password',
@@ -26,6 +26,7 @@ export class PasswordComponent implements OnInit {
2626
private passwordService: PasswordService,
2727
private accountService: AccountService,
2828
private fb: UntypedFormBuilder,
29+
private translateService: TranslateService,
2930
) {
3031
this.passwordForm = this.fb.group({
3132
currentPassword: ['', [Validators.required]],
@@ -36,6 +37,11 @@ export class PasswordComponent implements OnInit {
3637

3738
ngOnInit(): void {
3839
this.account$ = this.accountService.identity();
40+
this.account$.subscribe(account => {
41+
if (account?.langKey) {
42+
this.translateService.use(account.langKey);
43+
}
44+
});
3945
}
4046

4147
changePassword(): void {

src/main/webapp/app/account/register/register.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ describe('RegisterComponent', () => {
4545
[RegisterService, TranslateService],
4646
fakeAsync((service: RegisterService, mockTranslateService: TranslateService) => {
4747
jest.spyOn(service, 'save').mockReturnValue(of({}));
48-
mockTranslateService.currentLang = 'fr';
48+
mockTranslateService.use('fr');
4949
comp.registerForm.patchValue({
5050
password: 'password',
5151
confirmPassword: 'password',

src/main/webapp/app/account/settings/settings.component.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ export class SettingsComponent implements OnInit {
3535

3636
ngOnInit(): void {
3737
this.accountService.identity().subscribe(account => {
38+
if (account?.langKey) {
39+
this.translateService.use(account.langKey);
40+
}
41+
3842
if (account) {
3943
this.settingsForm.patchValue({
4044
firstName: account.firstName,

src/main/webapp/app/admin/user-management/list/user-management.component.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { AccountService } from 'app/core/auth/account.service';
1212

1313
import { UserManagementComponent } from './user-management.component';
1414
import { provideHttpClientTesting } from '@angular/common/http/testing';
15+
import { TranslateModule } from '@ngx-translate/core';
1516

1617
describe('User Management Component', () => {
1718
let comp: UserManagementComponent;
@@ -31,7 +32,7 @@ describe('User Management Component', () => {
3132

3233
beforeEach(waitForAsync(() => {
3334
TestBed.configureTestingModule({
34-
imports: [UserManagementComponent],
35+
imports: [UserManagementComponent, TranslateModule.forRoot()],
3536
declarations: [],
3637
providers: [
3738
provideHttpClient(),

src/main/webapp/app/admin/user-management/list/user-management.component.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { DatePipe } from '@angular/common';
1717
import { AlertComponent } from '../../../shared/alert/alert.component';
1818
import { AlertErrorComponent } from '../../../shared/alert/alert-error.component';
1919
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
20+
import { TranslateService } from '@ngx-translate/core';
2021

2122
@Component({
2223
selector: 'jhi-user-mgmt',
@@ -51,10 +52,16 @@ export class UserManagementComponent implements OnInit {
5152
private router: Router,
5253
private modalService: NgbModal,
5354
private zone: NgZone,
55+
private translateService: TranslateService,
5456
) {}
5557

5658
ngOnInit(): void {
57-
this.accountService.identity().subscribe(account => (this.currentAccount = account));
59+
this.accountService.identity().subscribe(account => {
60+
this.currentAccount = account;
61+
if (account?.langKey) {
62+
this.translateService.use(account.langKey);
63+
}
64+
});
5865
this.handleNavigation();
5966
}
6067

0 commit comments

Comments
 (0)