@wg-npm/survey-creator 0.3.4143 → 0.3.4169

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.
@@ -3281,11 +3281,11 @@ var __vue_render__$d = function () {var _vm=this;var _h=_vm.$createElement;var _
3281
3281
  type: 'number',
3282
3282
  trigger: 'change',
3283
3283
  message: _vm.t('survey_creator.question.scoreRequiredTip'),
3284
- }}},[_c('Select',{attrs:{"placeholder":_vm.t('survey_creator.question.selectScore')},model:{value:(_vm.value.minScore),callback:function ($$v) {_vm.$set(_vm.value, "minScore", $$v);},expression:"value.minScore"}},_vm._l((_vm.scores),function(score){return _c('Option',{key:score,attrs:{"value":score,"disabled":_vm.disabledScoreOption(score, 'left')}},[_vm._v("\n "+_vm._s(score)+"\n ")])}),1)],1)],1),_vm._v(" "),_c('Col',{staticClass:"label",attrs:{"span":1}},[_vm._v("\n "+_vm._s(_vm.t("survey_creator.question.scores"))+"\n ")]),_vm._v(" "),_c('Col',{attrs:{"span":3}},[_c('FormItem',{attrs:{"prop":("evaluationItems[" + _vm.itemIndex + "].conditions[" + _vm.index + "].payload.leftOperator"),"rules":{
3284
+ }}},[_c('Select',{attrs:{"placeholder":_vm.t('survey_creator.question.selectScore')},model:{value:(_vm.value.minScore),callback:function ($$v) {_vm.$set(_vm.value, "minScore", $$v);},expression:"value.minScore"}},_vm._l((_vm.scores),function(score){return _c('Option',{key:score,attrs:{"value":score,"disabled":_vm.disabledScoreOption(score, 'left')}},[_vm._v("\n "+_vm._s(score)+"\n ")])}),1)],1)],1),_vm._v(" "),_c('Col',{attrs:{"span":2}},[_c('FormItem',{attrs:{"prop":("evaluationItems[" + _vm.itemIndex + "].conditions[" + _vm.index + "].payload.leftOperator"),"rules":{
3285
3285
  required: true,
3286
3286
  trigger: 'change',
3287
3287
  message: _vm.t('survey_creator.question.notEmpty'),
3288
- }}},[_c('Select',{attrs:{"placeholder":_vm.t('survey_creator.question.evaluation.condition.operator')},model:{value:(_vm.value.leftOperator),callback:function ($$v) {_vm.$set(_vm.value, "leftOperator", $$v);},expression:"value.leftOperator"}},_vm._l((_vm.operators),function(operator,index){return _c('Option',{key:index,attrs:{"value":operator}},[_vm._v("\n "+_vm._s(operator)+"\n ")])}),1)],1)],1),_vm._v(" "),_c('Col',{staticClass:"label"},[_vm._v("\n "+_vm._s(_vm.t("survey_creator.question.totalScores"))+"\n ")]),_vm._v(" "),_c('Col',{attrs:{"span":3}},[_c('FormItem',{attrs:{"prop":("evaluationItems[" + _vm.itemIndex + "].conditions[" + _vm.index + "].payload.rightOperator"),"rules":{
3288
+ }}},[_c('Select',{attrs:{"placeholder":_vm.t('survey_creator.question.evaluation.condition.operator')},model:{value:(_vm.value.leftOperator),callback:function ($$v) {_vm.$set(_vm.value, "leftOperator", $$v);},expression:"value.leftOperator"}},_vm._l((_vm.operators),function(operator,index){return _c('Option',{key:index,attrs:{"value":operator}},[_vm._v("\n "+_vm._s(operator)+"\n ")])}),1)],1)],1),_vm._v(" "),_c('Col',{staticClass:"label"},[_vm._v("\n "+_vm._s(_vm.t("survey_creator.question.totalScores"))+"\n ")]),_vm._v(" "),_c('Col',{attrs:{"span":2}},[_c('FormItem',{attrs:{"prop":("evaluationItems[" + _vm.itemIndex + "].conditions[" + _vm.index + "].payload.rightOperator"),"rules":{
3289
3289
  required: true,
3290
3290
  trigger: 'change',
3291
3291
  message: _vm.t('survey_creator.question.notEmpty'),
@@ -3294,17 +3294,17 @@ var __vue_render__$d = function () {var _vm=this;var _h=_vm.$createElement;var _
3294
3294
  type: 'number',
3295
3295
  trigger: 'change',
3296
3296
  message: _vm.t('survey_creator.question.scoreRequiredTip'),
3297
- }}},[_c('Select',{attrs:{"placeholder":_vm.t('survey_creator.question.selectScore')},model:{value:(_vm.value.maxScore),callback:function ($$v) {_vm.$set(_vm.value, "maxScore", $$v);},expression:"value.maxScore"}},_vm._l((_vm.scores),function(score){return _c('Option',{key:score,attrs:{"value":score,"disabled":_vm.disabledScoreOption(score, 'right')}},[_vm._v("\n "+_vm._s(score)+"\n ")])}),1)],1)],1),_vm._v(" "),_c('Col',{staticClass:"label",attrs:{"span":1}},[_vm._v("\n "+_vm._s(_vm.t("survey_creator.question.scores"))+"\n ")])],1)};
3297
+ }}},[_c('Select',{attrs:{"placeholder":_vm.t('survey_creator.question.selectScore')},model:{value:(_vm.value.maxScore),callback:function ($$v) {_vm.$set(_vm.value, "maxScore", $$v);},expression:"value.maxScore"}},_vm._l((_vm.scores),function(score){return _c('Option',{key:score,attrs:{"value":score,"disabled":_vm.disabledScoreOption(score, 'right')}},[_vm._v("\n "+_vm._s(score)+"\n ")])}),1)],1)],1)],1)};
3298
3298
  var __vue_staticRenderFns__$d = [];
