Skip to content

Commit

Permalink
(chore) : Bump Angular to v18
Browse files Browse the repository at this point in the history
  • Loading branch information
donaldkibet committed Jan 9, 2025
1 parent b9b5073 commit 6187fe1
Show file tree
Hide file tree
Showing 10 changed files with 2,715 additions and 3,603 deletions.
40 changes: 20 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@
"@carbon/styles": "1.x"
},
"dependencies": {
"@angular-devkit/core": "^17.3.8",
"@angular-devkit/core": "^18.2.12",
"@angular-extensions/elements": "^17.1.1",
"@angular/animations": "^17.3.12",
"@angular/animations": "^18.2.13",
"@angular/cdk": "^17.3.10",
"@angular/common": "^17.3.12",
"@angular/compiler": "^17.3.12",
"@angular/core": "^17.3.12",
"@angular/forms": "^17.3.12",
"@angular/platform-browser": "^17.3.12",
"@angular/platform-browser-dynamic": "^17.3.12",
"@angular/router": "^17.3.12",
"@angular/common": "^18.2.13",
"@angular/compiler": "^18.2.13",
"@angular/core": "^18.2.13",
"@angular/forms": "^18.2.13",
"@angular/platform-browser": "^18.2.13",
"@angular/platform-browser-dynamic": "^18.2.13",
"@angular/router": "^18.2.13",
"@carbon/styles": "1.x",
"@ng-select/ng-select": "^12.0.7",
"@ngx-translate/core": "^15.0.0",
Expand All @@ -48,19 +48,19 @@
"time-ago-pipe": "^1.3.2",
"tree-model": "^1.0.7",
"tslib": "^2.0.0",
"zone.js": "~0.14.8"
"zone.js": "~0.14.10"
},
"devDependencies": {
"@angular-devkit/build-angular": "^17.3.8",
"@angular-eslint/builder": "^17.3.12",
"@angular-eslint/eslint-plugin": "^17.3.12",
"@angular-eslint/eslint-plugin-template": "^17.3.12",
"@angular-devkit/build-angular": "^18.2.12",
"@angular-eslint/builder": "^19.0.2",
"@angular-eslint/eslint-plugin": "^19.0.2",
"@angular-eslint/eslint-plugin-template": "^19.0.2",
"@angular-eslint/schematics": "^19.0.2",
"@angular-eslint/template-parser": "^17.3.12",
"@angular/cli": "^17.3.8",
"@angular/compiler-cli": "^17.3.12",
"@angular/language-service": "^17.3.12",
"@angular/material": "^17.3.10",
"@angular-eslint/template-parser": "^19.0.2",
"@angular/cli": "^18.2.12",
"@angular/compiler-cli": "^18.2.13",
"@angular/language-service": "^18.2.13",
"@angular/material": "18",
"@types/jasmine": "~3.6.11",
"@types/jasminewd2": "~2.0.11",
"@types/node": "^12.20.55",
Expand All @@ -78,7 +78,7 @@
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "^2.1.0",
"lint-staged": "^15.2.2",
"ng-packagr": "^17.3.0",
"ng-packagr": "^18.2.1",
"prettier": "2.1.2",
"protractor": "~7.0.0",
"sass": "^1.68.0",
Expand Down
12 changes: 6 additions & 6 deletions projects/ngx-formentry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"version": "17.0.0",
"dependencies": {},
"peerDependencies": {
"@angular/animations": "^17.3.12",
"@angular/animations": "^18.2.13",
"@angular/cdk": "^17.3.10",
"@angular/common": "^17.3.12",
"@angular/compiler": "^17.3.12",
"@angular/compiler-cli": "^17.3.12",
"@angular/core": "^17.3.12",
"@angular/forms": "^17.3.12",
"@angular/common": "^18.2.13",
"@angular/compiler": "^18.2.13",
"@angular/compiler-cli": "^18.2.13",
"@angular/core": "^18.2.13",
"@angular/forms": "^18.2.13",
"@carbon/styles": "1.x",
"@ng-select/ng-select": "^12.0.7",
"@ngx-translate/core": "^15.0.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
import { NgModule } from '@angular/core';
import { HttpClientModule } from '@angular/common/http';
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
import { BrowserModule } from '@angular/platform-browser';
import { ReactiveFormsModule } from '@angular/forms';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { FormEntryModule } from '../../form-entry/form-entry.module';
import { SampleFormComponent } from './sample-form.component';

@NgModule({
declarations: [SampleFormComponent],
imports: [
BrowserModule,
BrowserAnimationsModule,
FormEntryModule,
HttpClientModule,
ReactiveFormsModule
],
providers: [],
bootstrap: [SampleFormComponent]
})
@NgModule({ declarations: [SampleFormComponent],
bootstrap: [SampleFormComponent], imports: [BrowserModule,
BrowserAnimationsModule,
FormEntryModule,
ReactiveFormsModule], providers: [provideHttpClient(withInterceptorsFromDi())] })
export class SampleModule {}
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<lib-ngx-file-uploader
[srcUrl]="pdfUrl"
[formEntry]="formEntryMode"
[(ngModel)]="fileUuid"
[ngModel]="fileUuid"
(ngModelChange)="fileUuid = $event"
(_onClear)="clearValue()"
(uploadData)="onFileChange($event)"
>
Expand All @@ -10,7 +11,7 @@
<img
*ngIf="!pdfUploaded"
class="img-responsive"
[src]="fileUuid | secure: this.dataSource.fetchFile"
[src]="fileUuid | secure: dataSource.fetchFile"
alt=""
/>
</div>
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import {
async,
ComponentFixture,
TestBed,
waitForAsync
} from '@angular/core/testing';
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
import { OwlDateTimeIntl } from './date-time-picker-intl.service';
import { OwlNativeDateTimeModule } from './adapter/native-date-time.module';
import { OwlDateTimeModule } from './date-time.module';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<ng-select
[ngClass]="{
'afe-custom': theme === 'light',
'invalid': invalid ? true : null,
}"
'afe-custom': theme === 'light',
'invalid': invalid ?? false
}"
[disabled]="disabled"
[items]="remoteOptions$ | async"
bindLabel="label"
Expand All @@ -12,10 +12,10 @@
[compareWith]="compareItems"
[trackByFn]="trackByFn"
[loading]="loading"
typeToSearchText="{{ 'enterMoreCharacters' | translate }}"
[typeToSearchText]="'enterMoreCharacters' | translate"
[typeahead]="remoteOptionInput$"
[(ngModel)]="selectedRemoteOptions"
[ngModel]="selectedRemoteOptions"
(ngModelChange)="selectedRemoteOptions = $event; selected($event)"
[appendTo]="'form'"
(ngModelChange)="selected($event)"
>
</ng-select>
15 changes: 7 additions & 8 deletions src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import { BrowserModule } from '@angular/platform-browser';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { DebugElement } from '@angular/core';
import { FormEntryModule } from 'projects/ngx-formentry/src/public_api';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { provideHttpClientTesting } from '@angular/common/http/testing';
import { ReactiveFormsModule } from '@angular/forms';
import { TranslateModule } from '@ngx-translate/core';
import { AppComponent } from './app.component';
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';

