Skip to content

Commit 3f61505

Browse files
committed
completed
1 parent d19d1cf commit 3f61505

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/components.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ export namespace Components {
135135
"doc": any;
136136
}
137137
interface EditorPage {
138+
"mode": string;
138139
"permissions": string;
139140
"url": string;
140141
}
@@ -928,6 +929,7 @@ declare namespace LocalJSX {
928929
"doc"?: any;
929930
}
930931
interface EditorPage {
932+
"mode"?: string;
931933
"permissions"?: string;
932934
"url"?: string;
933935
}

src/components/editorPage/editor-page/editor-page.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { formatJSON } from '../../../utils/utils';
1313
export class EditorPage {
1414
@Prop() url: string;
1515
@Prop() permissions: string;
16+
@Prop() mode: string;
1617

1718
@State() selectedNodeName: string;
1819
@State() nodeList: string[] = [];
@@ -69,7 +70,7 @@ export class EditorPage {
6970
state.viewParameter.dispatch(transactionToFormatParameter);
7071
};
7172

72-
checkIfValidQuery(value) {
73+
checkIfValidDemoQuery(value: string) {
7374
const demoConstraints = ["drop", "addv", "addvertex", "addedge", "adde", "property", "addlabel"]
7475
demoConstraints.forEach(constraint => {
7576
if (value.toLowerCase().includes(constraint)) {
@@ -101,7 +102,7 @@ export class EditorPage {
101102
if (isValid) {
102103
state.timeTaken = null;
103104

104-
this.checkIfValidQuery(query)
105+
if (this.mode === "demo") this.checkIfValidDemoQuery(query)
105106

106107
const res = await axios.post(`${state.hostUrl}/query/`, {
107108
query,

src/components/editorPage/editor-page/readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
| Property | Attribute | Description | Type | Default |
1111
| ------------- | ------------- | ----------- | -------- | ----------- |
12+
| `mode` | `mode` | | `string` | `undefined` |
1213
| `permissions` | `permissions` | | `string` | `undefined` |
1314
| `url` | `url` | | `string` | `undefined` |
1415

0 commit comments

Comments
 (0)