@projectcaluma/ember-form-builder 9.0.6 → 10.0.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.
Files changed (50) hide show
  1. package/addon/components/cfb-form-editor/question/validation.js +1 -1
  2. package/addon/components/cfb-form-editor/question.hbs +75 -26
  3. package/addon/components/cfb-form-editor/question.js +32 -0
  4. package/addon/gql/mutations/add-form-question.graphql +2 -2
  5. package/addon/gql/mutations/remove-form-question.graphql +2 -2
  6. package/addon/gql/mutations/reorder-form-questions.graphql +2 -2
  7. package/addon/gql/mutations/save-action-button-question.graphql +15 -0
  8. package/addon/gql/mutations/save-calculated-float-question.graphql +1 -1
  9. package/addon/gql/mutations/save-choice-question.graphql +1 -1
  10. package/addon/gql/mutations/save-date-question.graphql +1 -1
  11. package/addon/gql/mutations/save-default-date-answer.graphql +2 -6
  12. package/addon/gql/mutations/save-default-float-answer.graphql +2 -6
  13. package/addon/gql/mutations/save-default-integer-answer.graphql +2 -6
  14. package/addon/gql/mutations/save-default-list-answer.graphql +2 -6
  15. package/addon/gql/mutations/save-default-string-answer.graphql +2 -6
  16. package/addon/gql/mutations/save-default-table-answer.graphql +2 -6
  17. package/addon/gql/mutations/save-dynamic-choice-question.graphql +1 -1
  18. package/addon/gql/mutations/save-dynamic-multiple-choice-question.graphql +1 -1
  19. package/addon/gql/mutations/save-file-question.graphql +1 -1
  20. package/addon/gql/mutations/save-float-question.graphql +1 -1
  21. package/addon/gql/mutations/save-form-question.graphql +1 -1
  22. package/addon/gql/mutations/save-form.graphql +1 -1
  23. package/addon/gql/mutations/save-integer-question.graphql +1 -1
  24. package/addon/gql/mutations/save-multiple-choice-question.graphql +1 -1
  25. package/addon/gql/mutations/save-static-question.graphql +1 -1
  26. package/addon/gql/mutations/save-table-question.graphql +1 -1
  27. package/addon/gql/mutations/save-text-question.graphql +1 -1
  28. package/addon/gql/mutations/save-textarea-question.graphql +1 -1
  29. package/addon/gql/queries/form-editor-general.graphql +1 -1
  30. package/addon/gql/queries/form-editor-question.graphql +7 -3
  31. package/addon/gql/queries/form-list.graphql +1 -1
  32. package/addon/gql/queries/search-form-question.graphql +1 -1
  33. package/addon/gql/queries/search-question.graphql +1 -1
  34. package/addon/routes/edit/questions/edit.js +1 -1
  35. package/addon/routes/edit.js +1 -1
  36. package/package.json +12 -12
  37. package/translations/de.yaml +16 -2
  38. package/translations/en.yaml +16 -2
  39. package/addon/gql/fragments/field-answer.graphql +0 -57
  40. package/addon/gql/fragments/field-question.graphql +0 -159
  41. package/addon/gql/mutations/archive-form.graphql +0 -5
  42. package/addon/gql/mutations/remove-document.graphql +0 -5
  43. package/addon/gql/queries/all-format-validators.graphql +0 -12
  44. package/addon/gql/queries/all-work-items.graphql +0 -9
  45. package/addon/gql/queries/data-source.graphql +0 -10
  46. package/addon/gql/queries/get-document-answers.graphql +0 -21
  47. package/addon/gql/queries/get-document-forms.graphql +0 -20
  48. package/addon/gql/queries/get-document-used-dynamic-options.graphql +0 -12
  49. package/addon/gql/queries/get-dynamic-options.graphql +0 -29
  50. 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-form-builder/gql/queries/all-format-validators.graphql";
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 f.model "static" "calculated-float")
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
- <div class="uk-margin">
139
+ {{#if (has-question-type f.model "action-button")}}
138
140
  <f.input
139
- @label={{t "caluma.form-builder.question.infoText"}}
141
+ @label={{t "caluma.form-builder.question.confirmationText"}}
140
142
  @name="infoText"
141
- @renderComponent={{component
142
- "cfb-code-editor"
143
- language="markdown"
144
- className="uk-margin-remove-bottom"
145
- }}
143
+ @type="textarea"
146
144
  />
147
- <small class="uk-text-muted">
148
- {{t "caluma.form-builder.question.supportsMarkdownPrefix"}}
149
- <a
150
- target="_blank"
151
- rel="noopener noreferrer"
152
- href="https://www.markdownguide.org/basic-syntax"
153
- >{{t "caluma.form-builder.question.markdown"}}</a>
154
- </small>
155
- </div>
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
- <f.input
276
- @name="meta.hideLabel"
277
- @required={{true}}
278
- @label={{t "caluma.form-builder.question.hideLabel"}}
279
- @renderComponent={{component "cfb-toggle-switch" size="small"}}
280
- @on-update={{changeset-set f.model "meta.hideLabel"}}
281
- @value={{changeset-get f.model "meta.hideLabel"}}
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 (not (has-question-type f.model "static" "calculated-float"))}}
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,5 +1,5 @@
1
- # import * from '@projectcaluma/ember-form-builder/gql/fragments/form-info.graphql'
2
- # import * from '@projectcaluma/ember-form-builder/gql/fragments/question-info.graphql'
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
- # import * from '@projectcaluma/ember-form-builder/gql/fragments/form-info.graphql'
2
- # import * from '@projectcaluma/ember-form-builder/gql/fragments/question-info.graphql'
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
- # import * from '@projectcaluma/ember-form-builder/gql/fragments/form-info.graphql'
2
- # import * from '@projectcaluma/ember-form-builder/gql/fragments/question-info.graphql'
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,4 +1,4 @@
1
- # import * from '@projectcaluma/ember-form-builder/gql/fragments/question-info.graphql'
1
+ #import QuestionInfo from '../fragments/question-info.graphql'
2
2
 
