Skip to content

Commit

Permalink
chore: Angular 17 upgrade (#5082)
Browse files Browse the repository at this point in the history
  • Loading branch information
tidusjar authored Mar 5, 2024
1 parent adfbc84 commit 617f26b
Show file tree
Hide file tree
Showing 43 changed files with 6,976 additions and 9,670 deletions.
8 changes: 4 additions & 4 deletions src/Ombi/ClientApp/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,22 +82,22 @@
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "ombi:build"
"buildTarget": "ombi:build"
},
"configurations": {
"production": {
"browserTarget": "ombi:build:production"
"buildTarget": "ombi:build:production"
},
"hmr": {
"hmr": true,
"browserTarget": "ombi:build:hmr"
"buildTarget": "ombi:build:hmr"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "ombi:build"
"buildTarget": "ombi:build"
}
},
"lint": {
Expand Down
137 changes: 69 additions & 68 deletions src/Ombi/ClientApp/package.json
Original file line number Diff line number Diff line change
@@ -1,70 +1,71 @@
{
"name": "ombi",
"version": "3.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve --port 3578 --configuration hmr",
"build": "node --max_old_space_size=6144 node_modules/@angular/cli/bin/ng build -c production",
"lint": "ng lint",
"docs:json": "compodoc -p ./tsconfig.json -e json -d .",
"storybook": "start-storybook -p 6006",
"chromatic": "chromatic --exit-zero-on-changes",
"storybookbuild": "yarn build-storybook"
},
"private": true,
"dependencies": {
"@angular/animations": "^15.2.10",
"@angular/cdk": "^14.2.7",
"@angular/common": "^15.2.10",
"@angular/compiler": "^15.2.10",
"@angular/core": "^15.2.10",
"@angular/forms": "^15.2.10",
"@angular/material": "^14.2.7",
"@angular/platform-browser": "^15.2.10",
"@angular/platform-browser-dynamic": "^15.2.10",
"@angular/platform-server": "^15.2.10",
"@angular/router": "^15.2.10",
"@angularclass/hmr": "^3.0.0",
"@auth0/angular-jwt": "^5.0.2",
"@fortawesome/fontawesome-free": "^6.5.0",
"@microsoft/signalr": "^6.0.23",
"@ngx-translate/core": "^14.0.0",
"@ngx-translate/http-loader": "^7.0.0",
"@ngxs/devtools-plugin": "3.8.2",
"@ngxs/store": "3.8.2",
"@types/jquery": "^3.5.28",
"@yellowspot/ng-truncate": "^2.0.0",
"angularx-qrcode": "^15.0.0",
"bootstrap": "^4.2.1",
"core-js": "^2.5.4",
"jquery": "3.7.1",
"lodash": "^4.17.21",
"moment": "^2.30.1",
"ng2-cookies": "^1.0.12",
"ngx-clipboard": "^12.1.0",
"ngx-infinite-scroll": "^9.0.0",
"ngx-moment": "^3.0.1",
"ngx-order-pipe": "^2.2.0",
"popper.js": "^1.14.3",
"primeicons": "^6.0.1",
"primeng": "^15.4.1",
"rxjs": "^7.5.4",
"ts-md5": "^1.2.7",
"zone.js": "~0.13.2"
},
"devDependencies": {
"@angular-devkit/build-angular": "^15.0.2",
"@angular/cli": "^15.0.2",
"@angular/compiler-cli": "^15.0.4",
"@babel/core": "^7.18.9",
"@compodoc/compodoc": "^1.1.19",
"@storybook/angular": "^6.5.9",
"chromatic": "^6.7.1",
"typescript": "~4.8.4"
},
"optionalDependencies": {
"protractor": "~5.4.0",
"ts-node": "~5.0.1",
"tslint": "^5.12.0"
}
"name": "ombi",
"version": "4.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve --port 3578 --configuration hmr",
"build": "node --max_old_space_size=6144 node_modules/@angular/cli/bin/ng build -c production",
"lint": "ng lint",
"docs:json": "compodoc -p ./tsconfig.json -e json -d .",
"storybook": "start-storybook -p 6006",
"chromatic": "chromatic --exit-zero-on-changes",
"storybookbuild": "yarn build-storybook"
},
"private": true,
"dependencies": {
"@angular/animations": "^17.1.3",
"@angular/cdk": "16.2.14",
"@angular/common": "^17.1.3",
"@angular/compiler": "^17.1.3",
"@angular/core": "^17.1.3",
"@angular/forms": "^17.1.3",
"@angular/material": "^14.2.7",
"@angular/platform-browser": "^17.1.3",
"@angular/platform-browser-dynamic": "^17.1.3",
"@angular/platform-server": "^17.1.3",
"@angular/router": "^17.1.3",
"@angularclass/hmr": "^3.0.0",
"@auth0/angular-jwt": "^5.0.2",
"@fortawesome/fontawesome-free": "^6.4.2",
"@microsoft/signalr": "^6.0.23",
"@ngx-translate/core": "^14.0.0",
"@ngx-translate/http-loader": "^7.0.0",
"@ngxs/devtools-plugin": "3.8.1",
"@ngxs/store": "3.8.1",
"@types/jquery": "^3.5.23",
"@yellowspot/ng-truncate": "^2.0.0",
"angularx-qrcode": "^16.0.0",
"bootstrap": "^4.2.1",
"core-js": "^2.5.4",
"date-fns": "3.3.1",
"jquery": "3.7.1",
"lodash": "^4.17.21",
"lodash-es": "^4.17.21",
"ng2-cookies": "^1.0.12",
"ngx-clipboard": "^16.0.0",
"ngx-date-fns": "^11.0.0",
"ngx-infinite-scroll": "^17.0.0",
"popper.js": "^1.14.3",
"primeicons": "^6.0.1",
"primeng": "^17.6.0",
"rxjs": "^7.5.4",
"ts-md5": "^1.2.7",
"zone.js": "0.14.3"
},
"devDependencies": {
"@angular-devkit/build-angular": "^17.1.3",
"@angular/cli": "^17.1.3",
"@angular/compiler-cli": "^17.1.3",
"@babel/core": "^7.18.9",
"@compodoc/compodoc": "^1.1.19",
"@storybook/angular": "7.6.14",
"@types/node": "^20.11.17",
"chromatic": "^6.7.1",
"typescript": "5.2.2"
},
"optionalDependencies": {
"protractor": "~5.4.0",
"ts-node": "~5.0.1",
"tslint": "^5.12.0"
}
}
4 changes: 2 additions & 2 deletions src/Ombi/ClientApp/src/app/auth/auth.guard.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@

