Skip to content

Commit

Permalink
cs/tslint + debug config
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierrci authored and n1t0 committed Aug 20, 2019
1 parent 4450a67 commit 0c155d7
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 17 deletions.
17 changes: 17 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Node: Nodemon",
"port": 9017,
"restart": true,
"protocol": "inspector",
"skipFiles": [ "<node_internals>/**/*.js" ]
},
]
}
30 changes: 15 additions & 15 deletions app/src/app/pages/explore/explore.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class ExploreComponent implements OnInit {
count = {
total: 0,
start: 0
}
};
items = [];

constructor(
Expand All @@ -43,9 +43,9 @@ export class ExploreComponent implements OnInit {
this.activatedRoute.paramMap,
this.activatedRoute.queryParamMap
).subscribe(([params, queryParams]) => {
this.server = params.get("server");
this.database = params.get("database");
this.collection = params.get("collection");
this.server = params.get('server');
this.database = params.get('database');
this.collection = params.get('collection');

let query;
let sort;
Expand All @@ -69,20 +69,20 @@ export class ExploreComponent implements OnInit {
}
this.params = {
query, sort, limit, skip, project
}
};
});
}

update(upd: boolean = true) {
if (!this.params || !this.params.query) { return; }

const query = JSON.stringify(this.jsonParser.parse(this.params.query));
const sort = (this.params.sort !== "")
const sort = (this.params.sort !== '')
? JSON.stringify(this.jsonParser.parse(this.params.sort))
: "{}";
const project = (this.params.project !== "")
: '{}';
const project = (this.params.project !== '')
? JSON.stringify(this.jsonParser.parse(this.params.project))
: "{}";
: '{}';
if (!query || !sort) { return ; }

if (upd) {
Expand Down Expand Up @@ -124,10 +124,10 @@ export class ExploreComponent implements OnInit {

go(documentId) {
this.router.navigate([
"servers", this.server,
"databases", this.database,
"collections", this.collection,
"documents", documentId
'servers', this.server,
'databases', this.database,
'collections', this.collection,
'documents', documentId
]);
}

Expand All @@ -136,7 +136,7 @@ export class ExploreComponent implements OnInit {
const newId = json && json._id && json._id.$value;
const oldId = _id && _id.$value;
if (newId !== oldId) {
this.notifService.notifyError("ObjectId changed. This is not supported, updated canceled.");
this.notifService.notifyError('ObjectId changed. This is not supported, updated canceled.');
return ;
}

Expand All @@ -159,7 +159,7 @@ export class ExploreComponent implements OnInit {
.subscribe((res: any) => {
const index = this.items.findIndex(v => v._id && v._id.$value && v._id.$value === document);
this.items.splice(index, 1);
})
});
}

get hasNext() {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
"@types/node": "^10.7.1"
},
"main": "./dist/server.js",
"scripts": {
"debug-server": "npx tsc -w & npx nodemon --inspect=9017 ./dist/server.js"
},
"bin": {
"mongoku": "./dist/cli.js"
},
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"module": "commonjs",
"outDir": "dist/",
"strictNullChecks": true,
"lib": ["es6", "es2016", "es2017"]
"lib": ["es6", "es2016", "es2017"],
"sourceMap": true // Needed for debugging with VSCode
},
"exclude": [
"app/**/*"
Expand Down

0 comments on commit 0c155d7

Please sign in to comment.