Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: update angular version #306

Merged
merged 31 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
21de5e4
feat: update to version 16, tests need to be fixed
Jul 3, 2024
94118b4
feat: update to version 17, tests still need to be fixed
Jul 3, 2024
5421060
feat: update to version 18, need to fix tests still
Jul 3, 2024
bd3e39c
feat: update packages to latest except for esbuild, eslint and typesc…
Jul 3, 2024
eabe2db
fix: some tests fixed
Jul 4, 2024
1c75f6f
fix: fixing tests in progress
Jul 4, 2024
5c97f94
fix: continue fixing tests, still one compiler issue remaining regard…
Jul 5, 2024
2000fe1
fix: narrowed down cause of error TypeError: Cannot read properties o…
Jul 8, 2024
cd0469c
fix: test regarding TypeError: Cannot read properties ff null (readin…
Jul 10, 2024
0ac6b47
fix: test fixes
Jul 11, 2024
e1911a9
fix: merge and fix test by updating poly-fill to latest
Jul 15, 2024
7296687
Merge branch 'main' into feat/update-angular-version
Jul 15, 2024
5fc4f20
fix: generate lock file again
Jul 15, 2024
d694bfc
fix: cleanup
Jul 15, 2024
0021482
fix: lint issues fixed
Jul 15, 2024
6280c21
fix lint issues in pipeline
Jul 15, 2024
813f9ae
fix: lint
Jul 15, 2024
3b7769f
fix: minor fixes
Jul 15, 2024
4e026c3
fix: peerDependencies and primeng selectButton template
Jul 17, 2024
b32cb33
Merge branch 'main' into feat/update-angular-version
Jul 17, 2024
0138b50
fix: storybook pipeline and minor fixes
Jul 17, 2024
51aff85
Merge branch 'main' into feat/update-angular-version
Jul 17, 2024
615ef1c
fix: lint issue
Jul 17, 2024
546854b
fix: storybook pipeline
Jul 17, 2024
2abbecc
fix: build pipeline missing properties
Jul 17, 2024
40d96b3
Merge branch 'main' into feat/update-angular-version
Jul 18, 2024
43ace64
fix: changing version back to 4.42.1
Jul 18, 2024
c904edf
fix: versioning and setting private porperty back to true
Jul 18, 2024
018438d
fix: improve portal message service, using appstateservice mock
Jul 18, 2024
f56514a
Merge branch 'main' into feat/update-angular-version
Jul 18, 2024
d06b769
fix: lint pipeline
Jul 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions libs/angular-accelerator/ng-package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../../dist/libs/angular-accelerator",
"lib": {
"entryFile": "src/index.ts"
},
"assets": ["./assets/**"]
}

