Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name := "delphi-management"
organization := "de.upb"


version := "1.0.0-SNAPSHOT"
version := "1.0.0"


scalaVersion := "2.12.4"
Expand Down
14 changes: 12 additions & 2 deletions client/src/app/dashboard/graph-view/graph-view.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,22 @@ export class GraphViewService {
}

private mapLinksToEdges(links: Array<InstanceLink>): Array<cytoscape.ElementDefinition> {
const edges: Array<cytoscape.ElementDefinition> = links.map((edgeVal) => {
return {data: {id: edgeVal.idFrom + '_' + edgeVal.idTo, source: edgeVal.idFrom, target: edgeVal.idTo, status: edgeVal.linkState}};
const edges: Array<cytoscape.ElementDefinition> = links.filter(edgeVal => this.targetsExists(edgeVal)).map((edgeVal) => {
return {data: {id: edgeVal.idFrom + '_' + edgeVal.idTo, source: edgeVal.idFrom, target: edgeVal.idTo, status: edgeVal.linkState}};
});
return edges;
}

private targetsExists(instanceLink: InstanceLink) {

const instances = this.storeService.getState().instances;
if (instances[instanceLink.idFrom] && instances[instanceLink.idTo]) {
return true;
} else {
return false;
}
}

public getGraphConfig() {
return new GraphConfig();
}
Expand Down
12 changes: 9 additions & 3 deletions client/src/app/dashboard/table-all/table-all.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
-->
<div *ngIf="dataSource.data.length == 0; else tableBlock">
There are currently no instances running.
<div class="col-lg-2 col-md-2 col-sm-2">
<div *ngIf="authService.userIsAdmin()">
<button mat-raised-button color="primary" id="addButton" (click)="openAddDialog()">Add
Instance</button>
</div>
</div>
</div>
<ng-template #tableBlock>
<div class="container">
Expand Down Expand Up @@ -149,7 +155,7 @@

</table>
</div>
<div *ngIf="!hideControlElements">
<mat-paginator class="paginator" [pageSizeOptions]="[5, 10, 20]"></mat-paginator>
</div>
</ng-template>
<div *ngIf="!hideControlElements">
<mat-paginator class="paginator" [pageSizeOptions]="[5, 10, 20]"></mat-paginator>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,4 @@ describe('TableAllComponent', () => {
expect(apiService).toBeTruthy();
})));

it('should check for apply filter keyup event', () => {
spyOn(component, 'applyFilter');
fixture.detectChanges();
expect(fixture.nativeElement.querySelectorAll('mat-form-field').length).toBe(1);
});

});