Skip to content

Commit

Permalink
Merge pull request #26935 from mshima/prettier-templates
Browse files Browse the repository at this point in the history
apply prettier to templates
  • Loading branch information
DanielFran authored Aug 9, 2024
2 parents c5d22fb + b1d3b9e commit ecad4e7
Show file tree
Hide file tree
Showing 12 changed files with 69 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ export class GatewayRoute {
constructor(
public path: string,
public serviceId: string,
public serviceInstances: any[]
public serviceInstances: any[],
) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<h2>
<span id="gateway-page-heading">__jhiTranslateTag__('gateway.title')</span>

<button class="btn btn-primary float-end" (click)="refresh()" (disabled)="updatingRoutes">
<button class="btn btn-primary float-end" (click)="refresh()" (disabled)="(updatingRoutes)">
<fa-icon icon="sync"></fa-icon> <span>__jhiTranslateTag__('gateway.refresh.button')</span>
</button>
</h2>
Expand All @@ -37,46 +37,50 @@
</tr>
</thead>
<tbody>
@for (route of gatewayRoutes; track route.path) {
<tr>
<td>{{ route.path }}</td>
<td>{{ route.serviceId }}</td>
<td>
@if (route.serviceInstances.length === 0) {
<div class="label label-danger">__jhiTranslateTag__('gateway.routes.error')</div>
}

<div class="table-responsive">
@if (route) {
<table class="table table-striped">
@for (instance of route.serviceInstances; track instance.uri) {
<tr>
<td><a href="{{ instance.uri }}" target="_blank">{{ instance.uri }}</a></td>
<td>
@if (instance.instanceInfo) {
<div class="badge bg-{{ instance.instanceInfo.status === 'UP' ? 'success' : 'danger' }}">{{ instance.instanceInfo.status }}</div>
} @else {
<div class="badge bg-warning">?</div>
}
</td>
<td>
@for (entry of (instance.metadata | keyvalue ); track entry.key) {
<span>
<span class="badge bg-default fw-normal">
<span class="badge rounded-pill bg-info fw-normal">{{ entry.key }}</span>
<span class="text-secondary">{{ entry.value }}</span>
</span>
</span>
}
</td>
</tr>
@for (route of gatewayRoutes; track route.path) {
<tr>
<td>{{ route.path }}</td>
<td>{{ route.serviceId }}</td>
<td>
@if (route.serviceInstances.length === 0) {
<div class="label label-danger">__jhiTranslateTag__('gateway.routes.error')</div>
}
</table>
}
</div>
</td>
</tr>
}

<div class="table-responsive">
@if (route) {
<table class="table table-striped">
@for (instance of route.serviceInstances; track instance.uri) {
<tr>
<td>
<a href="{{ instance.uri }}" target="_blank">{{ instance.uri }}</a>
</td>
<td>
@if (instance.instanceInfo) {
<div class="badge bg-{{ instance.instanceInfo.status === 'UP' ? 'success' : 'danger' }}">
{{ instance.instanceInfo.status }}
</div>
} @else {
<div class="badge bg-warning">?</div>
}
</td>
<td>
@for (entry of instance.metadata | keyvalue; track entry.key) {
<span>
<span class="badge bg-default fw-normal">
<span class="badge rounded-pill bg-info fw-normal">{{ entry.key }}</span>
<span class="text-secondary">{{ entry.value }}</span>
</span>
</span>
}
</td>
</tr>
}
</table>
}
</div>
</td>
</tr>
}
</tbody>
</table>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default class GatewayComponent implements OnInit {
) {
serviceInstance.instanceInfo = { status: 'UP' };
} else {
serviceInstance.instanceInfo = { status: 'DOWN'} ;
serviceInstance.instanceInfo = { status: 'DOWN' };
}
}
return serviceInstance as object;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ function lazyTranslatePartialLoader(http: HttpClient): TranslateLoader {
TranslateModule.forChild({
loader: {
provide: TranslateLoader,
useFactory: (lazyTranslatePartialLoader),
deps: [HttpClient]
useFactory: lazyTranslatePartialLoader,
deps: [HttpClient],
},
isolate: false,
extend: true,
Expand Down
6 changes: 3 additions & 3 deletions generators/angular/templates/webpack/webpack.custom.js.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ module.exports = async (config, options, targetOptions) => {
changeOrigin: false, //pass the Host header to the backend unchanged https://github.com/Browsersync/browser-sync/issues/430
},
proxyReq: [
function(proxyReq) {
function (proxyReq) {
// URI that will be retrieved by the ForwardedHeaderFilter on the server side
proxyReq.setHeader('X-Forwarded-Host', 'localhost:9000');
proxyReq.setHeader('X-Forwarded-Proto', 'https');
}
]
},
],
},
socket: {
clients: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const headerToString = (headerValue: any): string => {
throw new Error('Header value is not a string');
}
return headerValue;
}
};

const decodeHeaderValue = (headerValue: string): string => decodeURIComponent(headerValue.replace(/\+/g, ' '));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export type ProblemDetails = {
detail: string;
/** A URI reference that identifies the specific occurrence of the problem */
instance: string;
}
};

