Skip to content

Commit

Permalink
Delete dependency & microservice using hotkey #69
Browse files Browse the repository at this point in the history
  • Loading branch information
tillias committed Oct 30, 2020
1 parent 836190b commit 4b3b446
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sonar.testExecutionReportPaths=target/test-results/jest/TESTS-results-sonar.xml
sonar.typescript.lcov.reportPaths=target/test-results/lcov.info

sonar.sourceEncoding=UTF-8
sonar.exclusions=src/main/webapp/content/**/*.*, src/main/webapp/i18n/*.js, target/classes/static/**/*.*, **/main/resources/**/*, **/test/**/*, **/main/webapp/app/admin/**/*
sonar.exclusions=src/main/webapp/content/**/*.*, src/main/webapp/i18n/*.js, target/classes/static/**/*.*, **/main/resources/**/*, **/test/**/*, **/main/webapp/app/admin/**/*, **/aop/logging/*

sonar.issue.ignore.multicriteria=S3437,S4502,S4684,UndocumentedApi,BoldAndItalicTagsCheck
# Rule https://sonarcloud.io/coding_rules?open=squid%3AS3437&rule_key=squid%3AS3437 is ignored, as a JPA-managed field cannot be transient
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/config/application-postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ spring:
datasource:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: org.postgresql.Driver
url: ${JDBC_DATABASE_URL}
username: ${JDBC_DATABASE_USERNAME}
password: ${JDBC_DATABASE_PASSWORD}
url: jdbc:postgresql://localhost:5432/postgres
username: postgres
password: kEt#uR6M
hikari:
poolName: Hikari
auto-commit: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@

</div>
<div class="col-6">
<div class="p3 vis-network-full-height" #visNetwork></div>
<div class="p3 vis-network-full-height" #visNetwork (keydown.delete)="onDeleteKey()"></div>
</div>
<div class="col-3">
<jhi-node-legend [nodeSelection]="nodeSelection" [edgeSelection]="edgeSelection"></jhi-node-legend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,14 @@ export class DependencyDashboardComponent implements OnInit, AfterViewInit, OnDe
return -1;
}

selectedEdgeId(): number {
if (this.edgeSelection && this.edgeSelection.hasEdges()) {
return this.edgeSelection.firstEdge();
}

return -1;
}

createDependency(): void {
// Use selected microservice as dependency's start
if (this.nodeSelection && this.nodeSelection.hasNodes()) {
Expand Down Expand Up @@ -166,4 +174,12 @@ export class DependencyDashboardComponent implements OnInit, AfterViewInit, OnDe
});
}
}

onDeleteKey(): void {
if (this.selectedNodeId() > 0) {
this.deleteMicroservice();
} else if (this.selectedEdgeId() > 0) {
this.deleteDependency();
}
}
}

0 comments on commit 4b3b446

Please sign in to comment.