Skip to content

Commit

Permalink
Merge pull request #10299 from qmonmert/prettierappgenerated4
Browse files Browse the repository at this point in the history
Prettier: fix warnings on Angular generated app
  • Loading branch information
murdos authored Jul 16, 2024
2 parents 79e838b + ce0e860 commit 2938735
Show file tree
Hide file tree
Showing 15 changed files with 44 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class AngularOauth2ModuleFactory {
keycloak: {
url: 'http://localhost:9080',
realm: 'jhipster',
client_id: 'web_app'
client_id: 'web_app',
},
""";

Expand Down Expand Up @@ -58,7 +58,7 @@ public class AngularOauth2ModuleFactory {
private static final String TEST_IMPORTS =
"""
import { By } from '@angular/platform-browser';
import { Oauth2AuthService } from "./auth/oauth2-auth.service";
import { Oauth2AuthService } from './auth/oauth2-auth.service';
import LoginComponent from './login/login.component';
""";
private static final ElementReplacer TEST_NEEDLE = lineAfterRegex("^\\s+it\\('should have appName',[^}]+\\}\\);");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

.jhipster-logo {
display: block;
margin-left:auto;
margin-right:auto;
margin-left: auto;
margin-right: auto;
margin-top: 20px;
width: 250px;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,14 @@
<span class="space-separator" id="menu-space-separator"></span>
</mat-toolbar>

<img alt="JHipster logo" class="jhipster-logo" ngSrc="../../../../content/images/JHipster-Lite-neon-red.png" width="250" height="47" priority />
<img
alt="JHipster logo"
class="jhipster-logo"
ngSrc="../../../../content/images/JHipster-Lite-neon-red.png"
width="250"
height="47"
priority
/>

<router-outlet></router-outlet>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ describe('App Component', () => {
let comp: AppComponent;
let fixture: ComponentFixture<AppComponent>;
beforeEach(
waitForAsync(() => {
TestBed.configureTestingModule({
providers: [provideRouter([])],
}).compileComponents();
})
);
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
providers: [provideRouter([])],
}).compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(AppComponent);
Expand All @@ -29,5 +27,4 @@ describe('App Component', () => {
expect(comp.appName).toEqual('{{baseName}}');
});
});

});
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export const environment = {
production: true
production: true,
};
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export const environment = {
production: false
production: false,
};
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>JHipster Lite</title>
<base href="/" />
<meta name="description" content="JHipster Lite project" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons&display=swap" rel="stylesheet">
</head>
<link rel="preconnect" href="https://fonts.gstatic.com" />
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet" />
<link href="https://fonts.googleapis.com/icon?family=Material+Icons&display=swap" rel="stylesheet" />
</head>
<body class="mat-typography">
<jhi-root></jhi-root>
<jhi-root></jhi-root>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
/* You can add global styles to this file, and also import other style files */

html, body { height: 100%; }
body { margin: 0; font-family: Roboto, "Helvetica Neue", sans-serif; }
html,
body {
height: 100%;
}
body {
margin: 0;
font-family: Roboto, 'Helvetica Neue', sans-serif;
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Account } from './account.model';

describe('AccountModel', () => {
it('should initialize an account model', () => {
// GIVEN
const activated = true;
Expand All @@ -24,5 +23,4 @@ describe('AccountModel', () => {
expect(account.lastName).toBe(lastName);
expect(account.login).toBe(login);
});

});
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ export class Account {
public firstName: string | null,
public langKey: string,
public lastName: string | null,
public login: string
public login: string,
) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class AccountService {
tap((account: Account) => {
this.authenticate(account);
}),
shareReplay()
shareReplay(),
);
}
return this.accountCache$.pipe(catchError(() => of(null)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,7 @@ describe('Auth Interceptor', () => {
beforeEach(() => {
TestBed.configureTestingModule({
providers: [
provideHttpClient(
withInterceptors([authInterceptor])
),
provideHttpClientTesting(),
],
providers: [provideHttpClient(withInterceptors([authInterceptor])), provideHttpClientTesting()],
});

httpMock = TestBed.inject(HttpTestingController);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default class LoginComponent implements OnInit {
this.accountService
.getAuthenticationState()
.pipe(takeUntil(this.destroy$))
.subscribe(account => (this.account.set(account)));
.subscribe(account => this.account.set(account));
}

login(): void {
Expand All @@ -56,7 +56,7 @@ export default class LoginComponent implements OnInit {
password: this.loginForm.value.password!,
})
.subscribe({
error: (e) => this.updateErrorMessage(e)
error: e => this.updateErrorMessage(e),
});
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
export class Login {
constructor(public username: string | null, public password: string | null) {}
constructor(
public username: string | null,
public password: string | null,
) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private static JHipsterModuleAsserter assertAngularOAuthModule(ModuleFile angula
keycloak: {
url: 'http://localhost:9080',
realm: 'jhipster',
client_id: 'web_app'
client_id: 'web_app',
},
"""
)
Expand All @@ -72,7 +72,7 @@ private static JHipsterModuleAsserter assertAngularOAuthModule(ModuleFile angula
keycloak: {
url: 'http://localhost:9080',
realm: 'jhipster',
client_id: 'web_app'
client_id: 'web_app',
},
"""
)
Expand Down

0 comments on commit 2938735

Please sign in to comment.