-
Notifications
You must be signed in to change notification settings - Fork 6
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
Frontend rewrite #131
Open
lieberlois
wants to merge
16
commits into
feature-creeps:develop
Choose a base branch
from
lieberlois:frontend-rewrite
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+24,804
−10,401
Open
Frontend rewrite #131
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
aaecdde
Migrating to Angular 10
lieberlois 08552c5
Migrating to Angular 11
lieberlois 8cf331f
Migrating to Angular 12
lieberlois 8581e75
Migrating to Angular 13
lieberlois 353ba6b
Migrating to Angular 14
lieberlois d8336bb
Migrating to Angular 15
lieberlois 6e52a7f
Full project restructuring
lieberlois 609a411
Fixing dependencies in component code using dependency injection
lieberlois 715e944
Fixing build process for Angular 15
lieberlois d0247e5
Refactoring Orchetrate Feature
lieberlois f911cd5
Refactoring Display Feature
lieberlois 69b0d3b
Refactoring Album Feature
lieberlois 517ad6b
Refactoring Random Feature
lieberlois d85b342
Refactoring Delete Feature
lieberlois 6ca72dc
Refactoring Trafficgen Feature
lieberlois dbba18d
Setting node image to multiplatform version
lieberlois File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fixing dependencies in component code using dependency injection
commit 609a411eb96c2aa23a0f65d04f641580ab308466
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from "./components/album/album.component"; | ||
export * from "./components/preview/preview.component"; | ||
export * from "./services/preview.service"; | ||
export * from "./services/preview.service"; | ||
export * from "./services/album.service"; |
15 changes: 15 additions & 0 deletions
15
stack/application/frontend/src/app/features/album/services/album.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { HttpClient, HttpHeaders } from '@angular/common/http'; | ||
import {Injectable} from '@angular/core'; | ||
import {environment} from "../../../../environments/environment"; | ||
import { Image } from '../../../shared/models' | ||
|
||
|
||
@Injectable() | ||
export class AlbumService { | ||
|
||
public constructor(private readonly httpClient: HttpClient) {} | ||
|
||
public async getImages(): Promise<any> { | ||
return this.httpClient.get<Array<Image>>(environment.backend.imageholder + '/api/images').toPromise(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './components/delete/delete.component'; | ||
export * from './components/delete/delete.component'; | ||
export * from './services/delete.service'; |
27 changes: 27 additions & 0 deletions
27
stack/application/frontend/src/app/features/delete/services/delete.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { HttpClient, HttpHeaders } from '@angular/common/http'; | ||
import {Injectable} from '@angular/core'; | ||
import {environment} from "../../../../environments/environment"; | ||
import { Image } from '../../../shared/models' | ||
|
||
|
||
@Injectable() | ||
export class DeleteService { | ||
|
||
public constructor(private readonly httpClient: HttpClient) {} | ||
|
||
public async deleteImageById(deleteId: string): Promise<any> { | ||
return this.httpClient.delete(environment.backend.imageholder + '/api/images/' + deleteId, {responseType: 'text'}).toPromise(); | ||
} | ||
|
||
public async deleteAllImages(): Promise<any> { | ||
return this.httpClient.post(environment.backend.imageholder + '/api/images/delete/all', null, {responseType: 'text'}).toPromise(); | ||
} | ||
|
||
public async getImages(): Promise<any> { | ||
return this.httpClient.get<Array<Image>>(environment.backend.imageholder + '/api/images').toPromise(); | ||
} | ||
|
||
public async getImageById(id: string): Promise<any> { | ||
return this.httpClient.get(environment.backend.imagethumbnail + '/api/images/' + id, {responseType: 'blob'}).toPromise(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './components/display/display.component'; | ||
export * from './components/display/display.component'; | ||
export * from './services/display.service'; |
19 changes: 19 additions & 0 deletions
19
stack/application/frontend/src/app/features/display/services/display.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { HttpClient, HttpHeaders } from '@angular/common/http'; | ||
import {Injectable} from '@angular/core'; | ||
import {environment} from "../../../../environments/environment"; | ||
import { Image } from '../../../shared/models' | ||
|
||
|
||
@Injectable() | ||
export class DisplayService { | ||
|
||
public constructor(private readonly httpClient: HttpClient) {} | ||
|
||
public async getImages(): Promise<any> { | ||
return this.httpClient.get<Array<Image>>(environment.backend.imageholder + '/api/images').toPromise(); | ||
} | ||
|
||
public async getImageById(id: string): Promise<any> { | ||
return this.httpClient.get(environment.backend.imageholder + '/api/images/' + id, {responseType: 'blob'}).toPromise(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
stack/application/frontend/src/app/features/orchestrate/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './components/orchestrate/orchestrate.component'; | ||
export * from './components/orchestrate/orchestrate.component'; | ||
export * from './services/orchestrate.service'; |
27 changes: 27 additions & 0 deletions
27
stack/application/frontend/src/app/features/orchestrate/services/orchestrate.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { HttpClient, HttpHeaders } from '@angular/common/http'; | ||
import {Injectable} from '@angular/core'; | ||
import {environment} from "../../../../environments/environment"; | ||
import { Image } from '../../../shared/models' | ||
|
||
|
||
@Injectable() | ||
export class OrchestrateService { | ||
|
||
public constructor(private readonly httpClient: HttpClient) {} | ||
|
||
public async getImages(): Promise<any> { | ||
return this.httpClient.get<Array<Image>>(environment.backend.imageholder + '/api/images').toPromise(); | ||
} | ||
|
||
public async getImageById(id: string): Promise<any> { | ||
return this.httpClient.get(environment.backend.imagethumbnail + '/api/images/' + id, { responseType: 'blob' }).toPromise(); | ||
} | ||
|
||
public async sendTransformationRequest(transformationRequestString: string): Promise<any> { | ||
let headers = new HttpHeaders(); | ||
headers = headers.set('Content-Type', 'application/json; charset=utf-8'); | ||
|
||
return this.httpClient.post(environment.backend.imageorchestrator + '/api/images/transform', transformationRequestString, | ||
{ observe: "response", headers: headers, responseType: 'blob' }).toPromise(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './components/random.component'; | ||
export * from './components/random.component'; | ||
export * from './services/random.service'; |
16 changes: 16 additions & 0 deletions
16
stack/application/frontend/src/app/features/random/services/random.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { HttpClient } from '@angular/common/http'; | ||
import {Injectable} from '@angular/core'; | ||
import {environment} from "../../../../environments/environment"; | ||
|
||
|
||
@Injectable() | ||
export class RandomService { | ||
|
||
public constructor(private readonly httpClient: HttpClient) {} | ||
|
||
private randomImageUrl: string = environment.backend.imageholder + '/api/images/random'; | ||
|
||
public async getRandomImage(): Promise<Blob> { | ||
return this.httpClient.get(this.randomImageUrl, {responseType: 'blob'}).toPromise(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
stack/application/frontend/src/app/features/trafficgen/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './components/trafficgen.component'; | ||
export * from './components/trafficgen.component'; | ||
export * from './services/trafficgen.service'; |
22 changes: 22 additions & 0 deletions
22
stack/application/frontend/src/app/features/trafficgen/services/trafficgen.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { HttpClient } from '@angular/common/http'; | ||
import {Injectable} from '@angular/core'; | ||
import {environment} from "../../../../environments/environment"; | ||
|
||
|
||
@Injectable() | ||
export class TrafficgenService { | ||
|
||
public constructor(private readonly httpClient: HttpClient) {} | ||
|
||
public async uploadAll(): Promise<any> { | ||
return this.httpClient.post(environment.backend.trafficgen + '/api/traffic/image/upload', null, { responseType: 'text' }).toPromise(); | ||
} | ||
|
||
public async sendTransformationRequest(transformationsPerSecond: number): Promise<any> { | ||
return await this.httpClient.post(environment.backend.trafficgen + '/api/traffic/image/transform/start?transformationsPerSecond=' + transformationsPerSecond, null, { responseType: 'text' }).toPromise(); | ||
} | ||
|
||
public async stopTransformationTraffic(): Promise<any> { | ||
return await this.httpClient.post(environment.backend.trafficgen + '/api/traffic/image/transform/stop', null, { responseType: 'text' }).toPromise(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
stack/application/frontend/src/app/features/upload/models/image-snippet.model.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export interface ImageSnippet { | ||
src: string; | ||
file: File; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './info-type.enum'; |
5 changes: 5 additions & 0 deletions
5
stack/application/frontend/src/app/shared/enums/info-type.enum.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export enum InfoType { | ||
warning, | ||
danger, | ||
success | ||
} |
5 changes: 5 additions & 0 deletions
5
stack/application/frontend/src/app/shared/models/image.model.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export interface Image { | ||
id: String; | ||
contentType: String; | ||
name: String; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './image.model'; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can think about moving those classes into separate file(s)