@mongoosejs/studio 0.0.93 → 0.0.95
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/lint.yml +18 -0
- package/backend/actions/ChatThread/createChatMessage.js +1 -1
- package/backend/actions/ChatThread/createChatThread.js +2 -2
- package/backend/actions/Dashboard/getDashboards.js +1 -1
- package/backend/actions/Dashboard/updateDashboard.js +1 -1
- package/backend/actions/Model/createDocument.js +1 -1
- package/backend/actions/Model/deleteDocument.js +3 -3
- package/backend/actions/Model/deleteDocuments.js +2 -2
- package/backend/actions/Model/exportQueryResults.js +1 -1
- package/backend/actions/Model/getDocument.js +1 -1
- package/backend/actions/Model/getDocuments.js +2 -2
- package/backend/actions/Model/getIndexes.js +1 -1
- package/backend/actions/Model/index.js +1 -1
- package/backend/actions/Model/updateDocument.js +1 -1
- package/backend/actions/Model/updateDocuments.js +1 -1
- package/backend/authorize.js +1 -3
- package/backend/db/dashboardSchema.js +2 -2
- package/backend/helpers/removeSpecifiedPaths.js +1 -1
- package/backend/netlify.js +3 -3
- package/backend/next.js +1 -1
- package/eslint.config.js +46 -0
- package/frontend/index.js +1 -1
- package/frontend/public/app.js +122 -115
- package/frontend/src/api.js +16 -16
- package/frontend/src/chat/chat-message/chat-message.js +1 -1
- package/frontend/src/chat/chat.js +1 -1
- package/frontend/src/clone-document/clone-document.js +8 -8
- package/frontend/src/create-dashboard/create-dashboard.js +7 -7
- package/frontend/src/create-document/create-document.js +10 -10
- package/frontend/src/dashboard/dashboard.js +1 -1
- package/frontend/src/dashboard/edit-dashboard/edit-dashboard.js +3 -3
- package/frontend/src/dashboards/dashboards.js +1 -1
- package/frontend/src/document/confirm-changes/confirm-changes.js +2 -2
- package/frontend/src/document/confirm-delete/confirm-delete.js +2 -2
- package/frontend/src/document/document.js +2 -2
- package/frontend/src/document-details/document-details.js +3 -3
- package/frontend/src/document-details/document-property/document-property.js +3 -3
- package/frontend/src/edit-array/edit-array.js +1 -1
- package/frontend/src/edit-subdocument/edit-subdocument.js +1 -1
- package/frontend/src/index.js +3 -1
- package/frontend/src/list-default/list-default.js +3 -3
- package/frontend/src/models/models.js +11 -11
- package/frontend/src/navbar/navbar.js +3 -3
- package/frontend/src/update-document/update-document.js +25 -25
- package/package.json +4 -1
|
@@ -5,7 +5,7 @@ const api = require('../api');
|
|
|
5
5
|
const { BSON, EJSON } = require('bson');
|
|
6
6
|
|
|
7
7
|
const ObjectId = new Proxy(BSON.ObjectId, {
|
|
8
|
-
apply
|
|
8
|
+
apply(target, thisArg, argumentsList) {
|
|
9
9
|
return new target(...argumentsList);
|
|
10
10
|
}
|
|
11
11
|
});
|
|
@@ -14,7 +14,7 @@ const appendCSS = require('../appendCSS');
|
|
|
14
14
|
|
|
15
15
|
appendCSS(require('./update-document.css'));
|
|
16
16
|
|
|
17
|
-
const template = require('./update-document.html')
|
|
17
|
+
const template = require('./update-document.html');
|
|
18
18
|
|
|
19
19
|
module.exports = app => app.component('update-document', {
|
|
20
20
|
props: ['currentModel', 'document', 'multiple'],
|
|
@@ -23,7 +23,7 @@ module.exports = app => app.component('update-document', {
|
|
|
23
23
|
return {
|
|
24
24
|
editor: null,
|
|
25
25
|
errors: []
|
|
26
|
-
}
|
|
26
|
+
};
|
|
27
27
|
},
|
|
28
28
|
methods: {
|
|
29
29
|
async updateDocument() {
|
|
@@ -31,40 +31,40 @@ module.exports = app => app.component('update-document', {
|
|
|
31
31
|
if (this.multiple) {
|
|
32
32
|
const ids = this.document.map(x => x._id);
|
|
33
33
|
await api.Model.updateDocuments({ model: this.currentModel, _id: ids, update: data }).catch(err => {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
34
|
+
if (err.response?.data?.message) {
|
|
35
|
+
console.log(err.response.data);
|
|
36
|
+
const message = err.response.data.message.split(': ').slice(1).join(': ');
|
|
37
|
+
this.errors = message.split(',').map(error => {
|
|
38
|
+
return error.split(': ').slice(1).join(': ').trim();
|
|
39
|
+
});
|
|
40
|
+
throw new Error(err.response?.data?.message);
|
|
41
|
+
}
|
|
42
|
+
throw err;
|
|
43
43
|
});
|
|
44
44
|
} else {
|
|
45
45
|
await api.Model.updateDocument({ model: this.currentModel, _id: this.document._id, update: data }).catch(err => {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
46
|
+
if (err.response?.data?.message) {
|
|
47
|
+
console.log(err.response.data);
|
|
48
|
+
const message = err.response.data.message.split(': ').slice(1).join(': ');
|
|
49
|
+
this.errors = message.split(',').map(error => {
|
|
50
|
+
return error.split(': ').slice(1).join(': ').trim();
|
|
51
|
+
});
|
|
52
|
+
throw new Error(err.response?.data?.message);
|
|
53
|
+
}
|
|
54
|
+
throw err;
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
this.errors.length = 0;
|
|
58
58
|
this.$emit('update');
|
|
59
59
|
this.$emit('close');
|
|
60
|
-
}
|
|
60
|
+
}
|
|
61
61
|
},
|
|
62
62
|
mounted: function() {
|
|
63
|
-
this.$refs.codeEditor.value =
|
|
63
|
+
this.$refs.codeEditor.value = '{\n \n}';
|
|
64
64
|
this.editor = CodeMirror.fromTextArea(this.$refs.codeEditor, {
|
|
65
65
|
mode: 'javascript',
|
|
66
66
|
lineNumbers: true,
|
|
67
67
|
smartIndent: false
|
|
68
68
|
});
|
|
69
|
-
}
|
|
70
|
-
})
|
|
69
|
+
}
|
|
70
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mongoosejs/studio",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.95",
|
|
4
4
|
"description": "A sleek, powerful MongoDB UI with built-in dashboarding and auth, seamlessly integrated with your Express, Vercel, or Netlify app.",
|
|
5
5
|
"homepage": "https://studio.mongoosejs.io/",
|
|
6
6
|
"repository": {
|
|
@@ -25,12 +25,15 @@
|
|
|
25
25
|
"mongoose": "7.x || 8.x"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
+
"@masteringjs/eslint-config": "0.1.1",
|
|
28
29
|
"axios": "1.2.2",
|
|
30
|
+
"eslint": "9.30.0",
|
|
29
31
|
"express": "4.x",
|
|
30
32
|
"mocha": "10.2.0",
|
|
31
33
|
"mongoose": "8.x"
|
|
32
34
|
},
|
|
33
35
|
"scripts": {
|
|
36
|
+
"lint": "eslint .",
|
|
34
37
|
"tailwind": "tailwindcss -o ./frontend/public/tw.css",
|
|
35
38
|
"tailwind:watch": "tailwindcss -o ./frontend/public/tw.css --watch"
|
|
36
39
|
}
|