Skip to content

Commit

Permalink
Update to Angular 11
Browse files Browse the repository at this point in the history
  • Loading branch information
RickStrahl committed Nov 24, 2020
1 parent bf3169d commit a17e865
Show file tree
Hide file tree
Showing 25 changed files with 135 additions and 140 deletions.
22 changes: 14 additions & 8 deletions src/AlbumViewerAngular/angular.json
Expand Up @@ -41,24 +41,30 @@
],
"styles": [
{
"input": "node_modules/bootstrap/dist/css/bootstrap.css"
"input": "node_modules/bootstrap/dist/css/bootstrap.css",
"inject": true
},
{
"input": "node_modules/font-awesome/css/font-awesome.css"
"input": "node_modules/font-awesome/css/font-awesome.css",
"inject": true
},
{
"input": "node_modules/toastr/build/toastr.css"
"input": "node_modules/toastr/build/toastr.css",
"inject": true
},
{
"input": "src/css/albumviewer.css"
"input": "src/css/albumviewer.css",
"inject": true
}
],
"scripts": [
{
"input": "node_modules/jquery/dist/jquery.js"
"input": "node_modules/jquery/dist/jquery.js",
"inject": true
},
{
"input": "node_modules/toastr/toastr.js"
"input": "node_modules/toastr/toastr.js",
"inject": true
}
]
},
Expand All @@ -79,7 +85,6 @@
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
Expand Down Expand Up @@ -116,7 +121,8 @@
"karmaConfig": "src/karma.conf.js",
"styles": [
{
"input": "styles.css"
"input": "styles.css",
"inject": true
}
],
"scripts": [],
Expand Down
52 changes: 26 additions & 26 deletions src/AlbumViewerAngular/package.json
Expand Up @@ -16,15 +16,15 @@
},
"private": true,
"dependencies": {
"@angular/animations": "^9.1.11",
"@angular/common": "^9.1.11",
"@angular/compiler": "^9.1.11",
"@angular/core": "^9.1.11",
"@angular/forms": "^9.1.11",
"@angular/localize": "^9.1.11",
"@angular/platform-browser": "^9.1.11",
"@angular/platform-browser-dynamic": "^9.1.11",
"@angular/router": "^9.1.11",
"@angular/animations": "^11.0.0",
"@angular/common": "^11.0.0",
"@angular/compiler": "^11.0.0",
"@angular/core": "^11.0.0",
"@angular/forms": "^11.0.0",
"@angular/localize": "^11.0.0",
"@angular/platform-browser": "^11.0.0",
"@angular/platform-browser-dynamic": "^11.0.0",
"@angular/router": "^11.0.0",
"@ng-bootstrap/ng-bootstrap": "^6.1.0",
"bootstrap": "^4.4.1",
"core-js": "^2.5.4",
Expand All @@ -33,28 +33,28 @@
"rxjs": "^6.5.3",
"toastr": "^2.1.4",
"ngx-toastr": "^12.1.0",
"tslib": "^1.10.0",
"tslib": "^2.0.0",
"zone.js": "~0.10.2"
},
"devDependencies": {
"@angular/compiler-cli": "^9.1.11",
"@angular/language-service": "^9.1.11",
"@angular-devkit/build-angular": "~0.901.9",
"@angular/cli": "~9.1.9",
"@angular/compiler-cli": "^11.0.0",
"@angular/language-service": "^11.0.0",
"@angular-devkit/build-angular": "~0.1100.1",
"@angular/cli": "~11.0.1",
"@types/node": "^12.11.1",
"@types/jasmine": "~2.8.8",
"@types/jasmine": "~3.6.0",
"@types/jasminewd2": "~2.0.3",
"codelyzer": "^5.1.2",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.4.0",
"codelyzer": "^6.0.0",
"jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~5.0.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"protractor": "~7.0.0",
"ts-node": "~7.0.0",
"tslint": "~5.16.0",
"typescript": "~3.8.3"
"tslint": "~6.1.0",
"typescript": "~4.0.5"
}
}
2 changes: 1 addition & 1 deletion src/AlbumViewerAngular/src/app/app-routing.module.ts
Expand Up @@ -24,7 +24,7 @@ const routes: Routes = [
];

@NgModule({
imports: [RouterModule.forRoot(routes)],
imports: [RouterModule.forRoot(routes, { relativeLinkResolution: 'legacy' })],
exports: [RouterModule],
providers: []
})
Expand Down
4 changes: 2 additions & 2 deletions src/AlbumViewerAngular/src/app/artists/artistDisplay.html
Expand Up @@ -11,7 +11,7 @@
Edit
</button>