"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../../dist/libs/angular-accelerator",
"lib": {
"entryFile": "src/index.ts"
},
"assets": [
"./assets/**"
]
}
21 changes: 15 additions & 6 deletions libs/angular-accelerator/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"outputs": [
"{workspaceRoot}/coverage/{projectRoot}"
],
"options": {
"jestConfig": "libs/angular-accelerator/jest.config.ts",
"passWithNoTests": true
Expand All @@ -40,9 +42,15 @@
},
"lint": {
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"outputs": [
"{options.outputFile}"
],
"options": {
"lintFilePatterns": ["libs/angular-accelerator/**/*.ts", "libs/angular-accelerator/**/*.html", "libx/angular-accelerator/package.json"]
"lintFilePatterns": [
"libs/angular-accelerator/**/*.ts",
"libs/angular-accelerator/**/*.html",
"libx/angular-accelerator/package.json"
]
}
},
"release": {
Expand Down Expand Up @@ -73,7 +81,9 @@
},
"build-storybook": {
"executor": "@storybook/angular:build-storybook",
"outputs": ["{options.outputDir}"],
"outputs": [
"{options.outputDir}"
],
"options": {
"outputDir": "dist/storybook/angular-accelerator",
"configDir": "libs/angular-accelerator/.storybook",
Expand All @@ -85,7 +95,6 @@
"libs/angular-accelerator/assets/styles.scss",
"libs/angular-accelerator/.storybook/storybook.css"
]

},
"configurations": {
"ci": {
Expand All @@ -94,4 +103,4 @@
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'
import { ComponentFixture, TestBed } from '@angular/core/testing'
import { HttpClientTestingModule } from '@angular/common/http/testing'
import { provideHttpClientTesting } from '@angular/common/http/testing'
import { ActivatedRoute, RouterModule } from '@angular/router'
import { NoopAnimationsModule } from '@angular/platform-browser/animations'
import { TranslateTestingModule } from 'ngx-translate-testing'
Expand All @@ -15,6 +15,7 @@ import { DataListGridComponent } from '../data-list-grid/data-list-grid.componen
import { DataTableComponent } from '../data-table/data-table.component'
import { ColumnType } from '../../model/column-type.model'
import { AngularAcceleratorModule } from '../../angular-accelerator.module'
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';

describe('DataViewComponent', () => {
let component: DataViewComponent
Expand Down Expand Up @@ -193,30 +194,29 @@ describe('DataViewComponent', () => {

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [DataViewComponent, DataListGridComponent, DataTableComponent],
imports: [
DataViewModule,
declarations: [DataViewComponent, DataListGridComponent, DataTableComponent],
imports: [DataViewModule,
MockAuthModule,
TranslateTestingModule.withTranslations(TRANSLATIONS),
HttpClientTestingModule,
AngularAcceleratorModule,
RouterModule,
NoopAnimationsModule,
],
providers: [
NoopAnimationsModule],
providers: [
{ provide: UserService, useClass: MockUserService },
{
provide: ActivatedRoute,
useValue: {
snapshot: {
paramMap: {
get: () => '1',
},
provide: ActivatedRoute,
useValue: {
snapshot: {
paramMap: {
get: () => '1',
},
},
},
},
},
],
}).compileComponents()
provideHttpClient(withInterceptorsFromDi()),
provideHttpClientTesting(),
]
}).compileComponents()

fixture = TestBed.createComponent(DataViewComponent)
component = fixture.componentInstance
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { HttpClientTestingModule } from '@angular/common/http/testing'
import { provideHttpClientTesting } from '@angular/common/http/testing'
import { ComponentFixture, TestBed } from '@angular/core/testing'
import { NoopAnimationsModule } from '@angular/platform-browser/animations'
import { FormsModule } from '@angular/forms'
Expand All @@ -12,6 +12,7 @@ import { SelectButtonModule } from 'primeng/selectbutton'
import { DiagramHarness, TestbedHarnessEnvironment } from '../../../../testing'
import { DiagramType } from '../../model/diagram-type'
import { DiagramComponent, DiagramLayouts } from './diagram.component'
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';

describe('DiagramComponent', () => {
let translateService: TranslateService
Expand All @@ -34,20 +35,18 @@ describe('DiagramComponent', () => {

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [DiagramComponent],
imports: [
NoopAnimationsModule,
declarations: [DiagramComponent],
imports: [NoopAnimationsModule,
ChartModule,
MessageModule,
SelectButtonModule,
FormsModule,
TranslateTestingModule.withTranslations({
en: require('./../../../../assets/i18n/en.json'),
de: require('./../../../../assets/i18n/de.json'),
}),
HttpClientTestingModule,
],
}).compileComponents()
en: require('./../../../../assets/i18n/en.json'),
de: require('./../../../../assets/i18n/de.json'),
})],
providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()]
}).compileComponents()

fixture = TestBed.createComponent(DiagramComponent)
component = fixture.componentInstance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ export class DiagramComponent implements OnInit, OnChanges {
@Input() sumKey = 'OCX_DIAGRAM.SUM'
private _diagramType: DiagramType = DiagramType.PIE
selectedDiagramType: DiagramLayouts | undefined
public chartType = 'pie'
public chartType: 'bar' | 'line' | 'scatter' | 'bubble' | 'pie' | 'doughnut' | 'polarArea' | 'radar' | undefined =
'pie'
@Input()
get diagramType(): DiagramType {
return this._diagramType
Expand Down Expand Up @@ -118,7 +119,9 @@ export class DiagramComponent implements OnInit, OnChanges {
}
}

private diagramTypeToChartType(value: DiagramType): string {
private diagramTypeToChartType(
value: DiagramType
): 'bar' | 'line' | 'scatter' | 'bubble' | 'pie' | 'doughnut' | 'polarArea' | 'radar' | undefined {
if (value === DiagramType.PIE) return 'pie'
else if (value === DiagramType.HORIZONTAL_BAR || value === DiagramType.VERTICAL_BAR) return 'bar'
return 'pie'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { HarnessLoader } from '@angular/cdk/testing'
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'
import { HttpClientTestingModule } from '@angular/common/http/testing'
import { provideHttpClientTesting } from '@angular/common/http/testing'
import { ComponentFixture, TestBed } from '@angular/core/testing'
import { TranslateService } from '@ngx-translate/core'
import 'jest-canvas-mock'
Expand All @@ -13,6 +13,7 @@ import { ColumnType } from '../../model/column-type.model'
import { DiagramComponent } from '../diagram/diagram.component'
import { GroupByCountDiagramComponent } from './group-by-count-diagram.component'
import { DiagramType } from '../../model/diagram-type'
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';

describe('GroupByCountDiagramComponent', () => {
let translateService: TranslateService
Expand Down Expand Up @@ -147,17 +148,15 @@ describe('GroupByCountDiagramComponent', () => {

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [GroupByCountDiagramComponent, DiagramComponent],
imports: [
ChartModule,
declarations: [GroupByCountDiagramComponent, DiagramComponent],
imports: [ChartModule,
MessageModule,
TranslateTestingModule.withTranslations({
en: require('./../../../../assets/i18n/en.json'),
de: require('./../../../../assets/i18n/de.json'),
}),
HttpClientTestingModule,
],
}).compileComponents()
en: require('./../../../../assets/i18n/en.json'),
de: require('./../../../../assets/i18n/de.json'),
})],
providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()]
}).compileComponents()

