Skip to content

Commit be1d76f

Browse files
authored
[Angular] Remove CommonModule (#31623)
1 parent eec09c0 commit be1d76f

File tree

20 files changed

+40
-22
lines changed

20 files changed

+40
-22
lines changed

generators/angular/templates/src/main/webapp/app/account/sessions/sessions.ts.ejs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
limitations under the License.
1818
-%>
1919
import { Component, inject, OnInit } from '@angular/core';
20+
import { DatePipe } from '@angular/common';
2021

2122
import SharedModule from 'app/shared/shared.module';
2223
import { AccountService } from 'app/core/auth/account.service';
@@ -26,7 +27,7 @@ import { Account } from 'app/core/auth/account.model';
2627

2728
@Component({
2829
selector: '<%= jhiPrefixDashed %>-sessions',
29-
imports: [SharedModule],
30+
imports: [SharedModule, DatePipe],
3031
templateUrl: './sessions.html',
3132
})
3233
export default class Sessions implements OnInit {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
-%>
1919
import { Component, computed, inject, OnInit, signal } from '@angular/core';
2020
import { FormsModule } from '@angular/forms';
21+
import { KeyValuePipe, JsonPipe } from '@angular/common';
2122

2223
import SharedModule from 'app/shared/shared.module';
2324
import { SortDirective, SortByDirective, sortStateSignal, SortService } from 'app/shared/sort';
@@ -27,7 +28,7 @@ import { Bean, PropertySource } from './configuration.model';
2728
@Component({
2829
selector: '<%= jhiPrefixDashed %>-configuration',
2930
templateUrl: './configuration.html',
30-
imports: [SharedModule, FormsModule, SortDirective, SortByDirective],
31+
imports: [SharedModule, FormsModule, SortDirective, SortByDirective, KeyValuePipe, JsonPipe],
3132
})
3233
export default class Configuration implements OnInit {
3334
allBeans = signal<Bean[] | undefined>(undefined);

generators/angular/templates/src/main/webapp/app/admin/gateway/gateway.ts.ejs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
limitations under the License.
1818
-%>
1919
import { Component, inject, OnInit } from '@angular/core';
20+
import { KeyValuePipe } from '@angular/common';
2021

2122
import SharedModule from 'app/shared/shared.module';
2223
import { GatewayRoutesService } from './gateway-routes.service';
@@ -26,7 +27,7 @@ import { GatewayRoute } from './gateway-route.model';
2627
selector: '<%= jhiPrefixDashed %>-gateway',
2728
templateUrl: './gateway.html',
2829
providers: [GatewayRoutesService],
29-
imports: [SharedModule],
30+
imports: [SharedModule, KeyValuePipe],
3031
})
3132
export default class Gateway implements OnInit {
3233
gatewayRoutes: GatewayRoute[] = [];

generators/angular/templates/src/main/webapp/app/admin/health/health.ts.ejs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
-%>
1919
import { Component, inject, OnInit } from '@angular/core';
2020
import { HttpErrorResponse } from '@angular/common/http';
21+
import { KeyValuePipe, NgClass } from '@angular/common';
2122
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
2223

2324
import SharedModule from 'app/shared/shared.module';
@@ -28,7 +29,7 @@ import HealthModal from './modal/health-modal';
2829
@Component({
2930
selector: '<%= jhiPrefixDashed %>-health',
3031
templateUrl: './health.html',
31-
imports: [SharedModule],
32+
imports: [SharedModule, KeyValuePipe, NgClass],
3233
})
3334
export default class Health implements OnInit {
3435
health?: HealthModel;

generators/angular/templates/src/main/webapp/app/admin/health/modal/health-modal.ts.ejs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
limitations under the License.
1818
-%>
1919
import { Component, inject } from '@angular/core';
20+
import { KeyValuePipe } from '@angular/common';
2021
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
2122

2223
import SharedModule from 'app/shared/shared.module';
@@ -25,7 +26,7 @@ import { HealthKey, HealthDetails } from '../health.model';
2526
@Component({
2627
selector: '<%= jhiPrefixDashed %>-health-modal',
2728
templateUrl: './health-modal.html',
28-
imports: [SharedModule],
29+
imports: [SharedModule, KeyValuePipe],
2930
})
3031
export default class HealthModal {
3132
health?: { key: HealthKey; value: HealthDetails };

generators/angular/templates/src/main/webapp/app/admin/logs/logs.spec.ts.ejs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,11 @@ describe('Logs', () => {
3737
let service: LogsService;
3838

3939
beforeEach(
40-
() => {
41-
TestBed.configureTestingModule({
40+
async () => {
41+
await TestBed.configureTestingModule({
42+
imports: [Logs],
4243
providers: [provideHttpClient(), provideHttpClientTesting(), LogsService<%= applicationTypeGateway && gatewayServicesApiAvailable ? ', GatewayRoutesService' : '' %>],
43-
});
44+
}).compileComponents();
4445
}
4546
);
4647

generators/angular/templates/src/main/webapp/app/admin/logs/logs.ts.ejs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { finalize<%_ if (applicationTypeGateway && gatewayServicesApiAvailable)
2121

2222
import SharedModule from 'app/shared/shared.module';
2323
import { FormsModule } from '@angular/forms';
24+
import { SlicePipe, NgClass } from '@angular/common';
2425
import { SortDirective, SortByDirective, sortStateSignal, SortService } from 'app/shared/sort';
2526
import { Log, LoggersResponse, Level } from './log.model';
2627
import { LogsService } from './logs.service';
@@ -34,7 +35,7 @@ import { GatewayRoutesService } from '../gateway/gateway-routes.service';
3435
<%_ if (applicationTypeGateway && gatewayServicesApiAvailable) { _%>
3536
providers: [GatewayRoutesService],
3637
<%_ } _%>
37-
imports: [SharedModule, FormsModule, SortDirective, SortByDirective],
38+
imports: [SharedModule, FormsModule, SortDirective, SortByDirective, SlicePipe, NgClass],
3839
})
3940
export default class Logs implements OnInit {
4041
loggers = signal<Log[] | undefined>(undefined);

generators/angular/templates/src/main/webapp/app/admin/metrics/blocks/jvm-memory/jvm-memory.ts.ejs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,15 @@
1717
limitations under the License.
1818
-%>
1919
import { Component, input } from '@angular/core';
20+
import { KeyValuePipe, DecimalPipe } from '@angular/common';
2021

2122
import SharedModule from 'app/shared/shared.module';
2223
import { JvmMetrics } from 'app/admin/metrics/metrics.model';
2324

2425
@Component({
2526
selector: '<%= jhiPrefixDashed %>-jvm-memory',
2627
templateUrl: './jvm-memory.html',
27-
imports: [SharedModule],
28+
imports: [SharedModule, KeyValuePipe, DecimalPipe],
2829
})
2930
export class JvmMemory {
3031
/**

generators/angular/templates/src/main/webapp/app/admin/metrics/blocks/jvm-threads/jvm-threads.ts.ejs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
limitations under the License.
1818
-%>
1919
import { Component, inject, computed, input } from '@angular/core';
20+
import { DecimalPipe } from '@angular/common';
2021
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
2122

2223
import SharedModule from 'app/shared/shared.module';
@@ -26,7 +27,7 @@ import { MetricsModalThreads } from '../metrics-modal-threads/metrics-modal-thre
2627
@Component({
2728
selector: '<%= jhiPrefixDashed %>-jvm-threads',
2829
templateUrl: './jvm-threads.html',
29-
imports: [SharedModule],
30+
imports: [SharedModule, DecimalPipe],
3031
})
3132
export class JvmThreads {
3233
threads = input<Thread[] | undefined>();

generators/angular/templates/src/main/webapp/app/admin/metrics/blocks/metrics-cache/metrics-cache.ts.ejs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
limitations under the License.
1818
-%>
1919
import { ChangeDetectionStrategy, Component, input } from '@angular/core';
20+
import { KeyValuePipe, DecimalPipe } from '@angular/common';
2021

2122
import SharedModule from 'app/shared/shared.module';
2223
import { CacheMetrics } from 'app/admin/metrics/metrics.model';
@@ -26,7 +27,7 @@ import { filterNaN } from 'app/core/util/operators';
2627
selector: '<%= jhiPrefixDashed %>-metrics-cache',
2728
templateUrl: './metrics-cache.html',
2829
changeDetection: ChangeDetectionStrategy.OnPush,
29-
imports: [SharedModule],
30+
imports: [SharedModule, KeyValuePipe, DecimalPipe],
3031
})
3132
export class MetricsCache {
3233
/**

0 commit comments

Comments
 (0)