3
3
  mutation SaveCalculatedFloatQuestion(
4
4
  $input: SaveCalculatedFloatQuestionInput!
@@ -1,4 +1,4 @@
1
- # import * from '@projectcaluma/ember-form-builder/gql/fragments/question-info.graphql'
1
+ #import QuestionInfo from '../fragments/question-info.graphql'
2
2
 
3
3
  mutation SaveChoiceQuestion($input: SaveChoiceQuestionInput!) {
4
4
  saveChoiceQuestion(input: $input) {
@@ -1,4 +1,4 @@
1
- # import * from '@projectcaluma/ember-form-builder/gql/fragments/question-info.graphql'
1
+ #import QuestionInfo from '../fragments/question-info.graphql'
2
2
 
3
3
  mutation SaveDateQuestion($input: SaveDateQuestionInput!) {
4
4
  saveDateQuestion(input: $input) {
@@ -1,9 +1,5 @@
1
- # import * from '@projectcaluma/ember-form-builder/gql/fragments/field-answer.graphql'
2
-
3
- mutation ($input: SaveDefaultDateAnswerInput!) {
1
+ mutation SaveDefaultDateAnswer($input: SaveDefaultDateAnswerInput!) {
4
2
  saveDefaultDateAnswer(input: $input) {
5
- answer {
6
- ...FieldAnswer
7
- }
3
+ clientMutationId
8
4
  }
9
5
  }
@@ -1,9 +1,5 @@
1
- # import * from '@projectcaluma/ember-form-builder/gql/fragments/field-answer.graphql'
2
-
3
- mutation ($input: SaveDefaultFloatAnswerInput!) {
1
+ mutation SaveDefaultFloatAnswer($input: SaveDefaultFloatAnswerInput!) {
4
2
  saveDefaultFloatAnswer(input: $input) {
5
- answer {
6
- ...FieldAnswer
7
- }
3
+ clientMutationId
8
4
  }
9
5
  }
@@ -1,9 +1,5 @@
1
- # import * from '@projectcaluma/ember-form-builder/gql/fragments/field-answer.graphql'
2
-
3
- mutation ($input: SaveDefaultIntegerAnswerInput!) {
1
+ mutation SaveDefaultIntegerAnswer($input: SaveDefaultIntegerAnswerInput!) {
4
2
  saveDefaultIntegerAnswer(input: $input) {
5
- answer {
6
- ...FieldAnswer
7
- }
3
+ clientMutationId
8
4
  }
9
5
  }
@@ -1,9 +1,5 @@
1
- # import * from '@projectcaluma/ember-form-builder/gql/fragments/field-answer.graphql'
2
-
3
- mutation ($input: SaveDefaultListAnswerInput!) {
1
+ mutation SaveDefaultListAnswer($input: SaveDefaultListAnswerInput!) {
4
2
  saveDefaultListAnswer(input: $input) {
5
- answer {
6
- ...FieldAnswer
7
- }
3
+ clientMutationId
8
4
  }
9
5
  }
@@ -1,9 +1,5 @@
1
- # import * from '@projectcaluma/ember-form-builder/gql/fragments/field-answer.graphql'
2
-
3
- mutation ($input: SaveDefaultStringAnswerInput!) {
1
+ mutation SaveDefaultStringAnswer($input: SaveDefaultStringAnswerInput!) {
4
2
  saveDefaultStringAnswer(input: $input) {
5
- answer {
6
- ...FieldAnswer
7
- }
3
+ clientMutationId
8
4
  }
9
5
  }
@@ -1,9 +1,5 @@
1
- # import * from '@projectcaluma/ember-form-builder/gql/fragments/field-answer.graphql'
2
-
3
- mutation ($input: SaveDefaultTableAnswerInput!) {
1
+ mutation SaveDefaultTableAnswer($input: SaveDefaultTableAnswerInput!) {
4
2
  saveDefaultTableAnswer(input: $input) {
5
- answer {
6
- ...FieldAnswer
7
- }
3
+ clientMutationId
8
4
  }
9
5
  }
@@ -1,4 +1,4 @@
1
- # import * from '@projectcaluma/ember-form-builder/gql/fragments/question-info.graphql'
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
- # import * from '@projectcaluma/ember-form-builder/gql/fragments/question-info.graphql'
1
+ #import QuestionInfo from '../fragments/question-info.graphql'
2
2
 
3
3
  mutation SaveDynamicMultipleChoiceQuestion(
4
4
  $input: SaveDynamicMultipleChoiceQuestionInput!
@@ -1,4 +1,4 @@
1
- # import * from '@projectcaluma/ember-form-builder/gql/fragments/question-info.graphql'
1
+ #import QuestionInfo from '../fragments/question-info.graphql'
2
2
 
3
3
  mutation SaveFileQuestion($input: SaveFileQuestionInput!) {
4
4
  saveFileQuestion(input: $input) {
@@ -1,4 +1,4 @@
1
- # import * from '@projectcaluma/ember-form-builder/gql/fragments/question-info.graphql'
1
+ #import QuestionInfo from '../fragments/question-info.graphql'
2
2
 
3
3
  mutation SaveFloatQuestion($input: SaveFloatQuestionInput!) {
4
4
  saveFloatQuestion(input: $input) {
@@ -1,4 +1,4 @@
1
- # import * from '@projectcaluma/ember-form-builder/gql/fragments/question-info.graphql'
1
+ #import QuestionInfo from '../fragments/question-info.graphql'
2
2
 
3
3
  mutation SaveFormQuestion($input: SaveFormQuestionInput!) {
4
4
  saveFormQuestion(input: $input) {
@@ -1,4 +1,4 @@
1
- # import * from '@projectcaluma/ember-form-builder/gql/fragments/form-info.graphql'
1
+ #import FormInfo from '../fragments/form-info.graphql'
2
2
 
3
3
  mutation SaveForm($input: SaveFormInput!) {
4
4
  saveForm(input: $input) {
@@ -1,4 +1,4 @@
1
- # import * from '@projectcaluma/ember-form-builder/gql/fragments/question-info.graphql'
1
+ #import QuestionInfo from '../fragments/question-info.graphql'
2
2
 
3
3
  mutation SaveIntegerQuestion($input: SaveIntegerQuestionInput!) {
4
4
  saveIntegerQuestion(input: $input) {
@@ -1,4 +1,4 @@
1
- # import * from '@projectcaluma/ember-form-builder/gql/fragments/question-info.graphql'
1
+ #import QuestionInfo from '../fragments/question-info.graphql'
2
2
 
3
3
  mutation SaveMultipleChoiceQuestion($input: SaveMultipleChoiceQuestionInput!) {
4
4
  saveMultipleChoiceQuestion(input: $input) {
@@ -1,4 +1,4 @@
1
- # import * from '@projectcaluma/ember-form-builder/gql/fragments/question-info.graphql'
1
+ #import QuestionInfo from '../fragments/question-info.graphql'
2
2
 
3
3
  mutation SaveStaticQuestion($input: SaveStaticQuestionInput!) {
4
4
  saveStaticQuestion(input: $input) {
@@ -1,4 +1,4 @@
1
- # import * from '@projectcaluma/ember-form-builder/gql/fragments/question-info.graphql'
1
+ #import QuestionInfo from '../fragments/question-info.graphql'
2
2
 
3
3
  mutation SaveTableQuestion($input: SaveTableQuestionInput!) {
4
4
  saveTableQuestion(input: $input) {
@@ -1,4 +1,4 @@
1
- # import * from '@projectcaluma/ember-form-builder/gql/fragments/question-info.graphql'
1
+ #import QuestionInfo from '../fragments/question-info.graphql'
2
2
 
3
3
  mutation SaveTextQuestion($input: SaveTextQuestionInput!) {
4
4
  saveTextQuestion(input: $input) {
@@ -1,4 +1,4 @@
1
- # import * from '@projectcaluma/ember-form-builder/gql/fragments/question-info.graphql'
1
+ #import QuestionInfo from '../fragments/question-info.graphql'
2
2
 
3
3
  mutation SaveTextareaQuestion($input: SaveTextareaQuestionInput!) {
4
4
  saveTextareaQuestion(input: $input) {
@@ -1,4 +1,4 @@
1
- # import * from '@projectcaluma/ember-form-builder/gql/fragments/form-info.graphql'
1
+ #import FormInfo from '../fragments/form-info.graphql'
2
2
 
3
3
  query FormEditorGeneral($slug: String!) {
4
4
  allForms(filter: [{ slug: $slug }]) {
@@ -1,6 +1,5 @@
1
- # import * from '@projectcaluma/ember-form-builder/gql/fragments/question-info.graphql'
2
- # import * from '@projectcaluma/ember-form-builder/gql/fragments/field-question.graphql'
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
- # import * from '@projectcaluma/ember-form-builder/gql/fragments/form-info.graphql'
1
+ #import FormInfo from '../fragments/form-info.graphql'
2
2
 
3
3
  query FormList($filter: [FormFilterSetType], $order: [FormOrderSetType]) {
4
4
  allForms(filter: $filter, order: $order) {
@@ -1,4 +1,4 @@
1
- # import * from '@projectcaluma/ember-form-builder/gql/fragments/question-info.graphql'
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 }]) {
@@ -1,4 +1,4 @@
1
- # import * from '@projectcaluma/ember-form-builder/gql/fragments/question-info.graphql'
1
+ #import QuestionInfo from '../fragments/question-info.graphql'
2
2
 
3
3
  query SearchQuestion(
4
4
  $search: String
@@ -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
 
@@ -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": "9.0.6",
3
+ "version": "10.0.1",
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": "9.1.0",
22
- "@projectcaluma/ember-form": "9.1.2",
21
+ "@projectcaluma/ember-core": "^10.0.1",
22
+ "@projectcaluma/ember-form": "^10.0.1",
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.17.3",
35
+ "ember-math-helpers": "^2.18.0",
36
36
  "ember-pikaday": "^3.0.0",
37
- "ember-power-select": "^4.1.6",
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.5",
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.1",
51
- "@projectcaluma/ember-testing": "9.0.0",
50
+ "@embroider/test-setup": "0.47.2",
51
+ "@projectcaluma/ember-testing": "9.1.0",
52
52
  "broccoli-asset-rev": "3.0.0",
53
- "ember-cli": "3.28.3",
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": "1.4.0",
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.61.0"
76
+ "webpack": "5.64.1"
77
77
  },
78
78
  "engines": {
79
- "node": "10.* || >= 12"
79
+ "node": "12.* || 14.* || >= 16"
80
80
  },
81
81
  "ember": {
82
82
  "edition": "octane"
@@ -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
 
@@ -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,159 +0,0 @@
1
- fragment SimpleQuestion on Question {
2
- slug
3
- label
4
- isRequired
5
- isHidden
6
- meta
7
- infoText
8
- ... on TextQuestion {
9
- textMinLength: minLength
10
- textMaxLength: maxLength
11
- textDefaultAnswer: defaultAnswer {
12
- value
13
- }
14
- placeholder
15
- }
16
- ... on TextareaQuestion {
17
- textareaMinLength: minLength
18
- textareaMaxLength: maxLength
19
- textareaDefaultAnswer: defaultAnswer {
20
- value
21
- }
22
- placeholder
23
- }
24
- ... on IntegerQuestion {
25
- integerMinValue: minValue
26
- integerMaxValue: maxValue
27
- integerDefaultAnswer: defaultAnswer {
28
- value
29
- }
30
- placeholder
31
- }
32
- ... on FloatQuestion {
33
- floatMinValue: minValue
34
- floatMaxValue: maxValue
35
- floatDefaultAnswer: defaultAnswer {
36
- value
37
- }
38
- placeholder
39
- }
40
- ... on ChoiceQuestion {
41
- choiceOptions: options {
42
- edges {
43
- node {
44
- slug
45
- label
46
- isArchived
47
- }
48
- }
49
- }
50
- choiceDefaultAnswer: defaultAnswer {
51
- value
52
- }
53
- }
54
- ... on MultipleChoiceQuestion {
55
- multipleChoiceOptions: options {
56
- edges {
57
- node {
58
- slug
59
- label
60
- isArchived
61
- }
62
- }
63
- }
64
- multipleChoiceDefaultAnswer: defaultAnswer {
65
- value
66
- }
67
- }
68
- ... on DateQuestion {
69
- dateDefaultAnswer: defaultAnswer {
70
- value
71
- }
72
- }
73
- ... on StaticQuestion {
74
- staticContent
75
- }
76
- ... on CalculatedFloatQuestion {
77
- calcExpression
78
- }
79
- }
80
-
81
- fragment FieldTableQuestion on Question {
82
- ... on TableQuestion {
83
- rowForm {
84
- slug
85
- questions {
86
- edges {
87
- node {
88
- ...SimpleQuestion
89
- }
90
- }
91
- }
92
- }
93
- tableDefaultAnswer: defaultAnswer {
94
- value {
95
- id
96
- answers {
97
- edges {
98
- node {
99
- id
100
- question {
101
- slug
102
- }
103
- ... on StringAnswer {
104
- stringValue: value
105
- }
106
- ... on IntegerAnswer {
107
- integerValue: value
108
- }
109
- ... on FloatAnswer {
110
- floatValue: value
111
- }
112
- ... on ListAnswer {
113
- listValue: value
114
- }
115
- ... on DateAnswer {
116
- dateValue: value
117
- }
118
- }
119
- }
120
- }
121
- }
122
- }
123
- }
124
- }
125
-
126
- fragment FieldQuestion on Question {
127
- ...SimpleQuestion
128
- ...FieldTableQuestion
129
- ... on FormQuestion {
130
- subForm {
131
- slug
132
- name
133
- questions {
134
- edges {
135
- node {
136
- # This part here limits our query to 2 level deep nested forms. This
137
- # has to be solved in another way!
138
- ...SimpleQuestion
139
- ...FieldTableQuestion
140
- ... on FormQuestion {
141
- subForm {
142
- slug
143
- name
144
- questions {
145
- edges {
146
- node {
147
- ...SimpleQuestion
148
- ...FieldTableQuestion
149
- }
150
- }
151
- }
152
- }
153
- }
154
- }
155
- }
156
- }
157
- }
158
- }
159
- }
@@ -1,5 +0,0 @@
1
- mutation ArchiveForm($input: ArchiveFormInput!) {
2
- archiveForm(input: $input) {
3
- clientMutationId
4
- }
5
- }
@@ -1,5 +0,0 @@
1
- mutation RemoveDocument($input: RemoveDocumentInput!) {
2
- removeDocument(input: $input) {
3
- clientMutationId
4
- }
5
- }
@@ -1,12 +0,0 @@
1
- query AllFormatValidators {
2
- allFormatValidators {
3
- edges {
4
- node {
5
- slug
6
- name
7
- regex
8
- errorMsg
9
- }
10
- }
11
- }
12
- }
@@ -1,9 +0,0 @@
1
- query AllWorkItems($filter: [WorkItemFilterSetType]!) {
2
- allWorkItems(filter: $filter) {
3
- edges {
4
- node {
5
- id
6
- }
7
- }
8
- }
9
- }
@@ -1,10 +0,0 @@
1
- query DataSource($name: String!) {
2
- dataSource(filter: [{ name: $name }]) {
3
- edges {
4
- node {
5
- label
6
- slug
7
- }
8
- }
9
- }
10
- }
@@ -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,12 +0,0 @@
1
- query GetDocumentUsedDynamicOptions($document: ID!, $question: ID!) {
2
- allUsedDynamicOptions(
3
- filter: [{ document: $document }, { question: $question }]
4
- ) {
5
- edges {
6
- node {
7
- slug
8
- label
9
- }
10
- }
11
- }
12
- }
@@ -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
- }
@@ -1,13 +0,0 @@
1
- query getFileAnswerInfo($id: ID!) {
2
- node(id: $id) {
3
- id
4
- ... on FileAnswer {
5
- fileValue: value {
6
- uploadUrl
7
- downloadUrl
8
- metadata
9
- name
10
- }
11
- }
12
- }
13
- }