-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
1,870 additions
and
13 deletions.
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
34 changes: 34 additions & 0 deletions
34
src/app/core/component/create-algorithm/create-algorithm.component.html
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,34 @@ | ||
<button mat-icon-button class="close-button" [mat-dialog-close]="true"> | ||
<mat-icon class="close-icon" >close</mat-icon> | ||
</button> | ||
<div mat-dialog-content> | ||
<mat-form-field> | ||
<mat-label>Algorithm Name</mat-label> | ||
<input matInput [(ngModel)]="name" cdkFocusInitial> | ||
</mat-form-field> | ||
<mat-form-field> | ||
<mat-label>Select Patterns</mat-label> | ||
<mat-select [(value)]="res" multiple> | ||
<mat-option *ngFor="let pattern of patterns" [value]="pattern">{{pattern.name}}</mat-option> | ||
</mat-select> | ||
</mat-form-field> | ||
<mat-form-field> | ||
<mat-label>Select Optional Patterns</mat-label> | ||
<mat-select [(value)]="opt" multiple> | ||
<mat-option *ngFor="let pattern of patterns" [value]="pattern">{{pattern.name}}</mat-option> | ||
</mat-select> | ||
</mat-form-field> | ||
<mat-form-field> | ||
<mat-label>href to PlanQK website</mat-label> | ||
<input matInput [(ngModel)]="planqkref"> | ||
</mat-form-field> | ||
</div> | ||
<div mat-dialog-actions> | ||
<button class="action-button-with-margin" (click)="closeDialog()" color="accent" mat-raised-button> | ||
<i class="material-icons"></i> create Algorithm | ||
</button> | ||
<button mat-dialog-close class="action-button-with-margin" mat-raised-button > | ||
<i class="material-icons"></i> close | ||
</button> | ||
</div> | ||
|
11 changes: 11 additions & 0 deletions
11
src/app/core/component/create-algorithm/create-algorithm.component.scss
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,11 @@ | ||
.close-button{ | ||
float: right; | ||
top:-24px; | ||
right:-24px; | ||
} | ||
|
||
.close-button:hover{ | ||
opacity: 0.9; | ||
color: red; | ||
cursor: pointer; | ||
} |
25 changes: 25 additions & 0 deletions
25
src/app/core/component/create-algorithm/create-algorithm.component.spec.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,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { CreateAlgorithmComponent } from './create-algorithm.component'; | ||
|
||
describe('CreateAlgorithmComponent', () => { | ||
let component: CreateAlgorithmComponent; | ||
let fixture: ComponentFixture<CreateAlgorithmComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ CreateAlgorithmComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(CreateAlgorithmComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
49 changes: 49 additions & 0 deletions
49
src/app/core/component/create-algorithm/create-algorithm.component.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,49 @@ | ||
import { Component, OnInit, ViewChild, Inject } from '@angular/core'; | ||
import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog"; | ||
import {MatSelectModule} from '@angular/material/select'; | ||
import {MatFormFieldModule} from '@angular/material/form-field'; | ||
import {MatButtonModule} from '@angular/material/button'; | ||
|
||
import { HttpClient } from '@angular/common/http'; | ||
|
||
@Component({ | ||
selector: 'pp-create-algorithm', | ||
templateUrl: './create-algorithm.component.html', | ||
styleUrls: ['./create-algorithm.component.scss'] | ||
}) | ||
export class CreateAlgorithmComponent implements OnInit { | ||
|
||
patterns: any[]; | ||
res = []; | ||
opt = []; | ||
name: string; | ||
planqkref: string; | ||
|
||
infos: any; | ||
|
||
|
||
constructor(public dialogRef: MatDialogRef<CreateAlgorithmComponent>, | ||
private http: HttpClient, | ||
@Inject(MAT_DIALOG_DATA) public data) { | ||
this.patterns = data.patterns; | ||
} | ||
|
||
ngOnInit(): void { | ||
|
||
let href = "https://platform.planqk.de/qc-catalog/algorithms/fae60bca-d2b6-4aa2-88b7-58caace34179"; | ||
this.http.get(href).subscribe(data => { | ||
this.infos = data; | ||
}); | ||
|
||
} | ||
|
||
closeDialog() { | ||
if(this.res.length > 0){ | ||
const result = { name: this.name, patterns: this.res , optional: this.opt, href: this.planqkref}; | ||
this.dialogRef.close(result); | ||
} else { | ||
alert("no patterns selected!"); | ||
} | ||
} | ||
|
||
} |
19 changes: 19 additions & 0 deletions
19
src/app/core/component/delete-algorithm/delete-algorithm.component.html
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 @@ | ||
<button mat-icon-button class="close-button" [mat-dialog-close]="true"> | ||
<mat-icon class="close-icon" >close</mat-icon> | ||
</button> | ||
<div mat-dialog-content> | ||
<mat-form-field> | ||
<mat-label>Select algorithms to delete</mat-label> | ||
<mat-select [(value)]="res" multiple cdkFocusInitial> | ||
<mat-option *ngFor="let alg of algorithms" [value]="alg">{{alg.name}}</mat-option> | ||
</mat-select> | ||
</mat-form-field> | ||
</div> | ||
<div mat-dialog-actions> | ||
<button class="action-button-with-margin" (click)="closeDialog()" color="accent" mat-raised-button> | ||
<i class="material-icons"></i> delete Algorithm | ||
</button> | ||
<button mat-dialog-close class="action-button-with-margin" mat-raised-button > | ||
<i class="material-icons"></i> close | ||
</button> | ||
</div> | ||
11 changes: 11 additions & 0 deletions
11
src/app/core/component/delete-algorithm/delete-algorithm.component.scss
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,11 @@ | ||
.close-button{ | ||
float: right; | ||
top:-24px; | ||
right:-24px; | ||
} | ||
|
||
.close-button:hover{ | ||
opacity: 0.9; | ||
color: red; | ||
cursor: pointer; | ||
} |
25 changes: 25 additions & 0 deletions
25
src/app/core/component/delete-algorithm/delete-algorithm.component.spec.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,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { DeleteAlgorithmComponent } from './delete-algorithm.component'; | ||
|
||
describe('DeleteAlgorithmComponent', () => { | ||
let component: DeleteAlgorithmComponent; | ||
let fixture: ComponentFixture<DeleteAlgorithmComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ DeleteAlgorithmComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(DeleteAlgorithmComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
34 changes: 34 additions & 0 deletions
34
src/app/core/component/delete-algorithm/delete-algorithm.component.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,34 @@ | ||
import { Component, OnInit, Inject } from '@angular/core'; | ||
import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog"; | ||
import {MatSelectModule} from '@angular/material/select'; | ||
import {MatFormFieldModule} from '@angular/material/form-field'; | ||
import {MatButtonModule} from '@angular/material/button'; | ||
|
||
@Component({ | ||
selector: 'pp-delete-algorithm', | ||
templateUrl: './delete-algorithm.component.html', | ||
styleUrls: ['./delete-algorithm.component.scss'] | ||
}) | ||
export class DeleteAlgorithmComponent implements OnInit { | ||
|
||
algorithms: any[]; | ||
res = []; | ||
|
||
constructor(public dialogRef: MatDialogRef<DeleteAlgorithmComponent>, | ||
@Inject(MAT_DIALOG_DATA) public data) { | ||
this.algorithms = data.algorithms; | ||
} | ||
|
||
ngOnInit(): void { | ||
} | ||
|
||
closeDialog() { | ||
if(this.res.length > 0){ | ||
const result = this.res; | ||
this.dialogRef.close(result); | ||
} else { | ||
alert("no algorithm selected!"); | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.