Skip to content

Commit 49c8d5c

Browse files
author
T_S_V
committed
Small fixes
1 parent c3a3930 commit 49c8d5c

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

src/Creator.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import React from "react";
22
import SurveyCreator from "./SurveyCreator";
33

4+
import { json } from "./survey_json.js";
5+
46
export function CreatorPage() {
57
return (
68
<>
79
<h2>Survey Creator - create a new survey</h2>
8-
<SurveyCreator />
10+
<SurveyCreator json={json} />
911
</>
1012
);
1113
}

src/SurveyAnalyticsTabulator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { Component } from "react";
22
import { data, json } from "./analytics_data";
33

4-
import * as jsPDF from "jspdf";
4+
import jsPDF from "jspdf";
55
import * as XLSX from "xlsx";
66
import "jspdf-autotable";
77

src/SurveyCreator.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ import "survey-creator-core/survey-creator-core.css";
77

88
// Survey.StylesManager.applyTheme("defaultV2");
99

10-
export default function SurveyCreator() {
10+
export default function SurveyCreator(props) {
1111
let [creator, setCreator] = useState();
1212

13-
if (creator == undefined) {
13+
if (creator === undefined) {
1414
let options = { showEmbededSurveyTab: true, showLogicTab: true, showTranslationTab: true };
1515
creator = new SurveyCreatorReact.SurveyCreator(options);
1616
creator.saveSurveyFunc = (no, callback) => {
17-
console.log(JSON.stringify(creator.text));
17+
console.log(JSON.stringify(creator.JSON));
1818
callback(no, true);
1919
};
2020
// this.creator.tabs().push({
@@ -29,6 +29,8 @@ export default function SurveyCreator() {
2929
setCreator(creator);
3030
}
3131

32+
creator.JSON = props.json;
33+
3234
return (<div style={{ height: "calc(100% - 70px)" }}>
3335
{/* <script type="text/html" id="custom-tab-survey-templates">
3436
{`<div id="test">TEST</div>`}

0 commit comments

Comments
 (0)