@projectcaluma/ember-form-builder 9.0.7 → 10.0.2
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.
- package/addon/components/cfb-form-editor/question/validation.js +1 -1
- package/addon/components/cfb-form-editor/question.hbs +75 -26
- package/addon/components/cfb-form-editor/question.js +32 -0
- package/addon/gql/fragments/{field-question.graphql → field.graphql} +66 -0
- package/addon/gql/mutations/add-form-question.graphql +2 -2
- package/addon/gql/mutations/remove-form-question.graphql +2 -2
- package/addon/gql/mutations/reorder-form-questions.graphql +2 -2
- package/addon/gql/mutations/save-action-button-question.graphql +15 -0
- package/addon/gql/mutations/save-calculated-float-question.graphql +1 -1
- package/addon/gql/mutations/save-choice-question.graphql +1 -1
- package/addon/gql/mutations/save-date-question.graphql +1 -1
- package/addon/gql/mutations/save-default-date-answer.graphql +2 -6
- package/addon/gql/mutations/save-default-float-answer.graphql +2 -6
- package/addon/gql/mutations/save-default-integer-answer.graphql +2 -6
- package/addon/gql/mutations/save-default-list-answer.graphql +2 -6
- package/addon/gql/mutations/save-default-string-answer.graphql +2 -6
- package/addon/gql/mutations/save-default-table-answer.graphql +2 -6
- package/addon/gql/mutations/save-dynamic-choice-question.graphql +1 -1
- package/addon/gql/mutations/save-dynamic-multiple-choice-question.graphql +1 -1
- package/addon/gql/mutations/save-file-question.graphql +1 -1
- package/addon/gql/mutations/save-float-question.graphql +1 -1
- package/addon/gql/mutations/save-form-question.graphql +1 -1
- package/addon/gql/mutations/save-form.graphql +1 -1
- package/addon/gql/mutations/save-integer-question.graphql +1 -1
- package/addon/gql/mutations/save-multiple-choice-question.graphql +1 -1
- package/addon/gql/mutations/save-static-question.graphql +1 -1
- package/addon/gql/mutations/save-table-question.graphql +1 -1
- package/addon/gql/mutations/save-text-question.graphql +1 -1
- package/addon/gql/mutations/save-textarea-question.graphql +1 -1
- package/addon/gql/queries/form-editor-general.graphql +1 -1
- package/addon/gql/queries/form-editor-question.graphql +7 -3
- package/addon/gql/queries/form-list.graphql +1 -1
- package/addon/gql/queries/search-form-question.graphql +1 -1
- package/addon/gql/queries/search-question.graphql +1 -1
- package/addon/routes/edit/questions/edit.js +1 -1
- package/addon/routes/edit.js +1 -1
- package/package.json +12 -12
- package/translations/de.yaml +16 -2
- package/translations/en.yaml +16 -2
- package/addon/gql/fragments/field-answer.graphql +0 -57
- package/addon/gql/mutations/archive-form.graphql +0 -5
- package/addon/gql/mutations/remove-document.graphql +0 -5
- package/addon/gql/queries/all-format-validators.graphql +0 -12
- package/addon/gql/queries/all-work-items.graphql +0 -9
- package/addon/gql/queries/data-source.graphql +0 -10
- package/addon/gql/queries/get-document-answers.graphql +0 -21
- package/addon/gql/queries/get-document-forms.graphql +0 -20
- package/addon/gql/queries/get-document-used-dynamic-options.graphql +0 -12
- package/addon/gql/queries/get-dynamic-options.graphql +0 -29
- package/addon/gql/queries/get-fileanswer-info.graphql +0 -13
|
@@ -3,7 +3,7 @@ import Component from "@glimmer/component";
|
|
|
3
3
|
import { queryManager } from "ember-apollo-client";
|
|
4
4
|
import { dropTask } from "ember-concurrency";
|
|
5
5
|
|
|
6
|
-
import allFormatValidatorsQuery from "@projectcaluma/ember-
|
|
6
|
+
import allFormatValidatorsQuery from "@projectcaluma/ember-core/gql/queries/all-format-validators.graphql";
|
|
7
7
|
|
|
8
8
|
export default class CfbFormEditorQuestionValidation extends Component {
|
|
9
9
|
@queryManager apollo;
|
|
@@ -86,7 +86,9 @@
|
|
|
86
86
|
{{#if
|
|
87
87
|
(not
|
|
88
88
|
(or
|
|
89
|
-
(has-question-type
|
|
89
|
+
(has-question-type
|
|
90
|
+
f.model "static" "calculated-float" "action-button"
|
|
91
|
+
)
|
|
90
92
|
(not (includes f.model.isRequired (array "true" "false")))
|
|
91
93
|
)
|
|
92
94
|
)
|
|
@@ -134,25 +136,33 @@
|
|
|
134
136
|
</div>
|
|
135
137
|
{{/if}}
|
|
136
138
|
|
|
137
|
-
|
|
139
|
+
{{#if (has-question-type f.model "action-button")}}
|
|
138
140
|
<f.input
|
|
139
|
-
@label={{t "caluma.form-builder.question.
|
|
141
|
+
@label={{t "caluma.form-builder.question.confirmationText"}}
|
|
140
142
|
@name="infoText"
|
|
141
|
-
@
|
|
142
|
-
"cfb-code-editor"
|
|
143
|
-
language="markdown"
|
|
144
|
-
className="uk-margin-remove-bottom"
|
|
145
|
-
}}
|
|
143
|
+
@type="textarea"
|
|
146
144
|
/>
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
<
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
145
|
+
{{else}}
|
|
146
|
+
<div class="uk-margin">
|
|
147
|
+
<f.input
|
|
148
|
+
@label={{t "caluma.form-builder.question.infoText"}}
|
|
149
|
+
@name="infoText"
|
|
150
|
+
@renderComponent={{component
|
|
151
|
+
"cfb-code-editor"
|
|
152
|
+
language="markdown"
|
|
153
|
+
className="uk-margin-remove-bottom"
|
|
154
|
+
}}
|
|
155
|
+
/>
|
|
156
|
+
<small class="uk-text-muted">
|
|
157
|
+
{{t "caluma.form-builder.question.supportsMarkdownPrefix"}}
|
|
158
|
+
<a
|
|
159
|
+
target="_blank"
|
|
160
|
+
rel="noopener noreferrer"
|
|
161
|
+
href="https://www.markdownguide.org/basic-syntax"
|
|
162
|
+
>{{t "caluma.form-builder.question.markdown"}}</a>
|
|
163
|
+
</small>
|
|
164
|
+
</div>
|
|
165
|
+
{{/if}}
|
|
156
166
|
|
|
157
167
|
{{#if (has-question-type f.model "text" "textarea" "integer" "float")}}
|
|
158
168
|
<f.input
|
|
@@ -208,6 +218,27 @@
|
|
|
208
218
|
/>
|
|
209
219
|
{{/if}}
|
|
210
220
|
|
|
221
|
+
{{#if (has-question-type f.model "action-button")}}
|
|
222
|
+
<f.input
|
|
223
|
+
@type="select"
|
|
224
|
+
@options={{this.possibleActions}}
|
|
225
|
+
@optionLabelPath="label"
|
|
226
|
+
@optionTargetPath="value"
|
|
227
|
+
@label={{t "caluma.form-builder.question.action"}}
|
|
228
|
+
@name="action"
|
|
229
|
+
@required={{true}}
|
|
230
|
+
/>
|
|
231
|
+
<f.input
|
|
232
|
+
@type="select"
|
|
233
|
+
@options={{this.possibleColors}}
|
|
234
|
+
@optionLabelPath="label"
|
|
235
|
+
@optionTargetPath="value"
|
|
236
|
+
@label={{t "caluma.form-builder.question.color"}}
|
|
237
|
+
@name="color"
|
|
238
|
+
@required={{true}}
|
|
239
|
+
/>
|
|
240
|
+
{{/if}}
|
|
241
|
+
|
|
211
242
|
{{#if (has-question-type f.model "float")}}
|
|
212
243
|
<div uk-grid class="uk-grid-small uk-child-width-1-2 uk-margin">
|
|
213
244
|
<div>
|
|
@@ -272,14 +303,16 @@
|
|
|
272
303
|
/>
|
|
273
304
|
{{/if}}
|
|
274
305
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
306
|
+
{{#if (not (has-question-type f.model "action-button"))}}
|
|
307
|
+
<f.input
|
|
308
|
+
@name="meta.hideLabel"
|
|
309
|
+
@required={{true}}
|
|
310
|
+
@label={{t "caluma.form-builder.question.hideLabel"}}
|
|
311
|
+
@renderComponent={{component "cfb-toggle-switch" size="small"}}
|
|
312
|
+
@on-update={{changeset-set f.model "meta.hideLabel"}}
|
|
313
|
+
@value={{changeset-get f.model "meta.hideLabel"}}
|
|
314
|
+
/>
|
|
315
|
+
{{/if}}
|
|
283
316
|
|
|
284
317
|
{{#if (has-question-type f.model "table")}}
|
|
285
318
|
<div class="uk-margin">
|
|
@@ -428,6 +461,16 @@
|
|
|
428
461
|
</UkButton>
|
|
429
462
|
|
|
430
463
|
{{#if this.showAdvanced}}
|
|
464
|
+
{{#if (has-question-type f.model "action-button")}}
|
|
465
|
+
<f.input
|
|
466
|
+
@name="validateOnEnter"
|
|
467
|
+
@required={{true}}
|
|
468
|
+
@label={{t "caluma.form-builder.question.validateOnEnter"}}
|
|
469
|
+
@renderComponent={{component "cfb-toggle-switch" size="small"}}
|
|
470
|
+
class="uk-flex uk-flex-between uk-flex-column"
|
|
471
|
+
/>
|
|
472
|
+
{{/if}}
|
|
473
|
+
|
|
431
474
|
<div class="uk-margin">
|
|
432
475
|
<f.input
|
|
433
476
|
@label={{t "caluma.form-builder.question.isHidden"}}
|
|
@@ -436,7 +479,13 @@
|
|
|
436
479
|
/>
|
|
437
480
|
</div>
|
|
438
481
|
|
|
439
|
-
{{#if
|
|
482
|
+
{{#if
|
|
483
|
+
(not
|
|
484
|
+
(has-question-type
|
|
485
|
+
f.model "static" "calculated-float" "action-button"
|
|
486
|
+
)
|
|
487
|
+
)
|
|
488
|
+
}}
|
|
440
489
|
<div class="uk-margin">
|
|
441
490
|
<f.input
|
|
442
491
|
@label={{t "caluma.form-builder.question.isRequired"}}
|
|
@@ -16,6 +16,7 @@ import { hasQuestionType } from "@projectcaluma/ember-core/helpers/has-question-
|
|
|
16
16
|
import slugify from "@projectcaluma/ember-core/utils/slugify";
|
|
17
17
|
import addFormQuestionMutation from "@projectcaluma/ember-form-builder/gql/mutations/add-form-question.graphql";
|
|
18
18
|
import removeDefaultAnswerMutation from "@projectcaluma/ember-form-builder/gql/mutations/remove-default-answer.graphql";
|
|
19
|
+
import saveActionButtonQuestionMutation from "@projectcaluma/ember-form-builder/gql/mutations/save-action-button-question.graphql";
|
|
19
20
|
import saveCalculatedFloatQuestionMutation from "@projectcaluma/ember-form-builder/gql/mutations/save-calculated-float-question.graphql";
|
|
20
21
|
import saveChoiceQuestionMutation from "@projectcaluma/ember-form-builder/gql/mutations/save-choice-question.graphql";
|
|
21
22
|
import saveDateQuestionMutation from "@projectcaluma/ember-form-builder/gql/mutations/save-date-question.graphql";
|
|
@@ -58,8 +59,13 @@ export const TYPES = {
|
|
|
58
59
|
StaticQuestion: saveStaticQuestionMutation,
|
|
59
60
|
DateQuestion: saveDateQuestionMutation,
|
|
60
61
|
CalculatedFloatQuestion: saveCalculatedFloatQuestionMutation,
|
|
62
|
+
ActionButtonQuestion: saveActionButtonQuestionMutation,
|
|
61
63
|
};
|
|
62
64
|
|
|
65
|
+
const ACTIONS = ["COMPLETE", "SKIP"];
|
|
66
|
+
|
|
67
|
+
const COLORS = ["PRIMARY", "SECONDARY", "DEFAULT"];
|
|
68
|
+
|
|
63
69
|
const TYPES_ANSWER = {
|
|
64
70
|
StringAnswer: saveDefaultStringAnswerMutation,
|
|
65
71
|
IntegerAnswer: saveDefaultIntegerAnswerMutation,
|
|
@@ -101,6 +107,10 @@ export default class CfbFormEditorQuestion extends Component {
|
|
|
101
107
|
subForm: {},
|
|
102
108
|
meta: {},
|
|
103
109
|
dataSource: "",
|
|
110
|
+
// action button
|
|
111
|
+
action: ACTIONS[0],
|
|
112
|
+
color: COLORS[0],
|
|
113
|
+
validateOnEnter: false,
|
|
104
114
|
__typename: Object.keys(TYPES)[0],
|
|
105
115
|
},
|
|
106
116
|
},
|
|
@@ -157,6 +167,20 @@ export default class CfbFormEditorQuestion extends Component {
|
|
|
157
167
|
}));
|
|
158
168
|
}
|
|
159
169
|
|
|
170
|
+
get possibleActions() {
|
|
171
|
+
return ACTIONS.map((value) => ({
|
|
172
|
+
value,
|
|
173
|
+
label: this.intl.t(`caluma.form-builder.question.actions.${value}`),
|
|
174
|
+
}));
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
get possibleColors() {
|
|
178
|
+
return COLORS.map((value) => ({
|
|
179
|
+
value,
|
|
180
|
+
label: this.intl.t(`caluma.form-builder.question.colors.${value}`),
|
|
181
|
+
}));
|
|
182
|
+
}
|
|
183
|
+
|
|
160
184
|
get availableOverrides() {
|
|
161
185
|
const type = this.changeset.get("__typename");
|
|
162
186
|
const overrides = this.calumaOptions
|
|
@@ -292,6 +316,14 @@ export default class CfbFormEditorQuestion extends Component {
|
|
|
292
316
|
};
|
|
293
317
|
}
|
|
294
318
|
|
|
319
|
+
_getActionButtonQuestionInput(changeset) {
|
|
320
|
+
return {
|
|
321
|
+
action: changeset.get("action"),
|
|
322
|
+
color: changeset.get("color"),
|
|
323
|
+
validateOnEnter: Boolean(changeset.get("validateOnEnter")),
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
|
|
295
327
|
@task
|
|
296
328
|
*saveOptions(changeset) {
|
|
297
329
|
yield all(
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
# We can not symlink this file so an exact copy exists in another package:
|
|
2
|
+
# packages/form/addon/gql/fragments/field.graphql
|
|
3
|
+
#
|
|
4
|
+
# When changing this file the other must also receive the same changes.
|
|
5
|
+
|
|
1
6
|
fragment SimpleQuestion on Question {
|
|
2
7
|
slug
|
|
3
8
|
label
|
|
@@ -76,6 +81,11 @@ fragment SimpleQuestion on Question {
|
|
|
76
81
|
... on CalculatedFloatQuestion {
|
|
77
82
|
calcExpression
|
|
78
83
|
}
|
|
84
|
+
... on ActionButtonQuestion {
|
|
85
|
+
action
|
|
86
|
+
color
|
|
87
|
+
validateOnEnter
|
|
88
|
+
}
|
|
79
89
|
}
|
|
80
90
|
|
|
81
91
|
fragment FieldTableQuestion on Question {
|
|
@@ -157,3 +167,59 @@ fragment FieldQuestion on Question {
|
|
|
157
167
|
}
|
|
158
168
|
}
|
|
159
169
|
}
|
|
170
|
+
|
|
171
|
+
fragment SimpleAnswer on Answer {
|
|
172
|
+
id
|
|
173
|
+
question {
|
|
174
|
+
slug
|
|
175
|
+
}
|
|
176
|
+
... on StringAnswer {
|
|
177
|
+
stringValue: value
|
|
178
|
+
}
|
|
179
|
+
... on IntegerAnswer {
|
|
180
|
+
integerValue: value
|
|
181
|
+
}
|
|
182
|
+
... on FloatAnswer {
|
|
183
|
+
floatValue: value
|
|
184
|
+
}
|
|
185
|
+
... on ListAnswer {
|
|
186
|
+
listValue: value
|
|
187
|
+
}
|
|
188
|
+
... on FileAnswer {
|
|
189
|
+
fileValue: value {
|
|
190
|
+
uploadUrl
|
|
191
|
+
downloadUrl
|
|
192
|
+
metadata
|
|
193
|
+
name
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
... on DateAnswer {
|
|
197
|
+
dateValue: value
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
fragment FieldAnswer on Answer {
|
|
202
|
+
...SimpleAnswer
|
|
203
|
+
... on TableAnswer {
|
|
204
|
+
tableValue: value {
|
|
205
|
+
id
|
|
206
|
+
form {
|
|
207
|
+
slug
|
|
208
|
+
questions {
|
|
209
|
+
edges {
|
|
210
|
+
node {
|
|
211
|
+
...FieldQuestion
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
answers {
|
|
217
|
+
edges {
|
|
218
|
+
node {
|
|
219
|
+
...SimpleAnswer
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
1
|
+
#import FormInfo from '../fragments/form-info.graphql'
|
|
2
|
+
#import QuestionInfo from '../fragments/question-info.graphql'
|
|
3
3
|
|
|
4
4
|
mutation AddFormQuestion($input: AddFormQuestionInput!, $search: String) {
|
|
5
5
|
addFormQuestion(input: $input) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
1
|
+
#import FormInfo from '../fragments/form-info.graphql'
|
|
2
|
+
#import QuestionInfo from '../fragments/question-info.graphql'
|
|
3
3
|
|
|
4
4
|
mutation RemoveFormQuestion($input: RemoveFormQuestionInput!, $search: String) {
|
|
5
5
|
removeFormQuestion(input: $input) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
1
|
+
#import FormInfo from '../fragments/form-info.graphql'
|
|
2
|
+
#import QuestionInfo from '../fragments/question-info.graphql'
|
|
3
3
|
|
|
4
4
|
mutation ReorderFormQuestions(
|
|
5
5
|
$input: ReorderFormQuestionsInput!
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#import QuestionInfo from '../fragments/question-info.graphql'
|
|
2
|
+
|
|
3
|
+
mutation SaveActionButtonQuestion($input: SaveActionButtonQuestionInput!) {
|
|
4
|
+
saveActionButtonQuestion(input: $input) {
|
|
5
|
+
question {
|
|
6
|
+
...QuestionInfo
|
|
7
|
+
... on ActionButtonQuestion {
|
|
8
|
+
action
|
|
9
|
+
color
|
|
10
|
+
validateOnEnter
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
clientMutationId
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
mutation ($input: SaveDefaultDateAnswerInput!) {
|
|
1
|
+
mutation SaveDefaultDateAnswer($input: SaveDefaultDateAnswerInput!) {
|
|
4
2
|
saveDefaultDateAnswer(input: $input) {
|
|
5
|
-
|
|
6
|
-
...FieldAnswer
|
|
7
|
-
}
|
|
3
|
+
clientMutationId
|
|
8
4
|
}
|
|
9
5
|
}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
mutation ($input: SaveDefaultFloatAnswerInput!) {
|
|
1
|
+
mutation SaveDefaultFloatAnswer($input: SaveDefaultFloatAnswerInput!) {
|
|
4
2
|
saveDefaultFloatAnswer(input: $input) {
|
|
5
|
-
|
|
6
|
-
...FieldAnswer
|
|
7
|
-
}
|
|
3
|
+
clientMutationId
|
|
8
4
|
}
|
|
9
5
|
}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
mutation ($input: SaveDefaultIntegerAnswerInput!) {
|
|
1
|
+
mutation SaveDefaultIntegerAnswer($input: SaveDefaultIntegerAnswerInput!) {
|
|
4
2
|
saveDefaultIntegerAnswer(input: $input) {
|
|
5
|
-
|
|
6
|
-
...FieldAnswer
|
|
7
|
-
}
|
|
3
|
+
clientMutationId
|
|
8
4
|
}
|
|
9
5
|
}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
mutation ($input: SaveDefaultListAnswerInput!) {
|
|
1
|
+
mutation SaveDefaultListAnswer($input: SaveDefaultListAnswerInput!) {
|
|
4
2
|
saveDefaultListAnswer(input: $input) {
|
|
5
|
-
|
|
6
|
-
...FieldAnswer
|
|
7
|
-
}
|
|
3
|
+
clientMutationId
|
|
8
4
|
}
|
|
9
5
|
}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
mutation ($input: SaveDefaultStringAnswerInput!) {
|
|
1
|
+
mutation SaveDefaultStringAnswer($input: SaveDefaultStringAnswerInput!) {
|
|
4
2
|
saveDefaultStringAnswer(input: $input) {
|
|
5
|
-
|
|
6
|
-
...FieldAnswer
|
|
7
|
-
}
|
|
3
|
+
clientMutationId
|
|
8
4
|
}
|
|
9
5
|
}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
mutation ($input: SaveDefaultTableAnswerInput!) {
|
|
1
|
+
mutation SaveDefaultTableAnswer($input: SaveDefaultTableAnswerInput!) {
|
|
4
2
|
saveDefaultTableAnswer(input: $input) {
|
|
5
|
-
|
|
6
|
-
...FieldAnswer
|
|
7
|
-
}
|
|
3
|
+
clientMutationId
|
|
8
4
|
}
|
|
9
5
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
#import QuestionInfo from '../fragments/question-info.graphql'
|
|
2
2
|
|
|
3
3
|
mutation SaveDynamicChoiceQuestion($input: SaveDynamicChoiceQuestionInput!) {
|
|
4
4
|
saveDynamicChoiceQuestion(input: $input) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
#import QuestionInfo from '../fragments/question-info.graphql'
|
|
2
2
|
|
|
3
3
|
mutation SaveMultipleChoiceQuestion($input: SaveMultipleChoiceQuestionInput!) {
|
|
4
4
|
saveMultipleChoiceQuestion(input: $input) {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
3
|
-
# import SimpleAnswer from '@projectcaluma/ember-form-builder/gql/fragments/field-answer.graphql'
|
|
1
|
+
#import QuestionInfo from '../fragments/question-info.graphql'
|
|
2
|
+
#import FieldQuestion, FieldTableQuestion, SimpleAnswer, SimpleQuestion from '../fragments/field.graphql'
|
|
4
3
|
|
|
5
4
|
query FormEditorQuestion($slug: String!) {
|
|
6
5
|
allQuestions(filter: [{ slug: $slug }]) {
|
|
@@ -132,6 +131,11 @@ query FormEditorQuestion($slug: String!) {
|
|
|
132
131
|
... on CalculatedFloatQuestion {
|
|
133
132
|
calcExpression
|
|
134
133
|
}
|
|
134
|
+
... on ActionButtonQuestion {
|
|
135
|
+
action
|
|
136
|
+
color
|
|
137
|
+
validateOnEnter
|
|
138
|
+
}
|
|
135
139
|
}
|
|
136
140
|
}
|
|
137
141
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
#import QuestionInfo from '../fragments/question-info.graphql'
|
|
2
2
|
|
|
3
3
|
query SearchFormQuestion($slug: String!, $search: String, $archived: Boolean) {
|
|
4
4
|
allForms(filter: [{ slug: $slug }]) {
|
|
@@ -2,7 +2,7 @@ import Route from "@ember/routing/route";
|
|
|
2
2
|
import { inject as service } from "@ember/service";
|
|
3
3
|
import { queryManager } from "ember-apollo-client";
|
|
4
4
|
import { lastValue, dropTask } from "ember-concurrency-decorators";
|
|
5
|
-
import gql from "graphql-tag";
|
|
5
|
+
import { gql } from "graphql-tag";
|
|
6
6
|
|
|
7
7
|
import { navigationTitle } from "@projectcaluma/ember-form-builder/decorators";
|
|
8
8
|
|
package/addon/routes/edit.js
CHANGED
|
@@ -2,7 +2,7 @@ import Route from "@ember/routing/route";
|
|
|
2
2
|
import { inject as service } from "@ember/service";
|
|
3
3
|
import { queryManager } from "ember-apollo-client";
|
|
4
4
|
import { lastValue, dropTask } from "ember-concurrency-decorators";
|
|
5
|
-
import gql from "graphql-tag";
|
|
5
|
+
import { gql } from "graphql-tag";
|
|
6
6
|
|
|
7
7
|
import { navigationTitle } from "@projectcaluma/ember-form-builder/decorators";
|
|
8
8
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@projectcaluma/ember-form-builder",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.2",
|
|
4
4
|
"description": "Ember engine for building Caluma forms.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"@ember/render-modifiers": "^2.0.0",
|
|
19
19
|
"@glimmer/component": "^1.0.4",
|
|
20
20
|
"@glimmer/tracking": "^1.0.4",
|
|
21
|
-
"@projectcaluma/ember-core": "
|
|
22
|
-
"@projectcaluma/ember-form": "
|
|
21
|
+
"@projectcaluma/ember-core": "^10.0.2",
|
|
22
|
+
"@projectcaluma/ember-form": "^10.0.2",
|
|
23
23
|
"codejar": "^3.5.0",
|
|
24
24
|
"ember-apollo-client": "^3.2.0",
|
|
25
25
|
"ember-auto-import": "^2.2.3",
|
|
@@ -32,14 +32,14 @@
|
|
|
32
32
|
"ember-concurrency-decorators": "^2.0.3",
|
|
33
33
|
"ember-engines-router-service": "^0.3.0",
|
|
34
34
|
"ember-fetch": "^8.0.4",
|
|
35
|
-
"ember-math-helpers": "^2.
|
|
35
|
+
"ember-math-helpers": "^2.18.0",
|
|
36
36
|
"ember-pikaday": "^3.0.0",
|
|
37
|
-
"ember-power-select": "^4.1.
|
|
37
|
+
"ember-power-select": "^4.1.7",
|
|
38
38
|
"ember-test-selectors": "^6.0.0",
|
|
39
39
|
"ember-uikit": "^4.0.0",
|
|
40
40
|
"ember-validated-form": "^5.0.0",
|
|
41
41
|
"graphql": "^15.6.1",
|
|
42
|
-
"graphql-tag": "^2.12.
|
|
42
|
+
"graphql-tag": "^2.12.6",
|
|
43
43
|
"jexl": "^2.3.0",
|
|
44
44
|
"moment": "^2.29.1",
|
|
45
45
|
"prismjs": "^1.25.0"
|
|
@@ -47,10 +47,10 @@
|
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@ember/optional-features": "2.0.0",
|
|
49
49
|
"@ember/test-helpers": "2.6.0",
|
|
50
|
-
"@embroider/test-setup": "0.47.
|
|
51
|
-
"@projectcaluma/ember-testing": "
|
|
50
|
+
"@embroider/test-setup": "0.47.2",
|
|
51
|
+
"@projectcaluma/ember-testing": "10.0.0",
|
|
52
52
|
"broccoli-asset-rev": "3.0.0",
|
|
53
|
-
"ember-cli": "3.28.
|
|
53
|
+
"ember-cli": "3.28.4",
|
|
54
54
|
"ember-cli-code-coverage": "1.0.3",
|
|
55
55
|
"ember-cli-dependency-checker": "3.2.0",
|
|
56
56
|
"ember-cli-inject-live-reload": "2.1.0",
|
|
@@ -67,16 +67,16 @@
|
|
|
67
67
|
"ember-resolver": "8.0.3",
|
|
68
68
|
"ember-source": "3.28.6",
|
|
69
69
|
"ember-source-channel-url": "3.0.0",
|
|
70
|
-
"ember-try": "
|
|
70
|
+
"ember-try": "2.0.0",
|
|
71
71
|
"faker": "5.5.3",
|
|
72
72
|
"loader.js": "4.7.0",
|
|
73
73
|
"npm-run-all": "4.1.5",
|
|
74
74
|
"qunit": "2.17.2",
|
|
75
75
|
"qunit-dom": "2.0.0",
|
|
76
|
-
"webpack": "5.
|
|
76
|
+
"webpack": "5.64.1"
|
|
77
77
|
},
|
|
78
78
|
"engines": {
|
|
79
|
-
"node": "
|
|
79
|
+
"node": "12.* || 14.* || >= 16"
|
|
80
80
|
},
|
|
81
81
|
"ember": {
|
|
82
82
|
"edition": "octane"
|
package/translations/de.yaml
CHANGED
|
@@ -52,6 +52,7 @@ caluma:
|
|
|
52
52
|
isRequired: "Pflichtfeld"
|
|
53
53
|
staticContent: "Statischer Inhalt"
|
|
54
54
|
infoText: "Infotext"
|
|
55
|
+
confirmationText: "Bestätigungstext"
|
|
55
56
|
placeholder: "Platzhalter"
|
|
56
57
|
isHidden: "Versteckt (JEXL)"
|
|
57
58
|
widgetOverride: "Anzeigetyp"
|
|
@@ -107,12 +108,25 @@ caluma:
|
|
|
107
108
|
DynamicMultipleChoiceQuestion: "Dynamische Mehrfachauswahl"
|
|
108
109
|
DynamicChoiceQuestion: "Dynamische Einzelauswahl"
|
|
109
110
|
CalculatedFloatQuestion: "Berechnung (Gleitkommazahl)"
|
|
111
|
+
ActionButtonQuestion: "Aktionsbutton"
|
|
112
|
+
|
|
113
|
+
confirmText: "Bestätigungstext"
|
|
114
|
+
action: "Aktion"
|
|
115
|
+
color: "Farbe"
|
|
116
|
+
validateOnEnter: "Validierung beim Betreten des Fensters"
|
|
117
|
+
|
|
118
|
+
actions:
|
|
119
|
+
COMPLETE: "Abschliessen"
|
|
120
|
+
SKIP: "Überspringen"
|
|
121
|
+
|
|
122
|
+
colors:
|
|
123
|
+
PRIMARY: "Primär"
|
|
124
|
+
SECONDARY: "Sekundär"
|
|
125
|
+
DEFAULT: "Standard"
|
|
110
126
|
|
|
111
127
|
widgetOverrides:
|
|
112
128
|
powerselect: "Power Select"
|
|
113
129
|
hidden: "Versteckt"
|
|
114
|
-
dummy-one: "Dummy One"
|
|
115
|
-
dummy-two: "Dummy Two"
|
|
116
130
|
|
|
117
131
|
not-found: "Keine Frage mit dem Slug '{slug}' gefunden"
|
|
118
132
|
|
package/translations/en.yaml
CHANGED
|
@@ -52,6 +52,7 @@ caluma:
|
|
|
52
52
|
isRequired: "Required"
|
|
53
53
|
staticContent: "Static content"
|
|
54
54
|
infoText: "Information text"
|
|
55
|
+
confirmationText: "Confirmation text"
|
|
55
56
|
placeholder: "Placeholder"
|
|
56
57
|
isHidden: "Hidden (JEXL)"
|
|
57
58
|
widgetOverride: "Widget type"
|
|
@@ -107,12 +108,25 @@ caluma:
|
|
|
107
108
|
DynamicMultipleChoiceQuestion: "Dynamic choices"
|
|
108
109
|
DynamicChoiceQuestion: "Dynamic choice"
|
|
109
110
|
CalculatedFloatQuestion: "Calculation (float)"
|
|
111
|
+
ActionButtonQuestion: "Action button"
|
|
112
|
+
|
|
113
|
+
confirmText: "Confirm text"
|
|
114
|
+
action: "Action"
|
|
115
|
+
color: "Color"
|
|
116
|
+
validateOnEnter: "Validate on entering the viewport"
|
|
117
|
+
|
|
118
|
+
actions:
|
|
119
|
+
COMPLETE: "Complete"
|
|
120
|
+
SKIP: "Skip"
|
|
121
|
+
|
|
122
|
+
colors:
|
|
123
|
+
PRIMARY: "Primary"
|
|
124
|
+
SECONDARY: "Secondary"
|
|
125
|
+
DEFAULT: "Default"
|
|
110
126
|
|
|
111
127
|
widgetOverrides:
|
|
112
128
|
powerselect: "Power Select"
|
|
113
129
|
hidden: "Hidden"
|
|
114
|
-
dummy-one: "Dummy One"
|
|
115
|
-
dummy-two: "Dummy Two"
|
|
116
130
|
|
|
117
131
|
not-found: "No question with slug '{slug}' found"
|
|
118
132
|
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
# import * from '@projectcaluma/ember-form-builder/gql/fragments/field-question.graphql'
|
|
2
|
-
|
|
3
|
-
fragment SimpleAnswer on Answer {
|
|
4
|
-
id
|
|
5
|
-
question {
|
|
6
|
-
slug
|
|
7
|
-
}
|
|
8
|
-
... on StringAnswer {
|
|
9
|
-
stringValue: value
|
|
10
|
-
}
|
|
11
|
-
... on IntegerAnswer {
|
|
12
|
-
integerValue: value
|
|
13
|
-
}
|
|
14
|
-
... on FloatAnswer {
|
|
15
|
-
floatValue: value
|
|
16
|
-
}
|
|
17
|
-
... on ListAnswer {
|
|
18
|
-
listValue: value
|
|
19
|
-
}
|
|
20
|
-
... on FileAnswer {
|
|
21
|
-
fileValue: value {
|
|
22
|
-
uploadUrl
|
|
23
|
-
downloadUrl
|
|
24
|
-
metadata
|
|
25
|
-
name
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
... on DateAnswer {
|
|
29
|
-
dateValue: value
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
fragment FieldAnswer on Answer {
|
|
34
|
-
...SimpleAnswer
|
|
35
|
-
... on TableAnswer {
|
|
36
|
-
tableValue: value {
|
|
37
|
-
id
|
|
38
|
-
form {
|
|
39
|
-
slug
|
|
40
|
-
questions {
|
|
41
|
-
edges {
|
|
42
|
-
node {
|
|
43
|
-
...FieldQuestion
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
answers {
|
|
49
|
-
edges {
|
|
50
|
-
node {
|
|
51
|
-
...SimpleAnswer
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# import * from '@projectcaluma/ember-form-builder/gql/fragments/field-answer.graphql'
|
|
2
|
-
|
|
3
|
-
query ($id: ID!) {
|
|
4
|
-
allDocuments(filter: [{ id: $id }]) {
|
|
5
|
-
edges {
|
|
6
|
-
node {
|
|
7
|
-
id
|
|
8
|
-
form {
|
|
9
|
-
slug
|
|
10
|
-
}
|
|
11
|
-
answers {
|
|
12
|
-
edges {
|
|
13
|
-
node {
|
|
14
|
-
...FieldAnswer
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# import * from '@projectcaluma/ember-form-builder/gql/fragments/field-question.graphql'
|
|
2
|
-
|
|
3
|
-
query ($slug: String!) {
|
|
4
|
-
allForms(filter: [{ slug: $slug }]) {
|
|
5
|
-
edges {
|
|
6
|
-
node {
|
|
7
|
-
slug
|
|
8
|
-
name
|
|
9
|
-
meta
|
|
10
|
-
questions {
|
|
11
|
-
edges {
|
|
12
|
-
node {
|
|
13
|
-
...FieldQuestion
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
query ($question: String!) {
|
|
2
|
-
allQuestions(filter: [{ slug: $question }], first: 1) {
|
|
3
|
-
edges {
|
|
4
|
-
node {
|
|
5
|
-
slug
|
|
6
|
-
... on DynamicChoiceQuestion {
|
|
7
|
-
dynamicChoiceOptions: options {
|
|
8
|
-
edges {
|
|
9
|
-
node {
|
|
10
|
-
slug
|
|
11
|
-
label
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
... on DynamicMultipleChoiceQuestion {
|
|
17
|
-
dynamicMultipleChoiceOptions: options {
|
|
18
|
-
edges {
|
|
19
|
-
node {
|
|
20
|
-
slug
|
|
21
|
-
label
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|