Skip to content

Commit ad1d0ce

Browse files
authored
Upgrade Angular to v18 (#721)
* Angular CLI update for packages - @angular/cdk@*, @angular/cli@*, @angular/core@*, ng-mocks@*, @angular-builders/jest@* * Fix tests and replace deprecated HttpClientModule * Changelog and version * Update angular-svg-icon to v18
1 parent 7a44ae1 commit ad1d0ce

File tree

9 files changed

+16312
-13391
lines changed

9 files changed

+16312
-13391
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# 2.67.0 (2024-08-08)
2+
3+
### Improvements
4+
5+
- Upgrade to Angular 18
6+
17
# 2.66.4 (2024-07-19)
28

39
### Improvements

package-lock.json

+16,274-13,363
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+16-16
Original file line numberDiff line numberDiff line change
@@ -20,35 +20,35 @@
2020
},
2121
"private": true,
2222
"dependencies": {
23-
"@angular/animations": "^17.3.6",
24-
"@angular/cdk": "^17.3.6",
25-
"@angular/common": "^17.3.6",
26-
"@angular/compiler": "^17.3.6",
27-
"@angular/core": "^17.3.6",
28-
"@angular/forms": "^17.3.6",
29-
"@angular/platform-browser": "^17.3.6",
30-
"@angular/platform-browser-dynamic": "^17.3.6",
31-
"@angular/router": "^17.3.6",
23+
"@angular/animations": "^18.1.4",
24+
"@angular/cdk": "^18.1.4",
25+
"@angular/common": "^18.1.4",
26+
"@angular/compiler": "^18.1.4",
27+
"@angular/core": "^18.1.4",
28+
"@angular/forms": "^18.1.4",
29+
"@angular/platform-browser": "^18.1.4",
30+
"@angular/platform-browser-dynamic": "^18.1.4",
31+
"@angular/router": "^18.1.4",
3232
"@ng-web-apis/common": "^2.1.0",
33-
"angular-svg-icon": "^17.0.0",
33+
"angular-svg-icon": "^18.0.1",
3434
"date-fns": "^3.6.0",
3535
"rxjs": "^7.8.1",
3636
"tslib": "^2.4.0",
3737
"zone.js": "^0.14.2"
3838
},
3939
"devDependencies": {
40-
"@angular-builders/jest": "^17.0.3",
41-
"@angular-devkit/build-angular": "^17.3.6",
42-
"@angular/cli": "^17.3.6",
43-
"@angular/compiler-cli": "^17.3.6",
40+
"@angular-builders/jest": "^18.0.0",
41+
"@angular-devkit/build-angular": "^18.1.4",
42+
"@angular/cli": "^18.1.4",
43+
"@angular/compiler-cli": "^18.1.4",
4444
"@ngneat/spectator": "^18.0.1",
4545
"@types/jest": "^29.5.12",
4646
"@types/node": "^20.12.5",
4747
"angular-cli-ghpages": "^1.0.7",
4848
"husky": "^8.0.3",
4949
"jest": "^29.7.0",
50-
"ng-mocks": "^14.12.2",
51-
"ng-packagr": "^17.3.0",
50+
"ng-mocks": "^14.13.0",
51+
"ng-packagr": "^18.1.0",
5252
"prettier": "^3.2.5",
5353
"pretty-quick": "^4.0.0",
5454
"typescript": "^5.4.4"

projects/pastanaga-angular/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@guillotinaweb/pastanaga-angular",
33
"description": "Provides Pastanaga UI elements as Angular components",
4-
"version": "2.66.4",
4+
"version": "2.67.0",
55
"license": "MIT",
66
"keywords": [
77
"angular",

projects/pastanaga-angular/src/lib/controls/textfield/select/select-options/select-options.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@for (typedOption of typedOptions; track typedOption) {
1+
@for (typedOption of typedOptions; track typedOption.id) {
22
@if (typedOption.type === 'header' && !!typedOption.header) {
33
<pa-option-header>
44
{{ typedOption.header.label }}

projects/pastanaga-angular/src/lib/controls/textfield/select/select-options/select-options.component.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
22
import { OptionHeaderModel, OptionModel, OptionSeparator } from '../../../control.model';
33

4+
let optionId = 0;
5+
46
@Component({
57
selector: 'pa-select-options',
68
templateUrl: './select-options.component.html',
@@ -11,19 +13,20 @@ export class SelectOptionsComponent {
1113
this.typedOptions = (values || []).map((value) => {
1214
switch (value.type) {
1315
case 'header':
14-
return { type: 'header', header: value as OptionHeaderModel };
16+
return { id: optionId++, type: 'header', header: value as OptionHeaderModel };
1517
case 'option':
16-
return { type: 'option', option: value as OptionModel };
18+
return { id: optionId++, type: 'option', option: value as OptionModel };
1719
case 'separator':
18-
return { type: 'separator', separator: value as OptionSeparator };
20+
return { id: optionId++, type: 'separator', separator: value as OptionSeparator };
1921
default:
20-
return { type: 'null' };
22+
return { id: optionId++, type: 'null' };
2123
}
2224
});
2325
}
2426
@Output() optionSelected = new EventEmitter<OptionModel>();
2527

2628
typedOptions: {
29+
id: number;
2730
type: 'header' | 'separator' | 'option' | 'null';
2831
option?: OptionModel;
2932
header?: OptionHeaderModel;

projects/pastanaga-angular/src/lib/icon/icon.component.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
1+
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
22

33
import { IconComponent } from './icon.component';
44
import { By } from '@angular/platform-browser';
@@ -9,7 +9,7 @@ describe('IconComponent', () => {
99
let component: IconComponent;
1010
let fixture: ComponentFixture<IconComponent>;
1111

12-
beforeEach(async(() => {
12+
beforeEach(waitForAsync(() => {
1313
TestBed.configureTestingModule({
1414
providers: [
1515
{

projects/pastanaga-angular/src/lib/icon/icon.module.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ import { NgModule } from '@angular/core';
22
import { CommonModule } from '@angular/common';
33
import { IconComponent } from './icon.component';
44
import { AngularSvgIconModule } from 'angular-svg-icon';
5-
import { HttpClientModule } from '@angular/common/http';
5+
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
66

77
@NgModule({
8-
imports: [CommonModule, AngularSvgIconModule, HttpClientModule],
8+
imports: [CommonModule, AngularSvgIconModule],
99
declarations: [IconComponent],
1010
exports: [IconComponent],
11+
providers: [provideHttpClient(withInterceptorsFromDi())],
1112
})
1213
export class PaIconModule {}

projects/pastanaga-angular/src/lib/table/table.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
1+
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
22
import { Component, ViewChild } from '@angular/core';
33
import { By } from '@angular/platform-browser';
44
import { TableHeaderDirective } from './table.directives';
@@ -62,7 +62,7 @@ describe('Table', () => {
6262
let component: TestComponent;
6363
let fixture: ComponentFixture<TestComponent>;
6464

65-
beforeEach(async(() => {
65+
beforeEach(waitForAsync(() => {
6666
TestBed.configureTestingModule({
6767
imports: [MockModule(PaFocusableModule)],
6868
declarations: [

0 commit comments

Comments
 (0)