From 708c7f39811ac3b7d466982e19049e06e03e5fd0 Mon Sep 17 00:00:00 2001 From: Paxton Hare Date: Tue, 14 Feb 2017 13:41:30 -0500 Subject: [PATCH] prepping alpha 6 --- CHANGELOG.md | 14 +++++++++++++- gradle.properties | 2 +- .../com/marklogic/debugger/web/ApiController.java | 7 ++++--- src/main/resources/modules/clear-breakpoints.xqy | 6 ++++++ src/main/ui/app/home/home.component.ts | 13 ++++++++++--- 5 files changed, 34 insertions(+), 8 deletions(-) create mode 100644 src/main/resources/modules/clear-breakpoints.xqy diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ae1d10..6110337 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,19 @@ # Change Log -## [v1.0.0-alpha.5](https://github.com/paxtonhare/marklogic-debugger/tree/v1.0.0-alpha.5) +## [v1.0.0-alpha.6](https://github.com/paxtonhare/marklogic-debugger/tree/v1.0.0-alpha.6) +[Full Changelog](https://github.com/paxtonhare/marklogic-debugger/compare/v1.0.0-alpha.5...v1.0.0-alpha.6) + +**Closed issues:** + +- invoke a main module from the debugger [\#19](https://github.com/paxtonhare/marklogic-debugger/issues/19) +- determine if breakpoint is valid when set [\#18](https://github.com/paxtonhare/marklogic-debugger/issues/18) +- update node dependencies [\#17](https://github.com/paxtonhare/marklogic-debugger/issues/17) +- Rename the "Debugging is ON|OFF" [\#16](https://github.com/paxtonhare/marklogic-debugger/issues/16) +- Can we pause a long running request? [\#10](https://github.com/paxtonhare/marklogic-debugger/issues/10) +- Indicate that something happened [\#3](https://github.com/paxtonhare/marklogic-debugger/issues/3) + +## [v1.0.0-alpha.5](https://github.com/paxtonhare/marklogic-debugger/tree/v1.0.0-alpha.5) (2017-02-10) [Full Changelog](https://github.com/paxtonhare/marklogic-debugger/compare/v1.0.0-alpha.4...v1.0.0-alpha.5) **Closed issues:** diff --git a/gradle.properties b/gradle.properties index 02be3af..d4838b2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,2 @@ -version=1.0.0-alpha.5 +version=1.0.0-alpha.6 diff --git a/src/main/java/com/marklogic/debugger/web/ApiController.java b/src/main/java/com/marklogic/debugger/web/ApiController.java index 04b0da8..01b2378 100644 --- a/src/main/java/com/marklogic/debugger/web/ApiController.java +++ b/src/main/java/com/marklogic/debugger/web/ApiController.java @@ -227,9 +227,10 @@ public String pauseRequest(@PathVariable String requestId) throws InvalidRequest @ResponseBody public String setBreakpoints(@PathVariable String requestId, @RequestBody List breakpoints) throws InvalidRequestException { ConnectionAuthenticationToken auth = (ConnectionAuthenticationToken)SecurityContextHolder.getContext().getAuthentication(); + HashMap hm = new HashMap<>(); + hm.put("requestId", requestId); + evalQuery(auth, "clear-breakpoints.xqy", hm); for (Breakpoint bp : breakpoints) { - HashMap hm = new HashMap<>(); - hm.put("requestId", requestId); hm.put("uri", bp.uri); hm.put("line", bp.line); evalQuery(auth, "set-breakpoints.xqy", hm); @@ -243,7 +244,7 @@ public String getBreakpoints(@PathVariable String requestId) throws InvalidReque ConnectionAuthenticationToken auth = (ConnectionAuthenticationToken)SecurityContextHolder.getContext().getAuthentication(); HashMap hm = new HashMap<>(); hm.put("requestId", requestId); - return evalQuery(auth, "set-breakpoints.xqy", hm); + return evalQuery(auth, "get-breakpoints.xqy", hm); } @RequestMapping(value = "/requests/{requestId}/eval", method = RequestMethod.POST) diff --git a/src/main/resources/modules/clear-breakpoints.xqy b/src/main/resources/modules/clear-breakpoints.xqy new file mode 100644 index 0000000..5d21994 --- /dev/null +++ b/src/main/resources/modules/clear-breakpoints.xqy @@ -0,0 +1,6 @@ +declare variable $requestId external; + +let $requestId := xs:unsignedLong($requestId) +for $expression in dbg:breakpoints($requestId) +return + dbg:clear($requestId, $expression) diff --git a/src/main/ui/app/home/home.component.ts b/src/main/ui/app/home/home.component.ts index 0541fde..6cff9d5 100644 --- a/src/main/ui/app/home/home.component.ts +++ b/src/main/ui/app/home/home.component.ts @@ -248,12 +248,16 @@ export class HomeComponent implements OnInit, OnDestroy { } setBreakpoints() { - if (!this.breakpointsSet && Object.keys(this.breakpoints).length > 0) { + let keys: Array; + if (this.breakpoints) { + keys = Array.from(this.breakpoints.keys()); + } + + if (!this.breakpointsSet && keys && keys.length > 0) { this.breakpointsSet = true; let breakpoints = new Array(); - let keys = Object.keys(this.breakpoints); for (let key of keys) { - for (let bps of this.breakpoints[key]) { + for (let bps of this.breakpoints.get(key)) { breakpoints.push(bps); } } @@ -270,6 +274,7 @@ export class HomeComponent implements OnInit, OnDestroy { gutterClick(cm: any, line: number, gutter: string, clickEvent: MouseEvent) { const info = cm.lineInfo(line); + this.breakpointsSet = false; if (info.gutterMarkers && info.gutterMarkers.breakpoints && clickEvent.which === 3) { this.marklogic.disableBreakpoint(this.selectedServer.name, this.currentUri, line); } else if (info.gutterMarkers && info.gutterMarkers.breakpoints) { @@ -291,11 +296,13 @@ export class HomeComponent implements OnInit, OnDestroy { } toggleBreakpoint(breakpoint: Breakpoint) { + this.breakpointsSet = false; this.marklogic.toggleBreakpoint(this.selectedServer.name, breakpoint.uri, breakpoint.line); this.getBreakpoints(); } disableBreakpoint(breakpoint: Breakpoint) { + this.breakpointsSet = false; this.marklogic.disableBreakpoint(this.selectedServer.name, breakpoint.uri, breakpoint.line); this.getBreakpoints(); }