@projectcaluma/ember-form-builder 10.0.0 → 11.0.0-beta.1
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/general.hbs +83 -90
- package/addon/components/cfb-form-editor/general.js +10 -4
- package/addon/components/cfb-form-editor/question/default.js +11 -12
- package/addon/components/cfb-form-editor/question-list/item.hbs +4 -4
- package/addon/components/cfb-form-editor/question-list.hbs +2 -2
- package/addon/components/cfb-form-editor/question-list.js +2 -2
- package/addon/components/cfb-form-editor/question.hbs +0 -1
- package/addon/components/cfb-form-list.hbs +69 -72
- package/addon/components/cfb-form-list.js +10 -33
- package/addon/components/cfb-navigation.hbs +1 -1
- package/addon/components/cfb-toggle-switch.hbs +1 -1
- package/addon/gql/fragments/field.graphql +247 -0
- package/addon/gql/fragments/form-info.graphql +1 -0
- package/addon/gql/fragments/question-info.graphql +1 -0
- package/addon/gql/mutations/add-form-question.graphql +2 -0
- package/addon/gql/mutations/remove-form-question.graphql +2 -0
- package/addon/gql/mutations/reorder-form-questions.graphql +2 -0
- package/addon/gql/mutations/save-action-button-question.graphql +1 -0
- package/addon/gql/mutations/save-calculated-float-question.graphql +1 -0
- package/addon/gql/mutations/save-choice-question.graphql +2 -0
- package/addon/gql/mutations/save-date-question.graphql +1 -0
- package/addon/gql/mutations/save-dynamic-choice-question.graphql +1 -0
- package/addon/gql/mutations/save-dynamic-multiple-choice-question.graphql +1 -0
- package/addon/gql/mutations/save-file-question.graphql +1 -0
- package/addon/gql/mutations/save-float-question.graphql +1 -0
- package/addon/gql/mutations/save-form-question.graphql +2 -0
- package/addon/gql/mutations/save-form.graphql +1 -0
- package/addon/gql/mutations/save-integer-question.graphql +1 -0
- package/addon/gql/mutations/save-multiple-choice-question.graphql +2 -0
- package/addon/gql/mutations/save-option.graphql +1 -0
- package/addon/gql/mutations/save-static-question.graphql +1 -0
- package/addon/gql/mutations/save-table-question.graphql +2 -0
- package/addon/gql/mutations/save-text-question.graphql +1 -0
- package/addon/gql/mutations/save-textarea-question.graphql +1 -0
- package/addon/gql/queries/check-form-slug.graphql +1 -0
- package/addon/gql/queries/check-question-slug.graphql +1 -0
- package/addon/gql/queries/form-editor-general.graphql +1 -0
- package/addon/gql/queries/form-editor-question.graphql +7 -0
- package/addon/gql/queries/form-list.graphql +1 -0
- package/addon/gql/queries/search-form-question.graphql +4 -0
- package/addon/gql/queries/search-question.graphql +3 -0
- package/addon/routes/edit/questions/edit.js +1 -1
- package/addon/routes/edit.js +1 -1
- package/package.json +18 -18
- package/CHANGELOG.md +0 -16
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
# We can not symlink this file so an exact copy exists in another package:
|
|
2
|
+
# packages/form-builder/addon/gql/fragments/field.graphql
|
|
3
|
+
#
|
|
4
|
+
# When changing this file the other must also receive the same changes.
|
|
5
|
+
|
|
6
|
+
fragment SimpleQuestion on Question {
|
|
7
|
+
id
|
|
8
|
+
slug
|
|
9
|
+
label
|
|
10
|
+
isRequired
|
|
11
|
+
isHidden
|
|
12
|
+
meta
|
|
13
|
+
infoText
|
|
14
|
+
... on TextQuestion {
|
|
15
|
+
textMinLength: minLength
|
|
16
|
+
textMaxLength: maxLength
|
|
17
|
+
textDefaultAnswer: defaultAnswer {
|
|
18
|
+
id
|
|
19
|
+
value
|
|
20
|
+
}
|
|
21
|
+
placeholder
|
|
22
|
+
}
|
|
23
|
+
... on TextareaQuestion {
|
|
24
|
+
textareaMinLength: minLength
|
|
25
|
+
textareaMaxLength: maxLength
|
|
26
|
+
textareaDefaultAnswer: defaultAnswer {
|
|
27
|
+
id
|
|
28
|
+
value
|
|
29
|
+
}
|
|
30
|
+
placeholder
|
|
31
|
+
}
|
|
32
|
+
... on IntegerQuestion {
|
|
33
|
+
integerMinValue: minValue
|
|
34
|
+
integerMaxValue: maxValue
|
|
35
|
+
integerDefaultAnswer: defaultAnswer {
|
|
36
|
+
id
|
|
37
|
+
value
|
|
38
|
+
}
|
|
39
|
+
placeholder
|
|
40
|
+
}
|
|
41
|
+
... on FloatQuestion {
|
|
42
|
+
floatMinValue: minValue
|
|
43
|
+
floatMaxValue: maxValue
|
|
44
|
+
floatDefaultAnswer: defaultAnswer {
|
|
45
|
+
id
|
|
46
|
+
value
|
|
47
|
+
}
|
|
48
|
+
placeholder
|
|
49
|
+
}
|
|
50
|
+
... on ChoiceQuestion {
|
|
51
|
+
choiceOptions: options {
|
|
52
|
+
edges {
|
|
53
|
+
node {
|
|
54
|
+
id
|
|
55
|
+
slug
|
|
56
|
+
label
|
|
57
|
+
isArchived
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
choiceDefaultAnswer: defaultAnswer {
|
|
62
|
+
id
|
|
63
|
+
value
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
... on MultipleChoiceQuestion {
|
|
67
|
+
multipleChoiceOptions: options {
|
|
68
|
+
edges {
|
|
69
|
+
node {
|
|
70
|
+
id
|
|
71
|
+
slug
|
|
72
|
+
label
|
|
73
|
+
isArchived
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
multipleChoiceDefaultAnswer: defaultAnswer {
|
|
78
|
+
id
|
|
79
|
+
value
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
... on DateQuestion {
|
|
83
|
+
dateDefaultAnswer: defaultAnswer {
|
|
84
|
+
id
|
|
85
|
+
value
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
... on StaticQuestion {
|
|
89
|
+
staticContent
|
|
90
|
+
}
|
|
91
|
+
... on CalculatedFloatQuestion {
|
|
92
|
+
calcExpression
|
|
93
|
+
}
|
|
94
|
+
... on ActionButtonQuestion {
|
|
95
|
+
action
|
|
96
|
+
color
|
|
97
|
+
validateOnEnter
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
fragment FieldTableQuestion on Question {
|
|
102
|
+
id
|
|
103
|
+
... on TableQuestion {
|
|
104
|
+
rowForm {
|
|
105
|
+
id
|
|
106
|
+
slug
|
|
107
|
+
questions {
|
|
108
|
+
edges {
|
|
109
|
+
node {
|
|
110
|
+
...SimpleQuestion
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
tableDefaultAnswer: defaultAnswer {
|
|
116
|
+
id
|
|
117
|
+
value {
|
|
118
|
+
id
|
|
119
|
+
answers {
|
|
120
|
+
edges {
|
|
121
|
+
node {
|
|
122
|
+
id
|
|
123
|
+
question {
|
|
124
|
+
id
|
|
125
|
+
slug
|
|
126
|
+
}
|
|
127
|
+
... on StringAnswer {
|
|
128
|
+
stringValue: value
|
|
129
|
+
}
|
|
130
|
+
... on IntegerAnswer {
|
|
131
|
+
integerValue: value
|
|
132
|
+
}
|
|
133
|
+
... on FloatAnswer {
|
|
134
|
+
floatValue: value
|
|
135
|
+
}
|
|
136
|
+
... on ListAnswer {
|
|
137
|
+
listValue: value
|
|
138
|
+
}
|
|
139
|
+
... on DateAnswer {
|
|
140
|
+
dateValue: value
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
fragment FieldQuestion on Question {
|
|
151
|
+
id
|
|
152
|
+
...SimpleQuestion
|
|
153
|
+
...FieldTableQuestion
|
|
154
|
+
... on FormQuestion {
|
|
155
|
+
subForm {
|
|
156
|
+
id
|
|
157
|
+
slug
|
|
158
|
+
name
|
|
159
|
+
questions {
|
|
160
|
+
edges {
|
|
161
|
+
node {
|
|
162
|
+
# This part here limits our query to 2 level deep nested forms. This
|
|
163
|
+
# has to be solved in another way!
|
|
164
|
+
id
|
|
165
|
+
...SimpleQuestion
|
|
166
|
+
...FieldTableQuestion
|
|
167
|
+
... on FormQuestion {
|
|
168
|
+
subForm {
|
|
169
|
+
id
|
|
170
|
+
slug
|
|
171
|
+
name
|
|
172
|
+
questions {
|
|
173
|
+
edges {
|
|
174
|
+
node {
|
|
175
|
+
...SimpleQuestion
|
|
176
|
+
...FieldTableQuestion
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
fragment SimpleAnswer on Answer {
|
|
190
|
+
id
|
|
191
|
+
question {
|
|
192
|
+
id
|
|
193
|
+
slug
|
|
194
|
+
}
|
|
195
|
+
... on StringAnswer {
|
|
196
|
+
stringValue: value
|
|
197
|
+
}
|
|
198
|
+
... on IntegerAnswer {
|
|
199
|
+
integerValue: value
|
|
200
|
+
}
|
|
201
|
+
... on FloatAnswer {
|
|
202
|
+
floatValue: value
|
|
203
|
+
}
|
|
204
|
+
... on ListAnswer {
|
|
205
|
+
listValue: value
|
|
206
|
+
}
|
|
207
|
+
... on FileAnswer {
|
|
208
|
+
fileValue: value {
|
|
209
|
+
id
|
|
210
|
+
uploadUrl
|
|
211
|
+
downloadUrl
|
|
212
|
+
metadata
|
|
213
|
+
name
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
... on DateAnswer {
|
|
217
|
+
dateValue: value
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
fragment FieldAnswer on Answer {
|
|
222
|
+
id
|
|
223
|
+
...SimpleAnswer
|
|
224
|
+
... on TableAnswer {
|
|
225
|
+
tableValue: value {
|
|
226
|
+
id
|
|
227
|
+
form {
|
|
228
|
+
id
|
|
229
|
+
slug
|
|
230
|
+
questions {
|
|
231
|
+
edges {
|
|
232
|
+
node {
|
|
233
|
+
...FieldQuestion
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
answers {
|
|
239
|
+
edges {
|
|
240
|
+
node {
|
|
241
|
+
...SimpleAnswer
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
@@ -3,11 +3,13 @@
|
|
|
3
3
|
mutation SaveMultipleChoiceQuestion($input: SaveMultipleChoiceQuestionInput!) {
|
|
4
4
|
saveMultipleChoiceQuestion(input: $input) {
|
|
5
5
|
question {
|
|
6
|
+
id
|
|
6
7
|
...QuestionInfo
|
|
7
8
|
... on MultipleChoiceQuestion {
|
|
8
9
|
options {
|
|
9
10
|
edges {
|
|
10
11
|
node {
|
|
12
|
+
id
|
|
11
13
|
label
|
|
12
14
|
slug
|
|
13
15
|
}
|
|
@@ -5,6 +5,7 @@ query FormEditorQuestion($slug: String!) {
|
|
|
5
5
|
allQuestions(filter: [{ slug: $slug }]) {
|
|
6
6
|
edges {
|
|
7
7
|
node {
|
|
8
|
+
id
|
|
8
9
|
...QuestionInfo
|
|
9
10
|
... on IntegerQuestion {
|
|
10
11
|
integerMaxValue: maxValue
|
|
@@ -52,6 +53,7 @@ query FormEditorQuestion($slug: String!) {
|
|
|
52
53
|
options {
|
|
53
54
|
edges {
|
|
54
55
|
node {
|
|
56
|
+
id
|
|
55
57
|
label
|
|
56
58
|
slug
|
|
57
59
|
isArchived
|
|
@@ -67,6 +69,7 @@ query FormEditorQuestion($slug: String!) {
|
|
|
67
69
|
options {
|
|
68
70
|
edges {
|
|
69
71
|
node {
|
|
72
|
+
id
|
|
70
73
|
label
|
|
71
74
|
slug
|
|
72
75
|
isArchived
|
|
@@ -86,10 +89,12 @@ query FormEditorQuestion($slug: String!) {
|
|
|
86
89
|
}
|
|
87
90
|
... on TableQuestion {
|
|
88
91
|
rowForm {
|
|
92
|
+
id
|
|
89
93
|
slug
|
|
90
94
|
questions {
|
|
91
95
|
edges {
|
|
92
96
|
node {
|
|
97
|
+
id
|
|
93
98
|
slug
|
|
94
99
|
label
|
|
95
100
|
}
|
|
@@ -101,6 +106,7 @@ query FormEditorQuestion($slug: String!) {
|
|
|
101
106
|
tableValue: value {
|
|
102
107
|
id
|
|
103
108
|
form {
|
|
109
|
+
id
|
|
104
110
|
slug
|
|
105
111
|
questions {
|
|
106
112
|
edges {
|
|
@@ -122,6 +128,7 @@ query FormEditorQuestion($slug: String!) {
|
|
|
122
128
|
}
|
|
123
129
|
... on FormQuestion {
|
|
124
130
|
subForm {
|
|
131
|
+
id
|
|
125
132
|
slug
|
|
126
133
|
}
|
|
127
134
|
}
|
|
@@ -4,19 +4,23 @@ query SearchFormQuestion($slug: String!, $search: String, $archived: Boolean) {
|
|
|
4
4
|
allForms(filter: [{ slug: $slug }]) {
|
|
5
5
|
edges {
|
|
6
6
|
node {
|
|
7
|
+
id
|
|
7
8
|
slug
|
|
8
9
|
questions(search: $search, isArchived: $archived) {
|
|
9
10
|
edges {
|
|
10
11
|
node {
|
|
12
|
+
id
|
|
11
13
|
...QuestionInfo
|
|
12
14
|
... on FormQuestion {
|
|
13
15
|
subForm {
|
|
16
|
+
id
|
|
14
17
|
slug
|
|
15
18
|
name
|
|
16
19
|
}
|
|
17
20
|
}
|
|
18
21
|
... on TableQuestion {
|
|
19
22
|
rowForm {
|
|
23
|
+
id
|
|
20
24
|
slug
|
|
21
25
|
name
|
|
22
26
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Route from "@ember/routing/route";
|
|
2
2
|
import { inject as service } from "@ember/service";
|
|
3
3
|
import { queryManager } from "ember-apollo-client";
|
|
4
|
-
import { lastValue, dropTask } from "ember-concurrency
|
|
4
|
+
import { lastValue, dropTask } from "ember-concurrency";
|
|
5
5
|
import { gql } from "graphql-tag";
|
|
6
6
|
|
|
7
7
|
import { navigationTitle } from "@projectcaluma/ember-form-builder/decorators";
|
package/addon/routes/edit.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Route from "@ember/routing/route";
|
|
2
2
|
import { inject as service } from "@ember/service";
|
|
3
3
|
import { queryManager } from "ember-apollo-client";
|
|
4
|
-
import { lastValue, dropTask } from "ember-concurrency
|
|
4
|
+
import { lastValue, dropTask } from "ember-concurrency";
|
|
5
5
|
import { gql } from "graphql-tag";
|
|
6
6
|
|
|
7
7
|
import { navigationTitle } from "@projectcaluma/ember-form-builder/decorators";
|