export const ProblemWithMessageType = 'https://www.jhipster.tech/problem/problem-with-message';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import java.util.Comparator;

public class AssertUtils {

public static Comparator<ZonedDateTime> zonedDataTimeSameInstant = Comparator.nullsFirst(
(e1, a2) -> e1.withZoneSameInstant(ZoneOffset.UTC).compareTo(a2.withZoneSameInstant(ZoneOffset.UTC))
public static Comparator<ZonedDateTime> zonedDataTimeSameInstant = Comparator.nullsFirst((e1, a2) ->
e1.withZoneSameInstant(ZoneOffset.UTC).compareTo(a2.withZoneSameInstant(ZoneOffset.UTC))
);

public static Comparator<BigDecimal> bigDecimalCompareTo = Comparator.nullsFirst((e1, a2) -> e1.compareTo(a2));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -917,14 +917,11 @@ public class UserService {
}
if (idpModifiedDate.isAfter(dbModifiedDate)) {
LOG.debug("Updating user '{}' in local database", user.getLogin());
return updateUser(user.getFirstName(), user.getLastName(), user.getEmail(),
user.getLangKey(), user.getImageUrl());
return updateUser(user.getFirstName(), user.getLastName(), user.getEmail(), user.getLangKey(), user.getImageUrl());
}
// no last updated info, blindly update
} else {
LOG.debug("Updating user '{}' in local database", user.getLogin());
return updateUser(user.getFirstName(), user.getLastName(), user.getEmail(),
user.getLangKey(), user.getImageUrl());
return updateUser(user.getFirstName(), user.getLastName(), user.getEmail(), user.getLangKey(), user.getImageUrl());
}
return Mono.empty();
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,10 @@ public class AuthenticateController {
@PostMapping("/authenticate")
public Mono<ResponseEntity<JWTToken>> authorize(@Valid @RequestBody Mono<LoginVM> loginVM) {
return loginVM
.flatMap(
login ->
authenticationManager
.authenticate(new UsernamePasswordAuthenticationToken(login.getUsername(), login.getPassword()))
.flatMap(auth -> Mono.fromCallable(() -> this.createToken(auth, login.isRememberMe())))
.flatMap(login ->
authenticationManager
.authenticate(new UsernamePasswordAuthenticationToken(login.getUsername(), login.getPassword()))
.flatMap(auth -> Mono.fromCallable(() -> this.createToken(auth, login.isRememberMe())))
)
.map(jwt -> {
HttpHeaders httpHeaders = new HttpHeaders();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,11 @@ class UserServiceIT {

private OAuth2AuthenticationToken createMockOAuth2AuthenticationToken(Map<String, Object> userDetails) {
Collection<GrantedAuthority> authorities = Collections.singletonList(new SimpleGrantedAuthority(AuthoritiesConstants.ANONYMOUS));
UsernamePasswordAuthenticationToken usernamePasswordAuthenticationToken = new UsernamePasswordAuthenticationToken("anonymous", "anonymous", authorities);
UsernamePasswordAuthenticationToken usernamePasswordAuthenticationToken = new UsernamePasswordAuthenticationToken(
"anonymous",
"anonymous",
authorities
);
usernamePasswordAuthenticationToken.setDetails(userDetails);
OAuth2User user = new DefaultOAuth2User(authorities, userDetails, "sub");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,9 @@ public class CacheConfiguration {
LOG.debug("Configuring Hazelcast clustering for instanceId: {}", serviceId);
// In development, everything goes through 127.0.0.1, with a different port
if (env.acceptsProfiles(Profiles.of(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT))) {
LOG.debug("Application is running with the \"dev\" profile, Hazelcast " +
"cluster will only work with localhost instances");
LOG.debug(
"Application is running with the \"dev\" profile, Hazelcast " + "cluster will only work with localhost instances"
);

config.getNetworkConfig().setPort(serverProperties.getPort() + 5701);
config.getNetworkConfig().getJoin().getTcpIpConfig().setEnabled(true);
Expand Down

0 comments on commit ecad4e7

Please sign in to comment.