Skip to content

Commit 3c8b2cb

Browse files
committed
Relax JSON syntax in DB query
1 parent 3b81662 commit 3c8b2cb

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Installation
3434
Credits
3535
-------
3636

37-
This GUI uses [Limber](https://github.com/nimbly/Limber), [Capsule](https://github.com/nimbly/Capsule), [Font Awesome](https://fontawesome.com/), [Bootstrap](https://getbootstrap.com/), [CodeMirror](https://github.com/codemirror/codemirror), [JsonView](https://github.com/pgrabovets/json-view), [MongoDB PHP library](https://github.com/mongodb/mongo-php-library), [vis.js](https://github.com/visjs) and [SQL to MongoDB Query Converter](https://github.com/vincentrussell/sql-to-mongo-db-query-converter). Leaf icon was made by [Freepik](https://www.freepik.com) from [Flaticon](https://www.flaticon.com).
37+
This GUI uses [Limber](https://github.com/nimbly/Limber), [Capsule](https://github.com/nimbly/Capsule), [Font Awesome](https://fontawesome.com/), [Bootstrap](https://getbootstrap.com/), [CodeMirror](https://github.com/codemirror/codemirror), [jsonic](https://github.com/jsonicjs/jsonic), [JsonView](https://github.com/pgrabovets/json-view), [MongoDB PHP library](https://github.com/mongodb/mongo-php-library), [vis.js](https://github.com/visjs) and [SQL to MongoDB Query Converter](https://github.com/vincentrussell/sql-to-mongo-db-query-converter). Leaf icon was made by [Freepik](https://www.freepik.com) from [Flaticon](https://www.flaticon.com).
3838

3939
Copyright
4040
---------

index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*
1919
* @var string
2020
*/
21-
define('MPG_APP_VERSION', '1.1.5');
21+
define('MPG_APP_VERSION', '1.1.6');
2222

2323
/**
2424
* Development mode?

static/js/jsonic.min.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/js/mpg.database.query.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ MPG.eventListeners.addInsertOne = function() {
350350
return window.alert('Please fill the document text area.');
351351
}
352352

353-
requestBody.document = JSON.parse(filterOrDocTextAreaValue);
353+
requestBody.document = jsonic(filterOrDocTextAreaValue);
354354

355355
MPG.helpers.doAjaxRequest(
356356
'POST',
@@ -394,7 +394,7 @@ MPG.eventListeners.addCount = function() {
394394
if ( filterOrDocTextAreaValue === '' ) {
395395
requestBody.filter = {};
396396
} else {
397-
requestBody.filter = JSON.parse(filterOrDocTextAreaValue);
397+
requestBody.filter = jsonic(filterOrDocTextAreaValue);
398398
}
399399

400400
MPG.helpers.doAjaxRequest(
@@ -448,7 +448,7 @@ MPG.eventListeners.addDeleteOne = function() {
448448
return;
449449
}
450450

451-
requestBody.filter = JSON.parse(filterOrDocTextAreaValue);
451+
requestBody.filter = jsonic(filterOrDocTextAreaValue);
452452

453453
MPG.helpers.doAjaxRequest(
454454
'POST',
@@ -627,7 +627,7 @@ MPG.eventListeners.addFind = function() {
627627
requestBody.filter = {};
628628
} else {
629629
MPG.queryHistory.push(filterOrDocTextAreaValue);
630-
requestBody.filter = JSON.parse(filterOrDocTextAreaValue);
630+
requestBody.filter = jsonic(filterOrDocTextAreaValue);
631631
}
632632

633633
requestBody.options = {};

views/database.query.tpl.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@
2222
<script src="<?php echo MPG_BASE_URL; ?>/static/js/codemirror-mode/sql.js"></script>
2323
<script src="<?php echo MPG_BASE_URL; ?>/static/js/codemirror-addon/show-hint.js"></script>
2424
<script src="<?php echo MPG_BASE_URL; ?>/static/js/codemirror-addon/mpg-hint.js"></script>
25+
<script src="<?php echo MPG_BASE_URL; ?>/static/js/jsonic.min.js"></script>
2526
<script src="<?php echo MPG_BASE_URL; ?>/static/js/jsonview.bundle.mod.js"></script>
26-
27+
2728
<script>
2829
var MPG_BASE_URL = '<?php echo MPG_BASE_URL; ?>';
2930
</script>

0 commit comments

Comments
 (0)