Skip to content
This repository has been archived by the owner on Jan 27, 2021. It is now read-only.

Commit

Permalink
prepping alpha 6
Browse files Browse the repository at this point in the history
  • Loading branch information
paxtonhare committed Feb 14, 2017
1 parent e60dab8 commit 708c7f3
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 8 deletions.
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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:**
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version=1.0.0-alpha.5
version=1.0.0-alpha.6

7 changes: 4 additions & 3 deletions src/main/java/com/marklogic/debugger/web/ApiController.java
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,10 @@ public String pauseRequest(@PathVariable String requestId) throws InvalidRequest
@ResponseBody
public String setBreakpoints(@PathVariable String requestId, @RequestBody List<Breakpoint> breakpoints) throws InvalidRequestException {
ConnectionAuthenticationToken auth = (ConnectionAuthenticationToken)SecurityContextHolder.getContext().getAuthentication();
HashMap<String, String> hm = new HashMap<>();
hm.put("requestId", requestId);
evalQuery(auth, "clear-breakpoints.xqy", hm);
for (Breakpoint bp : breakpoints) {
HashMap<String, String> hm = new HashMap<>();
hm.put("requestId", requestId);
hm.put("uri", bp.uri);
hm.put("line", bp.line);
evalQuery(auth, "set-breakpoints.xqy", hm);
Expand All @@ -243,7 +244,7 @@ public String getBreakpoints(@PathVariable String requestId) throws InvalidReque
ConnectionAuthenticationToken auth = (ConnectionAuthenticationToken)SecurityContextHolder.getContext().getAuthentication();
HashMap<String, String> 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)
Expand Down
6 changes: 6 additions & 0 deletions src/main/resources/modules/clear-breakpoints.xqy
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
declare variable $requestId external;

let $requestId := xs:unsignedLong($requestId)
for $expression in dbg:breakpoints($requestId)
return
dbg:clear($requestId, $expression)
13 changes: 10 additions & 3 deletions src/main/ui/app/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,12 +248,16 @@ export class HomeComponent implements OnInit, OnDestroy {
}

setBreakpoints() {
if (!this.breakpointsSet && Object.keys(this.breakpoints).length > 0) {
let keys: Array<string>;
if (this.breakpoints) {
keys = Array.from(this.breakpoints.keys());
}

if (!this.breakpointsSet && keys && keys.length > 0) {
this.breakpointsSet = true;
let breakpoints = new Array<Breakpoint>();
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);
}
}
Expand All @@ -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) {
Expand All @@ -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();
}
Expand Down

0 comments on commit 708c7f3

Please sign in to comment.