3299
3299
 
3300
3300
  /* style */
3301
3301
  const __vue_inject_styles__$d = function (inject) {
3302
3302
  if (!inject) return
3303
- inject("data-v-20053a8c_0", { source: ".label[data-v-20053a8c]{text-align:right;margin-bottom:24px}", map: undefined, media: undefined });
3303
+ inject("data-v-67c4e4b6_0", { source: ".label[data-v-67c4e4b6]{text-align:right;margin-bottom:24px}", map: undefined, media: undefined });
3304
3304
 
3305
3305
  };
3306
3306
  /* scoped */
3307
- const __vue_scope_id__$d = "data-v-20053a8c";
3307
+ const __vue_scope_id__$d = "data-v-67c4e4b6";
3308
3308
  /* module identifier */
3309
3309
  const __vue_module_identifier__$d = undefined;
3310
3310
  /* functional template */
@@ -3854,6 +3854,7 @@ var script$7 = Vue.extend({
3854
3854
  },
3855
3855
  cancel() {
3856
3856
  this.closeDrawer();
3857
+ this.$emit("cancel");
3857
3858
  }
3858
3859
  }
3859
3860
  });
@@ -3868,7 +3869,7 @@ var __vue_staticRenderFns__$7 = [function () {var _vm=this;var _h=_vm.$createEle
3868
3869
  /* style */
3869
3870
  const __vue_inject_styles__$7 = function (inject) {
3870
3871
  if (!inject) return
3871
- inject("data-v-7b8bc506_0", { source: ".drawer-footer{width:100%;position:absolute;bottom:0;left:0;border-top:1px solid #e8e8e8;padding:10px 16px;text-align:right;background:#fff;z-index:99}.question-form{margin-bottom:53px}", map: undefined, media: undefined });
3872
+ inject("data-v-80ded99c_0", { source: ".drawer-footer{width:100%;position:absolute;bottom:0;left:0;border-top:1px solid #e8e8e8;padding:10px 16px;text-align:right;background:#fff;z-index:99}.question-form{margin-bottom:53px}", map: undefined, media: undefined });
3872
3873
 
3873
3874
  };
3874
3875
  /* scoped */
@@ -4324,6 +4325,16 @@ var script$1 = Vue.extend({
4324
4325
  options: {
4325
4326
  type: Object,
4326
4327
  required: true
4328
+ },
4329
+ showQuestionWhenPageLoad: {
4330
+ type: Boolean,
4331
+ required: false,
4332
+ default: false
4333
+ },
4334
+ showQuestionType: {
4335
+ type: String,
4336
+ required: false,
4337
+ default: "EVALUATION"
4327
4338
  }
4328
4339
  },
4329
4340
  data: function () {
@@ -4355,6 +4366,15 @@ var script$1 = Vue.extend({
4355
4366
  this.currentSurvey.questions[0].active = true;
4356
4367
  }
4357
4368
  this.primaryLanguage = _.camelCase(this.currentSurvey.options.primaryLanguage);
4369
+ if (this.showQuestionWhenPageLoad) {
4370
+ const question = _.findLast(this.currentSurvey?.questions, questions => { return questions.type === this.showQuestionType; });
4371
+ if (_.isUndefined(question)) {
4372
+ this.createQuestion(this.showQuestionType);
4373
+ }
4374
+ else {
4375
+ this.showQuestionEditDrawer(question);
4376
+ }
4377
+ }
4358
4378
  },
4359
4379
  computed: {
4360
4380
  isEditMode() {
@@ -4393,12 +4413,14 @@ var script$1 = Vue.extend({
4393
4413
  this.$emit("on-save", JSON.stringify(this.getPureSurvey(this.currentSurvey)));
4394
4414
  return;
4395
4415
  }
4396
- Modal.confirm({
4397
- title: this.t("survey_creator.message.surveyLocaleNoSettingCompleted"),
4398
- onOk: () => {
4399
- this.$emit("on-save", JSON.stringify(this.getPureSurvey(this.currentSurvey)));
4400
- }
4401
- });
4416
+ if (!this.showQuestionWhenPageLoad) {
4417
+ Modal.confirm({
4418
+ title: this.t("survey_creator.message.surveyLocaleNoSettingCompleted"),
4419
+ onOk: () => {
4420
+ this.$emit("on-save", JSON.stringify(this.getPureSurvey(this.currentSurvey)));
4421
+ }
4422
+ });
4423
+ }
4402
4424
  },
4403
4425
  getPureSurvey(survey) {
4404
4426
  let temp = _.cloneDeep(survey);
@@ -4456,6 +4478,9 @@ var script$1 = Vue.extend({
4456
4478
  }
4457
4479
  BaseQuestionModel.refreshSurvey(this.currentSurvey);
4458
4480
  BaseQuestionModel.setActiveQuestion(newQuestion, this.currentSurvey.questions);
4481
+ if (this.showQuestionWhenPageLoad) {
4482
+ this.onSave();
4483
+ }
4459
4484
  },
4460
4485
  onQuestionDelete(id) {
4461
4486
  _.remove(this.currentSurvey.questions, function (question) {
@@ -4478,6 +4503,9 @@ var script$1 = Vue.extend({
4478
4503
  },
4479
4504
  validateData() {
4480
4505
  return this.allTranslationIsCompleted(this.currentSurvey);
4506
+ },
4507
+ cancel() {
4508
+ this.$emit("cancel");
4481
4509
  }
4482
4510
  }
4483
4511
  });
@@ -4486,7 +4514,7 @@ var script$1 = Vue.extend({
4486
4514
  const __vue_script__$1 = script$1;
4487
4515
 
4488
4516
  /* template */
4489
- var __vue_render__$1 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"survey-creator-wrapper"},[_c('Card',{attrs:{"shadow":""}},[_c('Row',{attrs:{"align":"middle","justify":"space-between","type":"flex"}},[_c('Col',{attrs:{"span":"20"}},[_c('Icon',{staticClass:"icon-clipboard",attrs:{"custom":"i-icon icon-clipboard","size":"24"}}),_vm._v(" "),_c('span',{staticClass:"title"},[_vm._v("\n "+_vm._s(_vm._f("translate")(_vm.survey.name.text,true))+"\n ")])],1),_vm._v(" "),_c('Col',[_c('Button',{attrs:{"icon":"ios-arrow-back"},on:{"click":_vm.onBack}},[_vm._v(_vm._s(_vm.t('survey_creator.common.back')))])],1)],1)],1),_vm._v(" "),(_vm.isPreviewMode)?_c('survey-internal-previewer',{staticStyle:{"min-height":"calc(100vh - 128px)"},attrs:{"options":this.options,"survey":this.currentSurvey,"operation-type":_vm.questionOperationType}}):_c('Card',{staticStyle:{"min-height":"calc(100vh - 128px)"},attrs:{"shadow":""}},[_c('Tabs',{attrs:{"type":"card"},model:{value:(_vm.activeTab),callback:function ($$v) {_vm.activeTab=$$v;},expression:"activeTab"}},[_c('TabPane',{attrs:{"label":_vm.t('survey_creator.common.tab.question_setting'),"name":"EDIT"}},[(_vm.activeTab == 'EDIT')?_c('div',[_c('Row',{staticClass:"survey-operate",attrs:{"type":"flex","justify":"space-between","align":"middle","gutter":48}},[_c('Col',[_c('create-question-dropdown')],1),_vm._v(" "),_c('Col',[_c('edit-options',{staticClass:"edit-option",attrs:{"survey":this.currentSurvey}})],1)],1),_vm._v(" "),_c('Scroll',{staticClass:"question-content",attrs:{"height":_vm.height}},[_c('survey-editor',{attrs:{"options":this.options,"survey":this.currentSurvey}})],1)],1):_vm._e()]),_vm._v(" "),_c('TabPane',{attrs:{"label":_vm.t('survey_creator.common.tab.language'),"name":"TRANSLATE"}},[(_vm.activeTab == 'TRANSLATE')?_c('survey-translator',{attrs:{"options":this.options,"survey":this.currentSurvey}}):_vm._e()],1)],1)],1),_vm._v(" "),_c('question-edit-drawer',{ref:"editDrawer",attrs:{"question":_vm.editingQuestion,"operation-type":_vm.operationType},model:{value:(_vm.questionEditDrawerVisible),callback:function ($$v) {_vm.questionEditDrawerVisible=$$v;},expression:"questionEditDrawerVisible"}}),_vm._v(" "),_c('Card',{attrs:{"shadow":""}},[_c('Row',{attrs:{"gutter":30,"align":"middle","justify":"center","type":"flex"}},[_c('Col',[_c('Button',{attrs:{"loading":_vm.loading,"type":"primary","disabled":_vm.isSaved},on:{"click":_vm.onSave}},[_vm._v(_vm._s(_vm.t("survey_creator.common.save"))+"\n ")])],1)],1)],1)],1)};
4517
+ var __vue_render__$1 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[(_vm.showQuestionWhenPageLoad)?_c('div',[_c('question-edit-drawer',{ref:"editDrawer",attrs:{"question":_vm.editingQuestion,"operation-type":_vm.operationType},on:{"cancel":_vm.cancel},model:{value:(_vm.questionEditDrawerVisible),callback:function ($$v) {_vm.questionEditDrawerVisible=$$v;},expression:"questionEditDrawerVisible"}})],1):_c('div',{staticClass:"survey-creator-wrapper"},[_c('Card',{attrs:{"shadow":""}},[_c('Row',{attrs:{"align":"middle","justify":"space-between","type":"flex"}},[_c('Col',{attrs:{"span":"20"}},[_c('Icon',{staticClass:"icon-clipboard",attrs:{"custom":"i-icon icon-clipboard","size":"24"}}),_vm._v(" "),_c('span',{staticClass:"title"},[_vm._v("\n "+_vm._s(_vm._f("translate")(_vm.survey.name.text,true))+"\n ")])],1),_vm._v(" "),_c('Col',[_c('Button',{attrs:{"icon":"ios-arrow-back"},on:{"click":_vm.onBack}},[_vm._v(_vm._s(_vm.t('survey_creator.common.back')))])],1)],1)],1),_vm._v(" "),(_vm.isPreviewMode)?_c('survey-internal-previewer',{staticStyle:{"min-height":"calc(100vh - 128px)"},attrs:{"options":this.options,"survey":this.currentSurvey,"operation-type":_vm.operationType}}):_c('Card',{staticStyle:{"min-height":"calc(100vh - 128px)"},attrs:{"shadow":""}},[_c('Tabs',{attrs:{"type":"card"},model:{value:(_vm.activeTab),callback:function ($$v) {_vm.activeTab=$$v;},expression:"activeTab"}},[_c('TabPane',{attrs:{"label":_vm.t('survey_creator.common.tab.question_setting'),"name":"EDIT"}},[(_vm.activeTab == 'EDIT')?_c('div',[_c('Row',{staticClass:"survey-operate",attrs:{"type":"flex","justify":"space-between","align":"middle","gutter":48}},[_c('Col',[_c('create-question-dropdown')],1),_vm._v(" "),_c('Col',[_c('edit-options',{staticClass:"edit-option",attrs:{"survey":this.currentSurvey}})],1)],1),_vm._v(" "),_c('Scroll',{staticClass:"question-content",attrs:{"height":_vm.height}},[_c('survey-editor',{attrs:{"options":this.options,"survey":this.currentSurvey}})],1)],1):_vm._e()]),_vm._v(" "),_c('TabPane',{attrs:{"label":_vm.t('survey_creator.common.tab.language'),"name":"TRANSLATE"}},[(_vm.activeTab == 'TRANSLATE')?_c('survey-translator',{attrs:{"options":this.options,"survey":this.currentSurvey}}):_vm._e()],1)],1)],1),_vm._v(" "),_c('question-edit-drawer',{ref:"editDrawer",attrs:{"question":_vm.editingQuestion,"operation-type":_vm.operationType},model:{value:(_vm.questionEditDrawerVisible),callback:function ($$v) {_vm.questionEditDrawerVisible=$$v;},expression:"questionEditDrawerVisible"}}),_vm._v(" "),_c('Card',{attrs:{"shadow":""}},[_c('Row',{attrs:{"gutter":30,"align":"middle","justify":"center","type":"flex"}},[_c('Col',[_c('Button',{attrs:{"loading":_vm.loading,"type":"primary","disabled":_vm.isSaved},on:{"click":_vm.onSave}},[_vm._v(_vm._s(_vm.t("survey_creator.common.save"))+"\n ")])],1)],1)],1)],1)])};
4490
4518
  var __vue_staticRenderFns__$1 = [];
4491
4519
 
4492
4520
  /* style */
@@ -4526,7 +4554,7 @@ var script = Vue.extend({
4526
4554
  components: { Card, Row, Col, Button, Toolbar, SurveyInternalPreviewer },
4527
4555
  provide() {
4528
4556
  return {
4529
- $rootComponent: this.$rootComponent
4557
+ $rootComponent: this
4530
4558
  };
4531
4559
  },
4532
4560
  props: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wg-npm/survey-creator",
3
- "version": "0.3.4143",
3
+ "version": "0.3.4169",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -12,8 +12,8 @@
12
12
  "lint-fix": "eslint \"**/*.ts\" \"**/*.vue\" --fix --no-error-on-unmatched-pattern"
13
13
  },
14
14
  "peerDependencies": {
15
- "@wg-npm/survey-core": "0.3.4143",
16
- "@wg-npm/survey-service-api": "0.3.4143",
15
+ "@wg-npm/survey-core": "0.3.4169",
16
+ "@wg-npm/survey-service-api": "0.3.4169",
17
17
  "axios": "^0.19.2",
18
18
  "camelcase": "^6.0.0",
19
19
  "deepmerge": "^4.2.2",
@@ -38,8 +38,8 @@
38
38
  "@typescript-eslint/eslint-plugin": "^3.6.0",
39
39
  "@typescript-eslint/parser": "^3.6.0",
40
40
  "@vue/eslint-config-prettier": "^6.0.0",
41
- "@wg-npm/survey-core": "0.3.4143",
42
- "@wg-npm/survey-service-api": "0.3.4143",
41
+ "@wg-npm/survey-core": "0.3.4169",
42
+ "@wg-npm/survey-service-api": "0.3.4169",
43
43
  "acorn": "^7.3.1",
44
44
  "axios": "^0.19.2",
45
45
  "babelrc-rollup": "^3.0.0",
@@ -30,10 +30,7 @@
30
30
  </Select>
31
31
  </FormItem>
32
32
  </Col>
33
- <Col class="label" :span="1">
34
- {{ t("survey_creator.question.scores") }}
35
- </Col>
36
- <Col :span="3">
33
+ <Col :span="2">
37
34
  <FormItem
38
35
  :prop="`evaluationItems[${itemIndex}].conditions[${index}].payload.leftOperator`"
39
36
  :rules="{
@@ -61,7 +58,7 @@
61
58
  <Col class="label">
62
59
  {{ t("survey_creator.question.totalScores") }}
63
60
  </Col>
64
- <Col :span="3">
61
+ <Col :span="2">
65
62
  <FormItem
66
63
  :prop="`evaluationItems[${itemIndex}].conditions[${index}].payload.rightOperator`"
67
64
  :rules="{
@@ -111,9 +108,6 @@
111
108
  </Select>
112
109
  </FormItem>
113
110
  </Col>
114
- <Col class="label" :span="1">
115
- {{ t("survey_creator.question.scores") }}
116
- </Col>
117
111
  </Row>
118
112
  </template>
119
113
  <script lang="ts">
@@ -126,6 +126,7 @@ export default Vue.extend({
126
126
  },
127
127
  cancel() {
128
128
  this.closeDrawer();
129
+ this.$emit("cancel")
129
130
  }
130
131
  }
131
132
  });
@@ -1,5 +1,15 @@
1
1
  <template>
2
- <div class="survey-creator-wrapper">
2
+ <div>
3
+ <div v-if="showQuestionWhenPageLoad">
4
+ <question-edit-drawer
5
+ :question="editingQuestion"
6
+ ref="editDrawer"
7
+ v-model="questionEditDrawerVisible"
8
+ :operation-type="operationType"
9
+ @cancel="cancel"
10
+ />
11
+ </div>
12
+ <div class="survey-creator-wrapper" v-else>
3
13
  <Card shadow>
4
14
  <Row align="middle" justify="space-between" type="flex">
5
15
  <Col span="20">
@@ -19,7 +29,7 @@
19
29
  :options="this.options"
20
30
  :survey="this.currentSurvey"
21
31
  v-if="isPreviewMode"
22
- :operation-type="questionOperationType"
32
+ :operation-type="operationType"
23
33
  ></survey-internal-previewer>
24
34
 
25
35
  <Card shadow v-else style="min-height: calc(100vh - 128px);">
@@ -69,6 +79,7 @@
69
79
  </Col>
70
80
  </Row>
71
81
  </Card>
82
+ </div>
72
83
  </div>
73
84
  </template>
74
85
  <script lang="ts">
@@ -136,6 +147,16 @@
136
147
  options: {
137
148
  type: Object as () => SurveyCreatorOptions,
138
149
  required: true
150
+ },
151
+ showQuestionWhenPageLoad: {
152
+ type: Boolean,
153
+ required: false,
154
+ default: false
155
+ },
156
+ showQuestionType: {
157
+ type: String,
158
+ required: false,
159
+ default: QuestionType.EVALUATION
139
160
  }
140
161
  },
141
162
  data: function () {
@@ -170,6 +191,15 @@
170
191
  this.currentSurvey.questions[0].active = true;
171
192
  }
172
193
  this.primaryLanguage = _.camelCase(this.currentSurvey.options.primaryLanguage);
194
+
195
+ if (this.showQuestionWhenPageLoad) {
196
+ const question = _.findLast(this.currentSurvey?.questions, questions=> { return questions.type === this.showQuestionType})
197
+ if (_.isUndefined(question)) {
198
+ this.createQuestion(this.showQuestionType)
199
+ } else {
200
+ this.showQuestionEditDrawer(<BaseQuestionModel>question)
201
+ }
202
+ }
173
203
  },
174
204
  computed: {
175
205
  isEditMode() {
@@ -211,16 +241,19 @@
211
241
  );
212
242
  return;
213
243
  }
214
- // @ts-ignore
215
- Modal.confirm({
244
+
245
+ if (!this.showQuestionWhenPageLoad) {
246
+ // @ts-ignore
247
+ Modal.confirm({
216
248
  title: this.t("survey_creator.message.surveyLocaleNoSettingCompleted"),
217
249
  onOk: () => {
218
- this.$emit(
219
- "on-save",
220
- JSON.stringify(this.getPureSurvey(this.currentSurvey))
221
- );
250
+ this.$emit(
251
+ "on-save",
252
+ JSON.stringify(this.getPureSurvey(this.currentSurvey))
253
+ );
222
254
  }
223
- });
255
+ });
256
+ }
224
257
  },
225
258
  getPureSurvey(survey) {
226
259
  let temp = _.cloneDeep(survey);
@@ -292,6 +325,10 @@
292
325
  newQuestion,
293
326
  this.currentSurvey.questions
294
327
  );
328
+
329
+ if (this.showQuestionWhenPageLoad) {
330
+ this.onSave()
331
+ }
295
332
  },
296
333
  onQuestionDelete(id) {
297
334
  _.remove(this.currentSurvey.questions, function (
@@ -318,6 +355,9 @@
318
355
  },
319
356
  validateData() {
320
357
  return this.allTranslationIsCompleted(this.currentSurvey);
358
+ },
359
+ cancel() {
360
+ this.$emit("cancel")
321
361
  }
322
362
  }
323
363
  });
@@ -36,7 +36,7 @@
36
36
  components: {Card, Row, Col, Button, Toolbar, SurveyInternalPreviewer},
37
37
  provide() {
38
38
  return {
39
- $rootComponent: this.$rootComponent
39
+ $rootComponent: this
40
40
  };
41
41
  },
42
42
  props: {