@projectcaluma/ember-form-builder 10.0.3 → 11.0.0-beta.4
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/CHANGELOG.md +1089 -0
- package/addon/components/cfb-form-editor/general.hbs +83 -90
- package/addon/components/cfb-form-editor/general.js +11 -6
- package/addon/components/cfb-form-editor/question/default.js +11 -12
- package/addon/components/cfb-form-editor/question/options.hbs +1 -1
- package/addon/components/cfb-form-editor/question/validation.hbs +1 -0
- package/addon/components/cfb-form-editor/question-list/item.hbs +4 -4
- package/addon/components/cfb-form-editor/question-list/item.js +2 -2
- package/addon/components/cfb-form-editor/question-list.hbs +6 -6
- package/addon/components/cfb-form-editor/question-list.js +5 -6
- package/addon/components/cfb-form-editor/question.hbs +3 -2
- package/addon/components/cfb-form-editor/question.js +4 -3
- package/addon/components/cfb-form-editor.hbs +5 -5
- package/addon/components/cfb-form-list/item.hbs +1 -1
- package/addon/components/cfb-form-list.hbs +69 -72
- package/addon/components/cfb-form-list.js +10 -33
- package/addon/components/cfb-toggle-switch.hbs +1 -1
- package/addon/engine.js +7 -10
- package/addon/routes/edit/questions/edit.js +1 -1
- package/addon/routes/edit.js +1 -1
- package/addon/templates/edit/questions/edit.hbs +1 -1
- package/addon/templates/edit/questions/new.hbs +1 -4
- package/addon/templates/edit.hbs +5 -5
- package/addon/templates/index.hbs +1 -1
- package/addon/templates/new.hbs +1 -1
- package/addon/utils/and.js +47 -0
- package/addon/utils/or.js +40 -0
- package/addon/validations/option.js +1 -1
- package/addon/validations/question.js +2 -2
- package/addon/validators/slug.js +1 -1
- package/app/utils/and.js +1 -0
- package/app/utils/or.js +1 -0
- package/index.js +6 -4
- package/package.json +28 -23
|
@@ -1,98 +1,91 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
>
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
@label={{t "caluma.form-builder.form.name"}}
|
|
19
|
-
@name="name"
|
|
20
|
-
@required={{true}}
|
|
21
|
-
@on-update={{this.updateName}}
|
|
22
|
-
/>
|
|
1
|
+
{{#if this._data.isRunning}}
|
|
2
|
+
<div class="uk-flex uk-flex-center uk-flex-middle uk-height-small">
|
|
3
|
+
<UkSpinner ratio="2" />
|
|
4
|
+
</div>
|
|
5
|
+
{{else if this.data}}
|
|
6
|
+
<ValidatedForm
|
|
7
|
+
@model={{changeset this.data this.Validations}}
|
|
8
|
+
@on-submit={{perform this.submit}}
|
|
9
|
+
as |f|
|
|
10
|
+
>
|
|
11
|
+
<f.input
|
|
12
|
+
@type="text"
|
|
13
|
+
@label={{t "caluma.form-builder.form.name"}}
|
|
14
|
+
@name="name"
|
|
15
|
+
@required={{true}}
|
|
16
|
+
@on-update={{this.updateName}}
|
|
17
|
+
/>
|
|
23
18
|
|
|
24
|
-
|
|
19
|
+
{{#if (or @slug (not this.prefix))}}
|
|
20
|
+
<f.input
|
|
21
|
+
@type="text"
|
|
22
|
+
@name="slug"
|
|
23
|
+
@label={{t "caluma.form-builder.form.slug"}}
|
|
24
|
+
@required={{true}}
|
|
25
|
+
@disabled={{@slug}}
|
|
26
|
+
@on-update={{this.updateSlug}}
|
|
27
|
+
/>
|
|
28
|
+
{{else}}
|
|
29
|
+
<f.input
|
|
30
|
+
@name="slug"
|
|
31
|
+
@required={{true}}
|
|
32
|
+
@disabled={{@slug}}
|
|
33
|
+
@label={{t "caluma.form-builder.question.slug"}}
|
|
34
|
+
@on-update={{this.updateSlug value="target.value"}}
|
|
35
|
+
as |fi|
|
|
36
|
+
>
|
|
37
|
+
<div class="cfb-prefixed">
|
|
38
|
+
<span class="cfb-prefixed-slug">{{this.prefix}}</span>
|
|
25
39
|
<f.input
|
|
26
40
|
@type="text"
|
|
27
|
-
@
|
|
28
|
-
@
|
|
29
|
-
@
|
|
30
|
-
@
|
|
31
|
-
@
|
|
41
|
+
@model={{fi.model}}
|
|
42
|
+
@name={{fi.name}}
|
|
43
|
+
@value={{fi.value}}
|
|
44
|
+
@update={{fi.update}}
|
|
45
|
+
@setDirty={{fi.setDirty}}
|
|
46
|
+
@inputId={{fi.inputId}}
|
|
47
|
+
@isValid={{fi.isValid}}
|
|
48
|
+
@isInvalid={{fi.isInvalid}}
|
|
32
49
|
/>
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
@required={{true}}
|
|
37
|
-
@disabled={{@slug}}
|
|
38
|
-
@label={{t "caluma.form-builder.question.slug"}}
|
|
39
|
-
@on-update={{this.updateSlug value="target.value"}}
|
|
40
|
-
as |fi|
|
|
41
|
-
>
|
|
42
|
-
<div class="cfb-prefixed">
|
|
43
|
-
<span class="cfb-prefixed-slug">{{this.prefix}}</span>
|
|
44
|
-
<f.input
|
|
45
|
-
@type="text"
|
|
46
|
-
@model={{fi.model}}
|
|
47
|
-
@name={{fi.name}}
|
|
48
|
-
@value={{fi.value}}
|
|
49
|
-
@update={{fi.update}}
|
|
50
|
-
@setDirty={{fi.setDirty}}
|
|
51
|
-
@inputId={{fi.inputId}}
|
|
52
|
-
@isValid={{fi.isValid}}
|
|
53
|
-
@isInvalid={{fi.isInvalid}}
|
|
54
|
-
/>
|
|
55
|
-
</div>
|
|
56
|
-
</f.input>
|
|
57
|
-
{{/if}}
|
|
50
|
+
</div>
|
|
51
|
+
</f.input>
|
|
52
|
+
{{/if}}
|
|
58
53
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
54
|
+
<f.input
|
|
55
|
+
@name="description"
|
|
56
|
+
@type="textarea"
|
|
57
|
+
@label={{t "caluma.form-builder.form.description"}}
|
|
58
|
+
@rows="4"
|
|
59
|
+
/>
|
|
65
60
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
61
|
+
<f.input
|
|
62
|
+
class="uk-flex uk-flex-between uk-flex-column"
|
|
63
|
+
@name="isArchived"
|
|
64
|
+
@label={{t "caluma.form-builder.form.isArchived"}}
|
|
65
|
+
@required={{true}}
|
|
66
|
+
@renderComponent={{component "cfb-toggle-switch" size="small"}}
|
|
67
|
+
/>
|
|
73
68
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
69
|
+
<f.input
|
|
70
|
+
class="uk-flex uk-flex-between uk-flex-column"
|
|
71
|
+
@name="isPublished"
|
|
72
|
+
@label={{t "caluma.form-builder.form.isPublished"}}
|
|
73
|
+
@required={{true}}
|
|
74
|
+
@renderComponent={{component "cfb-toggle-switch" size="small"}}
|
|
75
|
+
/>
|
|
81
76
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
{{/if}}
|
|
98
|
-
</div>
|
|
77
|
+
<div class="uk-text-right">
|
|
78
|
+
<f.submit
|
|
79
|
+
@disabled={{or f.loading f.model.isInvalid}}
|
|
80
|
+
@label={{t "caluma.form-builder.global.save"}}
|
|
81
|
+
/>
|
|
82
|
+
</div>
|
|
83
|
+
</ValidatedForm>
|
|
84
|
+
{{else}}
|
|
85
|
+
<div
|
|
86
|
+
class="uk-text-center uk-text-muted uk-padding uk-padding-remove-horizontal"
|
|
87
|
+
>
|
|
88
|
+
<UkIcon @icon="bolt" @ratio={{5}} />
|
|
89
|
+
<p>{{t "caluma.form-builder.form.not-found" slug=@slug}}</p>
|
|
90
|
+
</div>
|
|
91
|
+
{{/if}}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { getOwner } from "@ember/application";
|
|
2
|
-
import { A } from "@ember/array";
|
|
3
2
|
import { action } from "@ember/object";
|
|
4
3
|
import { inject as service } from "@ember/service";
|
|
5
4
|
import Component from "@glimmer/component";
|
|
6
5
|
import { queryManager } from "ember-apollo-client";
|
|
7
|
-
import { optional } from "ember-composable-helpers/helpers/optional";
|
|
8
6
|
import { timeout, restartableTask, dropTask } from "ember-concurrency";
|
|
7
|
+
import { useTask } from "ember-resources";
|
|
9
8
|
|
|
10
9
|
import FormValidations from "../../validations/form";
|
|
11
10
|
|
|
@@ -22,10 +21,16 @@ export default class CfbFormEditorGeneral extends Component {
|
|
|
22
21
|
|
|
23
22
|
Validations = FormValidations;
|
|
24
23
|
|
|
24
|
+
get data() {
|
|
25
|
+
return this._data.value?.[0]?.node;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
_data = useTask(this, this.fetchData, () => [this.args.slug]);
|
|
29
|
+
|
|
25
30
|
@restartableTask
|
|
26
|
-
*
|
|
31
|
+
*fetchData() {
|
|
27
32
|
if (!this.args.slug) {
|
|
28
|
-
return
|
|
33
|
+
return [
|
|
29
34
|
{
|
|
30
35
|
node: {
|
|
31
36
|
name: "",
|
|
@@ -34,7 +39,7 @@ export default class CfbFormEditorGeneral extends Component {
|
|
|
34
39
|
isPublished: true,
|
|
35
40
|
},
|
|
36
41
|
},
|
|
37
|
-
]
|
|
42
|
+
];
|
|
38
43
|
}
|
|
39
44
|
|
|
40
45
|
return yield this.apollo.watchQuery(
|
|
@@ -83,7 +88,7 @@ export default class CfbFormEditorGeneral extends Component {
|
|
|
83
88
|
)
|
|
84
89
|
);
|
|
85
90
|
|
|
86
|
-
|
|
91
|
+
this.args.onAfterSubmit?.(form);
|
|
87
92
|
} catch (e) {
|
|
88
93
|
this.notification.danger(
|
|
89
94
|
this.intl.t(
|
|
@@ -92,18 +92,17 @@ export default class CfbFormEditorQuestionDefault extends Component {
|
|
|
92
92
|
: null,
|
|
93
93
|
}));
|
|
94
94
|
}
|
|
95
|
-
|
|
96
|
-
const document =
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
});
|
|
95
|
+
const owner = getOwner(this);
|
|
96
|
+
const document = new (owner.factoryFor("caluma-model:document").class)({
|
|
97
|
+
raw: {
|
|
98
|
+
id: btoa(`Document:dv-document-${this.args.model.slug}`),
|
|
99
|
+
rootForm,
|
|
100
|
+
forms: [rootForm],
|
|
101
|
+
answers: [answer],
|
|
102
|
+
__typename: "Document",
|
|
103
|
+
},
|
|
104
|
+
owner,
|
|
105
|
+
});
|
|
107
106
|
|
|
108
107
|
return document.findField(this.question.slug);
|
|
109
108
|
}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
@question.isArchived
|
|
5
5
|
"cfb-form-editor__question-list__item__archived"
|
|
6
6
|
}}
|
|
7
|
-
{{did-insert (fn (optional @
|
|
8
|
-
{{will-destroy (fn (optional @
|
|
7
|
+
{{did-insert (fn (optional @onRegister) this.elementId @question.slug)}}
|
|
8
|
+
{{will-destroy (fn (optional @onUnregister) this.elementId @question.slug)}}
|
|
9
9
|
...attributes
|
|
10
10
|
>
|
|
11
11
|
<div class="uk-flex uk-flex-middle">
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
data-test-remove-item
|
|
25
25
|
uk-icon="minus"
|
|
26
26
|
class="cfb-pointer uk-text-danger"
|
|
27
|
-
{{on "click" (fn (optional @
|
|
27
|
+
{{on "click" (fn (optional @onRemoveQuestion) @question)}}
|
|
28
28
|
>
|
|
29
29
|
</i>
|
|
30
30
|
{{else if (eq @mode "add")}}
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
data-test-add-item
|
|
34
34
|
uk-icon="plus"
|
|
35
35
|
class="cfb-pointer uk-text-success"
|
|
36
|
-
{{on "click" (fn (optional @
|
|
36
|
+
{{on "click" (fn (optional @onAddQuestion) @question)}}
|
|
37
37
|
>
|
|
38
38
|
</i>
|
|
39
39
|
{{/if}}
|
|
@@ -51,12 +51,12 @@ export default class CfbFormEditorQuestionListItem extends Component {
|
|
|
51
51
|
@action
|
|
52
52
|
editQuestion(question, e) {
|
|
53
53
|
e.preventDefault();
|
|
54
|
-
this.args
|
|
54
|
+
this.args.onEditQuestion?.(question);
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
@action
|
|
58
58
|
clickForm(form, e) {
|
|
59
59
|
e.preventDefault();
|
|
60
|
-
this.args
|
|
60
|
+
this.args.onClickForm?.(form);
|
|
61
61
|
}
|
|
62
62
|
}
|
|
@@ -76,12 +76,12 @@
|
|
|
76
76
|
data-test-question-list-item={{item.node.slug}}
|
|
77
77
|
@mode={{this.mode}}
|
|
78
78
|
@question={{item.node}}
|
|
79
|
-
@
|
|
80
|
-
@
|
|
81
|
-
@
|
|
82
|
-
@
|
|
83
|
-
@
|
|
84
|
-
@
|
|
79
|
+
@onEditQuestion={{@onEditQuestion}}
|
|
80
|
+
@onRemoveQuestion={{perform this.removeQuestion}}
|
|
81
|
+
@onAddQuestion={{perform this.addQuestion}}
|
|
82
|
+
@onClickForm={{@onClickForm}}
|
|
83
|
+
@onRegister={{this.registerChild}}
|
|
84
|
+
@onUnregister={{this.unregisterChild}}
|
|
85
85
|
/>
|
|
86
86
|
{{else}}
|
|
87
87
|
<li
|
|
@@ -4,13 +4,12 @@ import { inject as service } from "@ember/service";
|
|
|
4
4
|
import Component from "@glimmer/component";
|
|
5
5
|
import { tracked } from "@glimmer/tracking";
|
|
6
6
|
import { queryManager } from "ember-apollo-client";
|
|
7
|
-
import { optional } from "ember-composable-helpers/helpers/optional";
|
|
8
|
-
import { timeout } from "ember-concurrency";
|
|
9
7
|
import {
|
|
8
|
+
timeout,
|
|
10
9
|
enqueueTask,
|
|
11
10
|
lastValue,
|
|
12
11
|
restartableTask,
|
|
13
|
-
} from "ember-concurrency
|
|
12
|
+
} from "ember-concurrency";
|
|
14
13
|
import UIkit from "uikit";
|
|
15
14
|
|
|
16
15
|
import addFormQuestionMutation from "@projectcaluma/ember-form-builder/gql/mutations/add-form-question.graphql";
|
|
@@ -148,7 +147,7 @@ export default class ComponentsCfbFormEditorQuestionList extends Component {
|
|
|
148
147
|
|
|
149
148
|
this.questionTask.perform();
|
|
150
149
|
|
|
151
|
-
|
|
150
|
+
this.args.onAfterAddQuestion?.(question);
|
|
152
151
|
} catch (e) {
|
|
153
152
|
this.notification.danger(
|
|
154
153
|
this.intl.t("caluma.form-builder.notification.form.add-question.error")
|
|
@@ -176,7 +175,7 @@ export default class ComponentsCfbFormEditorQuestionList extends Component {
|
|
|
176
175
|
)
|
|
177
176
|
);
|
|
178
177
|
|
|
179
|
-
|
|
178
|
+
this.args.onAfterRemoveQuestion?.(question);
|
|
180
179
|
} catch (e) {
|
|
181
180
|
this.notification.danger(
|
|
182
181
|
this.intl.t(
|
|
@@ -238,7 +237,7 @@ export default class ComponentsCfbFormEditorQuestionList extends Component {
|
|
|
238
237
|
createNewQuestion(e) {
|
|
239
238
|
e.preventDefault();
|
|
240
239
|
|
|
241
|
-
this.args
|
|
240
|
+
this.args.onCreateQuestion?.();
|
|
242
241
|
this.setMode("reorder");
|
|
243
242
|
}
|
|
244
243
|
}
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
>
|
|
12
12
|
{{#if (and f.model.isDirty @slug)}}
|
|
13
13
|
<div class="uk-alert-warning uk-animation-fade" uk-alert>
|
|
14
|
-
<a href="#" class="uk-alert-close" uk-close></a>
|
|
15
14
|
<div uk-grid class="uk-grid-small">
|
|
16
15
|
<div class="uk-width-auto uk-flex uk-flex-middle">
|
|
17
16
|
<UkIcon @icon="warning" @ratio={{1.2}} />
|
|
@@ -342,6 +341,7 @@
|
|
|
342
341
|
@noMatchesMessage={{t
|
|
343
342
|
"caluma.form-builder.question.search-empty"
|
|
344
343
|
}}
|
|
344
|
+
@renderInPlace={{true}}
|
|
345
345
|
as |form|
|
|
346
346
|
>
|
|
347
347
|
<span
|
|
@@ -414,6 +414,7 @@
|
|
|
414
414
|
"caluma.form-builder.question.search-placeholder"
|
|
415
415
|
}}
|
|
416
416
|
@noMatchesMessage={{t "caluma.form-builder.question.search-empty"}}
|
|
417
|
+
@renderInPlace={{true}}
|
|
417
418
|
as |form|
|
|
418
419
|
>
|
|
419
420
|
<span class="uk-width-auto uk-margin-small-right uk-text-truncate">
|
|
@@ -449,7 +450,7 @@
|
|
|
449
450
|
|
|
450
451
|
<UkButton
|
|
451
452
|
@color="link"
|
|
452
|
-
@
|
|
453
|
+
@onClick={{toggle-action "showAdvanced" this}}
|
|
453
454
|
class="uk-flex uk-flex-middle uk-margin"
|
|
454
455
|
>
|
|
455
456
|
{{#if this.showAdvanced}}
|
|
@@ -8,7 +8,6 @@ import { tracked } from "@glimmer/tracking";
|
|
|
8
8
|
import { queryManager } from "ember-apollo-client";
|
|
9
9
|
import Changeset from "ember-changeset";
|
|
10
10
|
import lookupValidator from "ember-changeset-validations";
|
|
11
|
-
import { optional } from "ember-composable-helpers/helpers/optional";
|
|
12
11
|
import { dropTask, restartableTask, task, timeout } from "ember-concurrency";
|
|
13
12
|
import { all } from "rsvp";
|
|
14
13
|
|
|
@@ -222,7 +221,9 @@ export default class CfbFormEditorQuestion extends Component {
|
|
|
222
221
|
isArchived: changeset.get("isArchived"),
|
|
223
222
|
};
|
|
224
223
|
|
|
225
|
-
if (
|
|
224
|
+
if (
|
|
225
|
+
!hasQuestionType(changeset, "static", "calculated-float", "action-button")
|
|
226
|
+
) {
|
|
226
227
|
Object.assign(input, {
|
|
227
228
|
isRequired: changeset.get("isRequired"),
|
|
228
229
|
});
|
|
@@ -406,7 +407,7 @@ export default class CfbFormEditorQuestion extends Component {
|
|
|
406
407
|
this.intl.t("caluma.form-builder.notification.question.save.success")
|
|
407
408
|
);
|
|
408
409
|
|
|
409
|
-
|
|
410
|
+
this.args.onAfterSubmit?.(question);
|
|
410
411
|
} catch (e) {
|
|
411
412
|
// eslint-disable-next-line no-console
|
|
412
413
|
console.error(e);
|
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
{{else}}
|
|
13
13
|
<CfbFormEditor::QuestionList
|
|
14
14
|
@form={{@slug}}
|
|
15
|
-
@
|
|
16
|
-
@
|
|
17
|
-
@
|
|
18
|
-
@
|
|
19
|
-
@
|
|
15
|
+
@onEditQuestion={{@onEditQuestion}}
|
|
16
|
+
@onCreateQuestion={{@onCreateQuestion}}
|
|
17
|
+
@onAfterAddQuestion={{@onAfterAddQuestion}}
|
|
18
|
+
@onAfterRemoveQuestion={{@onAfterRemoveQuestion}}
|
|
19
|
+
@onClickForm={{@onClickForm}}
|
|
20
20
|
/>
|
|
21
21
|
{{/if}}
|
|
22
22
|
</div>
|
|
@@ -1,76 +1,73 @@
|
|
|
1
|
-
<div
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
{{did-update (perform this.fetchForms)}}
|
|
5
|
-
>
|
|
6
|
-
<div class="uk-flex uk-flex-between">
|
|
7
|
-
<div class="uk-button-group">
|
|
8
|
-
{{#each (array "active" "archived" "all") as |category|}}
|
|
9
|
-
<UkButton
|
|
10
|
-
data-test-filter={{category}}
|
|
11
|
-
@on-click={{fn this.setFilter "category" category}}
|
|
12
|
-
@label={{t (concat "caluma.form-builder.form." category)}}
|
|
13
|
-
@class={{if (eq this.category category) "uk-button-primary" ""}}
|
|
14
|
-
/>
|
|
15
|
-
{{/each}}
|
|
16
|
-
</div>
|
|
17
|
-
<div>
|
|
1
|
+
<div class="uk-flex uk-flex-between">
|
|
2
|
+
<div class="uk-button-group">
|
|
3
|
+
{{#each (array "active" "archived" "all") as |category|}}
|
|
18
4
|
<UkButton
|
|
19
|
-
data-test-
|
|
20
|
-
@
|
|
21
|
-
@label={{t "caluma.form-builder.form.
|
|
5
|
+
data-test-filter={{category}}
|
|
6
|
+
@onClick={{fn (perform this.setFilter) "category" category}}
|
|
7
|
+
@label={{t (concat "caluma.form-builder.form." category)}}
|
|
8
|
+
@class={{if (eq this.category category) "uk-button-primary" ""}}
|
|
22
9
|
/>
|
|
23
|
-
|
|
10
|
+
{{/each}}
|
|
24
11
|
</div>
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
<input
|
|
31
|
-
data-test-form-search-input
|
|
32
|
-
class="uk-search-input"
|
|
33
|
-
type="search"
|
|
34
|
-
placeholder="{{t 'caluma.form-builder.global.search'}}..."
|
|
35
|
-
aria-label="{{t 'caluma.form-builder.global.search'}}"
|
|
36
|
-
value={{this.search}}
|
|
37
|
-
{{on "input" (fn this.setFilter "search")}}
|
|
12
|
+
<div>
|
|
13
|
+
<UkButton
|
|
14
|
+
data-test-new-form
|
|
15
|
+
@onClick={{optional @onNewForm}}
|
|
16
|
+
@label={{t "caluma.form-builder.form.new"}}
|
|
38
17
|
/>
|
|
39
|
-
</
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
</
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<div class="uk-search uk-search-default uk-width-1-1 uk-margin-top">
|
|
22
|
+
<span class="uk-search-icon-flip" uk-search-icon></span>
|
|
23
|
+
<input
|
|
24
|
+
data-test-form-search-input
|
|
25
|
+
class="uk-search-input"
|
|
26
|
+
type="search"
|
|
27
|
+
placeholder="{{t 'caluma.form-builder.global.search'}}..."
|
|
28
|
+
aria-label="{{t 'caluma.form-builder.global.search'}}"
|
|
29
|
+
value={{this.search}}
|
|
30
|
+
{{on "input" (fn (perform this.setFilter) "search")}}
|
|
31
|
+
/>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
{{#if this.formsQuery.value.length}}
|
|
35
|
+
<ul data-test-form-list class="uk-list uk-list-divider uk-list-large">
|
|
36
|
+
{{#each this.formsQuery.value key="id" as |item|}}
|
|
37
|
+
<CfbFormList::Item
|
|
38
|
+
data-test-form-list-item={{item.slug}}
|
|
39
|
+
@item={{item}}
|
|
40
|
+
@onEditForm={{@onEditForm}}
|
|
41
|
+
/>
|
|
42
|
+
{{/each}}
|
|
43
|
+
{{#if this.formsQuery.isLoading}}
|
|
44
|
+
<li class="uk-text-center">
|
|
45
|
+
<UkSpinner />
|
|
46
|
+
</li>
|
|
47
|
+
{{else if this.formsQuery.hasNextPage}}
|
|
48
|
+
<li class="uk-text-center cfb-pointer">
|
|
49
|
+
<a
|
|
50
|
+
data-test-form-loader-button
|
|
51
|
+
href="#"
|
|
52
|
+
{{on "click" this.formsQuery.fetchMore}}
|
|
53
|
+
>
|
|
54
|
+
{{t "caluma.form-builder.form.loadMore"}}
|
|
55
|
+
</a>
|
|
56
|
+
</li>
|
|
57
|
+
{{/if}}
|
|
58
|
+
</ul>
|
|
59
|
+
{{else if this.formsQuery.isLoading}}
|
|
60
|
+
<div class="uk-height-small uk-flex uk-flex-center uk-flex-middle">
|
|
61
|
+
<UkSpinner @ratio={{2}} />
|
|
62
|
+
</div>
|
|
63
|
+
{{else}}
|
|
64
|
+
<div
|
|
65
|
+
data-test-form-list-empty
|
|
66
|
+
class="uk-padding-large uk-padding-remove-horizontal uk-text-center"
|
|
67
|
+
>
|
|
68
|
+
<UkIcon @icon="search" @ratio={{10}} />
|
|
69
|
+
<p class="uk-text-muted">
|
|
70
|
+
{{t "caluma.form-builder.form.empty"}}
|
|
71
|
+
</p>
|
|
72
|
+
</div>
|
|
73
|
+
{{/if}}
|