const adultReturnVisitForm = require('./adult-1.6.json');

Expand All @@ -20,15 +21,13 @@ describe('AppComponent', () => {

beforeEach(() => {
TestBed.configureTestingModule({
declarations: [AppComponent],
imports: [
BrowserModule,
declarations: [AppComponent],
imports: [BrowserModule,
FormEntryModule,
HttpClientTestingModule,
ReactiveFormsModule,
TranslateModule.forRoot()
]
});
TranslateModule.forRoot()],
providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()]
});

fixture = TestBed.createComponent(AppComponent);
component = fixture.componentInstance;
Expand Down
23 changes: 8 additions & 15 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { HttpClientModule } from '@angular/common/http';
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
import { BrowserModule } from '@angular/platform-browser';
import { ReactiveFormsModule } from '@angular/forms';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { FormEntryModule } from '@openmrs/ngx-formentry';
import { AppComponent } from './app.component';
import { NgxTranslateModule } from './translate/translate.module';

@NgModule({
declarations: [AppComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [
BrowserModule,
BrowserAnimationsModule,
FormEntryModule,
HttpClientModule,
ReactiveFormsModule,
NgxTranslateModule
],
providers: [],
bootstrap: [AppComponent]
})
@NgModule({ declarations: [AppComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
bootstrap: [AppComponent], imports: [BrowserModule,
BrowserAnimationsModule,
FormEntryModule,
ReactiveFormsModule,
NgxTranslateModule], providers: [provideHttpClient(withInterceptorsFromDi())] })
export class AppModule {}
28 changes: 11 additions & 17 deletions src/app/translate/translate.module.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { HttpClient, HttpClientModule } from '@angular/common/http';
import { HttpClient, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
import { JsonLoader } from './json-loader';

@NgModule({
declarations: [],
imports: [
CommonModule,
HttpClientModule,
TranslateModule.forRoot({
defaultLanguage: 'en',
loader: {
provide: TranslateLoader,
useClass: JsonLoader,
deps: [HttpClient]
}
})
],
exports: [TranslateModule]
})
@NgModule({ declarations: [],
exports: [TranslateModule], imports: [CommonModule,
TranslateModule.forRoot({
defaultLanguage: 'en',
loader: {
provide: TranslateLoader,
useClass: JsonLoader,
deps: [HttpClient]
}
})], providers: [provideHttpClient(withInterceptorsFromDi())] })
export class NgxTranslateModule {}
Loading

0 comments on commit 6187fe1

Please sign in to comment.