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