<button (click)="deleteArtist(ArtistEditor)"
<button (click)="deleteArtist(ArtistEditor.artist)"
class="btn btn-sm btn-primary">
<i class="fa fa-remove"></i>
Delete
Expand All @@ -33,7 +33,7 @@ <h2>{{artist.ArtistName}}</h2>
<div class="col-sm-8">
<div class="line-breaks">{{artist.Description }}</div>

<a class="small" *ngIf="artist.AmazonUrl" href="{{artist.AmazonUrl}}">{{artist.ArtistName}} on Amazon</a>
<a class="small" *ngIf="artist.AmazonUrl" href="{{artist.AmazonUrl}}">{{artist.ArtistName}} on the Web</a>
</div>
</div>

Expand Down
4 changes: 2 additions & 2 deletions src/AlbumViewerAngular/src/app/artists/artistService.ts
Expand Up @@ -87,8 +87,8 @@ export class ArtistService {
}
}

deleteArtist(artist:ArtistEditor):Observable<boolean> {
let url = this.config.urls.url("artist",artist.artist.Id);
deleteArtist(artist:Artist):Observable<boolean> {
let url = this.config.urls.url("artist",artist.Id);
return this.httpClient.delete<boolean>(url,
this.config.requestHeaders)
.pipe(catchError( new ErrorInfo().parseObservableResponseError) );
Expand Down
5 changes: 3 additions & 2 deletions src/AlbumViewerAngular/src/app/business/appConfiguration.ts
Expand Up @@ -16,13 +16,14 @@ export class AppConfiguration {
this.setToastrOptions();

if(location.port && (location.port == "3000") || (location.port== "4200") || (location.port == 5200) ) {
this.urls.baseUrl = "http://localhost:5000/"; // local kestrel
this.urls.baseUrl = "https://localhost:5001/"; // local kestrel
}
else {
//this.urls.baseUrl = "http://localhost:5001/"; // kestrel
//this.urls.baseUrl = "http://localhost:26448/"; // iis Express
//this.urls.baseUrl = "http://localhost/albumviewer/"; // iis
this.urls.baseUrl = "https://albumviewer.west-wind.com/"; // online
//this.urls.baseUrl = https://albumviewer.west-wind.com/"; // online
this.urls.baseUrl = location.origin.trimEnd('/') + '/';
}

// always online
Expand Down
2 changes: 2 additions & 0 deletions src/AlbumViewerAngular/src/app/options/options.ts
Expand Up @@ -24,6 +24,8 @@ export class OptionsComponent implements OnInit {
ngOnInit() {
this.config.isSearchAllowed = false;

console.dir(location)

if (this.config.applicationStats.OsPlatform == null) {
this.http.get<ApplicationStats>(this.config.urls.url("applicationStats"))
.subscribe(stats => {
Expand Down
2 changes: 1 addition & 1 deletion src/AlbumViewerAngular/src/tsconfig.app.json
Expand Up @@ -11,7 +11,7 @@
],
"outDir": "../out-tsc/app",
"target": "es5",
"module": "esnext",
"module": "es2020",
"baseUrl": "",
"types": []
},
Expand Down
2 changes: 1 addition & 1 deletion src/AlbumViewerAngular/src/tsconfig.spec.json
Expand Up @@ -9,7 +9,7 @@
"es2016"
],
"outDir": "../out-tsc/spec",
"module": "esnext",
"module": "es2020",
"target": "es6",
"baseUrl": "",
"types": [
Expand Down
2 changes: 1 addition & 1 deletion src/AlbumViewerAngular/tsconfig.json
Expand Up @@ -2,7 +2,7 @@
"compileOnSave": false,
"compilerOptions": {
"importHelpers": true,
"module": "esnext",
"module": "es2020",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
Expand Down
4 changes: 3 additions & 1 deletion src/AlbumViewerAngular/tslint.json
Expand Up @@ -13,6 +13,9 @@
"curly": true,
"eofline": true,
"forin": true,
"deprecation": {
"severity": "warning"
},
"import-blacklist": [
true,
"rxjs",
Expand Down Expand Up @@ -70,7 +73,6 @@
"no-trailing-whitespace": true,
"no-unnecessary-initializer": true,
"no-unused-expression": true,
"no-use-before-declare": true,
"no-var-keyword": true,
"object-literal-sort-keys": false,
"one-line": [
Expand Down
3 changes: 2 additions & 1 deletion src/AlbumViewerNetCore/Properties/launchSettings.json
Expand Up @@ -22,7 +22,8 @@
"AlbumViewerNetCore": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "http://localhost:5000",
"launchUrl": "https://localhost:5001",

"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
Expand Down

0 comments on commit a17e865

Please sign in to comment.