import { Injectable } from "@angular/core";
import { Router } from "@angular/router";
import { CanActivate } from "@angular/router";

import { AuthService } from "./auth.service";
import { StorageService } from "../shared/storage/storage-service";

@Injectable()
export class AuthGuard implements CanActivate {
export class AuthGuard {

constructor(private auth: AuthService, private router: Router,
private store: StorageService) { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h3 id="detailed-request-title-{{request.mediaId}}">{{request.title}}</h3>
<p id="detailed-request-requestedby-{{request.mediaId}}">{{'MediaDetails.RequestedBy' | translate}} {{request.username}}</p>
</div>
<div class="col-12">
<p id="detailed-request-date-{{request.mediaId}}">{{'MediaDetails.OnDate' | translate}} {{request.requestDate | amFromUtc | amLocal | amUserLocale | amDateFormat: 'l LT'}}</p>
<p id="detailed-request-date-{{request.mediaId}}">{{'MediaDetails.OnDate' | translate}} {{request.requestDate | dfnsFormat: 'Ppp'}}</p>
</div>
<div class="col-12">
<p id="detailed-request-status-{{request.mediaId}}">{{'MediaDetails.Status' | translate}} <span class="badge badge-{{getClass(request)}}">{{getStatus(request) | translate}}</span></p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,43 +1,42 @@
import { OmbiCommonModules } from "../modules";
import { Component, OnDestroy, OnInit } from "@angular/core";
import { DomSanitizer } from "@angular/platform-browser";
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
import { ImageService } from "../../services";
import { fadeInOutAnimation } from "app/animations/fadeinout";
import { OmbiCommonModules } from '../modules';
import { Component, OnDestroy, OnInit } from '@angular/core';
import { DomSanitizer } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { ImageService } from '../../services';
import { fadeInOutAnimation } from 'app/animations/fadeinout';

@Component({
standalone: true,
selector: 'ombi-image-background',
templateUrl: './image-background.component.html',
styleUrls: ['./image-background.component.scss'],
imports: [...OmbiCommonModules, BrowserAnimationsModule],
providers: [ ImageService ],
animations: [ fadeInOutAnimation ],
})
export class ImageBackgroundComponent implements OnInit, OnDestroy {
standalone: true,
selector: 'ombi-image-background',
templateUrl: './image-background.component.html',
styleUrls: ['./image-background.component.scss'],
imports: [...OmbiCommonModules, BrowserAnimationsModule],
providers: [ImageService],
animations: [fadeInOutAnimation],
})
export class ImageBackgroundComponent implements OnInit, OnDestroy {
public background: any;
public name: string;
private timer: any;

public background: any;
public name: string;
private timer: NodeJS.Timeout;
constructor(private images: ImageService, private sanitizer: DomSanitizer) {}

constructor(private images: ImageService, private sanitizer: DomSanitizer) { }
public ngOnDestroy(): void {
clearTimeout(this.timer);
}

public ngOnDestroy(): void {
clearTimeout(this.timer);
}
public ngOnInit(): void {
this.cycleBackground();

public ngOnInit(): void {
this.cycleBackground();
this.timer = setInterval(() => {
this.cycleBackground();
}, 30000);
}

this.timer = setInterval(() => {
this.cycleBackground();
}, 30000);
}

private cycleBackground() {
this.images.getRandomBackgroundWithInfo().subscribe((x) => {
this.background = this.sanitizer.bypassSecurityTrustStyle("url(" + x.url + ")");
this.name = x.name;
});
}
}
private cycleBackground() {
this.images.getRandomBackgroundWithInfo().subscribe((x) => {
this.background = this.sanitizer.bypassSecurityTrustStyle('url(' + x.url + ')');
this.name = x.name;
});
}
}
5 changes: 2 additions & 3 deletions src/Ombi/ClientApp/src/app/components/modules.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { CommonModule } from "@angular/common";
import { MomentModule } from "ngx-moment";
import { CommonModule } from '@angular/common';

export const OmbiCommonModules = [ CommonModule, MomentModule ];
export const OmbiCommonModules = [CommonModule];

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import { CustomPageService, NotificationService } from "../services";

@Component({
templateUrl: "./custompage.component.html",
styleUrls: ["./custompage.component.scss"],
})
})
export class CustomPageComponent implements OnInit {

public form: UntypedFormGroup;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,43 +1,46 @@
<div class="small-middle-container">
<div class="section">
<h2 id="genreHeading" data-toggle="collapse" href="#genreCollapse" role="button">{{'Discovery.Genres' | translate}}</h2>
<genre-button-select class="collapse show" id="genreCollapse"></genre-button-select>
</div>
<div class="section">
<h2>{{'Discovery.RecentlyRequestedTab' | translate}}</h2>
<div>
<ombi-recently-list [id]="'recentlyRequested'"></ombi-recently-list>
</div>
</div>
<div class="section">
<h2 id="genreHeading" data-toggle="collapse" href="#genreCollapse" role="button">{{ 'Discovery.Genres' | translate }}</h2>
<genre-button-select class="collapse show" id="genreCollapse"></genre-button-select>
</div>
<div class="section">
<h2>{{ 'Discovery.RecentlyRequestedTab' | translate }}</h2>
<div>
<ombi-recently-list [id]="'recentlyRequested'"></ombi-recently-list>
</div>
</div>

<div class="section" [hidden]="!showSeasonal">
<h2>{{'Discovery.SeasonalTab' | translate}}</h2>
<div>
<carousel-list [id]="'seasonal'" [isAdmin]="isAdmin" [discoverType]="DiscoverType.Seasonal" (movieCount)="setSeasonalMovieCount($event)"></carousel-list>
</div>
</div>

<div class="section">
<h2>{{'Discovery.PopularTab' | translate}}</h2>
<div>
<carousel-list [id]="'popular'" [isAdmin]="isAdmin" [discoverType]="DiscoverType.Popular"></carousel-list>
</div>
<div class="section" [hidden]="!showSeasonal">
<h2>{{ 'Discovery.SeasonalTab' | translate }}</h2>
<div>
<carousel-list
[id]="'seasonal'"
[isAdmin]="isAdmin"
[discoverType]="DiscoverType.Seasonal"
(movieCount)="setSeasonalMovieCount($event)"
></carousel-list>
</div>
</div>

</div>
<div class="section">
<h2>{{ 'Discovery.PopularTab' | translate }}</h2>
<div>
<carousel-list [id]="'popular'" [isAdmin]="isAdmin" [discoverType]="DiscoverType.Popular"></carousel-list>
</div>
</div>

<div class="section">
<h2>{{'Discovery.TrendingTab' | translate}}</h2>
<div >
<carousel-list [id]="'trending'" [isAdmin]="isAdmin" [discoverType]="DiscoverType.Trending"></carousel-list>
</div>
<div class="section">
<h2>{{ 'Discovery.TrendingTab' | translate }}</h2>
<div>
<carousel-list [id]="'trending'" [isAdmin]="isAdmin" [discoverType]="DiscoverType.Trending"></carousel-list>
</div>
</div>

</div>

<div class="section">
<h2>{{'Discovery.UpcomingTab' | translate}}</h2>
<div>
<carousel-list [id]="'upcoming'" [isAdmin]="isAdmin" [discoverType]="DiscoverType.Upcoming"></carousel-list>
</div>
</div>

</div>
<div class="section">
<h2>{{ 'Discovery.UpcomingTab' | translate }}</h2>
<div>
<carousel-list [id]="'upcoming'" [isAdmin]="isAdmin" [discoverType]="DiscoverType.Upcoming"></carousel-list>
</div>
</div>
</div>
Loading

0 comments on commit 617f26b

Please sign in to comment.