fixture = TestBed.createComponent(GroupByCountDiagramComponent)
component = fixture.componentInstance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { HarnessLoader, parallel, TestElement } from '@angular/cdk/testing'
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'
import { RouterTestingModule } from '@angular/router/testing'
import { NoopAnimationsModule } from '@angular/platform-browser/animations'
import { HttpClientModule } from '@angular/common/http'
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'
import { TranslateModule } from '@ngx-translate/core'
import { TranslateTestingModule } from 'ngx-translate-testing'
import { ButtonModule } from 'primeng/button'
Expand Down Expand Up @@ -213,29 +213,26 @@ describe('InteractiveDataViewComponent', () => {

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [
declarations: [
InteractiveDataViewComponent,
DataLayoutSelectionComponent,
DataViewComponent,
ColumnGroupSelectionComponent,
CustomGroupColumnSelectorComponent,
],
imports: [
TranslateModule.forRoot(),
],
imports: [TranslateModule.forRoot(),
ButtonModule,
DialogModule,
PickListModule,
AngularAcceleratorModule,
RouterTestingModule,
NoopAnimationsModule,
TranslateTestingModule.withTranslations({
en: require('./../../../../assets/i18n/en.json'),
de: require('./../../../../assets/i18n/de.json'),
}),
HttpClientModule,
],
providers: [{ provide: UserService, useClass: MockUserService }],
}).compileComponents()
en: require('./../../../../assets/i18n/en.json'),
de: require('./../../../../assets/i18n/de.json'),
})],
providers: [{ provide: UserService, useClass: MockUserService }, provideHttpClient(withInterceptorsFromDi())]
}).compileComponents()

fixture = TestBed.createComponent(InteractiveDataViewComponent)
component = fixture.componentInstance
Expand Down Expand Up @@ -1587,7 +1584,7 @@ describe('InteractiveDataViewComponent', () => {
})
})

describe('Disable grid action buttons based on field path', () => {
fdescribe('Disable grid action buttons based on field path', () => {
it('should not disable any buttons initially', async () => {
setUpMockData('grid')
const dataView = await (await interactiveDataViewHarness.getDataView()).getDataListGrid()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ComponentFixture, TestBed, getTestBed } from '@angular/core/testing'
import { NoopAnimationsModule } from '@angular/platform-browser/animations'
import { RouterTestingModule } from '@angular/router/testing'
import { HttpClientTestingModule } from '@angular/common/http/testing'
import { provideHttpClientTesting } from '@angular/common/http/testing'
import { TranslateTestingModule } from 'ngx-translate-testing'
import { PrimeIcons } from 'primeng/api'
import { BreadcrumbModule } from 'primeng/breadcrumb'
Expand All @@ -13,6 +13,7 @@ import { MockUserService } from '@onecx/angular-integration-interface/mocks'
import { PageHeaderHarness, TestbedHarnessEnvironment } from '../../../../testing'
import { Action, ObjectDetailItem, PageHeaderComponent } from './page-header.component'
import { DynamicPipe } from '../../pipes/dynamic.pipe'
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';

const mockActions: Action[] = [
{
Expand Down Expand Up @@ -72,21 +73,18 @@ describe('PageHeaderComponent', () => {

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [PageHeaderComponent, PageHeaderComponent, DynamicPipe],
imports: [
RouterTestingModule,
HttpClientTestingModule,
declarations: [PageHeaderComponent, PageHeaderComponent, DynamicPipe],
imports: [RouterTestingModule,
TranslateTestingModule.withTranslations({
en: require('./../../../../assets/i18n/en.json'),
de: require('./../../../../assets/i18n/de.json'),
en: require('./../../../../assets/i18n/en.json'),
de: require('./../../../../assets/i18n/de.json'),
}),
BreadcrumbModule,
MenuModule,
ButtonModule,
NoopAnimationsModule,
],
providers: [AppStateService, { provide: UserService, useClass: MockUserService }],
}).compileComponents()
NoopAnimationsModule],
providers: [AppStateService, { provide: UserService, useClass: MockUserService }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()]
}).compileComponents()

const appStateService = getTestBed().inject(AppStateService)
await appStateService.currentPortal$.publish({
Expand Down
Loading