PreReq scripts and Test scripts now use JSEditor
This commit is contained in:
@@ -112,18 +112,11 @@ export default {
|
||||
provideLinting: debounce(function (code) {
|
||||
try {
|
||||
const res = esprima.parseScript(code, { tolerant: true })
|
||||
console.log(res)
|
||||
if (res.errors && res.errors.length > 0) {
|
||||
this.editor.session.setAnnotations(
|
||||
res.errors.map((err) => {
|
||||
const pos = this.editor.session.getDocument().indexToPosition(err.index, 0)
|
||||
|
||||
console.log({
|
||||
row: pos.row,
|
||||
column: pos.column,
|
||||
text: err.description,
|
||||
type: "error",
|
||||
})
|
||||
return {
|
||||
row: pos.row,
|
||||
column: pos.column,
|
||||
|
||||
@@ -821,9 +821,8 @@
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<Editor
|
||||
<JSEditor
|
||||
v-model="preRequestScript"
|
||||
:lang="'javascript'"
|
||||
:options="{
|
||||
maxLines: '16',
|
||||
minLines: '8',
|
||||
@@ -867,9 +866,8 @@
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<Editor
|
||||
<JSEditor
|
||||
v-model="testScript"
|
||||
:lang="'javascript'"
|
||||
:options="{
|
||||
maxLines: '16',
|
||||
minLines: '8',
|
||||
@@ -1254,6 +1252,7 @@ import getEnvironmentVariablesFromScript from "~/helpers/preRequest"
|
||||
import runTestScriptWithVariables from "~/helpers/postwomanTesting"
|
||||
import parseTemplateString from "~/helpers/templating"
|
||||
import AceEditor from "~/components/ui/ace-editor"
|
||||
import JSEditor from "~/components/ui/js-editor"
|
||||
import { tokenRequest, oauthRedirect } from "~/assets/js/oauth"
|
||||
import { cancelRunningRequest, sendNetworkRequest } from "~/helpers/network"
|
||||
import { fb } from "~/helpers/fb"
|
||||
@@ -1322,6 +1321,7 @@ export default {
|
||||
collections: () => import("~/components/collections"),
|
||||
saveRequestAs: () => import("~/components/collections/saveRequestAs"),
|
||||
Editor: AceEditor,
|
||||
JSEditor: JSEditor,
|
||||
environments: () => import("~/components/environments"),
|
||||
inputform: () => import("~/components/firebase/inputform"),
|
||||
notes: () => import("~/components/firebase/feeds"),
|
||||
|
||||
Reference in New Issue
Block a user